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
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// synchronous utility for filtering entries and calculating subwalks
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
|
|
5
|
+
const minimatch_1 = require("minimatch");
|
|
6
|
+
/**
|
|
7
|
+
* A cache of which patterns have been processed for a given Path
|
|
8
|
+
*/
|
|
9
|
+
class HasWalkedCache {
|
|
10
|
+
store;
|
|
11
|
+
constructor(store = new Map()) {
|
|
12
|
+
this.store = store;
|
|
13
|
+
}
|
|
14
|
+
copy() {
|
|
15
|
+
return new HasWalkedCache(new Map(this.store));
|
|
16
|
+
}
|
|
17
|
+
hasWalked(target, pattern) {
|
|
18
|
+
return this.store.get(target.fullpath())?.has(pattern.globString());
|
|
19
|
+
}
|
|
20
|
+
storeWalked(target, pattern) {
|
|
21
|
+
const fullpath = target.fullpath();
|
|
22
|
+
const cached = this.store.get(fullpath);
|
|
23
|
+
if (cached)
|
|
24
|
+
cached.add(pattern.globString());
|
|
25
|
+
else
|
|
26
|
+
this.store.set(fullpath, new Set([pattern.globString()]));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.HasWalkedCache = HasWalkedCache;
|
|
30
|
+
/**
|
|
31
|
+
* A record of which paths have been matched in a given walk step,
|
|
32
|
+
* and whether they only are considered a match if they are a directory,
|
|
33
|
+
* and whether their absolute or relative path should be returned.
|
|
34
|
+
*/
|
|
35
|
+
class MatchRecord {
|
|
36
|
+
store = new Map();
|
|
37
|
+
add(target, absolute, ifDir) {
|
|
38
|
+
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
|
39
|
+
const current = this.store.get(target);
|
|
40
|
+
this.store.set(target, current === undefined ? n : n & current);
|
|
41
|
+
}
|
|
42
|
+
// match, absolute, ifdir
|
|
43
|
+
entries() {
|
|
44
|
+
return [...this.store.entries()].map(([path, n]) => [
|
|
45
|
+
path,
|
|
46
|
+
!!(n & 2),
|
|
47
|
+
!!(n & 1),
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.MatchRecord = MatchRecord;
|
|
52
|
+
/**
|
|
53
|
+
* A collection of patterns that must be processed in a subsequent step
|
|
54
|
+
* for a given path.
|
|
55
|
+
*/
|
|
56
|
+
class SubWalks {
|
|
57
|
+
store = new Map();
|
|
58
|
+
add(target, pattern) {
|
|
59
|
+
if (!target.canReaddir()) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const subs = this.store.get(target);
|
|
63
|
+
if (subs) {
|
|
64
|
+
if (!subs.find(p => p.globString() === pattern.globString())) {
|
|
65
|
+
subs.push(pattern);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
this.store.set(target, [pattern]);
|
|
70
|
+
}
|
|
71
|
+
get(target) {
|
|
72
|
+
const subs = this.store.get(target);
|
|
73
|
+
/* c8 ignore start */
|
|
74
|
+
if (!subs) {
|
|
75
|
+
throw new Error('attempting to walk unknown path');
|
|
76
|
+
}
|
|
77
|
+
/* c8 ignore stop */
|
|
78
|
+
return subs;
|
|
79
|
+
}
|
|
80
|
+
entries() {
|
|
81
|
+
return this.keys().map(k => [k, this.store.get(k)]);
|
|
82
|
+
}
|
|
83
|
+
keys() {
|
|
84
|
+
return [...this.store.keys()].filter(t => t.canReaddir());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.SubWalks = SubWalks;
|
|
88
|
+
/**
|
|
89
|
+
* The class that processes patterns for a given path.
|
|
90
|
+
*
|
|
91
|
+
* Handles child entry filtering, and determining whether a path's
|
|
92
|
+
* directory contents must be read.
|
|
93
|
+
*/
|
|
94
|
+
class Processor {
|
|
95
|
+
hasWalkedCache;
|
|
96
|
+
matches = new MatchRecord();
|
|
97
|
+
subwalks = new SubWalks();
|
|
98
|
+
patterns;
|
|
99
|
+
follow;
|
|
100
|
+
dot;
|
|
101
|
+
opts;
|
|
102
|
+
constructor(opts, hasWalkedCache) {
|
|
103
|
+
this.opts = opts;
|
|
104
|
+
this.follow = !!opts.follow;
|
|
105
|
+
this.dot = !!opts.dot;
|
|
106
|
+
this.hasWalkedCache = hasWalkedCache
|
|
107
|
+
? hasWalkedCache.copy()
|
|
108
|
+
: new HasWalkedCache();
|
|
109
|
+
}
|
|
110
|
+
processPatterns(target, patterns) {
|
|
111
|
+
this.patterns = patterns;
|
|
112
|
+
const processingSet = patterns.map(p => [target, p]);
|
|
113
|
+
// map of paths to the magic-starting subwalks they need to walk
|
|
114
|
+
// first item in patterns is the filter
|
|
115
|
+
for (let [t, pattern] of processingSet) {
|
|
116
|
+
this.hasWalkedCache.storeWalked(t, pattern);
|
|
117
|
+
const root = pattern.root();
|
|
118
|
+
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
|
119
|
+
// start absolute patterns at root
|
|
120
|
+
if (root) {
|
|
121
|
+
t = t.resolve(root === '/' && this.opts.root !== undefined
|
|
122
|
+
? this.opts.root
|
|
123
|
+
: root);
|
|
124
|
+
const rest = pattern.rest();
|
|
125
|
+
if (!rest) {
|
|
126
|
+
this.matches.add(t, true, false);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
pattern = rest;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (t.isENOENT())
|
|
134
|
+
continue;
|
|
135
|
+
let p;
|
|
136
|
+
let rest;
|
|
137
|
+
let changed = false;
|
|
138
|
+
while (typeof (p = pattern.pattern()) === 'string' &&
|
|
139
|
+
(rest = pattern.rest())) {
|
|
140
|
+
const c = t.resolve(p);
|
|
141
|
+
// we can be reasonably sure that .. is a readable dir
|
|
142
|
+
if (c.isUnknown() && p !== '..')
|
|
143
|
+
break;
|
|
144
|
+
t = c;
|
|
145
|
+
pattern = rest;
|
|
146
|
+
changed = true;
|
|
147
|
+
}
|
|
148
|
+
p = pattern.pattern();
|
|
149
|
+
rest = pattern.rest();
|
|
150
|
+
if (changed) {
|
|
151
|
+
if (this.hasWalkedCache.hasWalked(t, pattern))
|
|
152
|
+
continue;
|
|
153
|
+
this.hasWalkedCache.storeWalked(t, pattern);
|
|
154
|
+
}
|
|
155
|
+
// now we have either a final string for a known entry,
|
|
156
|
+
// more strings for an unknown entry,
|
|
157
|
+
// or a pattern starting with magic, mounted on t.
|
|
158
|
+
if (typeof p === 'string') {
|
|
159
|
+
// must be final entry
|
|
160
|
+
if (!rest) {
|
|
161
|
+
const ifDir = p === '..' || p === '' || p === '.';
|
|
162
|
+
this.matches.add(t.resolve(p), absolute, ifDir);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this.subwalks.add(t, pattern);
|
|
166
|
+
}
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
else if (p === minimatch_1.GLOBSTAR) {
|
|
170
|
+
// if no rest, match and subwalk pattern
|
|
171
|
+
// if rest, process rest and subwalk pattern
|
|
172
|
+
// if it's a symlink, but we didn't get here by way of a
|
|
173
|
+
// globstar match (meaning it's the first time THIS globstar
|
|
174
|
+
// has traversed a symlink), then we follow it. Otherwise, stop.
|
|
175
|
+
if (!t.isSymbolicLink() ||
|
|
176
|
+
this.follow ||
|
|
177
|
+
pattern.checkFollowGlobstar()) {
|
|
178
|
+
this.subwalks.add(t, pattern);
|
|
179
|
+
}
|
|
180
|
+
const rp = rest?.pattern();
|
|
181
|
+
const rrest = rest?.rest();
|
|
182
|
+
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
|
183
|
+
// only HAS to be a dir if it ends in **/ or **/.
|
|
184
|
+
// but ending in ** will match files as well.
|
|
185
|
+
this.matches.add(t, absolute, rp === '' || rp === '.');
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
if (rp === '..') {
|
|
189
|
+
// this would mean you're matching **/.. at the fs root,
|
|
190
|
+
// and no thanks, I'm not gonna test that specific case.
|
|
191
|
+
/* c8 ignore start */
|
|
192
|
+
const tp = t.parent || t;
|
|
193
|
+
/* c8 ignore stop */
|
|
194
|
+
if (!rrest)
|
|
195
|
+
this.matches.add(tp, absolute, true);
|
|
196
|
+
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
|
197
|
+
this.subwalks.add(tp, rrest);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else if (p instanceof RegExp) {
|
|
203
|
+
this.subwalks.add(t, pattern);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return this;
|
|
207
|
+
}
|
|
208
|
+
subwalkTargets() {
|
|
209
|
+
return this.subwalks.keys();
|
|
210
|
+
}
|
|
211
|
+
child() {
|
|
212
|
+
return new Processor(this.opts, this.hasWalkedCache);
|
|
213
|
+
}
|
|
214
|
+
// return a new Processor containing the subwalks for each
|
|
215
|
+
// child entry, and a set of matches, and
|
|
216
|
+
// a hasWalkedCache that's a copy of this one
|
|
217
|
+
// then we're going to call
|
|
218
|
+
filterEntries(parent, entries) {
|
|
219
|
+
const patterns = this.subwalks.get(parent);
|
|
220
|
+
// put matches and entry walks into the results processor
|
|
221
|
+
const results = this.child();
|
|
222
|
+
for (const e of entries) {
|
|
223
|
+
for (const pattern of patterns) {
|
|
224
|
+
const absolute = pattern.isAbsolute();
|
|
225
|
+
const p = pattern.pattern();
|
|
226
|
+
const rest = pattern.rest();
|
|
227
|
+
if (p === minimatch_1.GLOBSTAR) {
|
|
228
|
+
results.testGlobstar(e, pattern, rest, absolute);
|
|
229
|
+
}
|
|
230
|
+
else if (p instanceof RegExp) {
|
|
231
|
+
results.testRegExp(e, p, rest, absolute);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
results.testString(e, p, rest, absolute);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return results;
|
|
239
|
+
}
|
|
240
|
+
testGlobstar(e, pattern, rest, absolute) {
|
|
241
|
+
if (this.dot || !e.name.startsWith('.')) {
|
|
242
|
+
if (!pattern.hasMore()) {
|
|
243
|
+
this.matches.add(e, absolute, false);
|
|
244
|
+
}
|
|
245
|
+
if (e.canReaddir()) {
|
|
246
|
+
// if we're in follow mode or it's not a symlink, just keep
|
|
247
|
+
// testing the same pattern. If there's more after the globstar,
|
|
248
|
+
// then this symlink consumes the globstar. If not, then we can
|
|
249
|
+
// follow at most ONE symlink along the way, so we mark it, which
|
|
250
|
+
// also checks to ensure that it wasn't already marked.
|
|
251
|
+
if (this.follow || !e.isSymbolicLink()) {
|
|
252
|
+
this.subwalks.add(e, pattern);
|
|
253
|
+
}
|
|
254
|
+
else if (e.isSymbolicLink()) {
|
|
255
|
+
if (rest && pattern.checkFollowGlobstar()) {
|
|
256
|
+
this.subwalks.add(e, rest);
|
|
257
|
+
}
|
|
258
|
+
else if (pattern.markFollowGlobstar()) {
|
|
259
|
+
this.subwalks.add(e, pattern);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// if the NEXT thing matches this entry, then also add
|
|
265
|
+
// the rest.
|
|
266
|
+
if (rest) {
|
|
267
|
+
const rp = rest.pattern();
|
|
268
|
+
if (typeof rp === 'string' &&
|
|
269
|
+
// dots and empty were handled already
|
|
270
|
+
rp !== '..' &&
|
|
271
|
+
rp !== '' &&
|
|
272
|
+
rp !== '.') {
|
|
273
|
+
this.testString(e, rp, rest.rest(), absolute);
|
|
274
|
+
}
|
|
275
|
+
else if (rp === '..') {
|
|
276
|
+
/* c8 ignore start */
|
|
277
|
+
const ep = e.parent || e;
|
|
278
|
+
/* c8 ignore stop */
|
|
279
|
+
this.subwalks.add(ep, rest);
|
|
280
|
+
}
|
|
281
|
+
else if (rp instanceof RegExp) {
|
|
282
|
+
this.testRegExp(e, rp, rest.rest(), absolute);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
testRegExp(e, p, rest, absolute) {
|
|
287
|
+
if (!p.test(e.name))
|
|
288
|
+
return;
|
|
289
|
+
if (!rest) {
|
|
290
|
+
this.matches.add(e, absolute, false);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
this.subwalks.add(e, rest);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
testString(e, p, rest, absolute) {
|
|
297
|
+
// should never happen?
|
|
298
|
+
if (!e.isNamed(p))
|
|
299
|
+
return;
|
|
300
|
+
if (!rest) {
|
|
301
|
+
this.matches.add(e, absolute, false);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
this.subwalks.add(e, rest);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
exports.Processor = Processor;
|
|
309
|
+
//# sourceMappingURL=processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../../src/processor.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAErE,yCAA8C;AAK9C;;GAEG;AACH,MAAa,cAAc;IACzB,KAAK,CAA0B;IAC/B,YAAY,QAAkC,IAAI,GAAG,EAAE;QACrD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IACD,IAAI;QACF,OAAO,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,CAAC;IACD,SAAS,CAAC,MAAY,EAAE,OAAgB;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,WAAW,CAAC,MAAY,EAAE,OAAgB;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,MAAM;YAAE,MAAM,CA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AApOD,8BAoOC","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n store: Map<string, Set<string>>\n constructor(store: Map<string, Set<string>> = new Map()) {\n this.store = store\n }\n copy() {\n return new HasWalkedCache(new Map(this.store))\n }\n hasWalked(target: Path, pattern: Pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.store.get(fullpath)\n if (cached) cached.add(pattern.globString())\n else this.store.set(fullpath, new Set([pattern.globString()]))\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n store: Map<Path, number> = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n // match, absolute, ifdir\n entries(): [Path, boolean, boolean][] {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ])\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map<Path, Pattern[]> = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache = hasWalkedCache\n ? hasWalkedCache.copy()\n : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined\n ? this.opts.root\n : root\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n // we can be reasonably sure that .. is a readable dir\n if (c.isUnknown() && p !== '..') break\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must be final entry\n if (!rest) {\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n } else {\n this.subwalks.add(t, pattern)\n }\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testRegExp(\n e: Path,\n p: MMRegExp,\n rest: Pattern | null,\n absolute: boolean\n ) {\n if (!p.test(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../../src/walker.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAA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