From 071e46ae56e6046ab2f1046684d821c2da3cc39a Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Thu, 16 Nov 2023 09:12:25 -0800 Subject: [PATCH] deps: upgrade npm to 10.2.4 PR-URL: https://github.com/nodejs/node/pull/50751 Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau --- deps/npm/docs/content/commands/npm-ls.md | 2 +- deps/npm/docs/content/commands/npm-prune.md | 5 +- deps/npm/docs/content/commands/npm-view.md | 7 + deps/npm/docs/content/commands/npm.md | 2 +- deps/npm/docs/output/commands/npm-ls.html | 2 +- deps/npm/docs/output/commands/npm-prune.html | 5 +- deps/npm/docs/output/commands/npm-view.html | 4 + deps/npm/docs/output/commands/npm.html | 2 +- deps/npm/lib/commands/exec.js | 25 +- deps/npm/lib/commands/outdated.js | 4 +- deps/npm/lib/commands/pkg.js | 7 +- deps/npm/lib/commands/search.js | 8 +- deps/npm/lib/commands/token.js | 6 +- deps/npm/lib/utils/format-search-stream.js | 192 +++++------ deps/npm/lib/utils/open-url.js | 2 +- deps/npm/lib/utils/sbom-cyclonedx.js | 11 +- deps/npm/lib/utils/sbom-spdx.js | 9 +- deps/npm/man/man1/npm-ls.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-view.1 | 8 + deps/npm/man/man1/npm.1 | 2 +- .../cliui/node_modules/ansi-regex/index.js | 8 - .../cliui/node_modules/strip-ansi/index.js | 14 - .../node_modules/@npmcli/config/package.json | 4 +- .../node_modules/ansi-styles/index.js | 163 +++++++++ .../node_modules/ansi-styles}/license | 2 +- .../node_modules/ansi-styles/package.json | 18 +- .../@sigstore/sign/dist/witness/tlog/index.js | 3 +- .../node_modules/@sigstore/sign/package.json | 6 +- .../node_modules/@sigstore/tuf/dist/client.js | 22 +- .../node_modules/@sigstore/tuf/dist/index.js | 7 +- .../node_modules/@sigstore/tuf/package.json | 2 +- .../agent-base/dist/helpers.js | 0 .../agent-base/dist/index.js | 0 .../node_modules => }/agent-base/package.json | 0 deps/npm/node_modules/ansi-regex/index.js | 8 +- deps/npm/node_modules/ansi-regex/license | 2 +- deps/npm/node_modules/ansi-regex/package.json | 15 +- deps/npm/node_modules/ansi-styles/index.js | 320 +++++++++++------- deps/npm/node_modules/ansi-styles/license | 2 +- .../npm/node_modules/ansi-styles/package.json | 18 +- deps/npm/node_modules/ci-info/package.json | 2 +- deps/npm/node_modules/ci-info/vendors.json | 43 ++- deps/npm/node_modules/cidr-regex/index.js | 15 +- deps/npm/node_modules/cidr-regex/package.json | 34 +- .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 2 +- .../node_modules/ansi-regex/package.json | 15 +- .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi}/license | 2 +- .../node_modules/strip-ansi/package.json | 17 +- .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 2 +- .../node_modules/ansi-regex/package.json | 15 +- .../node_modules/strip-ansi/index.js | 4 + .../columnify/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 17 +- .../function-bind/implementation.js | 56 ++- .../node_modules/function-bind/package.json | 52 ++- .../gauge/node_modules/ansi-regex/index.js | 10 + .../gauge/node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 +++ .../gauge/node_modules/strip-ansi/index.js | 4 + .../gauge/node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++ deps/npm/node_modules/has/LICENSE-MIT | 22 -- deps/npm/node_modules/has/package.json | 48 --- deps/npm/node_modules/has/src/index.js | 5 - deps/npm/node_modules/has/test/index.js | 10 - deps/npm/node_modules/hasown/LICENSE | 21 ++ deps/npm/node_modules/hasown/index.js | 8 + deps/npm/node_modules/hasown/package.json | 91 +++++ deps/npm/node_modules/hasown/tsconfig.json | 49 +++ .../http-proxy-agent/LICENSE | 0 .../http-proxy-agent/dist/index.js | 0 .../http-proxy-agent/package.json | 0 .../https-proxy-agent/dist/index.js | 0 .../dist/parse-proxy-response.js | 0 .../https-proxy-agent/package.json | 0 deps/npm/node_modules/ip-regex/index.js | 40 +-- deps/npm/node_modules/ip-regex/license | 2 +- deps/npm/node_modules/ip-regex/package.json | 13 +- deps/npm/node_modules/is-cidr/index.js | 14 +- deps/npm/node_modules/is-cidr/package.json | 38 +-- deps/npm/node_modules/is-core-module/index.js | 4 +- .../node_modules/is-core-module/package.json | 8 +- deps/npm/node_modules/libnpmexec/package.json | 4 +- .../libnpmpublish/lib/provenance.js | 8 +- .../node_modules/libnpmpublish/package.json | 4 +- .../lru-cache/dist/cjs/index.min.js | 2 - .../lru-cache/dist/{cjs => commonjs}/index.js | 28 +- .../dist/{cjs => commonjs}/package.json | 0 .../lru-cache/dist/{mjs => esm}/index.js | 28 +- .../lru-cache/dist/{mjs => esm}/package.json | 0 .../lru-cache/dist/mjs/index.min.js | 2 - deps/npm/node_modules/lru-cache/package.json | 98 +++--- .../signal-exit/dist/cjs/index.js | 31 +- .../signal-exit/dist/mjs/index.js | 31 +- .../npm/node_modules/signal-exit/package.json | 2 +- .../socks-proxy-agent/dist/index.js | 0 .../socks-proxy-agent/package.json | 0 .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 +++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++ .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 +++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++ .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 +++ deps/npm/node_modules/strip-ansi/index.js | 16 +- deps/npm/node_modules/strip-ansi/license | 2 +- deps/npm/node_modules/strip-ansi/package.json | 17 +- .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex/license | 9 + .../node_modules/ansi-regex/package.json | 55 +++ .../node_modules/ansi-styles/index.js | 163 +++++++++ .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 56 +++ .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi/license | 9 + .../node_modules/strip-ansi/package.json | 54 +++ .../node_modules/ansi-regex/index.js | 8 - .../node_modules/ansi-styles/index.js | 223 ------------ .../node_modules/strip-ansi/index.js | 14 - .../wrap-ansi/node_modules/strip-ansi/license | 9 - deps/npm/package.json | 18 +- .../test/lib/commands/search.js.test.cjs | 28 +- .../test/lib/utils/sbom-cyclonedx.js.test.cjs | 55 +++ .../test/lib/utils/sbom-spdx.js.test.cjs | 135 ++++++++ deps/npm/test/lib/commands/exec.js | 93 ++++- deps/npm/test/lib/commands/hook.js | 6 +- deps/npm/test/lib/commands/org.js | 10 +- deps/npm/test/lib/commands/pkg.js | 37 ++ deps/npm/test/lib/utils/open-url.js | 2 +- deps/npm/test/lib/utils/sbom-cyclonedx.js | 20 +- deps/npm/test/lib/utils/sbom-spdx.js | 30 ++ 143 files changed, 2417 insertions(+), 1013 deletions(-) delete mode 100644 deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/index.js rename deps/npm/node_modules/{@isaacs/cliui/node_modules/strip-ansi => @npmcli/disparity-colors/node_modules/ansi-styles}/license (92%) rename deps/npm/node_modules/{wrap-ansi => @npmcli/disparity-colors}/node_modules/ansi-styles/package.json (80%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/agent-base/dist/helpers.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/agent-base/dist/index.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/agent-base/package.json (100%) create mode 100644 deps/npm/node_modules/cli-columns/node_modules/ansi-regex/index.js rename deps/npm/node_modules/{@isaacs/cliui => cli-columns}/node_modules/ansi-regex/license (92%) rename deps/npm/node_modules/{wrap-ansi => cli-columns}/node_modules/ansi-regex/package.json (75%) create mode 100644 deps/npm/node_modules/cli-columns/node_modules/strip-ansi/index.js rename deps/npm/node_modules/{wrap-ansi/node_modules/ansi-styles => cli-columns/node_modules/strip-ansi}/license (92%) rename deps/npm/node_modules/{@isaacs/cliui => cli-columns}/node_modules/strip-ansi/package.json (71%) create mode 100644 deps/npm/node_modules/columnify/node_modules/ansi-regex/index.js rename deps/npm/node_modules/{wrap-ansi => columnify}/node_modules/ansi-regex/license (92%) rename deps/npm/node_modules/{@isaacs/cliui => columnify}/node_modules/ansi-regex/package.json (75%) create mode 100644 deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/columnify/node_modules/strip-ansi/license rename deps/npm/node_modules/{wrap-ansi => columnify}/node_modules/strip-ansi/package.json (71%) create mode 100644 deps/npm/node_modules/gauge/node_modules/ansi-regex/index.js create mode 100644 deps/npm/node_modules/gauge/node_modules/ansi-regex/license create mode 100644 deps/npm/node_modules/gauge/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/gauge/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/gauge/node_modules/strip-ansi/license create mode 100644 deps/npm/node_modules/gauge/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/has/LICENSE-MIT delete mode 100644 deps/npm/node_modules/has/package.json delete mode 100644 deps/npm/node_modules/has/src/index.js delete mode 100644 deps/npm/node_modules/has/test/index.js create mode 100644 deps/npm/node_modules/hasown/LICENSE create mode 100644 deps/npm/node_modules/hasown/index.js create mode 100644 deps/npm/node_modules/hasown/package.json create mode 100644 deps/npm/node_modules/hasown/tsconfig.json rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/http-proxy-agent/LICENSE (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/http-proxy-agent/dist/index.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/http-proxy-agent/package.json (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/https-proxy-agent/dist/index.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/https-proxy-agent/dist/parse-proxy-response.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/https-proxy-agent/package.json (100%) delete mode 100644 deps/npm/node_modules/lru-cache/dist/cjs/index.min.js rename deps/npm/node_modules/lru-cache/dist/{cjs => commonjs}/index.js (98%) rename deps/npm/node_modules/lru-cache/dist/{cjs => commonjs}/package.json (100%) rename deps/npm/node_modules/lru-cache/dist/{mjs => esm}/index.js (98%) rename deps/npm/node_modules/lru-cache/dist/{mjs => esm}/package.json (100%) delete mode 100644 deps/npm/node_modules/lru-cache/dist/mjs/index.min.js rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/socks-proxy-agent/dist/index.js (100%) rename deps/npm/node_modules/{@npmcli/agent/node_modules => }/socks-proxy-agent/package.json (100%) create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/index.js create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/license create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/license create mode 100644 deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/package.json create mode 100644 deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js create mode 100644 deps/npm/node_modules/string-width/node_modules/ansi-regex/license create mode 100644 deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/string-width/node_modules/strip-ansi/license create mode 100644 deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json create mode 100644 deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js create mode 100644 deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license create mode 100644 deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/index.js create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/license create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/package.json create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license create mode 100644 deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 2bff962988c4cc..4ad025dbb5b08e 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.2.3 /path/to/npm +npm@10.2.4 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index ec6aa1ee454d64..d195eb6d3b601f 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -18,10 +18,9 @@ then only packages matching one of the supplied names are removed. Extraneous packages are those present in the `node_modules` folder that are not listed as any package's dependency list. -If the `--production` flag is specified or the `NODE_ENV` environment +If the `--omit=dev` flag is specified or the `NODE_ENV` environment variable is set to `production`, this command will remove the packages -specified in your `devDependencies`. Setting `--no-production` will negate -`NODE_ENV` being set to `production`. +specified in your `devDependencies`. If the `--dry-run` flag is used then no changes will actually be made. diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index 280b6ebe1f091b..63bfe41398d1f3 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -32,6 +32,13 @@ For example, to show the dependencies of the `ronn` package at version npm view ronn@0.3.5 dependencies ``` +By default, `npm view` shows data about the current project context (by looking for a `package.json`). +To show field data for the current project use a file path (i.e. `.`): + +```bash +npm view . dependencies +``` + You can view child fields by separating them with a period. To view the git repository URL for the latest version of `npm`, you would run the following command: diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index 247b7ba6edf594..1528614f69a69a 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.2.3 +10.2.4 ### Description diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 0c623b49378635..642c883f350281 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -160,7 +160,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.2.3 /path/to/npm
+
npm@10.2.4 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm-prune.html b/deps/npm/docs/output/commands/npm-prune.html index acb24ea8023cee..034257f2271bea 100644 --- a/deps/npm/docs/output/commands/npm-prune.html +++ b/deps/npm/docs/output/commands/npm-prune.html @@ -153,10 +153,9 @@

Description

then only packages matching one of the supplied names are removed.

Extraneous packages are those present in the node_modules folder that are not listed as any package's dependency list.

-

If the --production flag is specified or the NODE_ENV environment +

If the --omit=dev flag is specified or the NODE_ENV environment variable is set to production, this command will remove the packages -specified in your devDependencies. Setting --no-production will negate -NODE_ENV being set to production.

+specified in your devDependencies.

If the --dry-run flag is used then no changes will actually be made.

If the --json flag is used, then the changes npm prune made (or would have made with --dry-run) are printed as a JSON object.

diff --git a/deps/npm/docs/output/commands/npm-view.html b/deps/npm/docs/output/commands/npm-view.html index 7db48739ef8842..af43193dd0869b 100644 --- a/deps/npm/docs/output/commands/npm-view.html +++ b/deps/npm/docs/output/commands/npm-view.html @@ -161,6 +161,10 @@

Description

0.3.5, you could do the following:

npm view ronn@0.3.5 dependencies
 
+

By default, npm view shows data about the current project context (by looking for a package.json). +To show field data for the current project use a file path (i.e. .):

+
npm view . dependencies
+

You can view child fields by separating them with a period. To view the git repository URL for the latest version of npm, you would run the following command:

npm view npm repository.url
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index d1ca758360ff09..7a530efa07bb17 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -150,7 +150,7 @@ 

Table of contents

Note: This command is unaware of workspaces.

Version

-

10.2.3

+

