fsevents 1.2.3 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fsevents might be problematic. Click here for more details.

Files changed (208) hide show
  1. package/.travis.yml +2 -3
  2. package/fsevents.cc +14 -26
  3. package/node_modules/abbrev/package.json +13 -14
  4. package/node_modules/ansi-regex/package.json +13 -14
  5. package/node_modules/aproba/package.json +13 -14
  6. package/node_modules/are-we-there-yet/CHANGES.md +6 -0
  7. package/node_modules/are-we-there-yet/package.json +19 -20
  8. package/node_modules/are-we-there-yet/tracker-stream.js +1 -0
  9. package/node_modules/balanced-match/package.json +13 -14
  10. package/node_modules/brace-expansion/package.json +13 -14
  11. package/node_modules/chownr/chownr.js +113 -40
  12. package/node_modules/chownr/package.json +22 -20
  13. package/node_modules/code-point-at/package.json +13 -14
  14. package/node_modules/concat-map/package.json +8 -9
  15. package/node_modules/console-control-strings/package.json +14 -14
  16. package/node_modules/core-util-is/package.json +13 -14
  17. package/node_modules/debug/CHANGELOG.md +34 -1
  18. package/node_modules/debug/README.md +188 -63
  19. package/node_modules/debug/dist/debug.js +886 -0
  20. package/node_modules/debug/package.json +34 -33
  21. package/node_modules/debug/src/browser.js +77 -82
  22. package/node_modules/debug/src/common.js +249 -0
  23. package/node_modules/debug/src/index.js +5 -3
  24. package/node_modules/debug/src/node.js +72 -146
  25. package/node_modules/deep-extend/CHANGELOG.md +28 -3
  26. package/node_modules/deep-extend/LICENSE +1 -1
  27. package/node_modules/deep-extend/README.md +2 -1
  28. package/node_modules/deep-extend/lib/deep-extend.js +11 -5
  29. package/node_modules/deep-extend/package.json +26 -28
  30. package/node_modules/delegates/package.json +13 -14
  31. package/node_modules/detect-libc/package.json +13 -14
  32. package/node_modules/fs-minipass/index.js +2 -1
  33. package/node_modules/fs-minipass/package.json +24 -22
  34. package/node_modules/fs.realpath/package.json +13 -14
  35. package/node_modules/gauge/package.json +13 -14
  36. package/node_modules/glob/LICENSE +6 -0
  37. package/node_modules/glob/README.md +8 -1
  38. package/node_modules/glob/package.json +21 -19
  39. package/node_modules/has-unicode/package.json +13 -14
  40. package/node_modules/iconv-lite/Changelog.md +16 -0
  41. package/node_modules/iconv-lite/encodings/sbcs-codec.js +2 -2
  42. package/node_modules/iconv-lite/encodings/sbcs-data.js +5 -0
  43. package/node_modules/iconv-lite/lib/extend-node.js +1 -1
  44. package/node_modules/iconv-lite/lib/index.d.ts +2 -2
  45. package/node_modules/iconv-lite/package.json +19 -20
  46. package/node_modules/ignore-walk/README.md +1 -1
  47. package/node_modules/ignore-walk/index.js +9 -5
  48. package/node_modules/ignore-walk/package.json +22 -20
  49. package/node_modules/inflight/package.json +13 -14
  50. package/node_modules/inherits/inherits.js +2 -0
  51. package/node_modules/inherits/inherits_browser.js +18 -14
  52. package/node_modules/inherits/package.json +20 -20
  53. package/node_modules/ini/package.json +13 -14
  54. package/node_modules/is-fullwidth-code-point/package.json +13 -14
  55. package/node_modules/isarray/package.json +13 -14
  56. package/node_modules/minimatch/package.json +14 -14
  57. package/node_modules/minimist/package.json +8 -9
  58. package/node_modules/minipass/LICENSE +15 -0
  59. package/node_modules/minipass/README.md +567 -7
  60. package/node_modules/minipass/index.js +255 -22
  61. package/node_modules/minipass/package.json +26 -22
  62. package/node_modules/minizlib/README.md +36 -27
  63. package/node_modules/minizlib/constants.js +73 -4
  64. package/node_modules/minizlib/index.js +188 -232
  65. package/node_modules/minizlib/package.json +19 -20
  66. package/node_modules/mkdirp/package.json +14 -14
  67. package/node_modules/ms/index.js +29 -19
  68. package/node_modules/ms/package.json +22 -23
  69. package/node_modules/ms/readme.md +18 -9
  70. package/node_modules/needle/README.md +3 -3
  71. package/node_modules/needle/examples/multipart-stream.js +1 -1
  72. package/node_modules/needle/lib/auth.js +1 -1
  73. package/node_modules/needle/lib/cookies.js +12 -10
  74. package/node_modules/needle/lib/multipart.js +1 -1
  75. package/node_modules/needle/lib/needle.js +20 -6
  76. package/node_modules/needle/package.json +26 -27
  77. package/node_modules/needle/test/basic_auth_spec.js +1 -1
  78. package/node_modules/needle/test/cookies_spec.js +2 -2
  79. package/node_modules/needle/test/errors_spec.js +4 -4
  80. package/node_modules/needle/test/headers_spec.js +1 -1
  81. package/node_modules/needle/test/long_string_spec.js +1 -1
  82. package/node_modules/needle/test/output_spec.js +1 -1
  83. package/node_modules/needle/test/post_data_spec.js +20 -20
  84. package/node_modules/needle/test/proxy_spec.js +1 -1
  85. package/node_modules/needle/test/url_spec.js +11 -3
  86. package/node_modules/needle/test/utils/test.js +1 -1
  87. package/node_modules/node-pre-gyp/CHANGELOG.md +34 -3
  88. package/node_modules/node-pre-gyp/README.md +53 -21
  89. package/node_modules/node-pre-gyp/appveyor.yml +2 -9
  90. package/node_modules/node-pre-gyp/contributing.md +2 -2
  91. package/node_modules/node-pre-gyp/lib/build.js +1 -1
  92. package/node_modules/node-pre-gyp/lib/install.js +46 -12
  93. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
  94. package/node_modules/node-pre-gyp/lib/package.js +5 -2
  95. package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
  96. package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
  97. package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
  98. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +148 -0
  99. package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
  100. package/node_modules/node-pre-gyp/lib/util/napi.js +70 -22
  101. package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
  102. package/node_modules/node-pre-gyp/package.json +16 -20
  103. package/node_modules/nopt/package.json +13 -14
  104. package/node_modules/npm-bundled/LICENSE +15 -0
  105. package/node_modules/npm-bundled/README.md +2 -0
  106. package/node_modules/npm-bundled/index.js +29 -7
  107. package/node_modules/npm-bundled/package.json +21 -19
  108. package/node_modules/npm-normalize-package-bin/.github/settings.yml +2 -0
  109. package/node_modules/npm-normalize-package-bin/.npmignore +24 -0
  110. package/node_modules/npm-normalize-package-bin/LICENSE +15 -0
  111. package/node_modules/npm-normalize-package-bin/README.md +14 -0
  112. package/node_modules/npm-normalize-package-bin/index.js +60 -0
  113. package/node_modules/npm-normalize-package-bin/package-lock.json +3529 -0
  114. package/node_modules/npm-normalize-package-bin/package.json +57 -0
  115. package/node_modules/npm-normalize-package-bin/test/array.js +37 -0
  116. package/node_modules/npm-normalize-package-bin/test/nobin.js +35 -0
  117. package/node_modules/npm-normalize-package-bin/test/object.js +141 -0
  118. package/node_modules/npm-normalize-package-bin/test/string.js +37 -0
  119. package/node_modules/npm-packlist/index.js +90 -21
  120. package/node_modules/npm-packlist/package.json +27 -21
  121. package/node_modules/npmlog/package.json +13 -14
  122. package/node_modules/number-is-nan/package.json +13 -14
  123. package/node_modules/object-assign/package.json +13 -14
  124. package/node_modules/once/package.json +14 -14
  125. package/node_modules/os-homedir/package.json +13 -14
  126. package/node_modules/os-tmpdir/package.json +13 -14
  127. package/node_modules/osenv/package.json +13 -14
  128. package/node_modules/path-is-absolute/package.json +13 -14
  129. package/node_modules/process-nextick-args/index.js +2 -1
  130. package/node_modules/process-nextick-args/package.json +17 -18
  131. package/node_modules/rc/node_modules/minimist/package.json +13 -14
  132. package/node_modules/rc/package.json +18 -19
  133. package/node_modules/readable-stream/package.json +13 -14
  134. package/node_modules/rimraf/package.json +22 -20
  135. package/node_modules/rimraf/rimraf.js +9 -1
  136. package/node_modules/safe-buffer/index.d.ts +187 -0
  137. package/node_modules/safe-buffer/package.json +23 -21
  138. package/node_modules/safer-buffer/package.json +13 -14
  139. package/node_modules/sax/package.json +13 -14
  140. package/node_modules/semver/CHANGELOG.md +39 -0
  141. package/node_modules/semver/README.md +43 -19
  142. package/node_modules/semver/bin/semver +92 -75
  143. package/node_modules/semver/package.json +25 -20
  144. package/node_modules/semver/semver.js +922 -763
  145. package/node_modules/set-blocking/package.json +13 -14
  146. package/node_modules/signal-exit/package.json +13 -14
  147. package/node_modules/string-width/package.json +14 -14
  148. package/node_modules/string_decoder/package.json +13 -14
  149. package/node_modules/strip-ansi/package.json +14 -14
  150. package/node_modules/strip-json-comments/package.json +13 -14
  151. package/node_modules/tar/README.md +7 -2
  152. package/node_modules/tar/lib/header.js +20 -4
  153. package/node_modules/tar/lib/large-numbers.js +32 -27
  154. package/node_modules/tar/lib/mkdir.js +2 -2
  155. package/node_modules/tar/lib/mode-fix.js +14 -0
  156. package/node_modules/tar/lib/pack.js +1 -0
  157. package/node_modules/tar/lib/parse.js +7 -1
  158. package/node_modules/tar/lib/read-entry.js +4 -0
  159. package/node_modules/tar/lib/unpack.js +67 -6
  160. package/node_modules/tar/lib/write-entry.js +25 -6
  161. package/node_modules/tar/package.json +33 -30
  162. package/node_modules/util-deprecate/package.json +13 -14
  163. package/node_modules/wide-align/package.json +19 -20
  164. package/node_modules/wrappy/package.json +14 -14
  165. package/node_modules/yallist/iterator.js +5 -5
  166. package/node_modules/yallist/package.json +19 -19
  167. package/node_modules/yallist/yallist.js +52 -2
  168. package/package.json +6 -9
  169. package/src/async.cc +2 -2
  170. package/src/constants.cc +20 -20
  171. package/src/thread.cc +5 -6
  172. package/.npmignore +0 -1
  173. package/build/.target.mk +0 -53
  174. package/build/Makefile +0 -352
  175. package/build/Release/.deps/Release/.node.d +0 -1
  176. package/build/Release/.deps/Release/fse.node.d +0 -1
  177. package/build/Release/.deps/Release/obj.target/action_after_build.stamp.d +0 -1
  178. package/build/Release/.deps/Release/obj.target/fse/fsevents.o.d +0 -65
  179. package/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node.d +0 -1
  180. package/build/Release/.node +0 -0
  181. package/build/Release/fse.node +0 -0
  182. package/build/Release/obj.target/action_after_build.stamp +0 -0
  183. package/build/Release/obj.target/fse/fsevents.o +0 -0
  184. package/build/action_after_build.target.mk +0 -32
  185. package/build/binding.Makefile +0 -6
  186. package/build/fse.target.mk +0 -179
  187. package/build/gyp-mac-tool +0 -611
  188. package/build/stage/v1.1.2/fse-v1.1.2-node-v48-darwin-x64.tar.gz +0 -0
  189. package/lib/binding/Release/node-v11-darwin-x64/fse.node +0 -0
  190. package/lib/binding/Release/node-v46-darwin-x64/fse.node +0 -0
  191. package/lib/binding/Release/node-v47-darwin-x64/fse.node +0 -0
  192. package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
  193. package/lib/binding/Release/node-v57-darwin-x64/fse.node +0 -0
  194. package/node_modules/are-we-there-yet/CHANGES.md~ +0 -27
  195. package/node_modules/debug/.coveralls.yml +0 -1
  196. package/node_modules/debug/.eslintrc +0 -11
  197. package/node_modules/debug/.npmignore +0 -9
  198. package/node_modules/debug/.travis.yml +0 -14
  199. package/node_modules/debug/Makefile +0 -50
  200. package/node_modules/debug/component.json +0 -19
  201. package/node_modules/debug/karma.conf.js +0 -70
  202. package/node_modules/debug/src/debug.js +0 -202
  203. package/node_modules/debug/src/inspector-log.js +0 -15
  204. package/node_modules/iconv-lite/.travis.yml +0 -23
  205. package/node_modules/rc/.npmignore +0 -3
  206. package/node_modules/safe-buffer/.travis.yml +0 -7
  207. package/node_modules/safe-buffer/test.js +0 -101
  208. package/src/locking.cc +0 -27
