diff options
author | npm-robot <ops+robot@npmjs.com> | 2022-02-07 23:15:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 23:15:05 +0300 |
commit | af7caf8d4746ca527f7fee97b0dea18c026538d0 (patch) | |
tree | 732490e8f22597b76993b6b6178d0efd122e3ac8 /deps | |
parent | f7ff2ff304404751de4f1528d727413f4da930a9 (diff) |
deps: upgrade npm to 8.4.1
PR-URL: https://github.com/nodejs/node/pull/41836
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Diffstat (limited to 'deps')
229 files changed, 3692 insertions, 830 deletions
diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 5d61aac52a1..530df0971c8 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -838,6 +838,10 @@ include any versions, as that information is specified in `dependencies`. If this is spelled `"bundleDependencies"`, then that is also honored. +Alternatively, `"bundledDependencies"` can be defined as a boolean value. A +value of `true` will bundle all dependencies, a value of `false` will bundle +none. + ### optionalDependencies If a dependency can be used, but you would like npm to proceed if it cannot diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 83a385e0834..0af538fed52 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1190,6 +1190,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + <!-- automatically generated, do not edit manually --> <!-- see lib/utils/config/definitions.js --> diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 341a3fee9da..8ec85513f73 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -160,7 +160,7 @@ tree at all, use <a href="../commands/npm-explain.html"><code>npm explain</code> the results to only the paths to the packages named. Note that nested packages will <em>also</em> show the paths to the specified packages. For example, running <code>npm ls promzard</code> in npm's source tree will show:</p> -<pre lang="bash"><code>npm@8.3.2 /path/to/npm +<pre lang="bash"><code>npm@8.4.1 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 </code></pre> diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index ab49c472ab6..54650f61b9d 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@ npm command-line interface <pre lang="bash"><code>npm <command> [args] </code></pre> <h3 id="version">Version</h3> -<p>8.3.2</p> +<p>8.4.1</p> <h3 id="description">Description</h3> <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 diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 590749131e9..9aed0d3070d 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -774,6 +774,9 @@ This file contains the dependencies <code>renderized</code> and <code>super-stre can be installed in a new project by executing <code>npm install awesome-web-framework-1.0.0.tgz</code>. Note that the package names do not include any versions, as that information is specified in <code>dependencies</code>.</p> <p>If this is spelled <code>"bundleDependencies"</code>, then that is also honored.</p> +<p>Alternatively, <code>"bundledDependencies"</code> can be defined as a boolean value. A +value of <code>true</code> will bundle all dependencies, a value of <code>false</code> will bundle +none.</p> <h3 id="optionaldependencies">optionalDependencies</h3> <p>If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index b96eecd3902..96e6f781381 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -1100,6 +1100,7 @@ will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save< <p>When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use <code>npm prune</code>.</p> +<p>This configuration does not affect <code>npm ci</code>.</p> <!-- raw HTML omitted --> <!-- raw HTML omitted --> <h4 id="package-lock-only"><code>package-lock-only</code></h4> diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js index f61c97d6f90..7d3930dacbc 100644 --- a/deps/npm/lib/commands/access.js +++ b/deps/npm/lib/commands/access.js @@ -3,6 +3,7 @@ const path = require('path') const libaccess = require('libnpmaccess') const readPackageJson = require('read-package-json-fast') +const log = require('../utils/log-shim.js') const otplease = require('../utils/otplease.js') const getIdentity = require('../utils/get-identity.js') const BaseCommand = require('../base-command.js') @@ -76,7 +77,10 @@ class Access extends BaseCommand { throw this.usageError(`${cmd} is not a recognized subcommand.`) } - return this[cmd](args, this.npm.flatOptions) + return this[cmd](args, { + ...this.npm.flatOptions, + log, + }) } public ([pkg], opts) { diff --git a/deps/npm/lib/commands/ci.js b/deps/npm/lib/commands/ci.js index 2c2f8da8666..5e862a473a7 100644 --- a/deps/npm/lib/commands/ci.js +++ b/deps/npm/lib/commands/ci.js @@ -6,6 +6,7 @@ const runScript = require('@npmcli/run-script') const fs = require('fs') const readdir = util.promisify(fs.readdir) const log = require('../utils/log-shim.js') +const validateLockfile = require('../utils/validate-lockfile.js') const removeNodeModules = async where => { const rimrafOpts = { glob: false } @@ -37,6 +38,7 @@ class CI extends ArboristWorkspaceCmd { const where = this.npm.prefix const opts = { ...this.npm.flatOptions, + packageLock: true, // npm ci should never skip lock files path: where, log, save: false, // npm ci should never modify the lockfile or package.json @@ -55,6 +57,28 @@ class CI extends ArboristWorkspaceCmd { }), removeNodeModules(where), ]) + + // retrieves inventory of packages from loaded virtual tree (lock file) + const virtualInventory = new Map(arb.virtualTree.inventory) + + // build ideal tree step needs to come right after retrieving the virtual + // inventory since it's going to erase the previous ref to virtualTree + await arb.buildIdealTree() + + // verifies that the packages from the ideal tree will match + // the same versions that are present in the virtual tree (lock file) + // throws a validation error in case of mismatches + const errors = validateLockfile(virtualInventory, arb.idealTree.inventory) + if (errors.length) { + throw new Error( + '`npm ci` can only install packages when your package.json and ' + + 'package-lock.json or npm-shrinkwrap.json are in sync. Please ' + + 'update your lock file with `npm install` ' + + 'before continuing.\n\n' + + errors.join('\n') + '\n' + ) + } + await arb.reify(opts) const ignoreScripts = this.npm.config.get('ignore-scripts') diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js index 839e974caf0..5505b9bf77c 100644 --- a/deps/npm/lib/commands/deprecate.js +++ b/deps/npm/lib/commands/deprecate.js @@ -1,4 +1,5 @@ const fetch = require('npm-registry-fetch') +const log = require('../utils/log-shim.js') const otplease = require('../utils/otplease.js') const npa = require('npm-package-arg') const semver = require('semver') @@ -50,6 +51,7 @@ class Deprecate extends BaseCommand { ...this.npm.flatOptions, spec: p, query: { write: true }, + log, }) Object.keys(packument.versions) @@ -64,6 +66,7 @@ class Deprecate extends BaseCommand { method: 'PUT', body: packument, ignoreBody: true, + log, })) } } diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js index d737a58dc43..b3855aa08f3 100644 --- a/deps/npm/lib/commands/diff.js +++ b/deps/npm/lib/commands/diff.js @@ -61,6 +61,7 @@ class Diff extends BaseCommand { ...this.npm.flatOptions, diffFiles: args, where: this.top, + log, }) return this.npm.output(res) } @@ -193,6 +194,7 @@ class Diff extends BaseCommand { const packument = await pacote.packument(spec, { ...this.npm.flatOptions, preferOnline: true, + log, }) bSpec = pickManifest( packument, diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js index bf2dffe9120..e2b013206d3 100644 --- a/deps/npm/lib/commands/dist-tag.js +++ b/deps/npm/lib/commands/dist-tag.js @@ -29,7 +29,10 @@ class DistTag extends BaseCommand { } async exec ([cmdName, pkg, tag]) { - const opts = this.npm.flatOptions + const opts = { + ...this.npm.flatOptions, + log, + } if (['add', 'a', 'set', 's'].includes(cmdName)) { return this.add(pkg, tag, opts) diff --git a/deps/npm/lib/commands/hook.js b/deps/npm/lib/commands/hook.js index 2881f044e8e..c99a9958589 100644 --- a/deps/npm/lib/commands/hook.js +++ b/deps/npm/lib/commands/hook.js @@ -2,6 +2,7 @@ const hookApi = require('libnpmhook') const otplease = require('../utils/otplease.js') const relativeDate = require('tiny-relative-date') const Table = require('cli-table3') +const log = require('../utils/log-shim.js') const BaseCommand = require('../base-command.js') class Hook extends BaseCommand { @@ -20,7 +21,10 @@ class Hook extends BaseCommand { ] async exec (args) { - return otplease(this.npm.flatOptions, (opts) => { + return otplease({ + ...this.npm.flatOptions, + log, + }, (opts) => { switch (args[0]) { case 'add': return this.add(args[1], args[2], args[3], opts) diff --git a/deps/npm/lib/commands/logout.js b/deps/npm/lib/commands/logout.js index 4e6bab98595..34fbace5835 100644 --- a/deps/npm/lib/commands/logout.js +++ b/deps/npm/lib/commands/logout.js @@ -1,4 +1,4 @@ -const getAuth = require('npm-registry-fetch/auth.js') +const getAuth = require('npm-registry-fetch/lib/auth.js') const npmFetch = require('npm-registry-fetch') const log = require('../utils/log-shim') const BaseCommand = require('../base-command.js') @@ -25,6 +25,7 @@ class Logout extends BaseCommand { ...this.npm.flatOptions, method: 'DELETE', ignoreBody: true, + log, }) } else if (auth.isBasicAuth) { log.verbose('logout', `clearing user credentials for ${reg}`) diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index e1a6f8150aa..0cb5b4247a0 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -193,7 +193,12 @@ class Outdated extends ArboristWorkspaceCmd { } async getOutdatedInfo (edge) { - const spec = npa(edge.name) + let alias = false + try { + alias = npa(edge.spec).subSpec + } catch (err) { + } + const spec = npa(alias ? alias.name : edge.name) const node = edge.to || edge const { path, location } = node const { version: current } = node.package || {} @@ -217,7 +222,7 @@ class Outdated extends ArboristWorkspaceCmd { try { const packument = await this.getPackument(spec) - const expected = edge.spec + const expected = alias ? alias.fetchSpec : edge.spec // if it's not a range, version, or tag, skip it try { if (!npa(`${edge.name}@${edge.spec}`).registry) { @@ -239,7 +244,7 @@ class Outdated extends ArboristWorkspaceCmd { : 'global' this.list.push({ - name: edge.name, + name: alias ? edge.spec.replace('npm', edge.name) : edge.name, path, type, current, diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index c027ad64645..7b76b7be42e 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -57,7 +57,10 @@ class Owner extends BaseCommand { } async exec ([action, ...args]) { - const opts = this.npm.flatOptions + const opts = { + ...this.npm.flatOptions, + log, + } switch (action) { case 'ls': case 'list': @@ -195,6 +198,7 @@ class Owner extends BaseCommand { method: 'PUT', body, spec, + log, }) }) diff --git a/deps/npm/lib/commands/ping.js b/deps/npm/lib/commands/ping.js index 993e029d456..27089be4e17 100644 --- a/deps/npm/lib/commands/ping.js +++ b/deps/npm/lib/commands/ping.js @@ -10,7 +10,7 @@ class Ping extends BaseCommand { async exec (args) { log.notice('PING', this.npm.config.get('registry')) const start = Date.now() - const details = await pingUtil(this.npm.flatOptions) + const details = await pingUtil({ ...this.npm.flatOptions, log }) const time = Date.now() - start log.notice('PONG', `${time}ms`) if (this.npm.config.get('json')) { diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js index 1250ed7d1c7..9786e9ba4d4 100644 --- a/deps/npm/lib/commands/profile.js +++ b/deps/npm/lib/commands/profile.js @@ -108,7 +108,7 @@ class Profile extends BaseCommand { async get (args) { const tfa = 'two-factor auth' const info = await pulseTillDone.withPromise( - npmProfile.get(this.npm.flatOptions) + npmProfile.get({ ...this.npm.flatOptions, log }) ) if (!info.cidr_whitelist) { @@ -170,7 +170,7 @@ class Profile extends BaseCommand { } async set (args) { - const conf = this.npm.flatOptions + const conf = { ...this.npm.flatOptions, log } const prop = (args[0] || '').toLowerCase().trim() let value = args.length > 1 ? args.slice(1).join(' ') : null @@ -285,7 +285,7 @@ class Profile extends BaseCommand { if (auth.basic) { log.info('profile', 'Updating authentication to bearer token') const result = await npmProfile.createToken( - auth.basic.password, false, [], this.npm.flatOptions + auth.basic.password, false, [], { ...this.npm.flatOptions, log } ) if (!result.token) { @@ -309,7 +309,7 @@ class Profile extends BaseCommand { log.info('profile', 'Determine if tfa is pending') const userInfo = await pulseTillDone.withPromise( - npmProfile.get(this.npm.flatOptions) + npmProfile.get({ ...this.npm.flatOptions, log }) ) const conf = { ...this.npm.flatOptions } diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index b8209374925..339c80daad6 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -61,7 +61,7 @@ class Publish extends BaseCommand { throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim()) } - const opts = { ...this.npm.flatOptions } + const opts = { ...this.npm.flatOptions, log } // you can publish name@version, ./foo.tgz, etc. // even though the default is the 'file:.' cwd. diff --git a/deps/npm/lib/commands/star.js b/deps/npm/lib/commands/star.js index ec116058994..4974c39883e 100644 --- a/deps/npm/lib/commands/star.js +++ b/deps/npm/lib/commands/star.js @@ -29,12 +29,13 @@ class Star extends BaseCommand { const pkgs = args.map(npa) for (const pkg of pkgs) { const [username, fullData] = await Promise.all([ - getIdentity(this.npm, this.npm.flatOptions), + getIdentity(this.npm, { ...this.npm.flatOptions, log }), fetch.json(pkg.escapedName, { ...this.npm.flatOptions, spec: pkg, query: { write: true }, preferOnline: true, + log, }), ]) @@ -63,6 +64,7 @@ class Star extends BaseCommand { spec: pkg, method: 'PUT', body, + log, }) this.npm.output(show + ' ' + pkg.name) diff --git a/deps/npm/lib/commands/team.js b/deps/npm/lib/commands/team.js index 3d2fff0f069..e3fb9b83c5a 100644 --- a/deps/npm/lib/commands/team.js +++ b/deps/npm/lib/commands/team.js @@ -1,6 +1,7 @@ const columns = require('cli-columns') const libteam = require('libnpmteam') +const log = require('../utils/log-shim.js') const otplease = require('../utils/otplease.js') const BaseCommand = require('../base-command.js') @@ -42,7 +43,7 @@ class Team extends BaseCommand { // XXX: "description" option to libnpmteam is used as a description of the // team, but in npm's options, this is a boolean meaning "show the // description in npm search output". Hence its being set to null here. - await otplease(this.npm.flatOptions, opts => { + await otplease({ ...this.npm.flatOptions, log }, opts => { entity = entity.replace(/^@/, '') switch (cmd) { case 'create': return this.create(entity, opts) diff --git a/deps/npm/lib/commands/token.js b/deps/npm/lib/commands/token.js index df80f1afec4..cfb5ab66656 100644 --- a/deps/npm/lib/commands/token.js +++ b/deps/npm/lib/commands/token.js @@ -168,7 +168,7 @@ class Token extends BaseCommand { } config () { - const conf = { ...this.npm.flatOptions } + const conf = { ...this.npm.flatOptions, log } const creds = this.npm.config.getCredentialsByURI(conf.registry) if (creds.token) { conf.auth = { token: creds.token } diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js index 85c366381cc..42c9c1db963 100644 --- a/deps/npm/lib/commands/unpublish.js +++ b/deps/npm/lib/commands/unpublish.js @@ -32,7 +32,7 @@ class Unpublish extends BaseCommand { return [] } - const opts = this.npm.flatOptions + const opts = { ...this.npm.flatOptions, log } const username = await getIdentity(this.npm, { ...opts }).catch(() => null) if (!username) { return [] diff --git a/deps/npm/lib/commands/whoami.js b/deps/npm/lib/commands/whoami.js index dbf32c0e737..07ebe2e2447 100644 --- a/deps/npm/lib/commands/whoami.js +++ b/deps/npm/lib/commands/whoami.js @@ -1,4 +1,5 @@ const getIdentity = require('../utils/get-identity.js') +const log = require('../utils/log-shim.js') const BaseCommand = require('../base-command.js') class Whoami extends BaseCommand { @@ -7,7 +8,7 @@ class Whoami extends BaseCommand { static params = ['registry'] async exec (args) { - const username = await getIdentity(this.npm, this.npm.flatOptions) + const username = await getIdentity(this.npm, { ...this.npm.flatOptions, log }) this.npm.output( this.npm.config.get('json') ? JSON.stringify(username) : username ) diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js index 95d79f0f053..79222881c97 100644 --- a/deps/npm/lib/utils/config/definitions.js +++ b/deps/npm/lib/utils/config/definitions.js @@ -1417,6 +1417,8 @@ define('package-lock', { When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use \`npm prune\`. + + This configuration does not affect \`npm ci\`. `, flatten: (key, obj, flatOptions) => { flatten(key, obj, flatOptions) diff --git a/deps/npm/lib/utils/validate-lockfile.js b/deps/npm/lib/utils/validate-lockfile.js new file mode 100644 index 00000000000..29161ec55bb --- /dev/null +++ b/deps/npm/lib/utils/validate-lockfile.js @@ -0,0 +1,29 @@ +// compares the inventory of package items in the tree +// that is about to be installed (idealTree) with the inventory +// of items stored in the package-lock file (virtualTree) +// +// Returns empty array if no errors found or an array populated +// with an entry for each validation error found. +function validateLockfile (virtualTree, idealTree) { + const errors = [] + + // loops through the inventory of packages resulted by ideal tree, + // for each package compares the versions with the version stored in the + // package-lock and adds an error to the list in case of mismatches + for (const [key, entry] of idealTree.entries()) { + const lock = virtualTree.get(key) + + if (!lock) { + errors.push(`Missing: ${entry.name}@${entry.version} from lock file`) + continue + } + + if (entry.version !== lock.version) { + errors.push(`Invalid: lock file's ${lock.name}@${lock.version} does ` + + `not satisfy ${entry.name}@${entry.version}`) + } + } + return errors +} + +module.exports = validateLockfile diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 400e41ba630..cd47aaac579 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "January 2022" "" "" +.TH "NPM\-ACCESS" "1" "February 2022" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 43273a5c7f6..7539f3d9838 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "January 2022" "" "" +.TH "NPM\-ADDUSER" "1" "February 2022" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SS Synopsis diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index 23ad2c4f5e3..8968fda01b9 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-AUDIT" "1" "January 2022" "" "" +.TH "NPM\-AUDIT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-audit\fR \- Run a security audit .SS Synopsis diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index a9fcca68865..fc8787e881c 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "January 2022" "" "" +.TH "NPM\-BIN" "1" "February 2022" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 97431843d22..a4375f62f4e 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "January 2022" "" "" +.TH "NPM\-BUGS" "1" "February 2022" "" "" .SH "NAME" \fBnpm-bugs\fR \- Report bugs for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index e696f17f7a8..113d6aca915 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "January 2022" "" "" +.TH "NPM\-CACHE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SS Synopsis diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index df1f1c9831e..b54060b14d6 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CI" "1" "January 2022" "" "" +.TH "NPM\-CI" "1" "February 2022" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SS Synopsis diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 7ac09937c93..865ddbd9cbb 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "January 2022" "" "" +.TH "NPM\-COMPLETION" "1" "February 2022" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index ce13c858854..75561092f29 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "January 2022" "" "" +.TH "NPM\-CONFIG" "1" "February 2022" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SS Synopsis diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index cf2734ac96a..8d2d5082a10 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "January 2022" "" "" +.TH "NPM\-DEDUPE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication in the package tree .SS Synopsis diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 36b93d8d8b8..40cd6b65eb6 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "January 2022" "" "" +.TH "NPM\-DEPRECATE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index 995391d15f4..97a5f7b73cf 100644 --- a/deps/npm/man/man1/npm-diff.1 +++ b/deps/npm/man/man1/npm-diff.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIFF" "1" "January 2022" "" "" +.TH "NPM\-DIFF" "1" "February 2022" "" "" .SH "NAME" \fBnpm-diff\fR \- The registry diff command .SS Synopsis diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index bc37884fab8..ea472e34c82 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "January 2022" "" "" +.TH "NPM\-DIST\-TAG" "1" "February 2022" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SS Synopsis diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index d794821a7cb..41f3e723d52 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "January 2022" "" "" +.TH "NPM\-DOCS" "1" "February 2022" "" "" .SH "NAME" \fBnpm-docs\fR \- Open documentation for a package in a web browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index 49bfe6e2dda..93065933246 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "January 2022" "" "" +.TH "NPM\-DOCTOR" "1" "February 2022" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your npm environment .SS Synopsis diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index e20c8af8438..b7e3a1258f7 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "January 2022" "" "" +.TH "NPM\-EDIT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 46140f0993e..cdb86e43a76 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXEC" "1" "January 2022" "" "" +.TH "NPM\-EXEC" "1" "February 2022" "" "" .SH "NAME" \fBnpm-exec\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index 7467b24a155..e036b1c10b7 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLAIN" "1" "January 2022" "" "" +.TH "NPM\-EXPLAIN" "1" "February 2022" "" "" .SH "NAME" \fBnpm-explain\fR \- Explain installed packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 1c4f90deb90..9b9dcf3eae7 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "January 2022" "" "" +.TH "NPM\-EXPLORE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index 162dcf0d443..5670e811dac 100644 --- a/deps/npm/man/man1/npm-find-dupes.1 +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FIND\-DUPES" "1" "January 2022" "" "" +.TH "NPM\-FIND\-DUPES" "1" "February 2022" "" "" .SH "NAME" \fBnpm-find-dupes\fR \- Find duplication in the package tree .SS Synopsis diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index 5a45391788f..181beaf362a 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FUND" "1" "January 2022" "" "" +.TH "NPM\-FUND" "1" "February 2022" "" "" .SH "NAME" \fBnpm-fund\fR \- Retrieve funding information .SS Synopsis diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 299ae9e5945..8a65bb39cab 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "January 2022" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "February 2022" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SS Synopsis diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index d84fbb58849..7f7ac6ee6f0 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "January 2022" "" "" +.TH "NPM\-HELP" "1" "February 2022" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index 4c3bd994398..b4f772c73db 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "January 2022" "" "" +.TH "NPM\-HOOK" "1" "February 2022" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SS Synopsis diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 7a540d2b141..2aa55d63a2d 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "January 2022" "" "" +.TH "NPM\-INIT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-init\fR \- Create a package\.json file .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index acc190c20b6..50da8e31a59 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-CI\-TEST" "1" "January 2022" "" "" +.TH "NPM\-INSTALL\-CI\-TEST" "1" "February 2022" "" "" .SH "NAME" \fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 3f1a07292fa..709523d9bf8 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-TEST" "1" "January 2022" "" "" +.TH "NPM\-INSTALL\-TEST" "1" "February 2022" "" "" .SH "NAME" \fBnpm-install-test\fR \- Install package(s) and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index d6f5c5f07bb..c77e379e5ae 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "January 2022" "" "" +.TH "NPM\-INSTALL" "1" "February 2022" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 3e7efd00ebb..378c342e459 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "January 2022" "" "" +.TH "NPM\-LINK" "1" "February 2022" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 7be9d44c006..f7f121d6dbd 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "January 2022" "" "" +.TH "NPM\-LOGOUT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 038eb5e72dd..a6dd63ae88a 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "January 2022" "" "" +.TH "NPM\-LS" "1" "February 2022" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SS Synopsis @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@8\.3\.2 /path/to/npm +npm@8\.4\.1 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 8c147767fbf..45c366aa7dc 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ORG" "1" "January 2022" "" "" +.TH "NPM\-ORG" "1" "February 2022" "" "" .SH "NAME" \fBnpm-org\fR \- Manage orgs .SS Synopsis diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 947037359c8..6e001f2644f 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "January 2022" "" "" +.TH "NPM\-OUTDATED" "1" "February 2022" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 13937da6484..3a28988d012 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "January 2022" "" "" +.TH "NPM\-OWNER" "1" "February 2022" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SS Synopsis diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 9f0e0d8bc78..5ab05b0105c 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "January 2022" "" "" +.TH "NPM\-PACK" "1" "February 2022" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 82a42a75716..410c2e3dd00 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "January 2022" "" "" +.TH "NPM\-PING" "1" "February 2022" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-pkg.1 b/deps/npm/man/man1/npm-pkg.1 index db5e89d1304..08610b24d1e 100644 --- a/deps/npm/man/man1/npm-pkg.1 +++ b/deps/npm/man/man1/npm-pkg.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PKG" "1" "January 2022" "" "" +.TH "NPM\-PKG" "1" "February 2022" "" "" .SH "NAME" \fBnpm-pkg\fR \- Manages your package\.json .SS Synopsis diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 7219fbecd13..d4d7139d984 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "January 2022" "" "" +.TH "NPM\-PREFIX" "1" "February 2022" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SS Synopsis diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 7fe66a033ef..9cd5bfd055c 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "January 2022" "" "" +.TH "NPM\-PROFILE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SS Synopsis diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 37d62b46027..e7d4a13f801 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "January 2022" "" "" +.TH "NPM\-PRUNE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 80e66f59c30..820d0d6850a 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "January 2022" "" "" +.TH "NPM\-PUBLISH" "1" "February 2022" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 7f4dd093411..06c17d369a6 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "January 2022" "" "" +.TH "NPM\-REBUILD" "1" "February 2022" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 31fb205ece5..fe752dbfcfb 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "January 2022" "" "" +.TH "NPM\-REPO" "1" "February 2022" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 549e531902a..9c6f50e45d0 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "January 2022" "" "" +.TH "NPM\-RESTART" "1" "February 2022" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 4b9816bfd59..e2bfadbcb6b 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "January 2022" "" "" +.TH "NPM\-ROOT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SS Synopsis diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 6587e358824..4edb0b7dfd9 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "January 2022" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SS Synopsis diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 80e6eb14e26..2fd5032062a 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "January 2022" "" "" +.TH "NPM\-SEARCH" "1" "February 2022" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-set-script.1 b/deps/npm/man/man1/npm-set-script.1 index 1d45353ddbd..4ea8ba31c61 100644 --- a/deps/npm/man/man1/npm-set-script.1 +++ b/deps/npm/man/man1/npm-set-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SET\-SCRIPT" "1" "January 2022" "" "" +.TH "NPM\-SET\-SCRIPT" "1" "February 2022" "" "" .SH "NAME" \fBnpm-set-script\fR \- Set tasks in the scripts section of package\.json .SS Synopsis diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 1a407c697ac..63cdd183c72 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "January 2022" "" "" +.TH "NPM\-SHRINKWRAP" "1" "February 2022" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SS Synopsis diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 705cc9fbc3a..3de4cceda83 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "January 2022" "" "" +.TH "NPM\-STAR" "1" "February 2022" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 20af164e278..4325d32fddc 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "January 2022" "" "" +.TH "NPM\-STARS" "1" "February 2022" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SS Synopsis diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 314d3914fc1..756b08f22cd 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "January 2022" "" "" +.TH "NPM\-START" "1" "February 2022" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 1bfa7443897..dd2357ba5d8 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "January 2022" "" "" +.TH "NPM\-STOP" "1" "February 2022" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 0ce06f38265..3d7ebf14476 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "January 2022" "" "" +.TH "NPM\-TEAM" "1" "February 2022" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SS Synopsis diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index e71fef4ab04..c2fb13f4243 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "January 2022" "" "" +.TH "NPM\-TEST" "1" "February 2022" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 968fee9305c..5d07f4bf99c 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "January 2022" "" "" +.TH "NPM\-TOKEN" "1" "February 2022" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SS Synopsis diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 66aef70b046..ddf5d307f36 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "January 2022" "" "" +.TH "NPM\-UNINSTALL" "1" "February 2022" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 41e8bee4da4..affff7d9392 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "January 2022" "" "" +.TH "NPM\-UNPUBLISH" "1" "February 2022" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index 5fc5316a865..eca58debaf8 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNSTAR" "1" "January 2022" "" "" +.TH "NPM\-UNSTAR" "1" "February 2022" "" "" .SH "NAME" \fBnpm-unstar\fR \- Remove an item from your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index f4c4adf45f7..88db2f81166 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "January 2022" "" "" +.TH "NPM\-UPDATE" "1" "February 2022" "" "" .SH "NAME" \fBnpm-update\fR \- Update packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 38e9f9af68d..5e7f7d183e9 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "January 2022" "" "" +.TH "NPM\-VERSION" "1" "February 2022" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SS Synopsis diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 5d2fdadfaf6..b9239bc5e5e 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "January 2022" "" "" +.TH "NPM\-VIEW" "1" "February 2022" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SS Synopsis diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 60d67c543b1..c6375847287 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "January 2022" "" "" +.TH "NPM\-WHOAMI" "1" "February 2022" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SS Synopsis diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index bdb9becfe23..64dde670207 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "January 2022" "" "" +.TH "NPM" "1" "February 2022" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis @@ -10,7 +10,7 @@ npm <command> [args] .RE .SS Version .P -8\.3\.2 +8\.4\.1 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index aee52e51203..f8889038c7f 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "January 2022" "" "" +.TH "NPX" "1" "February 2022" "" "" .SH "NAME" \fBnpx\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index 3c449d41eef..5f0c9d7b3a5 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "January 2022" "" "" +.TH "FOLDERS" "5" "February 2022" "" "" .SH "NAME" \fBfolders\fR \- Folder Structures Used by npm .SS Description diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index 432d11eda9e..c894e36b113 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "January 2022" "" "" +.TH "INSTALL" "5" "February 2022" "" "" .SH "NAME" \fBinstall\fR \- Download and install node and npm .SS Description diff --git a/deps/npm/man/man5/npm-shrinkwrap-json.5 b/deps/npm/man/man5/npm-shrinkwrap-json.5 index 01216bd0fdc..ae6ade37717 100644 --- a/deps/npm/man/man5/npm-shrinkwrap-json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "January 2022" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "February 2022" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SS Description diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 983294e9c20..96ea17a22cc 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "January 2022" "" "" +.TH "NPMRC" "5" "February 2022" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SS Description diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 2695e041e7e..0637ee4f87b 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "January 2022" "" "" +.TH "PACKAGE\.JSON" "5" "February 2022" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description @@ -926,6 +926,10 @@ awesome\-web\-framework\-1\.0\.0\.tgz\fP\|\. Note that the package names do not include any versions, as that information is specified in \fBdependencies\fP\|\. .P If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. +.P +Alternatively, \fB"bundledDependencies"\fP can be defined as a boolean value\. A +value of \fBtrue\fP will bundle all dependencies, a value of \fBfalse\fP will bundle +none\. .SS optionalDependencies .P If a dependency can be used, but you would like npm to proceed if it cannot diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 98de34c0c59..8a1f2f35687 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "January 2022" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "February 2022" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SS Description diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 0e9cbcb1f2a..cb50d44069c 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "January 2022" "" "" +.TH "CONFIG" "7" "February 2022" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -1503,6 +1503,8 @@ will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\ When package package\-locks are disabled, automatic pruning of extraneous modules will also be disabled\. To remove extraneous modules with package\-locks disabled use \fBnpm prune\fP\|\. +.P +This configuration does not affect \fBnpm ci\fP\|\. <!\-\- automatically generated, do not edit manually \-\-> <!\-\- see lib/utils/config/definitions\.js \-\-> diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index 9deb251a185..46eb4d16fc4 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "January 2022" "" "" +.TH "DEVELOPERS" "7" "February 2022" "" "" .SH "NAME" \fBdevelopers\fR \- Developer Guide .SS Description diff --git a/deps/npm/man/man7/logging.7 b/deps/npm/man/man7/logging.7 index 0818e0debc0..0630cc4615e 100644 --- a/deps/npm/man/man7/logging.7 +++ b/deps/npm/man/man7/logging.7 @@ -1,4 +1,4 @@ -.TH "LOGGING" "7" "January 2022" "" "" +.TH "LOGGING" "7" "February 2022" "" "" .SH "NAME" \fBLogging\fR \- Why, What & How we Log .SS Description diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 6790323a4f7..29b1f57f994 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "January 2022" "" "" +.TH "ORGS" "7" "February 2022" "" "" .SH "NAME" \fBorgs\fR \- Working with Teams & Orgs .SS Description diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index 8f085101168..75607009bdc 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "January 2022" "" "" +.TH "REGISTRY" "7" "February 2022" "" "" .SH "NAME" \fBregistry\fR \- The JavaScript Package Registry .SS Description diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 17a7d3dacb0..53d96f5e3a2 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "January 2022" "" "" +.TH "REMOVAL" "7" "February 2022" "" "" .SH "NAME" \fBremoval\fR \- Cleaning the Slate .SS Synopsis diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index b1fd4d17f11..44521ae945d 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "January 2022" "" "" +.TH "SCOPE" "7" "February 2022" "" "" .SH "NAME" \fBscope\fR \- Scoped packages .SS Description diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index 33b70e92ca3..8190c97cba7 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "January 2022" "" "" +.TH "SCRIPTS" "7" "February 2022" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index a4c3eef8beb..9928675e894 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "January 2022" "" "" +.TH "WORKSPACES" "7" "February 2022" "" "" .SH "NAME" \fBworkspaces\fR \- Working with workspaces .SS Description diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index f20a554bd5e..0375e185149 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -269,6 +269,22 @@ module.exports = cls => class IdealTreeBuilder extends cls { this[_complete] = !!options.complete this[_preferDedupe] = !!options.preferDedupe this[_legacyBundling] = !!options.legacyBundling + + // validates list of update names, they must + // be dep names only, no semver ranges are supported + for (const name of update.names) { + const spec = npa(name) + const validationError = + new TypeError(`Update arguments must not contain package version specifiers + +Try using the package name instead, e.g: + npm update ${spec.name}`) + validationError.code = 'EUPDATEARGS' + + if (spec.fetchSpec !== 'latest') { + throw validationError + } + } this[_updateNames] = update.names this[_updateAll] = update.all @@ -320,7 +336,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // Load on a new Arborist object, so the Nodes aren't the same, // or else it'll get super confusing when we change them! .then(async root => { - if (!this[_updateAll] && !this[_global] && !root.meta.loadedFromDisk) { + if ((!this[_updateAll] && !this[_global] && !root.meta.loadedFromDisk) || (this[_global] && this[_updateNames].length)) { await new this.constructor(this.options).loadActual({ root }) const tree = root.target // even though we didn't load it from a package-lock.json FILE, diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js index 0d260858d81..c06ed80265e 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js @@ -212,7 +212,8 @@ module.exports = cls => class ActualLoader extends cls { const promises = [] for (const path of tree.workspaces.values()) { if (!this[_cache].has(path)) { - const p = this[_loadFSNode]({ path, root: this[_actualTree] }) + // workspace overrides use the root overrides + const p = this[_loadFSNode]({ path, root: this[_actualTree], useRootOverrides: true }) .then(node => this[_loadFSTree](node)) promises.push(p) } @@ -240,7 +241,7 @@ module.exports = cls => class ActualLoader extends cls { this[_actualTree] = root } - [_loadFSNode] ({ path, parent, real, root, loadOverrides }) { + [_loadFSNode] ({ path, parent, real, root, loadOverrides, useRootOverrides }) { if (!real) { return realpath(path, this[_rpcache], this[_stcache]) .then( @@ -250,6 +251,7 @@ module.exports = cls => class ActualLoader extends cls { real, root, loadOverrides, + useRootOverrides, }), // if realpath fails, just provide a dummy error node error => new Node({ @@ -289,6 +291,9 @@ module.exports = cls => class ActualLoader extends cls { parent, root, loadOverrides, + ...(useRootOverrides && root.overrides + ? { overrides: root.overrides.getNodeRule({ name: pkg.name, version: pkg.version }) } + : {}), }) }) .then(node => { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index d5e70323830..45ef9398535 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -5,6 +5,7 @@ const pacote = require('pacote') const AuditReport = require('../audit-report.js') const { subset, intersects } = require('semver') const npa = require('npm-package-arg') +const semver = require('semver') const debug = require('../debug.js') const walkUp = require('walk-up-path') @@ -1273,6 +1274,21 @@ module.exports = cls => class Reifier extends cls { } } + // Returns true if any of the edges from this node has a semver + // range definition that is an exact match to the version installed + // e.g: should return true if for a given an installed version 1.0.0, + // range is either =1.0.0 or 1.0.0 + const exactVersion = node => { + for (const edge of node.edgesIn) { + try { + if (semver.subset(edge.spec, node.version)) { + return false + } + } catch {} + } + return true + } + // helper that retrieves an array of nodes that were // potentially updated during the reify process, in order // to limit the number of nodes to check and update, only @@ -1284,6 +1300,8 @@ module.exports = cls => class Reifier extends cls { const filterDirectDependencies = node => !node.isRoot && node.resolveParent.isRoot && (!names || names.includes(node.name)) + && exactVersion(node) // skip update for exact ranges + const directDeps = this.idealTree.inventory .filter(filterDirectDependencies) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js index b45fea0ac61..bb6971f7ad5 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js @@ -476,8 +476,13 @@ class Shrinkwrap { // all good! hidden lockfile is the newest thing in here. return data }).catch(er => { - const rel = relpath(this.path, this.filename) - this.log.verbose('shrinkwrap', `failed to load ${rel}`, er) + /* istanbul ignore else */ + if (typeof this.filename === 'string') { + const rel = relpath(this.path, this.filename) + this.log.verbose('shrinkwrap', `failed to load ${rel}`, er) + } else { + this.log.verbose('shrinkwrap', `failed to load ${this.path}`, er) + } this.loadingError = er this.loadedFromDisk = false this.ancientLockfile = false diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index 493a0a78c5c..5c33f71678a 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "4.2.1", + "version": "4.3.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -22,7 +22,7 @@ "npm-install-checks": "^4.0.0", "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.0", - "npm-registry-fetch": "^11.0.0", + "npm-registry-fetch": "^12.0.1", "pacote": "^12.0.2", "parse-conflict-json": "^2.0.1", "proc-log": "^1.0.0", diff --git a/deps/npm/node_modules/@npmcli/fs/LICENSE.md b/deps/npm/node_modules/@npmcli/fs/LICENSE.md index 845be76f64e..5fc208ff122 100644 --- a/deps/npm/node_modules/@npmcli/fs/LICENSE.md +++ b/deps/npm/node_modules/@npmcli/fs/LICENSE.md @@ -1,3 +1,5 @@ +<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> + ISC License Copyright npm, Inc. diff --git a/deps/npm/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js b/deps/npm/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js index 794d9bba415..6cc90f0b07d 100644 --- a/deps/npm/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js +++ b/deps/npm/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js @@ -29,7 +29,8 @@ class ERR_INVALID_FILE_URL_PATH extends TypeError { class ERR_INVALID_ARG_TYPE extends TypeError { constructor (name, actual) { - super(`The "${name}" argument must be one of type string or an instance of URL. Received type ${typeof actual} ${actual}`) + super(`The "${name}" argument must be one of type string or an instance ` + + `of URL. Received type ${typeof actual} ${actual}`) this.code = 'ERR_INVALID_ARG_TYPE' } diff --git a/deps/npm/node_modules/@npmcli/fs/lib/cp/LICENSE b/deps/npm/node_modules/@npmcli/fs/lib/cp/LICENSE new file mode 100644 index 00000000000..93546dfb765 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/fs/lib/cp/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +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/@npmcli/fs/lib/cp/index.js b/deps/npm/node_modules/@npmcli/fs/lib/cp/index.js new file mode 100644 index 00000000000..5da4739bdd5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/fs/lib/cp/index.js @@ -0,0 +1,22 @@ +const fs = require('../fs.js') +const getOptions = require('../common/get-options.js') +const node = require('../common/node.js') +const polyfill = require('./polyfill.js') + +// node 16.7.0 added fs.cp +const useNative = node.satisfies('>=16.7.0') + +const cp = async (src, dest, opts) => { + const options = getOptions(opts, { + copy: ['dereference', 'errorOnExist', 'filter', 'force', 'preserveTimestamps', 'recursive'], + }) + + // the polyfill is tested separately from this module, no need to hack + // process.version to try to trigger it just for coverage + // istanbul ignore next + return useNative + ? fs.cp(src, dest, options) + : polyfill(src, dest, options) +} + +module.exports = cp diff --git a/deps/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js b/deps/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js new file mode 100644 index 00000000000..f83ccbf57ec --- /dev/null +++ b/deps/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js @@ -0,0 +1,428 @@ +// this file is a modified version of the code in node 17.2.0 +// which is, in turn, a modified version of the fs-extra module on npm +// node core changes: +// - Use of the assert module has been replaced with core's error system. +// - All code related to the glob dependency has been removed. +// - Bring your own custom fs module is not currently supported. +// - Some basic code cleanup. +// changes here: +// - remove all callback related code +// - drop sync support +// - change assertions back to non-internal methods (see options.js) +// - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows +'use strict' + +const { + ERR_FS_CP_DIR_TO_NON_DIR, + ERR_FS_CP_EEXIST, + ERR_FS_CP_EINVAL, + ERR_FS_CP_FIFO_PIPE, + ERR_FS_CP_NON_DIR_TO_DIR, + ERR_FS_CP_SOCKET, + ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, + ERR_FS_CP_UNKNOWN, + ERR_FS_EISDIR, + ERR_INVALID_ARG_TYPE, +} = require('../errors.js') +const { + constants: { + errno: { + EEXIST, + EISDIR, + EINVAL, + ENOTDIR, + }, + }, +} = require('os') +const { + chmod, + copyFile, + lstat, + mkdir, + readdir, + readlink, + stat, + symlink, + unlink, + utimes, +} = require('../fs.js') +const { + dirname, + isAbsolute, + join, + parse, + resolve, + sep, + toNamespacedPath, +} = require('path') +const { fileURLToPath } = require('url') + +const defaultOptions = { + dereference: false, + errorOnExist: false, + filter: undefined, + force: true, + preserveTimestamps: false, + recursive: false, +} + +async function cp (src, dest, opts) { + if (opts != null && typeof opts !== 'object') { + throw new ERR_INVALID_ARG_TYPE('options', ['Object'], opts) + } + return cpFn( + toNamespacedPath(getValidatedPath(src)), + toNamespacedPath(getValidatedPath(dest)), + { ...defaultOptions, ...opts }) +} + +function getValidatedPath (fileURLOrPath) { + const path = fileURLOrPath != null && fileURLOrPath.href + && fileURLOrPath.origin + ? fileURLToPath(fileURLOrPath) + : fileURLOrPath + return path +} + +async function cpFn (src, dest, opts) { + // Warn about using preserveTimestamps on 32-bit node + // istanbul ignore next + if (opts.preserveTimestamps && process.arch === 'ia32') { + const warning = 'Using the preserveTimestamps option in 32-bit ' + + 'node is not recommended' + process.emitWarning(warning, 'TimestampPrecisionWarning') + } + const stats = await checkPaths(src, dest, opts) + const { srcStat, destStat } = stats + await checkParentPaths(src, srcStat, dest) + if (opts.filter) { + return handleFilter(checkParentDir, destStat, src, dest, opts) + } + return checkParentDir(destStat, src, dest, opts) +} + +async function checkPaths (src, dest, opts) { + const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts) + if (destStat) { + if (areIdentical(srcStat, destStat)) { + throw new ERR_FS_CP_EINVAL({ + message: 'src and dest cannot be the same', + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new ERR_FS_CP_DIR_TO_NON_DIR({ + message: `cannot overwrite directory ${src} ` + + `with non-directory ${dest}`, + path: dest, + syscall: 'cp', + errno: EISDIR, + }) + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new ERR_FS_CP_NON_DIR_TO_DIR({ + message: `cannot overwrite non-directory ${src} ` + + `with directory ${dest}`, + path: dest, + syscall: 'cp', + errno: ENOTDIR, + }) + } + } + + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${src} to a subdirectory of self ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return { srcStat, destStat } +} + +function areIdentical (srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && + destStat.dev === srcStat.dev +} + +function getStats (src, dest, opts) { + const statFunc = opts.dereference ? + (file) => stat(file, { bigint: true }) : + (file) => lstat(file, { bigint: true }) + return Promise.all([ + statFunc(src), + statFunc(dest).catch((err) => { + // istanbul ignore next: unsure how to cover. + if (err.code === 'ENOENT') { + return null + } + // istanbul ignore next: unsure how to cover. + throw err + }), + ]) +} + +async function checkParentDir (destStat, src, dest, opts) { + const destParent = dirname(dest) + const dirExists = await pathExists(destParent) + if (dirExists) { + return getStatsForCopy(destStat, src, dest, opts) + } + await mkdir(destParent, { recursive: true }) + return getStatsForCopy(destStat, src, dest, opts) +} + +function pathExists (dest) { + return stat(dest).then( + () => true, + // istanbul ignore next: not sure when this would occur + (err) => (err.code === 'ENOENT' ? false : Promise.reject(err))) +} + +// Recursively check if dest parent is a subdirectory of src. +// It works for all file types including symlinks since it +// checks the src and dest inodes. It starts from the deepest +// parent and stops once it reaches the src parent or the root path. +async function checkParentPaths (src, srcStat, dest) { + const srcParent = resolve(dirname(src)) + const destParent = resolve(dirname(dest)) + if (destParent === srcParent || destParent === parse(destParent).root) { + return + } + let destStat + try { + destStat = await stat(destParent, { bigint: true }) + } catch (err) { + // istanbul ignore else: not sure when this would occur + if (err.code === 'ENOENT') { + return + } + // istanbul ignore next: not sure when this would occur + throw err + } + if (areIdentical(srcStat, destStat)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${src} to a subdirectory of self ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return checkParentPaths(src, srcStat, destParent) +} + +const normalizePathToArray = (path) => + resolve(path).split(sep).filter(Boolean) + +// Return true if dest is a subdir of src, otherwise false. +// It only checks the path strings. +function isSrcSubdir (src, dest) { + const srcArr = normalizePathToArray(src) + const destArr = normalizePathToArray(dest) + return srcArr.every((cur, i) => destArr[i] === cur) +} + +async function handleFilter (onInclude, destStat, src, dest, opts, cb) { + const include = await opts.filter(src, dest) + if (include) { + return onInclude(destStat, src, dest, opts, cb) + } +} + +function startCopy (destStat, src, dest, opts) { + if (opts.filter) { + return handleFilter(getStatsForCopy, destStat, src, dest, opts) + } + return getStatsForCopy(destStat, src, dest, opts) +} + +async function getStatsForCopy (destStat, src, dest, opts) { + const statFn = opts.dereference ? stat : lstat + const srcStat = await statFn(src) + // istanbul ignore else: can't portably test FIFO + if (srcStat.isDirectory() && opts.recursive) { + return onDir(srcStat, destStat, src, dest, opts) + } else if (srcStat.isDirectory()) { + throw new ERR_FS_EISDIR({ + message: `${src} is a directory (not copied)`, + path: src, + syscall: 'cp', + errno: EINVAL, + }) + } else if (srcStat.isFile() || + srcStat.isCharacterDevice() || + srcStat.isBlockDevice()) { + return onFile(srcStat, destStat, src, dest, opts) + } else if (srcStat.isSymbolicLink()) { + return onLink(destStat, src, dest) + } else if (srcStat.isSocket()) { + throw new ERR_FS_CP_SOCKET({ + message: `cannot copy a socket file: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } else if (srcStat.isFIFO()) { + throw new ERR_FS_CP_FIFO_PIPE({ + message: `cannot copy a FIFO pipe: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + // istanbul ignore next: should be unreachable + throw new ERR_FS_CP_UNKNOWN({ + message: `cannot copy an unknown file type: ${dest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) +} + +function onFile (srcStat, destStat, src, dest, opts) { + if (!destStat) { + return _copyFile(srcStat, src, dest, opts) + } + return mayCopyFile(srcStat, src, dest, opts) +} + +async function mayCopyFile (srcStat, src, dest, opts) { + if (opts.force) { + await unlink(dest) + return _copyFile(srcStat, src, dest, opts) + } else if (opts.errorOnExist) { + throw new ERR_FS_CP_EEXIST({ + message: `${dest} already exists`, + path: dest, + syscall: 'cp', + errno: EEXIST, + }) + } +} + +async function _copyFile (srcStat, src, dest, opts) { + await copyFile(src, dest) + if (opts.preserveTimestamps) { + return handleTimestampsAndMode(srcStat.mode, src, dest) + } + return setDestMode(dest, srcStat.mode) +} + +async function handleTimestampsAndMode (srcMode, src, dest) { + // Make sure the file is writable before setting the timestamp + // otherwise open fails with EPERM when invoked with 'r+' + // (through utimes call) + if (fileIsNotWritable(srcMode)) { + await makeFileWritable(dest, srcMode) + return setDestTimestampsAndMode(srcMode, src, dest) + } + return setDestTimestampsAndMode(srcMode, src, dest) +} + +function fileIsNotWritable (srcMode) { + return (srcMode & 0o200) === 0 +} + +function makeFileWritable (dest, srcMode) { + return setDestMode(dest, srcMode | 0o200) +} + +async function setDestTimestampsAndMode (srcMode, src, dest) { + await setDestTimestamps(src, dest) + return setDestMode(dest, srcMode) +} + +function setDestMode (dest, srcMode) { + return chmod(dest, srcMode) +} + +async function setDestTimestamps (src, dest) { + // The initial srcStat.atime cannot be trusted + // because it is modified by the read(2) system call + // (See https://nodejs.org/api/fs.html#fs_stat_time_values) + const updatedSrcStat = await stat(src) + return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime) +} + +function onDir (srcStat, destStat, src, dest, opts) { + if (!destStat) { + return mkDirAndCopy(srcStat.mode, src, dest, opts) + } + return copyDir(src, dest, opts) +} + +async function mkDirAndCopy (srcMode, src, dest, opts) { + await mkdir(dest) + await copyDir(src, dest, opts) + return setDestMode(dest, srcMode) +} + +async function copyDir (src, dest, opts) { + const dir = await readdir(src) + for (let i = 0; i < dir.length; i++) { + const item = dir[i] + const srcItem = join(src, item) + const destItem = join(dest, item) + const { destStat } = await checkPaths(srcItem, destItem, opts) + await startCopy(destStat, srcItem, destItem, opts) + } +} + +async function onLink (destStat, src, dest) { + let resolvedSrc = await readlink(src) + if (!isAbsolute(resolvedSrc)) { + resolvedSrc = resolve(dirname(src), resolvedSrc) + } + if (!destStat) { + return symlink(resolvedSrc, dest) + } + let resolvedDest + try { + resolvedDest = await readlink(dest) + } catch (err) { + // Dest exists and is a regular file or directory, + // Windows may throw UNKNOWN error. If dest already exists, + // fs throws error anyway, so no need to guard against it here. + // istanbul ignore next: can only test on windows + if (err.code === 'EINVAL' || err.code === 'UNKNOWN') { + return symlink(resolvedSrc, dest) + } + // istanbul ignore next: should not be possible + throw err + } + if (!isAbsolute(resolvedDest)) { + resolvedDest = resolve(dirname(dest), resolvedDest) + } + if (isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new ERR_FS_CP_EINVAL({ + message: `cannot copy ${resolvedSrc} to a subdirectory of self ` + + `${resolvedDest}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + // Do not copy if src is a subdir of dest since unlinking + // dest in this case would result in removing src contents + // and therefore a broken symlink would be created. + const srcStat = await stat(src) + if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({ + message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`, + path: dest, + syscall: 'cp', + errno: EINVAL, + }) + } + return copyLink(resolvedSrc, dest) +} + +async function copyLink (resolvedSrc, dest) { + await unlink(dest) + return symlink(resolvedSrc, dest) +} + +module.exports = cp diff --git a/deps/npm/node_modules/@npmcli/fs/lib/errors.js b/deps/npm/node_modules/@npmcli/fs/lib/errors.js new file mode 100644 index 00000000000..1cd1e05d0c5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/fs/lib/errors.js @@ -0,0 +1,129 @@ +'use strict' +const { inspect } = require('util') + +// adapted from node's internal/errors +// https://github.com/nodejs/node/blob/c8a04049/lib/internal/errors.js + +// close copy of node's internal SystemError class. +class SystemError { + constructor (code, prefix, context) { + // XXX context.code is undefined in all constructors used in cp/polyfill + // that may be a bug copied from node, maybe the constructor should use + // `code` not `errno`? nodejs/node#41104 + let message = `${prefix}: ${context.syscall} returned ` + + `${context.code} (${context.message})` + + if (context.path !== undefined) { + message += ` ${context.path}` + } + if (context.dest !== undefined) { + message += ` => ${context.dest}` + } + + this.code = code + Object.defineProperties(this, { + name: { + value: 'SystemError', + enumerable: false, + writable: true, + configurable: true, + }, + message: { + value: message, + enumerable: false, + writable: true, + configurable: true, + }, + info: { + value: context, + enumerable: true, + configurable: true, + writable: false, + }, + errno: { + get () { + return context.errno + }, + set (value) { + context.errno = value + }, + enumerable: true, + configurable: true, + }, + syscall: { + get () { + return context.syscall + }, + set (value) { + context.syscall = value + }, + enumerable: true, + configurable: true, + }, + }) + + if (context.path !== undefined) { + Object.defineProperty(this, 'path', { + get () { + return context.path + }, + set (value) { + context.path = value + }, + enumerable: true, + configurable: true, + }) + } + + if (context.dest !== undefined) { + Object.defineProperty(this, 'dest', { + get () { + return context.dest + }, + set (value) { + context.dest = value + }, + enumerable: true, + configurable: true, + }) + } + } + + toString () { + return `${this.name} [${this.code}]: ${this.message}` + } + + [Symbol.for('nodejs.util.inspect.custom')] (_recurseTimes, ctx) { + return inspect(this, { + ...ctx, + getters: true, + customInspect: false, + }) + } +} + +function E (code, message) { + module.exports[code] = class NodeError extends SystemError { + constructor (ctx) { + super(code, message, ctx) + } + } +} + +E('ERR_FS_CP_DIR_TO_NON_DIR', 'Cannot overwrite directory with non-directory') +E('ERR_FS_CP_EEXIST', 'Target already exists') +E('ERR_FS_CP_EINVAL', 'Invalid src or dest') +E('ERR_FS_CP_FIFO_PIPE', 'Cannot copy a FIFO pipe') +E('ERR_FS_CP_NON_DIR_TO_DIR', 'Cannot overwrite non-directory with directory') +E('ERR_FS_CP_SOCKET', 'Cannot copy a socket file') +E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self') +E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type') +E('ERR_FS_EISDIR', 'Path is a directory') + +module.exports.ERR_INVALID_ARG_TYPE = class ERR_INVALID_ARG_TYPE extends Error { + constructor (name, expected, actual) { + super() + this.code = 'ERR_INVALID_ARG_TYPE' + this.message = `The ${name} argument must be ${expected}. Received ${typeof actual}` + } +} diff --git a/deps/npm/node_modules/@npmcli/fs/lib/index.js b/deps/npm/node_modules/@npmcli/fs/lib/index.js index f669efc1a91..e40d748a7da 100644 --- a/deps/npm/node_modules/@npmcli/fs/lib/index.js +++ b/deps/npm/node_modules/@npmcli/fs/lib/index.js @@ -1,6 +1,7 @@ module.exports = { ...require('./fs.js'), copyFile: require('./copy-file.js'), + cp: require('./cp/index.js'), mkdir: require('./mkdir/index.js'), mkdtemp: require('./mkdtemp.js'), rm: require('./rm/index.js'), diff --git a/deps/npm/node_modules/@npmcli/fs/lib/rm/polyfill.js b/deps/npm/node_modules/@npmcli/fs/lib/rm/polyfill.js index 77196b76beb..a25c17483b0 100644 --- a/deps/npm/node_modules/@npmcli/fs/lib/rm/polyfill.js +++ b/deps/npm/node_modules/@npmcli/fs/lib/rm/polyfill.js @@ -56,7 +56,8 @@ class ERR_FS_EISDIR extends Error { this.errno = errnos.EISDIR this.syscall = 'rm' this.path = path - this.message = `Path is a directory: ${this.syscall} returned ${this.info.code} (is a directory) ${path}` + this.message = `Path is a directory: ${this.syscall} returned ` + + `${this.info.code} (is a directory) ${path}` } toString () { diff --git a/deps/npm/node_modules/@npmcli/fs/package.json b/deps/npm/node_modules/@npmcli/fs/package.json index b114b73d24e..cb64ac82023 100644 --- a/deps/npm/node_modules/@npmcli/fs/package.json +++ b/deps/npm/node_modules/@npmcli/fs/package.json @@ -1,11 +1,11 @@ { "name": "@npmcli/fs", - "version": "1.0.0", + "version": "1.1.0", "description": "filesystem utilities for the npm cli", "main": "lib/index.js", "files": [ - "lib", - "bin" + "bin", + "lib" ], "scripts": { "preversion": "npm test", @@ -14,10 +14,11 @@ "snap": "tap", "test": "tap", "npmclilint": "npmcli-lint", - "lint": "npm run npmclilint -- \"lib/**/*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint --", - "postsnap": "npm run lintfix --" + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check" }, "keywords": [ "npm", @@ -26,11 +27,15 @@ "author": "GitHub Inc.", "license": "ISC", "devDependencies": { - "@npmcli/lint": "^1.0.1", + "@npmcli/template-oss": "^2.3.1", "tap": "^15.0.9" }, "dependencies": { "@gar/promisify": "^1.0.1", "semver": "^7.3.5" + }, + "templateVersion": "2.3.1", + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" } } diff --git a/deps/npm/node_modules/object-assign/license b/deps/npm/node_modules/@tootallnate/once/LICENSE index 654d0bfe943..c4c56a2a53b 100644 --- a/deps/npm/node_modules/object-assign/license +++ b/deps/npm/node_modules/@tootallnate/once/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) +Copyright (c) 2020 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +9,13 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts index a7efe943b2a..93d02a9a348 100644 --- a/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts @@ -1,14 +1,7 @@ /// <reference types="node" /> import { EventEmitter } from 'events'; -declare function once<T>(emitter: EventEmitter, name: string): once.CancelablePromise<T>; -declare namespace once { - interface CancelFunction { - (): void; - } - interface CancelablePromise<T> extends Promise<T> { - cancel: CancelFunction; - } - type CancellablePromise<T> = CancelablePromise<T>; - function spread<T extends any[]>(emitter: EventEmitter, name: string): once.CancelablePromise<T>; +import { EventNames, EventListenerParameters, AbortSignal } from './types'; +export interface OnceOptions { + signal?: AbortSignal; } -export = once; +export default function once<Emitter extends EventEmitter, Event extends EventNames<Emitter>>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise<EventListenerParameters<Emitter, Event>>; diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js b/deps/npm/node_modules/@tootallnate/once/dist/index.js index bfd0dc88f75..ca6385b1b82 100644 --- a/deps/npm/node_modules/@tootallnate/once/dist/index.js +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.js @@ -1,39 +1,24 @@ "use strict"; -function noop() { } -function once(emitter, name) { - const o = once.spread(emitter, name); - const r = o.then((args) => args[0]); - r.cancel = o.cancel; - return r; -} -(function (once) { - function spread(emitter, name) { - let c = null; - const p = new Promise((resolve, reject) => { - function cancel() { - emitter.removeListener(name, onEvent); - emitter.removeListener('error', onError); - p.cancel = noop; - } - function onEvent(...args) { - cancel(); - resolve(args); - } - function onError(err) { - cancel(); - reject(err); - } - c = cancel; - emitter.on(name, onEvent); - emitter.on('error', onError); - }); - if (!c) { - throw new TypeError('Could not get `cancel()` function'); +Object.defineProperty(exports, "__esModule", { value: true }); +function once(emitter, name, { signal } = {}) { + return new Promise((resolve, reject) => { + function cleanup() { + signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); + emitter.removeListener(name, onEvent); + emitter.removeListener('error', onError); + } + function onEvent(...args) { + cleanup(); + resolve(args); } - p.cancel = c; - return p; - } - once.spread = spread; -})(once || (once = {})); -module.exports = once; + function onError(err) { + cleanup(); + reject(err); + } + signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); + emitter.on(name, onEvent); + emitter.on('error', onError); + }); +} +exports.default = once; //# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js.map b/deps/npm/node_modules/@tootallnate/once/dist/index.js.map index 30d20491dbc..61708ca07f1 100644 --- a/deps/npm/node_modules/@tootallnate/once/dist/index.js.map +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,IAAI,CACZ,OAAqB,EACrB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAM,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAA8B,CAAC;IACtE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,OAAO,CAAC,CAAC;AACV,CAAC;AAED,WAAU,IAAI;IAWb,SAAgB,MAAM,CACrB,OAAqB,EACrB,IAAY;QAEZ,IAAI,CAAC,GAA+B,IAAI,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,SAAS,MAAM;gBACd,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,SAAS,OAAO,CAAC,GAAG,IAAW;gBAC9B,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,IAAS,CAAC,CAAC;YACpB,CAAC;YACD,SAAS,OAAO,CAAC,GAAU;gBAC1B,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YACD,CAAC,GAAG,MAAM,CAAC;YACX,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC,CAA8B,CAAC;QAChC,IAAI,CAAC,CAAC,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;SACzD;QACD,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IA5Be,WAAM,SA4BrB,CAAA;AACF,CAAC,EAxCS,IAAI,KAAJ,IAAI,QAwCb;AAED,iBAAS,IAAI,CAAC"}
\ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAOA,SAAwB,IAAI,CAI3B,OAAgB,EAChB,IAAW,EACX,EAAE,MAAM,KAAkB,EAAE;IAE5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,SAAS,OAAO;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,SAAS,OAAO,CAAC,GAAG,IAAW;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAA+C,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"}
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts new file mode 100644 index 00000000000..eb2bbc6c627 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts @@ -0,0 +1,231 @@ +export declare type OverloadedParameters<T> = T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; + (...args: infer A16): any; + (...args: infer A17): any; + (...args: infer A18): any; + (...args: infer A19): any; + (...args: infer A20): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 | A20 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; + (...args: infer A16): any; + (...args: infer A17): any; + (...args: infer A18): any; + (...args: infer A19): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; + (...args: infer A16): any; + (...args: infer A17): any; + (...args: infer A18): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; + (...args: infer A16): any; + (...args: infer A17): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; + (...args: infer A16): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; + (...args: infer A15): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; + (...args: infer A14): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; + (...args: infer A13): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; + (...args: infer A12): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; + (...args: infer A11): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; + (...args: infer A10): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; + (...args: infer A9): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; + (...args: infer A8): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; + (...args: infer A7): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; + (...args: infer A6): any; +} ? A1 | A2 | A3 | A4 | A5 | A6 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; + (...args: infer A5): any; +} ? A1 | A2 | A3 | A4 | A5 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; + (...args: infer A4): any; +} ? A1 | A2 | A3 | A4 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; + (...args: infer A3): any; +} ? A1 | A2 | A3 : T extends { + (...args: infer A1): any; + (...args: infer A2): any; +} ? A1 | A2 : T extends { + (...args: infer A1): any; +} ? A1 : any; diff --git a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js new file mode 100644 index 00000000000..207186d9e7c --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=overloaded-parameters.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map new file mode 100644 index 00000000000..863f146d625 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"overloaded-parameters.js","sourceRoot":"","sources":["../src/overloaded-parameters.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts new file mode 100644 index 00000000000..58be8284ab8 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts @@ -0,0 +1,17 @@ +/// <reference types="node" /> +import { EventEmitter } from 'events'; +import { OverloadedParameters } from './overloaded-parameters'; +export declare type FirstParameter<T> = T extends [infer R, ...any[]] ? R : never; +export declare type EventListener<F, T extends string | symbol> = F extends [ + T, + infer R, + ...any[] +] ? R : never; +export declare type EventParameters<Emitter extends EventEmitter> = OverloadedParameters<Emitter['on']>; +export declare type EventNames<Emitter extends EventEmitter> = FirstParameter<EventParameters<Emitter>>; +export declare type EventListenerParameters<Emitter extends EventEmitter, Event extends EventNames<Emitter>> = WithDefault<Parameters<EventListener<EventParameters<Emitter>, Event>>, unknown[]>; +export declare type WithDefault<T, D> = [T] extends [never] ? D : T; +export interface AbortSignal { + addEventListener: (name: string, listener: (...args: any[]) => any) => void; + removeEventListener: (name: string, listener: (...args: any[]) => any) => void; +} diff --git a/deps/npm/node_modules/@tootallnate/once/dist/types.js b/deps/npm/node_modules/@tootallnate/once/dist/types.js new file mode 100644 index 00000000000..11e638d1ee4 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/types.js.map b/deps/npm/node_modules/@tootallnate/once/dist/types.js.map new file mode 100644 index 00000000000..c768b790026 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/package.json b/deps/npm/node_modules/@tootallnate/once/package.json index 8343f9fad73..69ce947d9c3 100644 --- a/deps/npm/node_modules/@tootallnate/once/package.json +++ b/deps/npm/node_modules/@tootallnate/once/package.json @@ -1,6 +1,6 @@ { "name": "@tootallnate/once", - "version": "1.1.2", + "version": "2.0.0", "description": "Creates a Promise that waits for a single event", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -10,8 +10,7 @@ "scripts": { "prebuild": "rimraf dist", "build": "tsc", - "test": "mocha --reporter spec", - "test-lint": "eslint src --ext .js,.ts", + "test": "jest", "prepublishOnly": "npm run build" }, "repository": { @@ -25,21 +24,29 @@ "url": "https://github.com/TooTallNate/once/issues" }, "devDependencies": { + "@types/jest": "^27.0.2", "@types/node": "^12.12.11", - "@typescript-eslint/eslint-plugin": "1.6.0", - "@typescript-eslint/parser": "1.1.0", - "eslint": "5.16.0", - "eslint-config-airbnb": "17.1.0", - "eslint-config-prettier": "4.1.0", - "eslint-import-resolver-typescript": "1.1.1", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-jsx-a11y": "6.2.1", - "eslint-plugin-react": "7.12.4", - "mocha": "^6.2.2", + "abort-controller": "^3.0.0", + "jest": "^27.2.1", "rimraf": "^3.0.0", - "typescript": "^3.7.3" + "ts-jest": "^27.0.5", + "typescript": "^4.4.3" }, "engines": { - "node": ">= 6" + "node": ">= 10" + }, + "jest": { + "preset": "ts-jest", + "globals": { + "ts-jest": { + "diagnostics": false, + "isolatedModules": true + } + }, + "verbose": false, + "testEnvironment": "node", + "testMatch": [ + "<rootDir>/test/**/*.test.ts" + ] } } diff --git a/deps/npm/node_modules/cli-table3/package.json b/deps/npm/node_modules/cli-table3/package.json index 7d8542e17c0..82a4905f6ec 100644 --- a/deps/npm/node_modules/cli-table3/package.json +++ b/deps/npm/node_modules/cli-table3/package.json @@ -1,6 +1,6 @@ { "name": "cli-table3", - "version": "0.6.0", + "version": "0.6.1", "description": "Pretty unicode tables for the command line. Based on the original cli-table.", "main": "index.js", "types": "index.d.ts", @@ -13,7 +13,6 @@ "test": "test" }, "dependencies": { - "object-assign": "^4.1.0", "string-width": "^4.2.0" }, "devDependencies": { @@ -21,13 +20,13 @@ "cli-table": "^0.3.1", "eslint-config-prettier": "^6.0.0", "eslint-plugin-prettier": "^3.0.0", - "jest": "^24.0.0", + "jest": "^25.2.4", "jest-runner-eslint": "^0.7.0", "lerna-changelog": "^1.0.1", - "prettier": "2.0.2" + "prettier": "2.3.2" }, "optionalDependencies": { - "colors": "^1.1.2" + "colors": "1.4.0" }, "scripts": { "changelog": "lerna-changelog", diff --git a/deps/npm/node_modules/cli-table3/src/layout-manager.js b/deps/npm/node_modules/cli-table3/src/layout-manager.js index 8bcef03a0e0..fe84ef844da 100644 --- a/deps/npm/node_modules/cli-table3/src/layout-manager.js +++ b/deps/npm/node_modules/cli-table3/src/layout-manager.js @@ -1,13 +1,13 @@ -const objectAssign = require('object-assign'); const Cell = require('./cell'); const { ColSpanCell, RowSpanCell } = Cell; (function () { function layoutTable(table) { table.forEach(function (row, rowIndex) { + let prevCell = null; row.forEach(function (cell, columnIndex) { cell.y = rowIndex; - cell.x = columnIndex; + cell.x = prevCell ? prevCell.x + 1 : columnIndex; for (let y = rowIndex; y >= 0; y--) { let row2 = table[y]; let xMax = y === rowIndex ? columnIndex : row2.length; @@ -17,6 +17,7 @@ const { ColSpanCell, RowSpanCell } = Cell; cell.x++; } } + prevCell = cell; } }); }); @@ -224,7 +225,7 @@ function makeComputeWidths(colSpan, desiredWidth, x, forcedMin) { } } - objectAssign(vals, result); + Object.assign(vals, result); for (let j = 0; j < vals.length; j++) { vals[j] = Math.max(forcedMin, vals[j] || 0); } diff --git a/deps/npm/node_modules/cli-table3/src/utils.js b/deps/npm/node_modules/cli-table3/src/utils.js index 3ac919c5326..1e6254af984 100644 --- a/deps/npm/node_modules/cli-table3/src/utils.js +++ b/deps/npm/node_modules/cli-table3/src/utils.js @@ -1,4 +1,3 @@ -const objectAssign = require('object-assign'); const stringWidth = require('string-width'); function codeRegex(capture) { @@ -235,9 +234,9 @@ function defaultOptions() { function mergeOptions(options, defaults) { options = options || {}; defaults = defaults || defaultOptions(); - let ret = objectAssign({}, defaults, options); - ret.chars = objectAssign({}, defaults.chars, options.chars); - ret.style = objectAssign({}, defaults.style, options.style); + let ret = Object.assign({}, defaults, options); + ret.chars = Object.assign({}, defaults.chars, options.chars); + ret.style = Object.assign({}, defaults.style, options.style); return ret; } @@ -286,7 +285,7 @@ function colorizeLines(input) { for (let i = 0; i < input.length; i++) { let line = rewindState(state, input[i]); state = readState(line); - let temp = objectAssign({}, state); + let temp = Object.assign({}, state); output.push(unwindState(temp, line)); } return output; diff --git a/deps/npm/node_modules/debug/LICENSE b/deps/npm/node_modules/debug/LICENSE index 658c933d282..1a9820e262b 100644 --- a/deps/npm/node_modules/debug/LICENSE +++ b/deps/npm/node_modules/debug/LICENSE @@ -1,19 +1,20 @@ (The MIT License) -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon -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, +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 +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 +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/debug/package.json b/deps/npm/node_modules/debug/package.json index b7d70acb9be..cb7efa8eec3 100644 --- a/deps/npm/node_modules/debug/package.json +++ b/deps/npm/node_modules/debug/package.json @@ -1,11 +1,11 @@ { "name": "debug", - "version": "4.3.2", + "version": "4.3.3", "repository": { "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "url": "git://github.com/debug-js/debug.git" }, - "description": "small debugging utility", + "description": "Lightweight debugging utility for Node.js and the browser", "keywords": [ "debug", "log", @@ -16,11 +16,11 @@ "LICENSE", "README.md" ], - "author": "TJ Holowaychuk <tj@vision-media.ca>", + "author": "Josh Junon <josh.junon@protonmail.com>", "contributors": [ + "TJ Holowaychuk <tj@vision-media.ca>", "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)", - "Andrew Rhyne <rhyneandrew@gmail.com>", - "Josh Junon <josh@junon.me>" + "Andrew Rhyne <rhyneandrew@gmail.com>" ], "license": "MIT", "scripts": { diff --git a/deps/npm/node_modules/debug/src/common.js b/deps/npm/node_modules/debug/src/common.js index 50ce2925101..6d571d2844d 100644 --- a/deps/npm/node_modules/debug/src/common.js +++ b/deps/npm/node_modules/debug/src/common.js @@ -34,7 +34,7 @@ function setup(env) { /** * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored + * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index 032c7d0b584..e1cb5847392 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,7 +1,7 @@ { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.8", + "version": "4.2.9", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index 1287da1aa45..26804ef0a68 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -310,8 +310,10 @@ function patch (fs) { return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } return stats; } } diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.js b/deps/npm/node_modules/http-proxy-agent/dist/agent.js index 02528505168..aca82804314 100644 --- a/deps/npm/node_modules/http-proxy-agent/dist/agent.js +++ b/deps/npm/node_modules/http-proxy-agent/dist/agent.js @@ -18,7 +18,7 @@ const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const once_1 = __importDefault(require("@tootallnate/once")); const agent_base_1 = require("agent-base"); -const debug = debug_1.default('http-proxy-agent'); +const debug = (0, debug_1.default)('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } @@ -86,7 +86,7 @@ class HttpProxyAgent extends agent_base_1.Agent { if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL - delete parsed.port; + parsed.port = ''; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. @@ -136,7 +136,7 @@ class HttpProxyAgent extends agent_base_1.Agent { // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. - yield once_1.default(socket, 'connect'); + yield (0, once_1.default)(socket, 'connect'); return socket; }); } diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map index 7a407620d8e..bd3b56aa6df 100644 --- a/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map +++ b/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map @@ -1 +1 @@ -{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAgC,EAChC,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YACpC,MAAM,MAAM,GAAG,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;aAC1B;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;aACrD;YAED,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE;gBAC5C,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;YAED,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,yDAAyD;gBACzD,2CAA2C;gBAC3C,OAAO,MAAM,CAAC,IAAI,CAAC;aACnB;YAED,0DAA0D;YAC1D,0DAA0D;YAC1D,GAAG,CAAC,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,GAAG,CAAC,SAAS,CACZ,qBAAqB,EACrB,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;aACF;YAED,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,GAAG,CAAC,OAAO,EAAE;gBAChB,IAAI,KAAa,CAAC;gBAClB,IAAI,YAAoB,CAAC;gBACzB,KAAK,CAAC,oDAAoD,CAAC,CAAC;gBAC5D,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;gBACnB,GAAG,CAAC,eAAe,EAAE,CAAC;gBACtB,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxC,YAAY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,cAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"}
\ No newline at end of file +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAgC,EAChC,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YACpC,MAAM,MAAM,GAAG,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;aAC1B;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;aACrD;YAED,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE;gBAC5C,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;YAED,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,yDAAyD;gBACzD,2CAA2C;gBAC3C,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;aACjB;YAED,0DAA0D;YAC1D,0DAA0D;YAC1D,GAAG,CAAC,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,GAAG,CAAC,SAAS,CACZ,qBAAqB,EACrB,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;aACF;YAED,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,GAAG,CAAC,OAAO,EAAE;gBAChB,IAAI,KAAa,CAAC;gBAClB,IAAI,YAAoB,CAAC;gBACzB,KAAK,CAAC,oDAAoD,CAAC,CAAC;gBAC5D,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;gBACnB,GAAG,CAAC,eAAe,EAAE,CAAC;gBACtB,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxC,YAAY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,IAAA,cAAI,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"}
\ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/package.json b/deps/npm/node_modules/http-proxy-agent/package.json index 870dd5d8af2..659d6e11e80 100644 --- a/deps/npm/node_modules/http-proxy-agent/package.json +++ b/deps/npm/node_modules/http-proxy-agent/package.json @@ -1,6 +1,6 @@ { "name": "http-proxy-agent", - "version": "4.0.1", + "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./dist/index.js", "types": "./dist/index.d.ts", @@ -30,13 +30,13 @@ "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", - "@types/node": "^12.12.11", + "@types/node": "^12.19.2", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", @@ -49,7 +49,7 @@ "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", - "typescript": "^3.5.3" + "typescript": "^4.4.3" }, "engines": { "node": ">= 6" diff --git a/deps/npm/node_modules/is-core-module/core.json b/deps/npm/node_modules/is-core-module/core.json index 8f4ad128989..d2752948548 100644 --- a/deps/npm/node_modules/is-core-module/core.json +++ b/deps/npm/node_modules/is-core-module/core.json @@ -5,12 +5,12 @@ "node:assert/strict": ">= 16", "async_hooks": ">= 8", "node:async_hooks": [">= 14.18 && < 15", ">= 16"], - "buffer_ieee754": "< 0.9.7", + "buffer_ieee754": ">= 0.5 && < 0.9.7", "buffer": true, "node:buffer": [">= 14.18 && < 15", ">= 16"], "child_process": true, "node:child_process": [">= 14.18 && < 15", ">= 16"], - "cluster": true, + "cluster": ">= 0.5", "node:cluster": [">= 14.18 && < 15", ">= 16"], "console": true, "node:console": [">= 14.18 && < 15", ">= 16"], @@ -77,7 +77,7 @@ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], "process": ">= 1", "node:process": [">= 14.18 && < 15", ">= 16"], - "punycode": true, + "punycode": ">= 0.5", "node:punycode": [">= 14.18 && < 15", ">= 16"], "querystring": true, "node:querystring": [">= 14.18 && < 15", ">= 16"], @@ -110,7 +110,7 @@ "node:stream/web": ">= 16.5", "string_decoder": true, "node:string_decoder": [">= 14.18 && < 15", ">= 16"], - "sys": [">= 0.6 && < 0.7", ">= 0.8"], + "sys": [">= 0.4 && < 0.7", ">= 0.8"], "node:sys": [">= 14.18 && < 15", ">= 16"], "timers": true, "node:timers": [">= 14.18 && < 15", ">= 16"], @@ -147,6 +147,6 @@ "wasi": ">= 13.4 && < 13.5", "worker_threads": ">= 11.7", "node:worker_threads": [">= 14.18 && < 15", ">= 16"], - "zlib": true, + "zlib": ">= 0.5", "node:zlib": [">= 14.18 && < 15", ">= 16"] } diff --git a/deps/npm/node_modules/is-core-module/package.json b/deps/npm/node_modules/is-core-module/package.json index 78470592517..0caddef2e16 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.8.0", + "version": "2.8.1", "description": "Is this specifier a node.js core module?", "main": "index.js", "sideEffects": false, @@ -18,8 +18,8 @@ "prepublishOnly": "safe-publish-latest", "lint": "eslint .", "pretest": "npm run lint", - "tests-only": "tape 'test/**/*.js'", - "test": "nyc npm run tests-only", + "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)\")\"" @@ -49,14 +49,14 @@ "has": "^1.0.3" }, "devDependencies": { - "@ljharb/eslint-config": "^18.0.0", + "@ljharb/eslint-config": "^20.1.0", "aud": "^1.1.5", "auto-changelog": "^2.3.0", - "eslint": "^7.32.0", + "eslint": "^8.6.0", "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", + "safe-publish-latest": "^2.0.0", "semver": "^6.3.0", - "tape": "^5.3.1" + "tape": "^5.4.0" }, "auto-changelog": { "output": "CHANGELOG.md", diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json index 8d2ba3ad765..760da6cc1be 100644 --- a/deps/npm/node_modules/libnpmaccess/package.json +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -1,6 +1,6 @@ { "name": "libnpmaccess", - "version": "5.0.0", + "version": "5.0.1", "description": "programmatic library for `npm access` commands", "author": "GitHub Inc.", "license": "ISC", @@ -32,7 +32,7 @@ "aproba": "^2.0.0", "minipass": "^3.1.1", "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index ff728b5473b..1de0cdfe26a 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "3.0.2", + "version": "3.0.3", "files": [ "bin", "lib" diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index a46de40ac98..4f305552732 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -1,6 +1,6 @@ { "name": "libnpmhook", - "version": "7.0.0", + "version": "7.0.1", "description": "programmatic API for managing npm registry hooks", "main": "lib/index.js", "files": [ @@ -34,7 +34,7 @@ "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.1" }, "devDependencies": { "@npmcli/template-oss": "^2.4.2", diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json index 93297c36338..5c4909b1c95 100644 --- a/deps/npm/node_modules/libnpmorg/package.json +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -1,6 +1,6 @@ { "name": "libnpmorg", - "version": "3.0.0", + "version": "3.0.1", "description": "Programmatic api for `npm org` commands", "author": "GitHub Inc.", "main": "lib/index.js", @@ -45,7 +45,7 @@ "homepage": "https://npmjs.com/package/libnpmorg", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 156503af7d3..3fd2d6d5a39 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "5.0.0", + "version": "5.0.1", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", @@ -37,14 +37,14 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/libnpmpublish.git" + "url": "https://github.com/npm/cli.git" }, - "bugs": "https://github.com/npm/libnpmpublish/issues", + "bugs": "https://github.com/npm/cli/issues", "homepage": "https://npmjs.com/package/libnpmpublish", "dependencies": { "normalize-package-data": "^3.0.2", "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^11.0.0", + "npm-registry-fetch": "^12.0.1", "semver": "^7.1.3", "ssri": "^8.0.1" }, diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 5479e41ae3c..f524426dc65 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "4.0.0", + "version": "4.0.1", "description": "Programmatic API for searching in npm and compatible registries.", "author": "GitHub Inc.", "main": "lib/index.js", @@ -41,7 +41,7 @@ "bugs": "https://github.com/npm/libnpmsearch/issues", "homepage": "https://npmjs.com/package/libnpmsearch", "dependencies": { - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json index 1264402321e..23903551aa8 100644 --- a/deps/npm/node_modules/libnpmteam/package.json +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -1,7 +1,7 @@ { "name": "libnpmteam", "description": "npm Team management APIs", - "version": "3.0.0", + "version": "3.0.1", "author": "GitHub Inc.", "license": "ISC", "main": "lib/index.js", @@ -32,7 +32,7 @@ "homepage": "https://npmjs.com/package/libnpmteam", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" diff --git a/deps/npm/node_modules/make-fetch-happen/LICENSE b/deps/npm/node_modules/make-fetch-happen/LICENSE index 8d28acf866d..1808eb28442 100644 --- a/deps/npm/node_modules/make-fetch-happen/LICENSE +++ b/deps/npm/node_modules/make-fetch-happen/LICENSE @@ -1,6 +1,6 @@ ISC License -Copyright (c) npm, Inc. +Copyright 2017-2022 (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the diff --git a/deps/npm/node_modules/make-fetch-happen/lib/agent.js b/deps/npm/node_modules/make-fetch-happen/lib/agent.js index 3675dd8ae98..095c35c5a25 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/agent.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/agent.js @@ -50,11 +50,13 @@ function getAgent (uri, opts) { : isHttps ? require('https').globalAgent : require('http').globalAgent - if (isLambda && !pxuri) + if (isLambda && !pxuri) { return lambdaAgent + } - if (AGENT_CACHE.peek(key)) + if (AGENT_CACHE.peek(key)) { return AGENT_CACHE.get(key) + } if (pxuri) { const pxopts = isLambda ? { @@ -86,16 +88,19 @@ function getAgent (uri, opts) { function checkNoProxy (uri, opts) { const host = new url.URL(uri).hostname.split('.').reverse() let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) - if (typeof noproxy === 'string') + if (typeof noproxy === 'string') { noproxy = noproxy.split(/\s*,\s*/g) + } return noproxy && noproxy.some(no => { const noParts = no.split('.').filter(x => x).reverse() - if (!noParts.length) + if (!noParts.length) { return false + } for (let i = 0; i < noParts.length; i++) { - if (host[i] !== noParts[i]) + if (host[i] !== noParts[i]) { return false + } } return true }) @@ -104,8 +109,9 @@ function checkNoProxy (uri, opts) { module.exports.getProcessEnv = getProcessEnv function getProcessEnv (env) { - if (!env) + if (!env) { return + } let value @@ -114,8 +120,9 @@ function getProcessEnv (env) { value = process.env[e] || process.env[e.toUpperCase()] || process.env[e.toLowerCase()] - if (typeof value !== 'undefined') + if (typeof value !== 'undefined') { break + } } } @@ -141,8 +148,9 @@ function getProxyUri (uri, opts) { protocol === 'http:' && getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) ) - if (!proxy) + if (!proxy) { return null + } const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy @@ -177,13 +185,14 @@ function getProxy (proxyUrl, opts, isHttps) { } if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { - if (!isHttps) + if (!isHttps) { return new HttpProxyAgent(popts) - else + } else { return new HttpsProxyAgent(popts) - } else if (proxyUrl.protocol.startsWith('socks')) + } + } else if (proxyUrl.protocol.startsWith('socks')) { return new SocksProxyAgent(popts) - else { + } else { throw Object.assign( new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), { diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js index a2acea156ee..ae2ad8c7667 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js @@ -52,23 +52,31 @@ const getMetadata = (request, response, options) => { url: request.url, reqHeaders: {}, resHeaders: {}, + + // options on which we must match the request and vary the response + options: { + compress: options.compress != null ? options.compress : request.compress, + }, } // only save the status if it's not a 200 or 304 - if (response.status !== 200 && response.status !== 304) + if (response.status !== 200 && response.status !== 304) { metadata.status = response.status + } for (const name of KEEP_REQUEST_HEADERS) { - if (request.headers.has(name)) + if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) + } } // if the request's host header differs from the host in the url // we need to keep it, otherwise it's just noise and we ignore it const host = request.headers.get('host') const parsedUrl = new url.URL(request.url) - if (host && parsedUrl.host !== host) + if (host && parsedUrl.host !== host) { metadata.reqHeaders.host = host + } // if the response has a vary header, make sure // we store the relevant request headers too @@ -82,25 +90,17 @@ const getMetadata = (request, response, options) => { // copy any other request headers that will vary the response const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) for (const name of varyHeaders) { - // explicitly ignore accept-encoding here - if (name !== 'accept-encoding' && request.headers.has(name)) + if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) + } } } } for (const name of KEEP_RESPONSE_HEADERS) { - if (response.headers.has(name)) + if (response.headers.has(name)) { metadata.resHeaders[name] = response.headers.get(name) - } - - // we only store accept-encoding and content-encoding if the user - // has disabled automatic compression and decompression in minipass-fetch - // since if it's enabled (the default) then the content will have - // already been decompressed making the header a lie - if (options.compress === false) { - metadata.reqHeaders['accept-encoding'] = request.headers.get('accept-encoding') - metadata.resHeaders['content-encoding'] = response.headers.get('content-encoding') + } } return metadata @@ -121,8 +121,9 @@ class CacheEntry { // entry timestamp to determine staleness because cacache will update it // when it verifies its data this.entry.metadata.time = this.entry.metadata.time || this.entry.time - } else + } else { this.key = cacheKey(request) + } this.options = options @@ -143,9 +144,17 @@ class CacheEntry { return entryA.policy.satisfies(entryB.request) }, { validateEntry: (entry) => { + // clean out entries with a buggy content-encoding value + if (entry.metadata && + entry.metadata.resHeaders && + entry.metadata.resHeaders['content-encoding'] === null) { + return false + } + // if an integrity is null, it needs to have a status specified - if (entry.integrity === null) + if (entry.integrity === null) { return !!(entry.metadata && entry.metadata.status) + } return true }, @@ -158,8 +167,9 @@ class CacheEntry { // a cache mode of 'reload' means to behave as though we have no cache // on the way to the network. return undefined to allow cacheFetch to // create a brand new request no matter what. - if (options.cache === 'reload') + if (options.cache === 'reload') { return + } // find the specific entry that satisfies the request let match @@ -194,6 +204,7 @@ class CacheEntry { this[_request] = new Request(this.entry.metadata.url, { method: 'GET', headers: this.entry.metadata.reqHeaders, + ...this.entry.metadata.options, }) } @@ -235,7 +246,11 @@ class CacheEntry { // if we got a status other than 200, 301, or 308, // or the CachePolicy forbid storage, append the // cache status header and return it untouched - if (this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable()) { + if ( + this.request.method !== 'GET' || + ![200, 301, 308].includes(this.response.status) || + !this.policy.storable() + ) { this.response.headers.set('x-local-cache-status', 'skip') return this.response } @@ -276,7 +291,8 @@ class CacheEntry { abortStream = collector collector.on('collect', (data) => { // TODO if the cache write fails, log a warning but return the response anyway - cacache.put(this.options.cachePath, this.key, data, cacheOpts).then(cacheWriteResolve, cacheWriteReject) + cacache.put(this.options.cachePath, this.key, data, cacheOpts) + .then(cacheWriteResolve, cacheWriteReject) }) body.unshift(collector) body.unshift(this.response.body) @@ -305,8 +321,9 @@ class CacheEntry { // know to be invalid to the cache abortStream.destroy(err) }) - } else + } else { await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) + } // note: we do not set the x-local-cache-hash header because we do not know // the hash value until after the write to the cache completes, which doesn't @@ -347,25 +364,37 @@ class CacheEntry { onResume = async () => { removeOnResume() try { - const content = await cacache.get.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + const content = await cacache.get.byDigest( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) body.end(content) } catch (err) { - if (err.code === 'EINTEGRITY') - await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + if (err.code === 'EINTEGRITY') { + await cacache.rm.content( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) + } + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) + } body.emit('error', err) } } } else { onResume = () => { - const cacheStream = cacache.get.stream.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + const cacheStream = cacache.get.stream.byDigest( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) cacheStream.on('error', async (err) => { cacheStream.pause() - if (err.code === 'EINTEGRITY') - await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) - if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + if (err.code === 'EINTEGRITY') { + await cacache.rm.content( + this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } + ) + } + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) + } body.emit('error', err) cacheStream.resume() }) @@ -415,8 +444,9 @@ class CacheEntry { // if the network fetch fails, return the stale // cached response unless it has a cache-control // of 'must-revalidate' - if (!this.policy.mustRevalidate) + if (!this.policy.mustRevalidate) { return this.respond(request.method, options, 'stale') + } throw err } @@ -429,8 +459,12 @@ class CacheEntry { // in the old cache entry to the new one, if the new metadata does not already // include that header for (const name of KEEP_RESPONSE_HEADERS) { - if (!hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name)) + if ( + !hasOwnProperty(metadata.resHeaders, name) && + hasOwnProperty(this.entry.metadata.resHeaders, name) + ) { metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] + } } try { diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js index 31e97c4b033..67a66573beb 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js @@ -1,5 +1,6 @@ class NotCachedError extends Error { constructor (url) { + /* eslint-disable-next-line max-len */ super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) this.code = 'ENOTCACHED' } diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js index cca93d9b4eb..17a6425592b 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js @@ -8,8 +8,9 @@ const cacheFetch = async (request, options) => { const entry = await CacheEntry.find(request, options) if (!entry) { // no cached result, if the cache mode is 'only-if-cached' that's a failure - if (options.cache === 'only-if-cached') + if (options.cache === 'only-if-cached') { throw new NotCachedError(request.url) + } // otherwise, we make a request, store it and return it const response = await remote(request, options) @@ -19,8 +20,9 @@ const cacheFetch = async (request, options) => { // we have a cached response that satisfies this request, however if the cache // mode is 'no-cache' then we send the revalidation request no matter what - if (options.cache === 'no-cache') + if (options.cache === 'no-cache') { return entry.revalidate(request, options) + } // if the cached entry is not stale, or if the cache mode is 'force-cache' or // 'only-if-cached' we can respond with the cached entry. set the status @@ -28,16 +30,18 @@ const cacheFetch = async (request, options) => { const _needsRevalidation = entry.policy.needsRevalidation(request) if (options.cache === 'force-cache' || options.cache === 'only-if-cached' || - !_needsRevalidation) + !_needsRevalidation) { return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') + } // if we got here, the cache entry is stale so revalidate it return entry.revalidate(request, options) } cacheFetch.invalidate = async (request, options) => { - if (!options.cachePath) + if (!options.cachePath) { return + } return CacheEntry.invalidate(request, options) } diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js index e0959f64ddf..ada3c8600da 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js @@ -2,19 +2,6 @@ const CacheSemantics = require('http-cache-semantics') const Negotiator = require('negotiator') const ssri = require('ssri') -// HACK: negotiator lazy loads several of its own modules -// as a micro optimization. we need to be sure that they're -// in memory as soon as possible at startup so that we do -// not try to lazy load them after the directory has been -// retired during a self update of the npm CLI, we do this -// by calling all of the methods that trigger a lazy load -// on a fake instance. -const preloadNegotiator = new Negotiator({ headers: {} }) -preloadNegotiator.charsets() -preloadNegotiator.encodings() -preloadNegotiator.languages() -preloadNegotiator.mediaTypes() - // options passed to http-cache-semantics constructor const policyOptions = { shared: false, @@ -31,6 +18,7 @@ const requestObject = (request) => { method: request.method, url: request.url, headers: {}, + compress: request.compress, } request.headers.forEach((value, key) => { @@ -74,16 +62,19 @@ class CachePolicy { // static method to quickly determine if a request alone is storable static storable (request, options) { // no cachePath means no caching - if (!options.cachePath) + if (!options.cachePath) { return false + } // user explicitly asked not to cache - if (options.cache === 'no-store') + if (options.cache === 'no-store') { return false + } // we only cache GET and HEAD requests - if (!['GET', 'HEAD'].includes(request.method)) + if (!['GET', 'HEAD'].includes(request.method)) { return false + } // otherwise, let http-cache-semantics make the decision // based on the request's headers @@ -94,23 +85,32 @@ class CachePolicy { // returns true if the policy satisfies the request satisfies (request) { const _req = requestObject(request) - if (this.request.headers.host !== _req.headers.host) + if (this.request.headers.host !== _req.headers.host) { + return false + } + + if (this.request.compress !== _req.compress) { return false + } const negotiatorA = new Negotiator(this.request) const negotiatorB = new Negotiator(_req) - if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) + if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) { return false + } - if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) + if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) { return false + } - if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) + if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) { return false + } - if (this.options.integrity) + if (this.options.integrity) { return ssri.parse(this.options.integrity).match(this.entry.integrity) + } return true } diff --git a/deps/npm/node_modules/make-fetch-happen/lib/fetch.js b/deps/npm/node_modules/make-fetch-happen/lib/fetch.js index dfded79295d..233ba67e165 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/fetch.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/fetch.js @@ -13,20 +13,28 @@ const remote = require('./remote.js') // in the fetch being rejected if the redirect is // possible but invalid for some reason const canFollowRedirect = (request, response, options) => { - if (!isRedirect(response.status)) + if (!isRedirect(response.status)) { return false + } - if (options.redirect === 'manual') + if (options.redirect === 'manual') { return false + } - if (options.redirect === 'error') - throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) + if (options.redirect === 'error') { + throw new FetchError(`redirect mode is set to error: ${request.url}`, + 'no-redirect', { code: 'ENOREDIRECT' }) + } - if (!response.headers.has('location')) - throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) + if (!response.headers.has('location')) { + throw new FetchError(`redirect location header missing for: ${request.url}`, + 'no-location', { code: 'EINVALIDREDIRECT' }) + } - if (request.counter >= request.follow) - throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) + if (request.counter >= request.follow) { + throw new FetchError(`maximum redirect reached at: ${request.url}`, + 'max-redirect', { code: 'EMAXREDIRECT' }) + } return true } @@ -39,26 +47,34 @@ const getRedirect = (request, response, options) => { const location = response.headers.get('location') const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) // Comment below is used under the following license: - // Copyright (c) 2010-2012 Mikeal Rogers - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // http://www.apache.org/licenses/LICENSE-2.0 - // Unless required by applicable law or agreed to in writing, - // software distributed under the License is distributed on an "AS - // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - // express or implied. See the License for the specific language - // governing permissions and limitations under the License. + /** + * @license + * Copyright (c) 2010-2012 Mikeal Rogers + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an "AS + * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of request: // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - if (new url.URL(request.url).hostname !== redirectUrl.hostname) + if (new url.URL(request.url).hostname !== redirectUrl.hostname) { request.headers.delete('authorization') + request.headers.delete('cookie') + } // for POST request with 301/302 response, or any request with 303 response, // use GET when following redirect - if (response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status))) { + if ( + response.status === 303 || + (request.method === 'POST' && [301, 302].includes(response.status)) + ) { _opts.method = 'GET' _opts.body = null request.headers.delete('content-length') @@ -87,11 +103,13 @@ const fetch = async (request, options) => { // request url if (!['GET', 'HEAD'].includes(request.method) && response.status >= 200 && - response.status <= 399) + response.status <= 399) { await cache.invalidate(request, options) + } - if (!canFollowRedirect(request, response, options)) + if (!canFollowRedirect(request, response, options)) { return response + } const redirect = getRedirect(request, response, options) return fetch(redirect.request, redirect.options) diff --git a/deps/npm/node_modules/make-fetch-happen/lib/options.js b/deps/npm/node_modules/make-fetch-happen/lib/options.js index f6138e6e1d1..a0c8664adf0 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/options.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/options.js @@ -7,36 +7,40 @@ const conditionalHeaders = [ ] const configureOptions = (opts) => { - const {strictSSL, ...options} = { ...opts } + const { strictSSL, ...options } = { ...opts } options.method = options.method ? options.method.toUpperCase() : 'GET' options.rejectUnauthorized = strictSSL !== false - if (!options.retry) + if (!options.retry) { options.retry = { retries: 0 } - else if (typeof options.retry === 'string') { + } else if (typeof options.retry === 'string') { const retries = parseInt(options.retry, 10) - if (isFinite(retries)) + if (isFinite(retries)) { options.retry = { retries } - else + } else { options.retry = { retries: 0 } - } else if (typeof options.retry === 'number') + } + } else if (typeof options.retry === 'number') { options.retry = { retries: options.retry } - else + } else { options.retry = { retries: 0, ...options.retry } + } options.cache = options.cache || 'default' if (options.cache === 'default') { const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { return conditionalHeaders.includes(name.toLowerCase()) }) - if (hasConditionalHeader) + if (hasConditionalHeader) { options.cache = 'no-store' + } } // cacheManager is deprecated, but if it's set and // cachePath is not we should copy it to the new field - if (options.cacheManager && !options.cachePath) + if (options.cacheManager && !options.cachePath) { options.cachePath = options.cacheManager + } return options } diff --git a/deps/npm/node_modules/make-fetch-happen/lib/remote.js b/deps/npm/node_modules/make-fetch-happen/lib/remote.js index 7e4ed24edb5..a8b8d2a0198 100644 --- a/deps/npm/node_modules/make-fetch-happen/lib/remote.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/remote.js @@ -29,11 +29,13 @@ const RETRY_TYPES = [ // and verifying response integrity const remoteFetch = (request, options) => { const agent = getAgent(request.url, options) - if (!request.headers.has('connection')) + if (!request.headers.has('connection')) { request.headers.set('connection', agent ? 'keep-alive' : 'close') + } - if (!request.headers.has('user-agent')) + if (!request.headers.has('user-agent')) { request.headers.set('user-agent', USER_AGENT) + } // keep our own options since we're overriding the agent // and the redirect mode @@ -64,8 +66,9 @@ const remoteFetch = (request, options) => { ([408, 420, 429].includes(res.status) || res.status >= 500) if (isRetriable) { - if (typeof options.onRetry === 'function') + if (typeof options.onRetry === 'function') { options.onRetry(res) + } return retryHandler(res) } @@ -82,18 +85,21 @@ const remoteFetch = (request, options) => { const isRetryError = err.retried instanceof fetch.Response || (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) - if (req.method === 'POST' || isRetryError) + if (req.method === 'POST' || isRetryError) { throw err + } - if (typeof options.onRetry === 'function') + if (typeof options.onRetry === 'function') { options.onRetry(err) + } return retryHandler(err) } }, options.retry).catch((err) => { // don't reject for http errors, just return them - if (err.status >= 400 && err.type !== 'system') + if (err.status >= 400 && err.type !== 'system') { return err + } throw err }) diff --git a/deps/npm/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/make-fetch-happen/package.json index dae7b37da40..7b61953e56f 100644 --- a/deps/npm/node_modules/make-fetch-happen/package.json +++ b/deps/npm/node_modules/make-fetch-happen/package.json @@ -1,20 +1,23 @@ { "name": "make-fetch-happen", - "version": "9.1.0", + "version": "10.0.0", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ + "bin", "lib" ], "scripts": { - "preversion": "npm t", + "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", + "prepublishOnly": "git push origin --follow-tags", "test": "tap", "posttest": "npm run lint", "eslint": "eslint", - "lint": "npm run eslint -- lib test", - "lintfix": "npm run lint -- --fix" + "lint": "eslint '**/*.js'", + "lintfix": "npm run lint -- --fix", + "postlint": "npm-template-check", + "snap": "tap" }, "repository": "https://github.com/npm/make-fetch-happen", "keywords": [ @@ -26,17 +29,13 @@ "cache", "subresource integrity" ], - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech", - "twitter": "maybekatz" - }, + "author": "GitHub Inc.", "license": "ISC", "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", @@ -45,20 +44,17 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", + "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" }, "devDependencies": { - "eslint": "^7.26.0", - "eslint-plugin-import": "^2.23.2", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", - "eslint-plugin-standard": "^5.0.0", + "@npmcli/template-oss": "^2.5.1", + "eslint": "^8.7.0", "mkdirp": "^1.0.4", "nock": "^13.0.11", - "npmlog": "^5.0.0", + "npmlog": "^6.0.0", "require-inject": "^1.4.2", "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", @@ -66,11 +62,14 @@ "tap": "^15.0.9" }, "engines": { - "node": ">= 10" + "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "color": 1, "files": "test/*.js", "check-coverage": true + }, + "templateOSS": { + "version": "2.5.1" } } diff --git a/deps/npm/node_modules/negotiator/HISTORY.md b/deps/npm/node_modules/negotiator/HISTORY.md index 6d06c76aaa9..a9a544914c4 100644 --- a/deps/npm/node_modules/negotiator/HISTORY.md +++ b/deps/npm/node_modules/negotiator/HISTORY.md @@ -1,3 +1,8 @@ +0.6.3 / 2022-01-22 +================== + + * Revert "Lazy-load modules from main entry point" + 0.6.2 / 2019-04-29 ================== diff --git a/deps/npm/node_modules/negotiator/index.js b/deps/npm/node_modules/negotiator/index.js index 8d4f6a226cb..4788264b16c 100644 --- a/deps/npm/node_modules/negotiator/index.js +++ b/deps/npm/node_modules/negotiator/index.js @@ -8,12 +8,10 @@ 'use strict'; -/** - * Cached loaded submodules. - * @private - */ - -var modules = Object.create(null); +var preferredCharsets = require('./lib/charset') +var preferredEncodings = require('./lib/encoding') +var preferredLanguages = require('./lib/language') +var preferredMediaTypes = require('./lib/mediaType') /** * Module exports. @@ -43,7 +41,6 @@ Negotiator.prototype.charset = function charset(available) { }; Negotiator.prototype.charsets = function charsets(available) { - var preferredCharsets = loadModule('charset').preferredCharsets; return preferredCharsets(this.request.headers['accept-charset'], available); }; @@ -53,7 +50,6 @@ Negotiator.prototype.encoding = function encoding(available) { }; Negotiator.prototype.encodings = function encodings(available) { - var preferredEncodings = loadModule('encoding').preferredEncodings; return preferredEncodings(this.request.headers['accept-encoding'], available); }; @@ -63,7 +59,6 @@ Negotiator.prototype.language = function language(available) { }; Negotiator.prototype.languages = function languages(available) { - var preferredLanguages = loadModule('language').preferredLanguages; return preferredLanguages(this.request.headers['accept-language'], available); }; @@ -73,7 +68,6 @@ Negotiator.prototype.mediaType = function mediaType(available) { }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { - var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; return preferredMediaTypes(this.request.headers.accept, available); }; @@ -86,39 +80,3 @@ Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; - -/** - * Load the given module. - * @private - */ - -function loadModule(moduleName) { - var module = modules[moduleName]; - - if (module !== undefined) { - return module; - } - - // This uses a switch for static require analysis - switch (moduleName) { - case 'charset': - module = require('./lib/charset'); - break; - case 'encoding': - module = require('./lib/encoding'); - break; - case 'language': - module = require('./lib/language'); - break; - case 'mediaType': - module = require('./lib/mediaType'); - break; - default: - throw new Error('Cannot find module \'' + moduleName + '\''); - } - - // Store to prevent invoking require() - modules[moduleName] = module; - - return module; -} diff --git a/deps/npm/node_modules/negotiator/lib/language.js b/deps/npm/node_modules/negotiator/lib/language.js index 62f737f0060..a2316725271 100644 --- a/deps/npm/node_modules/negotiator/lib/language.js +++ b/deps/npm/node_modules/negotiator/lib/language.js @@ -54,9 +54,9 @@ function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; - var prefix = match[1], - suffix = match[2], - full = prefix; + var prefix = match[1] + var suffix = match[2] + var full = prefix if (suffix) full += "-" + suffix; diff --git a/deps/npm/node_modules/negotiator/package.json b/deps/npm/node_modules/negotiator/package.json index 0c7ff3c2e64..297635f6d34 100644 --- a/deps/npm/node_modules/negotiator/package.json +++ b/deps/npm/node_modules/negotiator/package.json @@ -1,7 +1,7 @@ { "name": "negotiator", "description": "HTTP content negotiation", - "version": "0.6.2", + "version": "0.6.3", "contributors": [ "Douglas Christopher Wilson <doug@somethingdoug.com>", "Federico Romero <federico.romero@outboxlabs.com>", @@ -18,10 +18,10 @@ ], "repository": "jshttp/negotiator", "devDependencies": { - "eslint": "5.16.0", - "eslint-plugin-markdown": "1.0.0", - "mocha": "6.1.4", - "nyc": "14.0.0" + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.1.3", + "nyc": "15.1.0" }, "files": [ "lib/", @@ -34,9 +34,9 @@ "node": ">= 0.6" }, "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", + "lint": "eslint .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test" + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts new file mode 100644 index 00000000000..a7efe943b2a --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts @@ -0,0 +1,14 @@ +/// <reference types="node" /> +import { EventEmitter } from 'events'; +declare function once<T>(emitter: EventEmitter, name: string): once.CancelablePromise<T>; +declare namespace once { + interface CancelFunction { + (): void; + } + interface CancelablePromise<T> extends Promise<T> { + cancel: CancelFunction; + } + type CancellablePromise<T> = CancelablePromise<T>; + function spread<T extends any[]>(emitter: EventEmitter, name: string): once.CancelablePromise<T>; +} +export = once; diff --git a/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js new file mode 100644 index 00000000000..bfd0dc88f75 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js @@ -0,0 +1,39 @@ +"use strict"; +function noop() { } +function once(emitter, name) { + const o = once.spread(emitter, name); + const r = o.then((args) => args[0]); + r.cancel = o.cancel; + return r; +} +(function (once) { + function spread(emitter, name) { + let c = null; + const p = new Promise((resolve, reject) => { + function cancel() { + emitter.removeListener(name, onEvent); + emitter.removeListener('error', onError); + p.cancel = noop; + } + function onEvent(...args) { + cancel(); + resolve(args); + } + function onError(err) { + cancel(); + reject(err); + } + c = cancel; + emitter.on(name, onEvent); + emitter.on('error', onError); + }); + if (!c) { + throw new TypeError('Could not get `cancel()` function'); + } + p.cancel = c; + return p; + } + once.spread = spread; +})(once || (once = {})); +module.exports = once; +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map new file mode 100644 index 00000000000..30d20491dbc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,IAAI,CACZ,OAAqB,EACrB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAM,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAA8B,CAAC;IACtE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,OAAO,CAAC,CAAC;AACV,CAAC;AAED,WAAU,IAAI;IAWb,SAAgB,MAAM,CACrB,OAAqB,EACrB,IAAY;QAEZ,IAAI,CAAC,GAA+B,IAAI,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,SAAS,MAAM;gBACd,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,SAAS,OAAO,CAAC,GAAG,IAAW;gBAC9B,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,IAAS,CAAC,CAAC;YACpB,CAAC;YACD,SAAS,OAAO,CAAC,GAAU;gBAC1B,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YACD,CAAC,GAAG,MAAM,CAAC;YACX,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC,CAA8B,CAAC;QAChC,IAAI,CAAC,CAAC,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;SACzD;QACD,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IA5Be,WAAM,SA4BrB,CAAA;AACF,CAAC,EAxCS,IAAI,KAAJ,IAAI,QAwCb;AAED,iBAAS,IAAI,CAAC"}
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/package.json b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/package.json new file mode 100644 index 00000000000..8343f9fad73 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/package.json @@ -0,0 +1,45 @@ +{ + "name": "@tootallnate/once", + "version": "1.1.2", + "description": "Creates a Promise that waits for a single event", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/once.git" + }, + "keywords": [], + "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/once/issues" + }, + "devDependencies": { + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "rimraf": "^3.0.0", + "typescript": "^3.7.3" + }, + "engines": { + "node": ">= 6" + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts new file mode 100644 index 00000000000..3f043f7f9f7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts @@ -0,0 +1,32 @@ +/// <reference types="node" /> +import net from 'net'; +import { Agent, ClientRequest, RequestOptions } from 'agent-base'; +import { HttpProxyAgentOptions } from '.'; +interface HttpProxyAgentClientRequest extends ClientRequest { + path: string; + output?: string[]; + outputData?: { + data: string; + }[]; + _header?: string | null; + _implicitHeader(): void; +} +/** + * The `HttpProxyAgent` implements an HTTP Agent subclass that connects + * to the specified "HTTP proxy server" in order to proxy HTTP requests. + * + * @api public + */ +export default class HttpProxyAgent extends Agent { + private secureProxy; + private proxy; + constructor(_opts: string | HttpProxyAgentOptions); + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req: HttpProxyAgentClientRequest, opts: RequestOptions): Promise<net.Socket>; +} +export {}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js new file mode 100644 index 00000000000..02528505168 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js @@ -0,0 +1,145 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const net_1 = __importDefault(require("net")); +const tls_1 = __importDefault(require("tls")); +const url_1 = __importDefault(require("url")); +const debug_1 = __importDefault(require("debug")); +const once_1 = __importDefault(require("@tootallnate/once")); +const agent_base_1 = require("agent-base"); +const debug = debug_1.default('http-proxy-agent'); +function isHTTPS(protocol) { + return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; +} +/** + * The `HttpProxyAgent` implements an HTTP Agent subclass that connects + * to the specified "HTTP proxy server" in order to proxy HTTP requests. + * + * @api public + */ +class HttpProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); + } + debug('Creating new HttpProxyAgent instance: %o', opts); + super(opts); + const proxy = Object.assign({}, opts); + // If `true`, then connect to the proxy server over TLS. + // Defaults to `false`. + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + // Prefer `hostname` over `host`, and set the `port` if needed. + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === 'string') { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + if (proxy.host && proxy.path) { + // If both a `host` and `path` are specified then it's most likely + // the result of a `url.parse()` call... we need to remove the + // `path` portion so that `net.connect()` doesn't attempt to open + // that as a Unix socket file. + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + const parsed = url_1.default.parse(req.path); + if (!parsed.protocol) { + parsed.protocol = 'http:'; + } + if (!parsed.hostname) { + parsed.hostname = opts.hostname || opts.host || null; + } + if (parsed.port == null && typeof opts.port) { + parsed.port = String(opts.port); + } + if (parsed.port === '80') { + // if port is 80, then we can remove the port so that the + // ":80" portion is not on the produced URL + delete parsed.port; + } + // Change the `http.ClientRequest` instance's "path" field + // to the absolute path of the URL that will be requested. + req.path = url_1.default.format(parsed); + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.auth) { + req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`); + } + // Create a socket connection to the proxy server. + let socket; + if (secureProxy) { + debug('Creating `tls.Socket`: %o', proxy); + socket = tls_1.default.connect(proxy); + } + else { + debug('Creating `net.Socket`: %o', proxy); + socket = net_1.default.connect(proxy); + } + // At this point, the http ClientRequest's internal `_header` field + // might have already been set. If this is the case then we'll need + // to re-generate the string since we just changed the `req.path`. + if (req._header) { + let first; + let endOfHeaders; + debug('Regenerating stored HTTP header string for request'); + req._header = null; + req._implicitHeader(); + if (req.output && req.output.length > 0) { + // Node < 12 + debug('Patching connection write() output buffer with updated header'); + first = req.output[0]; + endOfHeaders = first.indexOf('\r\n\r\n') + 4; + req.output[0] = req._header + first.substring(endOfHeaders); + debug('Output buffer: %o', req.output); + } + else if (req.outputData && req.outputData.length > 0) { + // Node >= 12 + debug('Patching connection write() output buffer with updated header'); + first = req.outputData[0].data; + endOfHeaders = first.indexOf('\r\n\r\n') + 4; + req.outputData[0].data = + req._header + first.substring(endOfHeaders); + debug('Output buffer: %o', req.outputData[0].data); + } + } + // Wait for the socket's `connect` event, so that this `callback()` + // function throws instead of the `http` request machinery. This is + // important for i.e. `PacProxyAgent` which determines a failed proxy + // connection via the `callback()` function throwing. + yield once_1.default(socket, 'connect'); + return socket; + }); + } +} +exports.default = HttpProxyAgent; +//# sourceMappingURL=agent.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map new file mode 100644 index 00000000000..7a407620d8e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAgC,EAChC,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YACpC,MAAM,MAAM,GAAG,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;aAC1B;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;aACrD;YAED,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE;gBAC5C,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;YAED,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,yDAAyD;gBACzD,2CAA2C;gBAC3C,OAAO,MAAM,CAAC,IAAI,CAAC;aACnB;YAED,0DAA0D;YAC1D,0DAA0D;YAC1D,GAAG,CAAC,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,GAAG,CAAC,SAAS,CACZ,qBAAqB,EACrB,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;aACF;YAED,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,GAAG,CAAC,OAAO,EAAE;gBAChB,IAAI,KAAa,CAAC;gBAClB,IAAI,YAAoB,CAAC;gBACzB,KAAK,CAAC,oDAAoD,CAAC,CAAC;gBAC5D,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;gBACnB,GAAG,CAAC,eAAe,EAAE,CAAC;gBACtB,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxC,YAAY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,cAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"}
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts new file mode 100644 index 00000000000..24bdb52efce --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts @@ -0,0 +1,21 @@ +/// <reference types="node" /> +import net from 'net'; +import tls from 'tls'; +import { Url } from 'url'; +import { AgentOptions } from 'agent-base'; +import _HttpProxyAgent from './agent'; +declare function createHttpProxyAgent(opts: string | createHttpProxyAgent.HttpProxyAgentOptions): _HttpProxyAgent; +declare namespace createHttpProxyAgent { + interface BaseHttpProxyAgentOptions { + secureProxy?: boolean; + host?: string | null; + path?: string | null; + port?: string | number | null; + } + export interface HttpProxyAgentOptions extends AgentOptions, BaseHttpProxyAgentOptions, Partial<Omit<Url & net.NetConnectOpts & tls.ConnectionOptions, keyof BaseHttpProxyAgentOptions>> { + } + export type HttpProxyAgent = _HttpProxyAgent; + export const HttpProxyAgent: typeof _HttpProxyAgent; + export {}; +} +export = createHttpProxyAgent; diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js new file mode 100644 index 00000000000..0a711805946 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(require("./agent")); +function createHttpProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createHttpProxyAgent) { + createHttpProxyAgent.HttpProxyAgent = agent_1.default; + createHttpProxyAgent.prototype = agent_1.default.prototype; +})(createHttpProxyAgent || (createHttpProxyAgent = {})); +module.exports = createHttpProxyAgent; +//# sourceMappingURL=index.js.map
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map new file mode 100644 index 00000000000..e07dae5b084 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAIA,oDAAsC;AAEtC,SAAS,oBAAoB,CAC5B,IAAyD;IAEzD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,WAAU,oBAAoB;IAmBhB,mCAAc,GAAG,eAAe,CAAC;IAE9C,oBAAoB,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;AAC5D,CAAC,EAtBS,oBAAoB,KAApB,oBAAoB,QAsB7B;AAED,iBAAS,oBAAoB,CAAC"}
\ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/package.json b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/package.json new file mode 100644 index 00000000000..870dd5d8af2 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/package.json @@ -0,0 +1,57 @@ +{ + "name": "http-proxy-agent", + "version": "4.0.1", + "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" + }, + "keywords": [ + "http", + "proxy", + "endpoint", + "agent" + ], + "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" + }, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "devDependencies": { + "@types/debug": "4", + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "proxy": "1", + "rimraf": "^3.0.0", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">= 6" + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE new file mode 100644 index 00000000000..8d28acf866d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js new file mode 100644 index 00000000000..3675dd8ae98 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js @@ -0,0 +1,194 @@ +'use strict' +const LRU = require('lru-cache') +const url = require('url') +const isLambda = require('is-lambda') + +const AGENT_CACHE = new LRU({ max: 50 }) +const HttpAgent = require('agentkeepalive') +const HttpsAgent = HttpAgent.HttpsAgent + +module.exports = getAgent + +const getAgentTimeout = timeout => + typeof timeout !== 'number' || !timeout ? 0 : timeout + 1 + +const getMaxSockets = maxSockets => maxSockets || 15 + +function getAgent (uri, opts) { + const parsedUri = new url.URL(typeof uri === 'string' ? uri : uri.url) + const isHttps = parsedUri.protocol === 'https:' + const pxuri = getProxyUri(parsedUri.href, opts) + + // If opts.timeout is zero, set the agentTimeout to zero as well. A timeout + // of zero disables the timeout behavior (OS limits still apply). Else, if + // opts.timeout is a non-zero value, set it to timeout + 1, to ensure that + // the node-fetch-npm timeout will always fire first, giving us more + // consistent errors. + const agentTimeout = getAgentTimeout(opts.timeout) + const agentMaxSockets = getMaxSockets(opts.maxSockets) + + const key = [ + `https:${isHttps}`, + pxuri + ? `proxy:${pxuri.protocol}//${pxuri.host}:${pxuri.port}` + : '>no-proxy<', + `local-address:${opts.localAddress || '>no-local-address<'}`, + `strict-ssl:${isHttps ? opts.rejectUnauthorized : '>no-strict-ssl<'}`, + `ca:${(isHttps && opts.ca) || '>no-ca<'}`, + `cert:${(isHttps && opts.cert) || '>no-cert<'}`, + `key:${(isHttps && opts.key) || '>no-key<'}`, + `timeout:${agentTimeout}`, + `maxSockets:${agentMaxSockets}`, + ].join(':') + + if (opts.agent != null) { // `agent: false` has special behavior! + return opts.agent + } + + // keep alive in AWS lambda makes no sense + const lambdaAgent = !isLambda ? null + : isHttps ? require('https').globalAgent + : require('http').globalAgent + + if (isLambda && !pxuri) + return lambdaAgent + + if (AGENT_CACHE.peek(key)) + return AGENT_CACHE.get(key) + + if (pxuri) { + const pxopts = isLambda ? { + ...opts, + agent: lambdaAgent, + } : opts + const proxy = getProxy(pxuri, pxopts, isHttps) + AGENT_CACHE.set(key, proxy) + return proxy + } + + const agent = isHttps ? new HttpsAgent({ + maxSockets: agentMaxSockets, + ca: opts.ca, + cert: opts.cert, + key: opts.key, + localAddress: opts.localAddress, + rejectUnauthorized: opts.rejectUnauthorized, + timeout: agentTimeout, + }) : new HttpAgent({ + maxSockets: agentMaxSockets, + localAddress: opts.localAddress, + timeout: agentTimeout, + }) + AGENT_CACHE.set(key, agent) + return agent +} + +function checkNoProxy (uri, opts) { + const host = new url.URL(uri).hostname.split('.').reverse() + let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) + if (typeof noproxy === 'string') + noproxy = noproxy.split(/\s*,\s*/g) + + return noproxy && noproxy.some(no => { + const noParts = no.split('.').filter(x => x).reverse() + if (!noParts.length) + return false + for (let i = 0; i < noParts.length; i++) { + if (host[i] !== noParts[i]) + return false + } + return true + }) +} + +module.exports.getProcessEnv = getProcessEnv + +function getProcessEnv (env) { + if (!env) + return + + let value + + if (Array.isArray(env)) { + for (const e of env) { + value = process.env[e] || + process.env[e.toUpperCase()] || + process.env[e.toLowerCase()] + if (typeof value !== 'undefined') + break + } + } + + if (typeof env === 'string') { + value = process.env[env] || + process.env[env.toUpperCase()] || + process.env[env.toLowerCase()] + } + + return value +} + +module.exports.getProxyUri = getProxyUri +function getProxyUri (uri, opts) { + const protocol = new url.URL(uri).protocol + + const proxy = opts.proxy || + ( + protocol === 'https:' && + getProcessEnv('https_proxy') + ) || + ( + protocol === 'http:' && + getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) + ) + if (!proxy) + return null + + const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy + + return !checkNoProxy(uri, opts) && parsedProxy +} + +const getAuth = u => + u.username && u.password ? decodeURIComponent(`${u.username}:${u.password}`) + : u.username ? decodeURIComponent(u.username) + : null + +const getPath = u => u.pathname + u.search + u.hash + +const HttpProxyAgent = require('http-proxy-agent') +const HttpsProxyAgent = require('https-proxy-agent') +const SocksProxyAgent = require('socks-proxy-agent') +module.exports.getProxy = getProxy +function getProxy (proxyUrl, opts, isHttps) { + const popts = { + host: proxyUrl.hostname, + port: proxyUrl.port, + protocol: proxyUrl.protocol, + path: getPath(proxyUrl), + auth: getAuth(proxyUrl), + ca: opts.ca, + cert: opts.cert, + key: opts.key, + timeout: getAgentTimeout(opts.timeout), + localAddress: opts.localAddress, + maxSockets: getMaxSockets(opts.maxSockets), + rejectUnauthorized: opts.rejectUnauthorized, + } + + if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { + if (!isHttps) + return new HttpProxyAgent(popts) + else + return new HttpsProxyAgent(popts) + } else if (proxyUrl.protocol.startsWith('socks')) + return new SocksProxyAgent(popts) + else { + throw Object.assign( + new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), + { + url: proxyUrl.href, + } + ) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js new file mode 100644 index 00000000000..a2acea156ee --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js @@ -0,0 +1,460 @@ +const { Request, Response } = require('minipass-fetch') +const Minipass = require('minipass') +const MinipassCollect = require('minipass-collect') +const MinipassFlush = require('minipass-flush') +const MinipassPipeline = require('minipass-pipeline') +const cacache = require('cacache') +const url = require('url') + +const CachePolicy = require('./policy.js') +const cacheKey = require('./key.js') +const remote = require('../remote.js') + +const hasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) + +// maximum amount of data we will buffer into memory +// if we'll exceed this, we switch to streaming +const MAX_MEM_SIZE = 5 * 1024 * 1024 // 5MB + +// allow list for request headers that will be written to the cache index +// note: we will also store any request headers +// that are named in a response's vary header +const KEEP_REQUEST_HEADERS = [ + 'accept-charset', + 'accept-encoding', + 'accept-language', + 'accept', + 'cache-control', +] + +// allow list for response headers that will be written to the cache index +// note: we must not store the real response's age header, or when we load +// a cache policy based on the metadata it will think the cached response +// is always stale +const KEEP_RESPONSE_HEADERS = [ + 'cache-control', + 'content-encoding', + 'content-language', + 'content-type', + 'date', + 'etag', + 'expires', + 'last-modified', + 'location', + 'pragma', + 'vary', +] + +// return an object containing all metadata to be written to the index +const getMetadata = (request, response, options) => { + const metadata = { + time: Date.now(), + url: request.url, + reqHeaders: {}, + resHeaders: {}, + } + + // only save the status if it's not a 200 or 304 + if (response.status !== 200 && response.status !== 304) + metadata.status = response.status + + for (const name of KEEP_REQUEST_HEADERS) { + if (request.headers.has(name)) + metadata.reqHeaders[name] = request.headers.get(name) + } + + // if the request's host header differs from the host in the url + // we need to keep it, otherwise it's just noise and we ignore it + const host = request.headers.get('host') + const parsedUrl = new url.URL(request.url) + if (host && parsedUrl.host !== host) + metadata.reqHeaders.host = host + + // if the response has a vary header, make sure + // we store the relevant request headers too + if (response.headers.has('vary')) { + const vary = response.headers.get('vary') + // a vary of "*" means every header causes a different response. + // in that scenario, we do not include any additional headers + // as the freshness check will always fail anyway and we don't + // want to bloat the cache indexes + if (vary !== '*') { + // copy any other request headers that will vary the response + const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) + for (const name of varyHeaders) { + // explicitly ignore accept-encoding here + if (name !== 'accept-encoding' && request.headers.has(name)) + metadata.reqHeaders[name] = request.headers.get(name) + } + } + } + + for (const name of KEEP_RESPONSE_HEADERS) { + if (response.headers.has(name)) + metadata.resHeaders[name] = response.headers.get(name) + } + + // we only store accept-encoding and content-encoding if the user + // has disabled automatic compression and decompression in minipass-fetch + // since if it's enabled (the default) then the content will have + // already been decompressed making the header a lie + if (options.compress === false) { + metadata.reqHeaders['accept-encoding'] = request.headers.get('accept-encoding') + metadata.resHeaders['content-encoding'] = response.headers.get('content-encoding') + } + + return metadata +} + +// symbols used to hide objects that may be lazily evaluated in a getter +const _request = Symbol('request') +const _response = Symbol('response') +const _policy = Symbol('policy') + +class CacheEntry { + constructor ({ entry, request, response, options }) { + if (entry) { + this.key = entry.key + this.entry = entry + // previous versions of this module didn't write an explicit timestamp in + // the metadata, so fall back to the entry's timestamp. we can't use the + // entry timestamp to determine staleness because cacache will update it + // when it verifies its data + this.entry.metadata.time = this.entry.metadata.time || this.entry.time + } else + this.key = cacheKey(request) + + this.options = options + + // these properties are behind getters that lazily evaluate + this[_request] = request + this[_response] = response + this[_policy] = null + } + + // returns a CacheEntry instance that satisfies the given request + // or undefined if no existing entry satisfies + static async find (request, options) { + try { + // compacts the index and returns an array of unique entries + var matches = await cacache.index.compact(options.cachePath, cacheKey(request), (A, B) => { + const entryA = new CacheEntry({ entry: A, options }) + const entryB = new CacheEntry({ entry: B, options }) + return entryA.policy.satisfies(entryB.request) + }, { + validateEntry: (entry) => { + // if an integrity is null, it needs to have a status specified + if (entry.integrity === null) + return !!(entry.metadata && entry.metadata.status) + + return true + }, + }) + } catch (err) { + // if the compact request fails, ignore the error and return + return + } + + // a cache mode of 'reload' means to behave as though we have no cache + // on the way to the network. return undefined to allow cacheFetch to + // create a brand new request no matter what. + if (options.cache === 'reload') + return + + // find the specific entry that satisfies the request + let match + for (const entry of matches) { + const _entry = new CacheEntry({ + entry, + options, + }) + + if (_entry.policy.satisfies(request)) { + match = _entry + break + } + } + + return match + } + + // if the user made a PUT/POST/PATCH then we invalidate our + // cache for the same url by deleting the index entirely + static async invalidate (request, options) { + const key = cacheKey(request) + try { + await cacache.rm.entry(options.cachePath, key, { removeFully: true }) + } catch (err) { + // ignore errors + } + } + + get request () { + if (!this[_request]) { + this[_request] = new Request(this.entry.metadata.url, { + method: 'GET', + headers: this.entry.metadata.reqHeaders, + }) + } + + return this[_request] + } + + get response () { + if (!this[_response]) { + this[_response] = new Response(null, { + url: this.entry.metadata.url, + counter: this.options.counter, + status: this.entry.metadata.status || 200, + headers: { + ...this.entry.metadata.resHeaders, + 'content-length': this.entry.size, + }, + }) + } + + return this[_response] + } + + get policy () { + if (!this[_policy]) { + this[_policy] = new CachePolicy({ + entry: this.entry, + request: this.request, + response: this.response, + options: this.options, + }) + } + + return this[_policy] + } + + // wraps the response in a pipeline that stores the data + // in the cache while the user consumes it + async store (status) { + // if we got a status other than 200, 301, or 308, + // or the CachePolicy forbid storage, append the + // cache status header and return it untouched + if (this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable()) { + this.response.headers.set('x-local-cache-status', 'skip') + return this.response + } + + const size = this.response.headers.get('content-length') + const fitsInMemory = !!size && Number(size) < MAX_MEM_SIZE + const shouldBuffer = this.options.memoize !== false && fitsInMemory + const cacheOpts = { + algorithms: this.options.algorithms, + metadata: getMetadata(this.request, this.response, this.options), + size, + memoize: fitsInMemory && this.options.memoize, + } + + let body = null + // we only set a body if the status is a 200, redirects are + // stored as metadata only + if (this.response.status === 200) { + let cacheWriteResolve, cacheWriteReject + const cacheWritePromise = new Promise((resolve, reject) => { + cacheWriteResolve = resolve + cacheWriteReject = reject + }) + + body = new MinipassPipeline(new MinipassFlush({ + flush () { + return cacheWritePromise + }, + })) + + let abortStream, onResume + if (shouldBuffer) { + // if the result fits in memory, use a collect stream to gather + // the response and write it to cacache while also passing it through + // to the user + onResume = () => { + const collector = new MinipassCollect.PassThrough() + abortStream = collector + collector.on('collect', (data) => { + // TODO if the cache write fails, log a warning but return the response anyway + cacache.put(this.options.cachePath, this.key, data, cacheOpts).then(cacheWriteResolve, cacheWriteReject) + }) + body.unshift(collector) + body.unshift(this.response.body) + } + } else { + // if it does not fit in memory, create a tee stream and use + // that to pipe to both the cache and the user simultaneously + onResume = () => { + const tee = new Minipass() + const cacheStream = cacache.put.stream(this.options.cachePath, this.key, cacheOpts) + abortStream = cacheStream + tee.pipe(cacheStream) + // TODO if the cache write fails, log a warning but return the response anyway + cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) + body.unshift(tee) + body.unshift(this.response.body) + } + } + + body.once('resume', onResume) + body.once('end', () => body.removeListener('resume', onResume)) + this.response.body.on('error', (err) => { + // the abortStream will either be a MinipassCollect if we buffer + // or a cacache write stream, either way be sure to listen for + // errors from the actual response and avoid writing data that we + // know to be invalid to the cache + abortStream.destroy(err) + }) + } else + await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) + + // note: we do not set the x-local-cache-hash header because we do not know + // the hash value until after the write to the cache completes, which doesn't + // happen until after the response has been sent and it's too late to write + // the header anyway + this.response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) + this.response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) + this.response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') + this.response.headers.set('x-local-cache-status', status) + this.response.headers.set('x-local-cache-time', new Date().toISOString()) + const newResponse = new Response(body, { + url: this.response.url, + status: this.response.status, + headers: this.response.headers, + counter: this.options.counter, + }) + return newResponse + } + + // use the cached data to create a response and return it + async respond (method, options, status) { + let response + const size = Number(this.response.headers.get('content-length')) + const fitsInMemory = !!size && size < MAX_MEM_SIZE + const shouldBuffer = this.options.memoize !== false && fitsInMemory + if (method === 'HEAD' || [301, 308].includes(this.response.status)) { + // if the request is a HEAD, or the response is a redirect, + // then the metadata in the entry already includes everything + // we need to build a response + response = this.response + } else { + // we're responding with a full cached response, so create a body + // that reads from cacache and attach it to a new Response + const body = new Minipass() + const removeOnResume = () => body.removeListener('resume', onResume) + let onResume + if (shouldBuffer) { + onResume = async () => { + removeOnResume() + try { + const content = await cacache.get.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + body.end(content) + } catch (err) { + if (err.code === 'EINTEGRITY') + await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + await CacheEntry.invalidate(this.request, this.options) + body.emit('error', err) + } + } + } else { + onResume = () => { + const cacheStream = cacache.get.stream.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + cacheStream.on('error', async (err) => { + cacheStream.pause() + if (err.code === 'EINTEGRITY') + await cacache.rm.content(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') + await CacheEntry.invalidate(this.request, this.options) + body.emit('error', err) + cacheStream.resume() + }) + cacheStream.pipe(body) + } + } + + body.once('resume', onResume) + body.once('end', removeOnResume) + response = new Response(body, { + url: this.entry.metadata.url, + counter: options.counter, + status: 200, + headers: { + ...this.policy.responseHeaders(), + }, + }) + } + + response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) + response.headers.set('x-local-cache-hash', encodeURIComponent(this.entry.integrity)) + response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) + response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') + response.headers.set('x-local-cache-status', status) + response.headers.set('x-local-cache-time', new Date(this.entry.metadata.time).toUTCString()) + return response + } + + // use the provided request along with this cache entry to + // revalidate the stored response. returns a response, either + // from the cache or from the update + async revalidate (request, options) { + const revalidateRequest = new Request(request, { + headers: this.policy.revalidationHeaders(request), + }) + + try { + // NOTE: be sure to remove the headers property from the + // user supplied options, since we have already defined + // them on the new request object. if they're still in the + // options then those will overwrite the ones from the policy + var response = await remote(revalidateRequest, { + ...options, + headers: undefined, + }) + } catch (err) { + // if the network fetch fails, return the stale + // cached response unless it has a cache-control + // of 'must-revalidate' + if (!this.policy.mustRevalidate) + return this.respond(request.method, options, 'stale') + + throw err + } + + if (this.policy.revalidated(revalidateRequest, response)) { + // we got a 304, write a new index to the cache and respond from cache + const metadata = getMetadata(request, response, options) + // 304 responses do not include headers that are specific to the response data + // since they do not include a body, so we copy values for headers that were + // in the old cache entry to the new one, if the new metadata does not already + // include that header + for (const name of KEEP_RESPONSE_HEADERS) { + if (!hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name)) + metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] + } + + try { + await cacache.index.insert(options.cachePath, this.key, this.entry.integrity, { + size: this.entry.size, + metadata, + }) + } catch (err) { + // if updating the cache index fails, we ignore it and + // respond anyway + } + return this.respond(request.method, options, 'revalidated') + } + + // if we got a modified response, create a new entry based on it + const newEntry = new CacheEntry({ + request, + response, + options, + }) + + // respond with the new entry while writing it to the cache + return newEntry.store('updated') + } +} + +module.exports = CacheEntry diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js new file mode 100644 index 00000000000..31e97c4b033 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js @@ -0,0 +1,10 @@ +class NotCachedError extends Error { + constructor (url) { + super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) + this.code = 'ENOTCACHED' + } +} + +module.exports = { + NotCachedError, +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js new file mode 100644 index 00000000000..cca93d9b4eb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js @@ -0,0 +1,45 @@ +const { NotCachedError } = require('./errors.js') +const CacheEntry = require('./entry.js') +const remote = require('../remote.js') + +// do whatever is necessary to get a Response and return it +const cacheFetch = async (request, options) => { + // try to find a cached entry that satisfies this request + const entry = await CacheEntry.find(request, options) + if (!entry) { + // no cached result, if the cache mode is 'only-if-cached' that's a failure + if (options.cache === 'only-if-cached') + throw new NotCachedError(request.url) + + // otherwise, we make a request, store it and return it + const response = await remote(request, options) + const entry = new CacheEntry({ request, response, options }) + return entry.store('miss') + } + + // we have a cached response that satisfies this request, however if the cache + // mode is 'no-cache' then we send the revalidation request no matter what + if (options.cache === 'no-cache') + return entry.revalidate(request, options) + + // if the cached entry is not stale, or if the cache mode is 'force-cache' or + // 'only-if-cached' we can respond with the cached entry. set the status + // based on the result of needsRevalidation and respond + const _needsRevalidation = entry.policy.needsRevalidation(request) + if (options.cache === 'force-cache' || + options.cache === 'only-if-cached' || + !_needsRevalidation) + return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') + + // if we got here, the cache entry is stale so revalidate it + return entry.revalidate(request, options) +} + +cacheFetch.invalidate = async (request, options) => { + if (!options.cachePath) + return + + return CacheEntry.invalidate(request, options) +} + +module.exports = cacheFetch diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js new file mode 100644 index 00000000000..f7684d562b7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js @@ -0,0 +1,17 @@ +const { URL, format } = require('url') + +// options passed to url.format() when generating a key +const formatOptions = { + auth: false, + fragment: false, + search: true, + unicode: false, +} + +// returns a string to be used as the cache key for the Request +const cacheKey = (request) => { + const parsed = new URL(request.url) + return `make-fetch-happen:request-cache:${format(parsed, formatOptions)}` +} + +module.exports = cacheKey diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js new file mode 100644 index 00000000000..e0959f64ddf --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js @@ -0,0 +1,161 @@ +const CacheSemantics = require('http-cache-semantics') +const Negotiator = require('negotiator') +const ssri = require('ssri') + +// HACK: negotiator lazy loads several of its own modules +// as a micro optimization. we need to be sure that they're +// in memory as soon as possible at startup so that we do +// not try to lazy load them after the directory has been +// retired during a self update of the npm CLI, we do this +// by calling all of the methods that trigger a lazy load +// on a fake instance. +const preloadNegotiator = new Negotiator({ headers: {} }) +preloadNegotiator.charsets() +preloadNegotiator.encodings() +preloadNegotiator.languages() +preloadNegotiator.mediaTypes() + +// options passed to http-cache-semantics constructor +const policyOptions = { + shared: false, + ignoreCargoCult: true, +} + +// a fake empty response, used when only testing the +// request for storability +const emptyResponse = { status: 200, headers: {} } + +// returns a plain object representation of the Request +const requestObject = (request) => { + const _obj = { + method: request.method, + url: request.url, + headers: {}, + } + + request.headers.forEach((value, key) => { + _obj.headers[key] = value + }) + + return _obj +} + +// returns a plain object representation of the Response +const responseObject = (response) => { + const _obj = { + status: response.status, + headers: {}, + } + + response.headers.forEach((value, key) => { + _obj.headers[key] = value + }) + + return _obj +} + +class CachePolicy { + constructor ({ entry, request, response, options }) { + this.entry = entry + this.request = requestObject(request) + this.response = responseObject(response) + this.options = options + this.policy = new CacheSemantics(this.request, this.response, policyOptions) + + if (this.entry) { + // if we have an entry, copy the timestamp to the _responseTime + // this is necessary because the CacheSemantics constructor forces + // the value to Date.now() which means a policy created from a + // cache entry is likely to always identify itself as stale + this.policy._responseTime = this.entry.metadata.time + } + } + + // static method to quickly determine if a request alone is storable + static storable (request, options) { + // no cachePath means no caching + if (!options.cachePath) + return false + + // user explicitly asked not to cache + if (options.cache === 'no-store') + return false + + // we only cache GET and HEAD requests + if (!['GET', 'HEAD'].includes(request.method)) + return false + + // otherwise, let http-cache-semantics make the decision + // based on the request's headers + const policy = new CacheSemantics(requestObject(request), emptyResponse, policyOptions) + return policy.storable() + } + + // returns true if the policy satisfies the request + satisfies (request) { + const _req = requestObject(request) + if (this.request.headers.host !== _req.headers.host) + return false + + const negotiatorA = new Negotiator(this.request) + const negotiatorB = new Negotiator(_req) + + if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) + return false + + if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) + return false + + if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) + return false + + if (this.options.integrity) + return ssri.parse(this.options.integrity).match(this.entry.integrity) + + return true + } + + // returns true if the request and response allow caching + storable () { + return this.policy.storable() + } + + // NOTE: this is a hack to avoid parsing the cache-control + // header ourselves, it returns true if the response's + // cache-control contains must-revalidate + get mustRevalidate () { + return !!this.policy._rescc['must-revalidate'] + } + + // returns true if the cached response requires revalidation + // for the given request + needsRevalidation (request) { + const _req = requestObject(request) + // force method to GET because we only cache GETs + // but can serve a HEAD from a cached GET + _req.method = 'GET' + return !this.policy.satisfiesWithoutRevalidation(_req) + } + + responseHeaders () { + return this.policy.responseHeaders() + } + + // returns a new object containing the appropriate headers + // to send a revalidation request + revalidationHeaders (request) { + const _req = requestObject(request) + return this.policy.revalidationHeaders(_req) + } + + // returns true if the request/response was revalidated + // successfully. returns false if a new response was received + revalidated (request, response) { + const _req = requestObject(request) + const _res = responseObject(response) + const policy = this.policy.revalidatedPolicy(_req, _res) + return !policy.modified + } +} + +module.exports = CachePolicy diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js new file mode 100644 index 00000000000..dfded79295d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js @@ -0,0 +1,100 @@ +'use strict' + +const { FetchError, Request, isRedirect } = require('minipass-fetch') +const url = require('url') + +const CachePolicy = require('./cache/policy.js') +const cache = require('./cache/index.js') +const remote = require('./remote.js') + +// given a Request, a Response and user options +// return true if the response is a redirect that +// can be followed. we throw errors that will result +// in the fetch being rejected if the redirect is +// possible but invalid for some reason +const canFollowRedirect = (request, response, options) => { + if (!isRedirect(response.status)) + return false + + if (options.redirect === 'manual') + return false + + if (options.redirect === 'error') + throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) + + if (!response.headers.has('location')) + throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) + + if (request.counter >= request.follow) + throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) + + return true +} + +// given a Request, a Response, and the user's options return an object +// with a new Request and a new options object that will be used for +// following the redirect +const getRedirect = (request, response, options) => { + const _opts = { ...options } + const location = response.headers.get('location') + const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) + // Comment below is used under the following license: + // Copyright (c) 2010-2012 Mikeal Rogers + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // http://www.apache.org/licenses/LICENSE-2.0 + // Unless required by applicable law or agreed to in writing, + // software distributed under the License is distributed on an "AS + // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + // express or implied. See the License for the specific language + // governing permissions and limitations under the License. + + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of request: + // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 + if (new url.URL(request.url).hostname !== redirectUrl.hostname) + request.headers.delete('authorization') + + // for POST request with 301/302 response, or any request with 303 response, + // use GET when following redirect + if (response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status))) { + _opts.method = 'GET' + _opts.body = null + request.headers.delete('content-length') + } + + _opts.headers = {} + request.headers.forEach((value, key) => { + _opts.headers[key] = value + }) + + _opts.counter = ++request.counter + const redirectReq = new Request(url.format(redirectUrl), _opts) + return { + request: redirectReq, + options: _opts, + } +} + +const fetch = async (request, options) => { + const response = CachePolicy.storable(request, options) + ? await cache(request, options) + : await remote(request, options) + + // if the request wasn't a GET or HEAD, and the response + // status is between 200 and 399 inclusive, invalidate the + // request url + if (!['GET', 'HEAD'].includes(request.method) && + response.status >= 200 && + response.status <= 399) + await cache.invalidate(request, options) + + if (!canFollowRedirect(request, response, options)) + return response + + const redirect = getRedirect(request, response, options) + return fetch(redirect.request, redirect.options) +} + +module.exports = fetch diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js new file mode 100644 index 00000000000..6028bc07251 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js @@ -0,0 +1,40 @@ +const { FetchError, Headers, Request, Response } = require('minipass-fetch') + +const configureOptions = require('./options.js') +const fetch = require('./fetch.js') + +const makeFetchHappen = (url, opts) => { + const options = configureOptions(opts) + + const request = new Request(url, options) + return fetch(request, options) +} + +makeFetchHappen.defaults = (defaultUrl, defaultOptions = {}) => { + if (typeof defaultUrl === 'object') { + defaultOptions = defaultUrl + defaultUrl = null + } + + const defaultedFetch = (url, options = {}) => { + const finalUrl = url || defaultUrl + const finalOptions = { + ...defaultOptions, + ...options, + headers: { + ...defaultOptions.headers, + ...options.headers, + }, + } + return makeFetchHappen(finalUrl, finalOptions) + } + + defaultedFetch.defaults = makeFetchHappen.defaults + return defaultedFetch +} + +module.exports = makeFetchHappen +module.exports.FetchError = FetchError +module.exports.Headers = Headers +module.exports.Request = Request +module.exports.Response = Response diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js new file mode 100644 index 00000000000..f6138e6e1d1 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js @@ -0,0 +1,44 @@ +const conditionalHeaders = [ + 'if-modified-since', + 'if-none-match', + 'if-unmodified-since', + 'if-match', + 'if-range', +] + +const configureOptions = (opts) => { + const {strictSSL, ...options} = { ...opts } + options.method = options.method ? options.method.toUpperCase() : 'GET' + options.rejectUnauthorized = strictSSL !== false + + if (!options.retry) + options.retry = { retries: 0 } + else if (typeof options.retry === 'string') { + const retries = parseInt(options.retry, 10) + if (isFinite(retries)) + options.retry = { retries } + else + options.retry = { retries: 0 } + } else if (typeof options.retry === 'number') + options.retry = { retries: options.retry } + else + options.retry = { retries: 0, ...options.retry } + + options.cache = options.cache || 'default' + if (options.cache === 'default') { + const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { + return conditionalHeaders.includes(name.toLowerCase()) + }) + if (hasConditionalHeader) + options.cache = 'no-store' + } + + // cacheManager is deprecated, but if it's set and + // cachePath is not we should copy it to the new field + if (options.cacheManager && !options.cachePath) + options.cachePath = options.cacheManager + + return options +} + +module.exports = configureOptions diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js new file mode 100644 index 00000000000..7e4ed24edb5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js @@ -0,0 +1,102 @@ +const Minipass = require('minipass') +const MinipassPipeline = require('minipass-pipeline') +const fetch = require('minipass-fetch') +const promiseRetry = require('promise-retry') +const ssri = require('ssri') + +const getAgent = require('./agent.js') +const pkg = require('../package.json') + +const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` + +const RETRY_ERRORS = [ + 'ECONNRESET', // remote socket closed on us + 'ECONNREFUSED', // remote host refused to open connection + 'EADDRINUSE', // failed to bind to a local port (proxy?) + 'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW + 'ERR_SOCKET_TIMEOUT', // same as above, but this one comes from agentkeepalive + // Known codes we do NOT retry on: + // ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline) +] + +const RETRY_TYPES = [ + 'request-timeout', +] + +// make a request directly to the remote source, +// retrying certain classes of errors as well as +// following redirects (through the cache if necessary) +// and verifying response integrity +const remoteFetch = (request, options) => { + const agent = getAgent(request.url, options) + if (!request.headers.has('connection')) + request.headers.set('connection', agent ? 'keep-alive' : 'close') + + if (!request.headers.has('user-agent')) + request.headers.set('user-agent', USER_AGENT) + + // keep our own options since we're overriding the agent + // and the redirect mode + const _opts = { + ...options, + agent, + redirect: 'manual', + } + + return promiseRetry(async (retryHandler, attemptNum) => { + const req = new fetch.Request(request, _opts) + try { + let res = await fetch(req, _opts) + if (_opts.integrity && res.status === 200) { + // we got a 200 response and the user has specified an expected + // integrity value, so wrap the response in an ssri stream to verify it + const integrityStream = ssri.integrityStream({ integrity: _opts.integrity }) + res = new fetch.Response(new MinipassPipeline(res.body, integrityStream), res) + } + + res.headers.set('x-fetch-attempts', attemptNum) + + // do not retry POST requests, or requests with a streaming body + // do retry requests with a 408, 420, 429 or 500+ status in the response + const isStream = Minipass.isStream(req.body) + const isRetriable = req.method !== 'POST' && + !isStream && + ([408, 420, 429].includes(res.status) || res.status >= 500) + + if (isRetriable) { + if (typeof options.onRetry === 'function') + options.onRetry(res) + + return retryHandler(res) + } + + return res + } catch (err) { + const code = (err.code === 'EPROMISERETRY') + ? err.retried.code + : err.code + + // err.retried will be the thing that was thrown from above + // if it's a response, we just got a bad status code and we + // can re-throw to allow the retry + const isRetryError = err.retried instanceof fetch.Response || + (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) + + if (req.method === 'POST' || isRetryError) + throw err + + if (typeof options.onRetry === 'function') + options.onRetry(err) + + return retryHandler(err) + } + }, options.retry).catch((err) => { + // don't reject for http errors, just return them + if (err.status >= 400 && err.type !== 'system') + return err + + throw err + }) +} + +module.exports = remoteFetch diff --git a/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/package.json new file mode 100644 index 00000000000..dae7b37da40 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/package.json @@ -0,0 +1,76 @@ +{ + "name": "make-fetch-happen", + "version": "9.1.0", + "description": "Opinionated, caching, retrying fetch client", + "main": "lib/index.js", + "files": [ + "lib" + ], + "scripts": { + "preversion": "npm t", + "postversion": "npm publish", + "prepublishOnly": "git push --follow-tags", + "test": "tap", + "posttest": "npm run lint", + "eslint": "eslint", + "lint": "npm run eslint -- lib test", + "lintfix": "npm run lint -- --fix" + }, + "repository": "https://github.com/npm/make-fetch-happen", + "keywords": [ + "http", + "request", + "fetch", + "mean girls", + "caching", + "cache", + "subresource integrity" + ], + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech", + "twitter": "maybekatz" + }, + "license": "ISC", + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "devDependencies": { + "eslint": "^7.26.0", + "eslint-plugin-import": "^2.23.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-standard": "^5.0.0", + "mkdirp": "^1.0.4", + "nock": "^13.0.11", + "npmlog": "^5.0.0", + "require-inject": "^1.4.2", + "rimraf": "^3.0.2", + "safe-buffer": "^5.2.1", + "standard-version": "^9.3.0", + "tap": "^15.0.9" + }, + "engines": { + "node": ">= 10" + }, + "tap": { + "color": 1, + "files": "test/*.js", + "check-coverage": true + } +} diff --git a/deps/npm/node_modules/npm-profile/LICENSE b/deps/npm/node_modules/npm-profile/LICENSE deleted file mode 100644 index 7953647e776..00000000000 --- a/deps/npm/node_modules/npm-profile/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright npm, Inc - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-profile/LICENSE.md b/deps/npm/node_modules/npm-profile/LICENSE.md new file mode 100644 index 00000000000..5fc208ff122 --- /dev/null +++ b/deps/npm/node_modules/npm-profile/LICENSE.md @@ -0,0 +1,20 @@ +<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> + +ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-profile/index.js b/deps/npm/node_modules/npm-profile/lib/index.js index 4f2a2ae7cc2..aa322e37f48 100644 --- a/deps/npm/node_modules/npm-profile/index.js +++ b/deps/npm/node_modules/npm-profile/lib/index.js @@ -1,7 +1,7 @@ 'use strict' const fetch = require('npm-registry-fetch') -const { HttpErrorBase } = require('npm-registry-fetch/errors.js') +const { HttpErrorBase } = require('npm-registry-fetch/lib/errors') const os = require('os') const { URL } = require('url') @@ -57,7 +57,7 @@ const webAuth = (opener, opts, body) => { return fetch(target, { ...opts, method: 'POST', - body + body, }).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { @@ -76,7 +76,7 @@ const webAuth = (opener, opts, body) => { if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) { throw new WebLoginNotSupported('POST', { status: er.statusCode, - headers: { raw: () => er.headers } + headers: { raw: () => er.headers }, }, er.body) } else { throw er @@ -115,11 +115,11 @@ const adduserCouch = (username, email, password, opts = {}) => { email: email, type: 'user', roles: [], - date: new Date().toISOString() + date: new Date().toISOString(), } const logObj = { ...body, - password: 'XXXXX' + password: 'XXXXX', } process.emit('log', 'verbose', 'adduser', 'before first PUT', logObj) @@ -127,7 +127,7 @@ const adduserCouch = (username, email, password, opts = {}) => { return fetch.json(target, { ...opts, method: 'PUT', - body + body, }).then(result => { result.username = username return result @@ -141,11 +141,11 @@ const loginCouch = (username, password, opts = {}) => { password: password, type: 'user', roles: [], - date: new Date().toISOString() + date: new Date().toISOString(), } const logObj = { ...body, - password: 'XXXXX' + password: 'XXXXX', } process.emit('log', 'verbose', 'login', 'before first PUT', logObj) @@ -153,16 +153,18 @@ const loginCouch = (username, password, opts = {}) => { return fetch.json(target, { ...opts, method: 'PUT', - body + body, }).catch(err => { if (err.code === 'E400') { err.message = `There is no user with the username "${username}".` throw err } - if (err.code !== 'E409') throw err + if (err.code !== 'E409') { + throw err + } return fetch.json(target, { ...opts, - query: { write: true } + query: { write: true }, }).then(result => { Object.keys(result).forEach(k => { if (!body[k] || k === 'roles') { @@ -177,8 +179,8 @@ const loginCouch = (username, password, opts = {}) => { forceAuth: { username, password: Buffer.from(password, 'utf8').toString('base64'), - otp - } + otp, + }, }) }) }).then(result => { @@ -192,12 +194,14 @@ const get = (opts = {}) => fetch.json('/-/npm/v1/user', opts) const set = (profile, opts = {}) => { Object.keys(profile).forEach(key => { // profile keys can't be empty strings, but they CAN be null - if (profile[key] === '') profile[key] = null + if (profile[key] === '') { + profile[key] = null + } }) return fetch.json('/-/npm/v1/user', { ...opts, method: 'POST', - body: profile + body: profile, }) } @@ -220,7 +224,7 @@ const removeToken = (tokenKey, opts = {}) => { return fetch(target, { ...opts, method: 'DELETE', - ignoreBody: true + ignoreBody: true, }).then(() => null) } @@ -231,8 +235,8 @@ const createToken = (password, readonly, cidrs, opts = {}) => { body: { password: password, readonly: readonly, - cidr_whitelist: cidrs - } + cidr_whitelist: cidrs, + }, }) } @@ -267,5 +271,5 @@ module.exports = { set, listTokens, removeToken, - createToken + createToken, } diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index 43cc7c921bb..8745c2559f3 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,39 +1,45 @@ { "name": "npm-profile", - "version": "5.0.4", + "version": "6.0.0", "description": "Library for updating an npmjs.com profile", "keywords": [], - "author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)", + "author": "GitHub Inc.", "license": "ISC", "dependencies": { - "npm-registry-fetch": "^11.0.0" + "npm-registry-fetch": "^12.0.0" }, - "main": "index.js", + "main": "./lib/index.js", "repository": { "type": "git", "url": "git+https://github.com/npm/npm-profile.git" }, "files": [ - "index.js" + "bin", + "lib" ], "devDependencies": { - "nock": "^12.0.1", - "require-inject": "^1.4.4", - "standard": "^14.3.1", - "tap": "^14.10.6" + "@npmcli/template-oss": "^2.5.1", + "nock": "^13.2.1", + "tap": "^15.1.5" }, "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "posttest": "standard index.js", + "posttest": "npm run lint", "test": "tap", - "snap": "tap" + "snap": "tap", + "lint": "eslint '**/*.js'", + "postlint": "npm-template-check", + "lintfix": "npm run lint -- --fix" }, "tap": { "check-coverage": true }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "version": "2.5.1" } } diff --git a/deps/npm/node_modules/npm-registry-fetch/LICENSE.md b/deps/npm/node_modules/npm-registry-fetch/LICENSE.md index 8d28acf866d..5fc208ff122 100644 --- a/deps/npm/node_modules/npm-registry-fetch/LICENSE.md +++ b/deps/npm/node_modules/npm-registry-fetch/LICENSE.md @@ -1,16 +1,20 @@ +<!-- This file is automatically added by @npmcli/template-oss. Do not edit. --> + ISC License -Copyright (c) npm, Inc. +Copyright npm, Inc. -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby +granted, provided that the above copyright notice and this +permission notice appear in all copies. -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-fetch/auth.js b/deps/npm/node_modules/npm-registry-fetch/lib/auth.js index 01a4436a5d2..e6b50b12eb2 100644 --- a/deps/npm/node_modules/npm-registry-fetch/auth.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/auth.js @@ -12,8 +12,9 @@ const regKeyFromURI = (uri, opts) => { let regKey = `//${parsed.host}${parsed.pathname}` while (regKey.length > '//'.length) { // got some auth for this URI - if (hasAuth(regKey, opts)) + if (hasAuth(regKey, opts)) { return regKey + } // can be either //host/some/path/:_auth or //host/some/path:_auth // walk up by removing EITHER what's after the slash OR the slash itself @@ -44,8 +45,9 @@ const getRegistry = opts => { const getAuth = (uri, opts = {}) => { const { forceAuth } = opts - if (!uri) + if (!uri) { throw new Error('URI is required') + } const regKey = regKeyFromURI(uri, forceAuth || opts) // we are only allowed to use what's in forceAuth if specified @@ -62,9 +64,9 @@ const getAuth = (uri, opts = {}) => { // no auth for this URI, but might have it for the registry if (!regKey) { const registry = getRegistry(opts) - if (registry && uri !== registry && sameHost(uri, registry)) + if (registry && uri !== registry && sameHost(uri, registry)) { return getAuth(registry, opts) - else if (registry !== opts.registry) { + } else if (registry !== opts.registry) { // If making a tarball request to a different base URI than the // registry where we logged in, but the same auth SHOULD be sent // to that artifact host, then we track where it was coming in from, @@ -96,11 +98,11 @@ class Auth { this.token = null this.auth = null this.isBasicAuth = false - if (token) + if (token) { this.token = token - else if (auth) + } else if (auth) { this.auth = auth - else if (username && password) { + } else if (username && password) { const p = Buffer.from(password, 'base64').toString('utf8') this.auth = Buffer.from(`${username}:${p}`, 'utf8').toString('base64') this.isBasicAuth = true diff --git a/deps/npm/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/npm-registry-fetch/lib/check-response.js index 8bd85661ee8..26043a96de8 100644 --- a/deps/npm/node_modules/npm-registry-fetch/check-response.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/check-response.js @@ -4,11 +4,14 @@ const errors = require('./errors.js') const { Response } = require('minipass-fetch') const defaultOpts = require('./default-opts.js') +/* eslint-disable-next-line max-len */ +const moreInfoUrl = 'https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry' const checkResponse = async ({ method, uri, res, registry, startTime, auth, opts }) => { opts = { ...defaultOpts, ...opts } - if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) + if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) { opts.log.notice('', res.headers.get('npm-notice')) + } if (res.status >= 400) { logRequest(method, res, startTime, opts) @@ -21,7 +24,7 @@ const checkResponse = URI: ${uri} Scoped Registry Key: ${auth.scopeAuthKey} -More info here: https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry`) +More info here: ${moreInfoUrl}`) } return checkErrors(method, res, startTime, opts) } else { @@ -46,8 +49,9 @@ function logRequest (method, res, startTime, opts) { try { const { URL } = require('url') const url = new URL(res.url) - if (url.password) + if (url.password) { url.password = '***' + } urlStr = url.toString() } catch (er) { @@ -85,7 +89,11 @@ function checkErrors (method, res, startTime, opts) { method, res, parsed, opts.spec ) } - } else if (res.status === 401 && body != null && /one-time pass/.test(body.toString('utf8'))) { + } else if ( + res.status === 401 && + body != null && + /one-time pass/.test(body.toString('utf8')) + ) { // Heuristic for malformed OTP responses that don't include the // www-authenticate header. throw new errors.HttpErrorAuthOTP( diff --git a/deps/npm/node_modules/npm-registry-fetch/default-opts.js b/deps/npm/node_modules/npm-registry-fetch/lib/default-opts.js index 9ca3f97d035..e8e8221da4a 100644 --- a/deps/npm/node_modules/npm-registry-fetch/default-opts.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/default-opts.js @@ -1,4 +1,4 @@ -const pkg = require('./package.json') +const pkg = require('../package.json') module.exports = { log: require('./silentlog.js'), maxSockets: 12, diff --git a/deps/npm/node_modules/npm-registry-fetch/errors.js b/deps/npm/node_modules/npm-registry-fetch/lib/errors.js index e65e5fbd80d..0efc923e3e9 100644 --- a/deps/npm/node_modules/npm-registry-fetch/errors.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/errors.js @@ -8,10 +8,11 @@ function packageName (href) { if (!basePath.match(/^-/)) { basePath = basePath.split('/') var index = basePath.indexOf('_rewrite') - if (index === -1) + if (index === -1) { index = basePath.length - 1 - else + } else { index++ + } return decodeURIComponent(basePath[index]) } } catch (_) { diff --git a/deps/npm/node_modules/npm-registry-fetch/index.js b/deps/npm/node_modules/npm-registry-fetch/lib/index.js index 35fab75bcad..19c921403e5 100644 --- a/deps/npm/node_modules/npm-registry-fetch/index.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/index.js @@ -60,11 +60,14 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { typeof body === 'object' && typeof body.then === 'function' - if (body && !bodyIsStream && !bodyIsPromise && typeof body !== 'string' && !Buffer.isBuffer(body)) { + if ( + body && !bodyIsStream && !bodyIsPromise && typeof body !== 'string' && !Buffer.isBuffer(body) + ) { headers['content-type'] = headers['content-type'] || 'application/json' body = JSON.stringify(body) - } else if (body && !headers['content-type']) + } else if (body && !headers['content-type']) { headers['content-type'] = 'application/octet-stream' + } if (opts.gzip) { headers['content-encoding'] = 'gzip' @@ -73,8 +76,9 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { body.on('error', /* istanbul ignore next: unlikely and hard to test */ err => gz.emit('error', err)) body = body.pipe(gz) - } else if (!bodyIsPromise) + } else if (!bodyIsPromise) { body = new zlib.Gzip().end(body).concat() + } } const parsed = new url.URL(uri) @@ -84,8 +88,9 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { : opts.query Object.keys(q).forEach(key => { - if (q[key] !== undefined) + if (q[key] !== undefined) { parsed.searchParams.set(key, q[key]) + } }) uri = url.format(parsed) } @@ -105,7 +110,7 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { algorithms: opts.algorithms, body, cache: getCacheMode(opts), - cacheManager: opts.cache, + cachePath: opts.cache, ca: opts.ca, cert: opts.cert, headers, @@ -138,17 +143,24 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { if (typeof opts.otpPrompt === 'function') { return p.catch(async er => { if (er instanceof HttpErrorAuthOTP) { + let otp // if otp fails to complete, we fail with that failure - const otp = await opts.otpPrompt() - // if no otp provided, throw the original HTTP error - if (!otp) + try { + otp = await opts.otpPrompt() + } catch (_) { + // ignore this error + } + // if no otp provided, or otpPrompt errored, throw the original HTTP error + if (!otp) { throw er + } return regFetch(uri, { ...opts, otp }) } throw er }) - } else + } else { return p + } } return Promise.resolve(body).then(doFetch) @@ -178,11 +190,13 @@ function pickRegistry (spec, opts = {}) { let registry = spec.scope && opts[spec.scope.replace(/^@?/, '@') + ':registry'] - if (!registry && opts.scope) + if (!registry && opts.scope) { registry = opts[opts.scope.replace(/^@?/, '@') + ':registry'] + } - if (!registry) + if (!registry) { registry = opts.registry || defaultOpts.registry + } return registry } @@ -199,24 +213,29 @@ function getHeaders (uri, auth, opts) { 'user-agent': opts.userAgent, }, opts.headers || {}) - if (opts.projectScope) - headers['npm-scope'] = opts.projectScope + if (opts.scope) { + headers['npm-scope'] = opts.scope + } - if (opts.npmSession) + if (opts.npmSession) { headers['npm-session'] = opts.npmSession + } - if (opts.npmCommand) + if (opts.npmCommand) { headers['npm-command'] = opts.npmCommand + } // If a tarball is hosted on a different place than the manifest, only send // credentials on `alwaysAuth` - if (auth.token) + if (auth.token) { headers.authorization = `Bearer ${auth.token}` - else if (auth.auth) + } else if (auth.auth) { headers.authorization = `Basic ${auth.auth}` + } - if (opts.otp) + if (opts.otp) { headers['npm-otp'] = opts.otp + } return headers } diff --git a/deps/npm/node_modules/npm-registry-fetch/silentlog.js b/deps/npm/node_modules/npm-registry-fetch/lib/silentlog.js index 483bd44c708..483bd44c708 100644 --- a/deps/npm/node_modules/npm-registry-fetch/silentlog.js +++ b/deps/npm/node_modules/npm-registry-fetch/lib/silentlog.js diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json index e4eaabaa5b0..ff4482b1fdc 100644 --- a/deps/npm/node_modules/npm-registry-fetch/package.json +++ b/deps/npm/node_modules/npm-registry-fetch/package.json @@ -1,22 +1,25 @@ { "name": "npm-registry-fetch", - "version": "11.0.0", + "version": "12.0.1", "description": "Fetch-based http client for use with npm registry APIs", - "main": "index.js", + "main": "lib", "files": [ - "*.js" + "bin", + "lib" ], "scripts": { "eslint": "eslint", - "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", "prepublishOnly": "git push origin --follow-tags", "preversion": "npm test", "postversion": "npm publish", "test": "tap", - "posttest": "npm run lint --", + "posttest": "npm run lint", "npmclilint": "npmcli-lint", - "postsnap": "npm run lintfix --" + "postsnap": "npm run lintfix --", + "postlint": "npm-template-check", + "snap": "tap" }, "repository": "https://github.com/npm/npm-registry-fetch", "keywords": [ @@ -24,14 +27,10 @@ "registry", "fetch" ], - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org", - "twitter": "maybekatz" - }, + "author": "GitHub Inc.", "license": "ISC", "dependencies": { - "make-fetch-happen": "^9.0.1", + "make-fetch-happen": "^10.0.0", "minipass": "^3.1.3", "minipass-fetch": "^1.3.0", "minipass-json-stream": "^1.0.1", @@ -39,7 +38,7 @@ "npm-package-arg": "^8.0.0" }, "devDependencies": { - "@npmcli/lint": "^1.0.1", + "@npmcli/template-oss": "^2.5.1", "cacache": "^15.0.0", "nock": "^13.1.0", "npmlog": "^4.1.2", @@ -52,6 +51,9 @@ "test-ignore": "test[\\\\/](util|cache)[\\\\/]" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16" + }, + "templateOSS": { + "version": "2.5.1" } } diff --git a/deps/npm/node_modules/object-assign/index.js b/deps/npm/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf8890b..00000000000 --- a/deps/npm/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/deps/npm/node_modules/object-assign/package.json b/deps/npm/node_modules/object-assign/package.json deleted file mode 100644 index 503eb1e6d0f..00000000000 --- a/deps/npm/node_modules/object-assign/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "object-assign", - "version": "4.1.1", - "description": "ES2015 `Object.assign()` ponyfill", - "license": "MIT", - "repository": "sindresorhus/object-assign", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava", - "bench": "matcha bench.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - } -} diff --git a/deps/npm/node_modules/object-assign/readme.md b/deps/npm/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c77..00000000000 --- a/deps/npm/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index d0fe0a065b4..ffbc067f68d 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "12.0.2", + "version": "12.0.3", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", "bin": { @@ -46,7 +46,7 @@ "npm-package-arg": "^8.0.1", "npm-packlist": "^3.0.0", "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^11.0.0", + "npm-registry-fetch": "^12.0.0", "promise-retry": "^2.0.1", "read-package-json-fast": "^2.0.1", "rimraf": "^3.0.2", diff --git a/deps/npm/node_modules/socks-proxy-agent/package.json b/deps/npm/node_modules/socks-proxy-agent/package.json index a6b7efa89bc..460043188eb 100644 --- a/deps/npm/node_modules/socks-proxy-agent/package.json +++ b/deps/npm/node_modules/socks-proxy-agent/package.json @@ -1,9 +1,9 @@ { "name": "socks-proxy-agent", - "version": "6.1.0", + "version": "6.1.1", "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", "main": "dist/index", - "typings": "dist/index", + "typings": "dist/index.d.ts", "files": [ "dist" ], diff --git a/deps/npm/node_modules/spdx-license-ids/index.json b/deps/npm/node_modules/spdx-license-ids/index.json index 7c498132d46..a2f18e40160 100644 --- a/deps/npm/node_modules/spdx-license-ids/index.json +++ b/deps/npm/node_modules/spdx-license-ids/index.json @@ -135,12 +135,14 @@ "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", + "COIL-1.0", "CPAL-1.0", "CPL-1.0", "CPOL-1.02", "CUA-OPL-1.0", "Caldera", "ClArtistic", + "Community-Spec-1.0", "Condor-1.1", "Crossword", "CrystalStacker", @@ -164,6 +166,7 @@ "Entessa", "ErlPL-1.1", "Eurosym", + "FDK-AAC", "FSFAP", "FSFUL", "FSFULLR", @@ -245,6 +248,7 @@ "LiLiQ-Rplus-1.1", "Libpng", "Linux-OpenIB", + "Linux-man-pages-copyleft", "MIT", "MIT-0", "MIT-CMU", diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json index 1d696a7107a..61b10edc24c 100644 --- a/deps/npm/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/spdx-license-ids/package.json @@ -1,6 +1,6 @@ { "name": "spdx-license-ids", - "version": "3.0.10", + "version": "3.0.11", "description": "A list of SPDX license identifiers", "repository": "jslicense/spdx-license-ids", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", @@ -27,12 +27,11 @@ "oss" ], "devDependencies": { - "@shinnn/eslint-config": "^6.8.7", - "chalk": "^2.4.1", - "eslint": "^5.10.0", - "get-spdx-license-ids": "^2.1.0", + "@shinnn/eslint-config": "^7.0.0", + "eslint": "^8.2.0", + "eslint-formatter-codeframe": "^7.32.1", "rmfr": "^2.0.0", - "tape": "^4.9.1" + "tape": "^5.3.1" }, "eslintConfig": { "extends": "@shinnn" diff --git a/deps/npm/node_modules/wide-align/LICENSE b/deps/npm/node_modules/wide-align/LICENSE index f4be44d881b..f4be44d881b 100644..100755 --- a/deps/npm/node_modules/wide-align/LICENSE +++ b/deps/npm/node_modules/wide-align/LICENSE diff --git a/deps/npm/node_modules/wide-align/align.js b/deps/npm/node_modules/wide-align/align.js index 4f94ca4cde1..4f94ca4cde1 100644..100755 --- a/deps/npm/node_modules/wide-align/align.js +++ b/deps/npm/node_modules/wide-align/align.js diff --git a/deps/npm/node_modules/wide-align/package.json b/deps/npm/node_modules/wide-align/package.json index 1c31f9984e8..2dd27074c77 100644..100755 --- a/deps/npm/node_modules/wide-align/package.json +++ b/deps/npm/node_modules/wide-align/package.json @@ -1,11 +1,10 @@ { "name": "wide-align", - "version": "1.1.3", + "version": "1.1.5", "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", "main": "align.js", "scripts": { - "test": "tap --coverage test/*.js", - "version": "perl -pi -e 's/^( \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json" + "test": "tap --coverage test/*.js" }, "keywords": [ "wide", @@ -21,11 +20,12 @@ "type": "git", "url": "https://github.com/iarna/wide-align" }, + "//": "But not version 5 of string-width, as that's ESM only", "dependencies": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" }, "devDependencies": { - "tap": "10 || 11 || 12" + "tap": "*" }, "files": [ "align.js" diff --git a/deps/npm/package.json b/deps/npm/package.json index 508f6158471..10688636e66 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "8.3.2", + "version": "8.4.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -55,7 +55,7 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^4.2.1", + "@npmcli/arborist": "^4.3.0", "@npmcli/ci-detect": "^1.4.0", "@npmcli/config": "^2.4.0", "@npmcli/map-workspaces": "^2.0.0", @@ -69,28 +69,28 @@ "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", - "cli-table3": "^0.6.0", + "cli-table3": "^0.6.1", "columnify": "~1.5.4", "fastest-levenshtein": "^1.0.12", "glob": "^7.2.0", - "graceful-fs": "^4.2.8", + "graceful-fs": "^4.2.9", "hosted-git-info": "^4.1.0", "ini": "^2.0.0", "init-package-json": "^2.0.5", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", - "libnpmaccess": "^5.0.0", + "libnpmaccess": "^5.0.1", "libnpmdiff": "^3.0.0", - "libnpmexec": "^3.0.2", + "libnpmexec": "^3.0.3", "libnpmfund": "^2.0.2", - "libnpmhook": "^7.0.0", - "libnpmorg": "^3.0.0", + "libnpmhook": "^7.0.1", + "libnpmorg": "^3.0.1", "libnpmpack": "^3.0.1", - "libnpmpublish": "^5.0.0", - "libnpmsearch": "^4.0.0", - "libnpmteam": "^3.0.0", + "libnpmpublish": "^5.0.1", + "libnpmsearch": "^4.0.1", + "libnpmteam": "^3.0.1", "libnpmversion": "^2.0.2", - "make-fetch-happen": "^9.1.0", + "make-fetch-happen": "^10.0.0", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -102,12 +102,12 @@ "npm-install-checks": "^4.0.0", "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.1", - "npm-profile": "^5.0.3", - "npm-registry-fetch": "^11.0.0", + "npm-profile": "^6.0.0", + "npm-registry-fetch": "^12.0.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.0", "opener": "^1.5.2", - "pacote": "^12.0.2", + "pacote": "^12.0.3", "parse-conflict-json": "^2.0.1", "proc-log": "^1.0.0", "qrcode-terminal": "^0.12.0", diff --git a/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs b/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs index c1316e04d7a..2bcf58cb491 100644 --- a/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs +++ b/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs @@ -42,6 +42,17 @@ npm {CWD} ` +exports[`smoke-tests/index.js TAP npm ci > should throw mismatch deps in lock file error 1`] = ` +npm ERR! \`npm ci\` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with \`npm install\` before continuing. +npm ERR! +npm ERR! Invalid: lock file's abbrev@1.0.4 does not satisfy abbrev@1.1.1 +npm ERR! + +npm ERR! A complete log of this run can be found in: + + +` + exports[`smoke-tests/index.js TAP npm diff > should have expected diff output 1`] = ` diff --git a/package.json b/package.json index v1.0.4..v1.1.1 100644 diff --git a/deps/npm/tap-snapshots/test/lib/commands/ci.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/ci.js.test.cjs new file mode 100644 index 00000000000..d6a7471778a --- /dev/null +++ b/deps/npm/tap-snapshots/test/lib/commands/ci.js.test.cjs @@ -0,0 +1,13 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/commands/ci.js TAP should throw error when ideal inventory mismatches virtual > must match snapshot 1`] = ` +\`npm ci\` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with \`npm install\` before continuing. + +Invalid: lock file's foo@1.0.0 does not satisfy foo@2.0.0 + +` diff --git a/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs index c286ad734e6..ef6baa96661 100644 --- a/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/commands/outdated.js.test.cjs @@ -5,6 +5,12 @@ * Make sure to inspect the output below. Do not ignore changes! */ 'use strict' +exports[`test/lib/commands/outdated.js TAP aliases > should display aliased outdated dep output 1`] = ` + +Package Current Wanted Latest Location Depended by +cat:dog@latest 1.0.0 2.0.0 2.0.0 node_modules/cat tap-testdir-outdated-aliases +` + exports[`test/lib/commands/outdated.js TAP should display outdated deps outdated --all > must match snapshot 1`] = ` Package Current Wanted Latest Location Depended by diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 459c5de8dc2..ab706be89b8 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -1271,6 +1271,8 @@ will also prevent _writing_ \`package-lock.json\` if \`save\` is true. When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use \`npm prune\`. + +This configuration does not affect \`npm ci\`. ` exports[`test/lib/utils/config/definitions.js TAP > config description for package-lock-only 1`] = ` diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index ffa6617328b..58958ebdab9 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -1064,6 +1064,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use \`npm prune\`. +This configuration does not affect \`npm ci\`. + <!-- automatically generated, do not edit manually --> <!-- see lib/utils/config/definitions.js --> diff --git a/deps/npm/tap-snapshots/test/lib/utils/validate-lockfile.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/validate-lockfile.js.test.cjs new file mode 100644 index 00000000000..98a51267b1f --- /dev/null +++ b/deps/npm/tap-snapshots/test/lib/utils/validate-lockfile.js.test.cjs @@ -0,0 +1,35 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/utils/validate-lockfile.js TAP extra inventory items on idealTree > should have missing entries error 1`] = ` +Array [ + "Missing: baz@3.0.0 from lock file", +] +` + +exports[`test/lib/utils/validate-lockfile.js TAP extra inventory items on virtualTree > should have no errors if finding virtualTree extra items 1`] = ` +Array [] +` + +exports[`test/lib/utils/validate-lockfile.js TAP identical inventory for both idealTree and virtualTree > should have no errors on identical inventories 1`] = ` +Array [] +` + +exports[`test/lib/utils/validate-lockfile.js TAP mismatching versions on inventory > should have errors for each mismatching version 1`] = ` +Array [ + "Invalid: lock file's foo@1.0.0 does not satisfy foo@2.0.0", + "Invalid: lock file's bar@2.0.0 does not satisfy bar@3.0.0", +] +` + +exports[`test/lib/utils/validate-lockfile.js TAP missing virtualTree inventory > should have errors for each mismatching version 1`] = ` +Array [ + "Missing: foo@1.0.0 from lock file", + "Missing: bar@2.0.0 from lock file", + "Missing: baz@3.0.0 from lock file", +] +` diff --git a/deps/npm/test/lib/commands/access.js b/deps/npm/test/lib/commands/access.js index 298897e4f5f..c4e6f3167aa 100644 --- a/deps/npm/test/lib/commands/access.js +++ b/deps/npm/test/lib/commands/access.js @@ -75,12 +75,13 @@ t.test('access public on unscoped package', async t => { }) t.test('access public on scoped package', async t => { - t.plan(2) + t.plan(3) const name = '@scoped/npm-access-public-pkg' const { npm } = await loadMockNpm(t, { mocks: { libnpmaccess: { - public: (pkg, { registry }) => { + public: (pkg, { registry, log }) => { + t.ok(log, 'should pass a logger') t.equal(pkg, name, 'should use pkg name ref') t.equal( registry, diff --git a/deps/npm/test/lib/commands/ci.js b/deps/npm/test/lib/commands/ci.js index 537d0784f89..978cd03b877 100644 --- a/deps/npm/test/lib/commands/ci.js +++ b/deps/npm/test/lib/commands/ci.js @@ -19,6 +19,17 @@ t.test('should ignore scripts with --ignore-scripts', async t => { this.reify = () => { REIFY_CALLED = true } + this.buildIdealTree = () => {} + this.virtualTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } + this.idealTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } }, }) @@ -99,6 +110,17 @@ t.test('should use Arborist and run-script', async t => { this.reify = () => { t.ok(true, 'reify is called') } + this.buildIdealTree = () => {} + this.virtualTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } + this.idealTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } }, rimraf: (path, ...args) => { actualRimrafs++ @@ -138,6 +160,17 @@ t.test('should pass flatOptions to Arborist.reify', async t => { this.reify = async (options) => { t.equal(options.production, true, 'should pass flatOptions to Arborist.reify') } + this.buildIdealTree = () => {} + this.virtualTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } + this.idealTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } }, }) const npm = mockNpm({ @@ -199,7 +232,7 @@ t.test('should throw ECIGLOBAL', async t => { }) t.test('should remove existing node_modules before installing', async t => { - t.plan(2) + t.plan(3) const testDir = t.testdir({ node_modules: { 'some-file': 'some contents', @@ -212,12 +245,24 @@ t.test('should remove existing node_modules before installing', async t => { '@npmcli/arborist': function () { this.loadVirtual = () => Promise.resolve(true) this.reify = async (options) => { + t.equal(options.packageLock, true, 'npm ci should never ignore lock') t.equal(options.save, false, 'npm ci should never save') // check if node_modules was removed before reifying const contents = await readdir(testDir) const nodeModules = contents.filter((path) => path.startsWith('node_modules')) t.same(nodeModules, ['node_modules'], 'should only have the node_modules directory') } + this.buildIdealTree = () => {} + this.virtualTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } + this.idealTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } }, }) @@ -231,3 +276,41 @@ t.test('should remove existing node_modules before installing', async t => { await ci.exec(null) }) + +t.test('should throw error when ideal inventory mismatches virtual', async t => { + const CI = t.mock('../../../lib/commands/ci.js', { + '../../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/run-script': ({ event }) => {}, + '@npmcli/arborist': function () { + this.loadVirtual = async () => {} + this.reify = () => {} + this.buildIdealTree = () => {} + this.virtualTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ]), + } + this.idealTree = { + inventory: new Map([ + ['foo', { name: 'foo', version: '2.0.0' }], + ]), + } + }, + }) + + const npm = mockNpm({ + globalDir: 'path/to/node_modules/', + prefix: 'foo', + config: { + global: false, + 'ignore-scripts': true, + }, + }) + const ci = new CI(npm) + + try { + await ci.exec([]) + } catch (err) { + t.matchSnapshot(err.message) + } +}) diff --git a/deps/npm/test/lib/commands/deprecate.js b/deps/npm/test/lib/commands/deprecate.js index 02256d08edb..aa158cca3a1 100644 --- a/deps/npm/test/lib/commands/deprecate.js +++ b/deps/npm/test/lib/commands/deprecate.js @@ -2,12 +2,15 @@ const t = require('tap') let getIdentityImpl = () => 'someperson' let npmFetchBody = null +let npmFetchLog = null const npmFetch = async (uri, opts) => { npmFetchBody = opts.body + npmFetchLog = opts.log } npmFetch.json = async (uri, opts) => { + npmFetchLog = opts.log return { versions: { '1.0.0': {}, @@ -82,7 +85,12 @@ t.test('invalid semver range', async t => { }) t.test('undeprecate', async t => { + t.teardown(() => { + npmFetchBody = null + npmFetchLog = null + }) await deprecate.exec(['foo', '']) + t.ok(npmFetchLog, 'was passed a logger') t.match(npmFetchBody, { versions: { '1.0.0': { deprecated: '' }, @@ -95,9 +103,11 @@ t.test('undeprecate', async t => { t.test('deprecates given range', async t => { t.teardown(() => { npmFetchBody = null + npmFetchLog = null }) await deprecate.exec(['foo@1.0.0', 'this version is deprecated']) + t.ok(npmFetchLog, 'was passed a logger') t.match(npmFetchBody, { versions: { '1.0.0': { diff --git a/deps/npm/test/lib/commands/diff.js b/deps/npm/test/lib/commands/diff.js index ed0702e3784..f73a543cb4c 100644 --- a/deps/npm/test/lib/commands/diff.js +++ b/deps/npm/test/lib/commands/diff.js @@ -61,9 +61,10 @@ const diff = new Diff(npm) t.test('no args', t => { t.test('in a project dir', async t => { - t.plan(3) + t.plan(4) libnpmdiff = async ([a, b], opts) => { + t.ok(opts.log, 'should be passed a logger') t.equal(a, 'foo@latest', 'should have default spec comparison') t.equal(b, `file:${fooPath}`, 'should compare to cwd') t.match(opts, npm.flatOptions, 'should forward flat options') diff --git a/deps/npm/test/lib/commands/dist-tag.js b/deps/npm/test/lib/commands/dist-tag.js index 756a09d7de0..b83c30e9c64 100644 --- a/deps/npm/test/lib/commands/dist-tag.js +++ b/deps/npm/test/lib/commands/dist-tag.js @@ -43,6 +43,7 @@ const routeMap = { // XXX overriding this does not appear to do anything, adding t.plan to things // that use it fails the test let npmRegistryFetchMock = (url, opts) => { + npmRegistryFetchLog = opts.log if (url === '/-/package/foo/dist-tags') { throw new Error('no package found') } @@ -50,7 +51,11 @@ let npmRegistryFetchMock = (url, opts) => { return routeMap[url] } -npmRegistryFetchMock.json = async (url, opts) => routeMap[url] +let npmRegistryFetchLog +npmRegistryFetchMock.json = async (url, opts) => { + npmRegistryFetchLog = opts.log + return routeMap[url] +} const logger = (...msgs) => { for (const msg of [...msgs]) { @@ -81,6 +86,10 @@ const npm = mockNpm({ }) const distTag = new DistTag(npm) +t.afterEach(() => { + npmRegistryFetchLog = null +}) + t.test('ls in current package', async t => { npm.prefix = t.testdir({ 'package.json': JSON.stringify({ @@ -88,6 +97,7 @@ t.test('ls in current package', async t => { }), }) await distTag.exec(['ls']) + t.ok(npmRegistryFetchLog, 'is passed a logger') t.matchSnapshot( result, 'should list available tags for current package' @@ -289,6 +299,7 @@ t.test('add new tag', async t => { }) npmRegistryFetchMock = async (url, opts) => { + t.ok(opts.log, 'is passed a logger') t.equal(opts.method, 'PUT', 'should trigger request to add new tag') t.equal(opts.body, '7.7.7', 'should point to expected version') } @@ -355,6 +366,7 @@ t.test('remove existing tag', async t => { } npm.prefix = t.testdir({}) await distTag.exec(['rm', '@scoped/another', 'c']) + t.ok(npmRegistryFetchLog, 'is passed a logger') t.matchSnapshot(log, 'should log remove info') t.matchSnapshot(result, 'should return success msg') }) diff --git a/deps/npm/test/lib/commands/hook.js b/deps/npm/test/lib/commands/hook.js index cd4b3878728..a4eee711fe8 100644 --- a/deps/npm/test/lib/commands/hook.js +++ b/deps/npm/test/lib/commands/hook.js @@ -78,7 +78,8 @@ t.test('npm hook add', async t => { await hook.exec(['add', 'semver', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { pkg: 'semver', @@ -101,7 +102,8 @@ t.test('npm hook add - unicode output', async t => { await hook.exec(['add', 'semver', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { pkg: 'semver', @@ -124,7 +126,8 @@ t.test('npm hook add - json output', async t => { await hook.exec(['add', '@npmcli', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { pkg: '@npmcli', @@ -156,7 +159,8 @@ t.test('npm hook add - parseable output', async t => { await hook.exec(['add', '@npmcli', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { pkg: '@npmcli', @@ -188,7 +192,8 @@ t.test('npm hook add - silent output', async t => { await hook.exec(['add', '@npmcli', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { pkg: '@npmcli', @@ -209,7 +214,8 @@ t.test('npm hook ls', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -234,7 +240,8 @@ t.test('npm hook ls, no results', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -263,7 +270,8 @@ t.test('npm hook ls, single result', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -286,7 +294,8 @@ t.test('npm hook ls - json output', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -331,7 +340,8 @@ t.test('npm hook ls - parseable output', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -361,7 +371,8 @@ t.test('npm hook ls - silent output', async t => { await hook.exec(['ls']) - t.strictSame( + t.ok(hookArgs.log, 'is passed a logger') + t.match( hookArgs, { ...npm.flatOptions, @@ -380,7 +391,8 @@ t.test('npm hook rm', async t => { await hook.exec(['rm', '1']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -401,7 +413,8 @@ t.test('npm hook rm - unicode output', async t => { await hook.exec(['rm', '1']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -422,7 +435,8 @@ t.test('npm hook rm - silent output', async t => { await hook.exec(['rm', '1']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -443,7 +457,8 @@ t.test('npm hook rm - json output', async t => { await hook.exec(['rm', '1']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -473,7 +488,8 @@ t.test('npm hook rm - parseable output', async t => { await hook.exec(['rm', '1']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -499,7 +515,8 @@ t.test('npm hook update', async t => { await hook.exec(['update', '1', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -522,7 +539,8 @@ t.test('npm hook update - unicode', async t => { await hook.exec(['update', '1', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -545,7 +563,8 @@ t.test('npm hook update - json output', async t => { await hook.exec(['update', '1', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -577,7 +596,8 @@ t.test('npm hook update - parseable output', async t => { await hook.exec(['update', '1', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', @@ -607,7 +627,8 @@ t.test('npm hook update - silent output', async t => { await hook.exec(['update', '1', 'https://google.com', 'some-secret']) - t.strictSame( + t.ok(hookArgs.opts.log, 'is passed a logger') + t.match( hookArgs, { id: '1', diff --git a/deps/npm/test/lib/commands/logout.js b/deps/npm/test/lib/commands/logout.js index ee01e7500d1..1a1fbb785c8 100644 --- a/deps/npm/test/lib/commands/logout.js +++ b/deps/npm/test/lib/commands/logout.js @@ -31,7 +31,7 @@ t.afterEach(() => { }) t.test('token logout', async t => { - t.plan(5) + t.plan(6) flatOptions['//registry.npmjs.org/:_authToken'] = '@foo/' @@ -62,7 +62,8 @@ t.test('token logout', async t => { await logout.exec([]) - t.same( + t.ok(result.opts.log, 'should pass a logger') + t.match( result, { url: '/-/user/token/%40foo%2F', @@ -91,7 +92,7 @@ t.test('token scoped logout', async t => { config.save = null }) - t.plan(7) + t.plan(8) flatOptions['//diff-registry.npmjs.com/:_authToken'] = '@bar/' flatOptions['//registry.npmjs.org/:_authToken'] = '@foo/' @@ -132,7 +133,8 @@ t.test('token scoped logout', async t => { await logout.exec([]) - t.same( + t.ok(result.opts.log, 'should pass a logger') + t.match( result, { url: '/-/user/token/%40bar%2F', @@ -202,7 +204,7 @@ t.test('ignore invalid scoped registry config', async t => { config.delete = null config.save = null }) - t.plan(4) + t.plan(5) flatOptions['//registry.npmjs.org/:_authToken'] = '@foo/' config.scope = '@myscope' @@ -234,7 +236,8 @@ t.test('ignore invalid scoped registry config', async t => { await logout.exec([]) - t.same( + t.ok(result.opts.log, 'should pass a logger') + t.match( result, { url: '/-/user/token/%40foo%2F', diff --git a/deps/npm/test/lib/commands/outdated.js b/deps/npm/test/lib/commands/outdated.js index 245e93039c3..3bf42b10a26 100644 --- a/deps/npm/test/lib/commands/outdated.js +++ b/deps/npm/test/lib/commands/outdated.js @@ -609,3 +609,28 @@ t.test('workspaces', async t => { t.matchSnapshot(logs, 'should display missing deps when filtering by ws') }) + +t.test('aliases', async t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'display-aliases', + version: '1.0.0', + dependencies: { + cat: 'npm:dog@latest', + }, + }), + node_modules: { + cat: { + 'package.json': JSON.stringify({ + name: 'dog', + version: '1.0.0', + }), + }, + }, + }) + + await outdated(testDir, {}).exec([]) + + t.matchSnapshot(logs, 'should display aliased outdated dep output') + t.equal(process.exitCode, 1) +}) diff --git a/deps/npm/test/lib/commands/owner.js b/deps/npm/test/lib/commands/owner.js index b5d4d158428..a32a3df9b7d 100644 --- a/deps/npm/test/lib/commands/owner.js +++ b/deps/npm/test/lib/commands/owner.js @@ -51,13 +51,14 @@ t.test('owner no args', async t => { }) t.test('owner ls no args', async t => { - t.plan(4) + t.plan(5) result = '' readPackageNameResponse = '@npmcli/map-workspaces' pacote.packument = async (spec, opts) => { t.equal(spec.name, '@npmcli/map-workspaces', 'should use expect pkg name') + t.ok(opts.log, 'is passed a logger') t.match( opts, { @@ -172,10 +173,11 @@ t.test('owner ls <pkg> no maintainers', async t => { }) t.test('owner add <user> <pkg>', async t => { - t.plan(8) + t.plan(11) result = '' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { t.ok('should request user info') @@ -216,6 +218,7 @@ t.test('owner add <user> <pkg>', async t => { } } pacote.packument = async (spec, opts) => { + t.ok(opts.log, 'is passed a logger') t.equal(spec.name, '@npmcli/map-workspaces', 'should use expect pkg name') t.match( opts, @@ -244,6 +247,7 @@ t.test('owner add <user> cwd package', async t => { result = '' readPackageNameResponse = '@npmcli/map-workspaces' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { return { @@ -273,7 +277,7 @@ t.test('owner add <user> cwd package', async t => { }) t.test('owner add <user> <pkg> already an owner', async t => { - t.plan(2) + t.plan(3) result = '' log.info = (title, msg) => { @@ -285,6 +289,7 @@ t.test('owner add <user> <pkg> already an owner', async t => { ) } npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:ruyadorno') { return { @@ -316,6 +321,7 @@ t.test('owner add <user> <pkg> fails to retrieve user', async t => { result = '' readPackageNameResponse = npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve borked user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { return { ok: false } @@ -346,6 +352,7 @@ t.test('owner add <user> <pkg> fails to retrieve user', async t => { t.test('owner add <user> <pkg> fails to PUT updates', async t => { result = '' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { return { @@ -382,7 +389,7 @@ t.test('owner add <user> <pkg> fails to PUT updates', async t => { }) t.test('owner add <user> <pkg> fails to retrieve user info', async t => { - t.plan(3) + t.plan(4) result = '' log.error = (title, msg) => { @@ -390,6 +397,7 @@ t.test('owner add <user> <pkg> fails to retrieve user info', async t => { t.equal(msg, 'Error getting user data for foo') } npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { throw Object.assign( @@ -421,6 +429,7 @@ t.test('owner add <user> <pkg> fails to retrieve user info', async t => { t.test('owner add <user> <pkg> no previous maintainers property from server', async t => { result = '' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { return { @@ -487,10 +496,11 @@ t.test('owner add <user> no cwd package', async t => { }) t.test('owner rm <user> <pkg>', async t => { - t.plan(8) + t.plan(11) result = '' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:ruyadorno') { t.ok('should request user info') @@ -524,6 +534,7 @@ t.test('owner rm <user> <pkg>', async t => { } } pacote.packument = async (spec, opts) => { + t.ok(opts.log, 'is passed a logger') t.equal(spec.name, '@npmcli/map-workspaces', 'should use expect pkg name') t.match( opts, @@ -549,7 +560,7 @@ t.test('owner rm <user> <pkg>', async t => { }) t.test('owner rm <user> <pkg> not a current owner', async t => { - t.plan(2) + t.plan(3) result = '' log.info = (title, msg) => { @@ -557,6 +568,7 @@ t.test('owner rm <user> <pkg> not a current owner', async t => { t.equal(msg, 'Not a package owner: foo', 'should log.info not a package owner msg') } npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:foo') { return { @@ -590,6 +602,7 @@ t.test('owner rm <user> cwd package', async t => { result = '' readPackageNameResponse = '@npmcli/map-workspaces' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:ruyadorno') { return { @@ -622,6 +635,7 @@ t.test('owner rm <user> only user', async t => { result = '' readPackageNameResponse = 'ipt' npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') // retrieve user info from couchdb request if (uri === '/-/user/org.couchdb.user:ruyadorno') { return { diff --git a/deps/npm/test/lib/commands/ping.js b/deps/npm/test/lib/commands/ping.js index f808e0ac3ba..19ba9d586b7 100644 --- a/deps/npm/test/lib/commands/ping.js +++ b/deps/npm/test/lib/commands/ping.js @@ -2,12 +2,13 @@ const t = require('tap') const { fake: mockNpm } = require('../../fixtures/mock-npm') t.test('pings', async t => { - t.plan(6) + t.plan(7) const registry = 'https://registry.npmjs.org' let noticeCalls = 0 const Ping = t.mock('../../../lib/commands/ping.js', { '../../../lib/utils/ping.js': function (spec) { + t.ok(spec.log, 'is passed a logger') t.equal(spec.registry, registry, 'passes flatOptions') return {} }, @@ -35,13 +36,14 @@ t.test('pings', async t => { }) t.test('pings and logs details', async t => { - t.plan(8) + t.plan(9) const registry = 'https://registry.npmjs.org' const details = { extra: 'data' } let noticeCalls = 0 const Ping = t.mock('../../../lib/commands/ping.js', { '../../../lib/utils/ping.js': function (spec) { + t.ok(spec.log, 'is passed a logger') t.equal(spec.registry, registry, 'passes flatOptions') return details }, @@ -73,13 +75,14 @@ t.test('pings and logs details', async t => { }) t.test('pings and returns json', async t => { - t.plan(9) + t.plan(10) const registry = 'https://registry.npmjs.org' const details = { extra: 'data' } let noticeCalls = 0 const Ping = t.mock('../../../lib/commands/ping.js', { '../../../lib/utils/ping.js': function (spec) { + t.ok(spec.log, 'is passed a logger') t.equal(spec.registry, registry, 'passes flatOptions') return details }, diff --git a/deps/npm/test/lib/commands/publish.js b/deps/npm/test/lib/commands/publish.js index 2a591fd4c75..52d4c1b3429 100644 --- a/deps/npm/test/lib/commands/publish.js +++ b/deps/npm/test/lib/commands/publish.js @@ -25,7 +25,7 @@ t.test( /* eslint-disable-next-line max-len */ 'should publish with libnpmpublish, passing through flatOptions and respecting publishConfig.registry', async t => { - t.plan(6) + t.plan(7) const registry = 'https://some.registry' const publishConfig = { registry } @@ -59,6 +59,7 @@ t.test( t.match(manifest, { name: 'my-cool-pkg', version: '1.0.0' }, 'gets manifest') t.type(tarData, Buffer, 'tarData is a buffer') t.ok(opts, 'gets opts object') + t.ok(opts.log, 'gets passed a logger') t.same(opts.customValue, true, 'flatOptions values are passed through') t.same(opts.registry, registry, 'publishConfig.registry is passed through') }, @@ -81,7 +82,7 @@ t.test( ) t.test('re-loads publishConfig.registry if added during script process', async t => { - t.plan(5) + t.plan(6) const registry = 'https://some.registry' const publishConfig = { registry } const testDir = t.testdir({ @@ -112,6 +113,7 @@ t.test('re-loads publishConfig.registry if added during script process', async t t.match(manifest, { name: 'my-cool-pkg', version: '1.0.0' }, 'gets manifest') t.type(tarData, Buffer, 'tarData is a buffer') t.ok(opts, 'gets opts object') + t.ok(opts.log, 'gets passed a logger') t.same(opts.registry, registry, 'publishConfig.registry is passed through') }, }, @@ -292,7 +294,7 @@ t.test('throws when invalid tag', async t => { }) t.test('can publish a tarball', async t => { - t.plan(3) + t.plan(4) const testDir = t.testdir({ tarball: {}, @@ -317,6 +319,7 @@ t.test('can publish a tarball', async t => { const Publish = t.mock('../../../lib/commands/publish.js', { libnpmpublish: { publish: (manifest, tarData, opts) => { + t.ok(opts.log, 'gets passed a logger') t.match( manifest, { @@ -412,7 +415,7 @@ t.test('should check auth for scope specific registry', async t => { }) t.test('should use auth for scope specific registry', async t => { - t.plan(3) + t.plan(4) const registry = 'https://some.registry' const testDir = t.testdir({ 'package.json': JSON.stringify( @@ -429,6 +432,7 @@ t.test('should use auth for scope specific registry', async t => { libnpmpublish: { publish: (manifest, tarData, opts) => { t.ok(opts, 'gets opts object') + t.ok(opts.log, 'gets passed a logger') t.same(opts['@npm:registry'], registry, 'scope specific registry is passed through') }, }, @@ -446,7 +450,7 @@ t.test('should use auth for scope specific registry', async t => { }) t.test('read registry only from publishConfig', async t => { - t.plan(3) + t.plan(4) const registry = 'https://some.registry' const publishConfig = { registry } @@ -465,6 +469,7 @@ t.test('read registry only from publishConfig', async t => { const Publish = t.mock('../../../lib/commands/publish.js', { libnpmpublish: { publish: (manifest, tarData, opts) => { + t.ok(opts.log, 'gets passed a logger') t.match(manifest, { name: 'my-cool-pkg', version: '1.0.0' }, 'gets manifest') t.same(opts.registry, registry, 'publishConfig is passed through') }, @@ -481,7 +486,7 @@ t.test('read registry only from publishConfig', async t => { }) t.test('able to publish after if encountered multiple configs', async t => { - t.plan(2) + t.plan(3) const registry = 'https://some.registry' const tag = 'better-tag' @@ -510,6 +515,7 @@ t.test('able to publish after if encountered multiple configs', async t => { const Publish = t.mock('../../../lib/commands/publish.js', { libnpmpublish: { publish: (manifest, tarData, opts) => { + t.ok(opts.log, 'gets passed a logger') t.same(opts.defaultTag, tag, 'gets option for expected tag') }, }, @@ -748,7 +754,7 @@ t.test('private workspaces', async t => { if (manifest.private) { throw new Error('ERR') } - + t.ok(opts.log, 'gets passed a logger') publishes.push(manifest) }, }, diff --git a/deps/npm/test/lib/commands/star.js b/deps/npm/test/lib/commands/star.js index 9a49036422d..2f4ddc9dc64 100644 --- a/deps/npm/test/lib/commands/star.js +++ b/deps/npm/test/lib/commands/star.js @@ -42,17 +42,20 @@ t.test('no args', async t => { }) t.test('star a package', async t => { - t.plan(4) + t.plan(6) const pkgName = '@npmcli/arborist' - npmFetch.json = async (uri, opts) => ({ - _id: pkgName, - _rev: 'hash', - users: ( - opts.method === 'PUT' - ? { foo: true } - : {} - ), - }) + npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') + return { + _id: pkgName, + _rev: 'hash', + users: ( + opts.method === 'PUT' + ? { foo: true } + : {} + ), + } + } log.info = (title, msg, id) => { t.equal(title, 'star', 'should use expected title') t.equal(msg, 'starring', 'should use expected msg') @@ -67,17 +70,20 @@ t.test('star a package', async t => { }) t.test('unstar a package', async t => { - t.plan(4) + t.plan(6) const pkgName = '@npmcli/arborist' config['star.unstar'] = true - npmFetch.json = async (uri, opts) => ({ - _id: pkgName, - _rev: 'hash', - ...(opts.method === 'PUT' - ? {} - : { foo: true } - ), - }) + npmFetch.json = async (uri, opts) => { + t.ok(opts.log, 'is passed a logger') + return { + _id: pkgName, + _rev: 'hash', + ...(opts.method === 'PUT' + ? {} + : { foo: true } + ), + } + } log.info = (title, msg, id) => { t.equal(title, 'unstar', 'should use expected title') t.equal(msg, 'unstarring', 'should use expected msg') diff --git a/deps/npm/test/lib/utils/validate-lockfile.js b/deps/npm/test/lib/utils/validate-lockfile.js new file mode 100644 index 00000000000..25939c5f89c --- /dev/null +++ b/deps/npm/test/lib/utils/validate-lockfile.js @@ -0,0 +1,82 @@ +const t = require('tap') +const validateLockfile = require('../../../lib/utils/validate-lockfile.js') + +t.test('identical inventory for both idealTree and virtualTree', async t => { + t.matchSnapshot( + validateLockfile( + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ]), + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ]) + ), + 'should have no errors on identical inventories' + ) +}) + +t.test('extra inventory items on idealTree', async t => { + t.matchSnapshot( + validateLockfile( + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ]), + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ['baz', { name: 'baz', version: '3.0.0' }], + ]) + ), + 'should have missing entries error' + ) +}) + +t.test('extra inventory items on virtualTree', async t => { + t.matchSnapshot( + validateLockfile( + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ['baz', { name: 'baz', version: '3.0.0' }], + ]), + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ]) + ), + 'should have no errors if finding virtualTree extra items' + ) +}) + +t.test('mismatching versions on inventory', async t => { + t.matchSnapshot( + validateLockfile( + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ]), + new Map([ + ['foo', { name: 'foo', version: '2.0.0' }], + ['bar', { name: 'bar', version: '3.0.0' }], + ]) + ), + 'should have errors for each mismatching version' + ) +}) + +t.test('missing virtualTree inventory', async t => { + t.matchSnapshot( + validateLockfile( + new Map([]), + new Map([ + ['foo', { name: 'foo', version: '1.0.0' }], + ['bar', { name: 'bar', version: '2.0.0' }], + ['baz', { name: 'baz', version: '3.0.0' }], + ]) + ), + 'should have errors for each mismatching version' + ) +}) |