Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isaacs/node-tar
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 843c897e6844f70a34bb115df6c8a9b60112aaf5
Choose a base ref
...
head repository: isaacs/node-tar
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bf693837b3dcfeb76878b212310302dc5dc3d3dc
Choose a head ref

Commits on Sep 13, 2019

  1. update tap and minizlib deps

    isaacs committed Sep 13, 2019
    Copy the full SHA
    024e288 View commit details
  2. basic path reservation system

    This is going to be used to avoid harmful race conditions in parallel
    extraction operations.
    
    For example, a Link to a/b requires that the File at a/b is present.
    But, if they are run in parallel, then the File might not be written
    before the Link tries to create, and it'll fail with ENOENT.
    
    This gets worse if there's a Directory at a/b/c that unlinks the File so
    that it can create a dir.
    isaacs committed Sep 13, 2019
    Copy the full SHA
    6cb8cbc View commit details
  3. Address unpack race conditions using path reservations

    This addresses a race condition where one archive entry depends on an
    earlier archive entry completing its unpack operation.
    
    For example, a File entry followed by a Link to that file would fail if
    the File was not written before the link() call was attempted, raising
    an ENOENT.
    
    Or, a File entry at a/b could be clobbered mid-write by an entry at
    a/b/c.
    
    This was never a problem for npm packages, because those tarballs are
    created as a point-in-time snapshot of the package file tree.  Indeed,
    even in the generic case, it's a bit of an edge case.  However, this
    race condition led to some flaky tests, and could certainly be a problem
    in general tar archive usage, especially if someone were to use
    tar.update() often to append entries to an archive.
    isaacs committed Sep 13, 2019
    Copy the full SHA
    74fc5de View commit details
  4. Change large-numbers errors from TypeError to Error

    They're not technically TypeErrors, because the argument is of the
    correct _type_, just out of the acceptable range.
    isaacs committed Sep 13, 2019
    Copy the full SHA
    3905fed View commit details
  5. Add TAR_* error codes

    This adds error codes to all of the warnings emitted by tar operations,
    tests for several error conditions, and handling for errors raised by
    close(2).
    
    BREAKING CHANGES:
    - The `warn` event now emits with 3 arguments (code, message, data)
      rather than 2 (message, data).
    - The `data` argument to the warn event handler is always an object,
      (either an Error or a plain old JavaScript object) rather than
      sometimes being a string or undefined.
    - Failures from `fs.close()` are tracked and emitted.
    isaacs committed Sep 13, 2019
    Copy the full SHA
    0c757d5 View commit details
  6. add CODEOWNERS file

    isaacs committed Sep 13, 2019
    1
    Copy the full SHA
    76d8a40 View commit details

Commits on Sep 17, 2019

  1. do not treat ignored entries as an invalid archive

    They're valid tar, just not tar we care about.
    isaacs committed Sep 17, 2019
    Copy the full SHA
    825e199 View commit details
  2. unpack test: move warning count assertion below content

    So I can see what the warnings are in --bail mode when they fail.
    isaacs committed Sep 17, 2019
    Copy the full SHA
    f8b9f79 View commit details
  3. unpack: keep path reservations longer

    This avoids races when entries are zero-length, and emit end()
    before the fs object is fully finished and closed.
    isaacs committed Sep 17, 2019
    Copy the full SHA
    95f2ae4 View commit details
  4. Copy the full SHA
    705ad46 View commit details

Commits on Sep 25, 2019

  1. minipass@2.9.0

    isaacs committed Sep 25, 2019
    Copy the full SHA
    191eca3 View commit details
  2. update tap

    isaacs committed Sep 25, 2019
    Copy the full SHA
    2e2c0f0 View commit details
  3. update chownr

    isaacs committed Sep 25, 2019
    Copy the full SHA
    8cf9aa7 View commit details
  4. Copy the full SHA
    0b0a993 View commit details
  5. update dev deps

    isaacs committed Sep 25, 2019
    Copy the full SHA
    7dd8884 View commit details
  6. 5.0.0

    isaacs committed Sep 25, 2019
    Copy the full SHA
    7bc7c20 View commit details
  7. Merge branch 'v5'

    Typically we don't do merge commits on this library, but in this case,
    some bugfix patches were already landed on v4, which aren't relevant or
    necessary on the v5 codebase, prior to v5 being released.  A merge
    commit is the cleanest way to do this without having to roll back the
    publish or break the continuity of the default branch.
    isaacs committed Sep 25, 2019
    Copy the full SHA
    eea7dd7 View commit details