@@ -0,0 +1,57 @@
1
+ {
2
+ "_from": "npm-normalize-package-bin@^1.0.1",
3
+ "_id": "npm-normalize-package-bin@1.0.1",
4
+ "_inBundle": false,
5
+ "_integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==",
6
+ "_location": "/npm-normalize-package-bin",
7
+ "_phantomChildren": {},
8
+ "_requested": {
9
+ "type": "range",
10
+ "registry": true,
11
+ "raw": "npm-normalize-package-bin@^1.0.1",
12
+ "name": "npm-normalize-package-bin",
13
+ "escapedName": "npm-normalize-package-bin",
14
+ "rawSpec": "^1.0.1",
15
+ "saveSpec": null,
16
+ "fetchSpec": "^1.0.1"
17
+ },
18
+ "_requiredBy": [
19
+ "/npm-bundled"
20
+ ],
21
+ "_resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
22
+ "_shasum": "6e79a41f23fd235c0623218228da7d9c23b8f6e2",
23
+ "_spec": "npm-normalize-package-bin@^1.0.1",
24
+ "_where": "/Users/pipobscure/fsevents/node_modules/npm-bundled",
25
+ "author": {
26
+ "name": "Isaac Z. Schlueter",
27
+ "email": "i@izs.me",
28
+ "url": "https://izs.me"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/npm/npm-normalize-package-bin/issues"
32
+ },
33
+ "bundleDependencies": false,
34
+ "deprecated": false,
35
+ "description": "Turn any flavor of allowable package.json bin into a normalized object",
36
+ "devDependencies": {
37
+ "tap": "^14.10.2"
38
+ },
39
+ "homepage": "https://github.com/npm/npm-normalize-package-bin#readme",
40
+ "license": "ISC",
41
+ "name": "npm-normalize-package-bin",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/npm/npm-normalize-package-bin.git"
45
+ },
46
+ "scripts": {
47
+ "postpublish": "git push origin --follow-tags",
48
+ "postversion": "npm publish",
49
+ "preversion": "npm test",
50
+ "snap": "tap",
51
+ "test": "tap"
52
+ },
53
+ "tap": {
54
+ "check-coverage": true
55
+ },
56
+ "version": "1.0.1"
57
+ }
@@ -0,0 +1,37 @@
1
+ const normalize = require('../')
2
+ const t = require('tap')
3
+
4
+ t.test('benign array', async t => {
5
+ const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'y/z', './a'] }
6
+ const expect = { name: 'hello', version: 'world', bin: {
7
+ y: 'x/y',
8
+ z: 'y/z',
9
+ a: 'a',
10
+ } }
11
+ t.strictSame(normalize(pkg), expect)
12
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
13
+ })
14
+
15
+ t.test('conflicting array', async t => {
16
+ const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'z/y', './a'] }
17
+ const expect = { name: 'hello', version: 'world', bin: {
18
+ y: 'z/y',
19
+ a: 'a',
20
+ } }
21
+ t.strictSame(normalize(pkg), expect)
22
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
23
+ })
24
+
25
+ t.test('slashy array', async t => {
26
+ const pkg = { name: 'hello', version: 'world', bin: [ '/etc/passwd' ] }
27
+ const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } }
28
+ t.strictSame(normalize(pkg), expect)
29
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
30
+ })
31
+
32
+ t.test('dotty array', async t => {
33
+ const pkg = { name: 'hello', version: 'world', bin: ['../../../../etc/passwd'] }
34
+ const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } }
35
+ t.strictSame(normalize(pkg), expect)
36
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
37
+ })
@@ -0,0 +1,35 @@
1
+ const normalize = require('../')
2
+ const t = require('tap')
3
+
4
+ // all of these just delete the bins, so expect the same value
5
+ const expect = { name: 'hello', version: 'world' }
6
+
7
+ t.test('no bin in object', async t => {
8
+ const pkg = { name: 'hello', version: 'world' }
9
+ t.strictSame(normalize(pkg), expect)
10
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
11
+ })
12
+
13
+ t.test('empty string bin in object', async t => {
14
+ const pkg = { name: 'hello', version: 'world', bin: '' }
15
+ t.strictSame(normalize(pkg), expect)
16
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
17
+ })
18
+
19
+ t.test('false bin in object', async t => {
20
+ const pkg = { name: 'hello', version: 'world', bin: false }
21
+ t.strictSame(normalize(pkg), expect)
22
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
23
+ })
24
+
25
+ t.test('null bin in object', async t => {
26
+ const pkg = { name: 'hello', version: 'world', bin: null }
27
+ t.strictSame(normalize(pkg), expect)
28
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
29
+ })
30
+
31
+ t.test('number bin', async t => {
32
+ const pkg = { name: 'hello', version: 'world', bin: 42069 }
33
+ t.strictSame(normalize(pkg), expect)
34
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
35
+ })
@@ -0,0 +1,141 @@
1
+ const normalize = require('../')
2
+ const t = require('tap')
3
+
4
+ t.test('benign object', async t => {
5
+ // just clean up the ./ in the targets and remove anything weird
6
+ const pkg = { name: 'hello', version: 'world', bin: {
7
+ y: './x/y',
8
+ z: './y/z',
9
+ a: './a',
10
+ } }
11
+ const expect = { name: 'hello', version: 'world', bin: {
12
+ y: 'x/y',
13
+ z: 'y/z',
14
+ a: 'a',
15
+ } }
16
+ t.strictSame(normalize(pkg), expect)
17
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
18
+ })
19
+
20
+ t.test('empty and non-string targets', async t => {
21
+ // just clean up the ./ in the targets and remove anything weird
22
+ const pkg = { name: 'hello', version: 'world', bin: {
23
+ z: './././',
24
+ y: '',
25
+ './x': 'x.js',
26
+ re: /asdf/,
27
+ foo: { bar: 'baz' },
28
+ false: false,
29
+ null: null,
30
+ array: [1,2,3],
31
+ func: function () {},
32
+ } }
33
+ const expect = { name: 'hello', version: 'world', bin: {
34
+ x: 'x.js',
35
+ } }
36
+ t.strictSame(normalize(pkg), expect)
37
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
38
+ })
39
+
40
+ t.test('slashy object', async t => {
41
+ const pkg = { name: 'hello', version: 'world', bin: {
42
+ '/path/foo': '/etc/passwd',
43
+ 'bar': '/etc/passwd',
44
+ '/etc/glorb/baz': '/etc/passwd',
45
+ '/etc/passwd:/bin/usr/exec': '/etc/passwd',
46
+ } }
47
+ const expect = {
48
+ name: 'hello',
49
+ version: 'world',
50
+ bin: {
51
+ foo: 'etc/passwd',
52
+ bar: 'etc/passwd',
53
+ baz: 'etc/passwd',
54
+ exec: 'etc/passwd',
55
+ }
56
+ }
57
+ t.strictSame(normalize(pkg), expect)
58
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
59
+ })
60
+
61
+ t.test('dotty object', async t => {
62
+ const pkg = {
63
+ name: 'hello',
64
+ version: 'world',
65
+ bin: {
66
+ 'nodots': '../../../../etc/passwd',
67
+ '../../../../../../dots': '../../../../etc/passwd',
68
+ '.././../\\./..//C:\\./': 'this is removed',
69
+ '.././../\\./..//C:\\/': 'super safe programming language',
70
+ '.././../\\./..//C:\\x\\y\\z/': 'xyz',
71
+ } }
72
+ const expect = { name: 'hello', version: 'world', bin: {
73
+ nodots: 'etc/passwd',
74
+ dots: 'etc/passwd',
75
+ C: 'super safe programming language',
76
+ z: 'xyz',
77
+ } }
78
+ t.strictSame(normalize(pkg), expect)
79
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
80
+ })
81
+
82
+ t.test('weird object', async t => {
83
+ const pkg = { name: 'hello', version: 'world', bin: /asdf/ }
84
+ const expect = { name: 'hello', version: 'world' }
85
+ t.strictSame(normalize(pkg), expect)
86
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
87
+ })
88
+
89
+ t.test('oddball keys', async t => {
90
+ const pkg = {
91
+ bin: {
92
+ '~': 'target',
93
+ '£': 'target',
94
+ 'ζ': 'target',
95
+ 'ぎ': 'target',
96
+ '操': 'target',
97
+ '🎱': 'target',
98
+ '💎': 'target',
99
+ '💸': 'target',
100
+ '🦉': 'target',
101
+ 'сheck-dom': 'target',
102
+ 'Ωpm': 'target',
103
+ 'ζλ': 'target',
104
+ 'мга': 'target',
105
+ 'пше': 'target',
106
+ 'тзч': 'target',
107
+ 'тзь': 'target',
108
+ 'нфкт': 'target',
109
+ 'ссср': 'target',
110
+ '君の名は': 'target',
111
+ '君の名は': 'target',
112
+ }
113
+ }
114
+
115
+ const expect = {
116
+ bin: {
117
+ '~': 'target',
118
+ '£': 'target',
119
+ 'ζ': 'target',
120
+ 'ぎ': 'target',
121
+ '操': 'target',
122
+ '🎱': 'target',
123
+ '💎': 'target',
124
+ '💸': 'target',
125
+ '🦉': 'target',
126
+ 'сheck-dom': 'target',
127
+ 'Ωpm': 'target',
128
+ 'ζλ': 'target',
129
+ 'мга': 'target',
130
+ 'пше': 'target',
131
+ 'тзч': 'target',
132
+ 'тзь': 'target',
133
+ 'нфкт': 'target',
134
+ 'ссср': 'target',
135
+ '君の名は': 'target',
136
+ },
137
+ }
138
+
139
+ t.strictSame(normalize(pkg), expect)
140
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
141
+ })
@@ -0,0 +1,37 @@
1
+ const normalize = require('../')
2
+ const t = require('tap')
3
+
4
+ t.test('benign string', async t => {
5
+ const pkg = { name: 'hello', version: 'world', bin: 'hello.js' }
6
+ const expect = { name: 'hello', version: 'world', bin: { hello: 'hello.js' } }
7
+ t.strictSame(normalize(pkg), expect)
8
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
9
+ })
10
+
11
+ t.test('slashy string', async t => {
12
+ const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd' }
13
+ const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } }
14
+ t.strictSame(normalize(pkg), expect)
15
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
16
+ })
17
+
18
+ t.test('dotty string', async t => {
19
+ const pkg = { name: 'hello', version: 'world', bin: '../../../../etc/passwd' }
20
+ const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } }
21
+ t.strictSame(normalize(pkg), expect)
22
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
23
+ })
24
+
25
+ t.test('double path', async t => {
26
+ const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd:/bin/usr/exec' }
27
+ const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd:/bin/usr/exec' } }
28
+ t.strictSame(normalize(pkg), expect)
29
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
30
+ })
31
+
32
+ t.test('string with no name', async t => {
33
+ const pkg = { bin: 'foobar.js' }
34
+ const expect = {}
35
+ t.strictSame(normalize(pkg), expect)
36
+ t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok')
37
+ })
@@ -17,13 +17,19 @@ const rootBuiltinRules = Symbol('root-builtin-rules')
17
17
  const packageNecessaryRules = Symbol('package-necessary-rules')
