pnpm 7.9.1 → 7.9.2

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.
Files changed (108) hide show
  1. package/README.md +22 -7
  2. package/bin/pnpm.cjs +3 -0
  3. package/bin/pnpx.cjs +1 -15
  4. package/dist/node_modules/.modules.yaml +3 -3
  5. package/dist/node_modules/.pnpm/lock.yaml +76 -42
  6. package/dist/node_modules/@npmcli/fs/lib/common/owner-sync.js +96 -0
  7. package/dist/node_modules/@npmcli/fs/lib/common/owner.js +8 -4
  8. package/dist/node_modules/@npmcli/fs/lib/copy-file.js +3 -9
  9. package/dist/node_modules/@npmcli/fs/lib/fs.js +9 -3
  10. package/dist/node_modules/@npmcli/fs/lib/index.js +3 -1
  11. package/dist/node_modules/@npmcli/fs/lib/mkdir.js +19 -0
  12. package/dist/node_modules/@npmcli/fs/lib/mkdtemp.js +3 -8
  13. package/dist/node_modules/@npmcli/fs/lib/with-owner-sync.js +21 -0
  14. package/dist/node_modules/@npmcli/fs/lib/with-owner.js +21 -0
  15. package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +4 -2
  16. package/dist/node_modules/@npmcli/fs/lib/write-file.js +3 -8
  17. package/dist/node_modules/@npmcli/fs/package.json +21 -9
  18. package/dist/node_modules/@npmcli/move-file/{index.js → lib/index.js} +50 -27
  19. package/dist/node_modules/@npmcli/move-file/package.json +20 -7
  20. package/dist/node_modules/@tootallnate/once/LICENSE +21 -0
  21. package/dist/node_modules/@tootallnate/once/dist/index.js +21 -36
  22. package/dist/node_modules/@tootallnate/once/dist/index.js.map +1 -1
  23. package/dist/node_modules/@tootallnate/once/dist/overloaded-parameters.js +3 -0
  24. package/dist/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map +1 -0
  25. package/dist/node_modules/@tootallnate/once/dist/types.js +3 -0
  26. package/dist/node_modules/@tootallnate/once/dist/types.js.map +1 -0
  27. package/dist/node_modules/@tootallnate/once/package.json +22 -15
  28. package/dist/node_modules/cacache/lib/content/read.js +99 -102
  29. package/dist/node_modules/cacache/lib/content/rm.js +9 -8
  30. package/dist/node_modules/cacache/lib/content/write.js +67 -67
  31. package/dist/node_modules/cacache/lib/entry-index.js +128 -118
  32. package/dist/node_modules/cacache/{get.js → lib/get.js} +88 -100
  33. package/dist/node_modules/cacache/{index.js → lib/index.js} +5 -6
  34. package/dist/node_modules/cacache/lib/memoization.js +10 -11
  35. package/dist/node_modules/cacache/{put.js → lib/put.js} +23 -26
  36. package/dist/node_modules/cacache/{rm.js → lib/rm.js} +3 -3
  37. package/dist/node_modules/cacache/lib/util/fix-owner.js +41 -38
  38. package/dist/node_modules/cacache/lib/util/move-file.js +36 -47
  39. package/dist/node_modules/cacache/lib/util/tmp.js +5 -7
  40. package/dist/node_modules/cacache/lib/verify.js +160 -190
  41. package/dist/node_modules/cacache/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
  42. package/dist/node_modules/cacache/node_modules/brace-expansion/LICENSE +21 -0
  43. package/dist/node_modules/cacache/node_modules/brace-expansion/index.js +203 -0
  44. package/dist/node_modules/cacache/node_modules/brace-expansion/package.json +46 -0
  45. package/dist/node_modules/cacache/node_modules/glob/LICENSE +15 -0
  46. package/dist/node_modules/cacache/node_modules/glob/common.js +240 -0
  47. package/dist/node_modules/cacache/node_modules/glob/glob.js +790 -0
  48. package/dist/node_modules/cacache/node_modules/glob/package.json +55 -0
  49. package/dist/node_modules/cacache/node_modules/glob/sync.js +486 -0
  50. package/dist/node_modules/cacache/node_modules/minimatch/LICENSE +15 -0
  51. package/dist/node_modules/cacache/node_modules/minimatch/lib/path.js +4 -0
  52. package/dist/node_modules/cacache/node_modules/minimatch/minimatch.js +906 -0
  53. package/dist/node_modules/cacache/node_modules/minimatch/package.json +32 -0
  54. package/dist/node_modules/cacache/package.json +34 -30
  55. package/dist/node_modules/http-proxy-agent/dist/agent.js +3 -3
  56. package/dist/node_modules/http-proxy-agent/dist/agent.js.map +1 -1
  57. package/dist/node_modules/http-proxy-agent/package.json +4 -4
  58. package/dist/node_modules/lru-cache/LICENSE +1 -1
  59. package/dist/node_modules/lru-cache/index.js +921 -247
  60. package/dist/node_modules/lru-cache/package.json +49 -9
  61. package/dist/node_modules/make-fetch-happen/LICENSE +1 -1
  62. package/dist/node_modules/make-fetch-happen/lib/agent.js +34 -14
  63. package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +90 -106
  64. package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +1 -0
  65. package/dist/node_modules/make-fetch-happen/lib/cache/index.js +10 -6
  66. package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +21 -21
  67. package/dist/node_modules/make-fetch-happen/lib/dns.js +49 -0
  68. package/dist/node_modules/make-fetch-happen/lib/fetch.js +40 -22
  69. package/dist/node_modules/make-fetch-happen/lib/index.js +4 -3
  70. package/dist/node_modules/make-fetch-happen/lib/options.js +17 -9
  71. package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
  72. package/dist/node_modules/make-fetch-happen/lib/remote.js +28 -9
  73. package/dist/node_modules/make-fetch-happen/package.json +36 -33
  74. package/dist/node_modules/minipass-fetch/lib/blob.js +4 -4
  75. package/dist/node_modules/minipass-fetch/lib/body.js +63 -49
  76. package/dist/node_modules/minipass-fetch/lib/fetch-error.js +2 -1
  77. package/dist/node_modules/minipass-fetch/lib/headers.js +38 -21
  78. package/dist/node_modules/minipass-fetch/lib/index.js +130 -106
  79. package/dist/node_modules/minipass-fetch/lib/request.js +46 -28
  80. package/dist/node_modules/minipass-fetch/lib/response.js +3 -2
  81. package/dist/node_modules/minipass-fetch/package.json +27 -14
  82. package/dist/node_modules/node-gyp/.github/workflows/release-please.yml +1 -1
  83. package/dist/node_modules/node-gyp/.github/workflows/tests.yml +16 -9
  84. package/dist/node_modules/node-gyp/.github/workflows/visual-studio.yml +16 -8
  85. package/dist/node_modules/node-gyp/lib/build.js +7 -0
  86. package/dist/node_modules/node-gyp/lib/configure.js +26 -1
  87. package/dist/node_modules/node-gyp/lib/create-config-gypi.js +2 -1
  88. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +9 -8
  89. package/dist/node_modules/node-gyp/lib/node-gyp.js +4 -0
  90. package/dist/node_modules/node-gyp/package.json +4 -4
  91. package/dist/node_modules/semver/node_modules/lru-cache/LICENSE +15 -0
  92. package/dist/node_modules/semver/node_modules/lru-cache/index.js +334 -0
  93. package/dist/node_modules/semver/node_modules/lru-cache/package.json +34 -0
  94. package/dist/node_modules/socks-proxy-agent/dist/index.js +3 -3
  95. package/dist/node_modules/socks-proxy-agent/dist/index.js.map +1 -1
  96. package/dist/node_modules/socks-proxy-agent/package.json +2 -2
  97. package/dist/node_modules/ssri/{index.js → lib/index.js} +78 -24
  98. package/dist/node_modules/ssri/package.json +27 -16
  99. package/dist/pnpm.cjs +67042 -65886
  100. package/package.json +6 -6
  101. package/dist/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js +0 -17
  102. package/dist/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js +0 -121
  103. package/dist/node_modules/@npmcli/fs/lib/mkdir/index.js +0 -32
  104. package/dist/node_modules/@npmcli/fs/lib/mkdir/polyfill.js +0 -81
  105. package/dist/node_modules/cacache/lib/util/disposer.js +0 -30
  106. package/dist/node_modules/cacache/ls.js +0 -6
  107. package/dist/node_modules/cacache/verify.js +0 -3
  108. package/dist/node_modules/minipass-fetch/index.js +0 -1
