pnpm 8.6.2 → 8.6.4
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.
- package/dist/node_modules/.modules.yaml +81 -24
- package/dist/node_modules/.pnpm/lock.yaml +235 -91
- package/dist/node_modules/@isaacs/cliui/LICENSE.txt +14 -0
- package/dist/node_modules/@isaacs/cliui/build/index.cjs +317 -0
- package/dist/node_modules/@isaacs/cliui/build/index.d.cts +43 -0
- package/dist/node_modules/@isaacs/cliui/build/lib/index.js +302 -0
- package/dist/node_modules/@isaacs/cliui/index.mjs +14 -0
- package/dist/node_modules/@isaacs/cliui/node_modules/string-width/index.js +54 -0
- package/dist/node_modules/@isaacs/cliui/node_modules/string-width/license +9 -0
- package/dist/node_modules/@isaacs/cliui/node_modules/string-width/package.json +59 -0
- package/dist/node_modules/@isaacs/cliui/package.json +86 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +1 -1
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +2 -2
- package/dist/node_modules/@npmcli/fs/lib/index.js +11 -10
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +4 -6
- package/dist/node_modules/@npmcli/fs/package.json +11 -9
- package/dist/node_modules/@pkgjs/parseargs/LICENSE +201 -0
- package/dist/node_modules/@pkgjs/parseargs/index.js +396 -0
- package/dist/node_modules/@pkgjs/parseargs/internal/errors.js +47 -0
- package/dist/node_modules/@pkgjs/parseargs/internal/primordials.js +393 -0
- package/dist/node_modules/@pkgjs/parseargs/internal/util.js +14 -0
- package/dist/node_modules/@pkgjs/parseargs/internal/validators.js +89 -0
- package/dist/node_modules/@pkgjs/parseargs/package.json +36 -0
- package/dist/node_modules/@pkgjs/parseargs/utils.js +198 -0
- package/dist/node_modules/ansi-regex/index.js +3 -5
- package/dist/node_modules/ansi-regex/license +1 -1
- package/dist/node_modules/ansi-regex/package.json +9 -6
- package/dist/node_modules/ansi-styles/index.js +223 -0
- package/dist/node_modules/ansi-styles/license +9 -0
- package/dist/node_modules/ansi-styles/package.json +54 -0
- package/dist/node_modules/cacache/lib/content/read.js +1 -76
- package/dist/node_modules/cacache/lib/content/rm.js +2 -4
- package/dist/node_modules/cacache/lib/content/write.js +40 -24
- package/dist/node_modules/cacache/lib/entry-index.js +25 -99
- package/dist/node_modules/cacache/lib/get.js +1 -56
- package/dist/node_modules/cacache/lib/index.js +0 -3
- package/dist/node_modules/cacache/lib/rm.js +5 -5
- package/dist/node_modules/cacache/lib/util/glob.js +7 -0
- package/dist/node_modules/cacache/lib/util/tmp.js +3 -10
- package/dist/node_modules/cacache/lib/verify.js +28 -28
- package/dist/node_modules/cacache/node_modules/glob/LICENSE +1 -1
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/package.json +4 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/bin.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/bin.js +270 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/bin.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/glob.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/glob.js +234 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/glob.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/has-magic.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/has-magic.js +27 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/has-magic.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/ignore.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/ignore.js +103 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/ignore.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/index.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/index.js +68 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/index.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/pattern.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/pattern.js +219 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/pattern.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/processor.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/processor.js +309 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/processor.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/walker.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/walker.js +358 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/cjs/src/walker.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/glob.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/glob.js +230 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/glob.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/has-magic.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/has-magic.js +23 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/has-magic.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/ignore.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/ignore.js +99 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/ignore.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/index.js +56 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/package.json +4 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/pattern.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/pattern.js +215 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/pattern.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/processor.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/processor.js +302 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/processor.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/walker.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/walker.js +352 -0
- package/dist/node_modules/cacache/node_modules/glob/dist/mjs/walker.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/glob/package.json +78 -35
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/ast.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/ast.js +589 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/ast.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/brace-expressions.js +152 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/brace-expressions.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/escape.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/escape.js +22 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/escape.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/index.js +1011 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/package.json +3 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/unescape.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/unescape.js +24 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/cjs/unescape.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +10 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/ast.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/ast.js +585 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/ast.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/brace-expressions.js +148 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/brace-expressions.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/escape.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/escape.js +18 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/escape.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/index.js +995 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/package.json +3 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/unescape.d.ts.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/unescape.js +20 -0
- package/dist/node_modules/cacache/node_modules/minimatch/dist/mjs/unescape.js.map +1 -0
- package/dist/node_modules/cacache/node_modules/minimatch/package.json +66 -15
- package/dist/node_modules/cacache/package.json +19 -21
- package/dist/node_modules/color-convert/LICENSE +21 -0
- package/dist/node_modules/color-convert/conversions.js +839 -0
- package/dist/node_modules/color-convert/index.js +81 -0
- package/dist/node_modules/color-convert/package.json +48 -0
- package/dist/node_modules/color-convert/route.js +97 -0
- package/dist/node_modules/color-name/LICENSE +8 -0
- package/dist/node_modules/color-name/index.js +152 -0
- package/dist/node_modules/color-name/package.json +28 -0
- package/dist/node_modules/cross-spawn/LICENSE +21 -0
- package/dist/node_modules/cross-spawn/index.js +39 -0
- package/dist/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/dist/node_modules/cross-spawn/lib/parse.js +91 -0
- package/dist/node_modules/cross-spawn/lib/util/escape.js +45 -0
- package/dist/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/dist/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/dist/node_modules/cross-spawn/package.json +73 -0
- package/dist/node_modules/eastasianwidth/eastasianwidth.js +311 -0
- package/dist/node_modules/eastasianwidth/package.json +18 -0
- package/dist/node_modules/emoji-regex/RGI_Emoji.js +6 -0
- package/dist/node_modules/emoji-regex/es2015/RGI_Emoji.js +6 -0
- package/dist/node_modules/emoji-regex/es2015/index.js +1 -1
- package/dist/node_modules/emoji-regex/es2015/text.js +1 -1
- package/dist/node_modules/emoji-regex/index.js +1 -1
- package/dist/node_modules/emoji-regex/package.json +13 -11
- package/dist/node_modules/emoji-regex/text.js +1 -1
- package/dist/node_modules/exponential-backoff/LICENSE +202 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js +118 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js.map +1 -0
- package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
- package/dist/node_modules/exponential-backoff/dist/options.js.map +1 -0
- package/dist/node_modules/exponential-backoff/package.json +61 -0
- package/dist/node_modules/{promise-inflight → foreground-child}/LICENSE +5 -4
- package/dist/node_modules/foreground-child/dist/cjs/all-signals.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/cjs/all-signals.js +58 -0
- package/dist/node_modules/foreground-child/dist/cjs/all-signals.js.map +1 -0
- package/dist/node_modules/foreground-child/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/cjs/index.js +154 -0
- package/dist/node_modules/foreground-child/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/foreground-child/dist/cjs/package.json +3 -0
- package/dist/node_modules/foreground-child/dist/cjs/watchdog.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/cjs/watchdog.js +43 -0
- package/dist/node_modules/foreground-child/dist/cjs/watchdog.js.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/all-signals.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/all-signals.js +52 -0
- package/dist/node_modules/foreground-child/dist/mjs/all-signals.js.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/index.js +146 -0
- package/dist/node_modules/foreground-child/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/package.json +3 -0
- package/dist/node_modules/foreground-child/dist/mjs/watchdog.d.ts.map +1 -0
- package/dist/node_modules/foreground-child/dist/mjs/watchdog.js +39 -0
- package/dist/node_modules/foreground-child/dist/mjs/watchdog.js.map +1 -0
- package/dist/node_modules/foreground-child/package.json +83 -0
- package/dist/node_modules/fs-minipass/lib/index.js +443 -0
- package/dist/node_modules/fs-minipass/package.json +28 -13
- package/dist/node_modules/gauge/node_modules/ansi-regex/index.js +10 -0
- package/dist/node_modules/gauge/node_modules/ansi-regex/license +9 -0
- package/dist/node_modules/gauge/node_modules/ansi-regex/package.json +55 -0
- package/dist/node_modules/gauge/node_modules/signal-exit/LICENSE.txt +16 -0
- package/dist/node_modules/gauge/node_modules/signal-exit/package.json +38 -0
- package/dist/node_modules/gauge/node_modules/strip-ansi/index.js +4 -0
- package/dist/node_modules/gauge/node_modules/strip-ansi/license +9 -0
- package/dist/node_modules/gauge/node_modules/strip-ansi/package.json +54 -0
- package/dist/node_modules/jackspeak/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/jackspeak/dist/cjs/index.js +723 -0
- package/dist/node_modules/jackspeak/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/jackspeak/dist/cjs/package.json +3 -0
- package/dist/node_modules/jackspeak/dist/cjs/parse-args-cjs.d.ts.map +1 -0
- package/dist/node_modules/jackspeak/dist/cjs/parse-args-cjs.js.map +1 -0
- package/dist/node_modules/jackspeak/dist/cjs/parse-args.js +42 -0
- package/dist/node_modules/jackspeak/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/jackspeak/dist/mjs/index.js +713 -0
- package/dist/node_modules/jackspeak/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/jackspeak/dist/mjs/package.json +3 -0
- package/dist/node_modules/jackspeak/dist/mjs/parse-args-esm.d.ts.map +1 -0
- package/dist/node_modules/jackspeak/dist/mjs/parse-args-esm.js.map +1 -0
- package/dist/node_modules/jackspeak/dist/mjs/parse-args.js +19 -0
- package/dist/node_modules/jackspeak/package.json +98 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +26 -1
- package/dist/node_modules/make-fetch-happen/lib/options.js +2 -0
- package/dist/node_modules/make-fetch-happen/lib/remote.js +1 -1
- package/dist/node_modules/make-fetch-happen/package.json +16 -17
- package/dist/node_modules/minipass/LICENSE +1 -1
- package/dist/node_modules/minipass/index.js +299 -246
- package/dist/node_modules/minipass/package.json +27 -7
- package/dist/node_modules/{tar → minipass-collect}/node_modules/minipass/LICENSE +1 -1
- package/dist/node_modules/minipass-collect/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/{tar → minipass-collect}/node_modules/minipass/package.json +7 -27
- package/dist/node_modules/minipass-fetch/lib/blob.js +1 -1
- package/dist/node_modules/minipass-fetch/lib/body.js +1 -1
- package/dist/node_modules/minipass-fetch/lib/index.js +15 -3
- package/dist/node_modules/minipass-fetch/lib/request.js +2 -1
- package/dist/node_modules/minipass-fetch/package.json +13 -11
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-sized/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-sized/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-sized/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minizlib/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minizlib/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minizlib/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/node-gyp/.github/workflows/tests.yml +9 -6
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +1 -1
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +13 -2
- package/dist/node_modules/node-gyp/lib/install.js +174 -92
- package/dist/node_modules/node-gyp/package.json +7 -6
- package/dist/node_modules/node-gyp/update-gyp.py +1 -1
- package/dist/node_modules/path-key/index.js +16 -0
- package/dist/node_modules/path-key/license +9 -0
- package/dist/node_modules/path-key/package.json +39 -0
- package/dist/node_modules/path-scurry/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/path-scurry/dist/cjs/index.js +1995 -0
- package/dist/node_modules/path-scurry/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/path-scurry/dist/cjs/package.json +3 -0
- package/dist/node_modules/path-scurry/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/path-scurry/dist/mjs/index.js +1960 -0
- package/dist/node_modules/path-scurry/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/path-scurry/dist/mjs/package.json +3 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/LICENSE +15 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/index.js +1395 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/index.min.js +2 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/index.min.js.map +7 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/cjs/package.json +3 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/index.js +1391 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/index.min.js +2 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/index.min.js.map +7 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/mjs/package.json +3 -0
- package/dist/node_modules/path-scurry/node_modules/lru-cache/package.json +108 -0
- package/dist/node_modules/path-scurry/package.json +87 -0
- package/dist/node_modules/semver/classes/comparator.js +2 -1
- package/dist/node_modules/semver/classes/range.js +40 -27
- package/dist/node_modules/semver/classes/semver.js +5 -3
- package/dist/node_modules/semver/functions/coerce.js +1 -1
- package/dist/node_modules/semver/functions/diff.js +31 -20
- package/dist/node_modules/semver/internal/constants.js +5 -0
- package/dist/node_modules/semver/internal/re.js +30 -4
- package/dist/node_modules/semver/package.json +4 -4
- package/dist/node_modules/shebang-command/index.js +19 -0
- package/dist/node_modules/shebang-command/license +9 -0
- package/dist/node_modules/shebang-command/package.json +34 -0
- package/dist/node_modules/shebang-regex/index.js +2 -0
- package/dist/node_modules/shebang-regex/license +9 -0
- package/dist/node_modules/shebang-regex/package.json +35 -0
- package/dist/node_modules/signal-exit/LICENSE.txt +1 -1
- package/dist/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/dist/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/dist/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/cjs/index.js +272 -0
- package/dist/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/dist/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/dist/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/dist/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/dist/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/index.js +268 -0
- package/dist/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/dist/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/dist/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/dist/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/dist/node_modules/signal-exit/package.json +87 -19
- package/dist/node_modules/ssri/lib/index.js +157 -101
- package/dist/node_modules/ssri/package.json +12 -10
- package/dist/node_modules/string-width/node_modules/ansi-regex/index.js +10 -0
- package/dist/node_modules/string-width/node_modules/ansi-regex/license +9 -0
- package/dist/node_modules/string-width/node_modules/ansi-regex/package.json +55 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/es2015/index.js +6 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/es2015/text.js +6 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/index.js +6 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/package.json +50 -0
- package/dist/node_modules/string-width/node_modules/emoji-regex/text.js +6 -0
- package/dist/node_modules/string-width/node_modules/strip-ansi/index.js +4 -0
- package/dist/node_modules/string-width/node_modules/strip-ansi/license +9 -0
- package/dist/node_modules/string-width/node_modules/strip-ansi/package.json +54 -0
- package/dist/node_modules/string-width-cjs/index.js +47 -0
- package/dist/node_modules/string-width-cjs/license +9 -0
- package/dist/node_modules/string-width-cjs/node_modules/ansi-regex/index.js +10 -0
- package/dist/node_modules/string-width-cjs/node_modules/ansi-regex/license +9 -0
- package/dist/node_modules/string-width-cjs/node_modules/ansi-regex/package.json +55 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/index.js +6 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/text.js +6 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/index.js +6 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/package.json +50 -0
- package/dist/node_modules/string-width-cjs/node_modules/emoji-regex/text.js +6 -0
- package/dist/node_modules/string-width-cjs/node_modules/strip-ansi/index.js +4 -0
- package/dist/node_modules/string-width-cjs/node_modules/strip-ansi/license +9 -0
- package/dist/node_modules/string-width-cjs/node_modules/strip-ansi/package.json +54 -0
- package/dist/node_modules/string-width-cjs/package.json +56 -0
- package/dist/node_modules/strip-ansi/index.js +13 -3
- package/dist/node_modules/strip-ansi/license +1 -1
- package/dist/node_modules/strip-ansi/package.json +10 -7
- package/dist/node_modules/strip-ansi-cjs/index.js +4 -0
- package/dist/node_modules/strip-ansi-cjs/license +9 -0
- package/dist/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js +10 -0
- package/dist/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license +9 -0
- package/dist/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json +55 -0
- package/dist/node_modules/strip-ansi-cjs/package.json +54 -0
- package/dist/node_modules/{infer-owner → tar/node_modules/fs-minipass}/LICENSE +1 -1
- package/dist/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/tar/node_modules/fs-minipass/package.json +39 -0
- package/dist/node_modules/unique-filename/package.json +12 -9
- package/dist/node_modules/unique-slug/package.json +10 -7
- package/dist/node_modules/wrap-ansi/index.js +214 -0
- package/dist/node_modules/wrap-ansi/license +9 -0
- package/dist/node_modules/wrap-ansi/node_modules/string-width/index.js +54 -0
- package/dist/node_modules/wrap-ansi/node_modules/string-width/license +9 -0
- package/dist/node_modules/wrap-ansi/node_modules/string-width/package.json +59 -0
- package/dist/node_modules/wrap-ansi/package.json +69 -0
- package/dist/node_modules/wrap-ansi-cjs/index.js +216 -0
- package/dist/node_modules/wrap-ansi-cjs/license +9 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js +10 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license +9 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json +55 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/index.js +163 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/license +9 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/package.json +56 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js +4 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license +9 -0
- package/dist/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json +54 -0
- package/dist/node_modules/wrap-ansi-cjs/package.json +62 -0
- package/dist/pnpm.cjs +30877 -17543
- package/package.json +3 -3
- package/dist/node_modules/@gar/promisify/index.js +0 -36
- package/dist/node_modules/@gar/promisify/package.json +0 -32
- package/dist/node_modules/@npmcli/fs/lib/common/owner-sync.js +0 -96
- package/dist/node_modules/@npmcli/fs/lib/common/owner.js +0 -96
- package/dist/node_modules/@npmcli/fs/lib/copy-file.js +0 -16
- package/dist/node_modules/@npmcli/fs/lib/fs.js +0 -14
- package/dist/node_modules/@npmcli/fs/lib/mkdir.js +0 -19
- package/dist/node_modules/@npmcli/fs/lib/mkdtemp.js +0 -23
- package/dist/node_modules/@npmcli/fs/lib/rm/index.js +0 -22
- package/dist/node_modules/@npmcli/fs/lib/rm/polyfill.js +0 -239
- package/dist/node_modules/@npmcli/fs/lib/with-owner-sync.js +0 -21
- package/dist/node_modules/@npmcli/fs/lib/with-owner.js +0 -21
- package/dist/node_modules/@npmcli/fs/lib/write-file.js +0 -14
- package/dist/node_modules/@npmcli/move-file/lib/index.js +0 -185
- package/dist/node_modules/@npmcli/move-file/package.json +0 -47
- package/dist/node_modules/cacache/lib/util/fix-owner.js +0 -145
- package/dist/node_modules/cacache/lib/util/move-file.js +0 -56
- package/dist/node_modules/cacache/node_modules/glob/common.js +0 -244
- package/dist/node_modules/cacache/node_modules/glob/glob.js +0 -790
- package/dist/node_modules/cacache/node_modules/glob/sync.js +0 -486
- package/dist/node_modules/cacache/node_modules/minimatch/lib/path.js +0 -4
- package/dist/node_modules/cacache/node_modules/minimatch/minimatch.js +0 -944
- package/dist/node_modules/infer-owner/index.js +0 -71
- package/dist/node_modules/infer-owner/package.json +0 -26
- package/dist/node_modules/promise-inflight/inflight.js +0 -36
- package/dist/node_modules/promise-inflight/package.json +0 -24
- package/dist/node_modules/tar/node_modules/minipass/index.js +0 -702
- /package/dist/node_modules/@npmcli/fs/lib/{errors.js → cp/errors.js} +0 -0
- /package/dist/node_modules/{signal-exit → gauge/node_modules/signal-exit}/index.js +0 -0
- /package/dist/node_modules/{signal-exit → gauge/node_modules/signal-exit}/signals.js +0 -0
- /package/dist/node_modules/{tar/node_modules/minipass → minipass}/index.mjs +0 -0
- /package/dist/node_modules/{fs-minipass → tar/node_modules/fs-minipass}/index.js +0 -0
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const events = require('events')
|
|
4
|
-
const util = require('util')
|
|
5
4
|
|
|
6
5
|
const contentPath = require('./path')
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const Minipass = require('minipass')
|
|
6
|
+
const fs = require('fs/promises')
|
|
7
|
+
const { moveFile } = require('@npmcli/fs')
|
|
8
|
+
const { Minipass } = require('minipass')
|
|
11
9
|
const Pipeline = require('minipass-pipeline')
|
|
12
10
|
const Flush = require('minipass-flush')
|
|
13
11
|
const path = require('path')
|
|
14
|
-
const rimraf = util.promisify(require('rimraf'))
|
|
15
12
|
const ssri = require('ssri')
|
|
16
13
|
const uniqueFilename = require('unique-filename')
|
|
17
14
|
const fsm = require('fs-minipass')
|
|
18
15
|
|
|
19
16
|
module.exports = write
|
|
20
17
|
|
|
18
|
+
// Cache of move operations in process so we don't duplicate
|
|
19
|
+
const moveOperations = new Map()
|
|
20
|
+
|
|
21
21
|
async function write (cache, data, opts = {}) {
|
|
22
22
|
const { algorithms, size, integrity } = opts
|
|
23
|
-
if (algorithms && algorithms.length > 1) {
|
|
24
|
-
throw new Error('opts.algorithms only supports a single algorithm for now')
|
|
25
|
-
}
|
|
26
23
|
|
|
27
24
|
if (typeof size === 'number' && data.length !== size) {
|
|
28
25
|
throw sizeError(size, data.length)
|
|
@@ -33,16 +30,19 @@ async function write (cache, data, opts = {}) {
|
|
|
33
30
|
throw checksumError(integrity, sri)
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
for (const algo in sri) {
|
|
34
|
+
const tmp = await makeTmp(cache, opts)
|
|
35
|
+
const hash = sri[algo].toString()
|
|
36
|
+
try {
|
|
37
|
+
await fs.writeFile(tmp.target, data, { flag: 'wx' })
|
|
38
|
+
await moveToDestination(tmp, cache, hash, opts)
|
|
39
|
+
} finally {
|
|
40
|
+
if (!tmp.moved) {
|
|
41
|
+
await fs.rm(tmp.target, { recursive: true, force: true })
|
|
42
|
+
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
45
|
+
return { integrity: sri, size: data.length }
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
module.exports.stream = writeStream
|
|
@@ -111,7 +111,7 @@ async function handleContent (inputStream, cache, opts) {
|
|
|
111
111
|
return res
|
|
112
112
|
} finally {
|
|
113
113
|
if (!tmp.moved) {
|
|
114
|
-
await
|
|
114
|
+
await fs.rm(tmp.target, { recursive: true, force: true })
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -152,7 +152,7 @@ async function pipeToTmp (inputStream, cache, tmpTarget, opts) {
|
|
|
152
152
|
|
|
153
153
|
async function makeTmp (cache, opts) {
|
|
154
154
|
const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
|
|
155
|
-
await
|
|
155
|
+
await fs.mkdir(path.dirname(tmpTarget), { recursive: true })
|
|
156
156
|
return {
|
|
157
157
|
target: tmpTarget,
|
|
158
158
|
moved: false,
|
|
@@ -162,11 +162,27 @@ async function makeTmp (cache, opts) {
|
|
|
162
162
|
async function moveToDestination (tmp, cache, sri, opts) {
|
|
163
163
|
const destination = contentPath(cache, sri)
|
|
164
164
|
const destDir = path.dirname(destination)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
if (moveOperations.has(destination)) {
|
|
166
|
+
return moveOperations.get(destination)
|
|
167
|
+
}
|
|
168
|
+
moveOperations.set(
|
|
169
|
+
destination,
|
|
170
|
+
fs.mkdir(destDir, { recursive: true })
|
|
171
|
+
.then(async () => {
|
|
172
|
+
await moveFile(tmp.target, destination, { overwrite: false })
|
|
173
|
+
tmp.moved = true
|
|
174
|
+
return tmp.moved
|
|
175
|
+
})
|
|
176
|
+
.catch(err => {
|
|
177
|
+
if (!err.message.startsWith('The destination file exists')) {
|
|
178
|
+
throw Object.assign(err, { code: 'EEXIST' })
|
|
179
|
+
}
|
|
180
|
+
}).finally(() => {
|
|
181
|
+
moveOperations.delete(destination)
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
)
|
|
185
|
+
return moveOperations.get(destination)
|
|
170
186
|
}
|
|
171
187
|
|
|
172
188
|
function sizeError (expected, found) {
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const util = require('util')
|
|
4
3
|
const crypto = require('crypto')
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const {
|
|
5
|
+
appendFile,
|
|
6
|
+
mkdir,
|
|
7
|
+
readFile,
|
|
8
|
+
readdir,
|
|
9
|
+
rm,
|
|
10
|
+
writeFile,
|
|
11
|
+
} = require('fs/promises')
|
|
12
|
+
const { Minipass } = require('minipass')
|
|
7
13
|
const path = require('path')
|
|
8
14
|
const ssri = require('ssri')
|
|
9
15
|
const uniqueFilename = require('unique-filename')
|
|
10
16
|
|
|
11
17
|
const contentPath = require('./content/path')
|
|
12
|
-
const fixOwner = require('./util/fix-owner')
|
|
13
18
|
const hashToSegments = require('./util/hash-to-segments')
|
|
14
19
|
const indexV = require('../package.json')['cache-version'].index
|
|
15
|
-
const moveFile = require('@npmcli/
|
|
16
|
-
const _rimraf = require('rimraf')
|
|
17
|
-
const rimraf = util.promisify(_rimraf)
|
|
18
|
-
rimraf.sync = _rimraf.sync
|
|
20
|
+
const { moveFile } = require('@npmcli/fs')
|
|
19
21
|
|
|
20
22
|
module.exports.NotFoundError = class NotFoundError extends Error {
|
|
21
23
|
constructor (cache, key) {
|
|
@@ -66,7 +68,7 @@ async function compact (cache, key, matchFn, opts = {}) {
|
|
|
66
68
|
|
|
67
69
|
const setup = async () => {
|
|
68
70
|
const target = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix)
|
|
69
|
-
await
|
|
71
|
+
await mkdir(path.dirname(target), { recursive: true })
|
|
70
72
|
return {
|
|
71
73
|
target,
|
|
72
74
|
moved: false,
|
|
@@ -75,24 +77,17 @@ async function compact (cache, key, matchFn, opts = {}) {
|
|
|
75
77
|
|
|
76
78
|
const teardown = async (tmp) => {
|
|
77
79
|
if (!tmp.moved) {
|
|
78
|
-
return
|
|
80
|
+
return rm(tmp.target, { recursive: true, force: true })
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
const write = async (tmp) => {
|
|
83
|
-
await
|
|
84
|
-
await
|
|
85
|
+
await writeFile(tmp.target, newIndex, { flag: 'wx' })
|
|
86
|
+
await mkdir(path.dirname(bucket), { recursive: true })
|
|
85
87
|
// we use @npmcli/move-file directly here because we
|
|
86
88
|
// want to overwrite the existing file
|
|
87
89
|
await moveFile(tmp.target, bucket)
|
|
88
90
|
tmp.moved = true
|
|
89
|
-
try {
|
|
90
|
-
await fixOwner.chownr(cache, bucket)
|
|
91
|
-
} catch (err) {
|
|
92
|
-
if (err.code !== 'ENOENT') {
|
|
93
|
-
throw err
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
// write the file atomically
|
|
@@ -114,17 +109,17 @@ async function compact (cache, key, matchFn, opts = {}) {
|
|
|
114
109
|
module.exports.insert = insert
|
|
115
110
|
|
|
116
111
|
async function insert (cache, key, integrity, opts = {}) {
|
|
117
|
-
const { metadata, size } = opts
|
|
112
|
+
const { metadata, size, time } = opts
|
|
118
113
|
const bucket = bucketPath(cache, key)
|
|
119
114
|
const entry = {
|
|
120
115
|
key,
|
|
121
116
|
integrity: integrity && ssri.stringify(integrity),
|
|
122
|
-
time: Date.now(),
|
|
117
|
+
time: time || Date.now(),
|
|
123
118
|
size,
|
|
124
119
|
metadata,
|
|
125
120
|
}
|
|
126
121
|
try {
|
|
127
|
-
await
|
|
122
|
+
await mkdir(path.dirname(bucket), { recursive: true })
|
|
128
123
|
const stringified = JSON.stringify(entry)
|
|
129
124
|
// NOTE - Cleverness ahoy!
|
|
130
125
|
//
|
|
@@ -134,44 +129,13 @@ async function insert (cache, key, integrity, opts = {}) {
|
|
|
134
129
|
//
|
|
135
130
|
// Thanks to @isaacs for the whiteboarding session that ended up with
|
|
136
131
|
// this.
|
|
137
|
-
await
|
|
138
|
-
await fixOwner.chownr(cache, bucket)
|
|
132
|
+
await appendFile(bucket, `\n${hashEntry(stringified)}\t${stringified}`)
|
|
139
133
|
} catch (err) {
|
|
140
134
|
if (err.code === 'ENOENT') {
|
|
141
135
|
return undefined
|
|
142
136
|
}
|
|
143
137
|
|
|
144
138
|
throw err
|
|
145
|
-
// There's a class of race conditions that happen when things get deleted
|
|
146
|
-
// during fixOwner, or between the two mkdirfix/chownr calls.
|
|
147
|
-
//
|
|
148
|
-
// It's perfectly fine to just not bother in those cases and lie
|
|
149
|
-
// that the index entry was written. Because it's a cache.
|
|
150
|
-
}
|
|
151
|
-
return formatEntry(cache, entry)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
module.exports.insert.sync = insertSync
|
|
155
|
-
|
|
156
|
-
function insertSync (cache, key, integrity, opts = {}) {
|
|
157
|
-
const { metadata, size } = opts
|
|
158
|
-
const bucket = bucketPath(cache, key)
|
|
159
|
-
const entry = {
|
|
160
|
-
key,
|
|
161
|
-
integrity: integrity && ssri.stringify(integrity),
|
|
162
|
-
time: Date.now(),
|
|
163
|
-
size,
|
|
164
|
-
metadata,
|
|
165
|
-
}
|
|
166
|
-
fixOwner.mkdirfix.sync(cache, path.dirname(bucket))
|
|
167
|
-
const stringified = JSON.stringify(entry)
|
|
168
|
-
fs.appendFileSync(bucket, `\n${hashEntry(stringified)}\t${stringified}`)
|
|
169
|
-
try {
|
|
170
|
-
fixOwner.chownr.sync(cache, bucket)
|
|
171
|
-
} catch (err) {
|
|
172
|
-
if (err.code !== 'ENOENT') {
|
|
173
|
-
throw err
|
|
174
|
-
}
|
|
175
139
|
}
|
|
176
140
|
return formatEntry(cache, entry)
|
|
177
141
|
}
|
|
@@ -198,27 +162,6 @@ async function find (cache, key) {
|
|
|
198
162
|
}
|
|
199
163
|
}
|
|
200
164
|
|
|
201
|
-
module.exports.find.sync = findSync
|
|
202
|
-
|
|
203
|
-
function findSync (cache, key) {
|
|
204
|
-
const bucket = bucketPath(cache, key)
|
|
205
|
-
try {
|
|
206
|
-
return bucketEntriesSync(bucket).reduce((latest, next) => {
|
|
207
|
-
if (next && next.key === key) {
|
|
208
|
-
return formatEntry(cache, next)
|
|
209
|
-
} else {
|
|
210
|
-
return latest
|
|
211
|
-
}
|
|
212
|
-
}, null)
|
|
213
|
-
} catch (err) {
|
|
214
|
-
if (err.code === 'ENOENT') {
|
|
215
|
-
return null
|
|
216
|
-
} else {
|
|
217
|
-
throw err
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
165
|
module.exports.delete = del
|
|
223
166
|
|
|
224
167
|
function del (cache, key, opts = {}) {
|
|
@@ -227,18 +170,7 @@ function del (cache, key, opts = {}) {
|
|
|
227
170
|
}
|
|
228
171
|
|
|
229
172
|
const bucket = bucketPath(cache, key)
|
|
230
|
-
return
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
module.exports.delete.sync = delSync
|
|
234
|
-
|
|
235
|
-
function delSync (cache, key, opts = {}) {
|
|
236
|
-
if (!opts.removeFully) {
|
|
237
|
-
return insertSync(cache, key, null, opts)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const bucket = bucketPath(cache, key)
|
|
241
|
-
return rimraf.sync(bucket)
|
|
173
|
+
return rm(bucket, { recursive: true, force: true })
|
|
242
174
|
}
|
|
243
175
|
|
|
244
176
|
module.exports.lsStream = lsStream
|
|
@@ -304,14 +236,7 @@ async function ls (cache) {
|
|
|
304
236
|
module.exports.bucketEntries = bucketEntries
|
|
305
237
|
|
|
306
238
|
async function bucketEntries (bucket, filter) {
|
|
307
|
-
const data = await
|
|
308
|
-
return _bucketEntries(data, filter)
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
module.exports.bucketEntries.sync = bucketEntriesSync
|
|
312
|
-
|
|
313
|
-
function bucketEntriesSync (bucket, filter) {
|
|
314
|
-
const data = fs.readFileSync(bucket, 'utf8')
|
|
239
|
+
const data = await readFile(bucket, 'utf8')
|
|
315
240
|
return _bucketEntries(data, filter)
|
|
316
241
|
}
|
|
317
242
|
|
|
@@ -331,10 +256,11 @@ function _bucketEntries (data, filter) {
|
|
|
331
256
|
let obj
|
|
332
257
|
try {
|
|
333
258
|
obj = JSON.parse(pieces[1])
|
|
334
|
-
} catch (
|
|
335
|
-
//
|
|
336
|
-
return
|
|
259
|
+
} catch (_) {
|
|
260
|
+
// eslint-ignore-next-line no-empty-block
|
|
337
261
|
}
|
|
262
|
+
// coverage disabled here, no need to test with an entry that parses to something falsey
|
|
263
|
+
// istanbul ignore else
|
|
338
264
|
if (obj) {
|
|
339
265
|
entries.push(obj)
|
|
340
266
|
}
|
|
@@ -394,7 +320,7 @@ function formatEntry (cache, entry, keepAll) {
|
|
|
394
320
|
}
|
|
395
321
|
|
|
396
322
|
function readdirOrEmpty (dir) {
|
|
397
|
-
return
|
|
323
|
+
return readdir(dir).catch((err) => {
|
|
398
324
|
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {
|
|
399
325
|
return []
|
|
400
326
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const Collect = require('minipass-collect')
|
|
4
|
-
const Minipass = require('minipass')
|
|
4
|
+
const { Minipass } = require('minipass')
|
|
5
5
|
const Pipeline = require('minipass-pipeline')
|
|
6
6
|
|
|
7
7
|
const index = require('./entry-index')
|
|
@@ -53,61 +53,6 @@ async function getDataByDigest (cache, key, opts = {}) {
|
|
|
53
53
|
}
|
|
54
54
|
module.exports.byDigest = getDataByDigest
|
|
55
55
|
|
|
56
|
-
function getDataSync (cache, key, opts = {}) {
|
|
57
|
-
const { integrity, memoize, size } = opts
|
|
58
|
-
const memoized = memo.get(cache, key, opts)
|
|
59
|
-
|
|
60
|
-
if (memoized && memoize !== false) {
|
|
61
|
-
return {
|
|
62
|
-
metadata: memoized.entry.metadata,
|
|
63
|
-
data: memoized.data,
|
|
64
|
-
integrity: memoized.entry.integrity,
|
|
65
|
-
size: memoized.entry.size,
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
const entry = index.find.sync(cache, key, opts)
|
|
69
|
-
if (!entry) {
|
|
70
|
-
throw new index.NotFoundError(cache, key)
|
|
71
|
-
}
|
|
72
|
-
const data = read.sync(cache, entry.integrity, {
|
|
73
|
-
integrity: integrity,
|
|
74
|
-
size: size,
|
|
75
|
-
})
|
|
76
|
-
const res = {
|
|
77
|
-
metadata: entry.metadata,
|
|
78
|
-
data: data,
|
|
79
|
-
size: entry.size,
|
|
80
|
-
integrity: entry.integrity,
|
|
81
|
-
}
|
|
82
|
-
if (memoize) {
|
|
83
|
-
memo.put(cache, entry, res.data, opts)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return res
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
module.exports.sync = getDataSync
|
|
90
|
-
|
|
91
|
-
function getDataByDigestSync (cache, digest, opts = {}) {
|
|
92
|
-
const { integrity, memoize, size } = opts
|
|
93
|
-
const memoized = memo.get.byDigest(cache, digest, opts)
|
|
94
|
-
|
|
95
|
-
if (memoized && memoize !== false) {
|
|
96
|
-
return memoized
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const res = read.sync(cache, digest, {
|
|
100
|
-
integrity: integrity,
|
|
101
|
-
size: size,
|
|
102
|
-
})
|
|
103
|
-
if (memoize) {
|
|
104
|
-
memo.put.byDigest(cache, digest, res, opts)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return res
|
|
108
|
-
}
|
|
109
|
-
module.exports.sync.byDigest = getDataByDigestSync
|
|
110
|
-
|
|
111
56
|
const getMemoizedStream = (memoized) => {
|
|
112
57
|
const stream = new Minipass()
|
|
113
58
|
stream.on('newListener', function (ev, cb) {
|
|
@@ -17,15 +17,12 @@ module.exports.ls.stream = index.lsStream
|
|
|
17
17
|
|
|
18
18
|
module.exports.get = get
|
|
19
19
|
module.exports.get.byDigest = get.byDigest
|
|
20
|
-
module.exports.get.sync = get.sync
|
|
21
|
-
module.exports.get.sync.byDigest = get.sync.byDigest
|
|
22
20
|
module.exports.get.stream = get.stream
|
|
23
21
|
module.exports.get.stream.byDigest = get.stream.byDigest
|
|
24
22
|
module.exports.get.copy = get.copy
|
|
25
23
|
module.exports.get.copy.byDigest = get.copy.byDigest
|
|
26
24
|
module.exports.get.info = get.info
|
|
27
25
|
module.exports.get.hasContent = get.hasContent
|
|
28
|
-
module.exports.get.hasContent.sync = get.hasContent.sync
|
|
29
26
|
|
|
30
27
|
module.exports.put = put
|
|
31
28
|
module.exports.put.stream = put.stream
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const { rm } = require('fs/promises')
|
|
4
|
+
const glob = require('./util/glob.js')
|
|
5
5
|
const index = require('./entry-index')
|
|
6
6
|
const memo = require('./memoization')
|
|
7
7
|
const path = require('path')
|
|
8
|
-
const rimraf = util.promisify(require('rimraf'))
|
|
9
8
|
const rmContent = require('./content/rm')
|
|
10
9
|
|
|
11
10
|
module.exports = entry
|
|
@@ -25,7 +24,8 @@ function content (cache, integrity) {
|
|
|
25
24
|
|
|
26
25
|
module.exports.all = all
|
|
27
26
|
|
|
28
|
-
function all (cache) {
|
|
27
|
+
async function all (cache) {
|
|
29
28
|
memo.clearMemoized()
|
|
30
|
-
|
|
29
|
+
const paths = await glob(path.join(cache, '*(content-*|index-*)'), { silent: true, nosort: true })
|
|
30
|
+
return Promise.all(paths.map((p) => rm(p, { recursive: true, force: true })))
|
|
31
31
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const fixOwner = require('./fix-owner')
|
|
3
|
+
const { withTempDir } = require('@npmcli/fs')
|
|
4
|
+
const fs = require('fs/promises')
|
|
6
5
|
const path = require('path')
|
|
7
6
|
|
|
8
7
|
module.exports.mkdir = mktmpdir
|
|
@@ -23,11 +22,5 @@ function withTmp (cache, opts, cb) {
|
|
|
23
22
|
cb = opts
|
|
24
23
|
opts = {}
|
|
25
24
|
}
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports.fix = fixtmpdir
|
|
30
|
-
|
|
31
|
-
function fixtmpdir (cache) {
|
|
32
|
-
return fixOwner(cache, path.join(cache, 'tmp'))
|
|
25
|
+
return withTempDir(path.join(cache, 'tmp'), cb, opts)
|
|
33
26
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const {
|
|
4
|
+
mkdir,
|
|
5
|
+
readFile,
|
|
6
|
+
rm,
|
|
7
|
+
stat,
|
|
8
|
+
truncate,
|
|
9
|
+
writeFile,
|
|
10
|
+
} = require('fs/promises')
|
|
5
11
|
const pMap = require('p-map')
|
|
6
12
|
const contentPath = require('./content/path')
|
|
7
|
-
const fixOwner = require('./util/fix-owner')
|
|
8
|
-
const fs = require('@npmcli/fs')
|
|
9
13
|
const fsm = require('fs-minipass')
|
|
10
|
-
const glob =
|
|
14
|
+
const glob = require('./util/glob.js')
|
|
11
15
|
const index = require('./entry-index')
|
|
12
16
|
const path = require('path')
|
|
13
|
-
const rimraf = util.promisify(require('rimraf'))
|
|
14
17
|
const ssri = require('ssri')
|
|
15
18
|
|
|
16
|
-
const globify = pattern => pattern.split('\\').join('/')
|
|
17
|
-
|
|
18
19
|
const hasOwnProperty = (obj, key) =>
|
|
19
20
|
Object.prototype.hasOwnProperty.call(obj, key)
|
|
20
21
|
|
|
@@ -77,9 +78,7 @@ async function markEndTime (cache, opts) {
|
|
|
77
78
|
|
|
78
79
|
async function fixPerms (cache, opts) {
|
|
79
80
|
opts.log.silly('verify', 'fixing cache permissions')
|
|
80
|
-
await
|
|
81
|
-
// TODO - fix file permissions too
|
|
82
|
-
await fixOwner.chownr(cache, cache)
|
|
81
|
+
await mkdir(cache, { recursive: true })
|
|
83
82
|
return null
|
|
84
83
|
}
|
|
85
84
|
|
|
@@ -90,7 +89,7 @@ async function fixPerms (cache, opts) {
|
|
|
90
89
|
// 2. Mark each integrity value as "live"
|
|
91
90
|
// 3. Read entire filesystem tree in `content-vX/` dir
|
|
92
91
|
// 4. If content is live, verify its checksum and delete it if it fails
|
|
93
|
-
// 5. If content is not marked as live,
|
|
92
|
+
// 5. If content is not marked as live, rm it.
|
|
94
93
|
//
|
|
95
94
|
async function garbageCollect (cache, opts) {
|
|
96
95
|
opts.log.silly('verify', 'garbage collecting content')
|
|
@@ -101,13 +100,17 @@ async function garbageCollect (cache, opts) {
|
|
|
101
100
|
return
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
// integrity is stringified, re-parse it so we can get each hash
|
|
104
|
+
const integrity = ssri.parse(entry.integrity)
|
|
105
|
+
for (const algo in integrity) {
|
|
106
|
+
liveContent.add(integrity[algo].toString())
|
|
107
|
+
}
|
|
105
108
|
})
|
|
106
109
|
await new Promise((resolve, reject) => {
|
|
107
110
|
indexStream.on('end', resolve).on('error', reject)
|
|
108
111
|
})
|
|
109
112
|
const contentDir = contentPath.contentDir(cache)
|
|
110
|
-
const files = await glob(
|
|
113
|
+
const files = await glob(path.join(contentDir, '**'), {
|
|
111
114
|
follow: false,
|
|
112
115
|
nodir: true,
|
|
113
116
|
nosort: true,
|
|
@@ -139,8 +142,8 @@ async function garbageCollect (cache, opts) {
|
|
|
139
142
|
} else {
|
|
140
143
|
// No entries refer to this content. We can delete.
|
|
141
144
|
stats.reclaimedCount++
|
|
142
|
-
const s = await
|
|
143
|
-
await
|
|
145
|
+
const s = await stat(f)
|
|
146
|
+
await rm(f, { recursive: true, force: true })
|
|
144
147
|
stats.reclaimedSize += s.size
|
|
145
148
|
}
|
|
146
149
|
return stats
|
|
@@ -153,7 +156,7 @@ async function garbageCollect (cache, opts) {
|
|
|
153
156
|
async function verifyContent (filepath, sri) {
|
|
154
157
|
const contentInfo = {}
|
|
155
158
|
try {
|
|
156
|
-
const { size } = await
|
|
159
|
+
const { size } = await stat(filepath)
|
|
157
160
|
contentInfo.size = size
|
|
158
161
|
contentInfo.valid = true
|
|
159
162
|
await ssri.checkStream(new fsm.ReadStream(filepath), sri)
|
|
@@ -165,7 +168,7 @@ async function verifyContent (filepath, sri) {
|
|
|
165
168
|
throw err
|
|
166
169
|
}
|
|
167
170
|
|
|
168
|
-
await
|
|
171
|
+
await rm(filepath, { recursive: true, force: true })
|
|
169
172
|
contentInfo.valid = false
|
|
170
173
|
}
|
|
171
174
|
return contentInfo
|
|
@@ -211,16 +214,17 @@ async function rebuildIndex (cache, opts) {
|
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
async function rebuildBucket (cache, bucket, stats, opts) {
|
|
214
|
-
await
|
|
217
|
+
await truncate(bucket._path)
|
|
215
218
|
// This needs to be serialized because cacache explicitly
|
|
216
219
|
// lets very racy bucket conflicts clobber each other.
|
|
217
220
|
for (const entry of bucket) {
|
|
218
221
|
const content = contentPath(cache, entry.integrity)
|
|
219
222
|
try {
|
|
220
|
-
await
|
|
223
|
+
await stat(content)
|
|
221
224
|
await index.insert(cache, entry.key, entry.integrity, {
|
|
222
225
|
metadata: entry.metadata,
|
|
223
226
|
size: entry.size,
|
|
227
|
+
time: entry.time,
|
|
224
228
|
})
|
|
225
229
|
stats.totalEntries++
|
|
226
230
|
} catch (err) {
|
|
@@ -236,22 +240,18 @@ async function rebuildBucket (cache, bucket, stats, opts) {
|
|
|
236
240
|
|
|
237
241
|
function cleanTmp (cache, opts) {
|
|
238
242
|
opts.log.silly('verify', 'cleaning tmp directory')
|
|
239
|
-
return
|
|
243
|
+
return rm(path.join(cache, 'tmp'), { recursive: true, force: true })
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
function writeVerifile (cache, opts) {
|
|
246
|
+
async function writeVerifile (cache, opts) {
|
|
243
247
|
const verifile = path.join(cache, '_lastverified')
|
|
244
248
|
opts.log.silly('verify', 'writing verifile to ' + verifile)
|
|
245
|
-
|
|
246
|
-
return fs.writeFile(verifile, `${Date.now()}`)
|
|
247
|
-
} finally {
|
|
248
|
-
fixOwner.chownr.sync(cache, verifile)
|
|
249
|
-
}
|
|
249
|
+
return writeFile(verifile, `${Date.now()}`)
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
module.exports.lastRun = lastRun
|
|
253
253
|
|
|
254
254
|
async function lastRun (cache) {
|
|
255
|
-
const data = await
|
|
255
|
+
const data = await readFile(path.join(cache, '_lastverified'), { encoding: 'utf8' })
|
|
256
256
|
return new Date(+data)
|
|
257
257
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The ISC License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2009-
|
|
3
|
+
Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
6
|
purpose with or without fee is hereby granted, provided that the above
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":""}
|