Commits on Sep 26, 2019

  1. unpack: conditionally use a file mapping to write files

    Use a file mapping to write files up to 512KB. The limit where using
    a file mapping stops being an advantage varies from machine to
    machine. 512KB is a reasonable value to use here, close to the lower
    bound, to avoid tar becoming slower in some machines.
    
    PR-URL: #230
    Credit: @joaocgreis
    Close: #230
    Reviewed-by: @isaacs
    joaocgreis authored and isaacs committed Sep 26, 2019
    Copy the full SHA
    150da0e View commit details
  2. 1
    Copy the full SHA
    97f813a View commit details
  3. 5.0.1

    isaacs committed Sep 26, 2019
    Copy the full SHA
    14dc6f4 View commit details
  4. get-write-flag: don't test invariants

    If we're not on windows, or don't have fmap support,
    then just make this be a function that always returns 'w'.
    
    If it is windows, and has fmap support, only test the size.
    isaacs committed Sep 26, 2019
    Copy the full SHA
    82cb0f1 View commit details
  5. update minizlib

    Adds support for Brotli, which we don't use, but also removes a lot of
    extraneous range-checking code.
    isaacs committed Sep 26, 2019
    Copy the full SHA
    0973296 View commit details

Commits on Sep 30, 2019

  1. update all minipass deps

    isaacs committed Sep 30, 2019
    Copy the full SHA
    a74c6fb View commit details
  2. 5.0.2

    isaacs committed Sep 30, 2019
    Copy the full SHA
    a2f8899 View commit details