@@ -19,7 +19,7 @@ const defaultOpts = {
19
19
  pickAlgorithm: getPrioritizedHash,
20
20
  sep: ' ',
21
21
  single: false,
22
- strict: false
22
+ strict: false,
23
23
  }
24
24
 
25
25
  const ssriOpts = (opts = {}) => ({ ...defaultOpts, ...opts })
@@ -30,6 +30,10 @@ const getOptString = options => !options || !options.length
30
30
 
31
31
  const _onEnd = Symbol('_onEnd')
32
32
  const _getOptions = Symbol('_getOptions')
33
+ const _emittedSize = Symbol('_emittedSize')
34
+ const _emittedIntegrity = Symbol('_emittedIntegrity')
35
+ const _emittedVerified = Symbol('_emittedVerified')
36
+
33
37
  class IntegrityStream extends MiniPass {
34
38
  constructor (opts) {
35
39
  super()
@@ -51,7 +55,7 @@ class IntegrityStream extends MiniPass {
51
55
  const {
52
56
  integrity,
53
57
  size,
54
- options
58
+ options,
55
59
  } = { ...defaultOpts, ...this.opts }
56
60
 
57
61
  // For verification
@@ -63,8 +67,26 @@ class IntegrityStream extends MiniPass {
63
67
  this.optString = getOptString(options)
64
68
  }
65
69
 
70
+ on (ev, handler) {
71
+ if (ev === 'size' && this[_emittedSize]) {
72
+ return handler(this[_emittedSize])
73
+ }
74
+
75
+ if (ev === 'integrity' && this[_emittedIntegrity]) {
76
+ return handler(this[_emittedIntegrity])
77
+ }
78
+
79
+ if (ev === 'verified' && this[_emittedVerified]) {
80
+ return handler(this[_emittedVerified])
81
+ }
82
+
83
+ return super.on(ev, handler)
84
+ }
85
+
66
86
  emit (ev, data) {
67
- if (ev === 'end') this[_onEnd]()
87
+ if (ev === 'end') {
88
+ this[_onEnd]()
89
+ }
68
90
  return super.emit(ev, data)
69
91
  }
70
92
 
@@ -84,6 +106,7 @@ class IntegrityStream extends MiniPass {
84
106
  // Integrity verification mode
85
107
  const match = this.goodSri && newSri.match(this.sri, this.opts)
86
108
  if (typeof this.expectedSize === 'number' && this.size !== this.expectedSize) {
109
+ /* eslint-disable-next-line max-len */
87
110
  const err = new Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`)
88
111
  err.code = 'EBADSIZE'
89
112
  err.found = this.size
@@ -91,6 +114,7 @@ class IntegrityStream extends MiniPass {
91
114
  err.sri = this.sri
92
115
  this.emit('error', err)
93
116
  } else if (this.sri && !match) {
117
+ /* eslint-disable-next-line max-len */
94
118
  const err = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`)
95
119
  err.code = 'EINTEGRITY'
96
120
  err.found = newSri
@@ -99,15 +123,23 @@ class IntegrityStream extends MiniPass {
99
123
  err.sri = this.sri
100
124
  this.emit('error', err)
101
125
  } else {
126
+ this[_emittedSize] = this.size
102
127
  this.emit('size', this.size)
128
+ this[_emittedIntegrity] = newSri
103
129
  this.emit('integrity', newSri)
104
- match && this.emit('verified', match)
130
+ if (match) {
131
+ this[_emittedVerified] = match
132
+ this.emit('verified', match)
133
+ }
105
134
  }
106
135
  }
107
136
  }
108
137
 
109
138
  class Hash {
110
- get isHash () { return true }
139
+ get isHash () {
140
+ return true
141
+ }
142
+
111
143
  constructor (hash, opts) {
112
144
  opts = ssriOpts(opts)
113
145
  const strict = !!opts.strict
@@ -126,8 +158,12 @@ class Hash {
126
158
  ? STRICT_SRI_REGEX
127
159
  : SRI_REGEX
128
160
  )
129
- if (!match) { return }
130
- if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return }
161
+ if (!match) {
162
+ return
163
+ }
164
+ if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) {
165
+ return
166
+ }
131
167
  this.algorithm = match[1]
132
168
  this.digest = match[2]
133
169
 
@@ -175,7 +211,10 @@ class Hash {
175
211
  }
176
212
 
177
213
  class Integrity {
178
- get isIntegrity () { return true }
214
+ get isIntegrity () {
215
+ return true
216
+ }
217
+
179
218
  toJSON () {
180
219
  return this.toString()
181
220
  }
@@ -255,7 +294,9 @@ class Integrity {
255
294
 
256
295
  module.exports.parse = parse
257
296
  function parse (sri, opts) {
258
- if (!sri) return null
297
+ if (!sri) {
298
+ return null
299
+ }
259
300
  opts = ssriOpts(opts)
260
301
  if (typeof sri === 'string') {
261
302
  return _parse(sri, opts)
@@ -278,7 +319,9 @@ function _parse (integrity, opts) {
278
319
  const hash = new Hash(string, opts)
279
320
  if (hash.algorithm && hash.digest) {
280
321
  const algo = hash.algorithm
281
- if (!acc[algo]) { acc[algo] = [] }
322
+ if (!acc[algo]) {
323
+ acc[algo] = []
324
+ }
282
325
  acc[algo].push(hash)
283
326
  }
284
327
  return acc
@@ -324,9 +367,11 @@ function fromData (data, opts) {
324
367
  * just calculated with an algo did not have an algo or digest.
325
368
  */
326
369
  if (hash.algorithm && hash.digest) {
327
- const algo = hash.algorithm
328
- if (!acc[algo]) { acc[algo] = [] }
329
- acc[algo].push(hash)
370
+ const hashAlgo = hash.algorithm
371
+ if (!acc[hashAlgo]) {
372
+ acc[hashAlgo] = []
373
+ }
374
+ acc[hashAlgo].push(hash)
330
375
  }
331
376
  return acc
332
377
  }, new Integrity())
@@ -341,7 +386,9 @@ function fromStream (stream, opts) {
341
386
  stream.on('error', reject)
342
387
  istream.on('error', reject)
343
388
  let sri
344
- istream.on('integrity', s => { sri = s })
389
+ istream.on('integrity', s => {
390
+ sri = s
391
+ })
345
392
  istream.on('end', () => resolve(sri))
346
393
  istream.on('data', () => {})
347
394
  })
@@ -355,7 +402,7 @@ function checkData (data, sri, opts) {
355
402
  if (opts.error) {
356
403
  throw Object.assign(
357
404
  new Error('No valid integrity hashes to check against'), {
358
- code: 'EINTEGRITY'
405
+ code: 'EINTEGRITY',
359
406
  }
360
407
  )
361
408
  } else {
@@ -369,6 +416,7 @@ function checkData (data, sri, opts) {
369
416
  if (match || !opts.error) {
370
417
  return match
371
418
  } else if (typeof opts.size === 'number' && (data.length !== opts.size)) {
419
+ /* eslint-disable-next-line max-len */
372
420
  const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`)
373
421
  err.code = 'EBADSIZE'
374
422
  err.found = data.length
@@ -376,6 +424,7 @@ function checkData (data, sri, opts) {
376
424
  err.sri = sri
377
425
  throw err
378
426
  } else {
427
+ /* eslint-disable-next-line max-len */
379
428
  const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`)
380
429
  err.code = 'EINTEGRITY'
381
430
  err.found = newSri
@@ -394,7 +443,7 @@ function checkStream (stream, sri, opts) {
394
443
  if (!sri || !Object.keys(sri).length) {
395
444
  return Promise.reject(Object.assign(
396
445
  new Error('No valid integrity hashes to check against'), {
397
- code: 'EINTEGRITY'
446
+ code: 'EINTEGRITY',
398
447
  }
399
448
  ))
400
449
  }
@@ -403,9 +452,11 @@ function checkStream (stream, sri, opts) {
403
452
  stream.pipe(checker)
404
453
  stream.on('error', reject)
405
454
  checker.on('error', reject)
406
- let sri
407
- checker.on('verified', s => { sri = s })
408
- checker.on('end', () => resolve(sri))
455
+ let verified
456
+ checker.on('verified', s => {
457
+ verified = s
458
+ })
459
+ checker.on('end', () => resolve(verified))
409
460
  checker.on('data', () => {})
410
461
  })
411
462
  }
@@ -439,15 +490,17 @@ function createIntegrity (opts) {
439
490
  * just calculated with an algo did not have an algo or digest.
440
491
  */
441
492
  if (hash.algorithm && hash.digest) {
442
- const algo = hash.algorithm
443
- if (!acc[algo]) { acc[algo] = [] }
444
- acc[algo].push(hash)
493
+ const hashAlgo = hash.algorithm
494
+ if (!acc[hashAlgo]) {
495
+ acc[hashAlgo] = []
496
+ }
497
+ acc[hashAlgo].push(hash)
445
498
  }
446
499
  return acc
447
500
  }, new Integrity())
448
501
 
449
502
  return integrity
450
- }
503
+ },
451
504
  }
452
505
  }
453
506
 
@@ -460,10 +513,11 @@ const DEFAULT_PRIORITY = [
460
513
  // for the algorithm, so we guesswork it based on the OpenSSL names.
461
514
  'sha3',
462
515
  'sha3-256', 'sha3-384', 'sha3-512',
463
- 'sha3_256', 'sha3_384', 'sha3_512'
516
+ 'sha3_256', 'sha3_384', 'sha3_512',
464
517
  ].filter(algo => NODE_HASHES.has(algo))
465
518
 
466
519
  function getPrioritizedHash (algo1, algo2) {
520
+ /* eslint-disable-next-line max-len */
467
521
  return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase())
468
522
  ? algo1
469
523
  : algo2
@@ -1,23 +1,34 @@
1
1
  {
2
2
  "name": "ssri",
3
- "version": "8.0.1",
3
+ "version": "9.0.1",
4
4
  "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.",
5
- "main": "index.js",
6
- "files": [],
5
+ "main": "lib/index.js",
6
+ "files": [
7
+ "bin/",
8
+ "lib/"
9
+ ],
7
10
  "scripts": {
8
11
  "prerelease": "npm t",
9
12
  "postrelease": "npm publish",
10
- "prepublishOnly": "git push --follow-tags",
13
+ "prepublishOnly": "git push origin --follow-tags",
11
14
  "posttest": "npm run lint",
12
- "release": "standard-version -s",
13
15
  "test": "tap",
14
16
  "coverage": "tap",
15
- "lint": "standard"
17
+ "lint": "eslint \"**/*.js\"",
18
+ "postlint": "template-oss-check",
19
+ "template-oss-apply": "template-oss-apply --force",
20
+ "lintfix": "npm run lint -- --fix",
21
+ "preversion": "npm test",
22
+ "postversion": "npm publish",
23
+ "snap": "tap"
16
24
  },
17
25
  "tap": {
18
26
  "check-coverage": true
19
27
  },
20
- "repository": "https://github.com/npm/ssri",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/npm/ssri.git"
31
+ },
21
32
  "keywords": [
22
33
  "w3c",
23
34
  "web",
@@ -32,21 +43,21 @@
32
43
  "sri generator",
33
44
  "html"
34
45
  ],
35
- "author": {
36
- "name": "Kat Marchán",
37
- "email": "kzm@sykosomatic.org",
38
- "twitter": "maybekatz"
39
- },
46
+ "author": "GitHub Inc.",
40
47
  "license": "ISC",
41
48
  "dependencies": {
42
49
  "minipass": "^3.1.1"
43
50
  },
44
51
  "devDependencies": {
45
- "standard": "^16.0.3",
46
- "standard-version": "^9.1.0",
47
- "tap": "^14.10.6"
52
+ "@npmcli/eslint-config": "^3.0.1",
53
+ "@npmcli/template-oss": "3.5.0",
54
+ "tap": "^16.0.1"
48
55
  },
49
56
  "engines": {
50
- "node": ">= 8"
57
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
58
+ },
59
+ "templateOSS": {
60
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
61
+ "version": "3.5.0"
51
62
  }
52
63
  }