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
package/README.md CHANGED
@@ -35,13 +35,13 @@ To quote the [Rush](https://rushjs.io/) team:
35
35
  <tbody>
36
36
  <tr>
37
37
  <td align="center" valign="middle">
38
- <a href="https://bit.dev/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/bit.svg" width="80"></a>
38
+ <a href="https://bit.dev/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/bit.svg" width="80"></a>
39
39
  </td>
40
40
  <td align="center" valign="middle">
41
- <a href="https://nhost.io/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/nhost.svg" width="180"></a>
41
+ <a href="https://nhost.io/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/nhost.svg" width="180"></a>
42
42
  </td>
43
43
  <td align="center" valign="middle">
44
- <a href="https://novu.co/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/novu.svg" width="180"></a>
44
+ <a href="https://novu.co/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://pnpm.io/img/users/novu.svg" width="180"></a>
45
45
  </td>
46
46
  </tr>
47
47
  </table>
@@ -52,16 +52,31 @@ To quote the [Rush](https://rushjs.io/) team:
52
52
  <tbody>
53
53
  <tr>
54
54
  <td align="center" valign="middle">
55
- <a href="https://prisma.io/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/prisma.svg" width="180"></a>
55
+ <a href="https://prisma.io/?utm_source=pnpm&utm_medium=readme" target="_blank">
56
+ <img src="https://pnpm.io/img/users/prisma.svg" width="180">
57
+ </a>
56
58
  </td>
57
59
  <td align="center" valign="middle">
58
- <a href="https://leniolabs.com/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/leniolabs.jpg" width="80"></a>
60
+ <a href="https://leniolabs.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
61
+ <img src="https://pnpm.io/img/users/leniolabs.jpg" width="80">
62
+ </a>
59
63
  </td>
60
64
  <td align="center" valign="middle">
61
- <a href="https://vercel.com/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/vercel.svg" width="180"></a>
65
+ <a href="https://vercel.com/?utm_source=pnpm&utm_medium=readme" target="_blank">
66
+ <img src="https://pnpm.io/img/users/vercel.svg" width="180">
67
+ </a>
68
+ </td>
69
+ </tr>
70
+ <tr>
71
+ <td align="center" valign="middle">
72
+ <a href="https://www.takeshape.io/?utm_source=pnpm&utm_medium=readme" target="_blank">
73
+ <img src="https://pnpm.io/img/users/takeshape.svg" width="280">
74
+ </a>
62
75
  </td>
63
76
  <td align="center" valign="middle">
64
- <a href="https://www.takeshape.io/?utm_source=pnpm&utm_medium=readme" target="_blank"><img src="https://raw.githubusercontent.com/pnpm/pnpm.github.io/main/static/img/users/takeshape.svg" width="280"></a>
77
+ <a href="https://doppler.com/?utm_source=pnpm&utm_medium=readme#gh-light-mode-only" target="_blank">
78
+ <img src="https://pnpm.io/img/users/doppler.svg" width="280">
79
+ </a>
65
80
  </td>
66
81
  </tr>
67
82
  </tbody>
package/bin/pnpm.cjs CHANGED
@@ -2,6 +2,9 @@
2
2
  const [major, minor] = process.version.slice(1).split('.')
3
3
  const COMPATIBILITY_PAGE = `Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.`
4
4
 
5
+ // We don't use the semver library here because:
6
+ // 1. it is already bundled to dist/pnpm.cjs, so we would load it twice
7
+ // 2. we want this file to support potentially older Node.js versions than what semver supports
5
8
  if (major < 14 || major == 14 && minor < 6) {
6
9
  console.log(`ERROR: This version of pnpm requires at least Node.js v14.6
7
10
  The current version of Node.js is ${process.version}
package/bin/pnpx.cjs CHANGED
@@ -1,19 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const [major, minor] = process.version.slice(1).split('.')
3
- const COMPATIBILITY_PAGE = `Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.`
4
-
5
- if (major < 12 || major == 12 && minor < 17) {
6
- console.log(`ERROR: This version of pnpm requires at least Node.js v12.17
7
- The current version of Node.js is ${process.version}
8
- ${COMPATIBILITY_PAGE}`)
9
- process.exit(1)
10
- } else if (major == 13 && minor < 7) {
11
- console.log(`ERROR: This version of pnpm requires at least Node.js v13.7
12
- The current version of Node.js is ${process.version}
13
- ${COMPATIBILITY_PAGE}`)
14
- process.exit(1)
15
- }
16
2
 
17
3
  process.argv = [...process.argv.slice(0, 2), 'dlx', ...process.argv.slice(2)]
18
4
 
19
- require('../dist/pnpm.cjs')
5
+ require('./pnpm.cjs')
@@ -7,11 +7,11 @@ included:
7
7
  injectedDeps: {}
8
8
  layoutVersion: 5
9
9
  nodeLinker: hoisted
10
- packageManager: pnpm@7.9.0
10
+ packageManager: pnpm@7.9.1
11
11
  pendingBuilds:
12
- - /node-gyp/8.4.1
12
+ - /node-gyp/9.1.0
13
13
  - /encoding/0.1.13
14
- prunedAt: Wed, 10 Aug 2022 09:57:57 GMT
14
+ prunedAt: Wed, 17 Aug 2022 09:19:55 GMT
15
15
  publicHoistPattern:
16
16
  - '*eslint*'
17
17
  - '*prettier*'
@@ -1,10 +1,10 @@
1
1
  lockfileVersion: 5.4
2
2
 
3
3
  specifiers:
4
- node-gyp: ^8.4.1
4
+ node-gyp: ^9.1.0
5
5
 
6
6
  optionalDependencies:
7
- node-gyp: 8.4.1
7
+ node-gyp: 9.1.0
8
8
 
9
9
  packages:
10
10
 
@@ -13,26 +13,27 @@ packages:
13
13
  dev: false
14
14
  optional: true
15
15
 
16
- /@npmcli/fs/1.1.1:
17
- resolution: {integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==}
16
+ /@npmcli/fs/2.1.2:
17
+ resolution: {integrity: sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==}
18
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
18
19
  dependencies:
19
20
  '@gar/promisify': 1.1.3
20
21
  semver: 7.3.7
21
22
  dev: false
22
23
  optional: true
23
24
 
24
- /@npmcli/move-file/1.1.2:
25
- resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==}
26
- engines: {node: '>=10'}
25
+ /@npmcli/move-file/2.0.1:
26
+ resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==}
27
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
27
28
  dependencies:
28
29
  mkdirp: 1.0.4
29
30
  rimraf: 3.0.2
30
31
  dev: false
31
32
  optional: true
32
33
 
33
- /@tootallnate/once/1.1.2:
34
- resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==}
35
- engines: {node: '>= 6'}
34
+ /@tootallnate/once/2.0.0:
35
+ resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
36
+ engines: {node: '>= 10'}
36
37
  dev: false
37
38
  optional: true
38
39
 
@@ -105,17 +106,24 @@ packages:
105
106
  dev: false
106
107
  optional: true
107
108
 
108
- /cacache/15.3.0:
109
- resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==}
110
- engines: {node: '>= 10'}
109
+ /brace-expansion/2.0.1:
110
+ resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
111
111
  dependencies:
112
- '@npmcli/fs': 1.1.1
113
- '@npmcli/move-file': 1.1.2
112
+ balanced-match: 1.0.2
113
+ dev: false
114
+ optional: true
115
+
116
+ /cacache/16.1.2:
117
+ resolution: {integrity: sha512-Xx+xPlfCZIUHagysjjOAje9nRo8pRDczQCcXb4J2O0BLtH+xeVue6ba4y1kfJfQMAnM2mkcoMIAyOctlaRGWYA==}
118
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
119
+ dependencies:
120
+ '@npmcli/fs': 2.1.2
121
+ '@npmcli/move-file': 2.0.1
114
122
  chownr: 2.0.0
115
123
  fs-minipass: 2.1.0
116
- glob: 7.2.3
124
+ glob: 8.0.3
117
125
  infer-owner: 1.0.4
118
- lru-cache: 6.0.0
126
+ lru-cache: 7.14.0
119
127
  minipass: 3.3.4
120
128
  minipass-collect: 1.0.2
121
129
  minipass-flush: 1.0.5
@@ -124,7 +132,7 @@ packages:
124
132
  p-map: 4.0.0
125
133
  promise-inflight: 1.0.1
126
134
  rimraf: 3.0.2
127
- ssri: 8.0.1
135
+ ssri: 9.0.1
128
136
  tar: 6.1.11
129
137
  unique-filename: 1.1.1
130
138
  transitivePeerDependencies:
@@ -248,6 +256,18 @@ packages:
248
256
  dev: false
249
257
  optional: true
250
258
 
259
+ /glob/8.0.3:
260
+ resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==}
261
+ engines: {node: '>=12'}
262
+ dependencies:
263
+ fs.realpath: 1.0.0
264
+ inflight: 1.0.6
265
+ inherits: 2.0.4
266
+ minimatch: 5.1.0
267
+ once: 1.4.0
268
+ dev: false
269
+ optional: true
270
+
251
271
  /graceful-fs/4.2.10:
252
272
  resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
253
273
  dev: false
@@ -263,11 +283,11 @@ packages:
263
283
  dev: false
264
284
  optional: true
265
285
 
266
- /http-proxy-agent/4.0.1:
267
- resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==}
286
+ /http-proxy-agent/5.0.0:
287
+ resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
268
288
  engines: {node: '>= 6'}
269
289
  dependencies:
270
- '@tootallnate/once': 1.1.2
290
+ '@tootallnate/once': 2.0.0
271
291
  agent-base: 6.0.2
272
292
  debug: 4.3.4
273
293
  transitivePeerDependencies:
@@ -360,26 +380,32 @@ packages:
360
380
  dev: false
361
381
  optional: true
362
382
 
363
- /make-fetch-happen/9.1.0:
364
- resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==}
365
- engines: {node: '>= 10'}
383
+ /lru-cache/7.14.0:
384
+ resolution: {integrity: sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==}
385
+ engines: {node: '>=12'}
386
+ dev: false
387
+ optional: true
388
+
389
+ /make-fetch-happen/10.2.1:
390
+ resolution: {integrity: sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==}
391
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
366
392
  dependencies:
367
393
  agentkeepalive: 4.2.1
368
- cacache: 15.3.0
394
+ cacache: 16.1.2
369
395
  http-cache-semantics: 4.1.0
370
- http-proxy-agent: 4.0.1
396
+ http-proxy-agent: 5.0.0
371
397
  https-proxy-agent: 5.0.1
372
398
  is-lambda: 1.0.1
373
- lru-cache: 6.0.0
399
+ lru-cache: 7.14.0
374
400
  minipass: 3.3.4
375
401
  minipass-collect: 1.0.2
376
- minipass-fetch: 1.4.1
402
+ minipass-fetch: 2.1.0
377
403
  minipass-flush: 1.0.5
378
404
  minipass-pipeline: 1.2.4
379
405
  negotiator: 0.6.3
380
406
  promise-retry: 2.0.1
381
- socks-proxy-agent: 6.2.1
382
- ssri: 8.0.1
407
+ socks-proxy-agent: 7.0.0
408
+ ssri: 9.0.1
383
409
  transitivePeerDependencies:
384
410
  - bluebird
385
411
  - supports-color
@@ -393,6 +419,14 @@ packages:
393
419
  dev: false
394
420
  optional: true
395
421
 
422
+ /minimatch/5.1.0:
423
+ resolution: {integrity: sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==}
424
+ engines: {node: '>=10'}
425
+ dependencies:
426
+ brace-expansion: 2.0.1
427
+ dev: false
428
+ optional: true
429
+
396
430
  /minipass-collect/1.0.2:
397
431
  resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==}
398
432
  engines: {node: '>= 8'}
@@ -401,9 +435,9 @@ packages:
401
435
  dev: false
402
436
  optional: true
403
437
 
404
- /minipass-fetch/1.4.1:
405
- resolution: {integrity: sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==}
406
- engines: {node: '>=8'}
438
+ /minipass-fetch/2.1.0:
439
+ resolution: {integrity: sha512-H9U4UVBGXEyyWJnqYDCLp1PwD8XIkJ4akNHp1aGVI+2Ym7wQMlxDKi4IB4JbmyU+pl9pEs/cVrK6cOuvmbK4Sg==}
440
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
407
441
  dependencies:
408
442
  minipass: 3.3.4
409
443
  minipass-sized: 1.0.3
@@ -477,16 +511,16 @@ packages:
477
511
  dev: false
478
512
  optional: true
479
513
 
480
- /node-gyp/8.4.1:
481
- resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==}
482
- engines: {node: '>= 10.12.0'}
514
+ /node-gyp/9.1.0:
515
+ resolution: {integrity: sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==}
516
+ engines: {node: ^12.22 || ^14.13 || >=16}
483
517
  hasBin: true
484
518
  requiresBuild: true
485
519
  dependencies:
486
520
  env-paths: 2.2.1
487
521
  glob: 7.2.3
488
522
  graceful-fs: 4.2.10
489
- make-fetch-happen: 9.1.0
523
+ make-fetch-happen: 10.2.1
490
524
  nopt: 5.0.0
491
525
  npmlog: 6.0.2
492
526
  rimraf: 3.0.2
@@ -618,8 +652,8 @@ packages:
618
652
  dev: false
619
653
  optional: true
620
654
 
621
- /socks-proxy-agent/6.2.1:
622
- resolution: {integrity: sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==}
655
+ /socks-proxy-agent/7.0.0:
656
+ resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==}
623
657
  engines: {node: '>= 10'}
624
658
  dependencies:
625
659
  agent-base: 6.0.2
@@ -639,9 +673,9 @@ packages:
639
673
  dev: false
640
674
  optional: true
641
675
 
642
- /ssri/8.0.1:
643
- resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==}
644
- engines: {node: '>= 8'}
676
+ /ssri/9.0.1:
677
+ resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==}
678
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
645
679
  dependencies:
646
680
  minipass: 3.3.4
647
681
  dev: false
@@ -0,0 +1,96 @@
1
+ const { dirname, resolve } = require('path')
2
+ const url = require('url')
3
+
4
+ const fs = require('../fs.js')
5
+
6
+ // given a path, find the owner of the nearest parent
7
+ const find = (path) => {
8
+ // if we have no getuid, permissions are irrelevant on this platform
9
+ if (!process.getuid) {
10
+ return {}
11
+ }
12
+
13
+ // fs methods accept URL objects with a scheme of file: so we need to unwrap
14
+ // those into an actual path string before we can resolve it
15
+ const resolved = path != null && path.href && path.origin
16
+ ? resolve(url.fileURLToPath(path))
17
+ : resolve(path)
18
+
19
+ let stat
20
+
21
+ try {
22
+ stat = fs.lstatSync(resolved)
23
+ } finally {
24
+ // if we got a stat, return its contents
25
+ if (stat) {
26
+ return { uid: stat.uid, gid: stat.gid }
27
+ }
28
+
29
+ // try the parent directory
30
+ if (resolved !== dirname(resolved)) {
31
+ return find(dirname(resolved))
32
+ }
33
+
34
+ // no more parents, never got a stat, just return an empty object
35
+ return {}
36
+ }
37
+ }
38
+
39
+ // given a path, uid, and gid update the ownership of the path if necessary
40
+ const update = (path, uid, gid) => {
41
+ // nothing to update, just exit
42
+ if (uid === undefined && gid === undefined) {
43
+ return
44
+ }
45
+
46
+ try {
47
+ // see if the permissions are already the same, if they are we don't
48
+ // need to do anything, so return early
49
+ const stat = fs.statSync(path)
50
+ if (uid === stat.uid && gid === stat.gid) {
51
+ return
52
+ }
53
+ } catch {
54
+ // ignore errors
55
+ }
56
+
57
+ try {
58
+ fs.chownSync(path, uid, gid)
59
+ } catch {
60
+ // ignore errors
61
+ }
62
+ }
63
+
64
+ // accepts a `path` and the `owner` property of an options object and normalizes
65
+ // it into an object with numerical `uid` and `gid`
66
+ const validate = (path, input) => {
67
+ let uid
68
+ let gid
69
+
70
+ if (typeof input === 'string' || typeof input === 'number') {
71
+ uid = input
72
+ gid = input
73
+ } else if (input && typeof input === 'object') {
74
+ uid = input.uid
75
+ gid = input.gid
76
+ }
77
+
78
+ if (uid === 'inherit' || gid === 'inherit') {
79
+ const owner = find(path)
80
+ if (uid === 'inherit') {
81
+ uid = owner.uid
82
+ }
83
+
84
+ if (gid === 'inherit') {
85
+ gid = owner.gid
86
+ }
87
+ }
88
+
89
+ return { uid, gid }
90
+ }
91
+
92
+ module.exports = {
93
+ find,
94
+ update,
95
+ validate,
96
+ }
@@ -1,6 +1,6 @@
1
1
  const { dirname, resolve } = require('path')
2
+ const url = require('url')
2
3
 
3
- const fileURLToPath = require('./file-url-to-path/index.js')
4
4
  const fs = require('../fs.js')
5
5
 
6
6
  // given a path, find the owner of the nearest parent
@@ -13,7 +13,7 @@ const find = async (path) => {
13
13
  // fs methods accept URL objects with a scheme of file: so we need to unwrap
14
14
  // those into an actual path string before we can resolve it
15
15
  const resolved = path != null && path.href && path.origin
16
- ? resolve(fileURLToPath(path))
16
+ ? resolve(url.fileURLToPath(path))
17
17
  : resolve(path)
18
18
 
19
19
  let stat
@@ -50,11 +50,15 @@ const update = async (path, uid, gid) => {
50
50
  if (uid === stat.uid && gid === stat.gid) {
51
51
  return
52
52
  }
53
- } catch (err) {}
53
+ } catch {
54
+ // ignore errors
55
+ }
54
56
 
55
57
  try {
56
58
  await fs.chown(path, uid, gid)
57
- } catch (err) {}
59
+ } catch {
60
+ // ignore errors
61
+ }
58
62
  }
59
63
 
60
64
  // accepts a `path` and the `owner` property of an options object and normalizes
@@ -1,22 +1,16 @@
1
1
  const fs = require('./fs.js')
2
2
  const getOptions = require('./common/get-options.js')
3
- const owner = require('./common/owner.js')
3
+ const withOwner = require('./with-owner.js')
4
4
 
5
5
  const copyFile = async (src, dest, opts) => {
6
6
  const options = getOptions(opts, {
7
- copy: ['mode', 'owner'],
7
+ copy: ['mode'],
8
8
  wrap: 'mode',
9
9
  })
10
10
 
11
- const { uid, gid } = await owner.validate(dest, options.owner)
12
-
13
11
  // the node core method as of 16.5.0 does not support the mode being in an
14
12
  // object, so we have to pass the mode value directly
15
- const result = await fs.copyFile(src, dest, options.mode)
16
-
17
- await owner.update(dest, uid, gid)
18
-
19
- return result
13
+ return withOwner(dest, () => fs.copyFile(src, dest, options.mode), opts)
20
14
  }
21
15
 
22
16
  module.exports = copyFile
@@ -1,8 +1,14 @@
1
1
  const fs = require('fs')
2
2
  const promisify = require('@gar/promisify')
3
3
 
4
- // this module returns the core fs module wrapped in a proxy that promisifies
4
+ const isLower = (s) => s === s.toLowerCase() && s !== s.toUpperCase()
5
+
6
+ const fsSync = Object.fromEntries(Object.entries(fs).filter(([k, v]) =>
7
+ typeof v === 'function' && (k.endsWith('Sync') || !isLower(k[0]))
8
+ ))
9
+
10
+ // this module returns the core fs async fns wrapped in a proxy that promisifies
5
11
  // method calls within the getter. we keep it in a separate module so that the
6
12
  // overridden methods have a consistent way to get to promisified fs methods
7
- // without creating a circular dependency
8
- module.exports = promisify(fs)
13
+ // without creating a circular dependency. the ctors and sync methods are kept untouched
14
+ module.exports = { ...promisify(fs), ...fsSync }
@@ -2,9 +2,11 @@ module.exports = {
2
2
  ...require('./fs.js'),
3
3
  copyFile: require('./copy-file.js'),
4
4
  cp: require('./cp/index.js'),
5
- mkdir: require('./mkdir/index.js'),
5
+ mkdir: require('./mkdir.js'),
6
6
  mkdtemp: require('./mkdtemp.js'),
7
7
  rm: require('./rm/index.js'),
8
8
  withTempDir: require('./with-temp-dir.js'),
9
+ withOwner: require('./with-owner.js'),
10
+ withOwnerSync: require('./with-owner-sync.js'),
9
11
  writeFile: require('./write-file.js'),
10
12
  }
@@ -0,0 +1,19 @@
1
+ const fs = require('./fs.js')
2
+ const getOptions = require('./common/get-options.js')
3
+ const withOwner = require('./with-owner.js')
4
+
5
+ // extends mkdir with the ability to specify an owner of the new dir
6
+ const mkdir = async (path, opts) => {
7
+ const options = getOptions(opts, {
8
+ copy: ['mode', 'recursive'],
9
+ wrap: 'mode',
10
+ })
11
+
12
+ return withOwner(
13
+ path,
14
+ () => fs.mkdir(path, options),
15
+ opts
16
+ )
17
+ }
18
+
19
+ module.exports = mkdir
@@ -2,11 +2,11 @@ const { dirname, sep } = require('path')
2
2
 
3
3
  const fs = require('./fs.js')
4
4
  const getOptions = require('./common/get-options.js')
5
- const owner = require('./common/owner.js')
5
+ const withOwner = require('./with-owner.js')
6
6
 
7
7
  const mkdtemp = async (prefix, opts) => {
8
8
  const options = getOptions(opts, {
9
- copy: ['encoding', 'owner'],
9
+ copy: ['encoding'],
10
10
  wrap: 'encoding',
11
11
  })
12
12
 
@@ -16,13 +16,8 @@ const mkdtemp = async (prefix, opts) => {
16
16
  // /tmp -> /tmpABCDEF, infers from /
17
17
  // /tmp/ -> /tmp/ABCDEF, infers from /tmp
18
18
  const root = prefix.endsWith(sep) ? prefix : dirname(prefix)
19
- const { uid, gid } = await owner.validate(root, options.owner)
20
19
 
21
- const result = await fs.mkdtemp(prefix, options)
22
-
23
- await owner.update(result, uid, gid)
24
-
25
- return result
20
+ return withOwner(root, () => fs.mkdtemp(prefix, options), opts)
26
21
  }
27
22
 
28
23
  module.exports = mkdtemp
@@ -0,0 +1,21 @@
1
+ const getOptions = require('./common/get-options.js')
2
+ const owner = require('./common/owner-sync.js')
3
+
4
+ const withOwnerSync = (path, fn, opts) => {
5
+ const options = getOptions(opts, {
6
+ copy: ['owner'],
7
+ })
8
+
9
+ const { uid, gid } = owner.validate(path, options.owner)
10
+
11
+ const result = fn({ uid, gid })
12
+
13
+ owner.update(path, uid, gid)
14
+ if (typeof result === 'string') {
15
+ owner.update(result, uid, gid)
16
+ }
17
+
18
+ return result
19
+ }
20
+
21
+ module.exports = withOwnerSync
@@ -0,0 +1,21 @@
1
+ const getOptions = require('./common/get-options.js')
2
+ const owner = require('./common/owner.js')
3
+
4
+ const withOwner = async (path, fn, opts) => {
5
+ const options = getOptions(opts, {
6
+ copy: ['owner'],
7
+ })
8
+
9
+ const { uid, gid } = await owner.validate(path, options.owner)
10
+
11
+ const result = await fn({ uid, gid })
12
+
13
+ await Promise.all([
14
+ owner.update(path, uid, gid),
15
+ typeof result === 'string' ? owner.update(result, uid, gid) : null,
16
+ ])
17
+
18
+ return result
19
+ }
20
+
21
+ module.exports = withOwner
@@ -1,7 +1,7 @@
1
1
  const { join, sep } = require('path')
2
2
 
3
3
  const getOptions = require('./common/get-options.js')
4
- const mkdir = require('./mkdir/index.js')
4
+ const mkdir = require('./mkdir.js')
5
5
  const mkdtemp = require('./mkdtemp.js')
6
6
  const rm = require('./rm/index.js')
7
7
 
@@ -27,7 +27,9 @@ const withTempDir = async (root, fn, opts) => {
27
27
 
28
28
  try {
29
29
  await rm(target, { force: true, recursive: true })
30
- } catch (err) {}
30
+ } catch {
31
+ // ignore errors
32
+ }
31
33
 
32
34
  if (err) {
33
35
  throw err
@@ -1,19 +1,14 @@
1
1
  const fs = require('./fs.js')
2
2
  const getOptions = require('./common/get-options.js')
3
- const owner = require('./common/owner.js')
3
+ const withOwner = require('./with-owner.js')
4
4
 
5
5
  const writeFile = async (file, data, opts) => {
6
6
  const options = getOptions(opts, {
7
- copy: ['encoding', 'mode', 'flag', 'signal', 'owner'],
7
+ copy: ['encoding', 'mode', 'flag', 'signal'],
8
8
  wrap: 'encoding',
9
9
  })
10
- const { uid, gid } = await owner.validate(file, options.owner)
11
10
 
12
- const result = await fs.writeFile(file, data, options)
13
-
14
- await owner.update(file, uid, gid)
15
-
16
- return result
11
+ return withOwner(file, () => fs.writeFile(file, data, options), opts)
17
12
  }
18
13
 
19
14
  module.exports = writeFile