10.2.4

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/lib/commands/exec.js b/deps/npm/lib/commands/exec.js index ed4b07dc39b4d2..d532eca107c6c1 100644 --- a/deps/npm/lib/commands/exec.js +++ b/deps/npm/lib/commands/exec.js @@ -34,24 +34,33 @@ class Exec extends BaseCommand { for (const [name, path] of this.workspaces) { const locationMsg = `in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}` - await this.callExec(args, { locationMsg, runPath: path }) + await this.callExec(args, { name, locationMsg, runPath: path }) } } - async callExec (args, { locationMsg, runPath } = {}) { - // This is where libnpmexec will look for locally installed packages + 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 // This is where libnpmexec will actually run the scripts from if (!runPath) { runPath = process.cwd() + } else { + // We have to consider if the workspace has its own separate versions + // libnpmexec will walk up to localDir after looking here + 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 } const call = this.npm.config.get('call') let globalPath const { flatOptions, - localBin, globalBin, globalDir, chalk, @@ -79,14 +88,14 @@ class Exec extends BaseCommand { // copy args so they dont get mutated args: [...args], call, - localBin, - locationMsg, + chalk, globalBin, globalPath, + localBin, + locationMsg, output, - chalk, packages, - path: localPrefix, + path, runPath, scriptShell, yes, diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index 7e5805d41806c3..9b9283e497727e 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -6,7 +6,6 @@ const npa = require('npm-package-arg') const pickManifest = require('npm-pick-manifest') const localeCompare = require('@isaacs/string-locale-compare')('en') -const ansiTrim = require('strip-ansi') const ArboristWorkspaceCmd = require('../arborist-cmd.js') class Outdated extends ArboristWorkspaceCmd { @@ -23,6 +22,7 @@ class Outdated extends ArboristWorkspaceCmd { ] async exec (args) { + const { default: stripAnsi } = await import('strip-ansi') const global = resolve(this.npm.globalDir, '..') const where = this.npm.global ? global @@ -106,7 +106,7 @@ class Outdated extends ArboristWorkspaceCmd { const tableOpts = { align: ['l', 'r', 'r', 'r', 'l'], - stringLength: s => ansiTrim(s).length, + stringLength: s => stripAnsi(s).length, } this.npm.output(table(outTable, tableOpts)) } diff --git a/deps/npm/lib/commands/pkg.js b/deps/npm/lib/commands/pkg.js index 29bd4e89cc3c17..49a66823cca996 100644 --- a/deps/npm/lib/commands/pkg.js +++ b/deps/npm/lib/commands/pkg.js @@ -82,10 +82,9 @@ class Pkg extends BaseCommand { } } - // only outputs if not running with workspaces config, - // in case you're retrieving info for workspaces the pkgWorkspaces - // will handle the output to make sure it get keyed by ws name - if (!this.npm.config.get('workspaces')) { + // only outputs if not running with workspaces config + // execWorkspaces will handle the output otherwise + if (!this.workspaces) { this.npm.output(JSON.stringify(result, null, 2)) } diff --git a/deps/npm/lib/commands/search.js b/deps/npm/lib/commands/search.js index 85ff7db2b78840..2af4daa211dca1 100644 --- a/deps/npm/lib/commands/search.js +++ b/deps/npm/lib/commands/search.js @@ -81,12 +81,12 @@ class Search extends BaseCommand { const filterStream = new FilterStream() - // Grab a configured output stream that will spit out packages in the - // desired format. - const outputStream = formatSearchStream({ + const { default: stripAnsi } = await import('strip-ansi') + // Grab a configured output stream that will spit out packages in the desired format. + const outputStream = await formatSearchStream({ args, // --searchinclude options are not highlighted ...opts, - }) + }, stripAnsi) log.silly('search', 'searching packages') const p = new Pipeline( diff --git a/deps/npm/lib/commands/token.js b/deps/npm/lib/commands/token.js index c24684b3dd6143..dc1df6e0fcb25b 100644 --- a/deps/npm/lib/commands/token.js +++ b/deps/npm/lib/commands/token.js @@ -1,5 +1,4 @@ const Table = require('cli-table3') -const { v4: isCidrV4, v6: isCidrV6 } = require('is-cidr') const log = require('../utils/log-shim.js') const profile = require('npm-profile') @@ -137,7 +136,7 @@ class Token extends BaseCommand { const readonly = conf.readOnly const password = await readUserInfo.password() - const validCIDR = this.validateCIDRList(cidr) + const validCIDR = await this.validateCIDRList(cidr) log.info('token', 'creating') const result = await pulseTillDone.withPromise( otplease(this.npm, conf, c => profile.createToken(password, readonly, validCIDR, c)) @@ -209,7 +208,8 @@ class Token extends BaseCommand { return byId } - validateCIDRList (cidrs) { + async validateCIDRList (cidrs) { + const { v4: isCidrV4, v6: isCidrV6 } = await import('is-cidr') const maybeList = [].concat(cidrs).filter(Boolean) const list = maybeList.length === 1 ? maybeList[0].split(/,\s*/) : maybeList for (const cidr of list) { diff --git a/deps/npm/lib/utils/format-search-stream.js b/deps/npm/lib/utils/format-search-stream.js index 280e96b13fa8bd..cb29151e7c2e70 100644 --- a/deps/npm/lib/utils/format-search-stream.js +++ b/deps/npm/lib/utils/format-search-stream.js @@ -1,6 +1,5 @@ const { Minipass } = require('minipass') const columnify = require('columnify') -const ansiTrim = require('strip-ansi') // This module consumes package data in the following format: // @@ -16,8 +15,8 @@ const ansiTrim = require('strip-ansi') // The returned stream will format this package data // into a byte stream of formatted, displayable output. -module.exports = (opts) => { - return opts.json ? new JSONOutputStream() : new TextOutputStream(opts) +module.exports = async (opts, clean) => { + return opts.json ? new JSONOutputStream() : new TextOutputStream(opts, clean) } class JSONOutputStream extends Minipass { @@ -41,121 +40,96 @@ class JSONOutputStream extends Minipass { } class TextOutputStream extends Minipass { - constructor (opts) { + #clean + #opts + #line = 0 + + constructor (opts, clean) { super() - this._opts = opts - this._line = 0 + this.#clean = clean + this.#opts = opts } write (pkg) { - return super.write(prettify(pkg, ++this._line, this._opts)) - } -} - -function prettify (data, num, opts) { - var truncate = !opts.long - - var pkg = normalizePackage(data, opts) - - var columns = ['name', 'description', 'author', 'date', 'version', 'keywords'] - - if (opts.parseable) { - return columns.map(function (col) { - return pkg[col] && ('' + pkg[col]).replace(/\t/g, ' ') - }).join('\t') + return super.write(this.#prettify(pkg)) } - // stdout in tap is never a tty - /* istanbul ignore next */ - const maxWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity - let output = columnify( - [pkg], - { - include: columns, - showHeaders: num <= 1, - columnSplitter: ' | ', - truncate: truncate, - config: { - name: { minWidth: 25, maxWidth: 25, truncate: false, truncateMarker: '' }, - description: { minWidth: 20, maxWidth: 20 }, - author: { minWidth: 15, maxWidth: 15 }, - date: { maxWidth: 11 }, - version: { minWidth: 8, maxWidth: 8 }, - keywords: { maxWidth: Infinity }, - }, + #prettify (data) { + const pkg = { + author: data.maintainers.map((m) => `=${this.#clean(m.username)}`).join(' '), + date: 'prehistoric', + description: this.#clean(data.description ?? ''), + keywords: '', + name: this.#clean(data.name), + version: data.version, + } + if (Array.isArray(data.keywords)) { + pkg.keywords = data.keywords.map((k) => this.#clean(k)).join(' ') + } else if (typeof data.keywords === 'string') { + pkg.keywords = this.#clean(data.keywords.replace(/[,\s]+/, ' ')) + } + if (data.date) { + pkg.date = data.date.toISOString().split('T')[0] // remove time } - ).split('\n').map(line => line.slice(0, maxWidth)).join('\n') - - if (opts.color) { - output = highlightSearchTerms(output, opts.args) - } - - return output -} - -var colors = [31, 33, 32, 36, 34, 35] -var cl = colors.length - -function addColorMarker (str, arg, i) { - var m = i % cl + 1 - var markStart = String.fromCharCode(m) - var markEnd = String.fromCharCode(0) - - if (arg.charAt(0) === '/') { - return str.replace( - new RegExp(arg.slice(1, -1), 'gi'), - bit => markStart + bit + markEnd - ) - } - - // just a normal string, do the split/map thing - var pieces = str.toLowerCase().split(arg.toLowerCase()) - var p = 0 - - return pieces.map(function (piece) { - piece = str.slice(p, p + piece.length) - var mark = markStart + - str.slice(p + piece.length, p + piece.length + arg.length) + - markEnd - p += piece.length + arg.length - return piece + mark - }).join('') -} - -function colorize (line) { - for (var i = 0; i < cl; i++) { - var m = i + 1 - var color = '\u001B[' + colors[i] + 'm' - line = line.split(String.fromCharCode(m)).join(color) - } - var uncolor = '\u001B[0m' - return line.split('\u0000').join(uncolor) -} -function highlightSearchTerms (str, terms) { - terms.forEach(function (arg, i) { - str = addColorMarker(str, arg, i) - }) + const columns = ['name', 'description', 'author', 'date', 'version', 'keywords'] + if (this.#opts.parseable) { + return columns.map((col) => pkg[col] && ('' + pkg[col]).replace(/\t/g, ' ')).join('\t') + } - return colorize(str).trim() -} + // stdout in tap is never a tty + /* istanbul ignore next */ + const maxWidth = process.stdout.isTTY ? process.stdout.getWindowSize()[0] : Infinity + let output = columnify( + [pkg], + { + include: columns, + showHeaders: ++this.#line <= 1, + columnSplitter: ' | ', + truncate: !this.#opts.long, + config: { + name: { minWidth: 25, maxWidth: 25, truncate: false, truncateMarker: '' }, + description: { minWidth: 20, maxWidth: 20 }, + author: { minWidth: 15, maxWidth: 15 }, + date: { maxWidth: 11 }, + version: { minWidth: 8, maxWidth: 8 }, + keywords: { maxWidth: Infinity }, + }, + } + ).split('\n').map(line => line.slice(0, maxWidth)).join('\n') + + if (!this.#opts.color) { + return output + } -function normalizePackage (data, opts) { - return { - name: ansiTrim(data.name), - description: ansiTrim(data.description ?? ''), - author: data.maintainers.map((m) => `=${ansiTrim(m.username)}`).join(' '), - keywords: Array.isArray(data.keywords) - ? data.keywords.map(ansiTrim).join(' ') - : typeof data.keywords === 'string' - ? ansiTrim(data.keywords.replace(/[,\s]+/, ' ')) - : '', - version: data.version, - date: (data.date && - (data.date.toISOString() // remove time - .split('T').join(' ') - .replace(/:[0-9]{2}\.[0-9]{3}Z$/, '')) - .slice(0, -5)) || - 'prehistoric', + const colors = ['31m', '33m', '32m', '36m', '34m', '35m'] + + this.#opts.args.forEach((arg, i) => { + const markStart = String.fromCharCode(i % colors.length + 1) + const markEnd = String.fromCharCode(0) + + if (arg.charAt(0) === '/') { + output = output.replace( + new RegExp(arg.slice(1, -1), 'gi'), + bit => `${markStart}${bit}${markEnd}` + ) + } else { + // just a normal string, do the split/map thing + let p = 0 + + output = output.toLowerCase().split(arg.toLowerCase()).map(piece => { + piece = output.slice(p, p + piece.length) + p += piece.length + const mark = `${markStart}${output.slice(p, p + arg.length)}${markEnd}` + p += arg.length + return `${piece}${mark}` + }).join('') + } + }) + + for (let i = 1; i <= colors.length; i++) { + output = output.split(String.fromCharCode(i)).join(`\u001B[${colors[i - 1]}`) + } + return output.split('\u0000').join('\u001B[0m').trim() } } diff --git a/deps/npm/lib/utils/open-url.js b/deps/npm/lib/utils/open-url.js index f882d0c9d39341..77bb1d03d8e165 100644 --- a/deps/npm/lib/utils/open-url.js +++ b/deps/npm/lib/utils/open-url.js @@ -39,7 +39,7 @@ const open = async (npm, url, errMsg, isFile) => { const command = browser === true ? null : browser await promiseSpawn.open(url, { command }) .catch((err) => { - if (err.code !== 'ENOENT') { + if (err.code !== 127) { throw err } diff --git a/deps/npm/lib/utils/sbom-cyclonedx.js b/deps/npm/lib/utils/sbom-cyclonedx.js index 3088068ad3b5f2..0a340895bb3f49 100644 --- a/deps/npm/lib/utils/sbom-cyclonedx.js +++ b/deps/npm/lib/utils/sbom-cyclonedx.js @@ -86,7 +86,14 @@ const toCyclonedxItem = (node, { packageType }) => { let parsedLicense try { - parsedLicense = parseLicense(node.package?.license) + let license = node.package?.license + if (license) { + if (typeof license === 'object') { + license = license.type + } + } + + parsedLicense = parseLicense(license) } catch (err) { parsedLicense = null } @@ -152,7 +159,7 @@ const toCyclonedxItem = (node, { packageType }) => { // If license is a single SPDX license, use the license field if (parsedLicense?.license) { component.licenses = [{ license: { id: parsedLicense.license } }] - // If license is a conjunction, use the expression field + // If license is a conjunction, use the expression field } else if (parsedLicense?.conjunction) { component.licenses = [{ expression: node.package.license }] } diff --git a/deps/npm/lib/utils/sbom-spdx.js b/deps/npm/lib/utils/sbom-spdx.js index 890ee3310fa789..8c91147cb4102b 100644 --- a/deps/npm/lib/utils/sbom-spdx.js +++ b/deps/npm/lib/utils/sbom-spdx.js @@ -93,6 +93,13 @@ const toSpdxItem = (node, { packageType }) => { location = node.linksIn.values().next().value.location } + let license = node.package?.license + if (license) { + if (typeof license === 'object') { + license = license.type + } + } + const pkg = { name: node.packageName, SPDXID: toSpdxID(node), @@ -103,7 +110,7 @@ const toSpdxItem = (node, { packageType }) => { downloadLocation: (node.isLink ? undefined : node.resolved) || NO_ASSERTION, filesAnalyzed: false, homepage: node.package?.homepage || NO_ASSERTION, - licenseDeclared: node.package?.license || NO_ASSERTION, + licenseDeclared: license || NO_ASSERTION, externalRefs: [ { referenceCategory: REF_CAT_PACKAGE_MANAGER, diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 25af64a1534878..7b8ea0771e1a43 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit .P .RS 2 .nf -npm@10.2.3 /path/to/npm +npm@10.2.4 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 .fi diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 3ab15a55c879a1..32f57580e3fb49 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -14,7 +14,7 @@ This command removes "extraneous" packages. If a package name is provided, then .P Extraneous packages are those present in the \fBnode_modules\fR folder that are not listed as any package's dependency list. .P -If the \fB--production\fR flag is specified or the \fBNODE_ENV\fR environment variable is set to \fBproduction\fR, this command will remove the packages specified in your \fBdevDependencies\fR. Setting \fB--no-production\fR will negate \fBNODE_ENV\fR being set to \fBproduction\fR. +If the \fB--omit=dev\fR flag is specified or the \fBNODE_ENV\fR environment variable is set to \fBproduction\fR, this command will remove the packages specified in your \fBdevDependencies\fR. .P If the \fB--dry-run\fR flag is used then no changes will actually be made. .P diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index decf76a1e9bfc7..70c435cdc929c6 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -32,6 +32,14 @@ npm view ronn@0.3.5 dependencies .fi .RE .P +By default, \fBnpm view\fR shows data about the current project context (by looking for a \fBpackage.json\fR). To show field data for the current project use a file path (i.e. \fB.\fR): +.P +.RS 2 +.nf +npm view . dependencies +.fi +.RE +.P You can view child fields by separating them with a period. To view the git repository URL for the latest version of \fBnpm\fR, you would run the following command: .P .RS 2 diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 2f08cb27dbbca5..05d06e9f7758a4 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -12,7 +12,7 @@ npm Note: This command is unaware of workspaces. .SS "Version" .P -10.2.3 +10.2.4 .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/node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js b/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js deleted file mode 100644 index 130a0929b8ce8c..00000000000000 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export default function ansiRegex({onlyFirst = false} = {}) { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -} diff --git a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js b/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js deleted file mode 100644 index ba19750e64e061..00000000000000 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import ansiRegex from 'ansi-regex'; - -const regex = ansiRegex(); - -export default function stripAnsi(string) { - if (typeof string !== 'string') { - throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); - } - - // Even though the regex is global, we don't need to reset the `.lastIndex` - // because unlike `.exec()` and `.test()`, `.replace()` does it automatically - // and doing it manually has a performance penalty. - return string.replace(regex, ''); -} diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json index 2f30c7ff98a644..c4eabca7d1b8c1 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.0.1", + "version": "8.0.2", "files": [ "bin/", "lib/" @@ -37,7 +37,7 @@ }, "dependencies": { "@npmcli/map-workspaces": "^3.0.2", - "ci-info": "^3.8.0", + "ci-info": "^4.0.0", "ini": "^4.1.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", diff --git a/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/index.js b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/index.js new file mode 100644 index 00000000000000..5d82581a13f990 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/license b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/license similarity index 92% rename from deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/license rename to deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/license index fa7ceba3eb4a96..e7af2f77107d73 100644 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/license +++ b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/package.json b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/package.json similarity index 80% rename from deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/package.json rename to deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/package.json index 6cd3ca5bf95d00..75393284d7e474 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/@npmcli/disparity-colors/node_modules/ansi-styles/package.json @@ -1,6 +1,6 @@ { "name": "ansi-styles", - "version": "6.2.1", + "version": "4.3.0", "description": "ANSI escape codes for styling strings in the terminal", "license": "MIT", "repository": "chalk/ansi-styles", @@ -8,12 +8,10 @@ "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" + "url": "sindresorhus.com" }, - "type": "module", - "exports": "./index.js", "engines": { - "node": ">=12" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", @@ -45,10 +43,14 @@ "command-line", "text" ], + "dependencies": { + "color-convert": "^2.0.1" + }, "devDependencies": { - "ava": "^3.15.0", + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", "svg-term-cli": "^2.1.1", - "tsd": "^0.19.0", - "xo": "^0.47.0" + "tsd": "^0.11.0", + "xo": "^0.25.3" } } diff --git a/deps/npm/node_modules/@sigstore/sign/dist/witness/tlog/index.js b/deps/npm/node_modules/@sigstore/sign/dist/witness/tlog/index.js index 1f098df85390cf..6197b09d4cdd9a 100644 --- a/deps/npm/node_modules/@sigstore/sign/dist/witness/tlog/index.js +++ b/deps/npm/node_modules/@sigstore/sign/dist/witness/tlog/index.js @@ -22,13 +22,14 @@ const entry_1 = require("./entry"); exports.DEFAULT_REKOR_URL = 'https://rekor.sigstore.dev'; class RekorWitness { constructor(options) { + this.entryType = options.entryType; this.tlog = new client_1.TLogClient({ ...options, rekorBaseURL: options.rekorBaseURL || /* istanbul ignore next */ exports.DEFAULT_REKOR_URL, }); } async testify(content, publicKey) { - const proposedEntry = (0, entry_1.toProposedEntry)(content, publicKey); + const proposedEntry = (0, entry_1.toProposedEntry)(content, publicKey, this.entryType); const entry = await this.tlog.createEntry(proposedEntry); return toTransparencyLogEntry(entry); } diff --git a/deps/npm/node_modules/@sigstore/sign/package.json b/deps/npm/node_modules/@sigstore/sign/package.json index cd8dc14412e4da..7075ee16aeb0dc 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.1.0", + "version": "2.2.0", "description": "Sigstore signing library", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -27,9 +27,9 @@ }, "devDependencies": { "@sigstore/jest": "^0.0.0", - "@sigstore/mock": "^0.4.0", + "@sigstore/mock": "^0.6.0", "@sigstore/rekor-types": "^2.0.0", - "@types/make-fetch-happen": "^10.0.0" + "@types/make-fetch-happen": "^10.0.3" }, "dependencies": { "@sigstore/bundle": "^2.1.0", diff --git a/deps/npm/node_modules/@sigstore/tuf/dist/client.js b/deps/npm/node_modules/@sigstore/tuf/dist/client.js index 797346d39e6202..865d52b73027ed 100644 --- a/deps/npm/node_modules/@sigstore/tuf/dist/client.js +++ b/deps/npm/node_modules/@sigstore/tuf/dist/client.js @@ -25,8 +25,8 @@ const tuf_js_1 = require("tuf-js"); const target_1 = require("./target"); class TUFClient { constructor(options) { - initTufCache(options.cachePath, options.rootPath); - const remote = initRemoteConfig(options.cachePath, options.mirrorURL); + initTufCache(options); + const remote = initRemoteConfig(options); this.updater = initClient(options.cachePath, remote, options); } async refresh() { @@ -42,7 +42,7 @@ exports.TUFClient = TUFClient; // created. If the targets directory does not exist, it will be created. // If the root.json file does not exist, it will be copied from the // rootPath argument. -function initTufCache(cachePath, tufRootPath) { +function initTufCache({ cachePath, rootPath: tufRootPath, force, }) { const targetsPath = path_1.default.join(cachePath, 'targets'); const cachedRootPath = path_1.default.join(cachePath, 'root.json'); if (!fs_1.default.existsSync(cachePath)) { @@ -51,7 +51,9 @@ function initTufCache(cachePath, tufRootPath) { if (!fs_1.default.existsSync(targetsPath)) { fs_1.default.mkdirSync(targetsPath); } - if (!fs_1.default.existsSync(cachedRootPath)) { + // If the root.json file does not exist (or we're forcing re-initialization), + // copy it from the rootPath argument + if (!fs_1.default.existsSync(cachedRootPath) || force) { fs_1.default.copyFileSync(tufRootPath, cachedRootPath); } return cachePath; @@ -59,14 +61,18 @@ function initTufCache(cachePath, tufRootPath) { // Initializes the remote.json file, which contains the URL of the TUF // repository. If the file does not exist, it will be created. If the file // exists, it will be parsed and returned. -function initRemoteConfig(rootDir, mirrorURL) { +function initRemoteConfig({ cachePath, mirrorURL, force, }) { let remoteConfig; - const remoteConfigPath = path_1.default.join(rootDir, 'remote.json'); - if (fs_1.default.existsSync(remoteConfigPath)) { + const remoteConfigPath = path_1.default.join(cachePath, 'remote.json'); + // If the remote config file exists, read it and parse it (skip if force is + // true) + if (!force && fs_1.default.existsSync(remoteConfigPath)) { const data = fs_1.default.readFileSync(remoteConfigPath, 'utf-8'); remoteConfig = JSON.parse(data); } - if (!remoteConfig) { + // If the remote config file does not exist (or we're forcing initialization), + // create it + if (!remoteConfig || force) { remoteConfig = { mirror: mirrorURL }; fs_1.default.writeFileSync(remoteConfigPath, JSON.stringify(remoteConfig)); } diff --git a/deps/npm/node_modules/@sigstore/tuf/dist/index.js b/deps/npm/node_modules/@sigstore/tuf/dist/index.js index 0d201c356dffc5..297c7231408c25 100644 --- a/deps/npm/node_modules/@sigstore/tuf/dist/index.js +++ b/deps/npm/node_modules/@sigstore/tuf/dist/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.TUFError = exports.initTUF = exports.getTrustedRoot = void 0; +exports.TUFError = exports.initTUF = exports.getTrustedRoot = exports.DEFAULT_MIRROR_URL = void 0; /* Copyright 2023 The Sigstore Authors. @@ -19,8 +19,8 @@ limitations under the License. const protobuf_specs_1 = require("@sigstore/protobuf-specs"); const appdata_1 = require("./appdata"); const client_1 = require("./client"); +exports.DEFAULT_MIRROR_URL = 'https://tuf-repo-cdn.sigstore.dev'; const DEFAULT_CACHE_DIR = 'sigstore-js'; -const DEFAULT_MIRROR_URL = 'https://tuf-repo-cdn.sigstore.dev'; const DEFAULT_TUF_ROOT_PATH = '../store/public-good-instance-root.json'; const DEFAULT_RETRY = { retries: 2 }; const DEFAULT_TIMEOUT = 5000; @@ -46,9 +46,10 @@ function createClient(options) { return new client_1.TUFClient({ cachePath: options.cachePath || (0, appdata_1.appDataPath)(DEFAULT_CACHE_DIR), rootPath: options.rootPath || require.resolve(DEFAULT_TUF_ROOT_PATH), - mirrorURL: options.mirrorURL || DEFAULT_MIRROR_URL, + mirrorURL: options.mirrorURL || exports.DEFAULT_MIRROR_URL, retry: options.retry ?? DEFAULT_RETRY, timeout: options.timeout ?? DEFAULT_TIMEOUT, + force: options.force ?? false, }); } var error_1 = require("./error"); diff --git a/deps/npm/node_modules/@sigstore/tuf/package.json b/deps/npm/node_modules/@sigstore/tuf/package.json index a655d52a0407a3..38d5a03ad5be1c 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.1.0", + "version": "2.2.0", "description": "Client for the Sigstore TUF repository", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/dist/helpers.js b/deps/npm/node_modules/agent-base/dist/helpers.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/dist/helpers.js rename to deps/npm/node_modules/agent-base/dist/helpers.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/dist/index.js b/deps/npm/node_modules/agent-base/dist/index.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/dist/index.js rename to deps/npm/node_modules/agent-base/dist/index.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/package.json b/deps/npm/node_modules/agent-base/package.json similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/agent-base/package.json rename to deps/npm/node_modules/agent-base/package.json diff --git a/deps/npm/node_modules/ansi-regex/index.js b/deps/npm/node_modules/ansi-regex/index.js index 616ff837d3ff01..130a0929b8ce8c 100644 --- a/deps/npm/node_modules/ansi-regex/index.js +++ b/deps/npm/node_modules/ansi-regex/index.js @@ -1,10 +1,8 @@ -'use strict'; - -module.exports = ({onlyFirst = false} = {}) => { +export default function ansiRegex({onlyFirst = false} = {}) { const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, onlyFirst ? undefined : 'g'); -}; +} diff --git a/deps/npm/node_modules/ansi-regex/license b/deps/npm/node_modules/ansi-regex/license index e7af2f77107d73..fa7ceba3eb4a96 100644 --- a/deps/npm/node_modules/ansi-regex/license +++ b/deps/npm/node_modules/ansi-regex/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/ansi-regex/package.json b/deps/npm/node_modules/ansi-regex/package.json index 017f53116a9e28..7bbb563bf2a70a 100644 --- a/deps/npm/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/ansi-regex/package.json @@ -1,16 +1,19 @@ { "name": "ansi-regex", - "version": "5.0.1", + "version": "6.0.1", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", + "funding": "https://github.com/chalk/ansi-regex?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=8" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd", @@ -48,8 +51,8 @@ "pattern" ], "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" } } diff --git a/deps/npm/node_modules/ansi-styles/index.js b/deps/npm/node_modules/ansi-styles/index.js index 5d82581a13f990..d7bede44b7b6ba 100644 --- a/deps/npm/node_modules/ansi-styles/index.js +++ b/deps/npm/node_modules/ansi-styles/index.js @@ -1,130 +1,83 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); +const ANSI_BACKGROUND_OFFSET = 10; + +const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`; + +const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; + +const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; + +const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + gray: [90, 39], // Alias of `blackBright` + grey: [90, 39], // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39], + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], // Alias of `bgBlackBright` + bgGrey: [100, 49], // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49], + }, }; -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; +export const modifierNames = Object.keys(styles.modifier); +export const foregroundColorNames = Object.keys(styles.color); +export const backgroundColorNames = Object.keys(styles.bgColor); +export const colorNames = [...foregroundColorNames, ...backgroundColorNames]; function assembleStyles() { const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; for (const [groupName, group] of Object.entries(styles)) { for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` + close: `\u001B[${style[1]}m`, }; group[styleName] = styles[styleName]; @@ -134,30 +87,137 @@ function assembleStyles() { Object.defineProperty(styles, groupName, { value: group, - enumerable: false + enumerable: false, }); } Object.defineProperty(styles, 'codes', { value: codes, - enumerable: false + enumerable: false, }); styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + + // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js + Object.defineProperties(styles, { + rgbToAnsi256: { + value: (red, green, blue) => { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + + if (red > 248) { + return 231; + } + + return Math.round(((red - 8) / 247) * 24) + 232; + } + + return 16 + + (36 * Math.round(red / 255 * 5)) + + (6 * Math.round(green / 255 * 5)) + + Math.round(blue / 255 * 5); + }, + enumerable: false, + }, + hexToRgb: { + value: hex => { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + + let [colorString] = matches; + + if (colorString.length === 3) { + colorString = [...colorString].map(character => character + character).join(''); + } + + const integer = Number.parseInt(colorString, 16); + + return [ + /* eslint-disable no-bitwise */ + (integer >> 16) & 0xFF, + (integer >> 8) & 0xFF, + integer & 0xFF, + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false, + }, + hexToAnsi256: { + value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false, + }, + ansi256ToAnsi: { + value: code => { + if (code < 8) { + return 30 + code; + } + + if (code < 16) { + return 90 + (code - 8); + } + + let red; + let green; + let blue; + + if (code >= 232) { + red = (((code - 232) * 10) + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + + const remainder = code % 36; + + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + + const value = Math.max(red, green, blue) * 2; + + if (value === 0) { + return 30; + } + + // eslint-disable-next-line no-bitwise + let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + + if (value === 2) { + result += 60; + } + + return result; + }, + enumerable: false, + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false, + }, + hexToAnsi: { + value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false, + }, + }); return styles; } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); +const ansiStyles = assembleStyles(); + +export default ansiStyles; diff --git a/deps/npm/node_modules/ansi-styles/license b/deps/npm/node_modules/ansi-styles/license index e7af2f77107d73..fa7ceba3eb4a96 100644 --- a/deps/npm/node_modules/ansi-styles/license +++ b/deps/npm/node_modules/ansi-styles/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/ansi-styles/package.json b/deps/npm/node_modules/ansi-styles/package.json index 75393284d7e474..6cd3ca5bf95d00 100644 --- a/deps/npm/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/ansi-styles/package.json @@ -1,6 +1,6 @@ { "name": "ansi-styles", - "version": "4.3.0", + "version": "6.2.1", "description": "ANSI escape codes for styling strings in the terminal", "license": "MIT", "repository": "chalk/ansi-styles", @@ -8,10 +8,12 @@ "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=8" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd", @@ -43,14 +45,10 @@ "command-line", "text" ], - "dependencies": { - "color-convert": "^2.0.1" - }, "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", + "ava": "^3.15.0", "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" + "tsd": "^0.19.0", + "xo": "^0.47.0" } } diff --git a/deps/npm/node_modules/ci-info/package.json b/deps/npm/node_modules/ci-info/package.json index 8d3ff0030cc919..3c6b9e4adac8e8 100644 --- a/deps/npm/node_modules/ci-info/package.json +++ b/deps/npm/node_modules/ci-info/package.json @@ -1,6 +1,6 @@ { "name": "ci-info", - "version": "3.9.0", + "version": "4.0.0", "description": "Get details about the current Continuous Integration environment", "main": "index.js", "typings": "index.d.ts", diff --git a/deps/npm/node_modules/ci-info/vendors.json b/deps/npm/node_modules/ci-info/vendors.json index 7bedd96a7972fa..6b65e3f9b541f8 100644 --- a/deps/npm/node_modules/ci-info/vendors.json +++ b/deps/npm/node_modules/ci-info/vendors.json @@ -1,4 +1,10 @@ [ + { + "name": "Agola CI", + "constant": "AGOLA", + "env": "AGOLA_GIT_REF", + "pr": "AGOLA_PULL_REQUEST_ID" + }, { "name": "Appcircle", "constant": "APPCIRCLE", @@ -104,6 +110,11 @@ "constant": "DSARI", "env": "DSARI" }, + { + "name": "Earthly", + "constant": "EARTHLY", + "env": "EARTHLY_CI" + }, { "name": "Expo Application Services", "constant": "EAS", @@ -114,6 +125,11 @@ "constant": "GERRIT", "env": "GERRIT_PROJECT" }, + { + "name": "Gitea Actions", + "constant": "GITEA_ACTIONS", + "env": "GITEA_ACTIONS" + }, { "name": "GitHub Actions", "constant": "GITHUB_ACTIONS", @@ -199,6 +215,11 @@ "ne": "false" } }, + { + "name": "Prow", + "constant": "PROW", + "env": "PROW_JOB_ID" + }, { "name": "ReleaseHub", "constant": "RELEASEHUB", @@ -233,20 +254,6 @@ "env": "SEMAPHORE", "pr": "PULL_REQUEST_NUMBER" }, - { - "name": "Shippable", - "constant": "SHIPPABLE", - "env": "SHIPPABLE", - "pr": { - "IS_PULL_REQUEST": "true" - } - }, - { - "name": "Solano CI", - "constant": "SOLANO", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID" - }, { "name": "Sourcehut", "constant": "SOURCEHUT", @@ -281,6 +288,14 @@ "ne": "false" } }, + { + "name": "Vela", + "constant": "VELA", + "env": "VELA", + "pr": { + "VELA_PULL_REQUEST": "1" + } + }, { "name": "Vercel", "constant": "VERCEL", diff --git a/deps/npm/node_modules/cidr-regex/index.js b/deps/npm/node_modules/cidr-regex/index.js index 0f12ee10b3c815..61597c62532aa8 100644 --- a/deps/npm/node_modules/cidr-regex/index.js +++ b/deps/npm/node_modules/cidr-regex/index.js @@ -1,18 +1,15 @@ -"use strict"; - -const ipRegex = require("ip-regex"); +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])`; -// can not precompile the non-exact regexes because global flag makes the regex object stateful -// which would require the user to reset .lastIndex on subsequent calls +// 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}$)`); -module.exports = ({exact} = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g"); -module.exports.v4 = ({exact} = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g"); -module.exports.v6 = ({exact} = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g"); +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 8ddef4ed96a935..4f743464075e3e 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": "3.1.1", + "version": "4.0.3", "description": "Regular expression for matching IP addresses in CIDR notation", "author": "silverwind ", "contributors": [ @@ -8,35 +8,25 @@ ], "repository": "silverwind/cidr-regex", "license": "BSD-2-Clause", - "scripts": { - "test": "make test" - }, + "type": "module", + "exports": "./index.js", + "sideEffects": false, "engines": { - "node": ">=10" + "node": ">=14" }, "files": [ "index.js", "index.d.ts" ], - "keywords": [ - "cidr", - "regex", - "notation", - "cidr notation", - "prefix", - "prefixes", - "ip", - "ip address" - ], "dependencies": { - "ip-regex": "^4.1.0" + "ip-regex": "^5.0.0" }, "devDependencies": { - "eslint": "7.8.1", - "eslint-config-silverwind": "18.0.8", - "jest": "26.4.2", - "tsd": "0.13.1", - "updates": "10.3.6", - "versions": "8.4.3" + "eslint": "8.37.0", + "eslint-config-silverwind": "65.1.3", + "tsd": "0.28.1", + "updates": "13.2.9", + "versions": "10.4.2", + "vitest": "0.29.8" } } diff --git a/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/index.js b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/license b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/license similarity index 92% rename from deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/license rename to deps/npm/node_modules/cli-columns/node_modules/ansi-regex/license index fa7ceba3eb4a96..e7af2f77107d73 100644 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/license +++ b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/package.json similarity index 75% rename from deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json rename to deps/npm/node_modules/cli-columns/node_modules/ansi-regex/package.json index 7bbb563bf2a70a..017f53116a9e28 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/cli-columns/node_modules/ansi-regex/package.json @@ -1,19 +1,16 @@ { "name": "ansi-regex", - "version": "6.0.1", + "version": "5.0.1", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", - "funding": "https://github.com/chalk/ansi-regex?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" + "url": "sindresorhus.com" }, - "type": "module", - "exports": "./index.js", "engines": { - "node": ">=12" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", @@ -51,8 +48,8 @@ "pattern" ], "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" } } diff --git a/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/index.js b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/license b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/license similarity index 92% rename from deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/license rename to deps/npm/node_modules/cli-columns/node_modules/strip-ansi/license index fa7ceba3eb4a96..e7af2f77107d73 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/license +++ b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/package.json similarity index 71% rename from deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json rename to deps/npm/node_modules/cli-columns/node_modules/strip-ansi/package.json index e1f455c325b007..1a41108d42831c 100644 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/cli-columns/node_modules/strip-ansi/package.json @@ -1,19 +1,16 @@ { "name": "strip-ansi", - "version": "7.1.0", + "version": "6.0.1", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", - "funding": "https://github.com/chalk/strip-ansi?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" + "url": "sindresorhus.com" }, - "type": "module", - "exports": "./index.js", "engines": { - "node": ">=12" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" @@ -47,11 +44,11 @@ "text" ], "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.17.0", - "xo": "^0.44.0" + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" } } diff --git a/deps/npm/node_modules/columnify/node_modules/ansi-regex/index.js b/deps/npm/node_modules/columnify/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/columnify/node_modules/ansi-regex/license similarity index 92% rename from deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license rename to deps/npm/node_modules/columnify/node_modules/ansi-regex/license index fa7ceba3eb4a96..e7af2f77107d73 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license +++ b/deps/npm/node_modules/columnify/node_modules/ansi-regex/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/ansi-regex/package.json similarity index 75% rename from deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/package.json rename to deps/npm/node_modules/columnify/node_modules/ansi-regex/package.json index 7bbb563bf2a70a..017f53116a9e28 100644 --- a/deps/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/columnify/node_modules/ansi-regex/package.json @@ -1,19 +1,16 @@ { "name": "ansi-regex", - "version": "6.0.1", + "version": "5.0.1", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", - "funding": "https://github.com/chalk/ansi-regex?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" + "url": "sindresorhus.com" }, - "type": "module", - "exports": "./index.js", "engines": { - "node": ">=12" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", @@ -51,8 +48,8 @@ "pattern" ], "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" } } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/license b/deps/npm/node_modules/columnify/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json similarity index 71% rename from deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json rename to deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json index e1f455c325b007..1a41108d42831c 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json @@ -1,19 +1,16 @@ { "name": "strip-ansi", - "version": "7.1.0", + "version": "6.0.1", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", - "funding": "https://github.com/chalk/strip-ansi?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" + "url": "sindresorhus.com" }, - "type": "module", - "exports": "./index.js", "engines": { - "node": ">=12" + "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" @@ -47,11 +44,11 @@ "text" ], "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^5.0.1" }, "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.17.0", - "xo": "^0.44.0" + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" } } diff --git a/deps/npm/node_modules/function-bind/implementation.js b/deps/npm/node_modules/function-bind/implementation.js index cc4daec1b080a1..fd4384cc0c34ce 100644 --- a/deps/npm/node_modules/function-bind/implementation.js +++ b/deps/npm/node_modules/function-bind/implementation.js @@ -3,43 +3,75 @@ /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; var toStr = Object.prototype.toString; +var max = Math.max; var funcType = '[object Function]'; +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + module.exports = function bind(that) { var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } - var args = slice.call(arguments, 1); + var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, - args.concat(slice.call(arguments)) + concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); } + return target.apply( + that, + concatty(args, arguments) + ); + }; - var boundLength = Math.max(0, target.length - args.length); + var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); + boundArgs[i] = '$' + i; } - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; diff --git a/deps/npm/node_modules/function-bind/package.json b/deps/npm/node_modules/function-bind/package.json index 20a1727cbf8711..61859638977906 100644 --- a/deps/npm/node_modules/function-bind/package.json +++ b/deps/npm/node_modules/function-bind/package.json @@ -1,6 +1,6 @@ { "name": "function-bind", - "version": "1.1.1", + "version": "1.1.2", "description": "Implementation of Function.prototype.bind", "keywords": [ "function", @@ -9,7 +9,13 @@ "es5" ], "author": "Raynos ", - "repository": "git://github.com/Raynos/function-bind.git", + "repository": { + "type": "git", + "url": "https://github.com/Raynos/function-bind.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, "main": "index", "homepage": "https://github.com/Raynos/function-bind", "contributors": [ @@ -25,24 +31,29 @@ "url": "https://github.com/Raynos/function-bind/issues", "email": "raynos2@gmail.com" }, - "dependencies": {}, "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.5.0", - "jscs": "^3.0.7", - "tape": "^4.8.0" + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.3", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.1" }, "license": "MIT", "scripts": { + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepack": "npmignore --auto --commentLines=autogenerated", "pretest": "npm run lint", "test": "npm run tests-only", - "posttest": "npm run coverage -- --quiet", - "tests-only": "node test", - "coverage": "covert test/*.js", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" + "posttest": "aud --production", + "tests-only": "nyc tape 'test/**/*.js'", + "lint": "eslint --ext=js,mjs .", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" }, "testling": { "files": "test/index.js", @@ -59,5 +70,18 @@ "iphone/6.0..latest", "android-browser/4.2..latest" ] + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] } } diff --git a/deps/npm/node_modules/gauge/node_modules/ansi-regex/index.js b/deps/npm/node_modules/gauge/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/gauge/node_modules/ansi-regex/license b/deps/npm/node_modules/gauge/node_modules/ansi-regex/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/gauge/node_modules/ansi-regex/package.json b/deps/npm/node_modules/gauge/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..017f53116a9e28 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/gauge/node_modules/strip-ansi/index.js b/deps/npm/node_modules/gauge/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/gauge/node_modules/strip-ansi/license b/deps/npm/node_modules/gauge/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/gauge/node_modules/strip-ansi/package.json b/deps/npm/node_modules/gauge/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..1a41108d42831c --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/has/LICENSE-MIT b/deps/npm/node_modules/has/LICENSE-MIT deleted file mode 100644 index ae7014d385df3d..00000000000000 --- a/deps/npm/node_modules/has/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/has/package.json b/deps/npm/node_modules/has/package.json deleted file mode 100644 index 7c4592f16de071..00000000000000 --- a/deps/npm/node_modules/has/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "has", - "description": "Object.prototype.hasOwnProperty.call shortcut", - "version": "1.0.3", - "homepage": "https://github.com/tarruda/has", - "author": { - "name": "Thiago de Arruda", - "email": "tpadilha84@gmail.com" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/tarruda/has.git" - }, - "bugs": { - "url": "https://github.com/tarruda/has/issues" - }, - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" - } - ], - "main": "./src", - "dependencies": { - "function-bind": "^1.1.1" - }, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "eslint": "^4.19.1", - "tape": "^4.9.0" - }, - "engines": { - "node": ">= 0.4.0" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "tape test" - } -} diff --git a/deps/npm/node_modules/has/src/index.js b/deps/npm/node_modules/has/src/index.js deleted file mode 100644 index dd92dd9094edb0..00000000000000 --- a/deps/npm/node_modules/has/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/deps/npm/node_modules/has/test/index.js b/deps/npm/node_modules/has/test/index.js deleted file mode 100644 index 43d480b2c2e763..00000000000000 --- a/deps/npm/node_modules/has/test/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var test = require('tape'); -var has = require('../'); - -test('has', function (t) { - t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); - t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); - t.end(); -}); diff --git a/deps/npm/node_modules/hasown/LICENSE b/deps/npm/node_modules/hasown/LICENSE new file mode 100644 index 00000000000000..0314929078de8a --- /dev/null +++ b/deps/npm/node_modules/hasown/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Jordan Harband and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/hasown/index.js b/deps/npm/node_modules/hasown/index.js new file mode 100644 index 00000000000000..3b91618323842f --- /dev/null +++ b/deps/npm/node_modules/hasown/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = require('function-bind'); + +/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ +module.exports = bind.call(call, $hasOwn); diff --git a/deps/npm/node_modules/hasown/package.json b/deps/npm/node_modules/hasown/package.json new file mode 100644 index 00000000000000..954500640223c2 --- /dev/null +++ b/deps/npm/node_modules/hasown/package.json @@ -0,0 +1,91 @@ +{ + "name": "hasown", + "version": "2.0.0", + "description": "A robust, ES3 compatible, \"has own property\" predicate.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run emit-types", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "npm run tsc", + "preemit-types": "rm -f *.ts *.ts.map test/*.ts test/*.ts.map", + "emit-types": "npm run tsc -- --noEmit false --emitDeclarationOnly", + "pretest": "npm run lint", + "tsc": "tsc -p .", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/hasOwn.git" + }, + "keywords": [ + "has", + "hasOwnProperty", + "hasOwn", + "has-own", + "own", + "has", + "property", + "in", + "javascript", + "ecmascript" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/hasOwn/issues" + }, + "homepage": "https://github.com/inspect-js/hasOwn#readme", + "dependencies": { + "function-bind": "^1.1.2" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/function-bind": "^1.1.9", + "@types/mock-property": "^1.0.1", + "@types/tape": "^5.6.3", + "aud": "^2.0.3", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "mock-property": "^1.0.2", + "npmignore": "^0.3.0", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.1", + "typescript": "^5.3.0-dev.20231019" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "test", + "!*.d.ts", + "!*.d.ts.map" + ] + } +} diff --git a/deps/npm/node_modules/hasown/tsconfig.json b/deps/npm/node_modules/hasown/tsconfig.json new file mode 100644 index 00000000000000..fdab34fe311577 --- /dev/null +++ b/deps/npm/node_modules/hasown/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + //"skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/LICENSE b/deps/npm/node_modules/http-proxy-agent/LICENSE similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/LICENSE rename to deps/npm/node_modules/http-proxy-agent/LICENSE diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/dist/index.js b/deps/npm/node_modules/http-proxy-agent/dist/index.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/dist/index.js rename to deps/npm/node_modules/http-proxy-agent/dist/index.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/package.json b/deps/npm/node_modules/http-proxy-agent/package.json similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/http-proxy-agent/package.json rename to deps/npm/node_modules/http-proxy-agent/package.json diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/index.js b/deps/npm/node_modules/https-proxy-agent/dist/index.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/index.js rename to deps/npm/node_modules/https-proxy-agent/dist/index.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js rename to deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/package.json b/deps/npm/node_modules/https-proxy-agent/package.json similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/https-proxy-agent/package.json rename to deps/npm/node_modules/https-proxy-agent/package.json diff --git a/deps/npm/node_modules/ip-regex/index.js b/deps/npm/node_modules/ip-regex/index.js index ab7a37f1caf0e3..1fe723cb7f5a9f 100644 --- a/deps/npm/node_modules/ip-regex/index.js +++ b/deps/npm/node_modules/ip-regex/index.js @@ -1,23 +1,23 @@ -'use strict'; - const word = '[a-fA-F\\d:]'; -const b = options => options && options.includeBoundaries ? - `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : - ''; + +const boundry = options => options && options.includeBoundaries + ? `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` + : ''; const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; -const v6seg = '[a-fA-F\\d]{1,4}'; +const v6segment = '[a-fA-F\\d]{1,4}'; + const v6 = ` (?: -(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${v6seg}:){5}(?::${v4}|(?::${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${v6seg}:){4}(?:(?::${v6seg}){0,1}:${v4}|(?::${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${v6seg}:){3}(?:(?::${v6seg}){0,2}:${v4}|(?::${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${v6seg}:){2}(?:(?::${v6seg}){0,3}:${v4}|(?::${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${v6seg}:){1}(?:(?::${v6seg}){0,4}:${v4}|(?::${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::(?:(?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 +(?:${v6segment}:){7}(?:${v6segment}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 +(?:${v6segment}:){6}(?:${v4}|:${v6segment}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 +(?:${v6segment}:){5}(?::${v4}|(?::${v6segment}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 +(?:${v6segment}:){4}(?:(?::${v6segment}){0,1}:${v4}|(?::${v6segment}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 +(?:${v6segment}:){3}(?:(?::${v6segment}){0,2}:${v4}|(?::${v6segment}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 +(?:${v6segment}:){2}(?:(?::${v6segment}){0,3}:${v4}|(?::${v6segment}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 +(?:${v6segment}:){1}(?:(?::${v6segment}){0,4}:${v4}|(?::${v6segment}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 +(?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 `.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); @@ -26,11 +26,11 @@ const v46Exact = new RegExp(`(?:^${v4}$)|(?:^${v6}$)`); const v4exact = new RegExp(`^${v4}$`); const v6exact = new RegExp(`^${v6}$`); -const ip = options => options && options.exact ? - v46Exact : - new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); +const ipRegex = options => options && options.exact + ? v46Exact + : new RegExp(`(?:${boundry(options)}${v4}${boundry(options)})|(?:${boundry(options)}${v6}${boundry(options)})`, 'g'); -ip.v4 = options => options && options.exact ? v4exact : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); -ip.v6 = options => options && options.exact ? v6exact : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); +ipRegex.v4 = options => options && options.exact ? v4exact : new RegExp(`${boundry(options)}${v4}${boundry(options)}`, 'g'); +ipRegex.v6 = options => options && options.exact ? v6exact : new RegExp(`${boundry(options)}${v6}${boundry(options)}`, 'g'); -module.exports = ip; +export default ipRegex; diff --git a/deps/npm/node_modules/ip-regex/license b/deps/npm/node_modules/ip-regex/license index e7af2f77107d73..fa7ceba3eb4a96 100644 --- a/deps/npm/node_modules/ip-regex/license +++ b/deps/npm/node_modules/ip-regex/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/ip-regex/package.json b/deps/npm/node_modules/ip-regex/package.json index 2fb8a03c812a09..1f82fd5947262b 100644 --- a/deps/npm/node_modules/ip-regex/package.json +++ b/deps/npm/node_modules/ip-regex/package.json @@ -1,16 +1,19 @@ { "name": "ip-regex", - "version": "4.3.0", + "version": "5.0.0", "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", "license": "MIT", "repository": "sindresorhus/ip-regex", + "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "scripts": { "test": "xo && ava && tsd" @@ -37,8 +40,8 @@ "validate" ], "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" + "ava": "^3.15.0", + "tsd": "^0.19.1", + "xo": "^0.47.0" } } diff --git a/deps/npm/node_modules/is-cidr/index.js b/deps/npm/node_modules/is-cidr/index.js index 8caef5fbb72a38..ed7f152c1163e7 100644 --- a/deps/npm/node_modules/is-cidr/index.js +++ b/deps/npm/node_modules/is-cidr/index.js @@ -1,9 +1,9 @@ -"use strict"; -const {v4, v6} = require("cidr-regex"); +import {v4 as v4Re, v6 as v6Re} from "cidr-regex"; -const re4 = v4({exact: true}); -const re6 = v6({exact: true}); +const re4 = v4Re({exact: true}); +const re6 = v6Re({exact: true}); -module.exports = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0); -module.exports.v4 = str => re4.test(str); -module.exports.v6 = str => re6.test(str); +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 b02775a0e3f6f8..d6971b3b33bd83 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": "4.0.2", + "version": "5.0.3", "description": "Check if a string is an IP address in CIDR notation", "author": "silverwind ", "contributors": [ @@ -8,39 +8,25 @@ ], "repository": "silverwind/is-cidr", "license": "BSD-2-Clause", - "scripts": { - "test": "make test" - }, + "type": "module", + "exports": "./index.js", + "sideEffects": false, "engines": { - "node": ">=10" + "node": ">=14" }, "files": [ "index.js", "index.d.ts" ], - "keywords": [ - "cidr", - "regex", - "notation", - "cidr notation", - "prefix", - "prefixes", - "ip", - "ip address", - "network" - ], "dependencies": { - "cidr-regex": "^3.1.1" + "cidr-regex": "4.0.3" }, "devDependencies": { - "eslint": "7.10.0", - "eslint-config-silverwind": "18.0.10", - "jest": "26.4.2", - "updates": "11.1.5", - "versions": "8.4.3" - }, - "jest": { - "verbose": false, - "testTimeout": 10000 + "eslint": "8.37.0", + "eslint-config-silverwind": "65.1.3", + "tsd": "0.28.1", + "updates": "13.2.9", + "versions": "10.4.2", + "vitest": "0.29.8" } } diff --git a/deps/npm/node_modules/is-core-module/index.js b/deps/npm/node_modules/is-core-module/index.js index f9637e0e7d3ffe..423e20c0d99db5 100644 --- a/deps/npm/node_modules/is-core-module/index.js +++ b/deps/npm/node_modules/is-core-module/index.js @@ -1,6 +1,6 @@ 'use strict'; -var has = require('has'); +var hasOwn = require('hasown'); function specifierIncluded(current, specifier) { var nodeParts = current.split('.'); @@ -65,5 +65,5 @@ function versionIncluded(nodeVersion, specifierValue) { var data = require('./core.json'); module.exports = function isCore(x, nodeVersion) { - return has(data, x) && versionIncluded(nodeVersion, data[x]); + return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); }; diff --git a/deps/npm/node_modules/is-core-module/package.json b/deps/npm/node_modules/is-core-module/package.json index 1269c80c5520d8..1bac5851fd637f 100644 --- a/deps/npm/node_modules/is-core-module/package.json +++ b/deps/npm/node_modules/is-core-module/package.json @@ -1,6 +1,6 @@ { "name": "is-core-module", - "version": "2.13.0", + "version": "2.13.1", "description": "Is this specifier a node.js core module?", "main": "index.js", "sideEffects": false, @@ -42,7 +42,7 @@ }, "homepage": "https://github.com/inspect-js/is-core-module", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "devDependencies": { "@ljharb/eslint-config": "^21.1.0", @@ -50,12 +50,12 @@ "auto-changelog": "^2.4.0", "eslint": "=8.8.0", "in-publish": "^2.0.1", - "mock-property": "^1.0.0", + "mock-property": "^1.0.2", "npmignore": "^0.3.0", "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", "semver": "^6.3.1", - "tape": "^5.6.6" + "tape": "^5.7.1" }, "auto-changelog": { "output": "CHANGELOG.md", diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index 5e4ae52a2fdddf..31e6c7386b1117 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "7.0.3", + "version": "7.0.4", "files": [ "bin/", "lib/" @@ -61,7 +61,7 @@ "dependencies": { "@npmcli/arborist": "^7.2.1", "@npmcli/run-script": "^7.0.2", - "ci-info": "^3.7.1", + "ci-info": "^4.0.0", "npm-package-arg": "^11.0.1", "npmlog": "^7.0.1", "pacote": "^17.0.4", diff --git a/deps/npm/node_modules/libnpmpublish/lib/provenance.js b/deps/npm/node_modules/libnpmpublish/lib/provenance.js index 45fe963d5f36f2..090d4cd7fe561c 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/provenance.js +++ b/deps/npm/node_modules/libnpmpublish/lib/provenance.js @@ -19,9 +19,11 @@ const generateProvenance = async (subject, opts) => { let payload if (ci.GITHUB_ACTIONS) { /* istanbul ignore next - not covering missing env var case */ - const [workflowPath, workflowRef] = (env.GITHUB_WORKFLOW_REF || '') - .replace(env.GITHUB_REPOSITORY + '/', '') - .split('@') + const relativeRef = (env.GITHUB_WORKFLOW_REF || '').replace(env.GITHUB_REPOSITORY + '/', '') + const delimiterIndex = relativeRef.indexOf('@') + const workflowPath = relativeRef.slice(0, delimiterIndex) + const workflowRef = relativeRef.slice(delimiterIndex + 1) + payload = { _type: INTOTO_STATEMENT_V1_TYPE, subject, diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index f5081a05188660..3d08280870ac72 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.1", + "version": "9.0.2", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", @@ -38,7 +38,7 @@ "bugs": "https://github.com/npm/cli/issues", "homepage": "https://npmjs.com/package/libnpmpublish", "dependencies": { - "ci-info": "^3.6.1", + "ci-info": "^4.0.0", "normalize-package-data": "^6.0.0", "npm-package-arg": "^11.0.1", "npm-registry-fetch": "^16.0.0", diff --git a/deps/npm/node_modules/lru-cache/dist/cjs/index.min.js b/deps/npm/node_modules/lru-cache/dist/cjs/index.min.js deleted file mode 100644 index 8d34a03041d25e..00000000000000 --- a/deps/npm/node_modules/lru-cache/dist/cjs/index.min.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";var x=(o,t,e)=>{if(!t.has(o))throw TypeError("Cannot "+e)};var j=(o,t,e)=>(x(o,t,"read from private field"),e?e.call(o):t.get(o)),I=(o,t,e)=>{if(t.has(o))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(o):t.set(o,e)},D=(o,t,e,i)=>(x(o,t,"write to private field"),i?i.call(o,e):t.set(o,e),e);Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var v=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,N=new Set,L=typeof process=="object"&&process?process:{},P=(o,t,e,i)=>{typeof L.emitWarning=="function"?L.emitWarning(o,t,e,i):console.error(`[${e}] ${t}: ${o}`)},W=globalThis.AbortController,M=globalThis.AbortSignal;if(typeof W>"u"){M=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},W=class{constructor(){t()}signal=new M;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let o=L.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{o&&(o=!1,P("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var V=o=>!N.has(o),Y=Symbol("type"),m=o=>o&&o===Math.floor(o)&&o>0&&isFinite(o),H=o=>m(o)?o<=Math.pow(2,8)?Uint8Array:o<=Math.pow(2,16)?Uint16Array:o<=Math.pow(2,32)?Uint32Array:o<=Number.MAX_SAFE_INTEGER?z:null:null,z=class extends Array{constructor(t){super(t),this.fill(0)}},E,T=class{heap;length;static create(t){let e=H(t);if(!e)return[];D(T,E,!0);let i=new T(t,e);return D(T,E,!1),i}constructor(t,e){if(!j(T,E))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},R=T;E=new WeakMap,I(R,E,!1);var C=class{#d;#f;#g;#p;#C;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#w;#n;#i;#t;#l;#c;#o;#h;#S;#r;#m;#F;#_;#b;#T;#a;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#_,sizes:t.#m,keyMap:t.#n,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#S,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#D(e,i,s,n),moveToTail:e=>t.#v(e),indexes:e=>t.#y(e),rindexes:e=>t.#A(e),isStale:e=>t.#u(e)}}get max(){return this.#d}get maxSize(){return this.#f}get calculatedSize(){return this.#w}get size(){return this.#s}get fetchMethod(){return this.#C}get dispose(){return this.#g}get disposeAfter(){return this.#p}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:a,allowStale:r,dispose:g,disposeAfter:b,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,noDeleteOnFetchRejection:l,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:_}=t;if(e!==0&&!m(e))throw new TypeError("max option must be a nonnegative integer");let O=e?H(e):Array;if(!O)throw new Error("invalid max value: "+e);if(this.#d=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#C=S,this.#T=!!S,this.#n=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new O(e),this.#c=new O(e),this.#o=0,this.#h=0,this.#S=R.create(e),this.#s=0,this.#w=0,typeof g=="function"&&(this.#g=g),typeof b=="function"?(this.#p=b,this.#r=[]):(this.#p=void 0,this.#r=void 0),this.#b=!!this.#g,this.#a=!!this.#p,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!l,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!p,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.#f!==0&&!m(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!m(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!a,this.ttlResolution=m(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!m(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#d===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#d&&!this.#f){let A="LRU_CACHE_UNBOUNDED";V(A)&&(N.add(A),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,C))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#L(){let t=new z(this.#d),e=new z(this.#d);this.#_=t,this.#F=e,this.#U=(n,h,a=v.now())=>{if(e[n]=h!==0?a:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#u(n)&&this.delete(this.#i[n])},h+1);r.unref&&r.unref()}},this.#z=n=>{e[n]=t[n]!==0?v.now():0},this.#O=(n,h)=>{if(t[h]){let a=t[h],r=e[h];n.ttl=a,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=a-g}};let i=0,s=()=>{let n=v.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#n.get(n);if(h===void 0)return 0;let a=t[h],r=e[h];if(a===0||r===0)return 1/0;let g=(i||s())-r;return a-g},this.#u=n=>t[n]!==0&&e[n]!==0&&(i||s())-e[n]>t[n]}#z=()=>{};#O=()=>{};#U=()=>{};#u=()=>!1;#I(){let t=new z(this.#d);this.#w=0,this.#m=t,this.#E=e=>{this.#w-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!m(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!m(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#R=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#w>n;)this.#W(!0)}this.#w+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#w)}}#E=t=>{};#R=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#y({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#h;!(!this.#x(e)||((t||!this.#u(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#A({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#o;!(!this.#x(e)||((t||!this.#u(e))&&(yield e),e===this.#h));)e=this.#l[e]}#x(t){return t!==void 0&&this.#n.get(this.#i[t])===t}*entries(){for(let t of this.#y())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#y()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#y())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(let i of this.#y()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#y()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#A({allowStale:!0}))this.#u(e)&&(this.delete(this.#i[e]),t=!0);return t}dump(){let t=[];for(let e of this.#y({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#_&&this.#F){h.ttl=this.#_[e];let a=v.now()-this.#F[e];h.start=Math.floor(Date.now()-a)}this.#m&&(h.size=this.#m[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=v.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,b=this.#G(t,e,i.size||0,a);if(this.maxEntrySize&&b>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#s===0?void 0:this.#n.get(t);if(f===void 0)f=this.#s===0?this.#h:this.#S.length!==0?this.#S.pop():this.#s===this.#d?this.#W(!1):this.#s,this.#i[f]=t,this.#t[f]=e,this.#n.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#s++,this.#R(f,b,r),r&&(r.set="add"),g=!1;else{this.#v(f);let u=this.#t[f];if(e!==u){if(this.#T&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#b&&this.#g?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#b&&this.#g?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#E(f),this.#R(f,b,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#_&&this.#L(),this.#_&&(g||this.#U(f,s,n),r&&this.#O(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#p?.(...c)}return this}pop(){try{for(;this.#s;){let t=this.#t[this.#o];if(this.#W(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#p?.(...e)}}}#W(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#T&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#b||this.#a)&&(this.#b&&this.#g?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#E(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#S.push(e)),this.#s===1?(this.#o=this.#h=0,this.#S.length=0):this.#o=this.#l[e],this.#n.delete(i),this.#s--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#n.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#u(n))s&&(s.has="stale",this.#O(s,n));else return i&&this.#z(n),s&&(s.has="hit",this.#O(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#n.get(t);if(s!==void 0&&(i||!this.#u(s))){let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}}#D(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new W,{signal:a}=i;a?.addEventListener("abort",()=>h.abort(a.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:l}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!S)return f(h.signal.reason);let y=c;return this.#t[e]===c&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},b=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,l=S&&i.allowStaleOnFetchAbort,w=l||i.allowStaleOnFetchRejection,y=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!y||p.__staleWhileFetching===void 0?this.delete(t):l||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let l=this.#C?.(t,n,r);l&&l instanceof Promise&&l.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,b),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#n.get(t)):this.#t[e]=F,F}#e(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof W}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:b=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:l,signal:w}=e;if(!this.#T)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:a,size:r,sizeCalculation:g,noUpdateTTL:b,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:l,signal:w},p=this.#n.get(t);if(p===void 0){l&&(l.fetch="miss");let _=this.#D(t,p,y,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let G=i&&_.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",G&&(l.returnedStale=!0)),G?_.__staleWhileFetching:_.__returned=_}let O=this.#u(p);if(!S&&!O)return l&&(l.fetch="hit"),this.#v(p),s&&this.#z(p),l&&this.#O(l,p),_;let A=this.#D(t,p,y,d),U=A.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=O?"stale":"refresh",U&&O&&(l.returnedStale=!0)),U?A.__staleWhileFetching:A.__returned=A}}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,a=this.#n.get(t);if(a!==void 0){let r=this.#t[a],g=this.#e(r);return h&&this.#O(h,a),this.#u(a)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.delete(t),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#v(a),s&&this.#z(a),r))}else h&&(h.get="miss")}#j(t,e){this.#c[e]=t,this.#l[t]=e}#v(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#c[t],this.#l[t]),this.#j(this.#h,t),this.#h=t)}delete(t){let e=!1;if(this.#s!==0){let i=this.#n.get(t);if(i!==void 0)if(e=!0,this.#s===1)this.clear();else{this.#E(i);let s=this.#t[i];this.#e(s)?s.__abortController.abort(new Error("deleted")):(this.#b||this.#a)&&(this.#b&&this.#g?.(s,t,"delete"),this.#a&&this.#r?.push([s,t,"delete"])),this.#n.delete(t),this.#i[i]=void 0,this.#t[i]=void 0,i===this.#h?this.#h=this.#c[i]:i===this.#o?this.#o=this.#l[i]:(this.#l[this.#c[i]]=this.#l[i],this.#c[this.#l[i]]=this.#c[i]),this.#s--,this.#S.push(i)}}if(this.#a&&this.#r?.length){let i=this.#r,s;for(;s=i?.shift();)this.#p?.(...s)}return e}clear(){for(let t of this.#A({allowStale:!0})){let e=this.#t[t];if(this.#e(e))e.__abortController.abort(new Error("deleted"));else{let i=this.#i[t];this.#b&&this.#g?.(e,i,"delete"),this.#a&&this.#r?.push([e,i,"delete"])}}if(this.#n.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#_&&this.#F&&(this.#_.fill(0),this.#F.fill(0)),this.#m&&this.#m.fill(0),this.#o=0,this.#h=0,this.#S.length=0,this.#w=0,this.#s=0,this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#p?.(...e)}}};exports.LRUCache=C; -//# sourceMappingURL=index.min.js.map diff --git a/deps/npm/node_modules/lru-cache/dist/cjs/index.js b/deps/npm/node_modules/lru-cache/dist/commonjs/index.js similarity index 98% rename from deps/npm/node_modules/lru-cache/dist/cjs/index.js rename to deps/npm/node_modules/lru-cache/dist/commonjs/index.js index 1d1f23a55ec4b4..3fec15958a5349 100644 --- a/deps/npm/node_modules/lru-cache/dist/cjs/index.js +++ b/deps/npm/node_modules/lru-cache/dist/commonjs/index.js @@ -435,6 +435,9 @@ class LRUCache { if (ttls[index]) { const ttl = ttls[index]; const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; status.ttl = ttl; status.start = start; status.now = cachedNow || getNow(); @@ -466,16 +469,16 @@ class LRUCache { } const ttl = ttls[index]; const start = starts[index]; - if (ttl === 0 || start === 0) { + if (!ttl || !start) { return Infinity; } const age = (cachedNow || getNow()) - start; return ttl - age; }; this.#isStale = index => { - return (ttls[index] !== 0 && - starts[index] !== 0 && - (cachedNow || getNow()) - starts[index] > ttls[index]); + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; }; } // conditionally set private methods related to TTL @@ -999,12 +1002,13 @@ class LRUCache { peek(k, peekOptions = {}) { const { allowStale = this.allowStale } = peekOptions; const index = this.#keyMap.get(k); - if (index !== undefined && - (allowStale || !this.#isStale(index))) { - const v = this.#valList[index]; - // either stale and allowed, or forcing a refresh of non-stale value - return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; } #backgroundFetch(k, index, options, context) { const v = index === undefined ? undefined : this.#valList[index]; @@ -1340,8 +1344,10 @@ class LRUCache { this.#head = this.#next[index]; } else { - this.#next[this.#prev[index]] = this.#next[index]; - this.#prev[this.#next[index]] = this.#prev[index]; + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; } this.#size--; this.#free.push(index); diff --git a/deps/npm/node_modules/lru-cache/dist/cjs/package.json b/deps/npm/node_modules/lru-cache/dist/commonjs/package.json similarity index 100% rename from deps/npm/node_modules/lru-cache/dist/cjs/package.json rename to deps/npm/node_modules/lru-cache/dist/commonjs/package.json diff --git a/deps/npm/node_modules/lru-cache/dist/mjs/index.js b/deps/npm/node_modules/lru-cache/dist/esm/index.js similarity index 98% rename from deps/npm/node_modules/lru-cache/dist/mjs/index.js rename to deps/npm/node_modules/lru-cache/dist/esm/index.js index 79025471782531..3c34d3de6c53cc 100644 --- a/deps/npm/node_modules/lru-cache/dist/mjs/index.js +++ b/deps/npm/node_modules/lru-cache/dist/esm/index.js @@ -432,6 +432,9 @@ export class LRUCache { if (ttls[index]) { const ttl = ttls[index]; const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; status.ttl = ttl; status.start = start; status.now = cachedNow || getNow(); @@ -463,16 +466,16 @@ export class LRUCache { } const ttl = ttls[index]; const start = starts[index]; - if (ttl === 0 || start === 0) { + if (!ttl || !start) { return Infinity; } const age = (cachedNow || getNow()) - start; return ttl - age; }; this.#isStale = index => { - return (ttls[index] !== 0 && - starts[index] !== 0 && - (cachedNow || getNow()) - starts[index] > ttls[index]); + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; }; } // conditionally set private methods related to TTL @@ -996,12 +999,13 @@ export class LRUCache { peek(k, peekOptions = {}) { const { allowStale = this.allowStale } = peekOptions; const index = this.#keyMap.get(k); - if (index !== undefined && - (allowStale || !this.#isStale(index))) { - const v = this.#valList[index]; - // either stale and allowed, or forcing a refresh of non-stale value - return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; } #backgroundFetch(k, index, options, context) { const v = index === undefined ? undefined : this.#valList[index]; @@ -1337,8 +1341,10 @@ export class LRUCache { this.#head = this.#next[index]; } else { - this.#next[this.#prev[index]] = this.#next[index]; - this.#prev[this.#next[index]] = this.#prev[index]; + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; } this.#size--; this.#free.push(index); diff --git a/deps/npm/node_modules/lru-cache/dist/mjs/package.json b/deps/npm/node_modules/lru-cache/dist/esm/package.json similarity index 100% rename from deps/npm/node_modules/lru-cache/dist/mjs/package.json rename to deps/npm/node_modules/lru-cache/dist/esm/package.json diff --git a/deps/npm/node_modules/lru-cache/dist/mjs/index.min.js b/deps/npm/node_modules/lru-cache/dist/mjs/index.min.js deleted file mode 100644 index 5a16b3940d6df9..00000000000000 --- a/deps/npm/node_modules/lru-cache/dist/mjs/index.min.js +++ /dev/null @@ -1,2 +0,0 @@ -var U=(o,t,e)=>{if(!t.has(o))throw TypeError("Cannot "+e)};var I=(o,t,e)=>(U(o,t,"read from private field"),e?e.call(o):t.get(o)),j=(o,t,e)=>{if(t.has(o))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(o):t.set(o,e)},D=(o,t,e,i)=>(U(o,t,"write to private field"),i?i.call(o,e):t.set(o,e),e);var v=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,M=new Set,L=typeof process=="object"&&process?process:{},P=(o,t,e,i)=>{typeof L.emitWarning=="function"?L.emitWarning(o,t,e,i):console.error(`[${e}] ${t}: ${o}`)},W=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof W>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},W=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let o=L.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{o&&(o=!1,P("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var V=o=>!M.has(o),Y=Symbol("type"),m=o=>o&&o===Math.floor(o)&&o>0&&isFinite(o),H=o=>m(o)?o<=Math.pow(2,8)?Uint8Array:o<=Math.pow(2,16)?Uint16Array:o<=Math.pow(2,32)?Uint32Array:o<=Number.MAX_SAFE_INTEGER?z:null:null,z=class extends Array{constructor(t){super(t),this.fill(0)}},E,T=class{heap;length;static create(t){let e=H(t);if(!e)return[];D(T,E,!0);let i=new T(t,e);return D(T,E,!1),i}constructor(t,e){if(!I(T,E))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},C=T;E=new WeakMap,j(C,E,!1);var R=class{#d;#f;#g;#p;#C;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#w;#n;#i;#t;#l;#c;#o;#h;#S;#r;#m;#F;#_;#b;#T;#a;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#_,sizes:t.#m,keyMap:t.#n,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#S,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#D(e,i,s,n),moveToTail:e=>t.#v(e),indexes:e=>t.#y(e),rindexes:e=>t.#A(e),isStale:e=>t.#u(e)}}get max(){return this.#d}get maxSize(){return this.#f}get calculatedSize(){return this.#w}get size(){return this.#s}get fetchMethod(){return this.#C}get dispose(){return this.#g}get disposeAfter(){return this.#p}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:a,allowStale:r,dispose:g,disposeAfter:b,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,noDeleteOnFetchRejection:l,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:_}=t;if(e!==0&&!m(e))throw new TypeError("max option must be a nonnegative integer");let O=e?H(e):Array;if(!O)throw new Error("invalid max value: "+e);if(this.#d=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#C=S,this.#T=!!S,this.#n=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new O(e),this.#c=new O(e),this.#o=0,this.#h=0,this.#S=C.create(e),this.#s=0,this.#w=0,typeof g=="function"&&(this.#g=g),typeof b=="function"?(this.#p=b,this.#r=[]):(this.#p=void 0,this.#r=void 0),this.#b=!!this.#g,this.#a=!!this.#p,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!l,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!p,this.ignoreFetchAbort=!!_,this.maxEntrySize!==0){if(this.#f!==0&&!m(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!m(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!a,this.ttlResolution=m(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!m(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#L()}if(this.#d===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#d&&!this.#f){let A="LRU_CACHE_UNBOUNDED";V(A)&&(M.add(A),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,R))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#L(){let t=new z(this.#d),e=new z(this.#d);this.#_=t,this.#F=e,this.#x=(n,h,a=v.now())=>{if(e[n]=h!==0?a:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#u(n)&&this.delete(this.#i[n])},h+1);r.unref&&r.unref()}},this.#z=n=>{e[n]=t[n]!==0?v.now():0},this.#O=(n,h)=>{if(t[h]){let a=t[h],r=e[h];n.ttl=a,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=a-g}};let i=0,s=()=>{let n=v.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#n.get(n);if(h===void 0)return 0;let a=t[h],r=e[h];if(a===0||r===0)return 1/0;let g=(i||s())-r;return a-g},this.#u=n=>t[n]!==0&&e[n]!==0&&(i||s())-e[n]>t[n]}#z=()=>{};#O=()=>{};#x=()=>{};#u=()=>!1;#j(){let t=new z(this.#d);this.#w=0,this.#m=t,this.#E=e=>{this.#w-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!m(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!m(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#W=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#w>n;)this.#R(!0)}this.#w+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#w)}}#E=t=>{};#W=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#y({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#h;!(!this.#U(e)||((t||!this.#u(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#A({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#o;!(!this.#U(e)||((t||!this.#u(e))&&(yield e),e===this.#h));)e=this.#l[e]}#U(t){return t!==void 0&&this.#n.get(this.#i[t])===t}*entries(){for(let t of this.#y())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#y()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#y())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(let i of this.#y()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#y()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#A({allowStale:!0}))this.#u(e)&&(this.delete(this.#i[e]),t=!0);return t}dump(){let t=[];for(let e of this.#y({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#_&&this.#F){h.ttl=this.#_[e];let a=v.now()-this.#F[e];h.start=Math.floor(Date.now()-a)}this.#m&&(h.size=this.#m[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=v.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,b=this.#G(t,e,i.size||0,a);if(this.maxEntrySize&&b>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#s===0?void 0:this.#n.get(t);if(f===void 0)f=this.#s===0?this.#h:this.#S.length!==0?this.#S.pop():this.#s===this.#d?this.#R(!1):this.#s,this.#i[f]=t,this.#t[f]=e,this.#n.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#s++,this.#W(f,b,r),r&&(r.set="add"),g=!1;else{this.#v(f);let u=this.#t[f];if(e!==u){if(this.#T&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#b&&this.#g?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#b&&this.#g?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#E(f),this.#W(f,b,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#_&&this.#L(),this.#_&&(g||this.#x(f,s,n),r&&this.#O(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#p?.(...c)}return this}pop(){try{for(;this.#s;){let t=this.#t[this.#o];if(this.#R(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#p?.(...e)}}}#R(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#T&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#b||this.#a)&&(this.#b&&this.#g?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#E(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#S.push(e)),this.#s===1?(this.#o=this.#h=0,this.#S.length=0):this.#o=this.#l[e],this.#n.delete(i),this.#s--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#n.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#u(n))s&&(s.has="stale",this.#O(s,n));else return i&&this.#z(n),s&&(s.has="hit",this.#O(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#n.get(t);if(s!==void 0&&(i||!this.#u(s))){let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}}#D(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new W,{signal:a}=i;a?.addEventListener("abort",()=>h.abort(a.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:l}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!S)return f(h.signal.reason);let y=c;return this.#t[e]===c&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},b=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,l=S&&i.allowStaleOnFetchAbort,w=l||i.allowStaleOnFetchRejection,y=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!y||p.__staleWhileFetching===void 0?this.delete(t):l||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let l=this.#C?.(t,n,r);l&&l instanceof Promise&&l.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,b),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#n.get(t)):this.#t[e]=F,F}#e(t){if(!this.#T)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof W}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:b=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:l,signal:w}=e;if(!this.#T)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:a,size:r,sizeCalculation:g,noUpdateTTL:b,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:l,signal:w},p=this.#n.get(t);if(p===void 0){l&&(l.fetch="miss");let _=this.#D(t,p,y,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let G=i&&_.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",G&&(l.returnedStale=!0)),G?_.__staleWhileFetching:_.__returned=_}let O=this.#u(p);if(!S&&!O)return l&&(l.fetch="hit"),this.#v(p),s&&this.#z(p),l&&this.#O(l,p),_;let A=this.#D(t,p,y,d),x=A.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=O?"stale":"refresh",x&&O&&(l.returnedStale=!0)),x?A.__staleWhileFetching:A.__returned=A}}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,a=this.#n.get(t);if(a!==void 0){let r=this.#t[a],g=this.#e(r);return h&&this.#O(h,a),this.#u(a)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.delete(t),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#v(a),s&&this.#z(a),r))}else h&&(h.get="miss")}#I(t,e){this.#c[e]=t,this.#l[t]=e}#v(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#I(this.#c[t],this.#l[t]),this.#I(this.#h,t),this.#h=t)}delete(t){let e=!1;if(this.#s!==0){let i=this.#n.get(t);if(i!==void 0)if(e=!0,this.#s===1)this.clear();else{this.#E(i);let s=this.#t[i];this.#e(s)?s.__abortController.abort(new Error("deleted")):(this.#b||this.#a)&&(this.#b&&this.#g?.(s,t,"delete"),this.#a&&this.#r?.push([s,t,"delete"])),this.#n.delete(t),this.#i[i]=void 0,this.#t[i]=void 0,i===this.#h?this.#h=this.#c[i]:i===this.#o?this.#o=this.#l[i]:(this.#l[this.#c[i]]=this.#l[i],this.#c[this.#l[i]]=this.#c[i]),this.#s--,this.#S.push(i)}}if(this.#a&&this.#r?.length){let i=this.#r,s;for(;s=i?.shift();)this.#p?.(...s)}return e}clear(){for(let t of this.#A({allowStale:!0})){let e=this.#t[t];if(this.#e(e))e.__abortController.abort(new Error("deleted"));else{let i=this.#i[t];this.#b&&this.#g?.(e,i,"delete"),this.#a&&this.#r?.push([e,i,"delete"])}}if(this.#n.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#_&&this.#F&&(this.#_.fill(0),this.#F.fill(0)),this.#m&&this.#m.fill(0),this.#o=0,this.#h=0,this.#S.length=0,this.#w=0,this.#s=0,this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#p?.(...e)}}};export{R as LRUCache}; -//# sourceMappingURL=index.min.js.map diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json index bae4a04839d1f7..e6cb6b32153b5b 100644 --- a/deps/npm/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "10.0.1", + "version": "10.0.2", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", @@ -11,67 +11,57 @@ "sideEffects": false, "scripts": { "build": "npm run prepare", - "preprepare": "rm -rf dist", - "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json", + "prepare": "tshy", "postprepare": "bash fixup.sh", "pretest": "npm run prepare", "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", + "test": "tap", + "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "format": "prettier --write .", - "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", "prebenchmark": "npm run prepare", "benchmark": "make -C benchmark", "preprofile": "npm run prepare", "profile": "make -C benchmark profile" }, - "main": "./dist/cjs/index.js", - "module": "./dist/mjs/index.js", - "exports": { - "./min": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.min.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.min.js" - } - }, - ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "exports": { + ".": "./src/index.ts", + "./min": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } } } }, "repository": "git://github.com/isaacs/node-lru-cache.git", "devDependencies": { - "@size-limit/preset-small-lib": "^7.0.8", + "@tapjs/clock": "^1.1.16", "@types/node": "^20.2.5", "@types/tap": "^15.0.6", "benchmark": "^2.1.4", - "c8": "^7.11.2", - "clock-mock": "^1.0.6", + "clock-mock": "^2.0.2", "esbuild": "^0.17.11", "eslint-config-prettier": "^8.5.0", "marked": "^4.2.12", "mkdirp": "^2.1.5", "prettier": "^2.6.2", - "size-limit": "^7.0.8", - "tap": "^16.3.4", - "ts-node": "^10.9.1", + "tap": "^18.5.7", + "tshy": "^1.8.0", "tslib": "^2.4.0", - "typedoc": "^0.24.6", - "typescript": "^5.0.4" + "typedoc": "^0.25.3", + "typescript": "^5.2.2" }, "license": "ISC", "files": [ @@ -92,17 +82,37 @@ "endOfLine": "lf" }, "tap": { - "coverage": false, "node-arg": [ - "--expose-gc", - "-r", - "ts-node/register" + "--expose-gc" ], - "ts": false + "plugin": [ + "@tapjs/clock" + ] }, - "size-limit": [ - { - "path": "./dist/mjs/index.js" + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./min": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } } - ] + }, + "type": "module", + "dependencies": { + "semver": "^7.3.5" + } } diff --git a/deps/npm/node_modules/signal-exit/dist/cjs/index.js b/deps/npm/node_modules/signal-exit/dist/cjs/index.js index 2e6c18316b9a5d..27d4e4f7fc7763 100644 --- a/deps/npm/node_modules/signal-exit/dist/cjs/index.js +++ b/deps/npm/node_modules/signal-exit/dist/cjs/index.js @@ -20,7 +20,7 @@ const processOk = (process) => !!process && const kExitEmitter = Symbol.for('signal-exit emitter'); const global = globalThis; const ObjectDefineProperty = Object.defineProperty.bind(Object); -// teeny tiny ee +// teeny special purpose ee class Emitter { emitted = { afterExit: false, @@ -63,12 +63,17 @@ class Emitter { } emit(ev, code, signal) { if (this.emitted[ev]) { - return; + return false; } this.emitted[ev] = true; + let ret = false; for (const fn of this.listeners[ev]) { - fn(code, signal); + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; } + return ret; } } class SignalExitBase { @@ -122,18 +127,22 @@ class SignalExit extends SignalExitBase { // exit v4 are not aware of each other, and each will attempt to let // the other handle it, so neither of them do. To correct this, we // detect if we're the only handler *except* for previous versions - // of signal-exit. + // of signal-exit, and increment by the count of listeners it has + // created. /* c8 ignore start */ - //@ts-ignore - if (typeof process.__signal_exit_emitter__ === 'object') - count++; + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } /* c8 ignore stop */ if (listeners.length === count) { this.unload(); - this.#emitter.emit('exit', null, sig); - this.#emitter.emit('afterExit', null, sig); + const ret = this.#emitter.emit('exit', null, sig); /* c8 ignore start */ - process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); /* c8 ignore stop */ } }; @@ -216,7 +225,6 @@ class SignalExit extends SignalExitBase { this.#process.exitCode = code || 0; /* c8 ignore stop */ this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); } #processEmit(ev, ...args) { @@ -230,7 +238,6 @@ class SignalExit extends SignalExitBase { const ret = og.call(this.#process, ev, ...args); /* c8 ignore start */ this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); /* c8 ignore stop */ return ret; } diff --git a/deps/npm/node_modules/signal-exit/dist/mjs/index.js b/deps/npm/node_modules/signal-exit/dist/mjs/index.js index 1e8dea6d4930b6..9a86ee86e1bc0d 100644 --- a/deps/npm/node_modules/signal-exit/dist/mjs/index.js +++ b/deps/npm/node_modules/signal-exit/dist/mjs/index.js @@ -16,7 +16,7 @@ const processOk = (process) => !!process && const kExitEmitter = Symbol.for('signal-exit emitter'); const global = globalThis; const ObjectDefineProperty = Object.defineProperty.bind(Object); -// teeny tiny ee +// teeny special purpose ee class Emitter { emitted = { afterExit: false, @@ -59,12 +59,17 @@ class Emitter { } emit(ev, code, signal) { if (this.emitted[ev]) { - return; + return false; } this.emitted[ev] = true; + let ret = false; for (const fn of this.listeners[ev]) { - fn(code, signal); + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; } + return ret; } } class SignalExitBase { @@ -118,18 +123,22 @@ class SignalExit extends SignalExitBase { // exit v4 are not aware of each other, and each will attempt to let // the other handle it, so neither of them do. To correct this, we // detect if we're the only handler *except* for previous versions - // of signal-exit. + // of signal-exit, and increment by the count of listeners it has + // created. /* c8 ignore start */ - //@ts-ignore - if (typeof process.__signal_exit_emitter__ === 'object') - count++; + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } /* c8 ignore stop */ if (listeners.length === count) { this.unload(); - this.#emitter.emit('exit', null, sig); - this.#emitter.emit('afterExit', null, sig); + const ret = this.#emitter.emit('exit', null, sig); /* c8 ignore start */ - process.kill(process.pid, sig === 'SIGHUP' ? this.#hupSig : sig); + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); /* c8 ignore stop */ } }; @@ -212,7 +221,6 @@ class SignalExit extends SignalExitBase { this.#process.exitCode = code || 0; /* c8 ignore stop */ this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); } #processEmit(ev, ...args) { @@ -226,7 +234,6 @@ class SignalExit extends SignalExitBase { const ret = og.call(this.#process, ev, ...args); /* c8 ignore start */ this.#emitter.emit('exit', this.#process.exitCode, null); - this.#emitter.emit('afterExit', this.#process.exitCode, null); /* c8 ignore stop */ return ret; } diff --git a/deps/npm/node_modules/signal-exit/package.json b/deps/npm/node_modules/signal-exit/package.json index 455452f96a0b3f..ac176cec743748 100644 --- a/deps/npm/node_modules/signal-exit/package.json +++ b/deps/npm/node_modules/signal-exit/package.json @@ -1,6 +1,6 @@ { "name": "signal-exit", - "version": "4.0.2", + "version": "4.1.0", "description": "when you want to fire an event no matter how a process exits.", "main": "./dist/cjs/index.js", "module": "./dist/mjs/index.js", diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent/dist/index.js b/deps/npm/node_modules/socks-proxy-agent/dist/index.js similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent/dist/index.js rename to deps/npm/node_modules/socks-proxy-agent/dist/index.js diff --git a/deps/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent/package.json b/deps/npm/node_modules/socks-proxy-agent/package.json similarity index 100% rename from deps/npm/node_modules/@npmcli/agent/node_modules/socks-proxy-agent/package.json rename to deps/npm/node_modules/socks-proxy-agent/package.json diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/license b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/package.json b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..017f53116a9e28 --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/index.js b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/license b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/package.json b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..1a41108d42831c --- /dev/null +++ b/deps/npm/node_modules/string-width-cjs/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/license b/deps/npm/node_modules/string-width/node_modules/ansi-regex/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..017f53116a9e28 --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/license b/deps/npm/node_modules/string-width/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..1a41108d42831c --- /dev/null +++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..017f53116a9e28 --- /dev/null +++ b/deps/npm/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/strip-ansi/index.js b/deps/npm/node_modules/strip-ansi/index.js index 9a593dfcd1fd5c..ba19750e64e061 100644 --- a/deps/npm/node_modules/strip-ansi/index.js +++ b/deps/npm/node_modules/strip-ansi/index.js @@ -1,4 +1,14 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); +import ansiRegex from 'ansi-regex'; -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; +const regex = ansiRegex(); + +export default function stripAnsi(string) { + if (typeof string !== 'string') { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + + // Even though the regex is global, we don't need to reset the `.lastIndex` + // because unlike `.exec()` and `.test()`, `.replace()` does it automatically + // and doing it manually has a performance penalty. + return string.replace(regex, ''); +} diff --git a/deps/npm/node_modules/strip-ansi/license b/deps/npm/node_modules/strip-ansi/license index e7af2f77107d73..fa7ceba3eb4a96 100644 --- a/deps/npm/node_modules/strip-ansi/license +++ b/deps/npm/node_modules/strip-ansi/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/strip-ansi/package.json b/deps/npm/node_modules/strip-ansi/package.json index 1a41108d42831c..e1f455c325b007 100644 --- a/deps/npm/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/strip-ansi/package.json @@ -1,16 +1,19 @@ { "name": "strip-ansi", - "version": "6.0.1", + "version": "7.1.0", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", + "funding": "https://github.com/chalk/strip-ansi?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", + "exports": "./index.js", "engines": { - "node": ">=8" + "node": ">=12" }, "scripts": { "test": "xo && ava && tsd" @@ -44,11 +47,11 @@ "text" ], "dependencies": { - "ansi-regex": "^5.0.1" + "ansi-regex": "^6.0.1" }, "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.10.0", - "xo": "^0.25.3" + "ava": "^3.15.0", + "tsd": "^0.17.0", + "xo": "^0.44.0" } } diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..616ff837d3ff01 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..017f53116a9e28 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/index.js b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/index.js new file mode 100644 index 00000000000000..5d82581a13f990 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/license b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/package.json b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/package.json new file mode 100644 index 00000000000000..75393284d7e474 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9a593dfcd1fd5c --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..1a41108d42831c --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 130a0929b8ce8c..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,8 +0,0 @@ -export default function ansiRegex({onlyFirst = false} = {}) { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/index.js deleted file mode 100644 index d7bede44b7b6ba..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,223 +0,0 @@ -const ANSI_BACKGROUND_OFFSET = 10; - -const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`; - -const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; - -const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; - -const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - overline: [53, 55], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29], - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - gray: [90, 39], // Alias of `blackBright` - grey: [90, 39], // Alias of `blackBright` - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39], - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgGray: [100, 49], // Alias of `bgBlackBright` - bgGrey: [100, 49], // Alias of `bgBlackBright` - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49], - }, -}; - -export const modifierNames = Object.keys(styles.modifier); -export const foregroundColorNames = Object.keys(styles.color); -export const backgroundColorNames = Object.keys(styles.bgColor); -export const colorNames = [...foregroundColorNames, ...backgroundColorNames]; - -function assembleStyles() { - const codes = new Map(); - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m`, - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false, - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false, - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - styles.color.ansi = wrapAnsi16(); - styles.color.ansi256 = wrapAnsi256(); - styles.color.ansi16m = wrapAnsi16m(); - styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); - - // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js - Object.defineProperties(styles, { - rgbToAnsi256: { - value: (red, green, blue) => { - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (red === green && green === blue) { - if (red < 8) { - return 16; - } - - if (red > 248) { - return 231; - } - - return Math.round(((red - 8) / 247) * 24) + 232; - } - - return 16 - + (36 * Math.round(red / 255 * 5)) - + (6 * Math.round(green / 255 * 5)) - + Math.round(blue / 255 * 5); - }, - enumerable: false, - }, - hexToRgb: { - value: hex => { - const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); - if (!matches) { - return [0, 0, 0]; - } - - let [colorString] = matches; - - if (colorString.length === 3) { - colorString = [...colorString].map(character => character + character).join(''); - } - - const integer = Number.parseInt(colorString, 16); - - return [ - /* eslint-disable no-bitwise */ - (integer >> 16) & 0xFF, - (integer >> 8) & 0xFF, - integer & 0xFF, - /* eslint-enable no-bitwise */ - ]; - }, - enumerable: false, - }, - hexToAnsi256: { - value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), - enumerable: false, - }, - ansi256ToAnsi: { - value: code => { - if (code < 8) { - return 30 + code; - } - - if (code < 16) { - return 90 + (code - 8); - } - - let red; - let green; - let blue; - - if (code >= 232) { - red = (((code - 232) * 10) + 8) / 255; - green = red; - blue = red; - } else { - code -= 16; - - const remainder = code % 36; - - red = Math.floor(code / 36) / 5; - green = Math.floor(remainder / 6) / 5; - blue = (remainder % 6) / 5; - } - - const value = Math.max(red, green, blue) * 2; - - if (value === 0) { - return 30; - } - - // eslint-disable-next-line no-bitwise - let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); - - if (value === 2) { - result += 60; - } - - return result; - }, - enumerable: false, - }, - rgbToAnsi: { - value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), - enumerable: false, - }, - hexToAnsi: { - value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), - enumerable: false, - }, - }); - - return styles; -} - -const ansiStyles = assembleStyles(); - -export default ansiStyles; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js deleted file mode 100644 index ba19750e64e061..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import ansiRegex from 'ansi-regex'; - -const regex = ansiRegex(); - -export default function stripAnsi(string) { - if (typeof string !== 'string') { - throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); - } - - // Even though the regex is global, we don't need to reset the `.lastIndex` - // because unlike `.exec()` and `.test()`, `.replace()` does it automatically - // and doing it manually has a performance penalty. - return string.replace(regex, ''); -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license deleted file mode 100644 index fa7ceba3eb4a96..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/package.json b/deps/npm/package.json index 185b5090cb9a2f..a946e38493e0e4 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "10.2.3", + "version": "10.2.4", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -53,18 +53,18 @@ "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^7.2.1", - "@npmcli/config": "^8.0.1", + "@npmcli/config": "^8.0.2", "@npmcli/fs": "^3.1.0", "@npmcli/map-workspaces": "^3.0.4", "@npmcli/package-json": "^5.0.0", "@npmcli/promise-spawn": "^7.0.0", "@npmcli/run-script": "^7.0.2", - "@sigstore/tuf": "^2.1.0", + "@sigstore/tuf": "^2.2.0", "abbrev": "^2.0.0", "archy": "~1.0.0", "cacache": "^18.0.0", "chalk": "^5.3.0", - "ci-info": "^3.9.0", + "ci-info": "^4.0.0", "cli-columns": "^4.0.0", "cli-table3": "^0.6.3", "columnify": "^1.6.0", @@ -75,16 +75,16 @@ "hosted-git-info": "^7.0.1", "ini": "^4.1.1", "init-package-json": "^6.0.0", - "is-cidr": "^4.0.2", + "is-cidr": "^5.0.3", "json-parse-even-better-errors": "^3.0.0", "libnpmaccess": "^8.0.1", "libnpmdiff": "^6.0.3", - "libnpmexec": "^7.0.3", + "libnpmexec": "^7.0.4", "libnpmfund": "^5.0.1", "libnpmhook": "^10.0.0", "libnpmorg": "^6.0.1", "libnpmpack": "^6.0.3", - "libnpmpublish": "^9.0.1", + "libnpmpublish": "^9.0.2", "libnpmsearch": "^7.0.0", "libnpmteam": "^6.0.0", "libnpmversion": "^5.0.1", @@ -113,7 +113,7 @@ "semver": "^7.5.4", "spdx-expression-parse": "^3.0.1", "ssri": "^10.0.5", - "strip-ansi": "^6.0.1", + "strip-ansi": "^7.1.0", "supports-color": "^9.4.0", "tar": "^6.2.0", "text-table": "~0.2.0", @@ -209,7 +209,7 @@ "ajv-formats-draft2019": "^1.6.1", "diff": "^5.1.0", "licensee": "^10.0.0", - "nock": "^13.3.3", + "nock": "^13.3.8", "npm-packlist": "^8.0.0", "remark": "^14.0.2", "remark-gfm": "^3.0.1", diff --git a/deps/npm/tap-snapshots/test/lib/commands/search.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/search.js.test.cjs index 50032deb745739..3fd12d699bd77f 100644 --- a/deps/npm/tap-snapshots/test/lib/commands/search.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/commands/search.js.test.cjs @@ -46,20 +46,20 @@ pkg-no-desc | | =lukekarrys | 2019-09-26 ` exports[`test/lib/commands/search.js TAP search --parseable > should have expected search results as parseable 1`] = ` -libnpm Collection of programmatic APIs for the npm CLI =nlf =ruyadorno =darcyclarke =isaacs 2019-07-16 3.0.1 npm api package manager lib -libnpmaccess programmatic library for \`npm access\` commands =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 4.0.1 libnpmaccess -@evocateur/libnpmaccess programmatic library for \`npm access\` commands =evocateur 2019-07-16 3.1.2 -@evocateur/libnpmpublish Programmatic API for the bits behind npm publish and unpublish =evocateur 2019-07-16 1.2.2 -libnpmorg Programmatic api for \`npm org\` commands =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 2.0.1 libnpm npm package manager api orgs teams -libnpmsearch Programmatic API for searching in npm and compatible registries. =nlf =ruyadorno =darcyclarke =isaacs 2020-12-08 3.1.0 npm search api libnpm -libnpmteam npm Team management APIs =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 2.0.2 -libnpmhook programmatic API for managing npm registry hooks =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 6.0.1 npm hooks registry npm api -libnpmpublish Programmatic API for the bits behind npm publish and unpublish =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 4.0.0 -libnpmfund Programmatic API for npm fund =nlf =ruyadorno =darcyclarke =isaacs 2020-12-08 1.0.2 npm npmcli libnpm cli git fund gitfund -@npmcli/map-workspaces Retrieves a name:pathname Map for a given workspaces config =nlf =ruyadorno =darcyclarke =isaacs 2020-09-30 1.0.1 npm bad map npmcli libnpm cli workspaces map-workspaces -libnpmversion library to do the things that 'npm version' does =nlf =ruyadorno =darcyclarke =isaacs 2020-11-04 1.0.7 -@types/libnpmsearch TypeScript definitions for libnpmsearch =types 2019-09-26 2.0.1 -pkg-no-desc =lukekarrys 2019-09-26 1.0.0 +libnpm Collection of programmatic APIs for the npm CLI =nlf =ruyadorno =darcyclarke =isaacs 2019-07-16 3.0.1 npm api package manager lib +libnpmaccess programmatic library for \`npm access\` commands =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 4.0.1 libnpmaccess +@evocateur/libnpmaccess programmatic library for \`npm access\` commands =evocateur 2019-07-16 3.1.2 +@evocateur/libnpmpublish Programmatic API for the bits behind npm publish and unpublish =evocateur 2019-07-16 1.2.2 +libnpmorg Programmatic api for \`npm org\` commands =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 2.0.1 libnpm npm package manager api orgs teams +libnpmsearch Programmatic API for searching in npm and compatible registries. =nlf =ruyadorno =darcyclarke =isaacs 2020-12-08 3.1.0 npm search api libnpm +libnpmteam npm Team management APIs =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 2.0.2 +libnpmhook programmatic API for managing npm registry hooks =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 6.0.1 npm hooks registry npm api +libnpmpublish Programmatic API for the bits behind npm publish and unpublish =nlf =ruyadorno =darcyclarke =isaacs 2020-11-03 4.0.0 +libnpmfund Programmatic API for npm fund =nlf =ruyadorno =darcyclarke =isaacs 2020-12-08 1.0.2 npm npmcli libnpm cli git fund gitfund +@npmcli/map-workspaces Retrieves a name:pathname Map for a given workspaces config =nlf =ruyadorno =darcyclarke =isaacs 2020-09-30 1.0.1 npm bad map npmcli libnpm cli workspaces map-workspaces +libnpmversion library to do the things that 'npm version' does =nlf =ruyadorno =darcyclarke =isaacs 2020-11-04 1.0.7 +@types/libnpmsearch TypeScript definitions for libnpmsearch =types 2019-09-26 2.0.1 +pkg-no-desc =lukekarrys 2019-09-26 1.0.0 ` exports[`test/lib/commands/search.js TAP search > should have filtered expected search results 1`] = ` diff --git a/deps/npm/tap-snapshots/test/lib/utils/sbom-cyclonedx.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/sbom-cyclonedx.js.test.cjs index 878dfd4be4705b..7a8d79017f36a2 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/sbom-cyclonedx.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/sbom-cyclonedx.js.test.cjs @@ -912,6 +912,61 @@ exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with license express } ` +exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with license object > must match snapshot 1`] = ` +{ + "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", + "bomFormat": "CycloneDX", + "specVersion": "1.5", + "serialNumber": "urn:uuid:00000000-0000-0000-0000-000000000000", + "version": 1, + "metadata": { + "timestamp": "2020-01-01T00:00:00.000Z", + "lifecycles": [ + { + "phase": "build" + } + ], + "tools": [ + { + "vendor": "npm", + "name": "cli", + "version": "10.0.0 " + } + ], + "component": { + "bom-ref": "root@1.0.0", + "type": "library", + "name": "root", + "version": "1.0.0", + "scope": "required", + "author": "Author", + "purl": "pkg:npm/root@1.0.0", + "properties": [ + { + "name": "cdx:npm:package:path", + "value": "" + } + ], + "externalReferences": [], + "licenses": [ + { + "license": { + "id": "MIT" + } + } + ] + } + }, + "components": [], + "dependencies": [ + { + "ref": "root@1.0.0", + "dependsOn": [] + } + ] +} +` + exports[`test/lib/utils/sbom-cyclonedx.js TAP single node - with repository url > must match snapshot 1`] = ` { "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", diff --git a/deps/npm/tap-snapshots/test/lib/utils/sbom-spdx.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/sbom-spdx.js.test.cjs index 890bd29b7d2639..aeda27793a04ff 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/sbom-spdx.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/sbom-spdx.js.test.cjs @@ -504,3 +504,138 @@ exports[`test/lib/utils/sbom-spdx.js TAP single node - with integrity > must mat ] } ` + +exports[`test/lib/utils/sbom-spdx.js TAP single node - with license expression > must match snapshot 1`] = ` +{ + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": "root@1.0.0", + "documentNamespace": "docns", + "creationInfo": { + "created": "2020-01-01T00:00:00.000Z", + "creators": [ + "Tool: npm/cli-10.0.0 " + ] + }, + "documentDescribes": [ + "SPDXRef-Package-root-1.0.0" + ], + "packages": [ + { + "name": "root", + "SPDXID": "SPDXRef-Package-root-1.0.0", + "versionInfo": "1.0.0", + "packageFileName": "", + "downloadLocation": "NOASSERTION", + "filesAnalyzed": false, + "homepage": "NOASSERTION", + "licenseDeclared": "(MIT OR Apache-2.0)", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/root@1.0.0" + } + ] + } + ], + "relationships": [ + { + "spdxElementId": "SPDXRef-DOCUMENT", + "relatedSpdxElement": "SPDXRef-Package-root-1.0.0", + "relationshipType": "DESCRIBES" + } + ] +} +` + +exports[`test/lib/utils/sbom-spdx.js TAP single node - with license object > must match snapshot 1`] = ` +{ + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": "root@1.0.0", + "documentNamespace": "docns", + "creationInfo": { + "created": "2020-01-01T00:00:00.000Z", + "creators": [ + "Tool: npm/cli-10.0.0 " + ] + }, + "documentDescribes": [ + "SPDXRef-Package-root-1.0.0" + ], + "packages": [ + { + "name": "root", + "SPDXID": "SPDXRef-Package-root-1.0.0", + "versionInfo": "1.0.0", + "packageFileName": "", + "downloadLocation": "NOASSERTION", + "filesAnalyzed": false, + "homepage": "NOASSERTION", + "licenseDeclared": "MIT", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/root@1.0.0" + } + ] + } + ], + "relationships": [ + { + "spdxElementId": "SPDXRef-DOCUMENT", + "relatedSpdxElement": "SPDXRef-Package-root-1.0.0", + "relationshipType": "DESCRIBES" + } + ] +} +` + +exports[`test/lib/utils/sbom-spdx.js TAP single node - with single license > must match snapshot 1`] = ` +{ + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": "root@1.0.0", + "documentNamespace": "docns", + "creationInfo": { + "created": "2020-01-01T00:00:00.000Z", + "creators": [ + "Tool: npm/cli-10.0.0 " + ] + }, + "documentDescribes": [ + "SPDXRef-Package-root-1.0.0" + ], + "packages": [ + { + "name": "root", + "SPDXID": "SPDXRef-Package-root-1.0.0", + "versionInfo": "1.0.0", + "packageFileName": "", + "downloadLocation": "NOASSERTION", + "filesAnalyzed": false, + "homepage": "NOASSERTION", + "licenseDeclared": "ISC", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": "pkg:npm/root@1.0.0" + } + ] + } + ], + "relationships": [ + { + "spdxElementId": "SPDXRef-DOCUMENT", + "relatedSpdxElement": "SPDXRef-Package-root-1.0.0", + "relationshipType": "DESCRIBES" + } + ] +} +` diff --git a/deps/npm/test/lib/commands/exec.js b/deps/npm/test/lib/commands/exec.js index 07a3e6ebd8ed95..3cb4e90e855fe4 100644 --- a/deps/npm/test/lib/commands/exec.js +++ b/deps/npm/test/lib/commands/exec.js @@ -88,7 +88,7 @@ t.test('--prefix', async t => { t.ok(exists.isFile(), 'bin ran, creating file') }) -t.test('workspaces', async t => { +t.test('runs in workspace path', async t => { const registry = new MockRegistry({ tap: t, registry: 'https://registry.npmjs.org/', @@ -124,12 +124,101 @@ t.test('workspaces', async t => { await registry.package({ manifest, tarballs: { '1.0.0': path.join(npm.prefix, 'npm-exec-test'), - } }) + }, + }) await npm.exec('exec', ['@npmcli/npx-test']) const exists = await fs.stat(path.join(npm.prefix, 'workspace-a', 'npm-exec-test-success')) t.ok(exists.isFile(), 'bin ran, creating file inside workspace') }) +t.test('finds workspace bin first', async t => { + const { npm } = await loadMockNpm(t, { + config: { + workspace: ['workspace-a'], + }, + prefixDir: { + 'package.json': JSON.stringify({ + name: '@npmcli/npx-workspace-root-test', + bin: { 'npx-test': 'index.js' }, + workspaces: ['workspace-a'], + }), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-fail', '')`, + 'workspace-a': { + 'package.json': JSON.stringify({ + name: '@npmcli/npx-workspace-test', + bin: { 'npx-test': 'index.js' }, + }), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-success', '')`, + }, + }, + }) + + await npm.exec('install', []) // reify + await npm.exec('exec', ['npx-test']) + const exists = await fs.stat(path.join(npm.prefix, 'workspace-a', 'npm-exec-test-success')) + t.ok(exists.isFile(), 'bin ran, creating file inside workspace') + t.rejects(fs.stat(path.join(npm.prefix, 'npm-exec-test-fail'))) +}) + +t.test('finds workspace dep first', async t => { + const registry = new MockRegistry({ + tap: t, + registry: 'https://registry.npmjs.org/', + }) + + const manifest = registry.manifest({ name: '@npmcli/subdep', versions: ['1.0.0', '2.0.0'] }) + manifest.versions['1.0.0'].bin = { 'npx-test': 'index.js' } + manifest.versions['2.0.0'].bin = { 'npx-test': 'index.js' } + + const { npm } = await loadMockNpm(t, { + prefixDir: { + subdep: { + one: { + 'package.json': JSON.stringify(manifest.versions['1.0.0']), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-one', '')`, + }, + two: { + 'package.json': JSON.stringify(manifest.versions['2.0.0']), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-two', '')`, + }, + }, + 'package.json': JSON.stringify({ + name: '@npmcli/npx-workspace-root-test', + dependencies: { '@npmcli/subdep': '1.0.0' }, + bin: { 'npx-test': 'index.js' }, + workspaces: ['workspace-a'], + }), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-fail', '')`, + 'workspace-a': { + 'package.json': JSON.stringify({ + name: '@npmcli/npx-workspace-test', + dependencies: { '@npmcli/subdep': '2.0.0' }, + bin: { 'npx-test': 'index.js' }, + }), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-success', '')`, + }, + }, + }) + + await registry.package({ manifest, + tarballs: { + '1.0.0': path.join(npm.prefix, 'subdep', 'one'), + '2.0.0': path.join(npm.prefix, 'subdep', 'two'), + }, + }) + await npm.exec('install', []) + npm.config.set('workspace', ['workspace-a']) + await npm.exec('exec', ['npx-test']) + const exists = await fs.stat(path.join(npm.prefix, 'workspace-a', 'npm-exec-test-success')) + t.ok(exists.isFile(), 'bin ran, creating file') +}) + t.test('npx --no-install @npmcli/npx-test', async t => { const registry = new MockRegistry({ tap: t, diff --git a/deps/npm/test/lib/commands/hook.js b/deps/npm/test/lib/commands/hook.js index d3de4f5c55efad..448045cdd69162 100644 --- a/deps/npm/test/lib/commands/hook.js +++ b/deps/npm/test/lib/commands/hook.js @@ -243,7 +243,8 @@ t.test('npm hook ls', async t => { 'received the correct arguments' ) t.equal(outputs[0][0], 'You have 3 hooks configured.', 'prints the correct header') - const out = require('strip-ansi')(outputs[1][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[1][0]) t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook') t.match(out, /@npmcli.*https:\/\/google.com.*\n.*\n.*triggered just now/, 'prints scope hook') t.match(out, /~npm.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints owner hook') @@ -292,7 +293,8 @@ t.test('npm hook ls, single result', async t => { 'received the correct arguments' ) t.equal(outputs[0][0], 'You have one hook configured.', 'prints the correct header') - const out = require('strip-ansi')(outputs[1][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[1][0]) t.match(out, /semver.*https:\/\/google.com.*\n.*\n.*never triggered/, 'prints package hook') }) diff --git a/deps/npm/test/lib/commands/org.js b/deps/npm/test/lib/commands/org.js index 5c239295c33432..ed8fb238c4b0d8 100644 --- a/deps/npm/test/lib/commands/org.js +++ b/deps/npm/test/lib/commands/org.js @@ -1,5 +1,4 @@ const t = require('tap') -const ansiTrim = require('strip-ansi') const mockNpm = require('../../fixtures/mock-npm') const mockOrg = async (t, { orgSize = 1, orgList = {}, ...npmOpts } = {}) => { @@ -427,7 +426,8 @@ t.test('npm org ls', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.match(out, /one.*developer/, 'contains the developer member') t.match(out, /two.*admin/, 'contains the admin member') t.match(out, /three.*owner/, 'contains the owner member') @@ -452,7 +452,8 @@ t.test('npm org ls - user filter', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.match(out, /username.*admin/, 'contains the filtered member') t.notMatch(out, /missing.*admin/, 'does not contain other members') }) @@ -475,7 +476,8 @@ t.test('npm org ls - user filter, missing user', async t => { }, 'receieved the correct args' ) - const out = ansiTrim(outputs[0][0]) + const { default: stripAnsi } = await import('strip-ansi') + const out = stripAnsi(outputs[0][0]) t.notMatch(out, /username/, 'does not contain the requested member') t.notMatch(out, /missing.*admin/, 'does not contain other members') }) diff --git a/deps/npm/test/lib/commands/pkg.js b/deps/npm/test/lib/commands/pkg.js index f3401bde5226a8..168870f59d9d1e 100644 --- a/deps/npm/test/lib/commands/pkg.js +++ b/deps/npm/test/lib/commands/pkg.js @@ -662,6 +662,43 @@ t.test('workspaces', async t => { ) }) +t.test('single workspace', async t => { + const { pkg, OUTPUT } = await mockNpm(t, { + prefixDir: { + 'package.json': JSON.stringify({ + name: 'root', + version: '1.0.0', + workspaces: [ + 'packages/*', + ], + }), + packages: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + }), + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.2.3', + }), + }, + }, + }, + config: { workspace: ['packages/a'] }, + }) + + await pkg('get', 'name', 'version') + + t.strictSame( + JSON.parse(OUTPUT()), + { a: { name: 'a', version: '1.0.0' } }, + 'should only return info for one workspace' + ) +}) + t.test('fix', async t => { const { pkg, readPackageJson } = await mockNpm(t, { prefixDir: { diff --git a/deps/npm/test/lib/utils/open-url.js b/deps/npm/test/lib/utils/open-url.js index 0ce1b57aa5f9f7..dab7b41b92f1fb 100644 --- a/deps/npm/test/lib/utils/open-url.js +++ b/deps/npm/test/lib/utils/open-url.js @@ -124,7 +124,7 @@ t.test('prints where to go when given browser does not exist', async t => { const { openerUrl, openerOpts, joinedOutput } = await mockOpenUrl(t, ['https://www.npmjs.com', 'npm home'], { - openerResult: Object.assign(new Error('failed'), { code: 'ENOENT' }), + openerResult: Object.assign(new Error('failed'), { code: 127 }), } ) diff --git a/deps/npm/test/lib/utils/sbom-cyclonedx.js b/deps/npm/test/lib/utils/sbom-cyclonedx.js index 540feb9eb0ee34..da9b3f757988b4 100644 --- a/deps/npm/test/lib/utils/sbom-cyclonedx.js +++ b/deps/npm/test/lib/utils/sbom-cyclonedx.js @@ -190,6 +190,20 @@ t.test('single node - with license expression', t => { t.end() }) +t.test('single node - with license object', t => { + const pkg = { + ...rootPkg, + license: { + type: 'MIT', + url: 'http://github.com/kriskowal/q/raw/master/LICENSE', + }, + } + const node = { ...root, package: pkg } + const res = cyclonedxOutput({ npm, nodes: [node] }) + t.matchSnapshot(JSON.stringify(res)) + t.end() +}) + t.test('single node - from git url', t => { const node = { ...root, type: 'git', resolved: 'https://github.com/foo/bar#1234' } const res = cyclonedxOutput({ npm, nodes: [node] }) @@ -205,13 +219,15 @@ t.test('single node - no package info', t => { }) t.test('node - with deps', t => { - const node = { ...root, + const node = { + ...root, edgesOut: [ { to: dep1 }, { to: dep2 }, { to: undefined }, { to: { pkgid: 'foo' } }, - ] } + ], + } const res = cyclonedxOutput({ npm, nodes: [node, dep1, dep2, dep2Link] }) t.matchSnapshot(JSON.stringify(res)) t.end() diff --git a/deps/npm/test/lib/utils/sbom-spdx.js b/deps/npm/test/lib/utils/sbom-spdx.js index 74f6c3f34e71c4..d69e85667dc85b 100644 --- a/deps/npm/test/lib/utils/sbom-spdx.js +++ b/deps/npm/test/lib/utils/sbom-spdx.js @@ -109,6 +109,36 @@ t.test('single node - application package type', t => { t.end() }) +t.test('single node - with single license', t => { + const pkg = { ...rootPkg, license: 'ISC' } + const node = { ...root, package: pkg } + const res = spdxOutput({ npm, nodes: [node] }) + t.matchSnapshot(JSON.stringify(res)) + t.end() +}) + +t.test('single node - with license object', t => { + const pkg = { + ...rootPkg, + license: { + type: 'MIT', + url: 'http://github.com/kriskowal/q/raw/master/LICENSE', + }, + } + const node = { ...root, package: pkg } + const res = spdxOutput({ npm, nodes: [node] }) + t.matchSnapshot(JSON.stringify(res)) + t.end() +}) + +t.test('single node - with license expression', t => { + const pkg = { ...rootPkg, license: '(MIT OR Apache-2.0)' } + const node = { ...root, package: pkg } + const res = spdxOutput({ npm, nodes: [node] }) + t.matchSnapshot(JSON.stringify(res)) + t.end() +}) + t.test('single node - with description', t => { const pkg = { ...rootPkg, description: 'Package description' } const node = { ...root, package: pkg }