18
18
  const path = require('path')
19
19
 
20
+ const normalizePackageBin = require('npm-normalize-package-bin')
21
+
20
22
  const defaultRules = [
21
23
  '.npmignore',
22
24
  '.gitignore',
23
- '**/.git/',
24
- '**/.svn/',
25
- '**/.hg/',
26
- '**/CVS/',
25
+ '**/.git',
26
+ '**/.svn',
27
+ '**/.hg',
28
+ '**/CVS',
29
+ '**/.git/**',
30
+ '**/.svn/**',
31
+ '**/.hg/**',
32
+ '**/CVS/**',
27
33
  '/.lock-wscript',
28
34
  '/.wafpickle-*',
29
35
  '/build/config.gypi',
@@ -31,11 +37,25 @@ const defaultRules = [
31
37
  '**/.npmrc',
32
38
  '.*.swp',
33
39
  '.DS_Store',
40
+ '**/.DS_Store/**',
34
41
  '._*',
42
+ '**/._*/**',
35
43
  '*.orig',
36
- 'package-lock.json'
44
+ '/package-lock.json',
45
+ '/yarn.lock',
46
+ 'archived-packages/**',
47
+ 'core',
48
+ '!core/',
49
+ '!**/core/',
50
+ '*.core',
51
+ '*.vgcore',
52
+ 'vgcore.*',
53
+ 'core.+([0-9])',
37
54
  ]
38
55
 
56
+ // There may be others, but :?|<> are handled by node-tar
57
+ const nameIsBadForWindows = file => /\*/.test(file)
58
+
39
59
  // a decorator that applies our custom rules to an ignore walker
40
60
  const npmWalker = Class => class Walker extends Class {
41
61
  constructor (opt) {
@@ -52,7 +72,11 @@ const npmWalker = Class => class Walker extends Class {
52
72
 
53
73
  opt.includeEmpty = false
54
74
  opt.path = opt.path || process.cwd()
55
- opt.follow = path.basename(opt.path) === 'node_modules'
75
+ const dirName = path.basename(opt.path)
76
+ const parentName = path.basename(path.dirname(opt.path))
77
+ opt.follow =
78
+ dirName === 'node_modules' ||
79
+ (parentName === 'node_modules' && /^@/.test(dirName))
56
80
  super(opt)
57
81
 
58
82
  // ignore a bunch of things by default at the root level.
@@ -72,6 +96,16 @@ const npmWalker = Class => class Walker extends Class {
72
96
  }
73
97
  }
74
98
 
99
+ onReaddir (entries) {
100
+ if (!this.parent) {
101
+ entries = entries.filter(e =>
102
+ e !== '.git' &&
103
+ !(e === 'node_modules' && this.bundled.length === 0)
104
+ )
105
+ }
106
+ return super.onReaddir(entries)
107
+ }
108
+
75
109
  filterEntry (entry, partial) {
76
110
  // get the partial path from the root of the walk
77
111
  const p = this.path.substr(this.root.length + 1)
@@ -127,13 +161,31 @@ const npmWalker = Class => class Walker extends Class {
127
161
  onPackageJson (ig, pkg, then) {
128
162
  this.packageJsonCache.set(ig, pkg)
129
163
 
130
- // if there's a browser or main, make sure we don't ignore it
164
+ // if there's a bin, browser or main, make sure we don't ignore it
165
+ // also, don't ignore the package.json itself!
166
+ //
167
+ // Weird side-effect of this: a readme (etc) file will be included
168
+ // if it exists anywhere within a folder with a package.json file.
169
+ // The original intent was only to include these files in the root,
170
+ // but now users in the wild are dependent on that behavior for
171
+ // localized documentation and other use cases. Adding a `/` to
172
+ // these rules, while tempting and arguably more "correct", is a
173
+ // breaking change.
131
174
  const rules = [
132
175
  pkg.browser ? '!' + pkg.browser : '',
133
176
  pkg.main ? '!' + pkg.main : '',
134
- '!@(readme|license|licence|notice|changes|changelog|history){,.*}'
135
- ].filter(f => f).join('\n') + '\n'
136
- super.onReadIgnoreFile(packageNecessaryRules, rules, _=>_)
177
+ '!package.json',
178
+ '!npm-shrinkwrap.json',
179
+ '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}'
180
+ ]
181
+ if (pkg.bin) {
182
+ // always an object, because normalized already
183
+ for (const key in pkg.bin)
184
+ rules.push('!' + pkg.bin[key])
185
+ }
186
+
187
+ const data = rules.filter(f => f).join('\n') + '\n'
188
+ super.onReadIgnoreFile(packageNecessaryRules, data, _=>_)
137
189
 
138
190
  if (Array.isArray(pkg.files))
139
191
  super.onReadIgnoreFile('package.json', '*\n' + pkg.files.map(
@@ -143,6 +195,16 @@ const npmWalker = Class => class Walker extends Class {
143
195
  then()
144
196
  }
145
197
 
198
+ // override parent stat function to completely skip any filenames
199
+ // that will break windows entirely.
200
+ // XXX(isaacs) Next major version should make this an error instead.
201
+ stat (entry, file, dir, then) {
202
+ if (nameIsBadForWindows(entry))
203
+ then()
204
+ else
205
+ super.stat(entry, file, dir, then)
206
+ }
207
+
146
208
  // override parent onstat function to nix all symlinks
147
209
  onstat (st, entry, file, dir, then) {
148
210
  if (st.isSymbolicLink())
@@ -154,7 +216,8 @@ const npmWalker = Class => class Walker extends Class {
154
216
  onReadIgnoreFile (file, data, then) {
155
217
  if (file === 'package.json')
156
218
  try {
157
- this.onPackageJson(file, JSON.parse(data), then)
219
+ const ig = path.resolve(this.path, file)
220
+ this.onPackageJson(ig, normalizePackageBin(JSON.parse(data)), then)
158
221
  } catch (er) {
159
222
  // ignore package.json files that are not json
160
223
  then()
@@ -184,12 +247,13 @@ class WalkerSync extends npmWalker(IgnoreWalkerSync) {
184
247
  const walk = (options, callback) => {
185
248
  options = options || {}
186
249
  const p = new Promise((resolve, reject) => {
187
- const bw = new BundleWalker(options).start()
250
+ const bw = new BundleWalker(options)
188
251
  bw.on('done', bundled => {
189
252
  options.bundled = bundled
190
253
  options.packageJsonCache = bw.packageJsonCache
191
254
  new Walker(options).on('done', resolve).on('error', reject).start()
192
255
  })
256
+ bw.start()
193
257
  })
194
258
  return callback ? p.then(res => callback(null, res), callback) : p
195
259
  }
@@ -204,15 +268,20 @@ const walkSync = options => {
204
268
  return walker.result
205
269
  }
206
270
 
207
- // package.json first, node_modules last, files before folders, alphasort
208
- const sort = (a, b) =>
209
- a === 'package.json' ? -1
210
- : b === 'package.json' ? 1
211
- : /^node_modules/.test(a) && !/^node_modules/.test(b) ? 1
212
- : /^node_modules/.test(b) && !/^node_modules/.test(a) ? -1
213
- : path.dirname(a) === '.' && path.dirname(b) !== '.' ? -1
214
- : path.dirname(b) === '.' && path.dirname(a) !== '.' ? 1
215
- : a.localeCompare(b)
271
+ // optimize for compressibility
272
+ // extname, then basename, then locale alphabetically
273
+ // https://twitter.com/isntitvacant/status/1131094910923231232
274
+ const sort = (a, b) => {
275
+ const exta = path.extname(a).toLowerCase()
276
+ const extb = path.extname(b).toLowerCase()
277
+ const basea = path.basename(a).toLowerCase()
278
+ const baseb = path.basename(b).toLowerCase()
279
+
280
+ return exta.localeCompare(extb) ||
281
+ basea.localeCompare(baseb) ||
282
+ a.localeCompare(b)
283
+ }
284
+
216
285
 
217
286
  module.exports = walk
218
287
  walk.sync = walkSync
@@ -1,30 +1,27 @@
1
1
  {
2
- "_args": [
3
- [
4
- "npm-packlist@1.1.10",
5
- "/Users/eshanker/Code/fsevents"
6
- ]
7
- ],
8
- "_from": "npm-packlist@1.1.10",
9
- "_id": "npm-packlist@1.1.10",
2
+ "_from": "npm-packlist@^1.1.6",
3
+ "_id": "npm-packlist@1.4.7",
10
4
  "_inBundle": false,
11
- "_integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
5
+ "_integrity": "sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ==",
12
6
  "_location": "/npm-packlist",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "npm-packlist@1.1.10",
11
+ "raw": "npm-packlist@^1.1.6",
18
12
  "name": "npm-packlist",
19
13
  "escapedName": "npm-packlist",
20
- "rawSpec": "1.1.10",
14
+ "rawSpec": "^1.1.6",
21
15
  "saveSpec": null,
22
- "fetchSpec": "1.1.10"
16
+ "fetchSpec": "^1.1.6"
23
17
  },
24
- "_requiredBy": [],
25
- "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz",
26
- "_spec": "1.1.10",
27
- "_where": "/Users/eshanker/Code/fsevents",
18
+ "_requiredBy": [
19
+ "/node-pre-gyp"
20
+ ],
21
+ "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.7.tgz",
22
+ "_shasum": "9e954365a06b80b18111ea900945af4f88ed4848",
23
+ "_spec": "npm-packlist@^1.1.6",
24
+ "_where": "/Users/pipobscure/fsevents/node_modules/node-pre-gyp",
28
25
  "author": {
29
26
  "name": "Isaac Z. Schlueter",
30
27
  "email": "i@izs.me",
@@ -33,15 +30,17 @@
33
30
  "bugs": {
34
31
  "url": "https://github.com/npm/npm-packlist/issues"
35
32
  },
33
+ "bundleDependencies": false,
36
34
  "dependencies": {
37
35
  "ignore-walk": "^3.0.1",
38
36
  "npm-bundled": "^1.0.1"
39
37
  },
38
+ "deprecated": false,
40
39
  "description": "Get a list of the files to add from a folder into an npm package",
41
40
  "devDependencies": {
42
41
  "mkdirp": "^0.5.1",
43
42
  "rimraf": "^2.6.1",
44
- "tap": "^10.7.2"
43
+ "tap": "^14.6.9"
45
44
  },
46
45
  "directories": {
47
46
  "test": "test"
@@ -53,15 +52,22 @@
53
52
  "license": "ISC",
54
53
  "main": "index.js",
55
54
  "name": "npm-packlist",
55
+ "publishConfig": {
56
+ "tag": "legacy-v1"
57
+ },
56
58
  "repository": {
57
59
  "type": "git",
58
60
  "url": "git+https://github.com/npm/npm-packlist.git"
59
61
  },
60
62
  "scripts": {
61
- "postpublish": "git push origin --all; git push origin --tags",
63
+ "postpublish": "git push origin --follow-tags",
62
64
  "postversion": "npm publish",
63
65
  "preversion": "npm test",
64
- "test": "tap test/*.js --100 -J"
66
+ "snap": "tap",
67
+ "test": "tap"
68
+ },
69
+ "tap": {
70
+ "jobs": 1
65
71
  },
66
- "version": "1.1.10"
72
+ "version": "1.4.7"
67
73
  }
@@ -1,30 +1,27 @@
1
1
  {
2
- "_args": [
3
- [
4
- "npmlog@4.1.2",
5
- "/Users/eshanker/Code/fsevents"
6
- ]
7
- ],
8
- "_from": "npmlog@4.1.2",
2
+ "_from": "npmlog@^4.0.2",
9
3
  "_id": "npmlog@4.1.2",
10
4
  "_inBundle": false,
11
5
  "_integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
12
6
  "_location": "/npmlog",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "npmlog@4.1.2",
11
+ "raw": "npmlog@^4.0.2",
18
12
  "name": "npmlog",
19
13
  "escapedName": "npmlog",
20
- "rawSpec": "4.1.2",
14
+ "rawSpec": "^4.0.2",
21
15
  "saveSpec": null,
22
- "fetchSpec": "4.1.2"
16
+ "fetchSpec": "^4.0.2"
23
17
  },
24
- "_requiredBy": [],
18
+ "_requiredBy": [
19
+ "/node-pre-gyp"
20
+ ],
25
21
  "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
26
- "_spec": "4.1.2",
27
- "_where": "/Users/eshanker/Code/fsevents",
22
+ "_shasum": "08a7f2a8bf734604779a9efa4ad5cc717abb954b",
23
+ "_spec": "npmlog@^4.0.2",
24
+ "_where": "/Users/pipobscure/fsevents/node_modules/node-pre-gyp",
28
25
  "author": {
29
26
  "name": "Isaac Z. Schlueter",
30
27
  "email": "i@izs.me",
@@ -33,12 +30,14 @@
33
30
  "bugs": {
34
31
  "url": "https://github.com/npm/npmlog/issues"
35
32
  },
33
+ "bundleDependencies": false,
36
34
  "dependencies": {
37
35
  "are-we-there-yet": "~1.1.2",
38
36
  "console-control-strings": "~1.1.0",
39
37
  "gauge": "~2.7.3",
40
38
  "set-blocking": "~2.0.0"
41
39
  },
40
+ "deprecated": false,
42
41
  "description": "logger for npm",
43
42
  "devDependencies": {
44
43
  "standard": "~7.1.2",