Commits on Oct 5, 2019

  1. Set more portable 'mode' value in portable mode

    Fix #235
    
    The `mode` value in `portable` mode will be set to a reasonable default
    across Unix systems.
    
    First, the user must always have read and write permissions.  (Ie, a
    mode of 0o044 becomes 0o644.)
    
    Next, the mode is masked against 0o022.  (Ie, a file of 0o777 becomes
    0o755.  0o666 becomes 0o644.)
    
    In practice, this means that all entries will usually have a mode of
    either 0644 or 0o755, depending on whether the executable bit was set.
    
    This avoids a situation where an archive created on a system with a
    umask of 0o2 creates an archive with files having modes 0o775 and 0o664,
    whereas an archive created on a system with a umask of 0o22 creates an
    archive with files having modes 0o755 and 0o644, for the same content.
    (Especially, for a check-out of the same git repository.)  Without this
    consistency, it's impossible to honor the contract that the same content
    will produce the same archive, which is necessary for npm to create
    reprodicible build artifacts that match both in CI and development.
    
    This unfortunately still does not address windows, where the executable
    bit is never set on files.  (This bit the mocha project when a publish
    from a Windows machine did not archive binaries with executable flags
    set: #210 (comment))
    isaacs committed Oct 5, 2019
    Copy the full SHA
    5e8dfa4 View commit details
  2. 5.0.3

    isaacs committed Oct 5, 2019
    Copy the full SHA
    16d07b2 View commit details
  3. Copy the full SHA
    48e5716 View commit details
  4. 5.0.4

    isaacs committed Oct 5, 2019
    Copy the full SHA
    58668c6 View commit details
  5. update minizlib

    isaacs committed Oct 5, 2019
    Copy the full SHA
    c517cc3 View commit details
  6. mock out get-write-flag on nodes where filemap is known

    Can't overwrite or modify a constant, they're very... constant.
    isaacs committed Oct 5, 2019
    Copy the full SHA
    d061ff0 View commit details
  7. Copy the full SHA
    cc0b415 View commit details
  8. 5.0.5

    isaacs committed Oct 5, 2019
    Copy the full SHA
    114efef View commit details

Commits on Nov 20, 2019

  1. Copy the full SHA
    2c9d359 View commit details

Commits on Jan 28, 2020

  1. use mkdirp v1

    isaacs committed Jan 28, 2020
    Copy the full SHA
    eeb8649 View commit details
  2. 6.0.0

    isaacs committed Jan 28, 2020
    Copy the full SHA
    a069020 View commit details

Commits on Jan 29, 2020

  1. Replace \ with / in linkpath field

    Fix: #241
    isaacs committed Jan 29, 2020
    Copy the full SHA
    01cdaaa View commit details
  2. Copy the full SHA
    d242054 View commit details
  3. 6.0.1

    isaacs committed Jan 29, 2020
    Copy the full SHA
    97a74cd View commit details
  4. add a log of changes

    fix #113
    isaacs committed Jan 29, 2020
    Copy the full SHA
    f9555dd View commit details
  5. ignore more stuff

    isaacs committed Jan 29, 2020
    Copy the full SHA
    731a648 View commit details

Commits on Feb 27, 2020

  1. Copy the full SHA
    0691c4f View commit details

Commits on Apr 27, 2020

  1. update chownr to 2.0.0

    isaacs committed Apr 27, 2020
    Copy the full SHA
    b074ac8 View commit details
  2. 6.0.2

    isaacs committed Apr 27, 2020
    Copy the full SHA
    0a55ace View commit details

Commits on May 26, 2020

  1. Fix typo

    razzeee authored and ruyadorno committed May 26, 2020
    Copy the full SHA
    8b605d7 View commit details

Commits on Aug 14, 2020

  1. Fix typo in README.md

    isker authored and ruyadorno committed Aug 14, 2020
    Copy the full SHA
    e20912c View commit details
  2. Copy the full SHA
    b113315 View commit details
  3. 6.0.3

    isaacs committed Aug 14, 2020
    Copy the full SHA
    f5e6cf6 View commit details
  4. Copy the full SHA
    aeda9bf View commit details
  5. 6.0.4

    isaacs committed Aug 14, 2020
    Copy the full SHA
    e8fcd63 View commit details
  6. update minizlib

    isaacs committed Aug 14, 2020
    Copy the full SHA
    7b3b217 View commit details
Showing with 12,684 additions and 3,349 deletions.
  1. +207 −0 .eslintrc.json
  2. +1 −0 .gitattributes
  3. +1 −0 .github/CODEOWNERS
  4. +2 −0 .github/settings.yml
  5. +49 −0 .github/workflows/ci.yml
  6. +71 −0 .github/workflows/codeql-analysis.yml
  7. +27 −3 .gitignore
  8. +0 −18 .travis.yml
  9. +68 −0 CHANGELOG.md
  10. +145 −57 README.md
  11. +0 −11 lib/buffer.js
  12. +9 −10 lib/create.js
  13. +11 −16 lib/extract.js
  14. +20 −0 lib/get-write-flag.js
  15. +13 −14 lib/header.js
  16. +3 −3 lib/high-level-opt.js
  17. +19 −17 lib/large-numbers.js
  18. +16 −14 lib/list.js
  19. +11 −11 lib/mkdir.js
  20. +10 −1 lib/mode-fix.js
  21. +19 −16 lib/pack.js
  22. +115 −62 lib/parse.js
  23. +125 −0 lib/path-reservations.js
  24. +5 −8 lib/pax.js
  25. +5 −4 lib/read-entry.js
  26. +18 −16 lib/replace.js
  27. +14 −0 lib/strip-absolute-path.js
  28. +24 −0 lib/strip-trailing-slashes.js
  29. +1 −1 lib/types.js
  30. +144 −61 lib/unpack.js
  31. +1 −1 lib/update.js
  32. +17 −10 lib/warn-mixin.js
  33. +2 −2 lib/winchars.js
  34. +61 −45 lib/write-entry.js
  35. +9,885 −1,465 package-lock.json
  36. +22 −14 package.json
  37. +6 −2 scripts/generate-parse-fixtures.js
  38. +33 −31 test/create.js
  39. +18 −21 test/extract.js
  40. +5 −3 test/fixtures/parse/bad-cksum--filter-strict.json
  41. +5 −3 test/fixtures/parse/bad-cksum--filter.json
  42. +5 −3 test/fixtures/parse/bad-cksum--meta-250-filter-strict.json
  43. +5 −3 test/fixtures/parse/bad-cksum--meta-250-filter.json
  44. +5 −3 test/fixtures/parse/bad-cksum--meta-250-strict.json
  45. +5 −3 test/fixtures/parse/bad-cksum--meta-250.json
  46. +5 −3 test/fixtures/parse/bad-cksum--strict.json
  47. +5 −3 test/fixtures/parse/bad-cksum.json
  48. +1 −1 test/fixtures/parse/body-byte-counts--filter-strict.json
  49. +1 −1 test/fixtures/parse/body-byte-counts--filter.json
  50. +1 −1 test/fixtures/parse/body-byte-counts--meta-250-filter-strict.json
  51. +1 −1 test/fixtures/parse/body-byte-counts--meta-250-filter.json
  52. +1 −1 test/fixtures/parse/body-byte-counts--meta-250-strict.json
  53. +1 −1 test/fixtures/parse/body-byte-counts--meta-250.json
  54. +1 −1 test/fixtures/parse/body-byte-counts--strict.json
  55. +1 −1 test/fixtures/parse/body-byte-counts.json
  56. +1 −1 test/fixtures/parse/dir--filter-strict.json
  57. +1 −1 test/fixtures/parse/dir--filter.json
  58. +1 −1 test/fixtures/parse/dir--meta-250-filter-strict.json
  59. +1 −1 test/fixtures/parse/dir--meta-250-filter.json
  60. +1 −1 test/fixtures/parse/dir--meta-250-strict.json
  61. +1 −1 test/fixtures/parse/dir--meta-250.json
  62. +1 −1 test/fixtures/parse/dir--strict.json
  63. +1 −1 test/fixtures/parse/dir.json
  64. +1 −1 test/fixtures/parse/emptypax--filter-strict.json
  65. +1 −1 test/fixtures/parse/emptypax--filter.json
  66. +1 −1 test/fixtures/parse/emptypax--meta-250-filter-strict.json
  67. +1 −1 test/fixtures/parse/emptypax--meta-250-filter.json
  68. +1 −1 test/fixtures/parse/emptypax--meta-250-strict.json
  69. +1 −1 test/fixtures/parse/emptypax--meta-250.json
  70. +1 −1 test/fixtures/parse/emptypax--strict.json
  71. +1 −1 test/fixtures/parse/emptypax.json
  72. +1 −1 test/fixtures/parse/file--filter-strict.json
  73. +1 −1 test/fixtures/parse/file--filter.json
  74. +1 −1 test/fixtures/parse/file--meta-250-filter-strict.json
  75. +1 −1 test/fixtures/parse/file--meta-250-filter.json
  76. +1 −1 test/fixtures/parse/file--meta-250-strict.json
  77. +1 −1 test/fixtures/parse/file--meta-250.json
  78. +1 −1 test/fixtures/parse/file--strict.json
  79. +1 −1 test/fixtures/parse/file.json
  80. +1 −1 test/fixtures/parse/global-header--filter-strict.json
  81. +1 −1 test/fixtures/parse/global-header--filter.json
  82. +1 −1 test/fixtures/parse/global-header--meta-250-filter-strict.json
  83. +1 −1 test/fixtures/parse/global-header--meta-250-filter.json
  84. +1 −1 test/fixtures/parse/global-header--meta-250-strict.json
  85. +1 −1 test/fixtures/parse/global-header--meta-250.json
  86. +1 −1 test/fixtures/parse/global-header--strict.json
  87. +1 −1 test/fixtures/parse/global-header.json
  88. +1 −1 test/fixtures/parse/links--filter-strict.json
  89. +1 −1 test/fixtures/parse/links--filter.json
  90. +1 −1 test/fixtures/parse/links--meta-250-filter-strict.json
  91. +1 −1 test/fixtures/parse/links--meta-250-filter.json
  92. +1 −1 test/fixtures/parse/links--meta-250-strict.json
  93. +1 −1 test/fixtures/parse/links--meta-250.json
  94. +1 −1 test/fixtures/parse/links--strict.json
  95. +7 −4 test/fixtures/parse/links-invalid--filter-strict.json
  96. +7 −4 test/fixtures/parse/links-invalid--filter.json
  97. +7 −4 test/fixtures/parse/links-invalid--meta-250-filter-strict.json
  98. +7 −4 test/fixtures/parse/links-invalid--meta-250-filter.json
  99. +7 −4 test/fixtures/parse/links-invalid--meta-250-strict.json
  100. +7 −4 test/fixtures/parse/links-invalid--meta-250.json
  101. +7 −4 test/fixtures/parse/links-invalid--strict.json
  102. +7 −4 test/fixtures/parse/links-invalid.json
  103. +1 −1 test/fixtures/parse/links.json
  104. +1 −1 test/fixtures/parse/long-paths--filter-strict.json
  105. +1 −1 test/fixtures/parse/long-paths--filter.json
  106. +1 −1 test/fixtures/parse/long-paths--meta-250-filter-strict.json
  107. +1 −1 test/fixtures/parse/long-paths--meta-250-filter.json
  108. +1 −1 test/fixtures/parse/long-paths--meta-250-strict.json
  109. +1 −1 test/fixtures/parse/long-paths--meta-250.json
  110. +1 −1 test/fixtures/parse/long-paths--strict.json
  111. +1 −1 test/fixtures/parse/long-paths.json
  112. +1 −1 test/fixtures/parse/next-file-has-long--filter-strict.json
  113. +1 −1 test/fixtures/parse/next-file-has-long--filter.json
  114. +1 −1 test/fixtures/parse/next-file-has-long--meta-250-filter-strict.json
  115. +1 −1 test/fixtures/parse/next-file-has-long--meta-250-filter.json
  116. +1 −1 test/fixtures/parse/next-file-has-long--meta-250-strict.json
  117. +1 −1 test/fixtures/parse/next-file-has-long--meta-250.json
  118. +1 −1 test/fixtures/parse/next-file-has-long--strict.json
  119. +1 −1 test/fixtures/parse/next-file-has-long.json
  120. +1 −40 test/fixtures/parse/null-byte--filter-strict.json
  121. +1 −40 test/fixtures/parse/null-byte--filter.json
  122. +1 −40 test/fixtures/parse/null-byte--meta-250-filter-strict.json
  123. +1 −40 test/fixtures/parse/null-byte--meta-250-filter.json
  124. +1 −40 test/fixtures/parse/null-byte--meta-250-strict.json
  125. +1 −40 test/fixtures/parse/null-byte--meta-250.json
  126. +1 −40 test/fixtures/parse/null-byte--strict.json
  127. +1 −40 test/fixtures/parse/null-byte.json
  128. +12 −3 test/fixtures/parse/path-missing--filter-strict.json
  129. +10 −3 test/fixtures/parse/path-missing--filter.json
  130. +12 −3 test/fixtures/parse/path-missing--meta-250-filter-strict.json
  131. +10 −3 test/fixtures/parse/path-missing--meta-250-filter.json
  132. +12 −3 test/fixtures/parse/path-missing--meta-250-strict.json
  133. +10 −3 test/fixtures/parse/path-missing--meta-250.json
  134. +12 −3 test/fixtures/parse/path-missing--strict.json
  135. +10 −3 test/fixtures/parse/path-missing.json
  136. +1 −22 test/fixtures/parse/trailing-slash-corner-case--filter-strict.json
  137. +1 −22 test/fixtures/parse/trailing-slash-corner-case--filter.json
  138. +1 −22 test/fixtures/parse/trailing-slash-corner-case--meta-250-filter-strict.json
  139. +1 −22 test/fixtures/parse/trailing-slash-corner-case--meta-250-filter.json
  140. +1 −22 test/fixtures/parse/trailing-slash-corner-case--meta-250-strict.json
  141. +1 −22 test/fixtures/parse/trailing-slash-corner-case--meta-250.json
  142. +1 −22 test/fixtures/parse/trailing-slash-corner-case--strict.json
  143. +1 −22 test/fixtures/parse/trailing-slash-corner-case.json
  144. +1 −1 test/fixtures/parse/utf8--filter-strict.json
  145. +1 −1 test/fixtures/parse/utf8--filter.json
  146. +1 −1 test/fixtures/parse/utf8--meta-250-filter-strict.json
  147. +1 −1 test/fixtures/parse/utf8--meta-250-filter.json
  148. +1 −1 test/fixtures/parse/utf8--meta-250-strict.json
  149. +1 −1 test/fixtures/parse/utf8--meta-250.json
  150. +1 −1 test/fixtures/parse/utf8--strict.json
  151. +1 −1 test/fixtures/parse/utf8.json
  152. +64 −0 test/get-write-flag.js
  153. +22 −23 test/header.js
  154. +4 −4 test/high-level-opt.js
  155. +1 −1 test/index.js
  156. +10 −12 test/large-numbers.js
  157. +23 −26 test/list.js
  158. +0 −1 test/make-tar.js
  159. +11 −4 test/mode-fix.js
  160. +136 −133 test/pack.js
  161. +159 −102 test/parse.js
  162. +56 −0 test/path-reservations.js
  163. +7 −9 test/pax.js
  164. +12 −13 test/read-entry.js
  165. +33 −34 test/replace.js
  166. +14 −0 test/strip-absolute-path.js
  167. +7 −0 test/strip-trailing-slashes.js
  168. +484 −276 test/unpack.js
  169. +18 −22 test/update.js
  170. +23 −5 test/warn-mixin.js
  171. +130 −102 test/write-entry.js
207 changes: 207 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
{
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {},
"sourceType": "script"
},

"env": {
"es6": true,
"node": true
},

"plugins": [
"import",
"node",
"promise",
"standard"
],

"globals": {
"document": "readonly",
"navigator": "readonly",
"window": "readonly"
},

"rules": {
"accessor-pairs": "error",
"array-bracket-spacing": ["error", "never"],
"arrow-spacing": ["error", { "before": true, "after": true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
"camelcase": ["error", { "properties": "never" }],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"constructor-super": "error",
"curly": ["error", "multi-or-nest"],
"dot-location": ["error", "property"],
"dot-notation": ["error", { "allowKeywords": true }],
"eol-last": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"func-call-spacing": ["error", "never"],
"generator-star-spacing": ["error", { "before": true, "after": true }],
"handle-callback-err": ["error", "^(err|error)$" ],
"indent": ["error", 2, {
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"MemberExpression": 1,
"FunctionDeclaration": { "parameters": 1, "body": 1 },
"FunctionExpression": { "parameters": 1, "body": 1 },
"CallExpression": { "arguments": 1 },
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": true,
"ignoreComments": false,
"ignoredNodes": ["TemplateLiteral *"]
}],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }],
"new-parens": "error",
"no-array-constructor": "error",
"no-async-promise-executor": "error",
"no-caller": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "off",
"no-const-assign": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-boolean-cast": "error",
"no-extra-parens": ["error", "functions"],
"no-fallthrough": "off",
"no-floating-decimal": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-inner-declarations": ["error", "functions"],
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-labels": ["error", { "allowLoop": true, "allowSwitch": false }],
"no-lone-blocks": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-useless-catch": "error",
"no-mixed-operators": "off",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"no-negated-in-lhs": "error",
"no-new": "off",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-path-concat": "error",
"no-proto": "error",
"no-redeclare": ["error", { "builtinGlobals": false }],
"no-regex-spaces": "error",
"no-return-assign": "off",
"no-self-assign": "off",
"no-self-compare": "error",
"no-sequences": "off",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-tabs": "error",
"no-template-curly-in-string": "error",
"no-this-before-super": "error",
"no-throw-literal": "off",
"no-trailing-spaces": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-unexpected-multiline": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-unreachable": "error",
"no-unsafe-finally": 0,
"no-unsafe-negation": "error",
"no-unused-expressions": ["off"],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-escape": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-void": "error",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": [2, "below"],
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
"one-var": ["error", { "initialized": "never" }],
"operator-linebreak": "off",
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
"prefer-const": ["error", {"destructuring": "all"}],
"prefer-promise-reject-errors": "error",
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"rest-spread-spacing": ["error", "never"],
"semi": ["error", "never"],
"semi-spacing": ["error", { "before": false, "after": true }],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"spaced-comment": ["error", "always", {
"line": { "markers": ["*package", "!", "/", ",", "="] },
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
}],
"symbol-description": "error",
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
"unicode-bom": ["error", "never"],
"use-isnan": "error",
"valid-typeof": ["error", { "requireStringLiterals": true }],
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
"yield-star-spacing": ["error", "both"],
"yoda": ["error", "never"],

"import/export": "error",
"import/first": "error",
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
"import/no-duplicates": "error",
"import/no-named-default": "error",
"import/no-webpack-loader-syntax": "error",

"node/no-deprecated-api": "error",
"node/process-exit-as-throw": "error",

"promise/param-names": "off",

"standard/no-callback-literal": "error"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/fixtures/files/** text eol=lf
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @npm/cli-team
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
_extends: 'open-source-project-boilerplate'
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
platform:
- os: ubuntu-latest
shell: bash
- os: macos-latest
shell: bash

# TODO: make tests pass on windows. it works, but the tests have
# quite a lot of unixisms wrt modes and paths. mostly trivial
# stuff to fix, but a lot of it.
#
# - os: windows-latest
# shell: bash
# - os: windows-latest
# shell: powershell

fail-fast: false

runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}

steps:
# there are files here that make windows unhappy by default
- name: Support longpaths
run: git config --global core.longpaths true

- name: Checkout Repository
uses: actions/checkout@v1.1.0

- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run Tap Tests
run: npm test -- -c -t0
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '27 20 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
30 changes: 27 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# ignore most things, include some others
/*
/.*

!bin/
!lib/
!docs/
!package.json
!package-lock.json
!README.md
!CONTRIBUTING.md
!LICENSE
!CHANGELOG.md
!example/
!scripts/
!tap-snapshots/
!test/
!.travis.yml
!.gitignore
!.gitattributes
!map.js
!index.js
!.github
!.eslintrc.json

.*.swp
node_modules
.nyc_output/
coverage/
node_modules/
test/fixtures/unpack
!benchmarks/
benchmarks/extract/cwd
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

Loading