From a0408b28111e0f7b1718c40249971b78def14980 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Thu, 30 May 2024 04:21:05 -0700 Subject: [PATCH] deps: upgrade npm to 10.8.1 PR-URL: https://github.com/nodejs/node/pull/53207 Reviewed-By: Richard Lau Reviewed-By: Marco Ippolito Reviewed-By: Mohammed Keyvanzadeh --- deps/npm/bin/npm-prefix.js | 2 +- deps/npm/docs/content/commands/npm-diff.md | 7 +- deps/npm/docs/content/commands/npm-ls.md | 2 +- deps/npm/docs/content/commands/npm-publish.md | 7 +- deps/npm/docs/content/commands/npm.md | 2 +- deps/npm/docs/content/using-npm/config.md | 7 +- deps/npm/docs/output/commands/npm-access.html | 4 +- .../npm/docs/output/commands/npm-adduser.html | 4 +- deps/npm/docs/output/commands/npm-audit.html | 4 +- deps/npm/docs/output/commands/npm-bugs.html | 4 +- deps/npm/docs/output/commands/npm-cache.html | 4 +- deps/npm/docs/output/commands/npm-ci.html | 4 +- .../docs/output/commands/npm-completion.html | 4 +- deps/npm/docs/output/commands/npm-config.html | 4 +- deps/npm/docs/output/commands/npm-dedupe.html | 4 +- .../docs/output/commands/npm-deprecate.html | 4 +- deps/npm/docs/output/commands/npm-diff.html | 9 +- .../docs/output/commands/npm-dist-tag.html | 4 +- deps/npm/docs/output/commands/npm-docs.html | 4 +- deps/npm/docs/output/commands/npm-doctor.html | 4 +- deps/npm/docs/output/commands/npm-edit.html | 4 +- deps/npm/docs/output/commands/npm-exec.html | 4 +- .../npm/docs/output/commands/npm-explain.html | 4 +- .../npm/docs/output/commands/npm-explore.html | 4 +- .../docs/output/commands/npm-find-dupes.html | 4 +- deps/npm/docs/output/commands/npm-fund.html | 4 +- .../docs/output/commands/npm-help-search.html | 4 +- deps/npm/docs/output/commands/npm-help.html | 4 +- deps/npm/docs/output/commands/npm-hook.html | 4 +- deps/npm/docs/output/commands/npm-init.html | 4 +- .../output/commands/npm-install-ci-test.html | 4 +- .../output/commands/npm-install-test.html | 4 +- .../npm/docs/output/commands/npm-install.html | 4 +- deps/npm/docs/output/commands/npm-link.html | 4 +- deps/npm/docs/output/commands/npm-login.html | 4 +- deps/npm/docs/output/commands/npm-logout.html | 4 +- deps/npm/docs/output/commands/npm-ls.html | 6 +- deps/npm/docs/output/commands/npm-org.html | 4 +- .../docs/output/commands/npm-outdated.html | 4 +- deps/npm/docs/output/commands/npm-owner.html | 4 +- deps/npm/docs/output/commands/npm-pack.html | 4 +- deps/npm/docs/output/commands/npm-ping.html | 4 +- deps/npm/docs/output/commands/npm-pkg.html | 4 +- deps/npm/docs/output/commands/npm-prefix.html | 4 +- .../npm/docs/output/commands/npm-profile.html | 4 +- deps/npm/docs/output/commands/npm-prune.html | 4 +- .../npm/docs/output/commands/npm-publish.html | 9 +- deps/npm/docs/output/commands/npm-query.html | 4 +- .../npm/docs/output/commands/npm-rebuild.html | 4 +- deps/npm/docs/output/commands/npm-repo.html | 4 +- .../npm/docs/output/commands/npm-restart.html | 4 +- deps/npm/docs/output/commands/npm-root.html | 4 +- .../docs/output/commands/npm-run-script.html | 4 +- deps/npm/docs/output/commands/npm-sbom.html | 4 +- deps/npm/docs/output/commands/npm-search.html | 4 +- .../docs/output/commands/npm-shrinkwrap.html | 4 +- deps/npm/docs/output/commands/npm-star.html | 4 +- deps/npm/docs/output/commands/npm-stars.html | 4 +- deps/npm/docs/output/commands/npm-start.html | 4 +- deps/npm/docs/output/commands/npm-stop.html | 4 +- deps/npm/docs/output/commands/npm-team.html | 4 +- deps/npm/docs/output/commands/npm-test.html | 4 +- deps/npm/docs/output/commands/npm-token.html | 4 +- .../docs/output/commands/npm-uninstall.html | 4 +- .../docs/output/commands/npm-unpublish.html | 4 +- deps/npm/docs/output/commands/npm-unstar.html | 4 +- deps/npm/docs/output/commands/npm-update.html | 4 +- .../npm/docs/output/commands/npm-version.html | 4 +- deps/npm/docs/output/commands/npm-view.html | 4 +- deps/npm/docs/output/commands/npm-whoami.html | 4 +- deps/npm/docs/output/commands/npm.html | 6 +- deps/npm/docs/output/commands/npx.html | 4 +- .../docs/output/configuring-npm/folders.html | 4 +- .../docs/output/configuring-npm/install.html | 4 +- .../output/configuring-npm/npm-global.html | 4 +- .../docs/output/configuring-npm/npm-json.html | 4 +- .../configuring-npm/npm-shrinkwrap-json.html | 4 +- .../docs/output/configuring-npm/npmrc.html | 4 +- .../output/configuring-npm/package-json.html | 4 +- .../configuring-npm/package-lock-json.html | 4 +- deps/npm/docs/output/using-npm/config.html | 9 +- .../using-npm/dependency-selectors.html | 4 +- .../npm/docs/output/using-npm/developers.html | 4 +- deps/npm/docs/output/using-npm/logging.html | 4 +- deps/npm/docs/output/using-npm/orgs.html | 4 +- .../docs/output/using-npm/package-spec.html | 4 +- deps/npm/docs/output/using-npm/registry.html | 4 +- deps/npm/docs/output/using-npm/removal.html | 4 +- deps/npm/docs/output/using-npm/scope.html | 4 +- deps/npm/docs/output/using-npm/scripts.html | 4 +- .../npm/docs/output/using-npm/workspaces.html | 4 +- deps/npm/lib/cli/entry.js | 2 +- deps/npm/lib/cli/update-notifier.js | 4 +- deps/npm/lib/commands/access.js | 2 +- deps/npm/lib/commands/cache.js | 13 +- deps/npm/lib/commands/ci.js | 22 +- deps/npm/lib/commands/completion.js | 4 +- deps/npm/lib/commands/config.js | 2 +- deps/npm/lib/commands/diff.js | 2 +- deps/npm/lib/commands/doctor.js | 4 +- deps/npm/lib/commands/edit.js | 6 +- deps/npm/lib/commands/exec.js | 24 +- deps/npm/lib/commands/explain.js | 4 +- deps/npm/lib/commands/explore.js | 2 +- deps/npm/lib/commands/fund.js | 6 +- deps/npm/lib/commands/help.js | 2 +- deps/npm/lib/commands/hook.js | 8 +- deps/npm/lib/commands/init.js | 6 +- deps/npm/lib/commands/link.js | 4 +- deps/npm/lib/commands/ls.js | 15 +- deps/npm/lib/commands/org.js | 16 +- deps/npm/lib/commands/outdated.js | 372 +++++++----------- deps/npm/lib/commands/ping.js | 4 +- deps/npm/lib/commands/pkg.js | 18 +- deps/npm/lib/commands/profile.js | 10 +- deps/npm/lib/commands/publish.js | 9 + deps/npm/lib/commands/query.js | 73 ++-- deps/npm/lib/commands/rebuild.js | 2 +- deps/npm/lib/commands/repo.js | 2 +- deps/npm/lib/commands/sbom.js | 62 ++- deps/npm/lib/commands/shrinkwrap.js | 4 +- deps/npm/lib/commands/team.js | 20 +- deps/npm/lib/commands/token.js | 6 +- deps/npm/lib/commands/uninstall.js | 2 +- deps/npm/lib/commands/update.js | 2 +- deps/npm/lib/commands/version.js | 2 +- deps/npm/lib/commands/view.js | 26 +- deps/npm/lib/commands/whoami.js | 8 +- deps/npm/lib/npm.js | 21 +- deps/npm/lib/utils/audit-error.js | 4 +- deps/npm/lib/utils/auth.js | 2 +- deps/npm/lib/utils/display.js | 48 +-- deps/npm/lib/utils/error-message.js | 2 +- deps/npm/lib/utils/format.js | 2 +- deps/npm/lib/utils/get-workspaces.js | 2 +- deps/npm/lib/utils/installed-deep.js | 2 +- deps/npm/lib/utils/log-file.js | 6 +- deps/npm/lib/utils/open-url.js | 9 +- deps/npm/lib/utils/queryable.js | 2 +- deps/npm/lib/utils/reify-finish.js | 4 +- deps/npm/lib/utils/reify-output.js | 2 +- deps/npm/lib/utils/sbom-cyclonedx.js | 2 +- deps/npm/lib/utils/sbom-spdx.js | 2 +- deps/npm/lib/utils/tar.js | 4 +- deps/npm/lib/utils/verify-signatures.js | 5 +- deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-audit.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-ci.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-diff.1 | 7 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-exec.1 | 2 +- deps/npm/man/man1/npm-explain.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-find-dupes.1 | 2 +- deps/npm/man/man1/npm-fund.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-hook.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-ci-test.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.1 | 2 +- deps/npm/man/man1/npm-login.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 4 +- deps/npm/man/man1/npm-org.1 | 2 +- deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 2 +- deps/npm/man/man1/npm-pkg.1 | 2 +- deps/npm/man/man1/npm-prefix.1 | 2 +- deps/npm/man/man1/npm-profile.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 7 +- deps/npm/man/man1/npm-query.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- deps/npm/man/man1/npm-sbom.1 | 2 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 2 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-token.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 2 +- deps/npm/man/man1/npm-unstar.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man1/npx.1 | 2 +- deps/npm/man/man5/folders.5 | 2 +- deps/npm/man/man5/install.5 | 2 +- deps/npm/man/man5/npm-global.5 | 2 +- deps/npm/man/man5/npm-json.5 | 2 +- deps/npm/man/man5/npm-shrinkwrap-json.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package-json.5 | 2 +- deps/npm/man/man5/package-lock-json.5 | 2 +- deps/npm/man/man7/config.7 | 7 +- deps/npm/man/man7/dependency-selectors.7 | 2 +- deps/npm/man/man7/developers.7 | 2 +- deps/npm/man/man7/logging.7 | 2 +- deps/npm/man/man7/orgs.7 | 2 +- deps/npm/man/man7/package-spec.7 | 2 +- deps/npm/man/man7/registry.7 | 2 +- deps/npm/man/man7/removal.7 | 2 +- deps/npm/man/man7/scope.7 | 2 +- deps/npm/man/man7/scripts.7 | 2 +- deps/npm/man/man7/workspaces.7 | 2 +- .../@npmcli/arborist/bin/index.js | 4 +- .../@npmcli/arborist/bin/lib/logging.js | 8 +- .../@npmcli/arborist/bin/lib/options.js | 2 +- .../@npmcli/arborist/bin/lib/print-tree.js | 2 +- .../arborist/lib/arborist/build-ideal-tree.js | 4 +- .../@npmcli/arborist/lib/arborist/index.js | 6 +- .../arborist/lib/arborist/isolated-reifier.js | 6 +- .../arborist/lib/arborist/load-actual.js | 2 +- .../arborist/lib/arborist/load-virtual.js | 2 +- .../@npmcli/arborist/lib/arborist/rebuild.js | 2 +- .../@npmcli/arborist/lib/arborist/reify.js | 4 +- .../@npmcli/arborist/lib/debug.js | 5 +- .../@npmcli/arborist/lib/dep-valid.js | 2 +- .../node_modules/@npmcli/arborist/lib/diff.js | 2 +- .../node_modules/@npmcli/arborist/lib/edge.js | 2 +- .../@npmcli/arborist/lib/from-path.js | 2 +- .../node_modules/@npmcli/arborist/lib/link.js | 2 +- .../node_modules/@npmcli/arborist/lib/node.js | 4 +- .../@npmcli/arborist/lib/printable.js | 2 +- .../arborist/lib/query-selector-all.js | 2 +- .../@npmcli/arborist/lib/realpath.js | 4 +- .../@npmcli/arborist/lib/relpath.js | 2 +- .../@npmcli/arborist/lib/retire-path.js | 4 +- .../@npmcli/arborist/lib/shrinkwrap.js | 4 +- .../@npmcli/arborist/lib/version-from-tgz.js | 4 +- .../@npmcli/arborist/lib/yarn-lock.js | 2 +- .../@npmcli/arborist/package.json | 2 +- .../config/lib/definitions/definitions.js | 11 +- .../node_modules/@npmcli/config/lib/index.js | 2 +- .../node_modules/@npmcli/config/package.json | 2 +- .../@npmcli/package-json/lib/normalize.js | 60 ++- .../@npmcli/package-json/package.json | 8 +- .../@sigstore/bundle/package.json | 4 +- .../node_modules/@sigstore/sign/package.json | 8 +- .../node_modules/@sigstore/tuf/package.json | 4 +- .../@sigstore/verify/package.json | 6 +- .../npm/node_modules/cidr-regex/dist/index.js | 15 + deps/npm/node_modules/cidr-regex/index.js | 15 - deps/npm/node_modules/cidr-regex/package.json | 31 +- deps/npm/node_modules/glob/README.md | 47 ++- .../node_modules/glob/dist/commonjs/glob.d.ts | 45 +++ .../glob/dist/commonjs/glob.d.ts.map | 2 +- .../node_modules/glob/dist/commonjs/glob.js | 42 +- .../glob/dist/commonjs/glob.js.map | 2 +- .../glob/dist/commonjs/has-magic.js.map | 2 +- .../glob/dist/commonjs/ignore.d.ts | 7 +- .../glob/dist/commonjs/ignore.d.ts.map | 2 +- .../node_modules/glob/dist/commonjs/ignore.js | 69 ++-- .../glob/dist/commonjs/ignore.js.map | 2 +- .../glob/dist/commonjs/index.d.ts | 15 +- .../glob/dist/commonjs/index.d.ts.map | 2 +- .../node_modules/glob/dist/commonjs/index.js | 20 +- .../glob/dist/commonjs/index.js.map | 2 +- .../glob/dist/commonjs/pattern.d.ts.map | 2 +- .../glob/dist/commonjs/pattern.js | 22 +- .../glob/dist/commonjs/pattern.js.map | 2 +- .../glob/dist/commonjs/processor.d.ts.map | 2 +- .../glob/dist/commonjs/processor.js | 9 +- .../glob/dist/commonjs/processor.js.map | 2 +- .../glob/dist/commonjs/walker.d.ts | 12 +- .../glob/dist/commonjs/walker.d.ts.map | 2 +- .../node_modules/glob/dist/commonjs/walker.js | 35 +- .../glob/dist/commonjs/walker.js.map | 2 +- deps/npm/node_modules/glob/dist/esm/bin.mjs | 12 +- .../node_modules/glob/dist/esm/bin.mjs.map | 2 +- deps/npm/node_modules/glob/dist/esm/glob.d.ts | 45 +++ .../node_modules/glob/dist/esm/glob.d.ts.map | 2 +- deps/npm/node_modules/glob/dist/esm/glob.js | 42 +- .../node_modules/glob/dist/esm/glob.js.map | 2 +- .../glob/dist/esm/has-magic.js.map | 2 +- .../node_modules/glob/dist/esm/ignore.d.ts | 7 +- .../glob/dist/esm/ignore.d.ts.map | 2 +- deps/npm/node_modules/glob/dist/esm/ignore.js | 69 ++-- .../node_modules/glob/dist/esm/ignore.js.map | 2 +- .../npm/node_modules/glob/dist/esm/index.d.ts | 15 +- .../node_modules/glob/dist/esm/index.d.ts.map | 2 +- deps/npm/node_modules/glob/dist/esm/index.js | 9 +- .../node_modules/glob/dist/esm/index.js.map | 2 +- .../glob/dist/esm/pattern.d.ts.map | 2 +- .../npm/node_modules/glob/dist/esm/pattern.js | 22 +- .../node_modules/glob/dist/esm/pattern.js.map | 2 +- .../glob/dist/esm/processor.d.ts.map | 2 +- .../node_modules/glob/dist/esm/processor.js | 9 +- .../glob/dist/esm/processor.js.map | 2 +- .../node_modules/glob/dist/esm/walker.d.ts | 12 +- .../glob/dist/esm/walker.d.ts.map | 2 +- deps/npm/node_modules/glob/dist/esm/walker.js | 35 +- .../node_modules/glob/dist/esm/walker.js.map | 2 +- deps/npm/node_modules/glob/package.json | 25 +- deps/npm/node_modules/ini/lib/ini.js | 4 +- deps/npm/node_modules/ini/package.json | 8 +- deps/npm/node_modules/is-cidr/dist/index.js | 11 + deps/npm/node_modules/is-cidr/index.js | 9 - deps/npm/node_modules/is-cidr/package.json | 33 +- .../jackspeak/dist/commonjs/index.js | 296 +++++++++----- .../jackspeak/dist/commonjs/package.json | 4 +- .../node_modules/jackspeak/dist/esm/index.js | 296 +++++++++----- .../jackspeak/dist/esm/package.json | 4 +- .../jackspeak/dist/esm/parse-args.js | 4 +- deps/npm/node_modules/jackspeak/package.json | 9 +- .../libnpmdiff/lib/should-print-patch.js | 2 +- .../node_modules/libnpmdiff/lib/tarball.js | 2 +- deps/npm/node_modules/libnpmdiff/package.json | 4 +- .../libnpmexec/lib/file-exists.js | 4 +- deps/npm/node_modules/libnpmexec/lib/index.js | 53 ++- deps/npm/node_modules/libnpmexec/package.json | 4 +- deps/npm/node_modules/libnpmfund/lib/index.js | 2 +- deps/npm/node_modules/libnpmfund/package.json | 4 +- deps/npm/node_modules/libnpmpack/lib/index.js | 4 +- deps/npm/node_modules/libnpmpack/package.json | 4 +- .../libnpmpublish/lib/provenance.js | 2 +- .../node_modules/libnpmpublish/lib/publish.js | 2 +- .../libnpmpublish/lib/unpublish.js | 2 +- .../node_modules/libnpmpublish/package.json | 2 +- .../node_modules/libnpmsearch/package.json | 2 +- .../libnpmversion/lib/read-json.js | 2 +- .../libnpmversion/lib/write-json.js | 2 +- .../node_modules/libnpmversion/package.json | 2 +- .../minipass/dist/commonjs/package.json | 4 +- .../minipass/dist/esm/package.json | 4 +- deps/npm/node_modules/minipass/package.json | 10 +- .../postcss-selector-parser/dist/parser.js | 11 +- .../postcss-selector-parser/package.json | 2 +- deps/npm/node_modules/sigstore/package.json | 16 +- .../spdx-license-ids/deprecated.json | 6 - .../node_modules/spdx-license-ids/index.json | 22 ++ .../spdx-license-ids/package.json | 2 +- deps/npm/package.json | 30 +- .../test/lib/commands/outdated.js.test.cjs | 30 +- .../test/lib/commands/publish.js.test.cjs | 33 +- .../test/lib/commands/view.js.test.cjs | 147 +++++++ .../tap-snapshots/test/lib/docs.js.test.cjs | 7 +- .../test/lib/utils/open-url.js.test.cjs | 10 +- deps/npm/test/bin/windows-shims.js | 6 +- deps/npm/test/fixtures/clean-snapshot.js | 2 +- deps/npm/test/fixtures/mock-logs.js | 9 +- deps/npm/test/fixtures/mock-npm.js | 169 +++++++- deps/npm/test/fixtures/tmock.js | 2 +- deps/npm/test/lib/arborist-cmd.js | 2 +- deps/npm/test/lib/cli/entry.js | 4 +- deps/npm/test/lib/cli/exit-handler.js | 1 - deps/npm/test/lib/cli/update-notifier.js | 6 +- deps/npm/test/lib/commands/adduser.js | 6 +- deps/npm/test/lib/commands/audit.js | 6 +- deps/npm/test/lib/commands/cache.js | 18 +- deps/npm/test/lib/commands/ci.js | 110 +++++- deps/npm/test/lib/commands/completion.js | 4 +- deps/npm/test/lib/commands/config.js | 4 +- deps/npm/test/lib/commands/dedupe.js | 4 +- deps/npm/test/lib/commands/diff.js | 2 +- deps/npm/test/lib/commands/docs.js | 2 +- deps/npm/test/lib/commands/doctor.js | 10 +- deps/npm/test/lib/commands/edit.js | 2 +- deps/npm/test/lib/commands/exec.js | 4 +- deps/npm/test/lib/commands/explain.js | 2 +- deps/npm/test/lib/commands/find-dupes.js | 4 +- deps/npm/test/lib/commands/init.js | 4 +- deps/npm/test/lib/commands/install.js | 186 +++++++-- deps/npm/test/lib/commands/link.js | 4 +- deps/npm/test/lib/commands/logout.js | 4 +- deps/npm/test/lib/commands/ls.js | 4 +- deps/npm/test/lib/commands/outdated.js | 20 + deps/npm/test/lib/commands/owner.js | 2 +- deps/npm/test/lib/commands/pack.js | 4 +- deps/npm/test/lib/commands/pkg.js | 4 +- deps/npm/test/lib/commands/publish.js | 46 ++- deps/npm/test/lib/commands/rebuild.js | 4 +- deps/npm/test/lib/commands/repo.js | 2 +- deps/npm/test/lib/commands/run-script.js | 2 +- deps/npm/test/lib/commands/sbom.js | 4 +- deps/npm/test/lib/commands/set.js | 4 +- deps/npm/test/lib/commands/shrinkwrap.js | 4 +- deps/npm/test/lib/commands/uninstall.js | 4 +- deps/npm/test/lib/commands/version.js | 4 +- deps/npm/test/lib/commands/view.js | 116 +++++- deps/npm/test/lib/docs.js | 4 +- deps/npm/test/lib/load-all-commands.js | 2 +- deps/npm/test/lib/npm.js | 4 +- deps/npm/test/lib/utils/audit-error.js | 2 + deps/npm/test/lib/utils/auth.js | 21 +- deps/npm/test/lib/utils/display.js | 2 +- deps/npm/test/lib/utils/error-message.js | 4 +- deps/npm/test/lib/utils/explain-dep.js | 2 +- deps/npm/test/lib/utils/get-workspaces.js | 2 +- deps/npm/test/lib/utils/log-file.js | 8 +- deps/npm/test/lib/utils/open-url.js | 7 +- deps/npm/test/lib/utils/queryable.js | 2 +- deps/npm/test/lib/utils/reify-finish.js | 4 +- deps/npm/test/lib/utils/reify-output.js | 1 + deps/npm/test/lib/utils/tar.js | 83 +++- deps/npm/test/lib/utils/timers.js | 2 +- 421 files changed, 2852 insertions(+), 1606 deletions(-) create mode 100644 deps/npm/node_modules/cidr-regex/dist/index.js delete mode 100644 deps/npm/node_modules/cidr-regex/index.js create mode 100644 deps/npm/node_modules/is-cidr/dist/index.js delete mode 100644 deps/npm/node_modules/is-cidr/index.js diff --git a/deps/npm/bin/npm-prefix.js b/deps/npm/bin/npm-prefix.js index 3ff43de0dd84de..b0b0ace6a92ab9 100755 --- a/deps/npm/bin/npm-prefix.js +++ b/deps/npm/bin/npm-prefix.js @@ -3,7 +3,7 @@ // without having to load all of npm first // It does not accept argv params -const path = require('path') +const path = require('node:path') const Config = require('@npmcli/config') const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions') const config = new Config({ diff --git a/deps/npm/docs/content/commands/npm-diff.md b/deps/npm/docs/content/commands/npm-diff.md index e93aef383c3f27..5248410972785d 100644 --- a/deps/npm/docs/content/commands/npm-diff.md +++ b/deps/npm/docs/content/commands/npm-diff.md @@ -248,12 +248,15 @@ folder instead of the current working directory. See If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. -Also the tag that is added to the package@version specified by the `npm tag` -command, if no explicit tag is given. +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + #### `workspace` diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 580e559ebd737c..eb9314720d91ce 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show: ```bash -npm@10.8.0 /path/to/npm +npm@10.8.1 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index a9c368e218543f..6bff5ff1c30201 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -95,12 +95,15 @@ built. If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. -Also the tag that is added to the package@version specified by the `npm tag` -command, if no explicit tag is given. +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + #### `access` diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index ac3041cfcfdf48..fc19d7c5531669 100644 --- a/deps/npm/docs/content/commands/npm.md +++ b/deps/npm/docs/content/commands/npm.md @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. ### Version -10.8.0 +10.8.1 ### Description diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 622b84b44210a5..6143e59d46a040 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1567,12 +1567,15 @@ See also the `ca` config. If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. -Also the tag that is added to the package@version specified by the `npm tag` -command, if no explicit tag is given. +It is the tag added to the package@version specified in the `npm dist-tag +add` command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. +If used in the `npm publish` command, this is the tag that will be added to +the package submitted to the registry. + #### `tag-version-prefix` diff --git a/deps/npm/docs/output/commands/npm-access.html b/deps/npm/docs/output/commands/npm-access.html index 61bb6a3c762a35..65ffb9e90b89f0 100644 --- a/deps/npm/docs/output/commands/npm-access.html +++ b/deps/npm/docs/output/commands/npm-access.html @@ -141,9 +141,9 @@
-

+

npm-access - @10.8.0 + @10.8.1

Set access level on published packages
diff --git a/deps/npm/docs/output/commands/npm-adduser.html b/deps/npm/docs/output/commands/npm-adduser.html index 0a338175ead62d..9543d85ad76089 100644 --- a/deps/npm/docs/output/commands/npm-adduser.html +++ b/deps/npm/docs/output/commands/npm-adduser.html @@ -141,9 +141,9 @@
-

+

npm-adduser - @10.8.0 + @10.8.1

Add a registry user account
diff --git a/deps/npm/docs/output/commands/npm-audit.html b/deps/npm/docs/output/commands/npm-audit.html index 1e556d50a03f9b..358a1f07ec803c 100644 --- a/deps/npm/docs/output/commands/npm-audit.html +++ b/deps/npm/docs/output/commands/npm-audit.html @@ -141,9 +141,9 @@
-

+

npm-audit - @10.8.0 + @10.8.1

Run a security audit
diff --git a/deps/npm/docs/output/commands/npm-bugs.html b/deps/npm/docs/output/commands/npm-bugs.html index ac46a5e8de225c..3fb83b80a2250b 100644 --- a/deps/npm/docs/output/commands/npm-bugs.html +++ b/deps/npm/docs/output/commands/npm-bugs.html @@ -141,9 +141,9 @@
-

+

npm-bugs - @10.8.0 + @10.8.1

Report bugs for a package in a web browser
diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html index 45c980155e7b14..354d40937b8f06 100644 --- a/deps/npm/docs/output/commands/npm-cache.html +++ b/deps/npm/docs/output/commands/npm-cache.html @@ -141,9 +141,9 @@
-

+

npm-cache - @10.8.0 + @10.8.1

Manipulates packages cache
diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index 961718439b4a47..ee45b84236f061 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -141,9 +141,9 @@
-

+

npm-ci - @10.8.0 + @10.8.1

Clean install a project
diff --git a/deps/npm/docs/output/commands/npm-completion.html b/deps/npm/docs/output/commands/npm-completion.html index b1896ad10f4e20..1f0c580725e5fc 100644 --- a/deps/npm/docs/output/commands/npm-completion.html +++ b/deps/npm/docs/output/commands/npm-completion.html @@ -141,9 +141,9 @@
-

+

npm-completion - @10.8.0 + @10.8.1

Tab Completion for npm
diff --git a/deps/npm/docs/output/commands/npm-config.html b/deps/npm/docs/output/commands/npm-config.html index c399d3142eb004..72d1ca5deb4525 100644 --- a/deps/npm/docs/output/commands/npm-config.html +++ b/deps/npm/docs/output/commands/npm-config.html @@ -141,9 +141,9 @@
-

+

npm-config - @10.8.0 + @10.8.1

Manage the npm configuration files
diff --git a/deps/npm/docs/output/commands/npm-dedupe.html b/deps/npm/docs/output/commands/npm-dedupe.html index 9864ec2ecc5cb0..8cf60ac2d0d94a 100644 --- a/deps/npm/docs/output/commands/npm-dedupe.html +++ b/deps/npm/docs/output/commands/npm-dedupe.html @@ -141,9 +141,9 @@
-

+

npm-dedupe - @10.8.0 + @10.8.1

Reduce duplication in the package tree
diff --git a/deps/npm/docs/output/commands/npm-deprecate.html b/deps/npm/docs/output/commands/npm-deprecate.html index 9dedd3be56f2ad..4088528e81ab3f 100644 --- a/deps/npm/docs/output/commands/npm-deprecate.html +++ b/deps/npm/docs/output/commands/npm-deprecate.html @@ -141,9 +141,9 @@
-

+

npm-deprecate - @10.8.0 + @10.8.1

Deprecate a version of a package
diff --git a/deps/npm/docs/output/commands/npm-diff.html b/deps/npm/docs/output/commands/npm-diff.html index 5d3f5ef0f089b6..0b39ea05f1d4ec 100644 --- a/deps/npm/docs/output/commands/npm-diff.html +++ b/deps/npm/docs/output/commands/npm-diff.html @@ -141,9 +141,9 @@
-

+

npm-diff - @10.8.0 + @10.8.1

The registry diff command
@@ -334,10 +334,11 @@

tag

If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag.

-

Also the tag that is added to the package@version specified by the npm tag -command, if no explicit tag is given.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

When used by the npm diff command, this is the tag used to fetch the tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

workspace

  • Default:
  • diff --git a/deps/npm/docs/output/commands/npm-dist-tag.html b/deps/npm/docs/output/commands/npm-dist-tag.html index ba748cd0b16ec6..ccaa92003210aa 100644 --- a/deps/npm/docs/output/commands/npm-dist-tag.html +++ b/deps/npm/docs/output/commands/npm-dist-tag.html @@ -141,9 +141,9 @@
    -

    +

    npm-dist-tag - @10.8.0 + @10.8.1

    Modify package distribution tags
    diff --git a/deps/npm/docs/output/commands/npm-docs.html b/deps/npm/docs/output/commands/npm-docs.html index 9624310743ed1d..206df2950ea64c 100644 --- a/deps/npm/docs/output/commands/npm-docs.html +++ b/deps/npm/docs/output/commands/npm-docs.html @@ -141,9 +141,9 @@
    -

    +

    npm-docs - @10.8.0 + @10.8.1

    Open documentation for a package in a web browser
    diff --git a/deps/npm/docs/output/commands/npm-doctor.html b/deps/npm/docs/output/commands/npm-doctor.html index e861423a6daba7..f3d9c9daf2c731 100644 --- a/deps/npm/docs/output/commands/npm-doctor.html +++ b/deps/npm/docs/output/commands/npm-doctor.html @@ -141,9 +141,9 @@
    -

    +

    npm-doctor - @10.8.0 + @10.8.1

    Check the health of your npm environment
    diff --git a/deps/npm/docs/output/commands/npm-edit.html b/deps/npm/docs/output/commands/npm-edit.html index 238f2fb7ad5e3f..bf8bd4a2a7d70f 100644 --- a/deps/npm/docs/output/commands/npm-edit.html +++ b/deps/npm/docs/output/commands/npm-edit.html @@ -141,9 +141,9 @@
    -

    +

    npm-edit - @10.8.0 + @10.8.1

    Edit an installed package
    diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html index b2f4fa56527767..649cf404ef08f0 100644 --- a/deps/npm/docs/output/commands/npm-exec.html +++ b/deps/npm/docs/output/commands/npm-exec.html @@ -141,9 +141,9 @@
    -

    +

    npm-exec - @10.8.0 + @10.8.1

    Run a command from a local or remote npm package
    diff --git a/deps/npm/docs/output/commands/npm-explain.html b/deps/npm/docs/output/commands/npm-explain.html index 915559613d1e96..ab47be253e44b6 100644 --- a/deps/npm/docs/output/commands/npm-explain.html +++ b/deps/npm/docs/output/commands/npm-explain.html @@ -141,9 +141,9 @@
    -

    +

    npm-explain - @10.8.0 + @10.8.1

    Explain installed packages
    diff --git a/deps/npm/docs/output/commands/npm-explore.html b/deps/npm/docs/output/commands/npm-explore.html index 851b42790c160c..21070286a1859b 100644 --- a/deps/npm/docs/output/commands/npm-explore.html +++ b/deps/npm/docs/output/commands/npm-explore.html @@ -141,9 +141,9 @@
    -

    +

    npm-explore - @10.8.0 + @10.8.1

    Browse an installed package
    diff --git a/deps/npm/docs/output/commands/npm-find-dupes.html b/deps/npm/docs/output/commands/npm-find-dupes.html index 18ec5d449d4f50..9846600156fcb3 100644 --- a/deps/npm/docs/output/commands/npm-find-dupes.html +++ b/deps/npm/docs/output/commands/npm-find-dupes.html @@ -141,9 +141,9 @@
    -

    +

    npm-find-dupes - @10.8.0 + @10.8.1

    Find duplication in the package tree
    diff --git a/deps/npm/docs/output/commands/npm-fund.html b/deps/npm/docs/output/commands/npm-fund.html index 7381f39f2f95b5..2fc63283ec761f 100644 --- a/deps/npm/docs/output/commands/npm-fund.html +++ b/deps/npm/docs/output/commands/npm-fund.html @@ -141,9 +141,9 @@
    -

    +

    npm-fund - @10.8.0 + @10.8.1

    Retrieve funding information
    diff --git a/deps/npm/docs/output/commands/npm-help-search.html b/deps/npm/docs/output/commands/npm-help-search.html index 0003fbc903e32b..e97e3d24b699ff 100644 --- a/deps/npm/docs/output/commands/npm-help-search.html +++ b/deps/npm/docs/output/commands/npm-help-search.html @@ -141,9 +141,9 @@
    -

    +

    npm-help-search - @10.8.0 + @10.8.1

    Search npm help documentation
    diff --git a/deps/npm/docs/output/commands/npm-help.html b/deps/npm/docs/output/commands/npm-help.html index 3fff79470f8339..12aa45130822cd 100644 --- a/deps/npm/docs/output/commands/npm-help.html +++ b/deps/npm/docs/output/commands/npm-help.html @@ -141,9 +141,9 @@
    -

    +

    npm-help - @10.8.0 + @10.8.1

    Get help on npm
    diff --git a/deps/npm/docs/output/commands/npm-hook.html b/deps/npm/docs/output/commands/npm-hook.html index 73a7fec7ad9993..afd472bda02375 100644 --- a/deps/npm/docs/output/commands/npm-hook.html +++ b/deps/npm/docs/output/commands/npm-hook.html @@ -141,9 +141,9 @@
    -

    +

    npm-hook - @10.8.0 + @10.8.1

    Manage registry hooks
    diff --git a/deps/npm/docs/output/commands/npm-init.html b/deps/npm/docs/output/commands/npm-init.html index a7eeececb33df9..634768de35c536 100644 --- a/deps/npm/docs/output/commands/npm-init.html +++ b/deps/npm/docs/output/commands/npm-init.html @@ -141,9 +141,9 @@
    -

    +

    npm-init - @10.8.0 + @10.8.1

    Create a package.json file
    diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index 1cd97c41a79e3a..9a7123b892b34f 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -141,9 +141,9 @@
    -

    +

    npm-install-ci-test - @10.8.0 + @10.8.1

    Install a project with a clean slate and run tests
    diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index 78fb874a8208a1..f953d621cc9ec8 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -141,9 +141,9 @@
    -

    +

    npm-install-test - @10.8.0 + @10.8.1

    Install package(s) and run tests
    diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index e8c03b3d91dd85..23cc94750d0ad5 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -141,9 +141,9 @@
    -

    +

    npm-install - @10.8.0 + @10.8.1

    Install a package
    diff --git a/deps/npm/docs/output/commands/npm-link.html b/deps/npm/docs/output/commands/npm-link.html index 1f20e99c5ff76e..e018b25adde2b9 100644 --- a/deps/npm/docs/output/commands/npm-link.html +++ b/deps/npm/docs/output/commands/npm-link.html @@ -141,9 +141,9 @@
    -

    +

    npm-link - @10.8.0 + @10.8.1

    Symlink a package folder
    diff --git a/deps/npm/docs/output/commands/npm-login.html b/deps/npm/docs/output/commands/npm-login.html index 821d2158709a58..4ecb190ad3db7b 100644 --- a/deps/npm/docs/output/commands/npm-login.html +++ b/deps/npm/docs/output/commands/npm-login.html @@ -141,9 +141,9 @@
    -

    +

    npm-login - @10.8.0 + @10.8.1

    Login to a registry user account
    diff --git a/deps/npm/docs/output/commands/npm-logout.html b/deps/npm/docs/output/commands/npm-logout.html index 0ae8a1059ac71d..724292567d79a9 100644 --- a/deps/npm/docs/output/commands/npm-logout.html +++ b/deps/npm/docs/output/commands/npm-logout.html @@ -141,9 +141,9 @@
    -

    +

    npm-logout - @10.8.0 + @10.8.1

    Log out of the registry
    diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index f46d1f062f283d..df92c00c059cd6 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -141,9 +141,9 @@
    -

    +

    npm-ls - @10.8.0 + @10.8.1

    List installed packages
    @@ -168,7 +168,7 @@

    Description

    the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -
    npm@10.8.0 /path/to/npm
    +
    npm@10.8.1 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     
    diff --git a/deps/npm/docs/output/commands/npm-org.html b/deps/npm/docs/output/commands/npm-org.html index fa3cf17fe91ce5..84e9c5968b9a8a 100644 --- a/deps/npm/docs/output/commands/npm-org.html +++ b/deps/npm/docs/output/commands/npm-org.html @@ -141,9 +141,9 @@
    -

    +

    npm-org - @10.8.0 + @10.8.1

    Manage orgs
    diff --git a/deps/npm/docs/output/commands/npm-outdated.html b/deps/npm/docs/output/commands/npm-outdated.html index c7f265fc45e6e5..2bd3e8079825b8 100644 --- a/deps/npm/docs/output/commands/npm-outdated.html +++ b/deps/npm/docs/output/commands/npm-outdated.html @@ -141,9 +141,9 @@
    -

    +

    npm-outdated - @10.8.0 + @10.8.1

    Check for outdated packages
    diff --git a/deps/npm/docs/output/commands/npm-owner.html b/deps/npm/docs/output/commands/npm-owner.html index 4b69069eb1cb8d..2877b42a263767 100644 --- a/deps/npm/docs/output/commands/npm-owner.html +++ b/deps/npm/docs/output/commands/npm-owner.html @@ -141,9 +141,9 @@
    -

    +

    npm-owner - @10.8.0 + @10.8.1

    Manage package owners
    diff --git a/deps/npm/docs/output/commands/npm-pack.html b/deps/npm/docs/output/commands/npm-pack.html index eed8ab39c212e3..143a87d02e59ba 100644 --- a/deps/npm/docs/output/commands/npm-pack.html +++ b/deps/npm/docs/output/commands/npm-pack.html @@ -141,9 +141,9 @@
    -

    +

    npm-pack - @10.8.0 + @10.8.1

    Create a tarball from a package
    diff --git a/deps/npm/docs/output/commands/npm-ping.html b/deps/npm/docs/output/commands/npm-ping.html index 26fe123493be79..f78d6c5be6e640 100644 --- a/deps/npm/docs/output/commands/npm-ping.html +++ b/deps/npm/docs/output/commands/npm-ping.html @@ -141,9 +141,9 @@
    -

    +

    npm-ping - @10.8.0 + @10.8.1

    Ping npm registry
    diff --git a/deps/npm/docs/output/commands/npm-pkg.html b/deps/npm/docs/output/commands/npm-pkg.html index aa85100d6e7925..bfa083f4db1fb1 100644 --- a/deps/npm/docs/output/commands/npm-pkg.html +++ b/deps/npm/docs/output/commands/npm-pkg.html @@ -141,9 +141,9 @@
    -

    +

    npm-pkg - @10.8.0 + @10.8.1

    Manages your package.json
    diff --git a/deps/npm/docs/output/commands/npm-prefix.html b/deps/npm/docs/output/commands/npm-prefix.html index 954ec28a8ea7fc..726177323d7072 100644 --- a/deps/npm/docs/output/commands/npm-prefix.html +++ b/deps/npm/docs/output/commands/npm-prefix.html @@ -141,9 +141,9 @@
    -

    +

    npm-prefix - @10.8.0 + @10.8.1

    Display prefix
    diff --git a/deps/npm/docs/output/commands/npm-profile.html b/deps/npm/docs/output/commands/npm-profile.html index 8d7472d64f5495..58dbf8d78faf7a 100644 --- a/deps/npm/docs/output/commands/npm-profile.html +++ b/deps/npm/docs/output/commands/npm-profile.html @@ -141,9 +141,9 @@
    -

    +

    npm-profile - @10.8.0 + @10.8.1

    Change settings on your registry profile
    diff --git a/deps/npm/docs/output/commands/npm-prune.html b/deps/npm/docs/output/commands/npm-prune.html index 2ac404508a4472..06c076db286e32 100644 --- a/deps/npm/docs/output/commands/npm-prune.html +++ b/deps/npm/docs/output/commands/npm-prune.html @@ -141,9 +141,9 @@
    -

    +

    npm-prune - @10.8.0 + @10.8.1

    Remove extraneous packages
    diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html index 8ca49253fbb0eb..970a2228070cbb 100644 --- a/deps/npm/docs/output/commands/npm-publish.html +++ b/deps/npm/docs/output/commands/npm-publish.html @@ -141,9 +141,9 @@
    -

    +

    npm-publish - @10.8.0 + @10.8.1

    Publish a package
    @@ -233,10 +233,11 @@

    tag

If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag.

-

Also the tag that is added to the package@version specified by the npm tag -command, if no explicit tag is given.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

When used by the npm diff command, this is the tag used to fetch the tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

access

  • Default: 'public' for new packages, existing packages it will not change the diff --git a/deps/npm/docs/output/commands/npm-query.html b/deps/npm/docs/output/commands/npm-query.html index 1b9c9dccc7b3db..4327c1245f90d0 100644 --- a/deps/npm/docs/output/commands/npm-query.html +++ b/deps/npm/docs/output/commands/npm-query.html @@ -141,9 +141,9 @@
    -

    +

    npm-query - @10.8.0 + @10.8.1

    Dependency selector query
    diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index da577ba779c3d7..b722d7456a506a 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -141,9 +141,9 @@
    -

    +

    npm-rebuild - @10.8.0 + @10.8.1

    Rebuild a package
    diff --git a/deps/npm/docs/output/commands/npm-repo.html b/deps/npm/docs/output/commands/npm-repo.html index 3664db2261e6d9..dd77662cb434d9 100644 --- a/deps/npm/docs/output/commands/npm-repo.html +++ b/deps/npm/docs/output/commands/npm-repo.html @@ -141,9 +141,9 @@
    -

    +

    npm-repo - @10.8.0 + @10.8.1

    Open package repository page in the browser
    diff --git a/deps/npm/docs/output/commands/npm-restart.html b/deps/npm/docs/output/commands/npm-restart.html index 28b77442350989..6573171d2ca1b5 100644 --- a/deps/npm/docs/output/commands/npm-restart.html +++ b/deps/npm/docs/output/commands/npm-restart.html @@ -141,9 +141,9 @@
    -

    +

    npm-restart - @10.8.0 + @10.8.1

    Restart a package
    diff --git a/deps/npm/docs/output/commands/npm-root.html b/deps/npm/docs/output/commands/npm-root.html index e75f2cf4365022..b0d2d2743346e0 100644 --- a/deps/npm/docs/output/commands/npm-root.html +++ b/deps/npm/docs/output/commands/npm-root.html @@ -141,9 +141,9 @@
    -

    +

    npm-root - @10.8.0 + @10.8.1

    Display npm root
    diff --git a/deps/npm/docs/output/commands/npm-run-script.html b/deps/npm/docs/output/commands/npm-run-script.html index 5fecae8454429a..9639f09baae960 100644 --- a/deps/npm/docs/output/commands/npm-run-script.html +++ b/deps/npm/docs/output/commands/npm-run-script.html @@ -141,9 +141,9 @@
    -

    +

    npm-run-script - @10.8.0 + @10.8.1

    Run arbitrary package scripts
    diff --git a/deps/npm/docs/output/commands/npm-sbom.html b/deps/npm/docs/output/commands/npm-sbom.html index c4e3f3063bf78b..d0f10a7ccc0816 100644 --- a/deps/npm/docs/output/commands/npm-sbom.html +++ b/deps/npm/docs/output/commands/npm-sbom.html @@ -141,9 +141,9 @@
    -

    +

    npm-sbom - @10.8.0 + @10.8.1

    Generate a Software Bill of Materials (SBOM)
    diff --git a/deps/npm/docs/output/commands/npm-search.html b/deps/npm/docs/output/commands/npm-search.html index 67a609015eeca8..6a4897dfe29940 100644 --- a/deps/npm/docs/output/commands/npm-search.html +++ b/deps/npm/docs/output/commands/npm-search.html @@ -141,9 +141,9 @@
    -

    +

    npm-search - @10.8.0 + @10.8.1

    Search for packages
    diff --git a/deps/npm/docs/output/commands/npm-shrinkwrap.html b/deps/npm/docs/output/commands/npm-shrinkwrap.html index 0ca603a788b007..24957cb2d3864d 100644 --- a/deps/npm/docs/output/commands/npm-shrinkwrap.html +++ b/deps/npm/docs/output/commands/npm-shrinkwrap.html @@ -141,9 +141,9 @@
    -

    +

    npm-shrinkwrap - @10.8.0 + @10.8.1

    Lock down dependency versions for publication
    diff --git a/deps/npm/docs/output/commands/npm-star.html b/deps/npm/docs/output/commands/npm-star.html index ab7371e2b91cdf..4adbcafb8c0e24 100644 --- a/deps/npm/docs/output/commands/npm-star.html +++ b/deps/npm/docs/output/commands/npm-star.html @@ -141,9 +141,9 @@
    -

    +

    npm-star - @10.8.0 + @10.8.1

    Mark your favorite packages
    diff --git a/deps/npm/docs/output/commands/npm-stars.html b/deps/npm/docs/output/commands/npm-stars.html index 2ed1193c1e6f1d..05dc3fea90abff 100644 --- a/deps/npm/docs/output/commands/npm-stars.html +++ b/deps/npm/docs/output/commands/npm-stars.html @@ -141,9 +141,9 @@
    -

    +

    npm-stars - @10.8.0 + @10.8.1

    View packages marked as favorites
    diff --git a/deps/npm/docs/output/commands/npm-start.html b/deps/npm/docs/output/commands/npm-start.html index ade6e79ff9eff0..76b0727b964c86 100644 --- a/deps/npm/docs/output/commands/npm-start.html +++ b/deps/npm/docs/output/commands/npm-start.html @@ -141,9 +141,9 @@
    -

    +

    npm-start - @10.8.0 + @10.8.1

    Start a package
    diff --git a/deps/npm/docs/output/commands/npm-stop.html b/deps/npm/docs/output/commands/npm-stop.html index 57deebf6ac7e39..8044aa976bb6d4 100644 --- a/deps/npm/docs/output/commands/npm-stop.html +++ b/deps/npm/docs/output/commands/npm-stop.html @@ -141,9 +141,9 @@
    -

    +

    npm-stop - @10.8.0 + @10.8.1

    Stop a package
    diff --git a/deps/npm/docs/output/commands/npm-team.html b/deps/npm/docs/output/commands/npm-team.html index 00b739517f6cdb..61646ebf3e5615 100644 --- a/deps/npm/docs/output/commands/npm-team.html +++ b/deps/npm/docs/output/commands/npm-team.html @@ -141,9 +141,9 @@
    -

    +

    npm-team - @10.8.0 + @10.8.1

    Manage organization teams and team memberships
    diff --git a/deps/npm/docs/output/commands/npm-test.html b/deps/npm/docs/output/commands/npm-test.html index d9c73d48618535..4889992fe96bb7 100644 --- a/deps/npm/docs/output/commands/npm-test.html +++ b/deps/npm/docs/output/commands/npm-test.html @@ -141,9 +141,9 @@
    -

    +

    npm-test - @10.8.0 + @10.8.1

    Test a package
    diff --git a/deps/npm/docs/output/commands/npm-token.html b/deps/npm/docs/output/commands/npm-token.html index ac6dde4adb31af..76a0ddc501cd72 100644 --- a/deps/npm/docs/output/commands/npm-token.html +++ b/deps/npm/docs/output/commands/npm-token.html @@ -141,9 +141,9 @@
    -

    +

    npm-token - @10.8.0 + @10.8.1

    Manage your authentication tokens
    diff --git a/deps/npm/docs/output/commands/npm-uninstall.html b/deps/npm/docs/output/commands/npm-uninstall.html index 32fc83fc1f1233..d8816dc7538056 100644 --- a/deps/npm/docs/output/commands/npm-uninstall.html +++ b/deps/npm/docs/output/commands/npm-uninstall.html @@ -141,9 +141,9 @@
    -

    +

    npm-uninstall - @10.8.0 + @10.8.1

    Remove a package
    diff --git a/deps/npm/docs/output/commands/npm-unpublish.html b/deps/npm/docs/output/commands/npm-unpublish.html index f9e914d67ff963..0ef9855c1e2499 100644 --- a/deps/npm/docs/output/commands/npm-unpublish.html +++ b/deps/npm/docs/output/commands/npm-unpublish.html @@ -141,9 +141,9 @@
    -

    +

    npm-unpublish - @10.8.0 + @10.8.1

    Remove a package from the registry
    diff --git a/deps/npm/docs/output/commands/npm-unstar.html b/deps/npm/docs/output/commands/npm-unstar.html index 7845f3b401f8cc..5bc670d8e683e5 100644 --- a/deps/npm/docs/output/commands/npm-unstar.html +++ b/deps/npm/docs/output/commands/npm-unstar.html @@ -141,9 +141,9 @@
    -

    +

    npm-unstar - @10.8.0 + @10.8.1

    Remove an item from your favorite packages
    diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html index 12231c0e838931..c4992cee5b6c73 100644 --- a/deps/npm/docs/output/commands/npm-update.html +++ b/deps/npm/docs/output/commands/npm-update.html @@ -141,9 +141,9 @@
    -

    +

    npm-update - @10.8.0 + @10.8.1

    Update packages
    diff --git a/deps/npm/docs/output/commands/npm-version.html b/deps/npm/docs/output/commands/npm-version.html index b1092d2af20333..de99cea865a282 100644 --- a/deps/npm/docs/output/commands/npm-version.html +++ b/deps/npm/docs/output/commands/npm-version.html @@ -141,9 +141,9 @@
    -

    +

    npm-version - @10.8.0 + @10.8.1

    Bump a package version
    diff --git a/deps/npm/docs/output/commands/npm-view.html b/deps/npm/docs/output/commands/npm-view.html index de9d9bd0280fef..d84240fa2b72b6 100644 --- a/deps/npm/docs/output/commands/npm-view.html +++ b/deps/npm/docs/output/commands/npm-view.html @@ -141,9 +141,9 @@
    -

    +

    npm-view - @10.8.0 + @10.8.1

    View registry info
    diff --git a/deps/npm/docs/output/commands/npm-whoami.html b/deps/npm/docs/output/commands/npm-whoami.html index 8cb3231e1e9030..c025f1975f92d0 100644 --- a/deps/npm/docs/output/commands/npm-whoami.html +++ b/deps/npm/docs/output/commands/npm-whoami.html @@ -141,9 +141,9 @@
    -

    +

    npm-whoami - @10.8.0 + @10.8.1

    Display npm username
    diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 9094333b74138e..81a9e3aa38f9e9 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -141,9 +141,9 @@
    -

    +

    npm - @10.8.0 + @10.8.1

    javascript package manager
    @@ -158,7 +158,7 @@

    Table of contents

    Note: This command is unaware of workspaces.

    Version

    -

    10.8.0

    +

    10.8.1

    Description

    npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/commands/npx.html b/deps/npm/docs/output/commands/npx.html index b3da26ebd097e0..0f25bd41f35af6 100644 --- a/deps/npm/docs/output/commands/npx.html +++ b/deps/npm/docs/output/commands/npx.html @@ -141,9 +141,9 @@

    -

    +

    npx - @10.8.0 + @10.8.1

    Run a command from a local or remote npm package
    diff --git a/deps/npm/docs/output/configuring-npm/folders.html b/deps/npm/docs/output/configuring-npm/folders.html index 52891fddf891d4..f0eebc8665cf58 100644 --- a/deps/npm/docs/output/configuring-npm/folders.html +++ b/deps/npm/docs/output/configuring-npm/folders.html @@ -141,9 +141,9 @@
    -

    +

    folders - @10.8.0 + @10.8.1

    Folder Structures Used by npm
    diff --git a/deps/npm/docs/output/configuring-npm/install.html b/deps/npm/docs/output/configuring-npm/install.html index e9f278ee30f88f..2d874b6f05696c 100644 --- a/deps/npm/docs/output/configuring-npm/install.html +++ b/deps/npm/docs/output/configuring-npm/install.html @@ -141,9 +141,9 @@
    -

    +

    install - @10.8.0 + @10.8.1

    Download and install node and npm
    diff --git a/deps/npm/docs/output/configuring-npm/npm-global.html b/deps/npm/docs/output/configuring-npm/npm-global.html index 52891fddf891d4..f0eebc8665cf58 100644 --- a/deps/npm/docs/output/configuring-npm/npm-global.html +++ b/deps/npm/docs/output/configuring-npm/npm-global.html @@ -141,9 +141,9 @@
    -

    +

    folders - @10.8.0 + @10.8.1

    Folder Structures Used by npm
    diff --git a/deps/npm/docs/output/configuring-npm/npm-json.html b/deps/npm/docs/output/configuring-npm/npm-json.html index ebf67c36fb2bd2..895df5190c2487 100644 --- a/deps/npm/docs/output/configuring-npm/npm-json.html +++ b/deps/npm/docs/output/configuring-npm/npm-json.html @@ -141,9 +141,9 @@
    -

    +

    package.json - @10.8.0 + @10.8.1

    Specifics of npm's package.json handling
    diff --git a/deps/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html b/deps/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html index 4882e030da6e1e..b8b858fa618e02 100644 --- a/deps/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html +++ b/deps/npm/docs/output/configuring-npm/npm-shrinkwrap-json.html @@ -141,9 +141,9 @@
    -

    +

    npm-shrinkwrap.json - @10.8.0 + @10.8.1

    A publishable lockfile
    diff --git a/deps/npm/docs/output/configuring-npm/npmrc.html b/deps/npm/docs/output/configuring-npm/npmrc.html index 60595e7cd92066..763c87f83f4f13 100644 --- a/deps/npm/docs/output/configuring-npm/npmrc.html +++ b/deps/npm/docs/output/configuring-npm/npmrc.html @@ -141,9 +141,9 @@
    -

    +

    npmrc - @10.8.0 + @10.8.1

    The npm config files
    diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index ebf67c36fb2bd2..895df5190c2487 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -141,9 +141,9 @@
    -

    +

    package.json - @10.8.0 + @10.8.1

    Specifics of npm's package.json handling
    diff --git a/deps/npm/docs/output/configuring-npm/package-lock-json.html b/deps/npm/docs/output/configuring-npm/package-lock-json.html index c0951061760ce3..838934d71c4c9f 100644 --- a/deps/npm/docs/output/configuring-npm/package-lock-json.html +++ b/deps/npm/docs/output/configuring-npm/package-lock-json.html @@ -141,9 +141,9 @@
    -

    +

    package-lock.json - @10.8.0 + @10.8.1

    A manifestation of the manifest
    diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 8e420e6cc38997..79db31dc5c396a 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -141,9 +141,9 @@
    -

    +

    config - @10.8.0 + @10.8.1

    More than you probably want to know about npm configuration
    @@ -1273,10 +1273,11 @@

    tag

If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag.

-

Also the tag that is added to the package@version specified by the npm tag -command, if no explicit tag is given.

+

It is the tag added to the package@version specified in the npm dist-tag add command, if no explicit tag is given.

When used by the npm diff command, this is the tag used to fetch the tarball that will be compared with the local files by default.

+

If used in the npm publish command, this is the tag that will be added to +the package submitted to the registry.

tag-version-prefix

  • Default: "v"
  • diff --git a/deps/npm/docs/output/using-npm/dependency-selectors.html b/deps/npm/docs/output/using-npm/dependency-selectors.html index c2535dbc0974ae..218b818821c4a7 100644 --- a/deps/npm/docs/output/using-npm/dependency-selectors.html +++ b/deps/npm/docs/output/using-npm/dependency-selectors.html @@ -141,9 +141,9 @@
    -

    +

    Dependency Selector Syntax & Querying - @10.8.0 + @10.8.1

    Dependency Selector Syntax & Querying
    diff --git a/deps/npm/docs/output/using-npm/developers.html b/deps/npm/docs/output/using-npm/developers.html index 039b7840e70554..2f79f96fdaca17 100644 --- a/deps/npm/docs/output/using-npm/developers.html +++ b/deps/npm/docs/output/using-npm/developers.html @@ -141,9 +141,9 @@
    -

    +

    developers - @10.8.0 + @10.8.1

    Developer Guide
    diff --git a/deps/npm/docs/output/using-npm/logging.html b/deps/npm/docs/output/using-npm/logging.html index 8440dbdb0c196f..f15c475c45c8bf 100644 --- a/deps/npm/docs/output/using-npm/logging.html +++ b/deps/npm/docs/output/using-npm/logging.html @@ -141,9 +141,9 @@
    -

    +

    Logging - @10.8.0 + @10.8.1

    Why, What & How We Log
    diff --git a/deps/npm/docs/output/using-npm/orgs.html b/deps/npm/docs/output/using-npm/orgs.html index fef8c1423d2c62..8779548ef9cd61 100644 --- a/deps/npm/docs/output/using-npm/orgs.html +++ b/deps/npm/docs/output/using-npm/orgs.html @@ -141,9 +141,9 @@
    -

    +

    orgs - @10.8.0 + @10.8.1

    Working with Teams & Orgs
    diff --git a/deps/npm/docs/output/using-npm/package-spec.html b/deps/npm/docs/output/using-npm/package-spec.html index 52d706cd8480b4..558f771e5032e9 100644 --- a/deps/npm/docs/output/using-npm/package-spec.html +++ b/deps/npm/docs/output/using-npm/package-spec.html @@ -141,9 +141,9 @@
    -

    +

    package-spec - @10.8.0 + @10.8.1

    Package name specifier
    diff --git a/deps/npm/docs/output/using-npm/registry.html b/deps/npm/docs/output/using-npm/registry.html index e5f4a30cb02113..d06d54ec554a0e 100644 --- a/deps/npm/docs/output/using-npm/registry.html +++ b/deps/npm/docs/output/using-npm/registry.html @@ -141,9 +141,9 @@
    -

    +

    registry - @10.8.0 + @10.8.1

    The JavaScript Package Registry
    diff --git a/deps/npm/docs/output/using-npm/removal.html b/deps/npm/docs/output/using-npm/removal.html index 3ef038bfa9d151..85c60f17646e6e 100644 --- a/deps/npm/docs/output/using-npm/removal.html +++ b/deps/npm/docs/output/using-npm/removal.html @@ -141,9 +141,9 @@
    -

    +

    removal - @10.8.0 + @10.8.1

    Cleaning the Slate
    diff --git a/deps/npm/docs/output/using-npm/scope.html b/deps/npm/docs/output/using-npm/scope.html index 0e6e4d939abb55..7cd4948690010a 100644 --- a/deps/npm/docs/output/using-npm/scope.html +++ b/deps/npm/docs/output/using-npm/scope.html @@ -141,9 +141,9 @@
    -

    +

    scope - @10.8.0 + @10.8.1

    Scoped packages
    diff --git a/deps/npm/docs/output/using-npm/scripts.html b/deps/npm/docs/output/using-npm/scripts.html index f37ac8bcf375e1..199b09829d1c25 100644 --- a/deps/npm/docs/output/using-npm/scripts.html +++ b/deps/npm/docs/output/using-npm/scripts.html @@ -141,9 +141,9 @@
    -

    +

    scripts - @10.8.0 + @10.8.1

    How npm handles the "scripts" field
    diff --git a/deps/npm/docs/output/using-npm/workspaces.html b/deps/npm/docs/output/using-npm/workspaces.html index f76929b19e7366..edb3a495420e39 100644 --- a/deps/npm/docs/output/using-npm/workspaces.html +++ b/deps/npm/docs/output/using-npm/workspaces.html @@ -141,9 +141,9 @@
    -

    +

    workspaces - @10.8.0 + @10.8.1

    Working with workspaces
    diff --git a/deps/npm/lib/cli/entry.js b/deps/npm/lib/cli/entry.js index 49b13eb0234cd4..ed73eb89e2d360 100644 --- a/deps/npm/lib/cli/entry.js +++ b/deps/npm/lib/cli/entry.js @@ -12,7 +12,7 @@ module.exports = async (process, validateEngines) => { } // Patch the global fs module here at the app level - require('graceful-fs').gracefulify(require('fs')) + require('graceful-fs').gracefulify(require('node:fs')) const satisfies = require('semver/functions/satisfies') const ExitHandler = require('./exit-handler.js') diff --git a/deps/npm/lib/cli/update-notifier.js b/deps/npm/lib/cli/update-notifier.js index 41fece36a558eb..32cac18350be9f 100644 --- a/deps/npm/lib/cli/update-notifier.js +++ b/deps/npm/lib/cli/update-notifier.js @@ -6,8 +6,8 @@ const ciInfo = require('ci-info') const gt = require('semver/functions/gt') const gte = require('semver/functions/gte') const parse = require('semver/functions/parse') -const { stat, writeFile } = require('fs/promises') -const { resolve } = require('path') +const { stat, writeFile } = require('node:fs/promises') +const { resolve } = require('node:path') // update check frequency const DAILY = 1000 * 60 * 60 * 24 diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js index dad0c405f713b4..547fa7af01577c 100644 --- a/deps/npm/lib/commands/access.js +++ b/deps/npm/lib/commands/access.js @@ -208,7 +208,7 @@ class Access extends BaseCommand { outputs[item] = lookup[val] || val } if (this.npm.config.get('json')) { - output.standard(JSON.stringify(outputs, null, 2)) + output.buffer(outputs) } else { for (const item of Object.keys(outputs).sort(localeCompare)) { if (!limiter || limiter === item) { diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js index d23c51c3902875..87c70a57dc0edf 100644 --- a/deps/npm/lib/commands/cache.js +++ b/deps/npm/lib/commands/cache.js @@ -1,7 +1,7 @@ const cacache = require('cacache') const pacote = require('pacote') -const fs = require('fs/promises') -const { join } = require('path') +const fs = require('node:fs/promises') +const { join } = require('node:path') const semver = require('semver') const BaseCommand = require('../base-cmd.js') const npa = require('npm-package-arg') @@ -152,15 +152,20 @@ class Cache extends BaseCommand { throw this.usageError('First argument to `add` is required') } - return Promise.all(args.map(spec => { + await Promise.all(args.map(async spec => { log.silly('cache add', 'spec', spec) // we ask pacote for the thing, and then just throw the data // away so that it tee-pipes it into the cache like it does // for a normal request. - return pacote.tarball.stream(spec, stream => { + await pacote.tarball.stream(spec, stream => { stream.resume() return stream.promise() }, { ...this.npm.flatOptions }) + + await pacote.manifest(spec, { + ...this.npm.flatOptions, + fullMetadata: true, + }) })) } diff --git a/deps/npm/lib/commands/ci.js b/deps/npm/lib/commands/ci.js index 7e79d7208c9c4b..c190de7e3ea7f8 100644 --- a/deps/npm/lib/commands/ci.js +++ b/deps/npm/lib/commands/ci.js @@ -1,9 +1,11 @@ const reifyFinish = require('../utils/reify-finish.js') const runScript = require('@npmcli/run-script') -const fs = require('fs/promises') +const fs = require('node:fs/promises') +const path = require('node:path') const { log, time } = require('proc-log') const validateLockfile = require('../utils/validate-lockfile.js') const ArboristWorkspaceCmd = require('../arborist-cmd.js') +const getWorkspaces = require('../utils/get-workspaces.js') class CI extends ArboristWorkspaceCmd { static description = 'Clean install a project' @@ -76,14 +78,22 @@ class CI extends ArboristWorkspaceCmd { const dryRun = this.npm.config.get('dry-run') if (!dryRun) { + const workspacePaths = await getWorkspaces([], { + path: this.npm.localPrefix, + includeWorkspaceRoot: true, + }) + // Only remove node_modules after we've successfully loaded the virtual // tree and validated the lockfile await time.start('npm-ci:rm', async () => { - const path = `${where}/node_modules` - // get the list of entries so we can skip the glob for performance - const entries = await fs.readdir(path, null).catch(() => []) - return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, - { force: true, recursive: true }))) + return await Promise.all([...workspacePaths.values()].map(async modulePath => { + const fullPath = path.join(modulePath, 'node_modules') + // get the list of entries so we can skip the glob for performance + const entries = await fs.readdir(fullPath, null).catch(() => []) + return Promise.all(entries.map(folder => { + return fs.rm(path.join(fullPath, folder), { force: true, recursive: true }) + })) + })) }) } diff --git a/deps/npm/lib/commands/completion.js b/deps/npm/lib/commands/completion.js index 9b147d2f5bdac6..f8c2e00c6baee7 100644 --- a/deps/npm/lib/commands/completion.js +++ b/deps/npm/lib/commands/completion.js @@ -28,9 +28,9 @@ // one per line for the shell completion method to consume in IFS=$'\n' mode // as an array. -const fs = require('fs/promises') +const fs = require('node:fs/promises') const nopt = require('nopt') -const { resolve } = require('path') +const { resolve } = require('node:path') const { output } = require('proc-log') const Npm = require('../npm.js') const { definitions, shorthands } = require('@npmcli/config/lib/definitions') diff --git a/deps/npm/lib/commands/config.js b/deps/npm/lib/commands/config.js index e8da195204c00f..6b1447d7e84268 100644 --- a/deps/npm/lib/commands/config.js +++ b/deps/npm/lib/commands/config.js @@ -403,7 +403,7 @@ ${defData} publicConf[key] = value } - output.standard(JSON.stringify(publicConf, null, 2)) + output.buffer(publicConf) } } diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js index ca8b1237b40c5a..3fa8090a350468 100644 --- a/deps/npm/lib/commands/diff.js +++ b/deps/npm/lib/commands/diff.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const semver = require('semver') const libnpmdiff = require('libnpmdiff') const npa = require('npm-package-arg') diff --git a/deps/npm/lib/commands/doctor.js b/deps/npm/lib/commands/doctor.js index c29dd7e0ecb174..8fbd49b7ca8bfb 100644 --- a/deps/npm/lib/commands/doctor.js +++ b/deps/npm/lib/commands/doctor.js @@ -1,9 +1,9 @@ const cacache = require('cacache') -const { access, lstat, readdir, constants: { R_OK, W_OK, X_OK } } = require('fs/promises') +const { access, lstat, readdir, constants: { R_OK, W_OK, X_OK } } = require('node:fs/promises') const fetch = require('make-fetch-happen') const which = require('which') const pacote = require('pacote') -const { resolve } = require('path') +const { resolve } = require('node:path') const semver = require('semver') const { log, output } = require('proc-log') const ping = require('../utils/ping.js') diff --git a/deps/npm/lib/commands/edit.js b/deps/npm/lib/commands/edit.js index 4110a1db55e825..b2c2ec8d2a39a0 100644 --- a/deps/npm/lib/commands/edit.js +++ b/deps/npm/lib/commands/edit.js @@ -1,6 +1,6 @@ -const { resolve } = require('path') -const { lstat } = require('fs/promises') -const cp = require('child_process') +const { resolve } = require('node:path') +const { lstat } = require('node:fs/promises') +const cp = require('node:child_process') const completion = require('../utils/installed-shallow.js') const BaseCommand = require('../base-cmd.js') diff --git a/deps/npm/lib/commands/exec.js b/deps/npm/lib/commands/exec.js index 9bb4b15e0c5a3c..57ee8efe2c98fe 100644 --- a/deps/npm/lib/commands/exec.js +++ b/deps/npm/lib/commands/exec.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const libexec = require('libnpmexec') const BaseCommand = require('../base-cmd.js') @@ -39,11 +39,8 @@ class Exec extends BaseCommand { } async callExec (args, { name, locationMsg, runPath } = {}) { - // This is where libnpmexec will look for locally installed packages at the project level - const localPrefix = this.npm.localPrefix - // This is where libnpmexec will look for locally installed packages at the workspace level let localBin = this.npm.localBin - let path = localPrefix + let pkgPath = this.npm.localPrefix // This is where libnpmexec will actually run the scripts from if (!runPath) { @@ -54,7 +51,7 @@ class Exec extends BaseCommand { localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin') // We also need to look for `bin` entries in the workspace package.json // libnpmexec will NOT look in the project root for the bin entry - path = runPath + pkgPath = runPath } const call = this.npm.config.get('call') @@ -84,16 +81,25 @@ class Exec extends BaseCommand { // we explicitly set packageLockOnly to false because if it's true // when we try to install a missing package, we won't actually install it packageLockOnly: false, - // copy args so they dont get mutated - args: [...args], + // what the user asked to run args[0] is run by default + args: [...args], // copy args so they dont get mutated + // specify a custom command to be run instead of args[0] call, chalk, + // where to look for bins globally, if a file matches call or args[0] it is called globalBin, + // where to look for packages globally, if a package matches call or args[0] it is called globalPath, + // where to look for bins locally, if a file matches call or args[0] it is called localBin, locationMsg, + // packages that need to be installed packages, - path, + // path where node_modules is + path: this.npm.localPrefix, + // where to look for package.json#bin entries first + pkgPath, + // cwd to run from runPath, scriptShell, yes, diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js index 2e7d07df729a8c..cb0644304d2b55 100644 --- a/deps/npm/lib/commands/explain.js +++ b/deps/npm/lib/commands/explain.js @@ -1,7 +1,7 @@ const { explainNode } = require('../utils/explain-dep.js') const npa = require('npm-package-arg') const semver = require('semver') -const { relative, resolve } = require('path') +const { relative, resolve } = require('node:path') const validName = require('validate-npm-package-name') const { output } = require('proc-log') const ArboristWorkspaceCmd = require('../arborist-cmd.js') @@ -76,7 +76,7 @@ class Explain extends ArboristWorkspaceCmd { } if (this.npm.flatOptions.json) { - output.standard(JSON.stringify(expls, null, 2)) + output.buffer(expls) } else { output.standard(expls.map(expl => { return explainNode(expl, Infinity, this.npm.chalk) diff --git a/deps/npm/lib/commands/explore.js b/deps/npm/lib/commands/explore.js index d9dd9a9931f569..184af2bdc5a161 100644 --- a/deps/npm/lib/commands/explore.js +++ b/deps/npm/lib/commands/explore.js @@ -1,6 +1,6 @@ const pkgJson = require('@npmcli/package-json') const runScript = require('@npmcli/run-script') -const { join, relative } = require('path') +const { join, relative } = require('node:path') const { log, output } = require('proc-log') const completion = require('../utils/installed-shallow.js') const BaseCommand = require('../base-cmd.js') diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js index 8bb4c304b379ba..8c194dac80b49b 100644 --- a/deps/npm/lib/commands/fund.js +++ b/deps/npm/lib/commands/fund.js @@ -85,16 +85,12 @@ class Fund extends ArboristWorkspaceCmd { }) if (this.npm.config.get('json')) { - output.standard(this.printJSON(fundingInfo)) + output.buffer(fundingInfo) } else { output.standard(this.printHuman(fundingInfo)) } } - printJSON (fundingInfo) { - return JSON.stringify(fundingInfo, null, 2) - } - printHuman (fundingInfo) { const unicode = this.npm.config.get('unicode') const seenUrls = new Map() diff --git a/deps/npm/lib/commands/help.js b/deps/npm/lib/commands/help.js index a2307bf1d8a2c9..057090da0036c5 100644 --- a/deps/npm/lib/commands/help.js +++ b/deps/npm/lib/commands/help.js @@ -1,5 +1,5 @@ const spawn = require('@npmcli/promise-spawn') -const path = require('path') +const path = require('node:path') const { openUrl } = require('../utils/open-url.js') const { glob } = require('glob') const { output, input } = require('proc-log') diff --git a/deps/npm/lib/commands/hook.js b/deps/npm/lib/commands/hook.js index 43da92f3f9e6c6..5793b974197c8d 100644 --- a/deps/npm/lib/commands/hook.js +++ b/deps/npm/lib/commands/hook.js @@ -40,7 +40,7 @@ class Hook extends BaseCommand { async add (pkg, uri, secret, opts) { const hook = await hookApi.add(pkg, uri, secret, opts) if (opts.json) { - output.standard(JSON.stringify(hook, null, 2)) + output.buffer(hook) } else if (opts.parseable) { output.standard(Object.keys(hook).join('\t')) output.standard(Object.keys(hook).map(k => hook[k]).join('\t')) @@ -53,7 +53,7 @@ class Hook extends BaseCommand { const hooks = await hookApi.ls({ ...opts, package: pkg }) if (opts.json) { - output.standard(JSON.stringify(hooks, null, 2)) + output.buffer(hooks) } else if (opts.parseable) { output.standard(Object.keys(hooks[0]).join('\t')) hooks.forEach(hook => { @@ -80,7 +80,7 @@ class Hook extends BaseCommand { async rm (id, opts) { const hook = await hookApi.rm(id, opts) if (opts.json) { - output.standard(JSON.stringify(hook, null, 2)) + output.buffer(hook) } else if (opts.parseable) { output.standard(Object.keys(hook).join('\t')) output.standard(Object.keys(hook).map(k => hook[k]).join('\t')) @@ -92,7 +92,7 @@ class Hook extends BaseCommand { async update (id, uri, secret, opts) { const hook = await hookApi.update(id, uri, secret, opts) if (opts.json) { - output.standard(JSON.stringify(hook, null, 2)) + output.buffer(hook) } else if (opts.parseable) { output.standard(Object.keys(hook).join('\t')) output.standard(Object.keys(hook).map(k => hook[k]).join('\t')) diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js index 205352e86e6edc..4c68210483598f 100644 --- a/deps/npm/lib/commands/init.js +++ b/deps/npm/lib/commands/init.js @@ -1,6 +1,6 @@ -const { statSync } = require('fs') -const { relative, resolve } = require('path') -const { mkdir } = require('fs/promises') +const { statSync } = require('node:fs') +const { relative, resolve } = require('node:path') +const { mkdir } = require('node:fs/promises') const initJson = require('init-package-json') const npa = require('npm-package-arg') const libexec = require('libnpmexec') diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js index bde761c4226dcd..8a41548d7f108b 100644 --- a/deps/npm/lib/commands/link.js +++ b/deps/npm/lib/commands/link.js @@ -1,5 +1,5 @@ -const { readdir } = require('fs/promises') -const { resolve } = require('path') +const { readdir } = require('node:fs/promises') +const { resolve } = require('node:path') const npa = require('npm-package-arg') const pkgJson = require('@npmcli/package-json') const semver = require('semver') diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index 7dbe14fea20bc3..417cb1b40d8c25 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -1,4 +1,4 @@ -const { resolve, relative, sep } = require('path') +const { resolve, relative, sep } = require('node:path') const archy = require('archy') const { breadth } = require('treeverse') const npa = require('npm-package-arg') @@ -177,11 +177,14 @@ class LS extends ArboristWorkspaceCmd { const [rootError] = tree.errors.filter(e => e.code === 'EJSONPARSE' && e.path === resolve(path, 'package.json')) - output.buffer( - json ? jsonOutput({ path, problems, result, rootError, seenItems }) : - parseable ? parseableOutput({ seenNodes, global, long }) : - humanOutput({ chalk, result, seenItems, unicode }) - ) + if (json) { + output.buffer(jsonOutput({ path, problems, result, rootError, seenItems })) + } else { + output.standard(parseable + ? parseableOutput({ seenNodes, global, long }) + : humanOutput({ chalk, result, seenItems, unicode }) + ) + } // if filtering items, should exit with error code on no results if (result && !result[_include] && args.length) { diff --git a/deps/npm/lib/commands/org.js b/deps/npm/lib/commands/org.js index caebadbc545e7e..613498056f556a 100644 --- a/deps/npm/lib/commands/org.js +++ b/deps/npm/lib/commands/org.js @@ -100,14 +100,12 @@ class Org extends BaseCommand { org = org.replace(/^[~@]?/, '') const userCount = Object.keys(roster).length if (opts.json) { - output.standard( - JSON.stringify({ - user, - org, - userCount, - deleted: true, - }) - ) + output.buffer({ + user, + org, + userCount, + deleted: true, + }) } else if (opts.parseable) { output.standard(['user', 'org', 'userCount', 'deleted'].join('\t')) output.standard([user, org, userCount, true].join('\t')) @@ -135,7 +133,7 @@ class Org extends BaseCommand { roster = newRoster } if (opts.json) { - output.standard(JSON.stringify(roster, null, 2)) + output.buffer(roster) } else if (opts.parseable) { output.standard(['user', 'role'].join('\t')) Object.keys(roster).forEach(u => { diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index 2249808110bbbf..e8bba47cc213ff 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -8,6 +8,17 @@ const { output } = require('proc-log') const localeCompare = require('@isaacs/string-locale-compare')('en') const ArboristWorkspaceCmd = require('../arborist-cmd.js') +const safeNpa = (spec) => { + try { + return npa(spec) + } catch { + return null + } +} + +// This string is load bearing and is shared with Arborist +const MISSING = 'MISSING' + class Outdated extends ArboristWorkspaceCmd { static description = 'Check for outdated packages' static name = 'outdated' @@ -21,182 +32,131 @@ class Outdated extends ArboristWorkspaceCmd { 'workspace', ] - async exec (args) { - const global = resolve(this.npm.globalDir, '..') - const where = this.npm.global - ? global - : this.npm.prefix + #tree + #list = [] + #edges = new Set() + #filterSet + async exec (args) { const Arborist = require('@npmcli/arborist') const arb = new Arborist({ ...this.npm.flatOptions, - path: where, + path: this.npm.global ? resolve(this.npm.globalDir, '..') : this.npm.prefix, }) - - this.edges = new Set() - this.list = [] - this.tree = await arb.loadActual() - - if (this.workspaceNames && this.workspaceNames.length) { - this.filterSet = - arb.workspaceDependencySet( - this.tree, - this.workspaceNames, - this.npm.flatOptions.includeWorkspaceRoot - ) + this.#tree = await arb.loadActual() + + if (this.workspaceNames?.length) { + this.#filterSet = arb.workspaceDependencySet( + this.#tree, + this.workspaceNames, + this.npm.flatOptions.includeWorkspaceRoot + ) } else if (!this.npm.flatOptions.workspacesEnabled) { - this.filterSet = - arb.excludeWorkspacesDependencySet(this.tree) + this.#filterSet = arb.excludeWorkspacesDependencySet(this.#tree) } - if (args.length !== 0) { - // specific deps - for (let i = 0; i < args.length; i++) { - const nodes = this.tree.inventory.query('name', args[i]) - this.getEdges(nodes, 'edgesIn') + if (args.length) { + for (const arg of args) { + // specific deps + this.#getEdges(this.#tree.inventory.query('name', arg), 'edgesIn') } } else { if (this.npm.config.get('all')) { // all deps in tree - const nodes = this.tree.inventory.values() - this.getEdges(nodes, 'edgesOut') + this.#getEdges(this.#tree.inventory.values(), 'edgesOut') } // top-level deps - this.getEdges() + this.#getEdges() } - await Promise.all(Array.from(this.edges).map((edge) => { - return this.getOutdatedInfo(edge) - })) + await Promise.all([...this.#edges].map((e) => this.#getOutdatedInfo(e))) - // sorts list alphabetically - const outdated = this.list.sort((a, b) => localeCompare(a.name, b.name)) + // sorts list alphabetically by name and then dependent + const outdated = this.#list + .sort((a, b) => localeCompare(a.name, b.name) || localeCompare(a.dependent, b.dependent)) - if (outdated.length > 0) { + if (outdated.length) { process.exitCode = 1 } - // return if no outdated packages - if (outdated.length === 0 && !this.npm.config.get('json')) { + if (this.npm.config.get('json')) { + output.buffer(this.#json(outdated)) return } - // display results - if (this.npm.config.get('json')) { - output.standard(this.makeJSON(outdated)) - } else if (this.npm.config.get('parseable')) { - output.standard(this.makeParseable(outdated)) - } else { - const outList = outdated.map(x => this.makePretty(x)) - const outHead = ['Package', - 'Current', - 'Wanted', - 'Latest', - 'Location', - 'Depended by', - ] - - if (this.npm.config.get('long')) { - outHead.push('Package Type', 'Homepage') - } - const outTable = [outHead].concat(outList) - - outTable[0] = outTable[0].map(heading => this.npm.chalk.bold.underline(heading)) + const res = this.npm.config.get('parseable') + ? this.#parseable(outdated) + : this.#pretty(outdated) - const tableOpts = { - align: ['l', 'r', 'r', 'r', 'l'], - stringLength: s => stripVTControlCharacters(s).length, - } - output.standard(table(outTable, tableOpts)) + if (res) { + output.standard(res) } } - getEdges (nodes, type) { + #getEdges (nodes, type) { // when no nodes are provided then it should only read direct deps // from the root node and its workspaces direct dependencies if (!nodes) { - this.getEdgesOut(this.tree) - this.getWorkspacesEdges() + this.#getEdgesOut(this.#tree) + this.#getWorkspacesEdges() return } for (const node of nodes) { - type === 'edgesOut' - ? this.getEdgesOut(node) - : this.getEdgesIn(node) + if (type === 'edgesOut') { + this.#getEdgesOut(node) + } else { + this.#getEdgesIn(node) + } } } - getEdgesIn (node) { + #getEdgesIn (node) { for (const edge of node.edgesIn) { - this.trackEdge(edge) + this.#trackEdge(edge) } } - getEdgesOut (node) { + #getEdgesOut (node) { // TODO: normalize usage of edges and avoid looping through nodes here - if (this.npm.global) { - for (const child of node.children.values()) { - this.trackEdge(child) - } - } else { - for (const edge of node.edgesOut.values()) { - this.trackEdge(edge) - } + const edges = this.npm.global ? node.children.values() : node.edgesOut.values() + for (const edge of edges) { + this.#trackEdge(edge) } } - trackEdge (edge) { - const filteredOut = - edge.from - && this.filterSet - && this.filterSet.size > 0 - && !this.filterSet.has(edge.from.target) - - if (filteredOut) { + #trackEdge (edge) { + if (edge.from && this.#filterSet?.size > 0 && !this.#filterSet.has(edge.from.target)) { return } - - this.edges.add(edge) + this.#edges.add(edge) } - getWorkspacesEdges () { + #getWorkspacesEdges () { if (this.npm.global) { return } - for (const edge of this.tree.edgesOut.values()) { - const workspace = edge - && edge.to - && edge.to.target - && edge.to.target.isWorkspace - - if (workspace) { - this.getEdgesOut(edge.to.target) + for (const edge of this.#tree.edgesOut.values()) { + if (edge?.to?.target?.isWorkspace) { + this.#getEdgesOut(edge.to.target) } } } - async getPackument (spec) { - const packument = await pacote.packument(spec, { + async #getPackument (spec) { + return pacote.packument(spec, { ...this.npm.flatOptions, fullMetadata: this.npm.config.get('long'), preferOnline: true, }) - return packument } - async getOutdatedInfo (edge) { - let alias = false - try { - alias = npa(edge.spec).subSpec - } catch (err) { - // ignore errors, no alias - } - const spec = npa(alias ? alias.name : edge.name) + async #getOutdatedInfo (edge) { + const alias = safeNpa(edge.spec)?.subSpec?.name + const spec = npa(alias ?? edge.name) const node = edge.to || edge - const { path, location } = node - const { version: current } = node.package || {} + const { path, location, package: { version: current } = {} } = node const type = edge.optional ? 'optionalDependencies' : edge.peer ? 'peerDependencies' @@ -211,34 +171,22 @@ class Outdated extends ArboristWorkspaceCmd { // deps different from prod not currently // on disk are not included in the output - if (edge.error === 'MISSING' && type !== 'dependencies') { + if (edge.error === MISSING && type !== 'dependencies') { return } + // if it's not a range, version, or tag, skip it + if (!safeNpa(`${edge.name}@${edge.spec}`)?.registry) { + return null + } + try { - const packument = await this.getPackument(spec) + const packument = await this.#getPackument(spec) const expected = alias ? alias.fetchSpec : edge.spec - // if it's not a range, version, or tag, skip it - try { - if (!npa(`${edge.name}@${edge.spec}`).registry) { - return null - } - } catch (err) { - return null - } const wanted = pickManifest(packument, expected, this.npm.flatOptions) const latest = pickManifest(packument, '*', this.npm.flatOptions) - - if ( - !current || - current !== wanted.version || - wanted.version !== latest.version - ) { - const dependent = edge.from ? - this.maybeWorkspaceName(edge.from) - : 'global' - - this.list.push({ + if (!current || current !== wanted.version || wanted.version !== latest.version) { + this.#list.push({ name: alias ? edge.spec.replace('npm', edge.name) : edge.name, path, type, @@ -246,126 +194,88 @@ class Outdated extends ArboristWorkspaceCmd { location, wanted: wanted.version, latest: latest.version, - dependent, + workspaceDependent: edge.from?.isWorkspace ? edge.from.pkgid : null, + dependent: edge.from?.name ?? 'global', homepage: packument.homepage, }) } } catch (err) { // silently catch and ignore ETARGET, E403 & // E404 errors, deps are just skipped - if (!( - err.code === 'ETARGET' || - err.code === 'E403' || - err.code === 'E404') - ) { + if (!['ETARGET', 'E404', 'E404'].includes(err.code)) { throw err } } } - maybeWorkspaceName (node) { - if (!node.isWorkspace) { - return node.name - } - - const humanOutput = - !this.npm.config.get('json') && !this.npm.config.get('parseable') - - const workspaceName = - humanOutput - ? node.pkgid - : node.name - - return humanOutput - ? this.npm.chalk.blue(workspaceName) - : workspaceName - } - // formatting functions - makePretty (dep) { - const { - current = 'MISSING', - location = '-', - homepage = '', - name, - wanted, - latest, - type, - dependent, - } = dep - - const columns = [ - this.npm.chalk[current === wanted ? 'yellow' : 'red'](name), - current, - this.npm.chalk.cyan(wanted), - this.npm.chalk.blue(latest), - location, - dependent, - ] - - if (this.npm.config.get('long')) { - columns[6] = type - columns[7] = this.npm.chalk.blue(homepage) + + #pretty (list) { + if (!list.length) { + return } - return columns + const long = this.npm.config.get('long') + const { bold, yellow, red, cyan, blue } = this.npm.chalk + + return table([ + [ + 'Package', + 'Current', + 'Wanted', + 'Latest', + 'Location', + 'Depended by', + ...long ? ['Package Type', 'Homepage'] : [], + ].map(h => bold.underline(h)), + ...list.map((d) => [ + d.current === d.wanted ? yellow(d.name) : red(d.name), + d.current ?? 'MISSING', + cyan(d.wanted), + blue(d.latest), + d.location ?? '-', + d.workspaceDependent ? blue(d.workspaceDependent) : d.dependent, + ...long ? [d.type, blue(d.homepage ?? '')] : [], + ]), + ], { + align: ['l', 'r', 'r', 'r', 'l'], + stringLength: s => stripVTControlCharacters(s).length, + }) } // --parseable creates output like this: // :::: - makeParseable (list) { - return list.map(dep => { - const { - name, - current, - wanted, - latest, - path, - dependent, - type, - homepage, - } = dep - const out = [ - path, - name + '@' + wanted, - current ? (name + '@' + current) : 'MISSING', - name + '@' + latest, - dependent, - ] - if (this.npm.config.get('long')) { - out.push(type, homepage) - } - - return out.join(':') - }).join('\n') + #parseable (list) { + return list.map(d => [ + d.path, + `${d.name}@${d.wanted}`, + d.current ? `${d.name}@${d.current}` : 'MISSING', + `${d.name}@${d.latest}`, + d.dependent, + ...this.npm.config.get('long') ? [d.type, d.homepage] : [], + ].join(':')).join('\n') } - makeJSON (list) { - const out = {} - list.forEach(dep => { - const { - name, - current, - wanted, - latest, - path, - type, - dependent, - homepage, - } = dep - out[name] = { - current, - wanted, - latest, - dependent, - location: path, - } - if (this.npm.config.get('long')) { - out[name].type = type - out[name].homepage = homepage + #json (list) { + // TODO(BREAKING_CHANGE): this should just return an array. It's a list and + // turing it into an object with keys is lossy since multiple items in the + // list could have the same key. For now we hack that by only changing + // top level values into arrays if they have multiple outdated items + return list.reduce((acc, d) => { + const dep = { + current: d.current, + wanted: d.wanted, + latest: d.latest, + dependent: d.dependent, + location: d.path, + ...this.npm.config.get('long') ? { type: d.type, homepage: d.homepage } : {}, } - }) - return JSON.stringify(out, null, 2) + acc[d.name] = acc[d.name] + // If this item alread has an outdated dep then we turn it into an array + ? (Array.isArray(acc[d.name]) ? acc[d.name] : [acc[d.name]]).concat(dep) + : dep + return acc + }, {}) } } diff --git a/deps/npm/lib/commands/ping.js b/deps/npm/lib/commands/ping.js index 0d057862baa8fe..3388ba1aa378e0 100644 --- a/deps/npm/lib/commands/ping.js +++ b/deps/npm/lib/commands/ping.js @@ -16,11 +16,11 @@ class Ping extends BaseCommand { const time = Date.now() - start log.notice('PONG', `${time}ms`) if (this.npm.config.get('json')) { - output.standard(JSON.stringify({ + output.buffer({ registry: cleanRegistry, time, details, - }, null, 2)) + }) } else if (Object.keys(details).length) { log.notice('PONG', JSON.stringify(details, null, 2)) } diff --git a/deps/npm/lib/commands/pkg.js b/deps/npm/lib/commands/pkg.js index a108d79c515172..a011fc10be1070 100644 --- a/deps/npm/lib/commands/pkg.js +++ b/deps/npm/lib/commands/pkg.js @@ -59,28 +59,24 @@ class Pkg extends BaseCommand { this.npm.config.set('json', true) const pkgJson = await PackageJson.load(path) - let unwrap = false let result = pkgJson.content if (args.length) { result = new Queryable(result).query(args) // in case there's only a single result from the query // just prints that one element to stdout + // TODO(BREAKING_CHANGE): much like other places where we unwrap single + // item arrays this should go away. it makes the behavior unknown for users + // who don't already know the shape of the data. if (Object.keys(result).length === 1) { - unwrap = true result = result[args] } } - if (workspace) { - // workspaces are always json - output.buffer({ [workspace]: result }) - } else { - // if the result was unwrapped, stringify as json which will add quotes around strings - // TODO: https://github.com/npm/cli/issues/5508 a raw mode has been requested similar - // to jq -r. If that was added then it would conditionally not call JSON.stringify here - output.buffer(unwrap ? JSON.stringify(result) : result) - } + // The display layer is responsible for calling JSON.stringify on the result + // TODO: https://github.com/npm/cli/issues/5508 a raw mode has been requested similar + // to jq -r. If that was added then this method should no longer set `json:true` all the time + output.buffer(workspace ? { [workspace]: result } : result) } async set (args, { path }) { diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js index adf534730de243..965fcbcb8ce29b 100644 --- a/deps/npm/lib/commands/profile.js +++ b/deps/npm/lib/commands/profile.js @@ -1,5 +1,5 @@ -const { inspect } = require('util') -const { URL } = require('url') +const { inspect } = require('node:util') +const { URL } = require('node:url') const { log, output } = require('proc-log') const { get, set, createToken } = require('npm-profile') const qrcodeTerminal = require('qrcode-terminal') @@ -108,7 +108,7 @@ class Profile extends BaseCommand { } if (this.npm.config.get('json')) { - output.standard(JSON.stringify(info, null, 2)) + output.buffer(info) return } @@ -211,7 +211,7 @@ class Profile extends BaseCommand { const result = await otplease(this.npm, conf, c => set(newUser, c)) if (this.npm.config.get('json')) { - output.standard(JSON.stringify({ [prop]: result[prop] }, null, 2)) + output.buffer({ [prop]: result[prop] }) } else if (this.npm.config.get('parseable')) { output.standard(prop + '\t' + result[prop]) } else if (result[prop] != null) { @@ -378,7 +378,7 @@ class Profile extends BaseCommand { await set({ tfa: { password: password, mode: 'disable' } }, conf) if (this.npm.config.get('json')) { - output.standard(JSON.stringify({ tfa: false }, null, 2)) + output.buffer({ tfa: false }) } else if (this.npm.config.get('parseable')) { output.standard('tfa\tfalse') } else { diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index 6f893b929284bf..3fe337a7b1c43f 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -127,6 +127,15 @@ class Publish extends BaseCommand { const noCreds = !(creds.token || creds.username || creds.certfile && creds.keyfile) const outputRegistry = replaceInfo(registry) + // if a workspace package is marked private then we skip it + if (workspace && manifest.private) { + throw Object.assign( + new Error(`This package has been marked as private + Remove the 'private' field from the package.json to publish it.`), + { code: 'EPRIVATE' } + ) + } + if (noCreds) { const msg = `This command requires you to be logged in to ${outputRegistry}` if (dryRun) { diff --git a/deps/npm/lib/commands/query.js b/deps/npm/lib/commands/query.js index fe84469b88fe0a..74a50fc581d43e 100644 --- a/deps/npm/lib/commands/query.js +++ b/deps/npm/lib/commands/query.js @@ -51,70 +51,71 @@ class Query extends BaseCommand { 'expect-results', ] - get parsedResponse () { - return JSON.stringify(this.#response, null, 2) + constructor (...args) { + super(...args) + this.npm.config.set('json', true) } async exec (args) { - // one dir up from wherever node_modules lives - const where = resolve(this.npm.dir, '..') + const packageLock = this.npm.config.get('package-lock-only') const Arborist = require('@npmcli/arborist') - const opts = { + const arb = new Arborist({ ...this.npm.flatOptions, - path: where, - forceActual: true, - } - const arb = new Arborist(opts) + // one dir up from wherever node_modules lives + path: resolve(this.npm.dir, '..'), + forceActual: !packageLock, + }) let tree - if (this.npm.config.get('package-lock-only')) { + if (packageLock) { try { tree = await arb.loadVirtual() } catch (err) { log.verbose('loadVirtual', err.stack) - /* eslint-disable-next-line max-len */ - throw this.usageError('A package lock or shrinkwrap file is required in package-lock-only mode') + throw this.usageError( + 'A package lock or shrinkwrap file is required in package-lock-only mode' + ) } } else { - tree = await arb.loadActual(opts) + tree = await arb.loadActual() } - const items = await tree.querySelectorAll(args[0], this.npm.flatOptions) - this.buildResponse(items) - - this.checkExpected(this.#response.length) - output.standard(this.parsedResponse) + await this.#queryTree(tree, args[0]) + this.#output() } async execWorkspaces (args) { await this.setWorkspaces() const Arborist = require('@npmcli/arborist') - const opts = { + const arb = new Arborist({ ...this.npm.flatOptions, path: this.npm.prefix, + }) + // FIXME: Workspace support in query does not work as expected so this does not + // do the same package-lock-only check as this.exec(). + // https://github.com/npm/cli/pull/6732#issuecomment-1708804921 + const tree = await arb.loadActual() + for (const path of this.workspacePaths) { + const wsTree = path === tree.root.path + ? tree // --includes-workspace-root + : await tree.querySelectorAll(`.workspace:path(${path})`).then(r => r[0].target) + await this.#queryTree(wsTree, args[0]) } - const arb = new Arborist(opts) - const tree = await arb.loadActual(opts) - for (const workspacePath of this.workspacePaths) { - let items - if (workspacePath === tree.root.path) { - // include-workspace-root - items = await tree.querySelectorAll(args[0]) - } else { - const [workspace] = await tree.querySelectorAll(`.workspace:path(${workspacePath})`) - items = await workspace.target.querySelectorAll(args[0], this.npm.flatOptions) - } - this.buildResponse(items) - } + this.#output() + } + + #output () { this.checkExpected(this.#response.length) - output.standard(this.parsedResponse) + output.buffer(this.#response) } // builds a normalized inventory - buildResponse (items) { + async #queryTree (tree, arg) { + const items = await tree.querySelectorAll(arg, this.npm.flatOptions) for (const node of items) { - if (!node.target.location || !this.#seen.has(node.target.location)) { + const { location } = node.target + if (!location || !this.#seen.has(location)) { const item = new QuerySelectorItem(node) this.#response.push(item) - if (node.target.location) { + if (location) { this.#seen.add(item.location) } } diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js index 3894f0aa290cc7..1c19836106e063 100644 --- a/deps/npm/lib/commands/rebuild.js +++ b/deps/npm/lib/commands/rebuild.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const { output } = require('proc-log') const npa = require('npm-package-arg') const semver = require('semver') diff --git a/deps/npm/lib/commands/repo.js b/deps/npm/lib/commands/repo.js index 8e2fef24771d9d..3f120c0a3f59f5 100644 --- a/deps/npm/lib/commands/repo.js +++ b/deps/npm/lib/commands/repo.js @@ -1,4 +1,4 @@ -const { URL } = require('url') +const { URL } = require('node:url') const PackageUrlCmd = require('../package-url-cmd.js') class Repo extends PackageUrlCmd { diff --git a/deps/npm/lib/commands/sbom.js b/deps/npm/lib/commands/sbom.js index ff7377581dfa51..278c6d506b42af 100644 --- a/deps/npm/lib/commands/sbom.js +++ b/deps/npm/lib/commands/sbom.js @@ -22,10 +22,6 @@ class SBOM extends BaseCommand { 'workspaces', ] - get #parsedResponse () { - return JSON.stringify(this.#response, null, 2) - } - async exec () { const sbomFormat = this.npm.config.get('sbom-format') const packageLockOnly = this.npm.config.get('package-lock-only') @@ -35,56 +31,43 @@ class SBOM extends BaseCommand { throw this.usageError(`Must specify --sbom-format flag with one of: ${SBOM_FORMATS.join(', ')}.`) } - const Arborist = require('@npmcli/arborist') - const opts = { ...this.npm.flatOptions, path: this.npm.prefix, forceActual: true, } + const Arborist = require('@npmcli/arborist') const arb = new Arborist(opts) - let tree - if (packageLockOnly) { - try { - tree = await arb.loadVirtual(opts) - } catch (err) { - /* eslint-disable-next-line max-len */ - throw this.usageError('A package lock or shrinkwrap file is required in package-lock-only mode') - } - } else { - tree = await arb.loadActual(opts) - } + const tree = packageLockOnly ? await arb.loadVirtual(opts).catch(() => { + /* eslint-disable-next-line max-len */ + throw this.usageError('A package lock or shrinkwrap file is required in package-lock-only mode') + }) : await arb.loadActual(opts) // Collect the list of selected workspaces in the project - let wsNodes - if (this.workspaceNames && this.workspaceNames.length) { - wsNodes = arb.workspaceNodes(tree, this.workspaceNames) - } + const wsNodes = this.workspaceNames?.length + ? arb.workspaceNodes(tree, this.workspaceNames) + : null // Build the selector and query the tree for the list of nodes const selector = this.#buildSelector({ wsNodes }) log.info('sbom', `Using dependency selector: ${selector}`) const items = await tree.querySelectorAll(selector) - const errors = new Set() - for (const node of items) { - detectErrors(node).forEach(error => errors.add(error)) - } - - if (errors.size > 0) { - throw Object.assign( - new Error([...errors].join('\n')), - { code: 'ESBOMPROBLEMS' } - ) + const errors = items.flatMap(node => detectErrors(node)) + if (errors.length) { + throw Object.assign(new Error([...new Set(errors)].join('\n')), { + code: 'ESBOMPROBLEMS', + }) } // Populate the response with the list of unique nodes (sorted by location) - this.#buildResponse( - items - .sort((a, b) => localeCompare(a.location, b.location)) - ) - output.standard(this.#parsedResponse) + this.#buildResponse(items.sort((a, b) => localeCompare(a.location, b.location))) + + // TODO(BREAKING_CHANGE): all sbom output is in json mode but setting it before + // any of the errors will cause those to be thrown in json mode. + this.npm.config.set('json', true) + output.buffer(this.#response) } async execWorkspaces (args) { @@ -122,10 +105,9 @@ class SBOM extends BaseCommand { const packageType = this.npm.config.get('sbom-type') const packageLockOnly = this.npm.config.get('package-lock-only') - this.#response = - sbomFormat === 'cyclonedx' - ? cyclonedxOutput({ npm: this.npm, nodes: items, packageType, packageLockOnly }) - : spdxOutput({ npm: this.npm, nodes: items, packageType }) + this.#response = sbomFormat === 'cyclonedx' + ? cyclonedxOutput({ npm: this.npm, nodes: items, packageType, packageLockOnly }) + : spdxOutput({ npm: this.npm, nodes: items, packageType }) } } diff --git a/deps/npm/lib/commands/shrinkwrap.js b/deps/npm/lib/commands/shrinkwrap.js index d7866bdb91dceb..86215c18e62dd8 100644 --- a/deps/npm/lib/commands/shrinkwrap.js +++ b/deps/npm/lib/commands/shrinkwrap.js @@ -1,5 +1,5 @@ -const { resolve, basename } = require('path') -const { unlink } = require('fs/promises') +const { resolve, basename } = require('node:path') +const { unlink } = require('node:fs/promises') const { log } = require('proc-log') const BaseCommand = require('../base-cmd.js') diff --git a/deps/npm/lib/commands/team.js b/deps/npm/lib/commands/team.js index c36b6ef023a264..089e917909d10a 100644 --- a/deps/npm/lib/commands/team.js +++ b/deps/npm/lib/commands/team.js @@ -68,10 +68,10 @@ class Team extends BaseCommand { async create (entity, opts) { await libteam.create(entity, opts) if (opts.json) { - output.standard(JSON.stringify({ + output.buffer({ created: true, team: entity, - })) + }) } else if (opts.parseable) { output.standard(`${entity}\tcreated`) } else if (!this.npm.silent) { @@ -82,10 +82,10 @@ class Team extends BaseCommand { async destroy (entity, opts) { await libteam.destroy(entity, opts) if (opts.json) { - output.standard(JSON.stringify({ + output.buffer({ deleted: true, team: entity, - })) + }) } else if (opts.parseable) { output.standard(`${entity}\tdeleted`) } else if (!this.npm.silent) { @@ -96,11 +96,11 @@ class Team extends BaseCommand { async add (entity, user, opts) { await libteam.add(user, entity, opts) if (opts.json) { - output.standard(JSON.stringify({ + output.buffer({ added: true, team: entity, user, - })) + }) } else if (opts.parseable) { output.standard(`${user}\t${entity}\tadded`) } else if (!this.npm.silent) { @@ -111,11 +111,11 @@ class Team extends BaseCommand { async rm (entity, user, opts) { await libteam.rm(user, entity, opts) if (opts.json) { - output.standard(JSON.stringify({ + output.buffer({ removed: true, team: entity, user, - })) + }) } else if (opts.parseable) { output.standard(`${user}\t${entity}\tremoved`) } else if (!this.npm.silent) { @@ -126,7 +126,7 @@ class Team extends BaseCommand { async listUsers (entity, opts) { const users = (await libteam.lsUsers(entity, opts)).sort() if (opts.json) { - output.standard(JSON.stringify(users, null, 2)) + output.buffer(users) } else if (opts.parseable) { output.standard(users.join('\n')) } else if (!this.npm.silent) { @@ -140,7 +140,7 @@ class Team extends BaseCommand { async listTeams (entity, opts) { const teams = (await libteam.lsTeams(entity, opts)).sort() if (opts.json) { - output.standard(JSON.stringify(teams, null, 2)) + output.buffer(teams) } else if (opts.parseable) { output.standard(teams.join('\n')) } else if (!this.npm.silent) { diff --git a/deps/npm/lib/commands/token.js b/deps/npm/lib/commands/token.js index ae58891a566c22..d2e85ffe5a549d 100644 --- a/deps/npm/lib/commands/token.js +++ b/deps/npm/lib/commands/token.js @@ -50,7 +50,7 @@ class Token extends BaseCommand { log.info('token', 'getting list') const tokens = await listTokens(this.npm.flatOptions) if (json) { - output.standard(JSON.stringify(tokens, null, 2)) + output.buffer(tokens) return } if (parseable) { @@ -117,7 +117,7 @@ class Token extends BaseCommand { }) ) if (json) { - output.standard(JSON.stringify(toRemove)) + output.buffer(toRemove) } else if (parseable) { output.standard(toRemove.join('\t')) } else { @@ -142,7 +142,7 @@ class Token extends BaseCommand { delete result.key delete result.updated if (json) { - output.standard(JSON.stringify(result)) + output.buffer(result) } else if (parseable) { Object.keys(result).forEach(k => output.standard(k + '\t' + result[k])) } else { diff --git a/deps/npm/lib/commands/uninstall.js b/deps/npm/lib/commands/uninstall.js index 7496c02deb28f4..f9baebe3bc2e28 100644 --- a/deps/npm/lib/commands/uninstall.js +++ b/deps/npm/lib/commands/uninstall.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const pkgJson = require('@npmcli/package-json') const reifyFinish = require('../utils/reify-finish.js') const completion = require('../utils/installed-shallow.js') diff --git a/deps/npm/lib/commands/update.js b/deps/npm/lib/commands/update.js index ddc3e4a47f38a1..235a9a41177df3 100644 --- a/deps/npm/lib/commands/update.js +++ b/deps/npm/lib/commands/update.js @@ -1,4 +1,4 @@ -const path = require('path') +const path = require('node:path') const { log } = require('proc-log') const reifyFinish = require('../utils/reify-finish.js') const ArboristWorkspaceCmd = require('../arborist-cmd.js') diff --git a/deps/npm/lib/commands/version.js b/deps/npm/lib/commands/version.js index 549ba9b9f9c771..d6c2dd4caed750 100644 --- a/deps/npm/lib/commands/version.js +++ b/deps/npm/lib/commands/version.js @@ -126,7 +126,7 @@ class Version extends BaseCommand { } if (this.npm.config.get('json')) { - output.standard(JSON.stringify(results, null, 2)) + output.buffer(results) } else { output.standard(results) } diff --git a/deps/npm/lib/commands/view.js b/deps/npm/lib/commands/view.js index 8c6b5be3a0643a..cf7292a2f3b814 100644 --- a/deps/npm/lib/commands/view.js +++ b/deps/npm/lib/commands/view.js @@ -1,16 +1,18 @@ const columns = require('cli-columns') -const { readFile } = require('fs/promises') +const { readFile } = require('node:fs/promises') const jsonParse = require('json-parse-even-better-errors') -const { log, output } = require('proc-log') +const { log, output, META } = require('proc-log') const npa = require('npm-package-arg') -const { resolve } = require('path') +const { resolve } = require('node:path') const formatBytes = require('../utils/format-bytes.js') const relativeDate = require('tiny-relative-date') const semver = require('semver') -const { inspect } = require('util') +const { inspect } = require('node:util') const { packument } = require('pacote') const Queryable = require('../utils/queryable.js') const BaseCommand = require('../base-cmd.js') +const { getError } = require('../utils/error-message.js') +const { jsonError, outputError } = require('../utils/output-error.js') const readJson = file => readFile(file, 'utf8').then(jsonParse) @@ -76,10 +78,24 @@ class View extends BaseCommand { return this.exec([pkg, ...rest]) } + const json = this.npm.config.get('json') await this.setWorkspaces() for (const name of this.workspaceNames) { - await this.#viewPackage(`${name}${pkg.slice(1)}`, rest, { workspace: true }) + try { + await this.#viewPackage(`${name}${pkg.slice(1)}`, rest, { workspace: true }) + } catch (e) { + const err = getError(e, { npm: this.npm, command: this }) + if (err.code !== 'E404') { + throw e + } + if (json) { + output.buffer({ [META]: true, jsonError: { [name]: jsonError(err, this.npm) } }) + } else { + outputError(err) + } + process.exitCode = err.exitCode + } } } diff --git a/deps/npm/lib/commands/whoami.js b/deps/npm/lib/commands/whoami.js index 507adb276c7313..6b6e93ce7f885f 100644 --- a/deps/npm/lib/commands/whoami.js +++ b/deps/npm/lib/commands/whoami.js @@ -9,9 +9,11 @@ class Whoami extends BaseCommand { async exec () { const username = await getIdentity(this.npm, { ...this.npm.flatOptions }) - output.standard( - this.npm.config.get('json') ? JSON.stringify(username) : username - ) + if (this.npm.config.get('json')) { + output.buffer(username) + } else { + output.standard(username) + } } } diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 9d00b630857b1e..5563cec21ba4d2 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -260,7 +260,7 @@ class Npm { this.#logFile.off() } - finish () { + finish (err) { // Finish all our timer work, this will write the file if requested, end timers, etc this.#timers.finish({ id: this.#runId, @@ -268,6 +268,14 @@ class Npm { logfiles: this.logFiles, version: this.version, }) + + output.flush({ + [META]: true, + // json can be set during a command so we send the + // final value of it to the display layer here + json: this.loaded && this.config.get('json'), + jsonError: jsonError(err, this), + }) } exitErrorMessage () { @@ -296,16 +304,7 @@ class Npm { Object.assign(err, this.#getError(err, { pkg: localPkg })) } - // TODO: make this not need to be public - this.finish() - - output.flush({ - [META]: true, - // json can be set during a command so we send the - // final value of it to the display layer here - json: this.loaded && this.config.get('json'), - jsonError: jsonError(err, this), - }) + this.finish(err) if (err) { throw err diff --git a/deps/npm/lib/utils/audit-error.js b/deps/npm/lib/utils/audit-error.js index 10aec7592b03ce..c56ec9ba86f185 100644 --- a/deps/npm/lib/utils/audit-error.js +++ b/deps/npm/lib/utils/audit-error.js @@ -22,14 +22,14 @@ const auditError = (npm, report) => { const { body: errBody } = error const body = Buffer.isBuffer(errBody) ? errBody.toString() : errBody if (npm.flatOptions.json) { - output.standard(JSON.stringify({ + output.buffer({ message: error.message, method: error.method, uri: replaceInfo(error.uri), headers: error.headers, statusCode: error.statusCode, body, - }, null, 2)) + }) } else { output.standard(body) } diff --git a/deps/npm/lib/utils/auth.js b/deps/npm/lib/utils/auth.js index deaff6bbebbafb..747271169124b3 100644 --- a/deps/npm/lib/utils/auth.js +++ b/deps/npm/lib/utils/auth.js @@ -13,7 +13,7 @@ const otplease = async (npm, opts, fn) => { // web otp if (err.code === 'EOTP' && err.body?.authUrl && err.body?.doneUrl) { - const otp = await webAuthOpener( + const { token: otp } = await webAuthOpener( createOpener(npm, 'Authenticate your account at'), err.body.authUrl, err.body.doneUrl, diff --git a/deps/npm/lib/utils/display.js b/deps/npm/lib/utils/display.js index ede2588cacfc1f..67a3b98c0417a0 100644 --- a/deps/npm/lib/utils/display.js +++ b/deps/npm/lib/utils/display.js @@ -82,29 +82,33 @@ const ERROR_KEY = 'error' // is a json error that should be merged into the finished output const JSON_ERROR_KEY = 'jsonError' +const isPlainObject = (v) => v && typeof v === 'object' && !Array.isArray(v) + const getArrayOrObject = (items) => { - // Arrays cant be merged, if the first item is an array return that - if (Array.isArray(items[0])) { - return items[0] - } - // We use objects with 0,1,2,etc keys to merge array - if (items.length && items.every((o, i) => Object.hasOwn(o, i))) { - return Object.assign([], ...items) + if (items.length) { + const foundNonObject = items.find(o => !isPlainObject(o)) + // Non-objects and arrays cant be merged, so just return the first item + if (foundNonObject) { + return foundNonObject + } + // We use objects with 0,1,2,etc keys to merge array + if (items.every((o, i) => Object.hasOwn(o, i))) { + return Object.assign([], ...items) + } } - // Otherwise its an object with all items merged together - return Object.assign({}, ...items) + // Otherwise its an object with all object items merged together + return Object.assign({}, ...items.filter(o => isPlainObject(o))) } -const mergeJson = ({ [JSON_ERROR_KEY]: metaError }, buffer) => { +const getJsonBuffer = ({ [JSON_ERROR_KEY]: metaError }, buffer) => { const items = [] // meta also contains the meta object passed to flush const errors = metaError ? [metaError] : [] // index 1 is the meta, 2 is the logged argument for (const [, { [JSON_ERROR_KEY]: error }, obj] of buffer) { - if (obj && typeof obj === 'object') { + if (obj) { items.push(obj) } - /* istanbul ignore next - this is not used yet but will be */ if (error) { errors.push(error) } @@ -114,22 +118,20 @@ const mergeJson = ({ [JSON_ERROR_KEY]: metaError }, buffer) => { return null } - // If all items are keyed with array indexes, then we return the - // array. This skips any error checking since we cant really set - // an error property on an array in a way that can be stringified - // XXX(BREAKING_CHANGE): remove this in favor of always returning an object const res = getArrayOrObject(items) - if (!Array.isArray(res) && errors.length) { + // This skips any error checking since we can only set an error property + // on an object that can be stringified + // XXX(BREAKING_CHANGE): remove this in favor of always returning an object with result and error keys + if (isPlainObject(res) && errors.length) { // This is not ideal. JSON output has always been keyed at the root with an `error` // key, so we cant change that without it being a breaking change. At the same time // some commands output arbitrary keys at the top level of the output, such as package // names. So the output could already have the same key. The choice here is to overwrite // it with our error since that is (probably?) more important. // XXX(BREAKING_CHANGE): all json output should be keyed under well known keys, eg `result` and `error` - /* istanbul ignore next */ if (res[ERROR_KEY]) { - log.warn('display', `overwriting existing ${ERROR_KEY} on json output`) + log.warn('', `overwriting existing ${ERROR_KEY} on json output`) } res[ERROR_KEY] = getArrayOrObject(errors) } @@ -294,9 +296,11 @@ class Display { switch (level) { case output.KEYS.flush: { this.#outputState.buffering = false - const json = this.#json ? mergeJson(meta, this.#outputState.buffer) : null - if (json) { - this.#writeOutput(output.KEYS.standard, meta, JSON.stringify(json, null, 2)) + if (this.#json) { + const json = getJsonBuffer(meta, this.#outputState.buffer) + if (json) { + this.#writeOutput(output.KEYS.standard, meta, JSON.stringify(json, null, 2)) + } } else { this.#outputState.buffer.forEach((item) => this.#writeOutput(...item)) } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index c484c1ab9c2b61..fc47c909069f07 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -97,7 +97,7 @@ const errorMessage = (er, npm) => { // Check whether we ran into a conflict in our own package.json if (er.path === resolve(npm.prefix, 'package.json')) { const { isDiff } = require('parse-conflict-json') - const txt = require('fs').readFileSync(er.path, 'utf8').replace(/\r\n/g, '\n') + const txt = require('node:fs').readFileSync(er.path, 'utf8').replace(/\r\n/g, '\n') if (isDiff(txt)) { detail.push(['', [ 'Merge conflict detected in your package.json.', diff --git a/deps/npm/lib/utils/format.js b/deps/npm/lib/utils/format.js index abfbf9e3317043..aaecfe1ba0e7a7 100644 --- a/deps/npm/lib/utils/format.js +++ b/deps/npm/lib/utils/format.js @@ -1,4 +1,4 @@ -const { formatWithOptions: baseFormatWithOptions } = require('util') +const { formatWithOptions: baseFormatWithOptions } = require('node:util') // These are most assuredly not a mistake // https://eslint.org/docs/latest/rules/no-control-regex diff --git a/deps/npm/lib/utils/get-workspaces.js b/deps/npm/lib/utils/get-workspaces.js index 59efb0e9f01bef..48c26779bb1373 100644 --- a/deps/npm/lib/utils/get-workspaces.js +++ b/deps/npm/lib/utils/get-workspaces.js @@ -1,4 +1,4 @@ -const { resolve, relative } = require('path') +const { resolve, relative } = require('node:path') const mapWorkspaces = require('@npmcli/map-workspaces') const { minimatch } = require('minimatch') const pkgJson = require('@npmcli/package-json') diff --git a/deps/npm/lib/utils/installed-deep.js b/deps/npm/lib/utils/installed-deep.js index 045708f74bd2a7..3c56c5d036f256 100644 --- a/deps/npm/lib/utils/installed-deep.js +++ b/deps/npm/lib/utils/installed-deep.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const localeCompare = require('@isaacs/string-locale-compare')('en') const installedDeep = async (npm) => { diff --git a/deps/npm/lib/utils/log-file.js b/deps/npm/lib/utils/log-file.js index f8dd19d333cf67..6c9bcd7ff8d86b 100644 --- a/deps/npm/lib/utils/log-file.js +++ b/deps/npm/lib/utils/log-file.js @@ -1,7 +1,7 @@ -const os = require('os') -const { join, dirname, basename } = require('path') +const os = require('node:os') +const { join, dirname, basename } = require('node:path') const fsMiniPass = require('fs-minipass') -const fs = require('fs/promises') +const fs = require('node:fs/promises') const { log } = require('proc-log') const { formatWithOptions } = require('./format') diff --git a/deps/npm/lib/utils/open-url.js b/deps/npm/lib/utils/open-url.js index 7d8e1cb5a2d233..632dcc79949d66 100644 --- a/deps/npm/lib/utils/open-url.js +++ b/deps/npm/lib/utils/open-url.js @@ -1,6 +1,6 @@ const { open } = require('@npmcli/promise-spawn') const { output, input } = require('proc-log') -const { URL } = require('url') +const { URL } = require('node:url') const readline = require('node:readline/promises') const { once } = require('node:events') @@ -15,8 +15,11 @@ const assertValidUrl = (url) => { } const outputMsg = (json, title, url) => { - const msg = json ? JSON.stringify({ title, url }) : `${title}:\n${url}` - output.standard(msg) + if (json) { + output.buffer({ title, url }) + } else { + output.standard(`${title}:\n${url}`) + } } // attempt to open URL in web-browser, print address otherwise: diff --git a/deps/npm/lib/utils/queryable.js b/deps/npm/lib/utils/queryable.js index 4fc1e3533eabc3..a5fb25a845eafc 100644 --- a/deps/npm/lib/utils/queryable.js +++ b/deps/npm/lib/utils/queryable.js @@ -1,4 +1,4 @@ -const util = require('util') +const util = require('node:util') const _delete = Symbol('delete') const _append = Symbol('append') diff --git a/deps/npm/lib/utils/reify-finish.js b/deps/npm/lib/utils/reify-finish.js index 0b34a375768606..410c19730cdf4c 100644 --- a/deps/npm/lib/utils/reify-finish.js +++ b/deps/npm/lib/utils/reify-finish.js @@ -1,7 +1,7 @@ const reifyOutput = require('./reify-output.js') const ini = require('ini') -const { writeFile } = require('fs/promises') -const { resolve } = require('path') +const { writeFile } = require('node:fs/promises') +const { resolve } = require('node:path') const reifyFinish = async (npm, arb) => { await saveBuiltinConfig(npm, arb) diff --git a/deps/npm/lib/utils/reify-output.js b/deps/npm/lib/utils/reify-output.js index a858a546c4010c..025479f0c8e600 100644 --- a/deps/npm/lib/utils/reify-output.js +++ b/deps/npm/lib/utils/reify-output.js @@ -90,7 +90,7 @@ const reifyOutput = (npm, arb) => { summary.audit = npm.command === 'audit' ? auditReport : auditReport.toJSON().metadata } - output.standard(JSON.stringify(summary, null, 2)) + output.buffer(summary) } else { packagesChangedMessage(npm, summary) packagesFundingMessage(npm, summary) diff --git a/deps/npm/lib/utils/sbom-cyclonedx.js b/deps/npm/lib/utils/sbom-cyclonedx.js index 0a340895bb3f49..989abea58dae83 100644 --- a/deps/npm/lib/utils/sbom-cyclonedx.js +++ b/deps/npm/lib/utils/sbom-cyclonedx.js @@ -1,4 +1,4 @@ -const crypto = require('crypto') +const crypto = require('node:crypto') const normalizeData = require('normalize-package-data') const parseLicense = require('spdx-expression-parse') const npa = require('npm-package-arg') diff --git a/deps/npm/lib/utils/sbom-spdx.js b/deps/npm/lib/utils/sbom-spdx.js index fdddd8944f32d1..e3af77e10c7513 100644 --- a/deps/npm/lib/utils/sbom-spdx.js +++ b/deps/npm/lib/utils/sbom-spdx.js @@ -1,5 +1,5 @@ -const crypto = require('crypto') +const crypto = require('node:crypto') const normalizeData = require('normalize-package-data') const npa = require('npm-package-arg') const ssri = require('ssri') diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 31f8bb089ed859..63ef6067acb903 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -59,7 +59,7 @@ const getContents = async (manifest, tarball) => { totalEntries++ totalEntrySize += entry.size const p = entry.path - if (p.startsWith('package/node_modules/')) { + if (p.startsWith('package/node_modules/') && p !== 'package/node_modules/') { const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1] bundled.add(name) } @@ -72,7 +72,7 @@ const getContents = async (manifest, tarball) => { }) stream.end(tarball) - const integrity = await ssri.fromData(tarball, { + const integrity = ssri.fromData(tarball, { algorithms: ['sha1', 'sha512'], }) diff --git a/deps/npm/lib/utils/verify-signatures.js b/deps/npm/lib/utils/verify-signatures.js index f2973316c9b767..09711581d11ddd 100644 --- a/deps/npm/lib/utils/verify-signatures.js +++ b/deps/npm/lib/utils/verify-signatures.js @@ -60,10 +60,7 @@ class VerifySignatures { } if (this.npm.config.get('json')) { - output.standard(JSON.stringify({ - invalid, - missing, - }, null, 2)) + output.buffer({ invalid, missing }) return } const end = process.hrtime.bigint() diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 18e2bcac233163..f46de11b789b6c 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM-ACCESS" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-ACCESS" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-access\fR - Set access level on published packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 36958bc8347a2e..2e8009ed040cfd 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM-ADDUSER" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-ADDUSER" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-adduser\fR - Add a registry user account .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index 82cec83f472761..e1cc443405b46c 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM-AUDIT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-AUDIT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-audit\fR - Run a security audit .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 01ce318495068c..cd7f68e7ffe906 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM-BUGS" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-BUGS" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-bugs\fR - Report bugs for a package in a web browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 7b4c5e90a10316..847e3672a9de31 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM-CACHE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-CACHE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-cache\fR - Manipulates packages cache .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 6d6e3c564cb428..e821f621c89599 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM-CI" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-CI" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-ci\fR - Clean install a project .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index a2370a5cab6e9d..e5849857a97cb1 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM-COMPLETION" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-COMPLETION" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-completion\fR - Tab Completion for npm .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 9083b7bc508e51..1021c7ef8f39ce 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM-CONFIG" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-CONFIG" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-config\fR - Manage the npm configuration files .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index f8088d5d29a6a5..01d054e9706c25 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM-DEDUPE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DEDUPE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-dedupe\fR - Reduce duplication in the package tree .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index f6b593cd96fbcf..3b454daf95809f 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM-DEPRECATE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DEPRECATE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-deprecate\fR - Deprecate a version of a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index b0c66b2543089f..87b4f4febf05a6 100644 --- a/deps/npm/man/man1/npm-diff.1 +++ b/deps/npm/man/man1/npm-diff.1 @@ -1,4 +1,4 @@ -.TH "NPM-DIFF" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DIFF" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-diff\fR - The registry diff command .SS "Synopsis" @@ -233,9 +233,12 @@ Type: String .P If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. .P -Also the tag that is added to the package@version specified by the \fBnpm tag\fR command, if no explicit tag is given. +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. .P When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. .SS "\fBworkspace\fR" .RS 0 .IP \(bu 4 diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 3a056f5fc59eec..a9ef05ae2f80ac 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM-DIST-TAG" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DIST-TAG" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-dist-tag\fR - Modify package distribution tags .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index f0ca99bc75f96c..693253b899ce53 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM-DOCS" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DOCS" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-docs\fR - Open documentation for a package in a web browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index eecf5cf9981436..d87d07386e3522 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM-DOCTOR" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-DOCTOR" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-doctor\fR - Check the health of your npm environment .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index f6e06c426a338a..3955f73dce73f7 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM-EDIT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-EDIT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-edit\fR - Edit an installed package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 86289a3463037d..9f687a51853195 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXEC" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-EXEC" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-exec\fR - Run a command from a local or remote npm package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index 09033f5739113e..a6df9b04dc423b 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXPLAIN" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-EXPLAIN" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-explain\fR - Explain installed packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 1dc4fcf89af9a0..fca5f08a0519af 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXPLORE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-EXPLORE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-explore\fR - Browse an installed package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index 85e087349da4ad..49cf67eb56741e 100644 --- a/deps/npm/man/man1/npm-find-dupes.1 +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -1,4 +1,4 @@ -.TH "NPM-FIND-DUPES" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-FIND-DUPES" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-find-dupes\fR - Find duplication in the package tree .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index ceba71789ee99f..ea93baf6f61871 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM-FUND" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-FUND" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-fund\fR - Retrieve funding information .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 5c446812f40cc9..0f30809f7befea 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM-HELP-SEARCH" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-HELP-SEARCH" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-help-search\fR - Search npm help documentation .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index ca9d4d25f9d801..8f0dae367c3f7c 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM-HELP" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-HELP" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-help\fR - Get help on npm .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index 57b1946fcfeb98..cdbfb86de9d83f 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM-HOOK" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-HOOK" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-hook\fR - Manage registry hooks .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 768552131f939f..72fa1f352f826e 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM-INIT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-INIT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-init\fR - Create a package.json file .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index 29b4e0403e7db8..05543758db5633 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL-CI-TEST" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-INSTALL-CI-TEST" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-install-ci-test\fR - Install a project with a clean slate and run tests .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index dbe67b0a7b395e..356a3ac2f436cf 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL-TEST" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-INSTALL-TEST" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-install-test\fR - Install package(s) and run tests .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 6acd9c57d3eb0b..021f55e8ab1664 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-INSTALL" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-install\fR - Install a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 87a4a28956b48e..7dcde5ed199afb 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM-LINK" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-LINK" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-link\fR - Symlink a package folder .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-login.1 b/deps/npm/man/man1/npm-login.1 index f170fc928a5667..aa592e66bf92dc 100644 --- a/deps/npm/man/man1/npm-login.1 +++ b/deps/npm/man/man1/npm-login.1 @@ -1,4 +1,4 @@ -.TH "NPM-LOGIN" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-LOGIN" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-login\fR - Login to a registry user account .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 38f30b6f199727..16f60eeba42ba0 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM-LOGOUT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-LOGOUT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-logout\fR - Log out of the registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index b6d2b7e4de7031..0e571c9f6ac3c2 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM-LS" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-LS" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-ls\fR - List installed packages .SS "Synopsis" @@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit .P .RS 2 .nf -npm@10.8.0 /path/to/npm +npm@10.8.1 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 122781dd7e2514..6772c0e7853df3 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM-ORG" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-ORG" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-org\fR - Manage orgs .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index e8af0ae412eaec..ea9d9b512a2fd6 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM-OUTDATED" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-OUTDATED" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-outdated\fR - Check for outdated packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 657f53963c0056..5e85bb040ccbfb 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM-OWNER" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-OWNER" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-owner\fR - Manage package owners .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index a193f1f2679e14..17677933cbc3a4 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM-PACK" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PACK" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-pack\fR - Create a tarball from a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 42f3d8e76a0614..75cb2ba6fac433 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM-PING" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PING" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-ping\fR - Ping npm registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-pkg.1 b/deps/npm/man/man1/npm-pkg.1 index 9d827a27e73a8d..2b62b3d0a245d7 100644 --- a/deps/npm/man/man1/npm-pkg.1 +++ b/deps/npm/man/man1/npm-pkg.1 @@ -1,4 +1,4 @@ -.TH "NPM-PKG" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PKG" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-pkg\fR - Manages your package.json .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 55788dd4f3c8e5..e5246989e83835 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM-PREFIX" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PREFIX" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-prefix\fR - Display prefix .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 99db8193b1ff44..beab002720a2c8 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM-PROFILE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PROFILE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-profile\fR - Change settings on your registry profile .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 76a1eb1325d222..6a32b2edd1ebf0 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM-PRUNE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PRUNE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-prune\fR - Remove extraneous packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 190bbbf40ea9ab..3d93fad94449c5 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM-PUBLISH" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-PUBLISH" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-publish\fR - Publish a package .SS "Synopsis" @@ -72,9 +72,12 @@ Type: String .P If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. .P -Also the tag that is added to the package@version specified by the \fBnpm tag\fR command, if no explicit tag is given. +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. .P When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. .SS "\fBaccess\fR" .RS 0 .IP \(bu 4 diff --git a/deps/npm/man/man1/npm-query.1 b/deps/npm/man/man1/npm-query.1 index 85f8b742f9314a..e1c889aef93d19 100644 --- a/deps/npm/man/man1/npm-query.1 +++ b/deps/npm/man/man1/npm-query.1 @@ -1,4 +1,4 @@ -.TH "NPM-QUERY" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-QUERY" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-query\fR - Dependency selector query .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 6726d8837ed363..0a49c4a3465017 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM-REBUILD" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-REBUILD" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-rebuild\fR - Rebuild a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 92657ee7e73ac8..0079677b30488b 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM-REPO" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-REPO" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-repo\fR - Open package repository page in the browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index a0e0625a8fdff6..0b685372b00da8 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM-RESTART" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-RESTART" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-restart\fR - Restart a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index e939af0390befe..81feb805b066ce 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM-ROOT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-ROOT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-root\fR - Display npm root .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index a8e6330d38ac25..0d1f275392ff87 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM-RUN-SCRIPT" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-RUN-SCRIPT" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-run-script\fR - Run arbitrary package scripts .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-sbom.1 b/deps/npm/man/man1/npm-sbom.1 index 7611501b79f9c6..134e0a3f035368 100644 --- a/deps/npm/man/man1/npm-sbom.1 +++ b/deps/npm/man/man1/npm-sbom.1 @@ -1,4 +1,4 @@ -.TH "NPM-SBOM" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-SBOM" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-sbom\fR - Generate a Software Bill of Materials (SBOM) .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 750da81528c449..ccdaa04275db8d 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM-SEARCH" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-SEARCH" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-search\fR - Search for packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index b3b6ce959bc25e..eab8e3bc5c7e86 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM-SHRINKWRAP" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-SHRINKWRAP" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-shrinkwrap\fR - Lock down dependency versions for publication .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 7072b33548f1cc..f6e73e6d0597d8 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM-STAR" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-STAR" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-star\fR - Mark your favorite packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index e1036885e3efd4..b8e09fe0a31e63 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM-STARS" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-STARS" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-stars\fR - View packages marked as favorites .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index c0ac0bb5244b4d..cc515010053058 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM-START" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-START" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-start\fR - Start a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 5cf1b62acbb1c9..e55122ef9c3ab2 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM-STOP" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-STOP" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-stop\fR - Stop a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 7320fabc1c27c7..44b89279bfbe3f 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM-TEAM" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-TEAM" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-team\fR - Manage organization teams and team memberships .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 4ec030dd732010..12bce43c872b4f 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-TEST" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-TEST" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-test\fR - Test a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 2e461746d5fec8..09324e0e6143f9 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM-TOKEN" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-TOKEN" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-token\fR - Manage your authentication tokens .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 30b74b229db191..60e1bd44b5f319 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNINSTALL" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-UNINSTALL" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-uninstall\fR - Remove a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 571c97b736de89..c066304604173d 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNPUBLISH" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-UNPUBLISH" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-unpublish\fR - Remove a package from the registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index dc444c7f1fc76e..d011c8d6ca584d 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNSTAR" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-UNSTAR" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-unstar\fR - Remove an item from your favorite packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index f9fe4260f899a5..b0d4bfb68038a2 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM-UPDATE" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-UPDATE" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-update\fR - Update packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 10659c12accfc9..6968b4695f25fd 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM-VERSION" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-VERSION" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-version\fR - Bump a package version .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 78a4a03ab5d27f..0ff031ddbff49e 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM-VIEW" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-VIEW" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-view\fR - View registry info .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index b66d679b368450..fe45133fef68b5 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM-WHOAMI" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM-WHOAMI" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-whoami\fR - Display npm username .SS "Synopsis" diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index c485d79e1f79e3..6724212633bfe3 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPM" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm\fR - javascript package manager .SS "Synopsis" @@ -12,7 +12,7 @@ npm Note: This command is unaware of workspaces. .SS "Version" .P -10.8.0 +10.8.1 .SS "Description" .P npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index 78eabd16b84b4d..65e4c3e13611a7 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "May 2024" "NPM@10.8.0" "" +.TH "NPX" "1" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpx\fR - Run a command from a local or remote npm package .SS "Synopsis" diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index af5cccd4a53786..455d4fc2754ea2 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "May 2024" "NPM@10.8.0" "" +.TH "FOLDERS" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBfolders\fR - Folder Structures Used by npm .SS "Description" diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index 0b8207691d9bca..78619b99230ad5 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "May 2024" "NPM@10.8.0" "" +.TH "INSTALL" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBinstall\fR - Download and install node and npm .SS "Description" diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index af5cccd4a53786..455d4fc2754ea2 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "May 2024" "NPM@10.8.0" "" +.TH "FOLDERS" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBfolders\fR - Folder Structures Used by npm .SS "Description" diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 17a6e0a802b91e..3f6c03a548e234 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE.JSON" "5" "May 2024" "NPM@10.8.0" "" +.TH "PACKAGE.JSON" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBpackage.json\fR - Specifics of npm's package.json handling .SS "Description" diff --git a/deps/npm/man/man5/npm-shrinkwrap-json.5 b/deps/npm/man/man5/npm-shrinkwrap-json.5 index 17691217f03a82..e2b7112bc6133b 100644 --- a/deps/npm/man/man5/npm-shrinkwrap-json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM-SHRINKWRAP.JSON" "5" "May 2024" "NPM@10.8.0" "" +.TH "NPM-SHRINKWRAP.JSON" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR - A publishable lockfile .SS "Description" diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index aa6db5aaadb395..8704d65dd321d4 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "May 2024" "NPM@10.8.0" "" +.TH "NPMRC" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBnpmrc\fR - The npm config files .SS "Description" diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 17a6e0a802b91e..3f6c03a548e234 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE.JSON" "5" "May 2024" "NPM@10.8.0" "" +.TH "PACKAGE.JSON" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBpackage.json\fR - Specifics of npm's package.json handling .SS "Description" diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 6fe5ed2969216b..d22aa401ed49c1 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE-LOCK.JSON" "5" "May 2024" "NPM@10.8.0" "" +.TH "PACKAGE-LOCK.JSON" "5" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBpackage-lock.json\fR - A manifestation of the manifest .SS "Description" diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 50b1ccc0bf2dc5..7abd8432120d41 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "May 2024" "NPM@10.8.0" "" +.TH "CONFIG" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBconfig\fR - More than you probably want to know about npm configuration .SS "Description" @@ -1567,9 +1567,12 @@ Type: String .P If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. .P -Also the tag that is added to the package@version specified by the \fBnpm tag\fR command, if no explicit tag is given. +It is the tag added to the package@version specified in the \fBnpm dist-tag +add\fR command, if no explicit tag is given. .P When used by the \fBnpm diff\fR command, this is the tag used to fetch the tarball that will be compared with the local files by default. +.P +If used in the \fBnpm publish\fR command, this is the tag that will be added to the package submitted to the registry. .SS "\fBtag-version-prefix\fR" .RS 0 .IP \(bu 4 diff --git a/deps/npm/man/man7/dependency-selectors.7 b/deps/npm/man/man7/dependency-selectors.7 index ece9a2083857db..41b125736e660c 100644 --- a/deps/npm/man/man7/dependency-selectors.7 +++ b/deps/npm/man/man7/dependency-selectors.7 @@ -1,4 +1,4 @@ -.TH "QUERYING" "7" "May 2024" "NPM@10.8.0" "" +.TH "QUERYING" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBQuerying\fR - Dependency Selector Syntax & Querying .SS "Description" diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index fe0a04dccec87d..482124e3ef8504 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "May 2024" "NPM@10.8.0" "" +.TH "DEVELOPERS" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBdevelopers\fR - Developer Guide .SS "Description" diff --git a/deps/npm/man/man7/logging.7 b/deps/npm/man/man7/logging.7 index e96341d19bd1e3..3405dcef63daa5 100644 --- a/deps/npm/man/man7/logging.7 +++ b/deps/npm/man/man7/logging.7 @@ -1,4 +1,4 @@ -.TH "LOGGING" "7" "May 2024" "NPM@10.8.0" "" +.TH "LOGGING" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBLogging\fR - Why, What & How We Log .SS "Description" diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 5f34f1c193844a..f29fbb74077e0d 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "May 2024" "NPM@10.8.0" "" +.TH "ORGS" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBorgs\fR - Working with Teams & Orgs .SS "Description" diff --git a/deps/npm/man/man7/package-spec.7 b/deps/npm/man/man7/package-spec.7 index 871a75750d0592..5df9bebe355b21 100644 --- a/deps/npm/man/man7/package-spec.7 +++ b/deps/npm/man/man7/package-spec.7 @@ -1,4 +1,4 @@ -.TH "PACKAGE-SPEC" "7" "May 2024" "NPM@10.8.0" "" +.TH "PACKAGE-SPEC" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBpackage-spec\fR - Package name specifier .SS "Description" diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index f92a028367b649..3fb426ded5d13c 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "May 2024" "NPM@10.8.0" "" +.TH "REGISTRY" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBregistry\fR - The JavaScript Package Registry .SS "Description" diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 21e159e0dec333..eb9849bbefb6b2 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "May 2024" "NPM@10.8.0" "" +.TH "REMOVAL" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBremoval\fR - Cleaning the Slate .SS "Synopsis" diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index 6082d1453bdeea..5935770fd050cd 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "May 2024" "NPM@10.8.0" "" +.TH "SCOPE" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBscope\fR - Scoped packages .SS "Description" diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index 7942e6a39106c4..1c733e430eec87 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "May 2024" "NPM@10.8.0" "" +.TH "SCRIPTS" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBscripts\fR - How npm handles the "scripts" field .SS "Description" diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index a3bed632375f3f..6e9c73e34047ca 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "May 2024" "NPM@10.8.0" "" +.TH "WORKSPACES" "7" "May 2024" "NPM@10.8.1" "" .SH "NAME" \fBworkspaces\fR - Working with workspaces .SS "Description" diff --git a/deps/npm/node_modules/@npmcli/arborist/bin/index.js b/deps/npm/node_modules/@npmcli/arborist/bin/index.js index 414c7eb468cd85..7c5d45f1f1fc94 100755 --- a/deps/npm/node_modules/@npmcli/arborist/bin/index.js +++ b/deps/npm/node_modules/@npmcli/arborist/bin/index.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const { time } = require('proc-log') const { bin, arb: options } = require('./lib/options') diff --git a/deps/npm/node_modules/@npmcli/arborist/bin/lib/logging.js b/deps/npm/node_modules/@npmcli/arborist/bin/lib/logging.js index f06716735de74c..431eea3ec404aa 100644 --- a/deps/npm/node_modules/@npmcli/arborist/bin/lib/logging.js +++ b/deps/npm/node_modules/@npmcli/arborist/bin/lib/logging.js @@ -1,8 +1,8 @@ const { log } = require('proc-log') -const fs = require('fs') -const { dirname } = require('path') -const os = require('os') -const { inspect, format } = require('util') +const fs = require('node:fs') +const { dirname } = require('node:path') +const os = require('node:os') +const { inspect, format } = require('node:util') const { bin: options } = require('./options.js') diff --git a/deps/npm/node_modules/@npmcli/arborist/bin/lib/options.js b/deps/npm/node_modules/@npmcli/arborist/bin/lib/options.js index 8dbaf13dac03a8..419c81850071be 100644 --- a/deps/npm/node_modules/@npmcli/arborist/bin/lib/options.js +++ b/deps/npm/node_modules/@npmcli/arborist/bin/lib/options.js @@ -1,5 +1,5 @@ const nopt = require('nopt') -const path = require('path') +const path = require('node:path') const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k) diff --git a/deps/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js b/deps/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js index 55398190b99cb4..a110e6bcb8f030 100644 --- a/deps/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js +++ b/deps/npm/node_modules/@npmcli/arborist/bin/lib/print-tree.js @@ -1,4 +1,4 @@ -const { inspect } = require('util') +const { inspect } = require('node:util') const log = require('./logging.js') module.exports = tree => log.info(inspect(tree.toJSON(), { depth: Infinity })) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index 7808a4b0f86f12..06d03bbce7a32f 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -6,10 +6,10 @@ const pacote = require('pacote') const cacache = require('cacache') const { callLimit: promiseCallLimit } = require('promise-call-limit') const realpath = require('../../lib/realpath.js') -const { resolve, dirname } = require('path') +const { resolve, dirname } = require('node:path') const treeCheck = require('../tree-check.js') const { readdirScoped } = require('@npmcli/fs') -const { lstat, readlink } = require('fs/promises') +const { lstat, readlink } = require('node:fs/promises') const { depth } = require('treeverse') const { log, time } = require('proc-log') const { redact } = require('@npmcli/redact') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js index b348d490def653..3622f957b7acde 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -26,8 +26,8 @@ // the base class, so that the overall voltron class is easier to test and // cover, and separation of concerns can be maintained. -const { resolve } = require('path') -const { homedir } = require('os') +const { resolve } = require('node:path') +const { homedir } = require('node:os') const { depth } = require('treeverse') const mapWorkspaces = require('@npmcli/map-workspaces') const { log, time } = require('proc-log') @@ -47,7 +47,7 @@ const mixins = [ ] const _setWorkspaces = Symbol.for('setWorkspaces') -const Base = mixins.reduce((a, b) => b(a), require('events')) +const Base = mixins.reduce((a, b) => b(a), require('node:events')) // if it's 1, 2, or 3, set it explicitly that. // if undefined or null, set it null diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js index 1e60d0f696b26d..4fbcd801fdf639 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/isolated-reifier.js @@ -1,11 +1,11 @@ const _makeIdealGraph = Symbol('makeIdealGraph') const _createIsolatedTree = Symbol.for('createIsolatedTree') const _createBundledTree = Symbol('createBundledTree') -const { mkdirSync } = require('fs') +const { mkdirSync } = require('node:fs') const pacote = require('pacote') -const { join } = require('path') +const { join } = require('node:path') const { depth } = require('treeverse') -const crypto = require('crypto') +const crypto = require('node:crypto') // cache complicated function results const memoize = (fn) => { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js index 81c1bd11327753..22c1c2875f1b17 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js @@ -1,6 +1,6 @@ // mix-in implementing the loadActual method -const { relative, dirname, resolve, join, normalize } = require('path') +const { relative, dirname, resolve, join, normalize } = require('node:path') const rpj = require('read-package-json-fast') const { readdirScoped } = require('@npmcli/fs') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js index d96d4adc88a702..7c51f8b9bef795 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js @@ -1,7 +1,7 @@ // mixin providing the loadVirtual method const mapWorkspaces = require('@npmcli/map-workspaces') -const { resolve } = require('path') +const { resolve } = require('node:path') const nameFromFolder = require('@npmcli/name-from-folder') const consistentResolve = require('../consistent-resolve.js') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js index 4f8730cde7f382..82f84772f9a856 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -8,7 +8,7 @@ const rpj = require('read-package-json-fast') const binLinks = require('bin-links') const runScript = require('@npmcli/run-script') const { callLimit: promiseCallLimit } = require('promise-call-limit') -const { resolve } = require('path') +const { resolve } = require('node:path') const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') const { log, time } = require('proc-log') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index 96704f6556e0da..be920272d48f00 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -11,14 +11,14 @@ const { log, time } = require('proc-log') const hgi = require('hosted-git-info') const rpj = require('read-package-json-fast') -const { dirname, resolve, relative, join } = require('path') +const { dirname, resolve, relative, join } = require('node:path') const { depth: dfwalk } = require('treeverse') const { lstat, mkdir, rm, symlink, -} = require('fs/promises') +} = require('node:fs/promises') const { moveFile } = require('@npmcli/fs') const PackageJson = require('@npmcli/package-json') const packageContents = require('@npmcli/installed-package-contents') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/debug.js b/deps/npm/node_modules/@npmcli/arborist/lib/debug.js index aeda7229d5e8cb..d5197b46ef09a9 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/debug.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/debug.js @@ -18,14 +18,15 @@ const debug = process.env.ARBORIST_DEBUG !== '0' && ( /\barborist\b/.test(process.env.NODE_DEBUG || '') || process.env.npm_package_name === '@npmcli/arborist' && ['test', 'snap'].includes(process.env.npm_lifecycle_event) || - process.cwd() === require('path').resolve(__dirname, '..') + process.cwd() === require('node:path').resolve(__dirname, '..') ) module.exports = debug ? fn => fn() : () => {} const red = process.stderr.isTTY ? msg => `\x1B[31m${msg}\x1B[39m` : m => m module.exports.log = (...msg) => module.exports(() => { - const { format } = require('util') + const { format } = require('node:util') const prefix = `\n${process.pid} ${red(format(msg.shift()))} ` msg = (prefix + format(...msg).trim().split('\n').join(prefix)).trim() + /* eslint-disable-next-line no-console */ console.error(msg) }) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js b/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js index 58656e8dbbad29..e80310d9663a95 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js @@ -6,7 +6,7 @@ const semver = require('semver') const npa = require('npm-package-arg') -const { relative } = require('path') +const { relative } = require('node:path') const fromPath = require('./from-path.js') const depValid = (child, requested, requestor) => { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/diff.js b/deps/npm/node_modules/@npmcli/arborist/lib/diff.js index 0387773c297549..fb94407bb01660 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/diff.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/diff.js @@ -6,7 +6,7 @@ // for a given branch of the tree being mutated. const { depth } = require('treeverse') -const { existsSync } = require('fs') +const { existsSync } = require('node:fs') const ssri = require('ssri') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/edge.js b/deps/npm/node_modules/@npmcli/arborist/lib/edge.js index cc9698ad6cae71..77ba196e68eeb5 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/edge.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/edge.js @@ -1,7 +1,7 @@ // An edge in the dependency graph // Represents a dependency relationship of some kind -const util = require('util') +const util = require('node:util') const npa = require('npm-package-arg') const depValid = require('./dep-valid.js') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js b/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js index 761f15125b3432..f7e447495d1446 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js @@ -3,7 +3,7 @@ // installed. directory (ie, symlink) deps also need to be resolved based on // their targets, but that's what realpath is -const { dirname } = require('path') +const { dirname } = require('node:path') const npa = require('npm-package-arg') const fromPath = (node, edge) => { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/link.js b/deps/npm/node_modules/@npmcli/arborist/lib/link.js index 197f96c5c2ddb9..266ec45168839b 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/link.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/link.js @@ -2,7 +2,7 @@ const relpath = require('./relpath.js') const Node = require('./node.js') const _loadDeps = Symbol.for('Arborist.Node._loadDeps') const _target = Symbol.for('_target') -const { dirname } = require('path') +const { dirname } = require('node:path') // defined by Node class const _delistFromMeta = Symbol.for('_delistFromMeta') const _refreshLocation = Symbol.for('_refreshLocation') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/node.js b/deps/npm/node_modules/@npmcli/arborist/lib/node.js index d5c5a478cce0b3..c519a7b543d4db 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/node.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/node.js @@ -41,8 +41,8 @@ const gatherDepSet = require('./gather-dep-set.js') const treeCheck = require('./tree-check.js') const { walkUp } = require('walk-up-path') -const { resolve, relative, dirname, basename } = require('path') -const util = require('util') +const { resolve, relative, dirname, basename } = require('node:path') +const util = require('node:util') const _package = Symbol('_package') const _parent = Symbol('_parent') const _target = Symbol.for('_target') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/printable.js b/deps/npm/node_modules/@npmcli/arborist/lib/printable.js index 7c8d52a4207aaf..53c3f7a5756dfc 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/printable.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/printable.js @@ -1,7 +1,7 @@ // helper function to output a clearer visualization // of the current node and its descendents const localeCompare = require('@isaacs/string-locale-compare')('en') -const util = require('util') +const util = require('node:util') const relpath = require('./relpath.js') class ArboristNode { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js b/deps/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js index 77640a3803d13b..fa48d5f84b5562 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/query-selector-all.js @@ -1,6 +1,6 @@ 'use strict' -const { resolve } = require('path') +const { resolve } = require('node:path') const { parser, arrayDelimiter } = require('@npmcli/query') const localeCompare = require('@isaacs/string-locale-compare')('en') const { log } = require('proc-log') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js b/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js index 8dc20ab63d8365..6e5ad9b77ba5a5 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js @@ -5,8 +5,8 @@ // built-in fs.realpath, because we only care about symbolic links, // so we can handle many fewer edge cases. -const { lstat, readlink } = require('fs/promises') -const { resolve, basename, dirname } = require('path') +const { lstat, readlink } = require('node:fs/promises') +const { resolve, basename, dirname } = require('node:path') const realpathCached = (path, rpcache, stcache, depth) => { // just a safety against extremely deep eloops diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js b/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js index e1960cfec02c75..a4187b5f6095fb 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js @@ -1,3 +1,3 @@ -const { relative } = require('path') +const { relative } = require('node:path') const relpath = (from, to) => relative(from, to).replace(/\\/g, '/') module.exports = relpath diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js b/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js index 0c7a4a319e2798..5bff79a15a1654 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js @@ -1,5 +1,5 @@ -const crypto = require('crypto') -const { dirname, basename, resolve } = require('path') +const crypto = require('node:crypto') +const { dirname, basename, resolve } = require('node:path') // use sha1 because it's faster, and collisions extremely unlikely anyway const pathSafeHash = s => diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js index 111c73889c8767..6f6c17cb953741 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js @@ -42,9 +42,9 @@ const { rm, stat, writeFile, -} = require('fs/promises') +} = require('node:fs/promises') -const { resolve, basename, relative } = require('path') +const { resolve, basename, relative } = require('node:path') const specFromLock = require('./spec-from-lock.js') const versionFromTgz = require('./version-from-tgz.js') const npa = require('npm-package-arg') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js b/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js index 092cdbcbaf1326..77e3956c1c1713 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js @@ -1,6 +1,6 @@ const semver = require('semver') -const { basename } = require('path') -const { URL } = require('url') +const { basename } = require('node:path') +const { URL } = require('node:url') module.exports = (name, tgz) => { const base = basename(tgz) if (!base.endsWith('.tgz')) { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js b/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js index d5693a3eff943a..fc62806506acdc 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js @@ -29,7 +29,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en') const consistentResolve = require('./consistent-resolve.js') -const { dirname } = require('path') +const { dirname } = require('node:path') const { breadth } = require('treeverse') // Sort Yarn entries respecting the yarn.lock sort order diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index b18a67659a76d5..3cefe2e46b20e6 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "7.5.2", + "version": "7.5.3", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js b/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js index 2978aa4b55dacf..627d624be4a024 100644 --- a/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js +++ b/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js @@ -7,7 +7,7 @@ const { join } = require('node:path') const isWindows = process.platform === 'win32' // used by cafile flattening to flatOptions.ca -const { readFileSync } = require('fs') +const { readFileSync } = require('node:fs') const maybeReadFile = file => { try { return readFileSync(file, 'utf8') @@ -61,7 +61,7 @@ const editor = process.env.EDITOR || const shell = isWindows ? process.env.ComSpec || 'cmd' : process.env.SHELL || 'sh' -const { networkInterfaces } = require('os') +const { networkInterfaces } = require('node:os') const getLocalAddresses = () => { try { return Object.values(networkInterfaces()).map( @@ -2012,11 +2012,14 @@ const definitions = { If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. - Also the tag that is added to the package@version specified by the \`npm - tag\` command, if no explicit tag is given. + It is the tag added to the package@version specified in the + \`npm dist-tag add\` command, if no explicit tag is given. When used by the \`npm diff\` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + If used in the \`npm publish\` command, this is the tag that will be + added to the package submitted to the registry. `, flatten (key, obj, flatOptions) { flatOptions.defaultTag = obj[key] diff --git a/deps/npm/node_modules/@npmcli/config/lib/index.js b/deps/npm/node_modules/@npmcli/config/lib/index.js index 099bf2f5f15a0c..e786828589aafa 100644 --- a/deps/npm/node_modules/@npmcli/config/lib/index.js +++ b/deps/npm/node_modules/@npmcli/config/lib/index.js @@ -13,7 +13,7 @@ const { unlink, stat, mkdir, -} = require('fs/promises') +} = require('node:fs/promises') const fileExists = (...p) => stat(resolve(...p)) .then((st) => st.isFile()) diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json index 215175c7332262..7c4e56b3efcbf8 100644 --- a/deps/npm/node_modules/@npmcli/config/package.json +++ b/deps/npm/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "8.3.2", + "version": "8.3.3", "files": [ "bin/", "lib/" diff --git a/deps/npm/node_modules/@npmcli/package-json/lib/normalize.js b/deps/npm/node_modules/@npmcli/package-json/lib/normalize.js index e3b37984884279..1e4545c2d3a1c8 100644 --- a/deps/npm/node_modules/@npmcli/package-json/lib/normalize.js +++ b/deps/npm/node_modules/@npmcli/package-json/lib/normalize.js @@ -46,15 +46,14 @@ function normalizePackageBin (pkg, changes) { changes?.push(`removed invalid "bin[${binKey}]"`) continue } - const base = path.join('/', path.basename(binKey.replace(/\\|:/g, '/'))).slice(1) + const base = path.basename(secureAndUnixifyPath(binKey)) if (!base) { delete pkg.bin[binKey] changes?.push(`removed invalid "bin[${binKey}]"`) continue } - const binTarget = path.join('/', pkg.bin[binKey].replace(/\\/g, '/')) - .replace(/\\/g, '/').slice(1) + const binTarget = secureAndUnixifyPath(pkg.bin[binKey]) if (!binTarget) { delete pkg.bin[binKey] @@ -83,6 +82,27 @@ function normalizePackageBin (pkg, changes) { delete pkg.bin } +function normalizePackageMan (pkg, changes) { + if (pkg.man) { + const mans = [] + for (const man of (Array.isArray(pkg.man) ? pkg.man : [pkg.man])) { + if (typeof man !== 'string') { + changes?.push(`removed invalid "man [${man}]"`) + } else { + mans.push(secureAndUnixifyPath(man)) + } + } + + if (!mans.length) { + changes?.push('empty "man" was removed') + } else { + pkg.man = mans + return pkg + } + } + delete pkg.man +} + function isCorrectlyEncodedName (spec) { return !spec.match(/[/@\s+%:]/) && spec === encodeURIComponent(spec) @@ -103,6 +123,19 @@ function isValidScopedPackageName (spec) { rest[1] === encodeURIComponent(rest[1]) } +function unixifyPath (ref) { + return ref.replace(/\\|:/g, '/') +} + +function securePath (ref) { + const secured = path.join('.', path.join('/', unixifyPath(ref))) + return secured.startsWith('.') ? '' : secured +} + +function secureAndUnixifyPath (ref) { + return unixifyPath(securePath(ref)) +} + // We don't want the `changes` array in here by default because this is a hot // path for parsing packuments during install. So the calling method passes it // in if it wants to track changes. @@ -251,7 +284,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase }) // strip "node_modules/.bin" from scripts entries // remove invalid scripts entries (non-strings) - if (steps.includes('scripts') || steps.includes('scriptpath')) { + if ((steps.includes('scripts') || steps.includes('scriptpath')) && data.scripts !== undefined) { const spre = /^(\.[/\\])?node_modules[/\\].bin[\\/]/ if (typeof data.scripts === 'object') { for (const name in data.scripts) { @@ -325,13 +358,16 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase }) } // expand directories.man - if (steps.includes('mans') && !data.man && data.directories?.man) { - const manDir = data.directories.man - const cwd = path.resolve(pkg.path, manDir) - const files = await lazyLoadGlob()('**/*.[0-9]', { cwd }) - data.man = files.map(man => - path.relative(pkg.path, path.join(cwd, man)).split(path.sep).join('/') - ) + if (steps.includes('mans')) { + if (data.directories?.man && !data.man) { + const manDir = secureAndUnixifyPath(data.directories.man) + const cwd = path.resolve(pkg.path, manDir) + const files = await lazyLoadGlob()('**/*.[0-9]', { cwd }) + data.man = files.map(man => + path.relative(pkg.path, path.join(cwd, man)).split(path.sep).join('/') + ) + } + normalizePackageMan(data, changes) } if (steps.includes('bin') || steps.includes('binDir') || steps.includes('binRefs')) { @@ -340,7 +376,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase }) // expand "directories.bin" if (steps.includes('binDir') && data.directories?.bin && !data.bin) { - const binsDir = path.resolve(pkg.path, path.join('.', path.join('/', data.directories.bin))) + const binsDir = path.resolve(pkg.path, securePath(data.directories.bin)) const bins = await lazyLoadGlob()('**', { cwd: binsDir }) data.bin = bins.reduce((acc, binFile) => { if (binFile && !binFile.startsWith('.')) { diff --git a/deps/npm/node_modules/@npmcli/package-json/package.json b/deps/npm/node_modules/@npmcli/package-json/package.json index 98236f604ecbd7..2e87923c4edd2d 100644 --- a/deps/npm/node_modules/@npmcli/package-json/package.json +++ b/deps/npm/node_modules/@npmcli/package-json/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/package-json", - "version": "5.1.0", + "version": "5.1.1", "description": "Programmatic API to update package.json", "main": "lib/index.js", "files": [ @@ -25,7 +25,7 @@ "license": "ISC", "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.4", + "@npmcli/template-oss": "4.22.0", "read-package-json": "^7.0.0", "read-package-json-fast": "^3.0.2", "tap": "^16.0.1" @@ -41,14 +41,14 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/package-json.git" + "url": "git+https://github.com/npm/package-json.git" }, "engines": { "node": "^16.14.0 || >=18.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.4", + "version": "4.22.0", "publish": "true" }, "tap": { diff --git a/deps/npm/node_modules/@sigstore/bundle/package.json b/deps/npm/node_modules/@sigstore/bundle/package.json index ab96ba7e8b2ca6..dd853897226d2f 100644 --- a/deps/npm/node_modules/@sigstore/bundle/package.json +++ b/deps/npm/node_modules/@sigstore/bundle/package.json @@ -1,6 +1,6 @@ { "name": "@sigstore/bundle", - "version": "2.3.1", + "version": "2.3.2", "description": "Sigstore bundle type", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -27,7 +27,7 @@ "provenance": true }, "dependencies": { - "@sigstore/protobuf-specs": "^0.3.1" + "@sigstore/protobuf-specs": "^0.3.2" }, "engines": { "node": "^16.14.0 || >=18.0.0" diff --git a/deps/npm/node_modules/@sigstore/sign/package.json b/deps/npm/node_modules/@sigstore/sign/package.json index 47d8fed2e6ab38..4adb3d24c6fa68 100644 --- a/deps/npm/node_modules/@sigstore/sign/package.json +++ b/deps/npm/node_modules/@sigstore/sign/package.json @@ -1,6 +1,6 @@ { "name": "@sigstore/sign", - "version": "2.3.1", + "version": "2.3.2", "description": "Sigstore signing library", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -27,15 +27,15 @@ }, "devDependencies": { "@sigstore/jest": "^0.0.0", - "@sigstore/mock": "^0.7.3", + "@sigstore/mock": "^0.7.4", "@sigstore/rekor-types": "^2.0.0", "@types/make-fetch-happen": "^10.0.4", "@types/promise-retry": "^1.1.6" }, "dependencies": { - "@sigstore/bundle": "^2.3.0", + "@sigstore/bundle": "^2.3.2", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.1", + "@sigstore/protobuf-specs": "^0.3.2", "make-fetch-happen": "^13.0.1", "proc-log": "^4.2.0", "promise-retry": "^2.0.1" diff --git a/deps/npm/node_modules/@sigstore/tuf/package.json b/deps/npm/node_modules/@sigstore/tuf/package.json index d56d45cfc80a84..b7fd34ac9674eb 100644 --- a/deps/npm/node_modules/@sigstore/tuf/package.json +++ b/deps/npm/node_modules/@sigstore/tuf/package.json @@ -1,6 +1,6 @@ { "name": "@sigstore/tuf", - "version": "2.3.3", + "version": "2.3.4", "description": "Client for the Sigstore TUF repository", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -32,7 +32,7 @@ "@types/make-fetch-happen": "^10.0.4" }, "dependencies": { - "@sigstore/protobuf-specs": "^0.3.0", + "@sigstore/protobuf-specs": "^0.3.2", "tuf-js": "^2.2.1" }, "engines": { diff --git a/deps/npm/node_modules/@sigstore/verify/package.json b/deps/npm/node_modules/@sigstore/verify/package.json index edd6566e10ece7..cd0c845a797e47 100644 --- a/deps/npm/node_modules/@sigstore/verify/package.json +++ b/deps/npm/node_modules/@sigstore/verify/package.json @@ -1,6 +1,6 @@ { "name": "@sigstore/verify", - "version": "1.2.0", + "version": "1.2.1", "description": "Verification of Sigstore signatures", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -26,8 +26,8 @@ "provenance": true }, "dependencies": { - "@sigstore/protobuf-specs": "^0.3.1", - "@sigstore/bundle": "^2.3.1", + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/bundle": "^2.3.2", "@sigstore/core": "^1.1.0" }, "engines": { diff --git a/deps/npm/node_modules/cidr-regex/dist/index.js b/deps/npm/node_modules/cidr-regex/dist/index.js new file mode 100644 index 00000000000000..2817f65eeb3cb8 --- /dev/null +++ b/deps/npm/node_modules/cidr-regex/dist/index.js @@ -0,0 +1,15 @@ +import ipRegex from "ip-regex"; +const defaultOpts = { exact: false }; +const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`; +const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`; +const v4exact = new RegExp(`^${v4str}$`); +const v6exact = new RegExp(`^${v6str}$`); +const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`); +const cidrRegex = ({ exact } = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g"); +const v4 = cidrRegex.v4 = ({ exact } = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g"); +const v6 = cidrRegex.v6 = ({ exact } = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g"); +export { + cidrRegex as default, + v4, + v6 +}; diff --git a/deps/npm/node_modules/cidr-regex/index.js b/deps/npm/node_modules/cidr-regex/index.js deleted file mode 100644 index 61597c62532aa8..00000000000000 --- a/deps/npm/node_modules/cidr-regex/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import ipRegex from "ip-regex"; - -const defaultOpts = {exact: false}; -const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`; -const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`; - -// pre-compile only the exact regexes as global flag makes regex objects stateful -const v4exact = new RegExp(`^${v4str}$`); -const v6exact = new RegExp(`^${v6str}$`); -const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`); - -const cidrRegex = ({exact} = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g"); -export const v4 = cidrRegex.v4 = ({exact} = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g"); -export const v6 = cidrRegex.v6 = ({exact} = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g"); -export default cidrRegex; diff --git a/deps/npm/node_modules/cidr-regex/package.json b/deps/npm/node_modules/cidr-regex/package.json index 262da56e2ee676..88b8297b02473e 100644 --- a/deps/npm/node_modules/cidr-regex/package.json +++ b/deps/npm/node_modules/cidr-regex/package.json @@ -1,6 +1,6 @@ { "name": "cidr-regex", - "version": "4.0.5", + "version": "4.1.1", "description": "Regular expression for matching IP addresses in CIDR notation", "author": "silverwind ", "contributors": [ @@ -9,25 +9,32 @@ "repository": "silverwind/cidr-regex", "license": "BSD-2-Clause", "type": "module", - "exports": "./index.js", "sideEffects": false, + "main": "./dist/index.js", + "exports": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], "engines": { "node": ">=14" }, - "files": [ - "index.js", - "index.d.ts" - ], "dependencies": { "ip-regex": "^5.0.0" }, "devDependencies": { + "@types/node": "20.12.12", "eslint": "8.57.0", - "eslint-config-silverwind": "83.0.1", - "tsd": "0.31.0", - "updates": "16.0.0", - "versions": "12.0.1", - "vitest": "1.4.0", - "vitest-config-silverwind": "7.0.3" + "eslint-config-silverwind": "85.1.4", + "eslint-config-silverwind-typescript": "3.2.7", + "typescript": "5.4.5", + "typescript-config-silverwind": "4.3.2", + "updates": "16.1.1", + "versions": "12.0.2", + "vite": "5.2.11", + "vite-config-silverwind": "1.1.2", + "vite-plugin-dts": "3.9.1", + "vitest": "1.6.0", + "vitest-config-silverwind": "9.0.6" } } diff --git a/deps/npm/node_modules/glob/README.md b/deps/npm/node_modules/glob/README.md index 92c202afa1df8d..023cd7796820e0 100644 --- a/deps/npm/node_modules/glob/README.md +++ b/deps/npm/node_modules/glob/README.md @@ -77,7 +77,7 @@ g3.stream().on('data', path => { 'got a path object', path.fullpath(), path.isDirectory(), - path.readdirSync().map(e => e.name) + path.readdirSync().map(e => e.name), ) }) @@ -593,6 +593,51 @@ share the previously loaded cache. explicitly, then any provided `scurry` object must match this setting. +- `includeChildMatches` boolean, default `true`. Do not match any + children of any matches. For example, the pattern `**\/foo` + would match `a/foo`, but not `a/foo/b/foo` in this mode. + + This is especially useful for cases like "find all + `node_modules` folders, but not the ones in `node_modules`". + + In order to support this, the `Ignore` implementation must + support an `add(pattern: string)` method. If using the default + `Ignore` class, then this is fine, but if this is set to + `false`, and a custom `Ignore` is provided that does not have + an `add()` method, then it will throw an error. + + **Caveat** It _only_ ignores matches that would be a descendant + of a previous match, and only if that descendant is matched + _after_ the ancestor is encountered. Since the file system walk + happens in indeterminate order, it's possible that a match will + already be added before its ancestor, if multiple or braced + patterns are used. + + For example: + + ```js + const results = await glob( + [ + // likely to match first, since it's just a stat + 'a/b/c/d/e/f', + + // this pattern is more complicated! It must to various readdir() + // calls and test the results against a regular expression, and that + // is certainly going to take a little bit longer. + // + // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + // late to ignore a/b/c/d/e/f, because it's already been emitted. + 'a/[bdf]/?/[a-z]/*', + ], + { includeChildMatches: false }, + ) + ``` + + It's best to only set this to `false` if you can be reasonably + sure that no components of the pattern will potentially match + one another's file system descendants, or if the occasional + included child entry will not cause problems. + ## Glob Primer Much more information about glob pattern expansion can be found diff --git a/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts b/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts index a8b3da7722b652..b3559edf80121a 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts +++ b/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts @@ -247,6 +247,50 @@ export interface GlobOptions { * `'//?/C:/foo/bar'` */ posix?: boolean; + /** + * Do not match any children of any matches. For example, the pattern + * `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode. + * + * This is especially useful for cases like "find all `node_modules` + * folders, but not the ones in `node_modules`". + * + * In order to support this, the `Ignore` implementation must support an + * `add(pattern: string)` method. If using the default `Ignore` class, then + * this is fine, but if this is set to `false`, and a custom `Ignore` is + * provided that does not have an `add()` method, then it will throw an + * error. + * + * **Caveat** It *only* ignores matches that would be a descendant of a + * previous match, and only if that descendant is matched *after* the + * ancestor is encountered. Since the file system walk happens in + * indeterminate order, it's possible that a match will already be added + * before its ancestor, if multiple or braced patterns are used. + * + * For example: + * + * ```ts + * const results = await glob([ + * // likely to match first, since it's just a stat + * 'a/b/c/d/e/f', + * + * // this pattern is more complicated! It must to various readdir() + * // calls and test the results against a regular expression, and that + * // is certainly going to take a little bit longer. + * // + * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + * // late to ignore a/b/c/d/e/f, because it's already been emitted. + * 'a/[bdf]/?/[a-z]/*', + * ], { includeChildMatches: false }) + * ``` + * + * It's best to only set this to `false` if you can be reasonably sure that + * no components of the pattern will potentially match one another's file + * system descendants, or if the occasional included child entry will not + * cause problems. + * + * @default true + */ + includeChildMatches?: boolean; } export type GlobOptionsWithFileTypesTrue = GlobOptions & { withFileTypes: true; @@ -291,6 +335,7 @@ export declare class Glob implements GlobOptions { signal?: AbortSignal; windowsPathsNoEscape: boolean; withFileTypes: FileTypes; + includeChildMatches: boolean; /** * The options provided to the constructor. */ diff --git a/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts.map index 5216438a25086b..3ec673a5faef93 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/glob.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,C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CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/glob.js b/deps/npm/node_modules/glob/dist/commonjs/glob.js index 7734487d380526..e1339bbbcf57f3 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/glob.js +++ b/deps/npm/node_modules/glob/dist/commonjs/glob.js @@ -2,16 +2,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Glob = void 0; const minimatch_1 = require("minimatch"); -const path_scurry_1 = require("path-scurry"); const node_url_1 = require("node:url"); +const path_scurry_1 = require("path-scurry"); const pattern_js_1 = require("./pattern.js"); const walker_js_1 = require("./walker.js"); // if no process global, just call it linux. // so we default to case-sensitive, / separators -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * An object that can perform glob pattern traversals. @@ -41,6 +41,7 @@ class Glob { signal; windowsPathsNoEscape; withFileTypes; + includeChildMatches; /** * The options provided to the constructor. */ @@ -86,6 +87,7 @@ class Glob { this.noext = !!opts.noext; this.realpath = !!opts.realpath; this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; this.noglobstar = !!opts.noglobstar; this.matchBase = !!opts.matchBase; this.maxDepth = @@ -100,7 +102,8 @@ class Glob { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || - opts.allowWindowsEscape === false; + opts.allowWindowsEscape === + false; if (this.windowsPathsNoEscape) { pattern = pattern.map(p => p.replace(/\\/g, '/')); } @@ -121,12 +124,9 @@ class Glob { } } else { - const Scurry = opts.platform === 'win32' - ? path_scurry_1.PathScurryWin32 - : opts.platform === 'darwin' - ? path_scurry_1.PathScurryDarwin - : opts.platform - ? path_scurry_1.PathScurryPosix + const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32 + : opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin + : opts.platform ? path_scurry_1.PathScurryPosix : path_scurry_1.PathScurry; this.scurry = new Scurry(this.cwd, { nocase: opts.nocase, @@ -178,11 +178,12 @@ class Glob { return [ ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walk()), ]; } @@ -190,32 +191,35 @@ class Glob { return [ ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walkSync(), ]; } stream() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).stream(); } streamSync() { return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).streamSync(); } /** diff --git a/deps/npm/node_modules/glob/dist/commonjs/glob.js.map b/deps/npm/node_modules/glob/dist/commonjs/glob.js.map index f7114efa5f2073..ddab419717efa5 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/glob.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/glob.js.map @@ -1 +1 @@ -{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAEvD,6CAOoB;AACpB,uCAAwC;AAExC,6CAAsC;AACtC,2CAAoD;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;IAClC,CAAC,CAAC,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAgTb;;GAEG;AACH,MAAa,IAAI;IACf,QAAQ,CAAU;IAClB,GAAG,CAAQ;IACX,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,MAAM,CAAiC;IACvC,aAAa,CAAS;IACtB,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,QAAQ,CAAQ;IAChB,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,QAAQ,CAAiB;IACzB,QAAQ,CAAS;IACjB,MAAM,CAAY;IAClB,IAAI,CAAS;IACb,MAAM,CAAc;IACpB,oBAAoB,CAAS;IAC7B,aAAa,CAAiB;IAE9B;;OAEG;IACH,IAAI,CAAM;IAEV;;OAEG;IACH,QAAQ,CAAW;IAEnB;;;;;;;;;;;OAWG;IACH,YAAY,OAA0B,EAAE,IAAU;QAChD,qBAAqB;QACrB,IAAI,C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AAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;gBACzC,CAAC,CAAC,QAAQ;YACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC,MAAM,EAAE,CAAA;IACb,CAAC;IAMD,UAAU;QACR,OAAO,IAAI,sBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACpD,GAAG,IAAI,CAAC,IAAI;YACZ,QAAQ,EACN,IAAI,CAAC,QAAQ,KAAK,QAAQ;gBACxB,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;gBACzC,CAAC,CAAC,QAAQ;YACd,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF;AAzQD,oBAyQC","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { fileURLToPath } from 'node:url'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ? process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignore` and `ignoreChildren`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result = Opts extends GlobOptionsWithFileTypesTrue\n ? Path\n : Opts extends GlobOptionsWithFileTypesFalse\n ? string\n : Opts extends GlobOptionsWithFileTypesUnset\n ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes = Opts extends GlobOptionsWithFileTypesTrue\n ? true\n : Opts extends GlobOptionsWithFileTypesFalse\n ? false\n : Opts extends GlobOptionsWithFileTypesUnset\n ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as GlobOptions).allowWindowsEscape === false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32'\n ? PathScurryWin32\n : opts.platform === 'darwin'\n ? PathScurryDarwin\n : opts.platform\n ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []]\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAEvD,uCAAwC;AACxC,6CAOoB;AAEpB,6CAAsC;AACtC,2CAAoD;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAyVX;;GAEG;AACH,MAAa,IAAI;IACf,QAAQ,CAAU;IAClB,GAAG,CAAQ;IACX,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,MAAM,CAAiC;IACvC,aAAa,CAAS;IACtB,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,QAAQ,CAAQ;IAChB,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,QAAQ,CAAiB;IACzB,QAAQ,CAAS;IACjB,MAAM,CAAY;IAClB,IAAI,CAAS;IACb,MAAM,CAAc;IACpB,oBAAoB,CAAS;IAC7B,aAAa,CAAiB;IAC9B,mBAAmB,CAAS;IAE5B;;OAEG;IACH,IAAI,CAAM;IAEV;;OAEG;IACH,QAAQ,CAAW;IAEnB;;;;;;;;;;;OAWG;IACH,YAAY,OAA0B,EAAE,IAAU;QAChD,qBAAqB;QACrB,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAA;QACvD,oBAAoB;QACpB,IAAI,CAAC,aAAa,GA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MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF;AA7QD,oBA6QC","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignore` and `ignoreChildren`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/has-magic.js.map b/deps/npm/node_modules/glob/dist/commonjs/has-magic.js.map index 5e71e3a58a2d6e..44deab29058276 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/has-magic.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/has-magic.js.map @@ -1 +1 @@ -{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;KACpB;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;KACtD;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {}\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file +{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts b/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts index e9d74f3b5e1291..cfe108dbd4106c 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts +++ b/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts @@ -1,9 +1,11 @@ -import { Minimatch } from 'minimatch'; +/// +import { Minimatch, MinimatchOptions } from 'minimatch'; import { Path } from 'path-scurry'; import { GlobWalkerOpts } from './walker.js'; export interface IgnoreLike { ignored?: (p: Path) => boolean; childrenIgnored?: (p: Path) => boolean; + add?: (ignore: string) => void; } /** * Class used to process ignored patterns @@ -13,7 +15,10 @@ export declare class Ignore implements IgnoreLike { relativeChildren: Minimatch[]; absolute: Minimatch[]; absoluteChildren: Minimatch[]; + platform: NodeJS.Platform; + mmopts: MinimatchOptions; constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts); + add(ign: string): void; ignored(p: Path): boolean; childrenIgnored(p: Path): boolean; } diff --git a/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts.map index 21ab57b94d1a76..82a7ac2a306184 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/ignore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;CACvC;AASD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,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O;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/ignore.js b/deps/npm/node_modules/glob/dist/commonjs/ignore.js index 3c0daeff86ff87..5f1fde0680dea3 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/ignore.js +++ b/deps/npm/node_modules/glob/dist/commonjs/ignore.js @@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Ignore = void 0; const minimatch_1 = require("minimatch"); const pattern_js_1 = require("./pattern.js"); -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * Class used to process ignored patterns @@ -20,12 +20,15 @@ class Ignore { relativeChildren; absolute; absoluteChildren; + platform; + mmopts; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - const mmopts = { + this.platform = platform; + this.mmopts = { dot: true, nobrace, nocase, @@ -36,6 +39,10 @@ class Ignore { nocomment: true, nonegate: true, }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at @@ -48,36 +55,34 @@ class Ignore { // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. - for (const ign of ignored) { - const mm = new minimatch_1.Minimatch(ign, mmopts); - for (let i = 0; i < mm.set.length; i++) { - const parsed = mm.set[i]; - const globParts = mm.globParts[i]; - /* c8 ignore start */ - if (!parsed || !globParts) { - throw new Error('invalid pattern object'); - } - // strip off leading ./ portions - // https://github.com/isaacs/node-glob/issues/570 - while (parsed[0] === '.' && globParts[0] === '.') { - parsed.shift(); - globParts.shift(); - } - /* c8 ignore stop */ - const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform); - const m = new minimatch_1.Minimatch(p.globString(), mmopts); - const children = globParts[globParts.length - 1] === '**'; - const absolute = p.isAbsolute(); + const mm = new minimatch_1.Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform); + const m = new minimatch_1.Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { if (absolute) - this.absolute.push(m); + this.absoluteChildren.push(m); else - this.relative.push(m); - if (children) { - if (absolute) - this.absoluteChildren.push(m); - else - this.relativeChildren.push(m); - } + this.relativeChildren.push(m); } } } diff --git a/deps/npm/node_modules/glob/dist/commonjs/ignore.js.map b/deps/npm/node_modules/glob/dist/commonjs/ignore.js.map index 30a4f731ee6048..d9dfdfa34ab5c0 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/ignore.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/ignore.js.map @@ -1 +1 @@ -{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;;;AAE7C,yCAAqC;AAErC,6CAAsC;AAQtC,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;IAClC,CAAC,CAAC,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAEb;;GAEG;AACH,MAAa,MAAM;IACjB,QAAQ,CAAa;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CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;SACzD;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC7B,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;SACzD;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,eAAe,CAAC,CAAO;QACrB,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAA;QACnC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACrC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;SACnC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACrC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;SACnC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAnGD,wBAmGC","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n}\n\nconst defaultPlatform: NodeJS.Platform =\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ? process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n const mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n for (const ign of ignored) {\n const mm = new Minimatch(ign, mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, platform)\n const m = new Minimatch(p.globString(), mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;;;AAE7C,yCAAuD;AAEvD,6CAAsC;AAStC,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAEX;;GAEG;AACH,MAAa,MAAM;IACjB,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAC7B,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAC7B,QAAQ,CAAiB;IACzB,MAAM,CAAkB;IAExB,YACE,OAAiB,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAAQ,GAAG,eAAe,GACX;QAEjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,EAAE,IAAI;YACT,OAAO;YACP,MAAM;YACN,KAAK;YACL,UAAU;YACV,iBAAiB,EAAE,CAAC;YACpB,QAAQ;YACR,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;SACf,CAAA;QACD,KAAK,MAAM,GAAG,IAAI,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CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAvGD,wBAuGC","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n platform: NodeJS.Platform\n mmopts: MinimatchOptions\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts,\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n this.platform = platform\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n for (const ign of ignored) this.add(ign)\n }\n\n add(ign: string) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new Minimatch(ign, this.mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, this.platform)\n const m = new Minimatch(p.globString(), this.mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/index.d.ts b/deps/npm/node_modules/glob/dist/commonjs/index.d.ts index 048e584715b772..693ba2ab8e6275 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/index.d.ts +++ b/deps/npm/node_modules/glob/dist/commonjs/index.d.ts @@ -2,6 +2,14 @@ import { Minipass } from 'minipass'; import { Path } from 'path-scurry'; import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js'; import { Glob } from './glob.js'; +export { escape, unescape } from 'minimatch'; +export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry'; +export { Glob } from './glob.js'; +export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; +export type { IgnoreLike } from './ignore.js'; +export type { MatchStream } from './walker.js'; /** * Syncronous form of {@link globStream}. Will read all the matches as fast as * you consume them, even all in a single tick if you consume them immediately, @@ -62,13 +70,6 @@ export declare const sync: typeof globSync & { stream: typeof globStreamSync; iterate: typeof globIterateSync; }; -export { escape, unescape } from 'minimatch'; -export { Glob } from './glob.js'; -export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; -export { hasMagic } from './has-magic.js'; -export type { IgnoreLike } from './ignore.js'; -export type { MatchStream } from './walker.js'; -export type { Path, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, WalkOptions, FSOption, } from 'path-scurry'; export declare const glob: typeof glob_ & { glob: typeof glob_; globSync: typeof globSync; diff --git a/deps/npm/node_modules/glob/dist/commonjs/index.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/index.d.ts.map index 3e263fb5e2dbed..5fb32252b63747 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/index.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/index.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AAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,CAAC,EAAE,6BAA6B,GAAG,SAAS,GAClD,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,4BAA4B,GACpC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACnC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,GACnB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/index.js b/deps/npm/node_modules/glob/dist/commonjs/index.js index 71c31c03dd339b..31da9dfd53c6ae 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/index.js +++ b/deps/npm/node_modules/glob/dist/commonjs/index.js @@ -1,9 +1,18 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.glob = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = void 0; +exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.globSync = exports.globStream = exports.globStreamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0; const minimatch_1 = require("minimatch"); const glob_js_1 = require("./glob.js"); const has_magic_js_1 = require("./has-magic.js"); +var minimatch_2 = require("minimatch"); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); +Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); +var glob_js_2 = require("./glob.js"); +Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); +var has_magic_js_2 = require("./has-magic.js"); +Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); +var ignore_js_1 = require("./ignore.js"); +Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } }); function globStreamSync(pattern, options = {}) { return new glob_js_1.Glob(pattern, options).streamSync(); } @@ -38,15 +47,6 @@ exports.sync = Object.assign(globSync, { stream: globStreamSync, iterate: globIterateSync, }); -/* c8 ignore start */ -var minimatch_2 = require("minimatch"); -Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); -Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); -var glob_js_2 = require("./glob.js"); -Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); -var has_magic_js_2 = require("./has-magic.js"); -Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); -/* c8 ignore stop */ exports.glob = Object.assign(glob_, { glob: glob_, globSync, diff --git a/deps/npm/node_modules/glob/dist/commonjs/index.js.map b/deps/npm/node_modules/glob/dist/commonjs/index.js.map index e8c568acf837a5..7f3f8d89fd8bbe 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/index.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAS5C,uCAAgC;AAChC,iDAAyC;AAuBzC,SAAgB,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AALD,wCAKC;AAsBD,SAAgB,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AALD,gCAKC;AAqBD,SAAgB,QAAQ,CACtB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC9C,CAAC;AALD,4BAKC;AAwBD,KAAK,UAAU,KAAK,CAClB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AAC1C,CAAC;AAqBD,SAAgB,eAAe,CAC7B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;AACjD,CAAC;AALD,0CAKC;AAqBD,SAAgB,WAAW,CACzB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;AAC7C,CAAC;AALD,kCAKC;AAED,iEAAiE;AACpD,QAAA,UAAU,GAAG,cAAc,CAAA;AAC3B,QAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;AAC5D,QAAA,WAAW,GAAG,eAAe,CAAA;AAC7B,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IAChD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAA;AACW,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC1C,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAA;AAEF,qBAAqB;AACrB,uCAA4C;AAAnC,mGAAA,MAAM,OAAA;AAAE,qGAAA,QAAQ,OAAA;AACzB,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAOb,+CAAyC;AAAhC,wGAAA,QAAQ,OAAA;AAWjB,oBAAoB;AAEP,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,KAAK;IACX,QAAQ;IACR,IAAI,EAAJ,YAAI;IACJ,UAAU;IACV,MAAM,EAAN,cAAM;IACN,cAAc;IACd,UAAU,EAAV,kBAAU;IACV,WAAW;IACX,OAAO,EAAP,eAAO;IACP,eAAe;IACf,WAAW,EAAX,mBAAW;IACX,IAAI,EAAJ,cAAI;IACJ,QAAQ,EAAR,uBAAQ;IACR,MAAM,EAAN,kBAAM;IACN,QAAQ,EAAR,oBAAQ;CACT,CAAC,CAAA;AACF,YAAI,CAAC,IAAI,GAAG,YAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\n/* c8 ignore start */\nexport { escape, unescape } from 'minimatch'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\nexport type {\n Path,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n WalkOptions,\n FSOption,\n} from 'path-scurry'\n\n/* c8 ignore stop */\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAS5C,uCAAgC;AAChC,iDAAyC;AAEzC,uCAA4C;AAAnC,mGAAA,MAAM,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAQzB,qCAAgC;AAAvB,+FAAA,IAAI,OAAA;AAOb,+CAAyC;AAAhC,wGAAA,QAAQ,OAAA;AACjB,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AAyBf,SAAgB,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AALD,wCAKC;AAsBD,SAAgB,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AALD,gCAKC;AAqBD,SAAgB,QAAQ,CACtB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,cAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC9C,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AN,kBAAM;IACN,QAAQ,EAAR,oBAAQ;CACT,CAAC,CAAA;AACF,YAAI,CAAC,IAAI,GAAG,YAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions,\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions,\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/pattern.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/pattern.d.ts.map index 1430a77dadbbe4..39cd0620eb3ebb 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/pattern.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/pattern.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAA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QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/pattern.js b/deps/npm/node_modules/glob/dist/commonjs/pattern.js index 181371293d8605..f0de35fb5bed9d 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/pattern.js +++ b/deps/npm/node_modules/glob/dist/commonjs/pattern.js @@ -110,9 +110,9 @@ class Pattern { globString() { return (this.#globString = this.#globString || - (this.#index === 0 - ? this.isAbsolute() - ? this.#globList[0] + this.#globList.slice(1).join('/') + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') : this.#globList.join('/') : this.#globList.slice(this.#index).join('/'))); } @@ -141,8 +141,8 @@ class Pattern { */ isUNC() { const pl = this.#patternList; - return this.#isUNC !== undefined - ? this.#isUNC + return this.#isUNC !== undefined ? + this.#isUNC : (this.#isUNC = this.#platform === 'win32' && this.#index === 0 && @@ -163,8 +163,8 @@ class Pattern { */ isDrive() { const pl = this.#patternList; - return this.#isDrive !== undefined - ? this.#isDrive + return this.#isDrive !== undefined ? + this.#isDrive : (this.#isDrive = this.#platform === 'win32' && this.#index === 0 && @@ -180,8 +180,8 @@ class Pattern { */ isAbsolute() { const pl = this.#patternList; - return this.#isAbsolute !== undefined - ? this.#isAbsolute + return this.#isAbsolute !== undefined ? + this.#isAbsolute : (this.#isAbsolute = (pl[0] === '' && pl.length > 1) || this.isDrive() || @@ -192,8 +192,8 @@ class Pattern { */ root() { const p = this.#patternList[0]; - return typeof p === 'string' && this.isAbsolute() && this.#index === 0 - ? p + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p : ''; } /** diff --git a/deps/npm/node_modules/glob/dist/commonjs/pattern.js.map b/deps/npm/node_modules/glob/dist/commonjs/pattern.js.map index d14f76b335cbc0..fc10ea5d6c4ef4 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/pattern.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/pattern.js.map @@ -1 +1 @@ -{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAAA,yEAAyE;;;AAEzE,yCAAoC;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE;;;GAGG;AACH,MAAa,OAAO;IACT,YAAY,CAAa;IACzB,SAAS,CAAU;IACnB,MAAM,CAAQ;IACd,MAAM,CAAQ;IACd,SAAS,CAAiB;IACnC,KAAK,CAAiB;IACtB,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,WAAW,CAAU;IACrB,eAAe,GAAY,IAAI,CAAA;IAE/B,YACE,WAAwB,EACxB,QAAkB,EAClB,KAAa,EACb,QAAyB;QAEzB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;YAC/B,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAA;SAC1C;QACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACzB,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;SACvC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE;YAC1C,MAAM,IAAI,SAAS,CAA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AAC,CAAA;IAChC,CAAC;IAED,sCAAsC;IACtC,kDAAkD;IAClD,oDAAoD;IACpD;;OAEG;IACH,UAAU;QACR,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAA;QAC5B,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,IAAI,CAAC,WAAW;YAClB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW;gBACf,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YACpE,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAnOD,0BAmOC","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[]\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0\n ? this.isAbsolute()\n ? this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined\n ? this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined\n ? this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined\n ? this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ? p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAAA,yEAAyE;;;AAEzE,yCAAoC;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EA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AC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArOD,0BAqOC","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/processor.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/processor.d.ts.map index 33a39b2a8be3bf..aa266fee4a0544 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/processor.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/processor.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG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EAAE,OAAO;CASvE"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/processor.js b/deps/npm/node_modules/glob/dist/commonjs/processor.js index 7d30a3b6650005..ee3bb4397e0b2d 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/processor.js +++ b/deps/npm/node_modules/glob/dist/commonjs/processor.js @@ -103,9 +103,8 @@ class Processor { this.opts = opts; this.follow = !!opts.follow; this.dot = !!opts.dot; - this.hasWalkedCache = hasWalkedCache - ? hasWalkedCache.copy() - : new HasWalkedCache(); + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); } processPatterns(target, patterns) { this.patterns = patterns; @@ -118,8 +117,8 @@ class Processor { const absolute = pattern.isAbsolute() && this.opts.absolute !== false; // start absolute patterns at root if (root) { - t = t.resolve(root === '/' && this.opts.root !== undefined - ? this.opts.root + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root : root); const rest = pattern.rest(); if (!rest) { diff --git a/deps/npm/node_modules/glob/dist/commonjs/processor.js.map b/deps/npm/node_modules/glob/dist/commonjs/processor.js.map index 51b21438a9b746..58a70882e9462f 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/processor.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/processor.js.map @@ -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,M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C;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;SAC3B;IACH,CAAC;CACF;AA/ND,8BA+NC","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>\n constructor(store: Map> = 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 = 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 = 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 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 not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\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"]} \ No newline at end of file +{"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,IA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AE,EAAE,QAAQ,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU,CACR,CAAO,EACP,CAAW,EACX,IAAoB,EACpB,QAAiB;QAEjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAM;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,UAAU,CAAC,CAAO,EAAE,CAAS,EAAE,IAAoB,EAAE,QAAiB;QACpE,uBAAuB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAM;QACzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF;AA9ND,8BA8NC","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>\n constructor(store: Map> = 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 = 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 = 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 =\n hasWalkedCache ? hasWalkedCache.copy() : 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 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 not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\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"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts b/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts index 5c1a0414971b3a..fb51b9ece571e5 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts +++ b/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts @@ -34,6 +34,7 @@ export interface GlobWalkerOpts { signal?: AbortSignal; windowsPathsNoEscape?: boolean; withFileTypes?: boolean; + includeChildMatches?: boolean; } export type GWOFileTypesTrue = GlobWalkerOpts & { withFileTypes: true; @@ -46,7 +47,7 @@ export type GWOFileTypesUnset = GlobWalkerOpts & { }; export type Result = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string; export type Matches = O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; -export type MatchStream = O extends GWOFileTypesTrue ? Minipass : O extends GWOFileTypesFalse ? Minipass : O extends GWOFileTypesUnset ? Minipass : Minipass; +export type MatchStream = Minipass, Result>; /** * basic walking utilities that all the glob walker types use */ @@ -60,6 +61,7 @@ export declare abstract class GlobUtil any): void; } export declare class GlobWalker extends GlobUtil { - matches: O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; + matches: Set>; constructor(patterns: Pattern[], path: Path, opts: O); matchEmit(e: Result): void; - walk(): Promise>; - walkSync(): Matches; + walk(): Promise>>; + walkSync(): Set>; } export declare class GlobStream extends GlobUtil { - results: O extends GWOFileTypesTrue ? Minipass : O extends GWOFileTypesFalse ? Minipass : O extends GWOFileTypesUnset ? Minipass : Minipass; + results: Minipass, Result>; constructor(patterns: Pattern[], path: Path, opts: O); matchEmit(e: Result): void; stream(): MatchStream; diff --git a/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts.map b/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts.map index 2cae287c2e1f42..832c35270862b8 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts.map +++ b/deps/npm/node_modules/glob/dist/commonjs/walker.d.ts.map @@ -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,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAA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/walker.js b/deps/npm/node_modules/glob/dist/commonjs/walker.js index 20cec70fdf95f5..cb15946d9a852c 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/walker.js +++ b/deps/npm/node_modules/glob/dist/commonjs/walker.js @@ -10,10 +10,8 @@ exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; const minipass_1 = require("minipass"); const ignore_js_1 = require("./ignore.js"); const processor_js_1 = require("./processor.js"); -const makeIgnore = (ignore, opts) => typeof ignore === 'string' - ? new ignore_js_1.Ignore([ignore], opts) - : Array.isArray(ignore) - ? new ignore_js_1.Ignore(ignore, opts) +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts) + : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; /** * basic walking utilities that all the glob walker types use @@ -30,13 +28,20 @@ class GlobUtil { #sep; signal; maxDepth; + includeChildMatches; constructor(patterns, path, opts) { this.patterns = patterns; this.path = path; this.opts = opts; this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; - if (opts.ignore) { - this.#ignore = makeIgnore(opts.ignore, opts); + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } } // ignore, always set with maxDepth, but it's optional on the // GlobOptions type @@ -108,7 +113,7 @@ class GlobUtil { return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { - return e && + return (e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && @@ -116,8 +121,8 @@ class GlobUtil { !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && - !this.#ignored(e) - ? e + !this.#ignored(e)) ? + e : undefined; } matchCheckSync(e, ifDir) { @@ -143,6 +148,11 @@ class GlobUtil { matchFinish(e, absolute) { if (this.#ignored(e)) return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; this.seen.add(e); const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; @@ -156,8 +166,8 @@ class GlobUtil { } else { const rel = this.opts.posix ? e.relativePosix() : e.relative(); - const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) - ? '.' + this.#sep + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep : ''; this.matchEmit(!rel ? '.' + mark : pre + rel + mark); } @@ -297,10 +307,9 @@ class GlobUtil { } exports.GlobUtil = GlobUtil; class GlobWalker extends GlobUtil { - matches; + matches = new Set(); constructor(patterns, path, opts) { super(patterns, path, opts); - this.matches = new Set(); } matchEmit(e) { this.matches.add(e); diff --git a/deps/npm/node_modules/glob/dist/commonjs/walker.js.map b/deps/npm/node_modules/glob/dist/commonjs/walker.js.map index 5c2a58531858b0..49b013864d534b 100644 --- a/deps/npm/node_modules/glob/dist/commonjs/walker.js.map +++ b/deps/npm/node_modules/glob/dist/commonjs/walker.js.map @@ -1 +1 @@ -{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,uCAAmC;AAEnC,2CAAgD;AAQhD,iDAA0C;AAiE1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,CACd,OAAO,MAAM,KAAK,QAAQ;IACxB,CAAC,CAAC,IAAI,kBAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC,CAAC,IAAI,kBAAM,CAAC,MAAM,EAAE,IAAI,CAAC;QAC1B,CAAC,CAAC,MAAM,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,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAChD,CAAC;IAGD,SAAS,CAAC,CAAgB;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;YACtB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;SACH;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;SAC7D;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;SACtB;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AA9CD,gCA8CC","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result = O extends GWOFileTypesTrue\n ? Path\n : O extends GWOFileTypesFalse\n ? string\n : O extends GWOFileTypesUnset\n ? string\n : Path | string\n\nexport type Matches = O extends GWOFileTypesTrue\n ? Set\n : O extends GWOFileTypesFalse\n ? Set\n : O extends GWOFileTypesUnset\n ? Set\n : Set\n\nexport type MatchStream =\n O extends GWOFileTypesTrue\n ? Minipass\n : O extends GWOFileTypesFalse\n ? Minipass\n : O extends GWOFileTypesUnset\n ? Minipass\n : Minipass\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts\n): IgnoreLike =>\n typeof ignore === 'string'\n ? new Ignore([ignore], opts)\n : Array.isArray(ignore)\n ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n if (opts.ignore) {\n this.#ignore = makeIgnore(opts.ignore, opts)\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ? e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep)\n ? '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb)\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil {\n matches: O extends GWOFileTypesTrue\n ? Set\n : O extends GWOFileTypesFalse\n ? Set\n : O extends GWOFileTypesUnset\n ? Set\n : Set\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.matches = new Set() as Matches\n }\n\n matchEmit(e: Result): void\n matchEmit(e: Path | string): void {\n this.matches.add(e)\n }\n\n async walk(): Promise> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Matches {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil {\n results: O extends GWOFileTypesTrue\n ? Minipass\n : O extends GWOFileTypesFalse\n ? Minipass\n : O extends GWOFileTypesUnset\n ? Minipass\n : Minipass\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass({\n signal: this.signal,\n objectMode: true,\n }) as MatchStream\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void\n matchEmit(e: Path | string): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,uCAAmC;AAEnC,2CAAgD;AAQhD,iDAA0C;AA0D1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,CACd,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,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CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;QACvB,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AAvCD,gCAuCC","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n O extends GWOFileTypesTrue ? Path\n : O extends GWOFileTypesFalse ? string\n : O extends GWOFileTypesUnset ? string\n : Path | string\n\nexport type Matches =\n O extends GWOFileTypesTrue ? Set\n : O extends GWOFileTypesFalse ? Set\n : O extends GWOFileTypesUnset ? Set\n : Set\n\nexport type MatchStream = Minipass<\n Result,\n Result\n>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts,\n): IgnoreLike =>\n typeof ignore === 'string' ? new Ignore([ignore], opts)\n : Array.isArray(ignore) ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n includeChildMatches: boolean\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n this.includeChildMatches = opts.includeChildMatches !== false\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n if (\n !this.includeChildMatches &&\n typeof this.#ignore.add !== 'function'\n ) {\n const m = 'cannot ignore child matches, ignore lacks add() method.'\n throw new Error(m)\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return (\n e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ) ?\n e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`\n this.#ignore.add(ign)\n }\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true,\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb),\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n matches = new Set>()\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n }\n\n matchEmit(e: Result): void {\n this.matches.add(e)\n }\n\n async walk(): Promise>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Set> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n results: Minipass, Result>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass, Result>({\n signal: this.signal,\n objectMode: true,\n })\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/bin.mjs b/deps/npm/node_modules/glob/dist/esm/bin.mjs index 9d57d4a943b26b..4bf17c5efd61c0 100755 --- a/deps/npm/node_modules/glob/dist/esm/bin.mjs +++ b/deps/npm/node_modules/glob/dist/esm/bin.mjs @@ -185,7 +185,7 @@ const j = jack({ description: `Defaults to the value of 'process.platform' if available, or 'linux' if not. Setting --platform=win32 on non-Windows systems may cause strange behavior!`, - validate: v => new Set([ + validOptions: [ 'aix', 'android', 'darwin', @@ -197,7 +197,7 @@ const j = jack({ 'win32', 'cygwin', 'netbsd', - ]).has(v), + ], }, }) .optList({ @@ -229,11 +229,9 @@ try { throw 'No patterns provided'; if (positionals.length === 0 && values.default) positionals.push(values.default); - const patterns = values.all - ? positionals - : positionals.filter(p => !existsSync(p)); - const matches = values.all - ? [] + const patterns = values.all ? positionals : positionals.filter(p => !existsSync(p)); + const matches = values.all ? + [] : positionals.filter(p => existsSync(p)).map(p => join(p)); const stream = globStream(patterns, { absolute: values.absolute, diff --git a/deps/npm/node_modules/glob/dist/esm/bin.mjs.map b/deps/npm/node_modules/glob/dist/esm/bin.mjs.map index bcf08f762f710c..27ac9d396dd01b 100644 --- a/deps/npm/node_modules/glob/dist/esm/bin.mjs.map +++ b/deps/npm/node_modules/glob/dist/esm/bin.mjs.map @@ -1 +1 @@ -{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,qBAAqB;AACrB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAC5B,MAAM,QAAQ,CACZ,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC7D,MAAM,CACP,CAAC,KAAK,CAAC,GAAG,EAAE,CACX,QAAQ,CACN,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;CAChB","sourcesContent":["#!/usr/bin/env node\nimport { foregroundChild } from 'foreground-child'\nimport { existsSync } from 'fs'\nimport { readFile } from 'fs/promises'\nimport { jack } from 'jackspeak'\nimport { join } from 'path'\nimport { fileURLToPath } from 'url'\nimport { globStream } from './index.js'\n\n/* c8 ignore start */\nconst { version } = JSON.parse(\n await readFile(\n fileURLToPath(new URL('../../package.json', import.meta.url)),\n 'utf8'\n ).catch(() =>\n readFile(\n fileURLToPath(new URL('../../package.json', import.meta.url)),\n 'utf8'\n )\n )\n) as { version: string }\n/* c8 ignore stop */\n\nconst j = jack({\n usage: 'glob [options] [ [ ...]]',\n})\n .description(\n `\n Glob v${version}\n\n Expand the positional glob expression arguments into any matching file\n system paths found.\n `\n )\n .opt({\n cmd: {\n short: 'c',\n hint: 'command',\n description: `Run the command provided, passing the glob expression\n matches as arguments.`,\n },\n })\n .opt({\n default: {\n short: 'p',\n hint: 'pattern',\n description: `If no positional arguments are provided, glob will use\n this pattern`,\n },\n })\n .flag({\n all: {\n short: 'A',\n description: `By default, the glob cli command will not expand any\n arguments that are an exact match to a file on disk.\n\n This prevents double-expanding, in case the shell expands\n an argument whose filename is a glob expression.\n\n For example, if 'app/*.ts' would match 'app/[id].ts', then\n on Windows powershell or cmd.exe, 'glob app/*.ts' will\n expand to 'app/[id].ts', as expected. However, in posix\n shells such as bash or zsh, the shell will first expand\n 'app/*.ts' to a list of filenames. Then glob will look\n for a file matching 'app/[id].ts' (ie, 'app/i.ts' or\n 'app/d.ts'), which is unexpected.\n\n Setting '--all' prevents this behavior, causing glob\n to treat ALL patterns as glob expressions to be expanded,\n even if they are an exact match to a file on disk.\n\n When setting this option, be sure to enquote arguments\n so that the shell will not expand them prior to passing\n them to the glob command process.\n `,\n },\n absolute: {\n short: 'a',\n description: 'Expand to absolute paths',\n },\n 'dot-relative': {\n short: 'd',\n description: `Prepend './' on relative matches`,\n },\n mark: {\n short: 'm',\n description: `Append a / on any directories matched`,\n },\n posix: {\n short: 'x',\n description: `Always resolve to posix style paths, using '/' as the\n directory separator, even on Windows. Drive letter\n absolute matches on Windows will be expanded to their\n full resolved UNC maths, eg instead of 'C:\\\\foo\\\\bar',\n it will expand to '//?/C:/foo/bar'.\n `,\n },\n\n follow: {\n short: 'f',\n description: `Follow symlinked directories when expanding '**'`,\n },\n realpath: {\n short: 'R',\n description: `Call 'fs.realpath' on all of the results. In the case\n of an entry that cannot be resolved, the entry is\n omitted. This incurs a slight performance penalty, of\n course, because of the added system calls.`,\n },\n stat: {\n short: 's',\n description: `Call 'fs.lstat' on all entries, whether required or not\n to determine if it's a valid match.`,\n },\n 'match-base': {\n short: 'b',\n description: `Perform a basename-only match if the pattern does not\n contain any slash characters. That is, '*.js' would be\n treated as equivalent to '**/*.js', matching js files\n in all directories.\n `,\n },\n\n dot: {\n description: `Allow patterns to match files/directories that start\n with '.', even if the pattern does not start with '.'\n `,\n },\n nobrace: {\n description: 'Do not expand {...} patterns',\n },\n nocase: {\n description: `Perform a case-insensitive match. This defaults to\n 'true' on macOS and Windows platforms, and false on\n all others.\n\n Note: 'nocase' should only be explicitly set when it is\n known that the filesystem's case sensitivity differs\n from the platform default. If set 'true' on\n case-insensitive file systems, then the walk may return\n more or less results than expected.\n `,\n },\n nodir: {\n description: `Do not match directories, only files.\n\n Note: to *only* match directories, append a '/' at the\n end of the pattern.\n `,\n },\n noext: {\n description: `Do not expand extglob patterns, such as '+(a|b)'`,\n },\n noglobstar: {\n description: `Do not expand '**' against multiple path portions.\n Ie, treat it as a normal '*' instead.`,\n },\n 'windows-path-no-escape': {\n description: `Use '\\\\' as a path separator *only*, and *never* as an\n escape character. If set, all '\\\\' characters are\n replaced with '/' in the pattern.`,\n },\n })\n .num({\n 'max-depth': {\n short: 'D',\n description: `Maximum depth to traverse from the current\n working directory`,\n },\n })\n .opt({\n cwd: {\n short: 'C',\n description: 'Current working directory to execute/match in',\n default: process.cwd(),\n },\n root: {\n short: 'r',\n description: `A string path resolved against the 'cwd', which is\n used as the starting point for absolute patterns that\n start with '/' (but not drive letters or UNC paths\n on Windows).\n\n Note that this *doesn't* necessarily limit the walk to\n the 'root' directory, and doesn't affect the cwd\n starting point for non-absolute patterns. A pattern\n containing '..' will still be able to traverse out of\n the root directory, if it is not an actual root directory\n on the filesystem, and any non-absolute patterns will\n still be matched in the 'cwd'.\n\n To start absolute and non-absolute patterns in the same\n path, you can use '--root=' to set it to the empty\n string. However, be aware that on Windows systems, a\n pattern like 'x:/*' or '//host/share/*' will *always*\n start in the 'x:/' or '//host/share/' directory,\n regardless of the --root setting.\n `,\n },\n platform: {\n description: `Defaults to the value of 'process.platform' if\n available, or 'linux' if not. Setting --platform=win32\n on non-Windows systems may cause strange behavior!`,\n validate: v =>\n new Set([\n 'aix',\n 'android',\n 'darwin',\n 'freebsd',\n 'haiku',\n 'linux',\n 'openbsd',\n 'sunos',\n 'win32',\n 'cygwin',\n 'netbsd',\n ]).has(v),\n },\n })\n .optList({\n ignore: {\n short: 'i',\n description: `Glob patterns to ignore`,\n },\n })\n .flag({\n debug: {\n short: 'v',\n description: `Output a huge amount of noisy debug information about\n patterns as they are parsed and used to match files.`,\n },\n })\n .flag({\n help: {\n short: 'h',\n description: 'Show this usage information',\n },\n })\n\ntry {\n const { positionals, values } = j.parse()\n if (values.help) {\n console.log(j.usage())\n process.exit(0)\n }\n if (positionals.length === 0 && !values.default)\n throw 'No patterns provided'\n if (positionals.length === 0 && values.default)\n positionals.push(values.default)\n const patterns = values.all\n ? positionals\n : positionals.filter(p => !existsSync(p))\n const matches = values.all\n ? []\n : positionals.filter(p => existsSync(p)).map(p => join(p))\n const stream = globStream(patterns, {\n absolute: values.absolute,\n cwd: values.cwd,\n dot: values.dot,\n dotRelative: values['dot-relative'],\n follow: values.follow,\n ignore: values.ignore,\n mark: values.mark,\n matchBase: values['match-base'],\n maxDepth: values['max-depth'],\n nobrace: values.nobrace,\n nocase: values.nocase,\n nodir: values.nodir,\n noext: values.noext,\n noglobstar: values.noglobstar,\n platform: values.platform as undefined | NodeJS.Platform,\n realpath: values.realpath,\n root: values.root,\n stat: values.stat,\n debug: values.debug,\n posix: values.posix,\n })\n\n const cmd = values.cmd\n if (!cmd) {\n matches.forEach(m => console.log(m))\n stream.on('data', f => console.log(f))\n } else {\n stream.on('data', f => matches.push(f))\n stream.on('end', () => foregroundChild(cmd, matches, { shell: true }))\n }\n} catch (e) {\n console.error(j.usage())\n console.error(e instanceof Error ? e.message : String(e))\n process.exit(1)\n}\n"]} \ No newline at end of file +{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,qBAAqB;AACrB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAC5B,MAAM,QAAQ,CACZ,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC7D,MAAM,CACP,CAAC,KAAK,CAAC,GAAG,EAAE,CACX,QAAQ,CACN,aAAa,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC7D,MAAM,CACP,CACF,CACqB,CAAA;AACxB,oBAAoB;AAEpB,MAAM,CAAC,GAAG,IAAI,CAAC;IACb,KAAK,EAAE,4CAA4C;CACpD,CAAC;KACC,WAAW,CACV;YACQ,OAAO;;;;G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;QACzB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA;IACtB,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACpC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACxC,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACxE,CAAC;AACH,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;IACxB,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { foregroundChild } from 'foreground-child'\nimport { existsSync } from 'fs'\nimport { readFile } from 'fs/promises'\nimport { jack } from 'jackspeak'\nimport { join } from 'path'\nimport { fileURLToPath } from 'url'\nimport { globStream } from './index.js'\n\n/* c8 ignore start */\nconst { version } = JSON.parse(\n await readFile(\n fileURLToPath(new URL('../../package.json', import.meta.url)),\n 'utf8',\n ).catch(() =>\n readFile(\n fileURLToPath(new URL('../../package.json', import.meta.url)),\n 'utf8',\n ),\n ),\n) as { version: string }\n/* c8 ignore stop */\n\nconst j = jack({\n usage: 'glob [options] [ [ ...]]',\n})\n .description(\n `\n Glob v${version}\n\n Expand the positional glob expression arguments into any matching file\n system paths found.\n `,\n )\n .opt({\n cmd: {\n short: 'c',\n hint: 'command',\n description: `Run the command provided, passing the glob expression\n matches as arguments.`,\n },\n })\n .opt({\n default: {\n short: 'p',\n hint: 'pattern',\n description: `If no positional arguments are provided, glob will use\n this pattern`,\n },\n })\n .flag({\n all: {\n short: 'A',\n description: `By default, the glob cli command will not expand any\n arguments that are an exact match to a file on disk.\n\n This prevents double-expanding, in case the shell expands\n an argument whose filename is a glob expression.\n\n For example, if 'app/*.ts' would match 'app/[id].ts', then\n on Windows powershell or cmd.exe, 'glob app/*.ts' will\n expand to 'app/[id].ts', as expected. However, in posix\n shells such as bash or zsh, the shell will first expand\n 'app/*.ts' to a list of filenames. Then glob will look\n for a file matching 'app/[id].ts' (ie, 'app/i.ts' or\n 'app/d.ts'), which is unexpected.\n\n Setting '--all' prevents this behavior, causing glob\n to treat ALL patterns as glob expressions to be expanded,\n even if they are an exact match to a file on disk.\n\n When setting this option, be sure to enquote arguments\n so that the shell will not expand them prior to passing\n them to the glob command process.\n `,\n },\n absolute: {\n short: 'a',\n description: 'Expand to absolute paths',\n },\n 'dot-relative': {\n short: 'd',\n description: `Prepend './' on relative matches`,\n },\n mark: {\n short: 'm',\n description: `Append a / on any directories matched`,\n },\n posix: {\n short: 'x',\n description: `Always resolve to posix style paths, using '/' as the\n directory separator, even on Windows. Drive letter\n absolute matches on Windows will be expanded to their\n full resolved UNC maths, eg instead of 'C:\\\\foo\\\\bar',\n it will expand to '//?/C:/foo/bar'.\n `,\n },\n\n follow: {\n short: 'f',\n description: `Follow symlinked directories when expanding '**'`,\n },\n realpath: {\n short: 'R',\n description: `Call 'fs.realpath' on all of the results. In the case\n of an entry that cannot be resolved, the entry is\n omitted. This incurs a slight performance penalty, of\n course, because of the added system calls.`,\n },\n stat: {\n short: 's',\n description: `Call 'fs.lstat' on all entries, whether required or not\n to determine if it's a valid match.`,\n },\n 'match-base': {\n short: 'b',\n description: `Perform a basename-only match if the pattern does not\n contain any slash characters. That is, '*.js' would be\n treated as equivalent to '**/*.js', matching js files\n in all directories.\n `,\n },\n\n dot: {\n description: `Allow patterns to match files/directories that start\n with '.', even if the pattern does not start with '.'\n `,\n },\n nobrace: {\n description: 'Do not expand {...} patterns',\n },\n nocase: {\n description: `Perform a case-insensitive match. This defaults to\n 'true' on macOS and Windows platforms, and false on\n all others.\n\n Note: 'nocase' should only be explicitly set when it is\n known that the filesystem's case sensitivity differs\n from the platform default. If set 'true' on\n case-insensitive file systems, then the walk may return\n more or less results than expected.\n `,\n },\n nodir: {\n description: `Do not match directories, only files.\n\n Note: to *only* match directories, append a '/' at the\n end of the pattern.\n `,\n },\n noext: {\n description: `Do not expand extglob patterns, such as '+(a|b)'`,\n },\n noglobstar: {\n description: `Do not expand '**' against multiple path portions.\n Ie, treat it as a normal '*' instead.`,\n },\n 'windows-path-no-escape': {\n description: `Use '\\\\' as a path separator *only*, and *never* as an\n escape character. If set, all '\\\\' characters are\n replaced with '/' in the pattern.`,\n },\n })\n .num({\n 'max-depth': {\n short: 'D',\n description: `Maximum depth to traverse from the current\n working directory`,\n },\n })\n .opt({\n cwd: {\n short: 'C',\n description: 'Current working directory to execute/match in',\n default: process.cwd(),\n },\n root: {\n short: 'r',\n description: `A string path resolved against the 'cwd', which is\n used as the starting point for absolute patterns that\n start with '/' (but not drive letters or UNC paths\n on Windows).\n\n Note that this *doesn't* necessarily limit the walk to\n the 'root' directory, and doesn't affect the cwd\n starting point for non-absolute patterns. A pattern\n containing '..' will still be able to traverse out of\n the root directory, if it is not an actual root directory\n on the filesystem, and any non-absolute patterns will\n still be matched in the 'cwd'.\n\n To start absolute and non-absolute patterns in the same\n path, you can use '--root=' to set it to the empty\n string. However, be aware that on Windows systems, a\n pattern like 'x:/*' or '//host/share/*' will *always*\n start in the 'x:/' or '//host/share/' directory,\n regardless of the --root setting.\n `,\n },\n platform: {\n description: `Defaults to the value of 'process.platform' if\n available, or 'linux' if not. Setting --platform=win32\n on non-Windows systems may cause strange behavior!`,\n validOptions: [\n 'aix',\n 'android',\n 'darwin',\n 'freebsd',\n 'haiku',\n 'linux',\n 'openbsd',\n 'sunos',\n 'win32',\n 'cygwin',\n 'netbsd',\n ],\n },\n })\n .optList({\n ignore: {\n short: 'i',\n description: `Glob patterns to ignore`,\n },\n })\n .flag({\n debug: {\n short: 'v',\n description: `Output a huge amount of noisy debug information about\n patterns as they are parsed and used to match files.`,\n },\n })\n .flag({\n help: {\n short: 'h',\n description: 'Show this usage information',\n },\n })\n\ntry {\n const { positionals, values } = j.parse()\n if (values.help) {\n console.log(j.usage())\n process.exit(0)\n }\n if (positionals.length === 0 && !values.default)\n throw 'No patterns provided'\n if (positionals.length === 0 && values.default)\n positionals.push(values.default)\n const patterns =\n values.all ? positionals : positionals.filter(p => !existsSync(p))\n const matches =\n values.all ?\n []\n : positionals.filter(p => existsSync(p)).map(p => join(p))\n const stream = globStream(patterns, {\n absolute: values.absolute,\n cwd: values.cwd,\n dot: values.dot,\n dotRelative: values['dot-relative'],\n follow: values.follow,\n ignore: values.ignore,\n mark: values.mark,\n matchBase: values['match-base'],\n maxDepth: values['max-depth'],\n nobrace: values.nobrace,\n nocase: values.nocase,\n nodir: values.nodir,\n noext: values.noext,\n noglobstar: values.noglobstar,\n platform: values.platform as undefined | NodeJS.Platform,\n realpath: values.realpath,\n root: values.root,\n stat: values.stat,\n debug: values.debug,\n posix: values.posix,\n })\n\n const cmd = values.cmd\n if (!cmd) {\n matches.forEach(m => console.log(m))\n stream.on('data', f => console.log(f))\n } else {\n stream.on('data', f => matches.push(f))\n stream.on('end', () => foregroundChild(cmd, matches, { shell: true }))\n }\n} catch (e) {\n console.error(j.usage())\n console.error(e instanceof Error ? e.message : String(e))\n process.exit(1)\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/glob.d.ts b/deps/npm/node_modules/glob/dist/esm/glob.d.ts index 55674de4490de9..457d5676cce57e 100644 --- a/deps/npm/node_modules/glob/dist/esm/glob.d.ts +++ b/deps/npm/node_modules/glob/dist/esm/glob.d.ts @@ -247,6 +247,50 @@ export interface GlobOptions { * `'//?/C:/foo/bar'` */ posix?: boolean; + /** + * Do not match any children of any matches. For example, the pattern + * `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode. + * + * This is especially useful for cases like "find all `node_modules` + * folders, but not the ones in `node_modules`". + * + * In order to support this, the `Ignore` implementation must support an + * `add(pattern: string)` method. If using the default `Ignore` class, then + * this is fine, but if this is set to `false`, and a custom `Ignore` is + * provided that does not have an `add()` method, then it will throw an + * error. + * + * **Caveat** It *only* ignores matches that would be a descendant of a + * previous match, and only if that descendant is matched *after* the + * ancestor is encountered. Since the file system walk happens in + * indeterminate order, it's possible that a match will already be added + * before its ancestor, if multiple or braced patterns are used. + * + * For example: + * + * ```ts + * const results = await glob([ + * // likely to match first, since it's just a stat + * 'a/b/c/d/e/f', + * + * // this pattern is more complicated! It must to various readdir() + * // calls and test the results against a regular expression, and that + * // is certainly going to take a little bit longer. + * // + * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too + * // late to ignore a/b/c/d/e/f, because it's already been emitted. + * 'a/[bdf]/?/[a-z]/*', + * ], { includeChildMatches: false }) + * ``` + * + * It's best to only set this to `false` if you can be reasonably sure that + * no components of the pattern will potentially match one another's file + * system descendants, or if the occasional included child entry will not + * cause problems. + * + * @default true + */ + includeChildMatches?: boolean; } export type GlobOptionsWithFileTypesTrue = GlobOptions & { withFileTypes: true; @@ -291,6 +335,7 @@ export declare class Glob implements GlobOptions { signal?: AbortSignal; windowsPathsNoEscape: boolean; withFileTypes: FileTypes; + includeChildMatches: boolean; /** * The options provided to the constructor. */ diff --git a/deps/npm/node_modules/glob/dist/esm/glob.d.ts.map b/deps/npm/node_modules/glob/dist/esm/glob.d.ts.map index 5216438a25086b..3ec673a5faef93 100644 --- a/deps/npm/node_modules/glob/dist/esm/glob.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/glob.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAWlE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IAEvC;;;;;OA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,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,mBAAmB,EAAE,OAAO,CAAA;IAE5B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IAEV;;OAEG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;IAEnB;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI;IA2HlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAoBpC;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBzB;;OAEG;IACH,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAc9C;;OAEG;IACH,UAAU,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAclD;;;OAGG;IACH,WAAW,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGlD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAIjB;;;OAGG;IACH,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC;IAGnD,CAAC,MAAM,CAAC,aAAa,CAAC;CAGvB"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/glob.js b/deps/npm/node_modules/glob/dist/esm/glob.js index 0b9384e19f88f2..c9ff3b0036d945 100644 --- a/deps/npm/node_modules/glob/dist/esm/glob.js +++ b/deps/npm/node_modules/glob/dist/esm/glob.js @@ -1,14 +1,14 @@ import { Minimatch } from 'minimatch'; -import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; import { fileURLToPath } from 'node:url'; +import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; import { Pattern } from './pattern.js'; import { GlobStream, GlobWalker } from './walker.js'; // if no process global, just call it linux. // so we default to case-sensitive, / separators -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * An object that can perform glob pattern traversals. @@ -38,6 +38,7 @@ export class Glob { signal; windowsPathsNoEscape; withFileTypes; + includeChildMatches; /** * The options provided to the constructor. */ @@ -83,6 +84,7 @@ export class Glob { this.noext = !!opts.noext; this.realpath = !!opts.realpath; this.absolute = opts.absolute; + this.includeChildMatches = opts.includeChildMatches !== false; this.noglobstar = !!opts.noglobstar; this.matchBase = !!opts.matchBase; this.maxDepth = @@ -97,7 +99,8 @@ export class Glob { } this.windowsPathsNoEscape = !!opts.windowsPathsNoEscape || - opts.allowWindowsEscape === false; + opts.allowWindowsEscape === + false; if (this.windowsPathsNoEscape) { pattern = pattern.map(p => p.replace(/\\/g, '/')); } @@ -118,12 +121,9 @@ export class Glob { } } else { - const Scurry = opts.platform === 'win32' - ? PathScurryWin32 - : opts.platform === 'darwin' - ? PathScurryDarwin - : opts.platform - ? PathScurryPosix + const Scurry = opts.platform === 'win32' ? PathScurryWin32 + : opts.platform === 'darwin' ? PathScurryDarwin + : opts.platform ? PathScurryPosix : PathScurry; this.scurry = new Scurry(this.cwd, { nocase: opts.nocase, @@ -175,11 +175,12 @@ export class Glob { return [ ...(await new GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walk()), ]; } @@ -187,32 +188,35 @@ export class Glob { return [ ...new GlobWalker(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).walkSync(), ]; } stream() { return new GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).stream(); } streamSync() { return new GlobStream(this.patterns, this.scurry.cwd, { ...this.opts, - maxDepth: this.maxDepth !== Infinity - ? this.maxDepth + this.scurry.cwd.depth() + maxDepth: this.maxDepth !== Infinity ? + this.maxDepth + this.scurry.cwd.depth() : Infinity, platform: this.platform, nocase: this.nocase, + includeChildMatches: this.includeChildMatches, }).streamSync(); } /** diff --git a/deps/npm/node_modules/glob/dist/esm/glob.js.map b/deps/npm/node_modules/glob/dist/esm/glob.js.map index 55c095ce096dc2..a62c3239827814 100644 --- a/deps/npm/node_modules/glob/dist/esm/glob.js.map +++ b/deps/npm/node_modules/glob/dist/esm/glob.js.map @@ -1 +1 @@ -{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAGL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,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AC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { fileURLToPath } from 'node:url'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ? process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignore` and `ignoreChildren`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result = Opts extends GlobOptionsWithFileTypesTrue\n ? Path\n : Opts extends GlobOptionsWithFileTypesFalse\n ? string\n : Opts extends GlobOptionsWithFileTypesUnset\n ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes = Opts extends GlobOptionsWithFileTypesTrue\n ? true\n : Opts extends GlobOptionsWithFileTypesFalse\n ? false\n : Opts extends GlobOptionsWithFileTypesUnset\n ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as GlobOptions).allowWindowsEscape === false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32'\n ? PathScurryWin32\n : opts.platform === 'darwin'\n ? PathScurryDarwin\n : opts.platform\n ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []]\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity\n ? this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAGL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,C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,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,MAAM,EAAE,CAAA;IACb,CAAC;IAMD,UAAU;QACR,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACpD,GAAG,IAAI,CAAC,IAAI;YACZ,QAAQ,EACN,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;gBACzC,CAAC,CAAC,QAAQ;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignore` and `ignoreChildren`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results = Result[]\n\nexport type FileTypes =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass, Result>\n stream(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass, Result>\n streamSync(): Minipass {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/has-magic.js.map b/deps/npm/node_modules/glob/dist/esm/has-magic.js.map index 27fd78dbae62cf..a20f5aa2e0fdb5 100644 --- a/deps/npm/node_modules/glob/dist/esm/has-magic.js.map +++ b/deps/npm/node_modules/glob/dist/esm/has-magic.js.map @@ -1 +1 @@ -{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAGrC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;KACpB;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;KACtD;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {}\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file +{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAGrC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/ignore.d.ts b/deps/npm/node_modules/glob/dist/esm/ignore.d.ts index e9d74f3b5e1291..085319e9dd6c93 100644 --- a/deps/npm/node_modules/glob/dist/esm/ignore.d.ts +++ b/deps/npm/node_modules/glob/dist/esm/ignore.d.ts @@ -1,9 +1,11 @@ -import { Minimatch } from 'minimatch'; +/// +import { Minimatch, MinimatchOptions } from 'minimatch'; import { Path } from 'path-scurry'; import { GlobWalkerOpts } from './walker.js'; export interface IgnoreLike { ignored?: (p: Path) => boolean; childrenIgnored?: (p: Path) => boolean; + add?: (ignore: string) => void; } /** * Class used to process ignored patterns @@ -13,7 +15,10 @@ export declare class Ignore implements IgnoreLike { relativeChildren: Minimatch[]; absolute: Minimatch[]; absoluteChildren: Minimatch[]; + platform: NodeJS.Platform; + mmopts: MinimatchOptions; constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts); + add(ign: string): void; ignored(p: Path): boolean; childrenIgnored(p: Path): boolean; } diff --git a/deps/npm/node_modules/glob/dist/esm/ignore.d.ts.map b/deps/npm/node_modules/glob/dist/esm/ignore.d.ts.map index 21ab57b94d1a76..82a7ac2a306184 100644 --- a/deps/npm/node_modules/glob/dist/esm/ignore.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/ignore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;CACvC;AASD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;gBAG3B,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IA4DnB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"} \ No newline at end of file +{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;IACzB,MAAM,EAAE,gBAAgB,CAAA;gBAGtB,OAAO,EAAE,MAAM,EAAE,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAA0B,GAC3B,EAAE,cAAc;IAqBnB,GAAG,CAAC,GAAG,EAAE,MAAM;IAyCf,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;IAczB,eAAe,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO;CAWlC"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/ignore.js b/deps/npm/node_modules/glob/dist/esm/ignore.js index 2b2808d0dfe0f1..539c4a4fdebc4b 100644 --- a/deps/npm/node_modules/glob/dist/esm/ignore.js +++ b/deps/npm/node_modules/glob/dist/esm/ignore.js @@ -4,10 +4,10 @@ // Ignores are always parsed in dot:true mode import { Minimatch } from 'minimatch'; import { Pattern } from './pattern.js'; -const defaultPlatform = typeof process === 'object' && +const defaultPlatform = (typeof process === 'object' && process && - typeof process.platform === 'string' - ? process.platform + typeof process.platform === 'string') ? + process.platform : 'linux'; /** * Class used to process ignored patterns @@ -17,12 +17,15 @@ export class Ignore { relativeChildren; absolute; absoluteChildren; + platform; + mmopts; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; - const mmopts = { + this.platform = platform; + this.mmopts = { dot: true, nobrace, nocase, @@ -33,6 +36,10 @@ export class Ignore { nocomment: true, nonegate: true, }; + for (const ign of ignored) + this.add(ign); + } + add(ign) { // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at @@ -45,36 +52,34 @@ export class Ignore { // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. - for (const ign of ignored) { - const mm = new Minimatch(ign, mmopts); - for (let i = 0; i < mm.set.length; i++) { - const parsed = mm.set[i]; - const globParts = mm.globParts[i]; - /* c8 ignore start */ - if (!parsed || !globParts) { - throw new Error('invalid pattern object'); - } - // strip off leading ./ portions - // https://github.com/isaacs/node-glob/issues/570 - while (parsed[0] === '.' && globParts[0] === '.') { - parsed.shift(); - globParts.shift(); - } - /* c8 ignore stop */ - const p = new Pattern(parsed, globParts, 0, platform); - const m = new Minimatch(p.globString(), mmopts); - const children = globParts[globParts.length - 1] === '**'; - const absolute = p.isAbsolute(); + const mm = new Minimatch(ign, this.mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + /* c8 ignore start */ + if (!parsed || !globParts) { + throw new Error('invalid pattern object'); + } + // strip off leading ./ portions + // https://github.com/isaacs/node-glob/issues/570 + while (parsed[0] === '.' && globParts[0] === '.') { + parsed.shift(); + globParts.shift(); + } + /* c8 ignore stop */ + const p = new Pattern(parsed, globParts, 0, this.platform); + const m = new Minimatch(p.globString(), this.mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { if (absolute) - this.absolute.push(m); + this.absoluteChildren.push(m); else - this.relative.push(m); - if (children) { - if (absolute) - this.absoluteChildren.push(m); - else - this.relativeChildren.push(m); - } + this.relativeChildren.push(m); } } } diff --git a/deps/npm/node_modules/glob/dist/esm/ignore.js.map b/deps/npm/node_modules/glob/dist/esm/ignore.js.map index baa7eb2efa01df..2cddba2ecfe9f6 100644 --- a/deps/npm/node_modules/glob/dist/esm/ignore.js.map +++ b/deps/npm/node_modules/glob/dist/esm/ignore.js.map @@ -1 +1 @@ -{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAQtC,MAAM,eAAe,GACnB,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;IAClC,CAAC,CAAC,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAEb;;GAEG;AACH,MAAM,OAAO,MAAM;IACjB,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAC7B,QAAQ,CAAa;IACrB,gBAAgB,CAAa;IAE7B,YACE,OAAiB,EACjB,EACE,OAAO,EACP,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAAQ,GAAG,eAAe,GACX;QAEjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;QAClB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,MAAM,MAAM,GAAG;YACb,GAAG,EAAE,I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GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACrC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;SACnC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACrC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;SACnC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n}\n\nconst defaultPlatform: NodeJS.Platform =\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ? process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n const mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n for (const ign of ignored) {\n const mm = new Minimatch(ign, mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, platform)\n const m = new Minimatch(p.globString(), mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;AAE7C,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,OAAO,EA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AAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n platform: NodeJS.Platform\n mmopts: MinimatchOptions\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts,\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n this.platform = platform\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n for (const ign of ignored) this.add(ign)\n }\n\n add(ign: string) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new Minimatch(ign, this.mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, this.platform)\n const m = new Minimatch(p.globString(), this.mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/index.d.ts b/deps/npm/node_modules/glob/dist/esm/index.d.ts index 048e584715b772..693ba2ab8e6275 100644 --- a/deps/npm/node_modules/glob/dist/esm/index.d.ts +++ b/deps/npm/node_modules/glob/dist/esm/index.d.ts @@ -2,6 +2,14 @@ import { Minipass } from 'minipass'; import { Path } from 'path-scurry'; import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js'; import { Glob } from './glob.js'; +export { escape, unescape } from 'minimatch'; +export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry'; +export { Glob } from './glob.js'; +export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; +export type { IgnoreLike } from './ignore.js'; +export type { MatchStream } from './walker.js'; /** * Syncronous form of {@link globStream}. Will read all the matches as fast as * you consume them, even all in a single tick if you consume them immediately, @@ -62,13 +70,6 @@ export declare const sync: typeof globSync & { stream: typeof globStreamSync; iterate: typeof globIterateSync; }; -export { escape, unescape } from 'minimatch'; -export { Glob } from './glob.js'; -export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js'; -export { hasMagic } from './has-magic.js'; -export type { IgnoreLike } from './ignore.js'; -export type { MatchStream } from './walker.js'; -export type { Path, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, WalkOptions, FSOption, } from 'path-scurry'; export declare const glob: typeof glob_ & { glob: typeof glob_; globSync: typeof globSync; diff --git a/deps/npm/node_modules/glob/dist/esm/index.d.ts.map b/deps/npm/node_modules/glob/dist/esm/index.d.ts.map index 3e263fb5e2dbed..5fb32252b63747 100644 --- a/deps/npm/node_modules/glob/dist/esm/index.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC;;;;GAIG;AACH,wBAAgB,cAAc,CA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,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,GACnB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/index.js b/deps/npm/node_modules/glob/dist/esm/index.js index 7b270117e740ad..e15c1f9c4cb032 100644 --- a/deps/npm/node_modules/glob/dist/esm/index.js +++ b/deps/npm/node_modules/glob/dist/esm/index.js @@ -1,6 +1,10 @@ import { escape, unescape } from 'minimatch'; import { Glob } from './glob.js'; import { hasMagic } from './has-magic.js'; +export { escape, unescape } from 'minimatch'; +export { Glob } from './glob.js'; +export { hasMagic } from './has-magic.js'; +export { Ignore } from './ignore.js'; export function globStreamSync(pattern, options = {}) { return new Glob(pattern, options).streamSync(); } @@ -30,11 +34,6 @@ export const sync = Object.assign(globSync, { stream: globStreamSync, iterate: globIterateSync, }); -/* c8 ignore start */ -export { escape, unescape } from 'minimatch'; -export { Glob } from './glob.js'; -export { hasMagic } from './has-magic.js'; -/* c8 ignore stop */ export const glob = Object.assign(glob_, { glob: glob_, globSync, diff --git a/deps/npm/node_modules/glob/dist/esm/index.js.map b/deps/npm/node_modules/glob/dist/esm/index.js.map index d857e6b0f2d2ab..a4f93dd0c1d87d 100644 --- a/deps/npm/node_modules/glob/dist/esm/index.js.map +++ b/deps/npm/node_modules/glob/dist/esm/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAS5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAuBzC,MAAM,UAAU,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AAsBD,MAAM,UAAU,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AAqBD,MAAM,UAAU,QAAQ,CACtB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC9C,CAAC;AAwBD,KAAK,UAAU,KAAK,CAClB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AAC1C,CAAC;AAqBD,MAAM,UAAU,eAAe,CAC7B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;AACjD,CAAC;AAqBD,MAAM,UAAU,WAAW,CACzB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAA;AAC7C,CAAC;AAED,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAA;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAA;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IAChD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC1C,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAA;AAEF,qBAAqB;AACrB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAOhC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,oBAAoB;AAEpB,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,KAAK;IACX,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,MAAM;IACN,cAAc;IACd,UAAU;IACV,WAAW;IACX,OAAO;IACP,eAAe;IACf,WAAW;IACX,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,QAAQ;CACT,CAAC,CAAA;AACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {}\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\n/* c8 ignore start */\nexport { escape, unescape } from 'minimatch'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\nexport type {\n Path,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n WalkOptions,\n FSOption,\n} from 'path-scurry'\n\n/* c8 ignore stop */\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAS5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAQ5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAOhC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAyBpC,MAAM,UAAU,cAAc,CAC5B,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;AAChD,CAAC;AAsBD,MAAM,UAAU,UAAU,CACxB,OAA0B,EAC1B,UAAuB,EAAE;IAEzB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5C,CAAC;AAqBD,M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IACd,UAAU;IACV,WAAW;IACX,OAAO;IACP,eAAe;IACf,WAAW;IACX,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,QAAQ;CACT,CAAC,CAAA;AACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass | Minipass\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions,\n): Promise\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions,\n): Generator | Generator\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions,\n): AsyncGenerator | AsyncGenerator\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/pattern.d.ts.map b/deps/npm/node_modules/glob/dist/esm/pattern.d.ts.map index 1430a77dadbbe4..39cd0620eb3ebb 100644 --- a/deps/npm/node_modules/glob/dist/esm/pattern.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/pattern.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAA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GnB;;OAEG;IACH,UAAU,IAAI,OAAO;IAGrB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,UAAU,IAAI,MAAM;IAUpB;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,IAAI,IAAI,OAAO,GAAG,IAAI;IAetB;;OAEG;IACH,KAAK,IAAI,OAAO;IAoBhB;;OAEG;IACH,OAAO,IAAI,OAAO;IAelB;;OAEG;IACH,UAAU,IAAI,OAAO;IAUrB;;OAEG;IACH,IAAI,IAAI,MAAM;IASd;;;OAGG;IACH,mBAAmB,IAAI,OAAO;IAQ9B;;OAEG;IACH,kBAAkB,IAAI,OAAO;CAM9B"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/pattern.js b/deps/npm/node_modules/glob/dist/esm/pattern.js index 60aa415d92fd12..b41defa10c6a3a 100644 --- a/deps/npm/node_modules/glob/dist/esm/pattern.js +++ b/deps/npm/node_modules/glob/dist/esm/pattern.js @@ -107,9 +107,9 @@ export class Pattern { globString() { return (this.#globString = this.#globString || - (this.#index === 0 - ? this.isAbsolute() - ? this.#globList[0] + this.#globList.slice(1).join('/') + (this.#index === 0 ? + this.isAbsolute() ? + this.#globList[0] + this.#globList.slice(1).join('/') : this.#globList.join('/') : this.#globList.slice(this.#index).join('/'))); } @@ -138,8 +138,8 @@ export class Pattern { */ isUNC() { const pl = this.#patternList; - return this.#isUNC !== undefined - ? this.#isUNC + return this.#isUNC !== undefined ? + this.#isUNC : (this.#isUNC = this.#platform === 'win32' && this.#index === 0 && @@ -160,8 +160,8 @@ export class Pattern { */ isDrive() { const pl = this.#patternList; - return this.#isDrive !== undefined - ? this.#isDrive + return this.#isDrive !== undefined ? + this.#isDrive : (this.#isDrive = this.#platform === 'win32' && this.#index === 0 && @@ -177,8 +177,8 @@ export class Pattern { */ isAbsolute() { const pl = this.#patternList; - return this.#isAbsolute !== undefined - ? this.#isAbsolute + return this.#isAbsolute !== undefined ? + this.#isAbsolute : (this.#isAbsolute = (pl[0] === '' && pl.length > 1) || this.isDrive() || @@ -189,8 +189,8 @@ export class Pattern { */ root() { const p = this.#patternList[0]; - return typeof p === 'string' && this.isAbsolute() && this.#index === 0 - ? p + return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ? + p : ''; } /** diff --git a/deps/npm/node_modules/glob/dist/esm/pattern.js.map b/deps/npm/node_modules/glob/dist/esm/pattern.js.map index 267a339ee5ab61..566a306ad1bf40 100644 --- a/deps/npm/node_modules/glob/dist/esm/pattern.js.map +++ b/deps/npm/node_modules/glob/dist/esm/pattern.js.map @@ -1 +1 @@ -{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAChB,MAAM,UAAU,GAAG,CAAC,EAAY,EAAkB,EAAE,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,CAAA;AAEnE;;;GAGG;AACH,MAAM,OAAO,OAAO;IACT,YAAY,CAAa;IACzB,SAAS,CAAU;IACnB,MAAM,CAAQ;IACd,MAAM,CAAQ;IACd,SAAS,CAAiB;IACnC,KAAK,CAAiB;IACtB,WAAW,CAAS;IACpB,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,WAAW,CAAU;IACrB,eAAe,GAAY,IAAI,CAAA;IAE/B,YACE,WAAwB,EACxB,QAAkB,EAClB,KAAa,EACb,QAAyB;QAEzB,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;YAC/B,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAA;SAC1C;QACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACzB,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;SACvC;QACD,IAAI,Q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KAAK,QAAQ;oBACzB,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAChC,CAAC;IAED,sCAAsC;IACtC,kDAAkD;IAClD,oDAAoD;IACpD;;OAEG;IACH,UAAU;QACR,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAA;QAC5B,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS;YACnC,CAAC,CAAC,IAAI,CAAC,WAAW;YAClB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW;gBACf,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YACpE,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[]\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0\n ? this.isAbsolute()\n ? this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined\n ? this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined\n ? this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined\n ? this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ? p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,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K,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;oBAC/B,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/processor.d.ts.map b/deps/npm/node_modules/glob/dist/esm/processor.d.ts.map index 33a39b2a8be3bf..aa266fee4a0544 100644 --- a/deps/npm/node_modules/glob/dist/esm/processor.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/processor.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,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EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO;CASvE"} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/processor.js b/deps/npm/node_modules/glob/dist/esm/processor.js index b5b2de2d314ca7..f874892ffed0c4 100644 --- a/deps/npm/node_modules/glob/dist/esm/processor.js +++ b/deps/npm/node_modules/glob/dist/esm/processor.js @@ -97,9 +97,8 @@ export class Processor { this.opts = opts; this.follow = !!opts.follow; this.dot = !!opts.dot; - this.hasWalkedCache = hasWalkedCache - ? hasWalkedCache.copy() - : new HasWalkedCache(); + this.hasWalkedCache = + hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache(); } processPatterns(target, patterns) { this.patterns = patterns; @@ -112,8 +111,8 @@ export class Processor { const absolute = pattern.isAbsolute() && this.opts.absolute !== false; // start absolute patterns at root if (root) { - t = t.resolve(root === '/' && this.opts.root !== undefined - ? this.opts.root + t = t.resolve(root === '/' && this.opts.root !== undefined ? + this.opts.root : root); const rest = pattern.rest(); if (!rest) { diff --git a/deps/npm/node_modules/glob/dist/esm/processor.js.map b/deps/npm/node_modules/glob/dist/esm/processor.js.map index 9e4673a5324637..05a832420b8b2f 100644 --- a/deps/npm/node_modules/glob/dist/esm/processor.js.map +++ b/deps/npm/node_modules/glob/dist/esm/processor.js.map @@ -1 +1 @@ -{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAY,MAAM,WAAW,CAAA;AAK9C;;GAEG;AACH,MAAM,OAAO,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;IACh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CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;SACrC;aAAM;YACL,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;SAC3B;IACH,CAAC;CACF","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>\n constructor(store: Map> = 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 = 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 = 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 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 not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\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"]} \ No newline at end of file +{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAY,MAAM,WAA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C,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU,CACR,CAAO,EACP,CAAW,EACX,IAAoB,EACpB,QAAiB;QAEjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAM;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,UAAU,CAAC,CAAO,EAAE,CAAS,EAAE,IAAoB,EAAE,QAAiB;QACpE,uBAAuB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAM;QACzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF","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>\n constructor(store: Map> = 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 = 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 = 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 =\n hasWalkedCache ? hasWalkedCache.copy() : 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 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 not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\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"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/esm/walker.d.ts b/deps/npm/node_modules/glob/dist/esm/walker.d.ts index dfbaf9b8681a55..fcc7fad29a1ede 100644 --- a/deps/npm/node_modules/glob/dist/esm/walker.d.ts +++ b/deps/npm/node_modules/glob/dist/esm/walker.d.ts @@ -34,6 +34,7 @@ export interface GlobWalkerOpts { signal?: AbortSignal; windowsPathsNoEscape?: boolean; withFileTypes?: boolean; + includeChildMatches?: boolean; } export type GWOFileTypesTrue = GlobWalkerOpts & { withFileTypes: true; @@ -46,7 +47,7 @@ export type GWOFileTypesUnset = GlobWalkerOpts & { }; export type Result = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string; export type Matches = O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; -export type MatchStream = O extends GWOFileTypesTrue ? Minipass : O extends GWOFileTypesFalse ? Minipass : O extends GWOFileTypesUnset ? Minipass : Minipass; +export type MatchStream = Minipass, Result>; /** * basic walking utilities that all the glob walker types use */ @@ -60,6 +61,7 @@ export declare abstract class GlobUtil any): void; } export declare class GlobWalker extends GlobUtil { - matches: O extends GWOFileTypesTrue ? Set : O extends GWOFileTypesFalse ? Set : O extends GWOFileTypesUnset ? Set : Set; + matches: Set>; constructor(patterns: Pattern[], path: Path, opts: O); matchEmit(e: Result): void; - walk(): Promise>; - walkSync(): Matches; + walk(): Promise>>; + walkSync(): Set>; } export declare class GlobStream extends GlobUtil { - results: O extends GWOFileTypesTrue ? Minipass : O extends GWOFileTypesFalse ? Minipass : O extends GWOFileTypesUnset ? Minipass : Minipass; + results: Minipass, Result>; constructor(patterns: Pattern[], path: Path, opts: O); matchEmit(e: Result): void; stream(): MatchStream; diff --git a/deps/npm/node_modules/glob/dist/esm/walker.d.ts.map b/deps/npm/node_modules/glob/dist/esm/walker.d.ts.map index 2cae287c2e1f42..832c35270862b8 100644 --- a/deps/npm/node_modules/glob/dist/esm/walker.d.ts.map +++ b/deps/npm/node_modules/glob/dist/esm/walker.d.ts.map @@ -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,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IAC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deps/npm/node_modules/glob/dist/esm/walker.js b/deps/npm/node_modules/glob/dist/esm/walker.js index b58472e9de4fbc..3d68196c4f175f 100644 --- a/deps/npm/node_modules/glob/dist/esm/walker.js +++ b/deps/npm/node_modules/glob/dist/esm/walker.js @@ -7,10 +7,8 @@ import { Minipass } from 'minipass'; import { Ignore } from './ignore.js'; import { Processor } from './processor.js'; -const makeIgnore = (ignore, opts) => typeof ignore === 'string' - ? new Ignore([ignore], opts) - : Array.isArray(ignore) - ? new Ignore(ignore, opts) +const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts) + : Array.isArray(ignore) ? new Ignore(ignore, opts) : ignore; /** * basic walking utilities that all the glob walker types use @@ -27,13 +25,20 @@ export class GlobUtil { #sep; signal; maxDepth; + includeChildMatches; constructor(patterns, path, opts) { this.patterns = patterns; this.path = path; this.opts = opts; this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; - if (opts.ignore) { - this.#ignore = makeIgnore(opts.ignore, opts); + this.includeChildMatches = opts.includeChildMatches !== false; + if (opts.ignore || !this.includeChildMatches) { + this.#ignore = makeIgnore(opts.ignore ?? [], opts); + if (!this.includeChildMatches && + typeof this.#ignore.add !== 'function') { + const m = 'cannot ignore child matches, ignore lacks add() method.'; + throw new Error(m); + } } // ignore, always set with maxDepth, but it's optional on the // GlobOptions type @@ -105,7 +110,7 @@ export class GlobUtil { return this.matchCheckTest(s, ifDir); } matchCheckTest(e, ifDir) { - return e && + return (e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && @@ -113,8 +118,8 @@ export class GlobUtil { !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && - !this.#ignored(e) - ? e + !this.#ignored(e)) ? + e : undefined; } matchCheckSync(e, ifDir) { @@ -140,6 +145,11 @@ export class GlobUtil { matchFinish(e, absolute) { if (this.#ignored(e)) return; + // we know we have an ignore if this is false, but TS doesn't + if (!this.includeChildMatches && this.#ignore?.add) { + const ign = `${e.relativePosix()}/**`; + this.#ignore.add(ign); + } const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; this.seen.add(e); const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; @@ -153,8 +163,8 @@ export class GlobUtil { } else { const rel = this.opts.posix ? e.relativePosix() : e.relative(); - const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) - ? '.' + this.#sep + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ? + '.' + this.#sep : ''; this.matchEmit(!rel ? '.' + mark : pre + rel + mark); } @@ -293,10 +303,9 @@ export class GlobUtil { } } export class GlobWalker extends GlobUtil { - matches; + matches = new Set(); constructor(patterns, path, opts) { super(patterns, path, opts); - this.matches = new Set(); } matchEmit(e) { this.matches.add(e); diff --git a/deps/npm/node_modules/glob/dist/esm/walker.js.map b/deps/npm/node_modules/glob/dist/esm/walker.js.map index 62f35d4a1a2955..daeeda6752713f 100644 --- a/deps/npm/node_modules/glob/dist/esm/walker.js.map +++ b/deps/npm/node_modules/glob/dist/esm/walker.js.map @@ -1 +1 @@ -{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAA;AAQhD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAiE1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,CACd,OAAO,MAAM,KAAK,QAAQ;IACxB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;IAC5B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;QAC1B,CAAC,CAA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AAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAChD,CAAC;IAGD,SAAS,CAAC,CAAgB;QACxB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;YACtB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;SACH;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;SAC7D;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;SACtB;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result = O extends GWOFileTypesTrue\n ? Path\n : O extends GWOFileTypesFalse\n ? string\n : O extends GWOFileTypesUnset\n ? string\n : Path | string\n\nexport type Matches = O extends GWOFileTypesTrue\n ? Set\n : O extends GWOFileTypesFalse\n ? Set\n : O extends GWOFileTypesUnset\n ? Set\n : Set\n\nexport type MatchStream =\n O extends GWOFileTypesTrue\n ? Minipass\n : O extends GWOFileTypesFalse\n ? Minipass\n : O extends GWOFileTypesUnset\n ? Minipass\n : Minipass\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts\n): IgnoreLike =>\n typeof ignore === 'string'\n ? new Ignore([ignore], opts)\n : Array.isArray(ignore)\n ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n if (opts.ignore) {\n this.#ignore = makeIgnore(opts.ignore, opts)\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ? e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep)\n ? '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb)\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil {\n matches: O extends GWOFileTypesTrue\n ? Set\n : O extends GWOFileTypesFalse\n ? Set\n : O extends GWOFileTypesUnset\n ? Set\n : Set\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.matches = new Set() as Matches\n }\n\n matchEmit(e: Result): void\n matchEmit(e: Path | string): void {\n this.matches.add(e)\n }\n\n async walk(): Promise> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Matches {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts\n> extends GlobUtil {\n results: O extends GWOFileTypesTrue\n ? Minipass\n : O extends GWOFileTypesFalse\n ? Minipass\n : O extends GWOFileTypesUnset\n ? Minipass\n : Minipass\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass({\n signal: this.signal,\n objectMode: true,\n }) as MatchStream\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void\n matchEmit(e: Path | string): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EAAE,MAAM,EAAc,MAAM,aAAa,CAAA;AAQhD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AA0D1C,MAAM,UAAU,GAAG,C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CAAC,CAAA;IAChD,CAAC;IAED,SAAS,CAAC,CAAY;QACpB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;QACvB,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result =\n O extends GWOFileTypesTrue ? Path\n : O extends GWOFileTypesFalse ? string\n : O extends GWOFileTypesUnset ? string\n : Path | string\n\nexport type Matches =\n O extends GWOFileTypesTrue ? Set\n : O extends GWOFileTypesFalse ? Set\n : O extends GWOFileTypesUnset ? Set\n : Set\n\nexport type MatchStream = Minipass<\n Result,\n Result\n>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts,\n): IgnoreLike =>\n typeof ignore === 'string' ? new Ignore([ignore], opts)\n : Array.isArray(ignore) ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set = new Set()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n includeChildMatches: boolean\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n this.includeChildMatches = opts.includeChildMatches !== false\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n if (\n !this.includeChildMatches &&\n typeof this.#ignore.add !== 'function'\n ) {\n const m = 'cannot ignore child matches, ignore lacks add() method.'\n throw new Error(m)\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return (\n e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ) ?\n e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`\n this.#ignore.add(ign)\n }\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true,\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb),\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n matches = new Set>()\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n }\n\n matchEmit(e: Result): void {\n this.matches.add(e)\n }\n\n async walk(): Promise>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Set> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil {\n results: Minipass, Result>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass, Result>({\n signal: this.signal,\n objectMode: true,\n })\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 6d93c9f9787ddf..f6f7eb4e8b0592 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -2,7 +2,7 @@ "author": "Isaac Z. Schlueter (https://blog.izs.me/)", "name": "glob", "description": "the most correct and second fastest glob implementation in JavaScript", - "version": "10.3.15", + "version": "10.4.1", "type": "module", "tshy": { "main": true, @@ -43,7 +43,7 @@ "presnap": "npm run prepare", "test": "tap", "snap": "tap", - "format": "prettier --write . --loglevel warn", + "format": "prettier --write . --log-level warn", "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts", "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", @@ -55,6 +55,7 @@ "benchclean": "node benchclean.cjs" }, "prettier": { + "experimentalTernaries": true, "semi": false, "printWidth": 75, "tabWidth": 2, @@ -67,23 +68,21 @@ }, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", - "minimatch": "^9.0.1", - "minipass": "^7.0.4", - "path-scurry": "^1.11.0" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "path-scurry": "^1.11.1" }, "devDependencies": { "@types/node": "^20.11.30", "memfs": "^3.4.13", "mkdirp": "^3.0.1", - "prettier": "^2.8.3", - "rimraf": "^5.0.1", + "prettier": "^3.2.5", + "rimraf": "^5.0.7", "sync-content": "^1.0.2", - "tap": "^18.7.2", - "ts-node": "^10.9.2", - "tshy": "^1.12.0", - "typedoc": "^0.25.12", - "typescript": "^5.2.2" + "tap": "^19.0.0", + "tshy": "^1.14.0", + "typedoc": "^0.25.12" }, "tap": { "before": "test/00-setup.ts" diff --git a/deps/npm/node_modules/ini/lib/ini.js b/deps/npm/node_modules/ini/lib/ini.js index 0e8623ee699294..beb390d0b0ee2c 100644 --- a/deps/npm/node_modules/ini/lib/ini.js +++ b/deps/npm/node_modules/ini/lib/ini.js @@ -140,7 +140,9 @@ const decode = (str, opt = {}) => { duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1 isArray = duplicates[keyRaw] > 1 } - const key = isArray ? keyRaw.slice(0, -2) : keyRaw + const key = isArray && keyRaw.endsWith('[]') + ? keyRaw.slice(0, -2) : keyRaw + if (key === '__proto__') { continue } diff --git a/deps/npm/node_modules/ini/package.json b/deps/npm/node_modules/ini/package.json index caa36d223f09ca..67aa9278259473 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -2,10 +2,10 @@ "author": "GitHub Inc.", "name": "ini", "description": "An ini encoder/decoder for node", - "version": "4.1.2", + "version": "4.1.3", "repository": { "type": "git", - "url": "https://github.com/npm/ini.git" + "url": "git+https://github.com/npm/ini.git" }, "main": "lib/ini.js", "scripts": { @@ -20,7 +20,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", + "@npmcli/template-oss": "4.22.0", "tap": "^16.0.1" }, "license": "ISC", @@ -33,7 +33,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.21.3", + "version": "4.22.0", "publish": "true" }, "tap": { diff --git a/deps/npm/node_modules/is-cidr/dist/index.js b/deps/npm/node_modules/is-cidr/dist/index.js new file mode 100644 index 00000000000000..35fba31c48c663 --- /dev/null +++ b/deps/npm/node_modules/is-cidr/dist/index.js @@ -0,0 +1,11 @@ +import { v4 as v4$1, v6 as v6$1 } from "cidr-regex"; +const re4 = v4$1({ exact: true }); +const re6 = v6$1({ exact: true }); +const isCidr = (str) => re4.test(str) ? 4 : re6.test(str) ? 6 : 0; +const v4 = isCidr.v4 = (str) => re4.test(str); +const v6 = isCidr.v6 = (str) => re6.test(str); +export { + isCidr as default, + v4, + v6 +}; diff --git a/deps/npm/node_modules/is-cidr/index.js b/deps/npm/node_modules/is-cidr/index.js deleted file mode 100644 index ed7f152c1163e7..00000000000000 --- a/deps/npm/node_modules/is-cidr/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import {v4 as v4Re, v6 as v6Re} from "cidr-regex"; - -const re4 = v4Re({exact: true}); -const re6 = v6Re({exact: true}); - -const isCidr = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0); -export const v4 = isCidr.v4 = str => re4.test(str); -export const v6 = isCidr.v6 = str => re6.test(str); -export default isCidr; diff --git a/deps/npm/node_modules/is-cidr/package.json b/deps/npm/node_modules/is-cidr/package.json index baf6fa55fe4522..4b0e95b9c78c7a 100644 --- a/deps/npm/node_modules/is-cidr/package.json +++ b/deps/npm/node_modules/is-cidr/package.json @@ -1,6 +1,6 @@ { "name": "is-cidr", - "version": "5.0.5", + "version": "5.1.0", "description": "Check if a string is an IP address in CIDR notation", "author": "silverwind ", "contributors": [ @@ -9,25 +9,32 @@ "repository": "silverwind/is-cidr", "license": "BSD-2-Clause", "type": "module", - "exports": "./index.js", "sideEffects": false, + "main": "./dist/index.js", + "exports": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], "engines": { "node": ">=14" }, - "files": [ - "index.js", - "index.d.ts" - ], "dependencies": { - "cidr-regex": "^4.0.4" + "cidr-regex": "^4.1.1" }, "devDependencies": { + "@types/node": "20.12.12", "eslint": "8.57.0", - "eslint-config-silverwind": "83.0.1", - "tsd": "0.31.0", - "updates": "16.0.0", - "versions": "12.0.1", - "vitest": "1.4.0", - "vitest-config-silverwind": "7.0.3" + "eslint-config-silverwind": "85.1.4", + "eslint-config-silverwind-typescript": "3.2.7", + "typescript": "5.4.5", + "typescript-config-silverwind": "4.3.2", + "updates": "16.1.1", + "versions": "12.0.2", + "vite": "5.2.11", + "vite-config-silverwind": "1.1.2", + "vite-plugin-dts": "3.9.1", + "vitest": "1.6.0", + "vitest-config-silverwind": "9.0.6" } } diff --git a/deps/npm/node_modules/jackspeak/dist/commonjs/index.js b/deps/npm/node_modules/jackspeak/dist/commonjs/index.js index 956d6a275c3634..a66dde30a9dd6a 100644 --- a/deps/npm/node_modules/jackspeak/dist/commonjs/index.js +++ b/deps/npm/node_modules/jackspeak/dist/commonjs/index.js @@ -21,51 +21,41 @@ const toEnvKey = (pref, key) => { .replace(/ /g, '_'); }; const toEnvVal = (value, delim = '\n') => { - const str = typeof value === 'string' - ? value - : typeof value === 'boolean' - ? value - ? '1' + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' : '0' - : typeof value === 'number' - ? String(value) - : Array.isArray(value) - ? value - .map((v) => toEnvVal(v)) - .join(delim) - : /* c8 ignore start */ - undefined; + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; if (typeof str !== 'string') { throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); } /* c8 ignore stop */ return str; }; -const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env - ? env.split(delim).map(v => fromEnvVal(v, type, false)) +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) : [] - : type === 'string' - ? env - : type === 'boolean' - ? env === '1' + : type === 'string' ? env + : type === 'boolean' ? env === '1' : +env.trim()); const isConfigType = (t) => typeof t === 'string' && (t === 'string' || t === 'number' || t === 'boolean'); exports.isConfigType = isConfigType; const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); // print the value type, for error message reporting -const valueType = (v) => typeof v === 'string' - ? 'string' - : typeof v === 'boolean' - ? 'boolean' - : typeof v === 'number' - ? 'number' - : Array.isArray(v) - ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' - ? types[0] +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { @@ -85,80 +75,140 @@ const isConfigOption = (o, type, multi) => !!o && undefOrType(o.description, 'string') && undefOrType(o.hint, 'string') && undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && (o.default === undefined || isValidValue(o.default, type, multi)) && !!o.multiple === multi; exports.isConfigOption = isConfigOption; function num(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: false, }; } function numList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: true, }; } function opt(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: false, }; } function optList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: true, }; } function flag(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', false)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag'); @@ -173,11 +223,12 @@ function flag(o = {}) { } function flagList(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', true)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag list'); @@ -210,8 +261,8 @@ const toParseArgsOptionsConfig = (options) => { c[longOption] = { type: 'string', multiple: false, - default: config.default === undefined - ? undefined + default: config.default === undefined ? + undefined : String(config.default), }; } @@ -219,7 +270,7 @@ const toParseArgsOptionsConfig = (options) => { const conf = config; c[longOption] = { type: conf.type, - multiple: conf.multiple, + multiple: !!conf.multiple, default: conf.default, }; } @@ -277,14 +328,25 @@ class Jack { this.validate(values); } catch (er) { - throw Object.assign(er, source ? { source } : {}); + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; } for (const [field, value] of Object.entries(values)) { const my = this.#configSet[field]; // already validated, just for TS's benefit /* c8 ignore start */ if (!my) { - throw new Error('unexpected field in config set: ' + field); + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); } /* c8 ignore stop */ my.default = value; @@ -355,18 +417,27 @@ class Jack { throw new Error(`Unknown option '${token.rawName}'. ` + `To specify a positional argument starting with a '-', ` + `place it at the end of the command after '--', as in ` + - `'-- ${token.rawName}'`); + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); } if (value === undefined) { if (token.value === undefined) { if (my.type !== 'boolean') { - throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`); + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); } value = true; } else { if (my.type === 'boolean') { - throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`); + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); } if (my.type === 'string') { value = token.value; @@ -375,7 +446,13 @@ class Jack { value = +token.value; if (value !== value) { throw new Error(`Invalid value '${token.value}' provided for ` + - `'${token.rawName}' option, expected number`); + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); } } } @@ -400,8 +477,16 @@ class Jack { } for (const [field, value] of Object.entries(p.values)) { const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } if (valid && !valid(value)) { - throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); } } this.#writeEnv(p); @@ -418,7 +503,7 @@ class Jack { // recurse so we get the core config key we care about. this.#noNoFields(yes, val, s); if (this.#configSet[yes]?.type === 'boolean') { - throw new Error(`do not set '${s}', instead set '${yes}' as desired.`); + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); } } /** @@ -427,22 +512,48 @@ class Jack { */ validate(o) { if (!o || typeof o !== 'object') { - throw new Error('Invalid config: not an object'); + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); } + const opts = o; for (const field in o) { - this.#noNoFields(field, o[field]); + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); const config = this.#configSet[field]; if (!config) { - throw new Error(`Unknown config option: ${field}`); + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); } - if (!isValidValue(o[field], config.type, !!config.multiple)) { - throw Object.assign(new Error(`Invalid value ${valueType(o[field])} for ${field}, expected ${valueType(config)}`), { - field, - value: o[field], + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, }); } - if (config.validate && !config.validate(o[field])) { - throw new Error(`Invalid config value for ${field}: ${o[field]}`); + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); } } } @@ -753,21 +864,21 @@ class Jack { const { value } = field; const desc = value.description || ''; const mult = value.multiple ? 'Can be set multiple times' : ''; - const dmDelim = mult && (desc.includes('\n') ? '\n\n' : '\n'); - const text = normalize(desc + dmDelim + mult); + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); const hint = value.hint || - (value.type === 'number' - ? 'n' - : value.type === 'string' - ? field.name + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name : undefined); - const short = !value.short - ? '' - : value.type === 'boolean' - ? `-${value.short} ` + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` : `-${value.short}<${hint}> `; - const left = value.type === 'boolean' - ? `${short}--${field.name}` + const left = value.type === 'boolean' ? + `${short}--${field.name}` : `${short}--${field.name}=<${hint}>`; const row = { text, left, type: 'config' }; if (text.length > width - maxMax) { @@ -795,10 +906,11 @@ class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description - ? { description: normalize(def.description) } + ...(def.description ? + { description: normalize(def.description) } : {}), ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, ])); @@ -813,12 +925,12 @@ class Jack { exports.Jack = Jack; // Unwrap and un-indent, so we can wrap description // strings however makes them look nice in the code. -const normalize = (s, pre = false) => pre - ? // prepend a ZWSP to each line so cliui doesn't strip it. - s - .split('\n') - .map(l => `\u200b${l}`) - .join('\n') +const normalize = (s, pre = false) => pre ? + // prepend a ZWSP to each line so cliui doesn't strip it. + s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n') : s // remove single line breaks, except for lists .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) @@ -832,8 +944,8 @@ const normalize = (s, pre = false) => pre // normalize for markdown printing, remove leading spaces on lines const normalizeMarkdown = (s, pre = false) => { const n = normalize(s, pre).replace(/\\/g, '\\\\'); - return pre - ? `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` : n.replace(/\n +/g, '\n').trim(); }; const normalizeOneLine = (s, pre = false) => { diff --git a/deps/npm/node_modules/jackspeak/dist/commonjs/package.json b/deps/npm/node_modules/jackspeak/dist/commonjs/package.json index 0292b9956f2e40..5bbefffbabee39 100644 --- a/deps/npm/node_modules/jackspeak/dist/commonjs/package.json +++ b/deps/npm/node_modules/jackspeak/dist/commonjs/package.json @@ -1 +1,3 @@ -{"type":"commonjs"} \ No newline at end of file +{ + "type": "commonjs" +} diff --git a/deps/npm/node_modules/jackspeak/dist/esm/index.js b/deps/npm/node_modules/jackspeak/dist/esm/index.js index 9914049f890269..6c4882b4e06bc6 100644 --- a/deps/npm/node_modules/jackspeak/dist/esm/index.js +++ b/deps/npm/node_modules/jackspeak/dist/esm/index.js @@ -15,50 +15,40 @@ const toEnvKey = (pref, key) => { .replace(/ /g, '_'); }; const toEnvVal = (value, delim = '\n') => { - const str = typeof value === 'string' - ? value - : typeof value === 'boolean' - ? value - ? '1' + const str = typeof value === 'string' ? value + : typeof value === 'boolean' ? + value ? '1' : '0' - : typeof value === 'number' - ? String(value) - : Array.isArray(value) - ? value - .map((v) => toEnvVal(v)) - .join(delim) - : /* c8 ignore start */ - undefined; + : typeof value === 'number' ? String(value) + : Array.isArray(value) ? + value.map((v) => toEnvVal(v)).join(delim) + : /* c8 ignore start */ undefined; if (typeof str !== 'string') { throw new Error(`could not serialize value to environment: ${JSON.stringify(value)}`); } /* c8 ignore stop */ return str; }; -const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple - ? env - ? env.split(delim).map(v => fromEnvVal(v, type, false)) +const fromEnvVal = (env, type, multiple, delim = '\n') => (multiple ? + env ? env.split(delim).map(v => fromEnvVal(v, type, false)) : [] - : type === 'string' - ? env - : type === 'boolean' - ? env === '1' + : type === 'string' ? env + : type === 'boolean' ? env === '1' : +env.trim()); export const isConfigType = (t) => typeof t === 'string' && (t === 'string' || t === 'number' || t === 'boolean'); const undefOrType = (v, t) => v === undefined || typeof v === t; +const undefOrTypeArray = (v, t) => v === undefined || (Array.isArray(v) && v.every(x => typeof x === t)); +const isValidOption = (v, vo) => Array.isArray(v) ? v.every(x => isValidOption(x, vo)) : vo.includes(v); // print the value type, for error message reporting -const valueType = (v) => typeof v === 'string' - ? 'string' - : typeof v === 'boolean' - ? 'boolean' - : typeof v === 'number' - ? 'number' - : Array.isArray(v) - ? joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' +const valueType = (v) => typeof v === 'string' ? 'string' + : typeof v === 'boolean' ? 'boolean' + : typeof v === 'number' ? 'number' + : Array.isArray(v) ? + joinTypes([...new Set(v.map(v => valueType(v)))]) + '[]' : `${v.type}${v.multiple ? '[]' : ''}`; -const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' - ? types[0] +const joinTypes = (types) => types.length === 1 && typeof types[0] === 'string' ? + types[0] : `(${types.join('|')})`; const isValidValue = (v, type, multi) => { if (multi) { @@ -78,79 +68,139 @@ export const isConfigOption = (o, type, multi) => !!o && undefOrType(o.description, 'string') && undefOrType(o.hint, 'string') && undefOrType(o.validate, 'function') && + (o.type === 'boolean' ? + o.validOptions === undefined + : undefOrTypeArray(o.validOptions, o.type)) && (o.default === undefined || isValidValue(o.default, type, multi)) && !!o.multiple === multi; function num(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: false, }; } function numList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'number', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'number[]', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'number')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'number[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'number', multiple: true, }; } function opt(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', false)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string', + }, + }); } - const validate = val - ? val + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); + } + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: false, }; } function optList(o = {}) { - const { default: def, validate: val, ...rest } = o; + const { default: def, validate: val, validOptions, ...rest } = o; if (def !== undefined && !isValidValue(def, 'string', true)) { - throw new TypeError('invalid default value'); + throw new TypeError('invalid default value', { + cause: { + found: def, + wanted: 'string[]', + }, + }); + } + if (!undefOrTypeArray(validOptions, 'string')) { + throw new TypeError('invalid validOptions', { + cause: { + found: validOptions, + wanted: 'string[]', + }, + }); } - const validate = val - ? val + const validate = val ? + val : undefined; return { ...rest, default: def, validate, + validOptions, type: 'string', multiple: true, }; } function flag(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', false)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag'); @@ -165,11 +215,12 @@ function flag(o = {}) { } function flagList(o = {}) { const { hint, default: def, validate: val, ...rest } = o; + delete rest.validOptions; if (def !== undefined && !isValidValue(def, 'boolean', true)) { throw new TypeError('invalid default value'); } - const validate = val - ? val + const validate = val ? + val : undefined; if (hint !== undefined) { throw new TypeError('cannot provide hint for flag list'); @@ -202,8 +253,8 @@ const toParseArgsOptionsConfig = (options) => { c[longOption] = { type: 'string', multiple: false, - default: config.default === undefined - ? undefined + default: config.default === undefined ? + undefined : String(config.default), }; } @@ -211,7 +262,7 @@ const toParseArgsOptionsConfig = (options) => { const conf = config; c[longOption] = { type: conf.type, - multiple: conf.multiple, + multiple: !!conf.multiple, default: conf.default, }; } @@ -269,14 +320,25 @@ export class Jack { this.validate(values); } catch (er) { - throw Object.assign(er, source ? { source } : {}); + const e = er; + if (source && e && typeof e === 'object') { + if (e.cause && typeof e.cause === 'object') { + Object.assign(e.cause, { path: source }); + } + else { + e.cause = { path: source }; + } + } + throw e; } for (const [field, value] of Object.entries(values)) { const my = this.#configSet[field]; // already validated, just for TS's benefit /* c8 ignore start */ if (!my) { - throw new Error('unexpected field in config set: ' + field); + throw new Error('unexpected field in config set: ' + field, { + cause: { found: field }, + }); } /* c8 ignore stop */ my.default = value; @@ -347,18 +409,27 @@ export class Jack { throw new Error(`Unknown option '${token.rawName}'. ` + `To specify a positional argument starting with a '-', ` + `place it at the end of the command after '--', as in ` + - `'-- ${token.rawName}'`); + `'-- ${token.rawName}'`, { + cause: { + found: token.rawName + (token.value ? `=${token.value}` : ''), + }, + }); } if (value === undefined) { if (token.value === undefined) { if (my.type !== 'boolean') { - throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`); + throw new Error(`No value provided for ${token.rawName}, expected ${my.type}`, { + cause: { + name: token.rawName, + wanted: valueType(my), + }, + }); } value = true; } else { if (my.type === 'boolean') { - throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`); + throw new Error(`Flag ${token.rawName} does not take a value, received '${token.value}'`, { cause: { found: token } }); } if (my.type === 'string') { value = token.value; @@ -367,7 +438,13 @@ export class Jack { value = +token.value; if (value !== value) { throw new Error(`Invalid value '${token.value}' provided for ` + - `'${token.rawName}' option, expected number`); + `'${token.rawName}' option, expected number`, { + cause: { + name: token.rawName, + found: token.value, + wanted: 'number', + }, + }); } } } @@ -392,8 +469,16 @@ export class Jack { } for (const [field, value] of Object.entries(p.values)) { const valid = this.#configSet[field]?.validate; + const validOptions = this.#configSet[field]?.validOptions; + let cause; + if (validOptions && !isValidOption(value, validOptions)) { + cause = { name: field, found: value, validOptions: validOptions }; + } if (valid && !valid(value)) { - throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`); + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid value provided for --${field}: ${JSON.stringify(value)}`, { cause }); } } this.#writeEnv(p); @@ -410,7 +495,7 @@ export class Jack { // recurse so we get the core config key we care about. this.#noNoFields(yes, val, s); if (this.#configSet[yes]?.type === 'boolean') { - throw new Error(`do not set '${s}', instead set '${yes}' as desired.`); + throw new Error(`do not set '${s}', instead set '${yes}' as desired.`, { cause: { found: s, wanted: yes } }); } } /** @@ -419,22 +504,48 @@ export class Jack { */ validate(o) { if (!o || typeof o !== 'object') { - throw new Error('Invalid config: not an object'); + throw new Error('Invalid config: not an object', { + cause: { found: o }, + }); } + const opts = o; for (const field in o) { - this.#noNoFields(field, o[field]); + const value = opts[field]; + /* c8 ignore next - for TS */ + if (value === undefined) + continue; + this.#noNoFields(field, value); const config = this.#configSet[field]; if (!config) { - throw new Error(`Unknown config option: ${field}`); + throw new Error(`Unknown config option: ${field}`, { + cause: { found: field }, + }); } - if (!isValidValue(o[field], config.type, !!config.multiple)) { - throw Object.assign(new Error(`Invalid value ${valueType(o[field])} for ${field}, expected ${valueType(config)}`), { - field, - value: o[field], + if (!isValidValue(value, config.type, !!config.multiple)) { + throw new Error(`Invalid value ${valueType(value)} for ${field}, expected ${valueType(config)}`, { + cause: { + name: field, + found: value, + wanted: valueType(config), + }, }); } - if (config.validate && !config.validate(o[field])) { - throw new Error(`Invalid config value for ${field}: ${o[field]}`); + let cause; + if (config.validOptions && + !isValidOption(value, config.validOptions)) { + cause = { + name: field, + found: value, + validOptions: config.validOptions, + }; + } + if (config.validate && !config.validate(value)) { + cause ??= { name: field, found: value }; + } + if (cause) { + throw new Error(`Invalid config value for ${field}: ${value}`, { + cause, + }); } } } @@ -745,21 +856,21 @@ export class Jack { const { value } = field; const desc = value.description || ''; const mult = value.multiple ? 'Can be set multiple times' : ''; - const dmDelim = mult && (desc.includes('\n') ? '\n\n' : '\n'); - const text = normalize(desc + dmDelim + mult); + const opts = value.validOptions?.length ? + `Valid options:${value.validOptions.map(v => ` ${JSON.stringify(v)}`)}` + : ''; + const dmDelim = desc.includes('\n') ? '\n\n' : '\n'; + const extra = [opts, mult].join(dmDelim).trim(); + const text = (normalize(desc) + dmDelim + extra).trim(); const hint = value.hint || - (value.type === 'number' - ? 'n' - : value.type === 'string' - ? field.name + (value.type === 'number' ? 'n' + : value.type === 'string' ? field.name : undefined); - const short = !value.short - ? '' - : value.type === 'boolean' - ? `-${value.short} ` + const short = !value.short ? '' + : value.type === 'boolean' ? `-${value.short} ` : `-${value.short}<${hint}> `; - const left = value.type === 'boolean' - ? `${short}--${field.name}` + const left = value.type === 'boolean' ? + `${short}--${field.name}` : `${short}--${field.name}=<${hint}>`; const row = { text, left, type: 'config' }; if (text.length > width - maxMax) { @@ -787,10 +898,11 @@ export class Jack { ...(def.multiple ? { multiple: true } : {}), ...(def.delim ? { delim: def.delim } : {}), ...(def.short ? { short: def.short } : {}), - ...(def.description - ? { description: normalize(def.description) } + ...(def.description ? + { description: normalize(def.description) } : {}), ...(def.validate ? { validate: def.validate } : {}), + ...(def.validOptions ? { validOptions: def.validOptions } : {}), ...(def.default !== undefined ? { default: def.default } : {}), }, ])); @@ -804,12 +916,12 @@ export class Jack { } // Unwrap and un-indent, so we can wrap description // strings however makes them look nice in the code. -const normalize = (s, pre = false) => pre - ? // prepend a ZWSP to each line so cliui doesn't strip it. - s - .split('\n') - .map(l => `\u200b${l}`) - .join('\n') +const normalize = (s, pre = false) => pre ? + // prepend a ZWSP to each line so cliui doesn't strip it. + s + .split('\n') + .map(l => `\u200b${l}`) + .join('\n') : s // remove single line breaks, except for lists .replace(/([^\n])\n[ \t]*([^\n])/g, (_, $1, $2) => !/^[-*]/.test($2) ? `${$1} ${$2}` : `${$1}\n${$2}`) @@ -823,8 +935,8 @@ const normalize = (s, pre = false) => pre // normalize for markdown printing, remove leading spaces on lines const normalizeMarkdown = (s, pre = false) => { const n = normalize(s, pre).replace(/\\/g, '\\\\'); - return pre - ? `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` + return pre ? + `\`\`\`\n${n.replace(/\u200b/g, '')}\n\`\`\`` : n.replace(/\n +/g, '\n').trim(); }; const normalizeOneLine = (s, pre = false) => { diff --git a/deps/npm/node_modules/jackspeak/dist/esm/package.json b/deps/npm/node_modules/jackspeak/dist/esm/package.json index 7c34deb5837d8d..3dbc1ca591c055 100644 --- a/deps/npm/node_modules/jackspeak/dist/esm/package.json +++ b/deps/npm/node_modules/jackspeak/dist/esm/package.json @@ -1 +1,3 @@ -{"type":"module"} \ No newline at end of file +{ + "type": "module" +} diff --git a/deps/npm/node_modules/jackspeak/dist/esm/parse-args.js b/deps/npm/node_modules/jackspeak/dist/esm/parse-args.js index 6dbb4d813ceeb9..23389a5ddee007 100644 --- a/deps/npm/node_modules/jackspeak/dist/esm/parse-args.js +++ b/deps/npm/node_modules/jackspeak/dist/esm/parse-args.js @@ -12,15 +12,15 @@ const pvs = pv const [major = 0, minor = 0] = pvs; /* c8 ignore stop */ let { parseArgs: pa, } = util; -/* c8 ignore start */ +/* c8 ignore start - version specific */ if (!pa || major < 16 || (major === 18 && minor < 11) || (major === 16 && minor < 19)) { - /* c8 ignore stop */ // Ignore because we will clobber it for commonjs //@ts-ignore pa = (await import('@pkgjs/parseargs')).parseArgs; } +/* c8 ignore stop */ export const parseArgs = pa; //# sourceMappingURL=parse-args.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/jackspeak/package.json b/deps/npm/node_modules/jackspeak/package.json index e5e4752ae66368..1e2b441f688a22 100644 --- a/deps/npm/node_modules/jackspeak/package.json +++ b/deps/npm/node_modules/jackspeak/package.json @@ -1,6 +1,6 @@ { "name": "jackspeak", - "version": "2.3.6", + "version": "3.1.2", "description": "A very strict and proper argument parser.", "tshy": { "main": true, @@ -43,6 +43,7 @@ }, "license": "BlueOak-1.0.0", "prettier": { + "experimentalTernaries": true, "semi": false, "printWidth": 75, "tabWidth": 2, @@ -56,9 +57,9 @@ "devDependencies": { "@types/node": "^20.7.0", "@types/pkgjs__parseargs": "^0.10.1", - "prettier": "^2.8.6", - "tap": "^18.1.4", - "tshy": "^1.2.2", + "prettier": "^3.2.5", + "tap": "^18.8.0", + "tshy": "^1.14.0", "typedoc": "^0.25.1", "typescript": "^5.2.2" }, diff --git a/deps/npm/node_modules/libnpmdiff/lib/should-print-patch.js b/deps/npm/node_modules/libnpmdiff/lib/should-print-patch.js index f8277a809eef6b..8000fc5e6afc16 100644 --- a/deps/npm/node_modules/libnpmdiff/lib/should-print-patch.js +++ b/deps/npm/node_modules/libnpmdiff/lib/should-print-patch.js @@ -1,4 +1,4 @@ -const { basename, extname } = require('path') +const { basename, extname } = require('node:path') const binaryExtensions = require('binary-extensions') diff --git a/deps/npm/node_modules/libnpmdiff/lib/tarball.js b/deps/npm/node_modules/libnpmdiff/lib/tarball.js index 41ea84a6885a5e..e2738b58f11bc4 100644 --- a/deps/npm/node_modules/libnpmdiff/lib/tarball.js +++ b/deps/npm/node_modules/libnpmdiff/lib/tarball.js @@ -1,4 +1,4 @@ -const { relative } = require('path') +const { relative } = require('node:path') const Arborist = require('@npmcli/arborist') const npa = require('npm-package-arg') diff --git a/deps/npm/node_modules/libnpmdiff/package.json b/deps/npm/node_modules/libnpmdiff/package.json index 33aae64ccae5ca..de359f2b68c459 100644 --- a/deps/npm/node_modules/libnpmdiff/package.json +++ b/deps/npm/node_modules/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "6.1.2", + "version": "6.1.3", "description": "The registry diff", "repository": { "type": "git", @@ -46,7 +46,7 @@ "tap": "^16.3.8" }, "dependencies": { - "@npmcli/arborist": "^7.5.2", + "@npmcli/arborist": "^7.5.3", "@npmcli/installed-package-contents": "^2.1.0", "binary-extensions": "^2.3.0", "diff": "^5.1.0", diff --git a/deps/npm/node_modules/libnpmexec/lib/file-exists.js b/deps/npm/node_modules/libnpmexec/lib/file-exists.js index 55c04bd4dc547e..8a1a88adee993d 100644 --- a/deps/npm/node_modules/libnpmexec/lib/file-exists.js +++ b/deps/npm/node_modules/libnpmexec/lib/file-exists.js @@ -1,5 +1,5 @@ -const { resolve } = require('path') -const { stat } = require('fs/promises') +const { resolve } = require('node:path') +const { stat } = require('node:fs/promises') const { walkUp } = require('walk-up-path') const fileExists = async (file) => { diff --git a/deps/npm/node_modules/libnpmexec/lib/index.js b/deps/npm/node_modules/libnpmexec/lib/index.js index 28cba79a7f227a..79d3cc1512f8ef 100644 --- a/deps/npm/node_modules/libnpmexec/lib/index.js +++ b/deps/npm/node_modules/libnpmexec/lib/index.js @@ -1,9 +1,9 @@ 'use strict' -const { mkdir } = require('fs/promises') +const { mkdir } = require('node:fs/promises') const Arborist = require('@npmcli/arborist') const ciInfo = require('ci-info') -const crypto = require('crypto') +const crypto = require('node:crypto') const { log, input } = require('proc-log') const npa = require('npm-package-arg') const pacote = require('pacote') @@ -14,7 +14,7 @@ const getBinFromManifest = require('./get-bin-from-manifest.js') const noTTY = require('./no-tty.js') const runScript = require('./run-script.js') const isWindows = require('./is-windows.js') -const { dirname, resolve } = require('path') +const { dirname, resolve } = require('node:path') const binPaths = [] @@ -73,6 +73,11 @@ const missingFromTree = async ({ spec, tree, flatOptions, isNpxTree }) => { } } +// see if the package.json at `path` has an entry that matches `cmd` +const hasPkgBin = (path, cmd, flatOptions) => + pacote.manifest(path, flatOptions) + .then(manifest => manifest?.bin?.[cmd]).catch(() => null) + const exec = async (opts) => { const { args = [], @@ -89,6 +94,13 @@ const exec = async (opts) => { ...flatOptions } = opts + let pkgPaths = opts.pkgPath + if (typeof pkgPaths === 'string') { + pkgPaths = [pkgPaths] + } + if (!pkgPaths) { + pkgPaths = ['.'] + } let yes = opts.yes const run = () => runScript({ args, @@ -106,28 +118,31 @@ const exec = async (opts) => { return run() } + // Look in the local tree too + pkgPaths.push(path) + let needPackageCommandSwap = (args.length > 0) && (packages.length === 0) // If they asked for a command w/o specifying a package, see if there is a // bin that directly matches that name: - // - in the local package itself - // - in the local tree + // - in any local packages (pkgPaths can have workspaces in them or just the root) + // - in the local tree (path) // - globally if (needPackageCommandSwap) { - let localManifest - try { - localManifest = await pacote.manifest(path, flatOptions) - } catch { - // no local package.json? no problem, move one. + // Local packages and local tree + for (const p of pkgPaths) { + if (await hasPkgBin(p, args[0], flatOptions)) { + // we have to install the local package into the npx cache so that its + // bin links get set up + flatOptions.installLinks = false + // args[0] will exist when the package is installed + packages.push(p) + yes = true + needPackageCommandSwap = false + break + } } - if (localManifest?.bin?.[args[0]]) { - // we have to install the local package into the npx cache so that its - // bin links get set up - flatOptions.installLinks = false - // args[0] will exist when the package is installed - packages.push(path) - yes = true - needPackageCommandSwap = false - } else { + if (needPackageCommandSwap) { + // no bin entry in local packages or in tree, now we look for binPaths const dir = dirname(dirname(localBin)) const localBinPath = await localFileExists(dir, args[0], '/') if (localBinPath) { diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index 9f2a3f531d6817..c4dbf73e86d881 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "8.1.1", + "version": "8.1.2", "files": [ "bin/", "lib/" @@ -59,7 +59,7 @@ "tap": "^16.3.8" }, "dependencies": { - "@npmcli/arborist": "^7.5.2", + "@npmcli/arborist": "^7.5.3", "@npmcli/run-script": "^8.1.0", "ci-info": "^4.0.0", "npm-package-arg": "^11.0.2", diff --git a/deps/npm/node_modules/libnpmfund/lib/index.js b/deps/npm/node_modules/libnpmfund/lib/index.js index 39b69afc0abcc5..1616c88b73c50c 100644 --- a/deps/npm/node_modules/libnpmfund/lib/index.js +++ b/deps/npm/node_modules/libnpmfund/lib/index.js @@ -1,6 +1,6 @@ 'use strict' -const URL = require('url').URL +const URL = require('node:url').URL const Arborist = require('@npmcli/arborist') // supports object funding and string shorthand, or an array of these diff --git a/deps/npm/node_modules/libnpmfund/package.json b/deps/npm/node_modules/libnpmfund/package.json index bd784bea0ced3c..4a37bb9c2f6ee1 100644 --- a/deps/npm/node_modules/libnpmfund/package.json +++ b/deps/npm/node_modules/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "5.0.10", + "version": "5.0.11", "main": "lib/index.js", "files": [ "bin/", @@ -45,7 +45,7 @@ "tap": "^16.3.8" }, "dependencies": { - "@npmcli/arborist": "^7.5.2" + "@npmcli/arborist": "^7.5.3" }, "engines": { "node": "^16.14.0 || >=18.0.0" diff --git a/deps/npm/node_modules/libnpmpack/lib/index.js b/deps/npm/node_modules/libnpmpack/lib/index.js index c71716cf544285..b026ad1a935c79 100644 --- a/deps/npm/node_modules/libnpmpack/lib/index.js +++ b/deps/npm/node_modules/libnpmpack/lib/index.js @@ -3,9 +3,9 @@ const pacote = require('pacote') const npa = require('npm-package-arg') const runScript = require('@npmcli/run-script') -const path = require('path') +const path = require('node:path') const Arborist = require('@npmcli/arborist') -const { writeFile } = require('fs/promises') +const { writeFile } = require('node:fs/promises') module.exports = pack async function pack (spec = 'file:.', opts = {}) { diff --git a/deps/npm/node_modules/libnpmpack/package.json b/deps/npm/node_modules/libnpmpack/package.json index ef56bb599b2e48..a4d7b8c135098c 100644 --- a/deps/npm/node_modules/libnpmpack/package.json +++ b/deps/npm/node_modules/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "7.0.2", + "version": "7.0.3", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/arborist": "^7.5.2", + "@npmcli/arborist": "^7.5.3", "@npmcli/run-script": "^8.1.0", "npm-package-arg": "^11.0.2", "pacote": "^18.0.6" diff --git a/deps/npm/node_modules/libnpmpublish/lib/provenance.js b/deps/npm/node_modules/libnpmpublish/lib/provenance.js index 090d4cd7fe561c..cead8da6be34fe 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/provenance.js +++ b/deps/npm/node_modules/libnpmpublish/lib/provenance.js @@ -1,5 +1,5 @@ const sigstore = require('sigstore') -const { readFile } = require('fs/promises') +const { readFile } = require('node:fs/promises') const ci = require('ci-info') const { env } = process diff --git a/deps/npm/node_modules/libnpmpublish/lib/publish.js b/deps/npm/node_modules/libnpmpublish/lib/publish.js index 9ffbc934263099..93d546efb5f0e1 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/publish.js +++ b/deps/npm/node_modules/libnpmpublish/lib/publish.js @@ -3,7 +3,7 @@ const npmFetch = require('npm-registry-fetch') const npa = require('npm-package-arg') const { log } = require('proc-log') const semver = require('semver') -const { URL } = require('url') +const { URL } = require('node:url') const ssri = require('ssri') const ciInfo = require('ci-info') diff --git a/deps/npm/node_modules/libnpmpublish/lib/unpublish.js b/deps/npm/node_modules/libnpmpublish/lib/unpublish.js index 9b124c11435fbb..983a5d2c39068e 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/unpublish.js +++ b/deps/npm/node_modules/libnpmpublish/lib/unpublish.js @@ -1,6 +1,6 @@ 'use strict' -const { URL } = require('url') +const { URL } = require('node:url') const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') const semver = require('semver') diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 8da06962da04ce..87fc8215dcab8c 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "9.0.8", + "version": "9.0.9", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 7e02fd9557a242..795a6ae076831b 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "7.0.5", + "version": "7.0.6", "description": "Programmatic API for searching in npm and compatible registries.", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/deps/npm/node_modules/libnpmversion/lib/read-json.js b/deps/npm/node_modules/libnpmversion/lib/read-json.js index 32c7289507697f..d5d47565a41ab9 100644 --- a/deps/npm/node_modules/libnpmversion/lib/read-json.js +++ b/deps/npm/node_modules/libnpmversion/lib/read-json.js @@ -1,6 +1,6 @@ // can't use read-package-json-fast, because we want to ensure // that we make as few changes as possible, even for safety issues. -const { readFile } = require('fs/promises') +const { readFile } = require('node:fs/promises') const parse = require('json-parse-even-better-errors') module.exports = async path => parse(await readFile(path)) diff --git a/deps/npm/node_modules/libnpmversion/lib/write-json.js b/deps/npm/node_modules/libnpmversion/lib/write-json.js index 425be8e8e3efb2..2f19953d75d281 100644 --- a/deps/npm/node_modules/libnpmversion/lib/write-json.js +++ b/deps/npm/node_modules/libnpmversion/lib/write-json.js @@ -1,5 +1,5 @@ // write the json back, preserving the line breaks and indent -const { writeFile } = require('fs/promises') +const { writeFile } = require('node:fs/promises') const kIndent = Symbol.for('indent') const kNewline = Symbol.for('newline') diff --git a/deps/npm/node_modules/libnpmversion/package.json b/deps/npm/node_modules/libnpmversion/package.json index d2c96ffb55cc00..3f251e4b63613e 100644 --- a/deps/npm/node_modules/libnpmversion/package.json +++ b/deps/npm/node_modules/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "6.0.2", + "version": "6.0.3", "main": "lib/index.js", "files": [ "bin/", diff --git a/deps/npm/node_modules/minipass/dist/commonjs/package.json b/deps/npm/node_modules/minipass/dist/commonjs/package.json index 0292b9956f2e40..5bbefffbabee39 100644 --- a/deps/npm/node_modules/minipass/dist/commonjs/package.json +++ b/deps/npm/node_modules/minipass/dist/commonjs/package.json @@ -1 +1,3 @@ -{"type":"commonjs"} \ No newline at end of file +{ + "type": "commonjs" +} diff --git a/deps/npm/node_modules/minipass/dist/esm/package.json b/deps/npm/node_modules/minipass/dist/esm/package.json index 7c34deb5837d8d..3dbc1ca591c055 100644 --- a/deps/npm/node_modules/minipass/dist/esm/package.json +++ b/deps/npm/node_modules/minipass/dist/esm/package.json @@ -1 +1,3 @@ -{"type":"module"} \ No newline at end of file +{ + "type": "module" +} diff --git a/deps/npm/node_modules/minipass/package.json b/deps/npm/node_modules/minipass/package.json index f8b39b52594900..771969b0285469 100644 --- a/deps/npm/node_modules/minipass/package.json +++ b/deps/npm/node_modules/minipass/package.json @@ -1,11 +1,12 @@ { "name": "minipass", - "version": "7.1.1", + "version": "7.1.2", "description": "minimal implementation of a PassThrough stream", "main": "./dist/commonjs/index.js", "types": "./dist/commonjs/index.d.ts", "type": "module", "tshy": { + "selfLink": false, "main": true, "exports": { "./package.json": "./package.json", @@ -57,11 +58,10 @@ "end-of-stream": "^1.4.0", "node-abort-controller": "^3.1.1", "prettier": "^2.6.2", - "tap": "^18.3.0", + "tap": "^19.0.0", "through2": "^2.0.3", - "tshy": "^1.2.2", - "typedoc": "^0.25.1", - "typescript": "^5.2.2" + "tshy": "^1.14.0", + "typedoc": "^0.25.1" }, "repository": "https://github.com/isaacs/minipass", "keywords": [ diff --git a/deps/npm/node_modules/postcss-selector-parser/dist/parser.js b/deps/npm/node_modules/postcss-selector-parser/dist/parser.js index b4c75e3edc3fe6..144f91f7300995 100644 --- a/deps/npm/node_modules/postcss-selector-parser/dist/parser.js +++ b/deps/npm/node_modules/postcss-selector-parser/dist/parser.js @@ -116,7 +116,8 @@ var Parser = /*#__PURE__*/function () { line: 1, column: 1 } - } + }, + sourceIndex: 0 }); this.root.append(selector); this.current = selector; @@ -577,7 +578,8 @@ var Parser = /*#__PURE__*/function () { var selector = new _selector["default"]({ source: { start: tokenStart(this.tokens[this.position + 1]) - } + }, + sourceIndex: this.tokens[this.position + 1][_tokenize.FIELDS.START_POS] }); this.current.parent.append(selector); this.current = selector; @@ -646,8 +648,9 @@ var Parser = /*#__PURE__*/function () { if (last && last.type === types.PSEUDO) { var selector = new _selector["default"]({ source: { - start: tokenStart(this.tokens[this.position - 1]) - } + start: tokenStart(this.tokens[this.position]) + }, + sourceIndex: this.tokens[this.position][_tokenize.FIELDS.START_POS] }); var cache = this.current; last.append(selector); diff --git a/deps/npm/node_modules/postcss-selector-parser/package.json b/deps/npm/node_modules/postcss-selector-parser/package.json index 0d1af5d373f20e..0a1bc95700dbb7 100644 --- a/deps/npm/node_modules/postcss-selector-parser/package.json +++ b/deps/npm/node_modules/postcss-selector-parser/package.json @@ -1,6 +1,6 @@ { "name": "postcss-selector-parser", - "version": "6.0.16", + "version": "6.1.0", "devDependencies": { "@babel/cli": "^7.11.6", "@babel/core": "^7.11.6", diff --git a/deps/npm/node_modules/sigstore/package.json b/deps/npm/node_modules/sigstore/package.json index f39fc63b5a91de..fa8744bf304a3f 100644 --- a/deps/npm/node_modules/sigstore/package.json +++ b/deps/npm/node_modules/sigstore/package.json @@ -1,6 +1,6 @@ { "name": "sigstore", - "version": "2.3.0", + "version": "2.3.1", "description": "code-signing for npm packages", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -29,17 +29,17 @@ "devDependencies": { "@sigstore/rekor-types": "^2.0.0", "@sigstore/jest": "^0.0.0", - "@sigstore/mock": "^0.7.0", - "@tufjs/repo-mock": "^2.0.0", + "@sigstore/mock": "^0.7.4", + "@tufjs/repo-mock": "^2.0.1", "@types/make-fetch-happen": "^10.0.4" }, "dependencies": { - "@sigstore/bundle": "^2.3.1", + "@sigstore/bundle": "^2.3.2", "@sigstore/core": "^1.0.0", - "@sigstore/protobuf-specs": "^0.3.1", - "@sigstore/sign": "^2.3.0", - "@sigstore/tuf": "^2.3.1", - "@sigstore/verify": "^1.2.0" + "@sigstore/protobuf-specs": "^0.3.2", + "@sigstore/sign": "^2.3.2", + "@sigstore/tuf": "^2.3.4", + "@sigstore/verify": "^1.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" diff --git a/deps/npm/node_modules/spdx-license-ids/deprecated.json b/deps/npm/node_modules/spdx-license-ids/deprecated.json index a877dc3efd8bd2..278531e40c613d 100644 --- a/deps/npm/node_modules/spdx-license-ids/deprecated.json +++ b/deps/npm/node_modules/spdx-license-ids/deprecated.json @@ -7,24 +7,18 @@ "GFDL-1.2", "GFDL-1.3", "GPL-1.0", - "GPL-1.0+", "GPL-2.0", - "GPL-2.0+", "GPL-2.0-with-GCC-exception", "GPL-2.0-with-autoconf-exception", "GPL-2.0-with-bison-exception", "GPL-2.0-with-classpath-exception", "GPL-2.0-with-font-exception", "GPL-3.0", - "GPL-3.0+", "GPL-3.0-with-GCC-exception", "GPL-3.0-with-autoconf-exception", "LGPL-2.0", - "LGPL-2.0+", "LGPL-2.1", - "LGPL-2.1+", "LGPL-3.0", - "LGPL-3.0+", "Nunit", "StandardML-NJ", "bzip2-1.0.5", diff --git a/deps/npm/node_modules/spdx-license-ids/index.json b/deps/npm/node_modules/spdx-license-ids/index.json index 7cc52df7dac860..c7686a710d61d1 100644 --- a/deps/npm/node_modules/spdx-license-ids/index.json +++ b/deps/npm/node_modules/spdx-license-ids/index.json @@ -1,5 +1,6 @@ [ "0BSD", + "3D-Slicer-1.0", "AAL", "ADSL", "AFL-1.1", @@ -11,6 +12,7 @@ "AGPL-1.0-or-later", "AGPL-3.0-only", "AGPL-3.0-or-later", + "AMD-newlib", "AMDPLPA", "AML", "AML-glslang", @@ -47,6 +49,7 @@ "BSD-2-Clause-Darwin", "BSD-2-Clause-Patent", "BSD-2-Clause-Views", + "BSD-2-Clause-first-lines", "BSD-3-Clause", "BSD-3-Clause-Attribution", "BSD-3-Clause-Clear", @@ -176,6 +179,7 @@ "CUA-OPL-1.0", "Caldera", "Caldera-no-preamble", + "Catharon", "ClArtistic", "Clips", "Community-Spec-1.0", @@ -255,25 +259,32 @@ "Glide", "Glulxe", "Graphics-Gems", + "Gutmann", "HP-1986", "HP-1989", "HPND", "HPND-DEC", "HPND-Fenneberg-Livingston", "HPND-INRIA-IMAG", + "HPND-Intel", "HPND-Kevlin-Henney", "HPND-MIT-disclaimer", "HPND-Markus-Kuhn", "HPND-Pbmplus", "HPND-UC", + "HPND-UC-export-US", "HPND-doc", "HPND-doc-sell", "HPND-export-US", + "HPND-export-US-acknowledgement", "HPND-export-US-modify", + "HPND-export2-US", + "HPND-merchantability-variant", "HPND-sell-MIT-disclaimer-xserver", "HPND-sell-regexpr", "HPND-sell-variant", "HPND-sell-variant-MIT-disclaimer", + "HPND-sell-variant-MIT-disclaimer-rev", "HTMLTIDY", "HaskellReport", "Hippocratic-2.1", @@ -338,6 +349,7 @@ "MIT-0", "MIT-CMU", "MIT-Festival", + "MIT-Khronos-old", "MIT-Modern-Variant", "MIT-Wu", "MIT-advertising", @@ -371,7 +383,9 @@ "NAIST-2003", "NASA-1.3", "NBPL-1.0", + "NCBI-PD", "NCGL-UK-2.0", + "NCL", "NCSA", "NGPL", "NICTA-1.0", @@ -395,6 +409,7 @@ "Nokia", "Noweb", "O-UDA-1.0", + "OAR", "OCCT-PL", "OCLC-2.0", "ODC-By-1.0", @@ -448,6 +463,7 @@ "PDDL-1.0", "PHP-3.0", "PHP-3.01", + "PPL", "PSF-2.0", "Parity-6.0.0", "Parity-7.0.0", @@ -503,6 +519,7 @@ "Spencer-99", "SugarCRM-1.1.3", "Sun-PPP", + "Sun-PPP-2000", "SunPro", "Symlinks", "TAPR-OHL-1.0", @@ -559,6 +576,7 @@ "Zimbra-1.3", "Zimbra-1.4", "Zlib", + "any-OSI", "bcrypt-Solar-Designer", "blessing", "bzip2-1.0.6", @@ -567,6 +585,7 @@ "copyleft-next-0.3.0", "copyleft-next-0.3.1", "curl", + "cve-tou", "diffmark", "dtoa", "dvipdfm", @@ -589,6 +608,7 @@ "mpi-permissive", "mpich2", "mplus", + "pkgconf", "pnmstitch", "psfrag", "psutils", @@ -598,11 +618,13 @@ "softSurfer", "ssh-keyscan", "swrule", + "threeparttable", "ulem", "w3m", "xinetd", "xkeyboard-config-Zinoviev", "xlock", "xpp", + "xzoom", "zlib-acknowledgement" ] diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json index 441f6ea38236c2..5f5ed9554f2579 100644 --- a/deps/npm/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/spdx-license-ids/package.json @@ -1,6 +1,6 @@ { "name": "spdx-license-ids", - "version": "3.0.17", + "version": "3.0.18", "description": "A list of SPDX license identifiers", "repository": "jslicense/spdx-license-ids", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", diff --git a/deps/npm/package.json b/deps/npm/package.json index 40c0643748e748..1532c7b508f834 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "10.8.0", + "version": "10.8.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -52,15 +52,15 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^7.5.2", - "@npmcli/config": "^8.3.2", + "@npmcli/arborist": "^7.5.3", + "@npmcli/config": "^8.3.3", "@npmcli/fs": "^3.1.1", "@npmcli/map-workspaces": "^3.0.6", - "@npmcli/package-json": "^5.1.0", + "@npmcli/package-json": "^5.1.1", "@npmcli/promise-spawn": "^7.0.2", "@npmcli/redact": "^2.0.0", "@npmcli/run-script": "^8.1.0", - "@sigstore/tuf": "^2.3.3", + "@sigstore/tuf": "^2.3.4", "abbrev": "^2.0.0", "archy": "~1.0.0", "cacache": "^18.0.3", @@ -69,24 +69,24 @@ "cli-columns": "^4.0.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.15", + "glob": "^10.4.1", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.2", - "ini": "^4.1.2", + "ini": "^4.1.3", "init-package-json": "^6.0.3", - "is-cidr": "^5.0.5", + "is-cidr": "^5.1.0", "json-parse-even-better-errors": "^3.0.2", "libnpmaccess": "^8.0.6", - "libnpmdiff": "^6.1.2", - "libnpmexec": "^8.1.1", - "libnpmfund": "^5.0.10", + "libnpmdiff": "^6.1.3", + "libnpmexec": "^8.1.2", + "libnpmfund": "^5.0.11", "libnpmhook": "^10.0.5", "libnpmorg": "^6.0.6", - "libnpmpack": "^7.0.2", - "libnpmpublish": "^9.0.8", - "libnpmsearch": "^7.0.5", + "libnpmpack": "^7.0.3", + "libnpmpublish": "^9.0.9", + "libnpmsearch": "^7.0.6", "libnpmteam": "^6.0.5", - "libnpmversion": "^6.0.2", + "libnpmversion": "^6.0.3", "make-fetch-happen": "^13.0.1", "minimatch": "^9.0.4", "minipass": "^7.1.1", diff --git a/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs index ec0298fcf4fa7b..943f1ef074e68d 100644 --- a/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs @@ -152,6 +152,8 @@ cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0 chai 1.0.0 1.0.1 1.0.1 node_modules/chai foo dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix theta MISSING 1.0.1 1.0.1 - c@1.0.0 +theta MISSING 1.0.1 1.0.1 - d@1.0.0 +theta MISSING 1.0.1 1.0.1 - e@1.0.0 ` exports[`test/lib/commands/outdated.js TAP workspaces should display json results filtered by ws > output 1`] = ` @@ -199,6 +201,8 @@ Package Current Wanted Latest Location Depended by cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0 dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix theta MISSING 1.0.1 1.0.1 - c@1.0.0 +theta MISSING 1.0.1 1.0.1 - d@1.0.0 +theta MISSING 1.0.1 1.0.1 - e@1.0.0 ` exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated deps json output > output 1`] = ` @@ -217,11 +221,23 @@ exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated "dependent": "prefix", "location": "{CWD}/prefix/node_modules/dog" }, - "theta": { - "wanted": "1.0.1", - "latest": "1.0.1", - "dependent": "c" - } + "theta": [ + { + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "c" + }, + { + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "d" + }, + { + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "e" + } + ] } ` @@ -229,6 +245,8 @@ exports[`test/lib/commands/outdated.js TAP workspaces should display ws outdated {CWD}/prefix/node_modules/cat:cat@1.0.1:cat@1.0.0:cat@1.0.1:a {CWD}/prefix/node_modules/dog:dog@1.0.1:dog@1.0.1:dog@2.0.0:prefix :theta@1.0.1:MISSING:theta@1.0.1:c +:theta@1.0.1:MISSING:theta@1.0.1:d +:theta@1.0.1:MISSING:theta@1.0.1:e ` exports[`test/lib/commands/outdated.js TAP workspaces should highlight ws in dependend by section > output 1`] = ` @@ -236,4 +254,6 @@ exports[`test/lib/commands/outdated.js TAP workspaces should highlight ws in dep cat 1.0.0 1.0.1 1.0.1 node_modules/cat a@1.0.0 dog 1.0.1 1.0.1 2.0.0 node_modules/dog prefix theta MISSING 1.0.1 1.0.1 - c@1.0.0 +theta MISSING 1.0.1 1.0.1 - d@1.0.0 +theta MISSING 1.0.1 1.0.1 - e@1.0.0 ` diff --git a/deps/npm/tap-snapshots/test/lib/commands/publish.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/publish.js.test.cjs index c13834d5d694cc..bad7355fb90762 100644 --- a/deps/npm/tap-snapshots/test/lib/commands/publish.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/commands/publish.js.test.cjs @@ -254,11 +254,6 @@ exports[`test/lib/commands/publish.js TAP no auth dry-run > must match snapshot exports[`test/lib/commands/publish.js TAP no auth dry-run > warns about auth being needed 1`] = ` Array [ - "publish npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", - String( - publish errors corrected: - publish Removed invalid "scripts" - ), "This command requires you to be logged in to https://registry.npmjs.org/ (dry-run)", ] ` @@ -359,26 +354,14 @@ Array [ "\\u001b[94mpublish\\u001b[39m npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", String( \\u001b[94mpublish\\u001b[39m errors corrected: - \\u001b[94mpublish\\u001b[39m Removed invalid "scripts" \\u001b[94mpublish\\u001b[39m "repository" was changed from a string to an object ), "\\u001b[94mpublish\\u001b[39m npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", String( \\u001b[94mpublish\\u001b[39m errors corrected: - \\u001b[94mpublish\\u001b[39m Removed invalid "scripts" \\u001b[94mpublish\\u001b[39m "repository" was changed from a string to an object \\u001b[94mpublish\\u001b[39m "repository.url" was normalized to "git+https://github.com/npm/workspace-b.git" ), - "\\u001b[94mpublish\\u001b[39m npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", - String( - \\u001b[94mpublish\\u001b[39m errors corrected: - \\u001b[94mpublish\\u001b[39m Removed invalid "scripts" - ), - "\\u001b[94mpublish\\u001b[39m npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", - String( - \\u001b[94mpublish\\u001b[39m errors corrected: - \\u001b[94mpublish\\u001b[39m Removed invalid "scripts" - ), "\\u001b[94mpublish\\u001b[39m Skipping workspace \\u001b[36mworkspace-p\\u001b[39m, marked as \\u001b[1mprivate\\u001b[22m", ] ` @@ -394,30 +377,22 @@ Array [ "publish npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", String( publish errors corrected: - publish Removed invalid "scripts" publish "repository" was changed from a string to an object ), "publish npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", String( publish errors corrected: - publish Removed invalid "scripts" publish "repository" was changed from a string to an object publish "repository.url" was normalized to "git+https://github.com/npm/workspace-b.git" ), - "publish npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", - String( - publish errors corrected: - publish Removed invalid "scripts" - ), - "publish npm auto-corrected some errors in your package.json when publishing. Please run \\"npm pkg fix\\" to address these errors.", - String( - publish errors corrected: - publish Removed invalid "scripts" - ), "publish Skipping workspace workspace-p, marked as private", ] ` +exports[`test/lib/commands/publish.js TAP workspaces all workspaces - some marked private > one marked private 1`] = ` ++ workspace-a@1.2.3-a +` + exports[`test/lib/commands/publish.js TAP workspaces json > all workspaces in json 1`] = ` { "workspace-a": { diff --git a/deps/npm/tap-snapshots/test/lib/commands/view.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/view.js.test.cjs index 54ceb893ae58a5..e6cd42d0d32a50 100644 --- a/deps/npm/tap-snapshots/test/lib/commands/view.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/commands/view.js.test.cjs @@ -363,6 +363,153 @@ yellow@1.0.1 'claudia' yellow@1.0.2 'claudia' ` +exports[`test/lib/commands/view.js TAP workspaces 404 workspaces basic > must match snapshot 1`] = ` + +green@1.0.0 | ACME | deps: 2 | versions: 2 +green is a very important color + +DEPRECATED!! - true + +keywords: colors, green, crayola + +bin: green + +dist +.tarball: http://hm.green.com/1.0.0.tgz +.shasum: 123 +.integrity: --- +.unpackedSize: 1.0 GB + +dependencies: +red: 1.0.0 +yellow: 1.0.0 + +maintainers: +- claudia <c@yellow.com> +- isaacs <i@yellow.com> + +dist-tags: +latest: 1.0.0 +error code E404 +error 404 404 +` + +exports[`test/lib/commands/view.js TAP workspaces 404 workspaces json > must match snapshot 1`] = ` +{ + "green": { + "_id": "green", + "name": "green", + "dist-tags": { + "latest": "1.0.0" + }, + "maintainers": [ + { + "name": "claudia", + "email": "c@yellow.com", + "twitter": "cyellow" + }, + { + "name": "isaacs", + "email": "i@yellow.com", + "twitter": "iyellow" + } + ], + "keywords": [ + "colors", + "green", + "crayola" + ], + "versions": [ + "1.0.0", + "1.0.1" + ], + "version": "1.0.0", + "description": "green is a very important color", + "bugs": { + "url": "http://bugs.green.com" + }, + "deprecated": true, + "repository": { + "url": "http://repository.green.com" + }, + "license": { + "type": "ACME" + }, + "bin": { + "green": "bin/green.js" + }, + "dependencies": { + "red": "1.0.0", + "yellow": "1.0.0" + }, + "dist": { + "shasum": "123", + "tarball": "http://hm.green.com/1.0.0.tgz", + "integrity": "---", + "fileCount": 1, + "unpackedSize": 1000000000 + } + }, + "error": { + "missing-package": { + "code": "E404", + "summary": "404", + "detail": "" + } + } +} +` + +exports[`test/lib/commands/view.js TAP workspaces 404 workspaces json with package named error > must match snapshot 1`] = ` +warn overwriting existing error on json output +{ + "error": { + "missing-package": { + "code": "E404", + "summary": "404", + "detail": "" + } + } +} +` + +exports[`test/lib/commands/view.js TAP workspaces 404 workspaces non-404 error rejects > must match snapshot 1`] = ` + +green@1.0.0 | ACME | deps: 2 | versions: 2 +green is a very important color + +DEPRECATED!! - true + +keywords: colors, green, crayola + +bin: green + +dist +.tarball: http://hm.green.com/1.0.0.tgz +.shasum: 123 +.integrity: --- +.unpackedSize: 1.0 GB + +dependencies: +red: 1.0.0 +yellow: 1.0.0 + +maintainers: +- claudia <c@yellow.com> +- isaacs <i@yellow.com> + +dist-tags: +latest: 1.0.0 +error Unknown error +` + +exports[`test/lib/commands/view.js TAP workspaces 404 workspaces non-404 error rejects with single arg > must match snapshot 1`] = ` +green: +1.0.0 +unknown-error: +error Unknown error +` + exports[`test/lib/commands/view.js TAP workspaces all workspaces --json > must match snapshot 1`] = ` { "green": { diff --git a/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs b/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs index 58277cf5052d89..4f74f88d2bf21d 100644 --- a/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs @@ -1612,12 +1612,15 @@ See also the \`ca\` config. If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag. -Also the tag that is added to the package@version specified by the \`npm tag\` -command, if no explicit tag is given. +It is the tag added to the package@version specified in the \`npm dist-tag +add\` command, if no explicit tag is given. When used by the \`npm diff\` command, this is the tag used to fetch the tarball that will be compared with the local files by default. +If used in the \`npm publish\` command, this is the tag that will be added to +the package submitted to the registry. + #### \`tag-version-prefix\` diff --git a/deps/npm/tap-snapshots/test/lib/utils/open-url.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/open-url.js.test.cjs index 92511b9284c7a3..fa256ba1314479 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/open-url.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/open-url.js.test.cjs @@ -11,7 +11,10 @@ https://www.npmjs.com ` exports[`test/lib/utils/open-url.js TAP open url prints where to go when browser is disabled and json is enabled > printed expected message 1`] = ` -{"title":"npm home","url":"https://www.npmjs.com"} +{ + "title": "npm home", + "url": "https://www.npmjs.com" +} ` exports[`test/lib/utils/open-url.js TAP open url prints where to go when given browser does not exist > printed expected message 1`] = ` @@ -33,5 +36,8 @@ https://www.npmjs.com ` exports[`test/lib/utils/open-url.js TAP open url prompt prints json output > must match snapshot 1`] = ` -{"title":"npm home","url":"https://www.npmjs.com"} +{ + "title": "npm home", + "url": "https://www.npmjs.com" +} ` diff --git a/deps/npm/test/bin/windows-shims.js b/deps/npm/test/bin/windows-shims.js index 71f12dc8e1cdda..8fbee609a0fabe 100644 --- a/deps/npm/test/bin/windows-shims.js +++ b/deps/npm/test/bin/windows-shims.js @@ -1,7 +1,7 @@ const t = require('tap') -const { spawnSync } = require('child_process') -const { resolve, join, extname, basename } = require('path') -const { readFileSync, chmodSync, readdirSync, statSync } = require('fs') +const { spawnSync } = require('node:child_process') +const { resolve, join, extname, basename } = require('node:path') +const { readFileSync, chmodSync, readdirSync, statSync } = require('node:fs') const Diff = require('diff') const { moveRemove } = require('rimraf') const { sync: which } = require('which') diff --git a/deps/npm/test/fixtures/clean-snapshot.js b/deps/npm/test/fixtures/clean-snapshot.js index bd4ce1d01df93d..bcbf699cb81fc9 100644 --- a/deps/npm/test/fixtures/clean-snapshot.js +++ b/deps/npm/test/fixtures/clean-snapshot.js @@ -1,4 +1,4 @@ -const { relative, dirname } = require('path') +const { relative, dirname } = require('node:path') // normalize line endings (for ini) const cleanNewlines = (s) => s.replace(/\r\n/g, '\n') diff --git a/deps/npm/test/fixtures/mock-logs.js b/deps/npm/test/fixtures/mock-logs.js index ce4c189219467d..3342b4e7614b24 100644 --- a/deps/npm/test/fixtures/mock-logs.js +++ b/deps/npm/test/fixtures/mock-logs.js @@ -1,5 +1,5 @@ const { log: { LEVELS } } = require('proc-log') -const { stripVTControlCharacters: stripAnsi } = require('util') +const { stripVTControlCharacters: stripAnsi } = require('node:util') const logPrefix = new RegExp(`^npm (${LEVELS.join('|')})\\s`) const isLog = (str) => logPrefix.test(stripAnsi(str)) @@ -24,6 +24,7 @@ const logsByTitle = (logs) => ({ module.exports = () => { const outputs = [] const outputErrors = [] + const fullOutput = [] const levelLogs = [] const logs = Object.defineProperties([], { @@ -53,6 +54,7 @@ module.exports = () => { // in the future if/when we refactor what logs look like. if (!isLog(str)) { outputErrors.push(str) + fullOutput.push(str) return } @@ -70,12 +72,14 @@ module.exports = () => { const level = stripAnsi(rawLevel) logs.push(str.replaceAll(prefix, `${level} `)) + fullOutput.push(str.replaceAll(prefix, `${level} `)) levelLogs.push({ level, message: str.replaceAll(prefix, '') }) }, }, stdout: { write: (str) => { outputs.push(trimTrailingNewline(str)) + fullOutput.push(trimTrailingNewline(str)) }, }, } @@ -88,9 +92,12 @@ module.exports = () => { clearOutput: () => { outputs.length = 0 outputErrors.length = 0 + fullOutput.length = 0 }, outputErrors, joinedOutputError: () => joinAndTrimTrailingNewlines(outputs), + fullOutput, + joinedFullOutput: () => joinAndTrimTrailingNewlines(fullOutput), logs, clearLogs: () => { levelLogs.length = 0 diff --git a/deps/npm/test/fixtures/mock-npm.js b/deps/npm/test/fixtures/mock-npm.js index 674147781af4c8..9e9113972d6a34 100644 --- a/deps/npm/test/fixtures/mock-npm.js +++ b/deps/npm/test/fixtures/mock-npm.js @@ -1,10 +1,12 @@ -const os = require('os') -const fs = require('fs').promises -const path = require('path') +const os = require('node:os') +const fs = require('node:fs').promises +const fsSync = require('node:fs') +const path = require('node:path') const tap = require('tap') const mockLogs = require('./mock-logs.js') const mockGlobals = require('@npmcli/mock-globals') const tmock = require('./tmock') +const MockRegistry = require('@npmcli/mock-registry') const defExitCode = process.exitCode const changeDir = (dir) => { @@ -288,6 +290,167 @@ const setupMockNpm = async (t, { } } +const loadNpmWithRegistry = async (t, opts) => { + const mock = await setupMockNpm(t, opts) + const registry = new MockRegistry({ + tap: t, + registry: mock.npm.config.get('registry'), + strict: true, + }) + + const fileShouldExist = (filePath) => { + t.equal( + fsSync.existsSync(path.join(mock.npm.prefix, filePath)), true, `${filePath} should exist` + ) + } + + const fileShouldNotExist = (filePath) => { + t.equal( + fsSync.existsSync(path.join(mock.npm.prefix, filePath)), false, `${filePath} should not exist` + ) + } + + const packageVersionMatches = (filePath, version) => { + t.equal( + JSON.parse(fsSync.readFileSync(path.join(mock.npm.prefix, filePath), 'utf8')).version, version + ) + } + + const packageInstalled = (target) => { + const spec = path.basename(target) + const dirname = path.dirname(target) + const [name, version = '1.0.0'] = spec.split('@') + fileShouldNotExist(`${dirname}/${name}/${name}@${version}.txt`) + packageVersionMatches(`${dirname}/${name}/package.json`, version) + fileShouldExist(`${dirname}/${name}/index.js`) + } + + const packageMissing = (target) => { + const spec = path.basename(target) + const dirname = path.dirname(target) + const [name, version = '1.0.0'] = spec.split('@') + fileShouldNotExist(`${dirname}/${name}/${name}@${version}.txt`) + fileShouldNotExist(`${dirname}/${name}/package.json`) + fileShouldNotExist(`${dirname}/${name}/index.js`) + } + + const packageDirty = (target) => { + const spec = path.basename(target) + const dirname = path.dirname(target) + const [name, version = '1.0.0'] = spec.split('@') + fileShouldExist(`${dirname}/${name}/${name}@${version}.txt`) + packageVersionMatches(`${dirname}/${name}/package.json`, version) + fileShouldNotExist(`${dirname}/${name}/index.js`) + } + + const assert = { + fileShouldExist, + fileShouldNotExist, + packageVersionMatches, + packageInstalled, + packageMissing, + packageDirty, + } + + return { registry, assert, ...mock } +} + +/** breaks down a spec "abbrev@1.1.1" into different parts for mocking */ +function dependencyDetails (spec, opt = {}) { + const [name, version = '1.0.0'] = spec.split('@') + const { parent, hoist = true, ws, clean = true } = opt + const modulePathPrefix = !hoist && parent ? `${parent}/` : '' + const modulePath = `${modulePathPrefix}node_modules/${name}` + const resolved = `https://registry.npmjs.org/${name}/-/${name}-${version}.tgz` + // deps + const wsEntries = Object.entries({ ...ws }) + const depsMap = wsEntries.map(([s, o]) => dependencyDetails(s, { ...o, parent: name })) + const dependencies = Object.assign({}, ...depsMap.map(d => d.packageDependency)) + const spreadDependencies = depsMap.length ? { dependencies } : {} + // package and lock objects + const packageDependency = { [name]: version } + const packageLockEntry = { [modulePath]: { version, resolved } } + const packageLockLink = { [modulePath]: { resolved: name, link: true } } + const packageLockLocal = { [name]: { version, dependencies } } + // build package.js + const packageJSON = { name, version, ...spreadDependencies } + const packageJSONString = JSON.stringify(packageJSON) + const packageJSONFile = { 'package.json': packageJSONString } + // build index.js + const indexJSString = 'module.exports = "hello world"' + const indexJSFile = { 'index.js': indexJSString } + // tarball + const packageFiles = { ...packageJSONFile, ...indexJSFile } + const nodeModules = Object.assign({}, ...depsMap.map(d => d.hoist ? {} : d.dirtyOrCleanDir)) + const nodeModulesDir = { node_modules: nodeModules } + const packageDir = { [name]: { ...packageFiles, ...nodeModulesDir } } + const tarballDir = { [`${name}@${version}`]: packageFiles } + // dirty files + const dirtyFile = { [`${name}@${version}.txt`]: 'dirty file' } + const dirtyFiles = { ...packageJSONFile, ...dirtyFile } + const dirtyDir = { [name]: dirtyFiles } + const dirtyOrCleanDir = clean ? {} : dirtyDir + + return { + packageDependency, + hoist, + depsMap, + dirtyOrCleanDir, + tarballDir, + packageDir, + packageLockEntry, + packageLockLink, + packageLockLocal, + } +} + +function workspaceMock (t, opts) { + const toObject = [(a, c) => ({ ...a, ...c }), {}] + const { workspaces: workspacesDef, ...rest } = { clean: true, ...opts } + const workspaces = Object.fromEntries(Object.entries(workspacesDef).map(([name, ws]) => { + return [name, Object.fromEntries(Object.entries(ws).map(([wsPackageDep, wsPackageDepOpts]) => { + return [wsPackageDep, { ...rest, ...wsPackageDepOpts }] + }))] + })) + const root = 'workspace-root' + const version = '1.0.0' + const names = Object.keys(workspaces) + const ws = Object.entries(workspaces).map(([name, _ws]) => dependencyDetails(name, { ws: _ws })) + const deps = ws.map(({ depsMap }) => depsMap).flat() + const tarballs = deps.map(w => w.tarballDir).reduce(...toObject) + const symlinks = names + .map((name) => ({ [name]: t.fixture('symlink', `../${name}`) })).reduce(...toObject) + const hoisted = deps.filter(d => d.hoist).map(w => w.dirtyOrCleanDir).reduce(...toObject) + const workspaceFolders = ws.map(w => w.packageDir).reduce(...toObject) + const packageJSON = { name: root, version, workspaces: names } + const packageLockJSON = ({ + name: root, + version, + lockfileVersion: 3, + requires: true, + packages: { + '': { name: root, version, workspaces: names }, + ...deps.filter(d => d.hoist).map(d => d.packageLockEntry).reduce(...toObject), + ...ws.map(d => d.packageLockEntry).flat().reduce(...toObject), + ...ws.map(d => d.packageLockLink).flat().reduce(...toObject), + ...ws.map(d => d.packageLockLocal).flat().reduce(...toObject), + ...deps.filter(d => !d.hoist).map(d => d.packageLockEntry).reduce(...toObject), + }, + }) + return { + tarballs, + node_modules: { + ...hoisted, + ...symlinks, + }, + 'package-lock.json': JSON.stringify(packageLockJSON), + 'package.json': JSON.stringify(packageJSON), + ...workspaceFolders, + } +} + module.exports = setupMockNpm module.exports.load = setupMockNpm module.exports.setGlobalNodeModules = setGlobalNodeModules +module.exports.loadNpmWithRegistry = loadNpmWithRegistry +module.exports.workspaceMock = workspaceMock diff --git a/deps/npm/test/fixtures/tmock.js b/deps/npm/test/fixtures/tmock.js index 321e8bc07c581c..ae270d57031bc1 100644 --- a/deps/npm/test/fixtures/tmock.js +++ b/deps/npm/test/fixtures/tmock.js @@ -1,4 +1,4 @@ -const path = require('path') +const path = require('node:path') const ROOT = path.resolve(__dirname, '../..') const BIN = path.join(ROOT, 'bin') diff --git a/deps/npm/test/lib/arborist-cmd.js b/deps/npm/test/lib/arborist-cmd.js index dd90d47b9a0003..6f848a650b83d6 100644 --- a/deps/npm/test/lib/arborist-cmd.js +++ b/deps/npm/test/lib/arborist-cmd.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const t = require('tap') const { load: loadMockNpm } = require('../fixtures/mock-npm') const tmock = require('../fixtures/tmock') diff --git a/deps/npm/test/lib/cli/entry.js b/deps/npm/test/lib/cli/entry.js index 87563fab59902a..900e3ab7943177 100644 --- a/deps/npm/test/lib/cli/entry.js +++ b/deps/npm/test/lib/cli/entry.js @@ -1,6 +1,6 @@ const t = require('tap') -const { readdirSync } = require('fs') -const { dirname } = require('path') +const { readdirSync } = require('node:fs') +const { dirname } = require('node:path') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const tmock = require('../../fixtures/tmock.js') const validateEngines = require('../../../lib/cli/validate-engines.js') diff --git a/deps/npm/test/lib/cli/exit-handler.js b/deps/npm/test/lib/cli/exit-handler.js index da050bbb0708e7..90d130a3992652 100644 --- a/deps/npm/test/lib/cli/exit-handler.js +++ b/deps/npm/test/lib/cli/exit-handler.js @@ -277,7 +277,6 @@ t.test('merges output buffers errors with --json', async (t) => { output.buffer({ output_data: 1 }) output.buffer({ more_data: 2 }) - output.buffer('not json, will be ignored') await exitHandler() diff --git a/deps/npm/test/lib/cli/update-notifier.js b/deps/npm/test/lib/cli/update-notifier.js index 2d29868b792a17..929e088bd4fa5c 100644 --- a/deps/npm/test/lib/cli/update-notifier.js +++ b/deps/npm/test/lib/cli/update-notifier.js @@ -1,5 +1,5 @@ const t = require('tap') -const { basename } = require('path') +const { basename } = require('node:path') const tmock = require('../../fixtures/tmock') const mockNpm = require('../../fixtures/mock-npm') @@ -27,7 +27,7 @@ const runUpdateNotifier = async (t, { ...config } = {}) => { const mockFs = { - ...require('fs/promises'), + ...require('node:fs/promises'), stat: async (path) => { if (basename(path) !== '_update-notifier-last-checked') { t.fail('no stat allowed for non upate notifier files') @@ -69,7 +69,7 @@ const runUpdateNotifier = async (t, { const mocks = { pacote: mockPacote, - 'fs/promises': mockFs, + 'node:fs/promises': mockFs, '{ROOT}/package.json': { version }, 'ci-info': { isCI: false, name: null }, ..._mocks, diff --git a/deps/npm/test/lib/commands/adduser.js b/deps/npm/test/lib/commands/adduser.js index 3063cdbeeab5ea..c69d996f91486f 100644 --- a/deps/npm/test/lib/commands/adduser.js +++ b/deps/npm/test/lib/commands/adduser.js @@ -1,12 +1,12 @@ const t = require('tap') -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const ini = require('ini') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const mockGlobals = require('@npmcli/mock-globals') const MockRegistry = require('@npmcli/mock-registry') -const stream = require('stream') +const stream = require('node:stream') const mockAddUser = async (t, { stdin: stdinLines, registry: registryUrl, ...options } = {}) => { if (stdinLines) { diff --git a/deps/npm/test/lib/commands/audit.js b/deps/npm/test/lib/commands/audit.js index d8714cb61912a8..4b239116188cae 100644 --- a/deps/npm/test/lib/commands/audit.js +++ b/deps/npm/test/lib/commands/audit.js @@ -1,6 +1,6 @@ -const fs = require('fs') -const zlib = require('zlib') -const path = require('path') +const fs = require('node:fs') +const zlib = require('node:zlib') +const path = require('node:path') const t = require('tap') const { default: tufmock } = require('@tufjs/repo-mock') diff --git a/deps/npm/test/lib/commands/cache.js b/deps/npm/test/lib/commands/cache.js index 15ee4dc80aa1aa..538a8c761a2d1d 100644 --- a/deps/npm/test/lib/commands/cache.js +++ b/deps/npm/test/lib/commands/cache.js @@ -3,8 +3,8 @@ const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const MockRegistry = require('@npmcli/mock-registry') const cacache = require('cacache') -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const pkg = 'test-package' @@ -71,7 +71,11 @@ t.test('cache add single pkg', async t => { registry: npm.config.get('registry'), }) const manifest = registry.manifest({ name: pkg }) - await registry.package({ manifest, tarballs: { '1.0.0': path.join(npm.prefix, 'package') } }) + await registry.package({ + manifest, + times: 2, + tarballs: { '1.0.0': path.join(npm.prefix, 'package') }, + }) await npm.exec('cache', ['add', pkg]) t.equal(joinedOutput(), '') // eslint-disable-next-line max-len @@ -99,9 +103,13 @@ t.test('cache add multiple pkgs', async t => { }) const manifest = registry.manifest({ name: pkg }) const manifest2 = registry.manifest({ name: pkg2 }) - await registry.package({ manifest, tarballs: { '1.0.0': path.join(npm.prefix, 'package') } }) await registry.package({ - manifest: manifest2, tarballs: { '1.0.0': path.join(npm.prefix, 'package') }, + manifest, + times: 2, + tarballs: { '1.0.0': path.join(npm.prefix, 'package') }, + }) + await registry.package({ + manifest: manifest2, times: 2, tarballs: { '1.0.0': path.join(npm.prefix, 'package') }, }) await npm.exec('cache', ['add', pkg, pkg2]) t.equal(joinedOutput(), '') diff --git a/deps/npm/test/lib/commands/ci.js b/deps/npm/test/lib/commands/ci.js index c4b855932a9ed5..8dc0f1d3cc149b 100644 --- a/deps/npm/test/lib/commands/ci.js +++ b/deps/npm/test/lib/commands/ci.js @@ -1,21 +1,14 @@ +const fs = require('node:fs') +const path = require('node:path') const t = require('tap') -const { load: _loadMockNpm } = require('../../fixtures/mock-npm') -const MockRegistry = require('@npmcli/mock-registry') -const path = require('path') -const fs = require('fs') +const { + loadNpmWithRegistry: loadMockNpm, + workspaceMock, +} = require('../../fixtures/mock-npm') // t.cleanSnapshot = str => str.replace(/ in [0-9ms]+/g, ' in {TIME}') -const loadMockNpm = async (t, opts) => { - const mock = await _loadMockNpm(t, opts) - const registry = new MockRegistry({ - tap: t, - registry: mock.npm.config.get('registry'), - }) - return { registry, ...mock } -} - const packageJson = { name: 'test-package', version: '1.0.0', @@ -109,11 +102,17 @@ t.test('reifies, audits, removes node_modules on repeat run', async t => { }, }) const manifest = registry.manifest({ name: 'abbrev' }) + await registry.tarball({ + times: 2, + manifest: manifest.versions['1.0.0'], + tarball: path.join(npm.prefix, 'abbrev'), + }) await registry.tarball({ manifest: manifest.versions['1.0.0'], tarball: path.join(npm.prefix, 'abbrev'), }) registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) await npm.exec('ci', []) await npm.exec('ci', []) t.match(joinedOutput(), 'added 1 package, and audited 2 packages in') @@ -142,9 +141,6 @@ t.test('--no-audit and --ignore-scripts', async t => { 'package-lock.json': JSON.stringify(packageLock), }, }) - require('nock').emitter.on('no match', () => { - t.fail('Should not audit') - }) const manifest = registry.manifest({ name: 'abbrev' }) await registry.tarball({ manifest: manifest.versions['1.0.0'], @@ -230,3 +226,85 @@ t.test('should throw error when ideal inventory mismatches virtual', async t => const nmTestFile = path.join(npm.prefix, 'node_modules', 'test-file') t.equal(fs.existsSync(nmTestFile), true, 'does not remove node_modules') }) + +t.test('should remove dirty node_modules with unhoisted workspace module', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + prefixDir: workspaceMock(t, { + clean: false, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { }, + }, + 'workspace-b': { + 'abbrev@1.1.1': { hoist: false }, + }, + }, + }), + }) + await registry.setup({ + 'abbrev@1.1.0': path.join(npm.prefix, 'tarballs/abbrev@1.1.0'), + 'abbrev@1.1.1': path.join(npm.prefix, 'tarballs/abbrev@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageDirty('node_modules/abbrev@1.1.0') + assert.packageDirty('workspace-b/node_modules/abbrev@1.1.1') + await npm.exec('ci', []) + assert.packageInstalled('node_modules/abbrev@1.1.0') + assert.packageInstalled('workspace-b/node_modules/abbrev@1.1.1') +}) + +t.test('should remove dirty node_modules with hoisted workspace modules', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + prefixDir: workspaceMock(t, { + clean: false, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { }, + }, + 'workspace-b': { + 'lodash@1.1.1': { }, + }, + }, + }), + }) + await registry.setup({ + 'abbrev@1.1.0': path.join(npm.prefix, 'tarballs/abbrev@1.1.0'), + 'lodash@1.1.1': path.join(npm.prefix, 'tarballs/lodash@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageDirty('node_modules/abbrev@1.1.0') + assert.packageDirty('node_modules/lodash@1.1.1') + await npm.exec('ci', []) + assert.packageInstalled('node_modules/abbrev@1.1.0') + assert.packageInstalled('node_modules/lodash@1.1.1') +}) + +/** this behaves the same way as install but will remove all workspace node_modules */ +t.test('should use --workspace flag', async t => { + t.saveFixture = true + const { npm, registry, assert } = await loadMockNpm(t, { + config: { + workspace: 'workspace-b', + }, + prefixDir: workspaceMock(t, { + clean: false, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { }, + }, + 'workspace-b': { + 'lodash@1.1.1': { }, + }, + }, + }), + }) + await registry.setup({ + 'lodash@1.1.1': path.join(npm.prefix, 'tarballs/lodash@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageDirty('node_modules/abbrev@1.1.0') + assert.packageDirty('node_modules/lodash@1.1.1') + await npm.exec('ci', []) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageInstalled('node_modules/lodash@1.1.1') +}) diff --git a/deps/npm/test/lib/commands/completion.js b/deps/npm/test/lib/commands/completion.js index 904d9410fdd6c7..e9ed95929fc345 100644 --- a/deps/npm/test/lib/commands/completion.js +++ b/deps/npm/test/lib/commands/completion.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs') -const path = require('path') +const fs = require('node:fs') +const path = require('node:path') const { load: loadMockNpm } = require('../../fixtures/mock-npm') const completionScript = fs diff --git a/deps/npm/test/lib/commands/config.js b/deps/npm/test/lib/commands/config.js index 1a3644a07623b5..849f832554aab1 100644 --- a/deps/npm/test/lib/commands/config.js +++ b/deps/npm/test/lib/commands/config.js @@ -1,5 +1,5 @@ -const { join } = require('path') -const fs = require('fs/promises') +const { join } = require('node:path') +const fs = require('node:fs/promises') const ini = require('ini') const tspawk = require('../../fixtures/tspawk') const t = require('tap') diff --git a/deps/npm/test/lib/commands/dedupe.js b/deps/npm/test/lib/commands/dedupe.js index 604ed21a257fc4..c94b0b8228cead 100644 --- a/deps/npm/test/lib/commands/dedupe.js +++ b/deps/npm/test/lib/commands/dedupe.js @@ -1,6 +1,6 @@ const t = require('tap') -const path = require('path') -const fs = require('fs') +const path = require('node:path') +const fs = require('node:fs') const { load: loadMockNpm } = require('../../fixtures/mock-npm') const MockRegistry = require('@npmcli/mock-registry') diff --git a/deps/npm/test/lib/commands/diff.js b/deps/npm/test/lib/commands/diff.js index 36a9e4bc17d9f1..3d55cd7879b7a7 100644 --- a/deps/npm/test/lib/commands/diff.js +++ b/deps/npm/test/lib/commands/diff.js @@ -1,5 +1,5 @@ const t = require('tap') -const { join, extname } = require('path') +const { join, extname } = require('node:path') const MockRegistry = require('@npmcli/mock-registry') const { load: loadMockNpm } = require('../../fixtures/mock-npm') diff --git a/deps/npm/test/lib/commands/docs.js b/deps/npm/test/lib/commands/docs.js index 2a7951edeaf764..2dce707bf1a41f 100644 --- a/deps/npm/test/lib/commands/docs.js +++ b/deps/npm/test/lib/commands/docs.js @@ -1,6 +1,6 @@ const t = require('tap') const mockNpm = require('../../fixtures/mock-npm.js') -const { sep } = require('path') +const { sep } = require('node:path') const fixtures = { pkg: { diff --git a/deps/npm/test/lib/commands/doctor.js b/deps/npm/test/lib/commands/doctor.js index 7dd53e10457d0f..0c58a09e20c577 100644 --- a/deps/npm/test/lib/commands/doctor.js +++ b/deps/npm/test/lib/commands/doctor.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs/promises') -const path = require('path') +const fs = require('node:fs/promises') +const path = require('node:path') const { load: loadMockNpm } = require('../../fixtures/mock-npm') const tnock = require('../../fixtures/tnock.js') @@ -390,7 +390,7 @@ t.test('incorrect owner', async t => { const { joinedOutput, logs, npm } = await loadMockNpm(t, { mocks: { ...mocks, - 'fs/promises': { + 'node:fs/promises': { ...fs, lstat: async (p) => { const stat = await fs.lstat(p) @@ -419,7 +419,7 @@ t.test('incorrect permissions', async t => { const { joinedOutput, logs, npm } = await loadMockNpm(t, { mocks: { ...mocks, - 'fs/promises': { + 'node:fs/promises': { ...fs, access: async () => { throw new Error('Test Error') @@ -443,7 +443,7 @@ t.test('error reading directory', async t => { const { joinedOutput, logs, npm } = await loadMockNpm(t, { mocks: { ...mocks, - 'fs/promises': { + 'node:fs/promises': { ...fs, readdir: async (s, ...args) => { if (s.endsWith('_logs')) { diff --git a/deps/npm/test/lib/commands/edit.js b/deps/npm/test/lib/commands/edit.js index 02621f1aef9825..ae6826f7f98ade 100644 --- a/deps/npm/test/lib/commands/edit.js +++ b/deps/npm/test/lib/commands/edit.js @@ -1,5 +1,5 @@ const t = require('tap') -const path = require('path') +const path = require('node:path') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') diff --git a/deps/npm/test/lib/commands/exec.js b/deps/npm/test/lib/commands/exec.js index d0aa5f9a33974c..c2977a2f577cb3 100644 --- a/deps/npm/test/lib/commands/exec.js +++ b/deps/npm/test/lib/commands/exec.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs/promises') -const path = require('path') +const fs = require('node:fs/promises') +const path = require('node:path') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const MockRegistry = require('@npmcli/mock-registry') diff --git a/deps/npm/test/lib/commands/explain.js b/deps/npm/test/lib/commands/explain.js index f4d898797bcbe4..b55371c8b7e5c4 100644 --- a/deps/npm/test/lib/commands/explain.js +++ b/deps/npm/test/lib/commands/explain.js @@ -1,5 +1,5 @@ const t = require('tap') -const { resolve } = require('path') +const { resolve } = require('node:path') const mockNpm = require('../../fixtures/mock-npm.js') const mockExplain = async (t, opts) => { diff --git a/deps/npm/test/lib/commands/find-dupes.js b/deps/npm/test/lib/commands/find-dupes.js index 40022fa0651219..83dca6240b1c2b 100644 --- a/deps/npm/test/lib/commands/find-dupes.js +++ b/deps/npm/test/lib/commands/find-dupes.js @@ -1,6 +1,6 @@ const t = require('tap') -const path = require('path') -const fs = require('fs') +const path = require('node:path') +const fs = require('node:fs') const { load: loadMockNpm } = require('../../fixtures/mock-npm') const MockRegistry = require('@npmcli/mock-registry') diff --git a/deps/npm/test/lib/commands/init.js b/deps/npm/test/lib/commands/init.js index 6dd23560bf8fa3..f210c9bc2c9315 100644 --- a/deps/npm/test/lib/commands/init.js +++ b/deps/npm/test/lib/commands/init.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs/promises') -const { resolve, basename } = require('path') +const fs = require('node:fs/promises') +const { resolve, basename } = require('node:path') const _mockNpm = require('../../fixtures/mock-npm') const { cleanTime } = require('../../fixtures/clean-snapshot') diff --git a/deps/npm/test/lib/commands/install.js b/deps/npm/test/lib/commands/install.js index 8bb84bfff581fe..0273f3deec73e9 100644 --- a/deps/npm/test/lib/commands/install.js +++ b/deps/npm/test/lib/commands/install.js @@ -1,9 +1,14 @@ -const t = require('tap') const tspawk = require('../../fixtures/tspawk') -const MockRegistry = require('@npmcli/mock-registry') -const { load: loadMockNpm } = require('../../fixtures/mock-npm') + const path = require('node:path') +const t = require('tap') + +const { + loadNpmWithRegistry: loadMockNpm, + workspaceMock, +} = require('../../fixtures/mock-npm') +// tspawk calls preventUnmatched which assures that no scripts run if we don't mock any const spawk = tspawk(t) const abbrev = { @@ -19,11 +24,9 @@ const packageJson = { }, } -// tspawk calls preventUnmatched which assures that no scripts run if we don't mock any - t.test('exec commands', async t => { await t.test('with args does not run lifecycle scripts', async t => { - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { config: { audit: false, }, @@ -37,11 +40,6 @@ t.test('exec commands', async t => { abbrev, }, }) - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) - const manifest = registry.manifest({ name: 'abbrev' }) await registry.package({ manifest }) await registry.tarball({ @@ -70,7 +68,7 @@ t.test('exec commands', async t => { }) scripts[script] = `${script} lifecycle script` } - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { config: { audit: false, }, @@ -83,10 +81,6 @@ t.test('exec commands', async t => { }, }) const runOrder = [] - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) const manifest = registry.manifest({ name: 'abbrev' }) await registry.package({ manifest }) await registry.tarball({ @@ -99,7 +93,7 @@ t.test('exec commands', async t => { }) await t.test('should ignore scripts with --ignore-scripts', async t => { - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { config: { 'ignore-scripts': true, audit: false, @@ -114,11 +108,6 @@ t.test('exec commands', async t => { abbrev, }, }) - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) - const manifest = registry.manifest({ name: 'abbrev' }) await registry.package({ manifest }) await registry.tarball({ @@ -143,7 +132,7 @@ t.test('exec commands', async t => { }) await t.test('npm i -g npm engines check success', async t => { - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { prefixDir: { npm: { 'package.json': JSON.stringify({ name: 'npm', version: '1.0.0' }), @@ -152,10 +141,6 @@ t.test('exec commands', async t => { }, config: { global: true }, }) - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) const manifest = registry.manifest({ name: 'npm', packuments: [{ version: '1.0.0', engines: { node: '>1' } }], @@ -170,7 +155,7 @@ t.test('exec commands', async t => { }) await t.test('npm i -g npm engines check failure', async t => { - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { prefixDir: { npm: { 'package.json': JSON.stringify({ name: 'npm', version: '1.0.0' }), @@ -179,10 +164,7 @@ t.test('exec commands', async t => { }, config: { global: true }, }) - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) + const manifest = registry.manifest({ name: 'npm', packuments: [{ version: '1.0.0', engines: { node: '~1' } }], @@ -206,7 +188,7 @@ t.test('exec commands', async t => { }) await t.test('npm i -g npm engines check failure forced override', async t => { - const { npm } = await loadMockNpm(t, { + const { npm, registry } = await loadMockNpm(t, { prefixDir: { npm: { 'package.json': JSON.stringify({ name: 'npm', version: '1.0.0' }), @@ -215,10 +197,6 @@ t.test('exec commands', async t => { }, config: { global: true, force: true }, }) - const registry = new MockRegistry({ - tap: t, - registry: npm.config.get('registry'), - }) const manifest = registry.manifest({ name: 'npm', packuments: [{ version: '1.0.0', engines: { node: '~1' } }], @@ -288,3 +266,137 @@ t.test('completion', async t => { t.strictSame(res, []) }) }) + +t.test('should install in workspace with unhoisted module', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + prefixDir: workspaceMock(t, { + clean: true, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { hoist: true }, + }, + 'workspace-b': { + 'abbrev@1.1.1': { hoist: false }, + }, + }, + }), + }) + await registry.setup({ + 'abbrev@1.1.0': path.join(npm.prefix, 'tarballs/abbrev@1.1.0'), + 'abbrev@1.1.1': path.join(npm.prefix, 'tarballs/abbrev@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageMissing('workspace-b/node_modules/abbrev@1.1.1') + await npm.exec('install', []) + assert.packageInstalled('node_modules/abbrev@1.1.0') + assert.packageInstalled('workspace-b/node_modules/abbrev@1.1.1') +}) + +t.test('should install in workspace with hoisted modules', async t => { + const prefixDir = workspaceMock(t, { + clean: true, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { hoist: true }, + }, + 'workspace-b': { + 'lodash@1.1.1': { hoist: true }, + }, + }, + }) + const { npm, registry, assert } = await loadMockNpm(t, { prefixDir }) + await registry.setup({ + 'abbrev@1.1.0': path.join(npm.prefix, 'tarballs/abbrev@1.1.0'), + 'lodash@1.1.1': path.join(npm.prefix, 'tarballs/lodash@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageMissing('node_modules/lodash@1.1.1') + await npm.exec('install', []) + assert.packageInstalled('node_modules/abbrev@1.1.0') + assert.packageInstalled('node_modules/lodash@1.1.1') +}) + +t.test('should install unhoisted module with --workspace flag', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + config: { + workspace: 'workspace-b', + }, + prefixDir: workspaceMock(t, { + clean: true, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { hoist: true }, + }, + 'workspace-b': { + 'abbrev@1.1.1': { hoist: false }, + }, + }, + }), + }) + await registry.setup({ + 'abbrev@1.1.1': path.join(npm.prefix, 'tarballs/abbrev@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageMissing('workspace-b/node_modules/abbrev@1.1.1') + await npm.exec('install', []) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageInstalled('workspace-b/node_modules/abbrev@1.1.1') +}) + +t.test('should install hoisted module with --workspace flag', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + config: { + workspace: 'workspace-b', + }, + prefixDir: workspaceMock(t, { + clean: true, + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { hoist: true }, + }, + 'workspace-b': { + 'lodash@1.1.1': { hoist: true }, + }, + }, + }), + }) + await registry.setup({ + 'lodash@1.1.1': path.join(npm.prefix, 'tarballs/lodash@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageMissing('node_modules/lodash@1.1.1') + await npm.exec('install', []) + assert.packageMissing('node_modules/abbrev@1.1.0') + assert.packageInstalled('node_modules/lodash@1.1.1') +}) + +t.test('should show install keeps dirty --workspace flag', async t => { + const { npm, registry, assert } = await loadMockNpm(t, { + config: { + workspace: 'workspace-b', + }, + prefixDir: workspaceMock(t, { + workspaces: { + 'workspace-a': { + 'abbrev@1.1.0': { clean: false, hoist: true }, + }, + 'workspace-b': { + 'lodash@1.1.1': { clean: true, hoist: true }, + }, + }, + }), + }) + await registry.setup({ + 'lodash@1.1.1': path.join(npm.prefix, 'tarballs/lodash@1.1.1'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + assert.packageDirty('node_modules/abbrev@1.1.0') + assert.packageMissing('node_modules/lodash@1.1.1') + await npm.exec('install', []) + assert.packageDirty('node_modules/abbrev@1.1.0') + assert.packageInstalled('node_modules/lodash@1.1.1') +}) diff --git a/deps/npm/test/lib/commands/link.js b/deps/npm/test/lib/commands/link.js index 85bada28d67b1e..184f7d64203397 100644 --- a/deps/npm/test/lib/commands/link.js +++ b/deps/npm/test/lib/commands/link.js @@ -1,6 +1,6 @@ const t = require('tap') -const { resolve, join } = require('path') -const fs = require('fs') +const { resolve, join } = require('node:path') +const fs = require('node:fs') const Arborist = require('@npmcli/arborist') const { cleanCwd } = require('../../fixtures/clean-snapshot.js') const mockNpm = require('../../fixtures/mock-npm') diff --git a/deps/npm/test/lib/commands/logout.js b/deps/npm/test/lib/commands/logout.js index 3087c8bb1e61d1..840c92274bad01 100644 --- a/deps/npm/test/lib/commands/logout.js +++ b/deps/npm/test/lib/commands/logout.js @@ -1,8 +1,8 @@ const t = require('tap') -const fs = require('fs/promises') +const fs = require('node:fs/promises') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const MockRegistry = require('@npmcli/mock-registry') -const { join } = require('path') +const { join } = require('node:path') t.test('token logout - user config', async t => { const { npm, home, logs } = await loadMockNpm(t, { diff --git a/deps/npm/test/lib/commands/ls.js b/deps/npm/test/lib/commands/ls.js index 9b773345525b5d..2147b3f036d722 100644 --- a/deps/npm/test/lib/commands/ls.js +++ b/deps/npm/test/lib/commands/ls.js @@ -4,7 +4,7 @@ // may change when node-tap is updated. const t = require('tap') -const { utimesSync } = require('fs') +const { utimesSync } = require('node:fs') const mockNpm = require('../../fixtures/mock-npm.js') const { cleanCwd } = require('../../fixtures/clean-snapshot') @@ -100,7 +100,7 @@ const mockLs = async (t, { mocks, config, ...opts } = {}) => { command: 'ls', mocks: { path: { - ...require('path'), + ...require('node:path'), sep: '/', }, ...mocks, diff --git a/deps/npm/test/lib/commands/outdated.js b/deps/npm/test/lib/commands/outdated.js index 7becc79d62e17d..27e674c76470aa 100644 --- a/deps/npm/test/lib/commands/outdated.js +++ b/deps/npm/test/lib/commands/outdated.js @@ -153,6 +153,8 @@ const fixtures = { a: t.fixture('symlink', '../packages/a'), b: t.fixture('symlink', '../packages/b'), c: t.fixture('symlink', '../packages/c'), + d: t.fixture('symlink', '../packages/d'), + e: t.fixture('symlink', '../packages/e'), cat: { 'package.json': JSON.stringify({ name: 'cat', @@ -228,6 +230,24 @@ const fixtures = { }, }), }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0', + dependencies: { + theta: '^1.0.0', + }, + }), + }, + e: { + 'package.json': JSON.stringify({ + name: 'e', + version: '1.0.0', + dependencies: { + theta: '^1.0.0', + }, + }), + }, }, }, } diff --git a/deps/npm/test/lib/commands/owner.js b/deps/npm/test/lib/commands/owner.js index ec774d16470484..e8b890a753eb1f 100644 --- a/deps/npm/test/lib/commands/owner.js +++ b/deps/npm/test/lib/commands/owner.js @@ -2,7 +2,7 @@ const t = require('tap') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const MockRegistry = require('@npmcli/mock-registry') -const path = require('path') +const path = require('node:path') const npa = require('npm-package-arg') const packageName = '@npmcli/test-package' const spec = npa(packageName) diff --git a/deps/npm/test/lib/commands/pack.js b/deps/npm/test/lib/commands/pack.js index fd525114cde9fb..7e98b12704df9b 100644 --- a/deps/npm/test/lib/commands/pack.js +++ b/deps/npm/test/lib/commands/pack.js @@ -1,8 +1,8 @@ const t = require('tap') const { load: loadMockNpm } = require('../../fixtures/mock-npm') const { cleanZlib } = require('../../fixtures/clean-snapshot') -const path = require('path') -const fs = require('fs') +const path = require('node:path') +const fs = require('node:fs') t.cleanSnapshot = data => cleanZlib(data) diff --git a/deps/npm/test/lib/commands/pkg.js b/deps/npm/test/lib/commands/pkg.js index 2941faf90c5841..2306fe10db0251 100644 --- a/deps/npm/test/lib/commands/pkg.js +++ b/deps/npm/test/lib/commands/pkg.js @@ -1,5 +1,5 @@ -const { resolve } = require('path') -const { readFileSync } = require('fs') +const { resolve } = require('node:path') +const { readFileSync } = require('node:fs') const t = require('tap') const _mockNpm = require('../../fixtures/mock-npm') const { cleanCwd } = require('../../fixtures/clean-snapshot') diff --git a/deps/npm/test/lib/commands/publish.js b/deps/npm/test/lib/commands/publish.js index 9e7ba6b0705838..fa43994679b97b 100644 --- a/deps/npm/test/lib/commands/publish.js +++ b/deps/npm/test/lib/commands/publish.js @@ -4,8 +4,8 @@ const { cleanZlib } = require('../../fixtures/clean-snapshot') const MockRegistry = require('@npmcli/mock-registry') const pacote = require('pacote') const Arborist = require('@npmcli/arborist') -const path = require('path') -const fs = require('fs') +const path = require('node:path') +const fs = require('node:fs') const npa = require('npm-package-arg') const pkg = 'test-package' @@ -617,6 +617,48 @@ t.test('workspaces', t => { await t.rejects(npm.exec('publish', []), { code: 'E404' }) }) + t.test('all workspaces - some marked private', async t => { + const testDir = { + 'package.json': JSON.stringify( + { + ...pkgJson, + workspaces: ['workspace-a', 'workspace-p'], + }, null, 2), + 'workspace-a': { + 'package.json': JSON.stringify({ + name: 'workspace-a', + version: '1.2.3-a', + }), + }, + 'workspace-p': { + 'package.json': JSON.stringify({ + name: '@scoped/workspace-p', + private: true, + version: '1.2.3-p-scoped', + }), + }, + } + + const { npm, joinedOutput } = await loadMockNpm(t, { + config: { + ...auth, + workspaces: true, + }, + prefixDir: testDir, + }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: token, + }) + registry.nock + .put('/workspace-a', body => { + return t.match(body, { name: 'workspace-a' }) + }).reply(200, {}) + await npm.exec('publish', []) + t.matchSnapshot(joinedOutput(), 'one marked private') + }) + t.test('invalid workspace', async t => { const { npm } = await loadMockNpm(t, { config: { diff --git a/deps/npm/test/lib/commands/rebuild.js b/deps/npm/test/lib/commands/rebuild.js index bda161772ddfc5..aa5578460b90fe 100644 --- a/deps/npm/test/lib/commands/rebuild.js +++ b/deps/npm/test/lib/commands/rebuild.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs') -const { resolve } = require('path') +const fs = require('node:fs') +const { resolve } = require('node:path') const setupMockNpm = require('../../fixtures/mock-npm') t.test('no args', async t => { diff --git a/deps/npm/test/lib/commands/repo.js b/deps/npm/test/lib/commands/repo.js index f6e3ed753d0393..1a8c9709ce1332 100644 --- a/deps/npm/test/lib/commands/repo.js +++ b/deps/npm/test/lib/commands/repo.js @@ -1,6 +1,6 @@ const t = require('tap') const mockNpm = require('../../fixtures/mock-npm.js') -const { sep } = require('path') +const { sep } = require('node:path') const fixture = { 'package.json': JSON.stringify({ diff --git a/deps/npm/test/lib/commands/run-script.js b/deps/npm/test/lib/commands/run-script.js index 5009f132057478..6906a7de67d0b4 100644 --- a/deps/npm/test/lib/commands/run-script.js +++ b/deps/npm/test/lib/commands/run-script.js @@ -1,5 +1,5 @@ const t = require('tap') -const { resolve } = require('path') +const { resolve } = require('node:path') const realRunScript = require('@npmcli/run-script') const mockNpm = require('../../fixtures/mock-npm') const { cleanCwd } = require('../../fixtures/clean-snapshot') diff --git a/deps/npm/test/lib/commands/sbom.js b/deps/npm/test/lib/commands/sbom.js index 3c79ed82cf8370..25f6135ef8a147 100644 --- a/deps/npm/test/lib/commands/sbom.js +++ b/deps/npm/test/lib/commands/sbom.js @@ -70,8 +70,8 @@ const mockSbom = async (t, { mocks, config, ...opts } = {}) => { }, command: 'sbom', mocks: { - path: { - ...require('path'), + 'node:path': { + ...require('node:path'), sep: '/', }, ...mocks, diff --git a/deps/npm/test/lib/commands/set.js b/deps/npm/test/lib/commands/set.js index 69c4dd87056af9..a4a2a7349ef1a9 100644 --- a/deps/npm/test/lib/commands/set.js +++ b/deps/npm/test/lib/commands/set.js @@ -1,7 +1,7 @@ const t = require('tap') -const fs = require('fs/promises') +const fs = require('node:fs/promises') const mockNpm = require('../../fixtures/mock-npm') -const { join } = require('path') +const { join } = require('node:path') const { cleanNewlines } = require('../../fixtures/clean-snapshot') t.test('no args', async t => { diff --git a/deps/npm/test/lib/commands/shrinkwrap.js b/deps/npm/test/lib/commands/shrinkwrap.js index c5909a3ceaeac2..ec65ca604a88b8 100644 --- a/deps/npm/test/lib/commands/shrinkwrap.js +++ b/deps/npm/test/lib/commands/shrinkwrap.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs') -const { resolve } = require('path') +const fs = require('node:fs') +const { resolve } = require('node:path') const { load: loadMockNpm } = require('../../fixtures/mock-npm') // Attempt to parse json values in snapshots before diff --git a/deps/npm/test/lib/commands/uninstall.js b/deps/npm/test/lib/commands/uninstall.js index ae116d44c208bf..a1ef1745d0f555 100644 --- a/deps/npm/test/lib/commands/uninstall.js +++ b/deps/npm/test/lib/commands/uninstall.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs') -const { resolve } = require('path') +const fs = require('node:fs') +const { resolve } = require('node:path') const _mockNpm = require('../../fixtures/mock-npm') const mockNpm = async (t, opts = {}) => { diff --git a/deps/npm/test/lib/commands/version.js b/deps/npm/test/lib/commands/version.js index 1f02f368f67bc0..35987ed83cb7a4 100644 --- a/deps/npm/test/lib/commands/version.js +++ b/deps/npm/test/lib/commands/version.js @@ -1,5 +1,5 @@ -const { readFileSync, statSync } = require('fs') -const { resolve } = require('path') +const { readFileSync, statSync } = require('node:fs') +const { resolve } = require('node:path') const t = require('tap') const _mockNpm = require('../../fixtures/mock-npm') const mockGlobals = require('@npmcli/mock-globals') diff --git a/deps/npm/test/lib/commands/view.js b/deps/npm/test/lib/commands/view.js index d15d62f8acdcba..5da9182ddd55ef 100644 --- a/deps/npm/test/lib/commands/view.js +++ b/deps/npm/test/lib/commands/view.js @@ -270,14 +270,45 @@ const packument = (nv, opts) => { }, }, }, + // this is a packaged named error which will conflict with + // the error key in json output + error: { + _id: 'error', + name: 'error', + 'dist-tags': { + latest: '1.0.0', + }, + versions: { + '1.0.0': { + name: 'error', + version: '1.0.0', + dist: { + shasum: '123', + tarball: 'http://hm.error.com/1.0.0.tgz', + fileCount: 1, + }, + }, + }, + }, } + if (nv.type === 'git') { return mocks[nv.hosted.project] } + if (nv.raw === './blue') { return mocks.blue } - return mocks[nv.name] + + if (mocks[nv.name]) { + return mocks[nv.name] + } + + if (nv.name === 'unknown-error') { + throw new Error('Unknown error') + } + + throw Object.assign(new Error('404'), { code: 'E404' }) } const loadMockNpm = async function (t, opts = {}) { @@ -375,6 +406,12 @@ t.test('package with --json and no versions', async t => { t.equal(joinedOutput(), '', 'no info to display') }) +t.test('package with --json and single string arg', async t => { + const { view, joinedOutput } = await loadMockNpm(t, { config: { json: true } }) + await view.exec(['blue', 'dist-tags.latest']) + t.equal(JSON.parse(joinedOutput()), '1.0.0', 'no info to display') +}) + t.test('package with single version', async t => { t.test('full json', async t => { const { view, joinedOutput } = await loadMockNpm(t, { config: { json: true } }) @@ -543,6 +580,33 @@ t.test('workspaces', async t => { }, } + const prefixDir404 = { + 'test-workspace-b': { + 'package.json': JSON.stringify({ + name: 'missing-package', + version: '1.2.3', + }), + }, + } + + const prefixDirError = { + 'test-workspace-b': { + 'package.json': JSON.stringify({ + name: 'unknown-error', + version: '1.2.3', + }), + }, + } + + const prefixPackageNamedError = { + 'test-workspace-a': { + 'package.json': JSON.stringify({ + name: 'error', + version: '1.2.3', + }), + }, + } + t.test('all workspaces', async t => { const { view, joinedOutput } = await loadMockNpm(t, { prefixDir, @@ -624,6 +688,56 @@ t.test('workspaces', async t => { t.matchSnapshot(joinedOutput()) t.matchSnapshot(logs.warn, 'should have warning of ignoring workspaces') }) + + t.test('404 workspaces', async t => { + t.test('basic', async t => { + const { view, joinedFullOutput } = await loadMockNpm(t, { + prefixDir: { ...prefixDir, ...prefixDir404 }, + config: { workspaces: true, loglevel: 'error' }, + }) + await view.exec([]) + t.matchSnapshot(joinedFullOutput()) + t.equal(process.exitCode, 1) + }) + + t.test('json', async t => { + const { view, joinedFullOutput } = await loadMockNpm(t, { + prefixDir: { ...prefixDir, ...prefixDir404 }, + config: { workspaces: true, json: true, loglevel: 'error' }, + }) + await view.exec([]) + t.matchSnapshot(joinedFullOutput()) + t.equal(process.exitCode, 1) + }) + + t.test('json with package named error', async t => { + const { view, joinedFullOutput } = await loadMockNpm(t, { + prefixDir: { ...prefixDir, ...prefixDir404, ...prefixPackageNamedError }, + config: { workspaces: true, json: true, loglevel: 'warn' }, + }) + await view.exec([]) + t.matchSnapshot(joinedFullOutput()) + t.equal(process.exitCode, 1) + }) + + t.test('non-404 error rejects', async t => { + const { view, joinedFullOutput } = await loadMockNpm(t, { + prefixDir: { ...prefixDir, ...prefixDirError }, + config: { workspaces: true, loglevel: 'error' }, + }) + await t.rejects(view.exec([])) + t.matchSnapshot(joinedFullOutput()) + }) + + t.test('non-404 error rejects with single arg', async t => { + const { view, joinedFullOutput } = await loadMockNpm(t, { + prefixDir: { ...prefixDir, ...prefixDirError }, + config: { workspaces: true, loglevel: 'error' }, + }) + await t.rejects(view.exec(['.', 'version'])) + t.matchSnapshot(joinedFullOutput()) + }) + }) }) t.test('completion', async t => { diff --git a/deps/npm/test/lib/docs.js b/deps/npm/test/lib/docs.js index 67afd1b54d91e6..833e58831ea51d 100644 --- a/deps/npm/test/lib/docs.js +++ b/deps/npm/test/lib/docs.js @@ -1,6 +1,6 @@ const t = require('tap') -const { join, resolve, basename, extname } = require('path') -const fs = require('fs/promises') +const { join, resolve, basename, extname } = require('node:path') +const fs = require('node:fs/promises') const localeCompare = require('@isaacs/string-locale-compare')('en') const docs = require('@npmcli/docs') diff --git a/deps/npm/test/lib/load-all-commands.js b/deps/npm/test/lib/load-all-commands.js index c00da37eff3fc3..892dd466ac5c47 100644 --- a/deps/npm/test/lib/load-all-commands.js +++ b/deps/npm/test/lib/load-all-commands.js @@ -3,7 +3,7 @@ // name, a description, and if it has completion it is a function. That it // renders also ensures that any params we've defined in our commands work. const t = require('tap') -const util = require('util') +const util = require('node:util') const { load: loadMockNpm } = require('../fixtures/mock-npm.js') const { commands } = require('../../lib/utils/cmd-list.js') const BaseCommand = require('../../lib/base-cmd.js') diff --git a/deps/npm/test/lib/npm.js b/deps/npm/test/lib/npm.js index a4f12f01c500aa..00ef3f79b04c17 100644 --- a/deps/npm/test/lib/npm.js +++ b/deps/npm/test/lib/npm.js @@ -1,6 +1,6 @@ const t = require('tap') -const { resolve, dirname, join } = require('path') -const fs = require('fs') +const { resolve, dirname, join } = require('node:path') +const fs = require('node:fs') const { time } = require('proc-log') const { load: loadMockNpm } = require('../fixtures/mock-npm.js') const mockGlobals = require('@npmcli/mock-globals') diff --git a/deps/npm/test/lib/utils/audit-error.js b/deps/npm/test/lib/utils/audit-error.js index 9d6192fbc31be2..00780f9e0bcf23 100644 --- a/deps/npm/test/lib/utils/audit-error.js +++ b/deps/npm/test/lib/utils/audit-error.js @@ -19,6 +19,8 @@ const auditError = async (t, { command, error, ...config } = {}) => { res.error = err } + mock.npm.finish() + return { ...res, logs: mock.logs.warn.byTitle('audit'), diff --git a/deps/npm/test/lib/utils/auth.js b/deps/npm/test/lib/utils/auth.js index 7d7f63d7ddfd50..01d254ad8a0e72 100644 --- a/deps/npm/test/lib/utils/auth.js +++ b/deps/npm/test/lib/utils/auth.js @@ -2,6 +2,7 @@ const t = require('tap') const setupMockNpm = require('../../fixtures/mock-npm') const tmock = require('../../fixtures/tmock') +// TODO make this real and not a mock const setupOtplease = async (t, { otp = {}, ...rest }, fn) => { const { otplease } = tmock(t, '{LIB}/utils/auth.js', { '{LIB}/utils/read-user-info.js': { @@ -13,7 +14,7 @@ const setupOtplease = async (t, { otp = {}, ...rest }, fn) => { 'npm-profile': { webAuthOpener: async (opener) => { opener() - return '1234' + return { token: '1234' } }, }, }) @@ -67,16 +68,16 @@ t.test('prompts for otp for EOTP', async (t) => { t.test('returns function results on webauth success', async (t) => { const fn = ({ otp }) => { - if (otp) { - return 'success' + if (!otp) { + throw Object.assign(new Error('nope'), { + code: 'EOTP', + body: { + authUrl: 'https://www.example.com/auth', + doneUrl: 'https://www.example.com/done', + }, + }) } - throw Object.assign(new Error('nope'), { - code: 'EOTP', - body: { - authUrl: 'https://www.example.com/auth', - doneUrl: 'https://www.example.com/done', - }, - }) + return 'success' } const result = await setupOtplease(t, { diff --git a/deps/npm/test/lib/utils/display.js b/deps/npm/test/lib/utils/display.js index 33f9360e5728cf..78bffa0221d03a 100644 --- a/deps/npm/test/lib/utils/display.js +++ b/deps/npm/test/lib/utils/display.js @@ -3,7 +3,7 @@ const timers = require('node:timers/promises') const tmock = require('../../fixtures/tmock') const mockLogs = require('../../fixtures/mock-logs') const mockGlobals = require('@npmcli/mock-globals') -const { inspect } = require('util') +const { inspect } = require('node:util') const mockDisplay = async (t, { mocks, load } = {}) => { const procLog = require('proc-log') diff --git a/deps/npm/test/lib/utils/error-message.js b/deps/npm/test/lib/utils/error-message.js index c99971fd412338..1939e27c8ba922 100644 --- a/deps/npm/test/lib/utils/error-message.js +++ b/deps/npm/test/lib/utils/error-message.js @@ -1,6 +1,6 @@ const t = require('tap') -const { resolve } = require('path') -const fs = require('fs/promises') +const { resolve } = require('node:path') +const fs = require('node:fs/promises') const { load: _loadMockNpm } = require('../../fixtures/mock-npm.js') const mockGlobals = require('@npmcli/mock-globals') const tmock = require('../../fixtures/tmock') diff --git a/deps/npm/test/lib/utils/explain-dep.js b/deps/npm/test/lib/utils/explain-dep.js index 06174f36a7ffcc..a90c0e90d5da63 100644 --- a/deps/npm/test/lib/utils/explain-dep.js +++ b/deps/npm/test/lib/utils/explain-dep.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const t = require('tap') const { explainNode, printNode } = require('../../../lib/utils/explain-dep.js') const { cleanCwd } = require('../../fixtures/clean-snapshot') diff --git a/deps/npm/test/lib/utils/get-workspaces.js b/deps/npm/test/lib/utils/get-workspaces.js index 931f90d13046fd..1df21d885f2789 100644 --- a/deps/npm/test/lib/utils/get-workspaces.js +++ b/deps/npm/test/lib/utils/get-workspaces.js @@ -1,4 +1,4 @@ -const { resolve } = require('path') +const { resolve } = require('node:path') const t = require('tap') const getWorkspaces = require('../../../lib/utils/get-workspaces.js') diff --git a/deps/npm/test/lib/utils/log-file.js b/deps/npm/test/lib/utils/log-file.js index 8e07da8671b6ad..cb550b58c4fd04 100644 --- a/deps/npm/test/lib/utils/log-file.js +++ b/deps/npm/test/lib/utils/log-file.js @@ -1,8 +1,8 @@ const t = require('tap') -const _fs = require('fs') +const _fs = require('node:fs') const fs = _fs.promises -const path = require('path') -const os = require('os') +const path = require('node:path') +const os = require('node:os') const fsMiniPass = require('fs-minipass') const tmock = require('../../fixtures/tmock') const LogFile = require('../../../lib/utils/log-file.js') @@ -280,7 +280,7 @@ t.test('rimraf error', async t => { logsMax, testdir: makeOldLogs(oldLogs), mocks: { - 'fs/promises': { + 'node:fs/promises': { readdir: fs.readdir, rm: async (...args) => { if (count >= 3) { diff --git a/deps/npm/test/lib/utils/open-url.js b/deps/npm/test/lib/utils/open-url.js index 452a09fac97e55..096533140757e6 100644 --- a/deps/npm/test/lib/utils/open-url.js +++ b/deps/npm/test/lib/utils/open-url.js @@ -1,7 +1,7 @@ const t = require('tap') const tmock = require('../../fixtures/tmock') const mockNpm = require('../../fixtures/mock-npm') -const EventEmitter = require('events') +const EventEmitter = require('node:events') const mockOpenUrl = async (t, args, { openerResult, ...config } = {}) => { let openerUrl = null @@ -27,6 +27,8 @@ const mockOpenUrl = async (t, args, { openerResult, ...config } = {}) => { await openWithNpm(...args) } + mock.npm.finish() + return { ...mock, openUrl: openWithNpm, @@ -101,6 +103,8 @@ const mockOpenUrlPrompt = async (t, { await openUrlPrompt(...args).catch((er) => error = er) } + mock.npm.finish() + return { ...mock, openerUrl, @@ -178,7 +182,6 @@ t.test('open url prompt', async t => { t.test('does not error when opener can not find command', async t => { const { OUTPUT, error, openerUrl } = await mockOpenUrlPrompt(t, { - // openerResult: new Error('Opener failed'), openerResult: Object.assign(new Error('Opener failed'), { code: 127 }), }) diff --git a/deps/npm/test/lib/utils/queryable.js b/deps/npm/test/lib/utils/queryable.js index bde3ea66238f28..fb0db5d021b57a 100644 --- a/deps/npm/test/lib/utils/queryable.js +++ b/deps/npm/test/lib/utils/queryable.js @@ -1,4 +1,4 @@ -const { inspect } = require('util') +const { inspect } = require('node:util') const t = require('tap') const Queryable = require('../../../lib/utils/queryable.js') diff --git a/deps/npm/test/lib/utils/reify-finish.js b/deps/npm/test/lib/utils/reify-finish.js index a2ca6e43679627..a1dd165034a46a 100644 --- a/deps/npm/test/lib/utils/reify-finish.js +++ b/deps/npm/test/lib/utils/reify-finish.js @@ -1,6 +1,6 @@ const t = require('tap') -const fs = require('fs/promises') -const { join } = require('path') +const fs = require('node:fs/promises') +const { join } = require('node:path') const { cleanNewlines } = require('../../fixtures/clean-snapshot') const tmock = require('../../fixtures/tmock') const mockNpm = require('../../fixtures/mock-npm') diff --git a/deps/npm/test/lib/utils/reify-output.js b/deps/npm/test/lib/utils/reify-output.js index 205b7baf421f79..184f934c97013c 100644 --- a/deps/npm/test/lib/utils/reify-output.js +++ b/deps/npm/test/lib/utils/reify-output.js @@ -23,6 +23,7 @@ const mockReify = async (t, reify, { command, ...config } = {}) => { }) reifyOutput(mock.npm, reify) + mock.npm.finish() return mock.joinedOutput() } diff --git a/deps/npm/test/lib/utils/tar.js b/deps/npm/test/lib/utils/tar.js index 45ba720ac54edb..a0a37a3356eea2 100644 --- a/deps/npm/test/lib/utils/tar.js +++ b/deps/npm/test/lib/utils/tar.js @@ -1,6 +1,8 @@ const t = require('tap') +const tar = require('tar') const pack = require('libnpmpack') const ssri = require('ssri') +const { readFile } = require('fs/promises') const tmock = require('../../fixtures/tmock') const { cleanZlib } = require('../../fixtures/clean-snapshot') @@ -106,7 +108,7 @@ t.test('should log tarball contents with unicode', async (t) => { t.end() }) -t.test('should getContents of a tarball', async (t) => { +t.test('should getContents of a tarball with only a package.json', async (t) => { const testDir = t.testdir({ 'package.json': JSON.stringify({ name: 'my-cool-pkg', @@ -142,3 +144,82 @@ t.test('should getContents of a tarball', async (t) => { }, 'contents are correct') t.end() }) + +t.test('should getContents of a tarball with a node_modules directory included', async (t) => { + const testDir = t.testdir({ + package: { + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0', + }, null, 2), + node_modules: { + 'bundle-dep': { + 'package.json': JSON.stringify({ + name: 'bundle-dep', + version: '1.0.0', + }, null, 2), + }, + }, + }, + }) + + await tar.c({ + gzip: true, + file: 'npm-example-v1.tgz', + C: testDir, + }, ['package']) + + const tarball = await readFile(`npm-example-v1.tgz`) + + const tarballContents = await getContents({ + name: 'my-cool-pkg', + version: '1.0.0', + }, tarball) + + const integrity = ssri.fromData(tarball, { + algorithms: ['sha1', 'sha512'], + }) + + // zlib is nondeterministic + t.match(tarballContents.shasum, /^[0-9a-f]{40}$/) + delete tarballContents.shasum + + // assert mode differently according to platform + if (process.platform === 'win32') { + tarballContents.files[0].mode = 511 + tarballContents.files[1].mode = 511 + tarballContents.files[2].mode = 511 + tarballContents.files[3].mode = 438 + tarballContents.files[4].mode = 438 + } else { + tarballContents.files[0].mode = 493 + tarballContents.files[1].mode = 493 + tarballContents.files[2].mode = 493 + tarballContents.files[3].mode = 420 + tarballContents.files[4].mode = 420 + } + + tarballContents.files.forEach((file) => { + delete file.mode + }) + + t.same(tarballContents, { + id: 'my-cool-pkg@1.0.0', + name: 'my-cool-pkg', + version: '1.0.0', + size: tarball.length, + unpackedSize: 97, + integrity: ssri.parse(integrity.sha512[0]), + filename: 'my-cool-pkg-1.0.0.tgz', + files: [ + { path: '', size: 0 }, + { path: 'node_modules/', size: 0 }, + { path: 'node_modules/bundle-dep/', size: 0 }, + { path: 'node_modules/bundle-dep/package.json', size: 48 }, + { path: 'package.json', size: 49 }, + ], + entryCount: 5, + bundled: ['bundle-dep'], + }, 'contents are correct') + t.end() +}) diff --git a/deps/npm/test/lib/utils/timers.js b/deps/npm/test/lib/utils/timers.js index 4e5bfb104db975..f13b5ac2ba75d5 100644 --- a/deps/npm/test/lib/utils/timers.js +++ b/deps/npm/test/lib/utils/timers.js @@ -1,5 +1,5 @@ const t = require('tap') -const { resolve, join } = require('path') +const { resolve, join } = require('node:path') const fs = require('graceful-fs') const { log, time } = require('proc-log') const tmock = require('../../fixtures/tmock')