From 2b7c4b4afe2df070443e3be23857a215d8f90c8f Mon Sep 17 00:00:00 2001
From: npm team Note that this operation transforms the dependency tree, but will never
result in new modules being installed. Using Note that by default Description
npm find-dupes
will run the command in --dry-run
mode.npm dedupe
will not update the semver values of direct
+dependencies in your project package.json
, if you want to also update
+values in package.json
you can run: npm dedupe --save
(or add the
+save=true
option to a configuration file
+to make that the default behavior).Configuration
diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html
index 3ad752bcac4c97..341a3fee9da0e6 100644
--- a/deps/npm/docs/output/commands/npm-ls.html
+++ b/deps/npm/docs/output/commands/npm-ls.html
@@ -160,7 +160,7 @@ Description
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard
in npm's source tree will show:
npm@8.3.1 /path/to/npm
+npm@8.3.2 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html
index 065feee3eb382b..6185df91e8d127 100644
--- a/deps/npm/docs/output/commands/npm-update.html
+++ b/deps/npm/docs/output/commands/npm-update.html
@@ -160,6 +160,11 @@ Description
packages.
If no package name is specified, all packages in the specified location (global
or local) will be updated.
+Note that by default npm update
will not update the semver values of direct
+dependencies in your project package.json
, if you want to also update
+values in package.json
you can run: npm update --save
(or add the
+save=true
option to a configuration file
+to make that the default behavior).
Example
For the examples below, assume that the current package is app
and it depends
on dependencies, dep1
(dep2
, .. etc.). The published versions of dep1
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 044d90faec666b..ab49c472ab6075 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -149,7 +149,7 @@
Table of contents
npm <command> [args]
Version
-8.3.1
+8.3.2
Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html
index f3db847b48abf1..b96eecd3902657 100644
--- a/deps/npm/docs/output/using-npm/config.html
+++ b/deps/npm/docs/output/using-npm/config.html
@@ -1210,12 +1210,14 @@
registry
save
-- Default: true
+- Default:
true
unless when using npm update
or npm dedupe
where it
+defaults to false
- Type: Boolean
-Save installed packages to a package.json file as dependencies.
+Save installed packages to a package.json
file as dependencies.
When used with the npm rm
command, removes the dependency from
-package.json.
+package.json
.
+Will also prevent writing to package-lock.json
if set to false
.
save-bundle
diff --git a/deps/npm/lib/base-command.js b/deps/npm/lib/base-command.js
index ad261b5148bd29..f67f99f36367c1 100644
--- a/deps/npm/lib/base-command.js
+++ b/deps/npm/lib/base-command.js
@@ -1,4 +1,7 @@
// Base class for npm commands
+
+const { relative } = require('path')
+
const usageUtil = require('./utils/usage.js')
const ConfigDefinitions = require('./utils/config/definitions.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')
@@ -78,9 +81,14 @@ class BaseCommand {
this.includeWorkspaceRoot = false
}
+ const relativeFrom = relative(this.npm.localPrefix, process.cwd()).startsWith('..')
+ ? this.npm.localPrefix
+ : process.cwd()
+
const ws = await getWorkspaces(filters, {
path: this.npm.localPrefix,
includeWorkspaceRoot: this.includeWorkspaceRoot,
+ relativeFrom,
})
this.workspaces = ws
this.workspaceNames = [...ws.keys()]
diff --git a/deps/npm/lib/commands/dedupe.js b/deps/npm/lib/commands/dedupe.js
index cc4b119d09d2ab..1c270249adb3fb 100644
--- a/deps/npm/lib/commands/dedupe.js
+++ b/deps/npm/lib/commands/dedupe.js
@@ -13,6 +13,7 @@ class Dedupe extends ArboristWorkspaceCmd {
'legacy-bundling',
'strict-peer-deps',
'package-lock',
+ 'save',
'omit',
'ignore-scripts',
'audit',
@@ -29,6 +30,12 @@ class Dedupe extends ArboristWorkspaceCmd {
throw er
}
+ // In the context of `npm dedupe` the save
+ // config value should default to `false`
+ const save = this.npm.config.isDefault('save')
+ ? false
+ : this.npm.config.get('save')
+
const dryRun = this.npm.config.get('dry-run')
const where = this.npm.prefix
const opts = {
@@ -36,6 +43,7 @@ class Dedupe extends ArboristWorkspaceCmd {
log,
path: where,
dryRun,
+ save,
workspaces: this.workspaceNames,
}
const arb = new Arborist(opts)
diff --git a/deps/npm/lib/commands/update.js b/deps/npm/lib/commands/update.js
index a8bbc4c969251d..c55d7cf575d88e 100644
--- a/deps/npm/lib/commands/update.js
+++ b/deps/npm/lib/commands/update.js
@@ -16,6 +16,7 @@ class Update extends ArboristWorkspaceCmd {
'legacy-bundling',
'strict-peer-deps',
'package-lock',
+ 'save',
'omit',
'ignore-scripts',
'audit',
@@ -40,19 +41,27 @@ class Update extends ArboristWorkspaceCmd {
? global
: this.npm.prefix
+ // In the context of `npm update` the save
+ // config value should default to `false`
+ const save = this.npm.config.isDefault('save')
+ ? false
+ : this.npm.config.get('save')
+
if (this.npm.config.get('depth')) {
log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' +
'https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md')
}
- const arb = new Arborist({
+ const opts = {
...this.npm.flatOptions,
log,
path: where,
+ save,
workspaces: this.workspaceNames,
- })
+ }
+ const arb = new Arborist(opts)
- await arb.reify({ update })
+ await arb.reify({ ...opts, update })
await reifyFinish(this.npm, arb)
}
}
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index ac8a4e2f6749d5..95d79f0f053253 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -1583,14 +1583,18 @@ define('registry', {
define('save', {
default: true,
+ defaultDescription: `\`true\` unless when using \`npm update\` or
+ \`npm dedupe\` where it defaults to \`false\``,
usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer',
type: Boolean,
short: 'S',
description: `
- Save installed packages to a package.json file as dependencies.
+ Save installed packages to a \`package.json\` file as dependencies.
When used with the \`npm rm\` command, removes the dependency from
- package.json.
+ \`package.json\`.
+
+ Will also prevent writing to \`package-lock.json\` if set to \`false\`.
`,
flatten,
})
diff --git a/deps/npm/lib/workspaces/get-workspaces.js b/deps/npm/lib/workspaces/get-workspaces.js
index a59b5a6c54b70d..0cddae2a462f11 100644
--- a/deps/npm/lib/workspaces/get-workspaces.js
+++ b/deps/npm/lib/workspaces/get-workspaces.js
@@ -5,7 +5,7 @@ const rpj = require('read-package-json-fast')
// Returns an Map of paths to workspaces indexed by workspace name
// { foo => '/path/to/foo' }
-const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => {
+const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom }) => {
// TODO we need a better error to be bubbled up here if this rpj call fails
const pkg = await rpj(resolve(path, 'package.json'))
const workspaces = await mapWorkspaces({ cwd: path, pkg })
@@ -21,8 +21,8 @@ const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => {
for (const filterArg of filters) {
for (const [workspaceName, workspacePath] of workspaces.entries()) {
if (filterArg === workspaceName
- || resolve(path, filterArg) === workspacePath
- || minimatch(workspacePath, `${resolve(path, filterArg)}/*`)) {
+ || resolve(relativeFrom || path, filterArg) === workspacePath
+ || minimatch(workspacePath, `${resolve(relativeFrom || path, filterArg)}/*`)) {
res.set(workspaceName, workspacePath)
}
}
diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1
index 959b3ffb6d0272..cf2734ac96a6e2 100644
--- a/deps/npm/man/man1/npm-dedupe.1
+++ b/deps/npm/man/man1/npm-dedupe.1
@@ -75,6 +75,12 @@ Note that this operation transforms the dependency tree, but will never
result in new modules being installed\.
.P
Using \fBnpm find\-dupes\fP will run the command in \fB\-\-dry\-run\fP mode\.
+.P
+Note that by default \fBnpm dedupe\fP will not update the semver values of direct
+dependencies in your project \fBpackage\.json\fP, if you want to also update
+values in \fBpackage\.json\fP you can run: \fBnpm dedupe \-\-save\fP (or add the
+\fBsave=true\fP option to a npm help configuration file
+to make that the default behavior)\.
.SS Configuration
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 2b0338e3f30867..038eb5e72ddd03 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@8\.3\.1 /path/to/npm
+npm@8\.3\.2 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1
index b5afea48f73c6d..f4c4adf45f7f22 100644
--- a/deps/npm/man/man1/npm-update.1
+++ b/deps/npm/man/man1/npm-update.1
@@ -24,6 +24,12 @@ packages\.
.P
If no package name is specified, all packages in the specified location (global
or local) will be updated\.
+.P
+Note that by default \fBnpm update\fP will not update the semver values of direct
+dependencies in your project \fBpackage\.json\fP, if you want to also update
+values in \fBpackage\.json\fP you can run: \fBnpm update \-\-save\fP (or add the
+\fBsave=true\fP option to a npm help configuration file
+to make that the default behavior)\.
.SS Example
.P
For the examples below, assume that the current package is \fBapp\fP and it depends
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 875c883fcf060e..bdb9becfe23402 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm [args]
.RE
.SS Version
.P
-8\.3\.1
+8\.3\.2
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7
index 2e05f320075441..0e9cbcb1f2a4b2 100644
--- a/deps/npm/man/man7/config.7
+++ b/deps/npm/man/man7/config.7
@@ -1673,16 +1673,19 @@ The base URL of the npm registry\.
.SS \fBsave\fP
.RS 0
.IP \(bu 2
-Default: true
+Default: \fBtrue\fP unless when using \fBnpm update\fP or \fBnpm dedupe\fP where it
+defaults to \fBfalse\fP
.IP \(bu 2
Type: Boolean
.RE
.P
-Save installed packages to a package\.json file as dependencies\.
+Save installed packages to a \fBpackage\.json\fP file as dependencies\.
.P
When used with the \fBnpm rm\fP command, removes the dependency from
-package\.json\.
+\fBpackage\.json\fP\|\.
+.P
+Will also prevent writing to \fBpackage\-lock\.json\fP if set to \fBfalse\fP\|\.
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 899d92ca937cca..f20a554bd5ee8e 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
@@ -41,7 +41,7 @@ const _complete = Symbol('complete')
const _depsSeen = Symbol('depsSeen')
const _depsQueue = Symbol('depsQueue')
const _currentDep = Symbol('currentDep')
-const _updateAll = Symbol('updateAll')
+const _updateAll = Symbol.for('updateAll')
const _mutateTree = Symbol('mutateTree')
const _flagsSuspect = Symbol.for('flagsSuspect')
const _workspaces = Symbol.for('workspaces')
@@ -176,7 +176,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
// public method
async buildIdealTree (options = {}) {
if (this.idealTree) {
- return Promise.resolve(this.idealTree)
+ return this.idealTree
}
// allow the user to set reify options on the ctor as well.
@@ -194,8 +194,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
process.emit('time', 'idealTree')
if (!options.add && !options.rm && !options.update && this[_global]) {
- const er = new Error('global requires add, rm, or update option')
- return Promise.reject(er)
+ throw new Error('global requires add, rm, or update option')
}
// first get the virtual tree, if possible. If there's a lockfile, then
@@ -334,6 +333,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
root.meta.lockfileVersion = defaultLockfileVersion
}
}
+ root.meta.inferFormattingOptions(root.package)
return root
})
@@ -1180,6 +1180,11 @@ This is a one-time fix-up, please be patient...
return true
}
+ // If the edge is a workspace, and it's valid, leave it alone
+ if (edge.to.isWorkspace) {
+ return false
+ }
+
// user explicitly asked to update this package by name, problem
if (this[_updateNames].includes(edge.name)) {
return true
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 547e54ac376700..d5e70323830b61 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js
@@ -58,6 +58,8 @@ const _bundleUnpacked = Symbol('bundleUnpacked')
const _bundleMissing = Symbol('bundleMissing')
const _reifyNode = Symbol.for('reifyNode')
const _extractOrLink = Symbol('extractOrLink')
+const _updateAll = Symbol.for('updateAll')
+const _updateNames = Symbol.for('updateNames')
// defined by rebuild mixin
const _checkBins = Symbol.for('checkBins')
const _symlink = Symbol('symlink')
@@ -1140,21 +1142,33 @@ module.exports = cls => class Reifier extends cls {
// for install failures. Those still end up in the shrinkwrap, so we
// save it first, then prune out the optional trash, and then return it.
- // support save=false option
- if (options.save === false || this[_global] || this[_dryRun]) {
+ const save = !(options.save === false)
+
+ // we check for updates in order to make sure we run save ideal tree
+ // even though save=false since we want `npm update` to be able to
+ // write to package-lock files by default
+ const hasUpdates = this[_updateAll] || this[_updateNames].length
+
+ // we're going to completely skip save ideal tree in case of a global or
+ // dry-run install and also if the save option is set to false, EXCEPT for
+ // update since the expected behavior for npm7+ is for update to
+ // NOT save to package.json, we make that exception since we still want
+ // saveIdealTree to be able to write the lockfile by default.
+ const saveIdealTree = !(
+ (!save && !hasUpdates)
+ || this[_global]
+ || this[_dryRun]
+ )
+
+ if (!saveIdealTree) {
return false
}
process.emit('time', 'reify:save')
const updatedTrees = new Set()
-
- // resolvedAdd is the list of user add requests, but with names added
- // to things like git repos and tarball file/urls. However, if the
- // user requested 'foo@', and we have a foo@file:../foo, then we should
- // end up saving the spec we actually used, not whatever they gave us.
- if (this[_resolvedAdd].length) {
- for (const { name, tree: addTree } of this[_resolvedAdd]) {
+ const updateNodes = nodes => {
+ for (const { name, tree: addTree } of nodes) {
// addTree either the root, or a workspace
const edge = addTree.edgesOut.get(name)
const pkg = addTree.package
@@ -1168,7 +1182,7 @@ module.exports = cls => class Reifier extends cls {
// that we couldn't resolve, this MAY be missing. if we haven't
// blown up by now, it's because it was not a problem, though, so
// just move on.
- if (!child) {
+ if (!child || !addTree.isTop) {
continue
}
@@ -1259,6 +1273,63 @@ module.exports = cls => class Reifier extends cls {
}
}
+ // 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
+ // select nodes from the inventory that are direct deps
+ // of a given package.json (project root or a workspace)
+ // and in ase of using a list of `names`, restrict nodes
+ // to only names that are found in this list
+ const retrieveUpdatedNodes = names => {
+ const filterDirectDependencies = node =>
+ !node.isRoot && node.resolveParent.isRoot
+ && (!names || names.includes(node.name))
+ const directDeps = this.idealTree.inventory
+ .filter(filterDirectDependencies)
+
+ // traverses the list of direct dependencies and collect all nodes
+ // to be updated, since any of them might have changed during reify
+ const nodes = []
+ for (const node of directDeps) {
+ for (const edgeIn of node.edgesIn) {
+ nodes.push({
+ name: node.name,
+ tree: edgeIn.from.target,
+ })
+ }
+ }
+ return nodes
+ }
+
+ if (save) {
+ // when using update all alongside with save, we'll make
+ // sure to refresh every dependency of the root idealTree
+ if (this[_updateAll]) {
+ const nodes = retrieveUpdatedNodes()
+ updateNodes(nodes)
+ } else {
+ // resolvedAdd is the list of user add requests, but with names added
+ // to things like git repos and tarball file/urls. However, if the
+ // user requested 'foo@', and we have a foo@file:../foo, then we should
+ // end up saving the spec we actually used, not whatever they gave us.
+ if (this[_resolvedAdd].length) {
+ updateNodes(this[_resolvedAdd])
+ }
+
+ // if updating given dependencies by name, restrict the list of
+ // nodes to check to only those currently in _updateNames
+ if (this[_updateNames].length) {
+ const nodes = retrieveUpdatedNodes(this[_updateNames])
+ updateNodes(nodes)
+ }
+
+ // grab any from explicitRequests that had deps removed
+ for (const { from: tree } of this.explicitRequests) {
+ updatedTrees.add(tree)
+ }
+ }
+ }
+
// preserve indentation, if possible
const {
[Symbol.for('indent')]: indent,
@@ -1291,15 +1362,12 @@ module.exports = cls => class Reifier extends cls {
await pkgJson.save()
}
- // grab any from explicitRequests that had deps removed
- for (const { from: tree } of this.explicitRequests) {
- updatedTrees.add(tree)
- }
-
- for (const tree of updatedTrees) {
- // refresh the edges so they have the correct specs
- tree.package = tree.package
- promises.push(updatePackageJson(tree))
+ if (save) {
+ for (const tree of updatedTrees) {
+ // refresh the edges so they have the correct specs
+ tree.package = tree.package
+ promises.push(updatePackageJson(tree))
+ }
}
await Promise.all(promises)
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
index a7a68c98c6d6d1..b45fea0ac61112 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
@@ -424,6 +424,18 @@ class Shrinkwrap {
.map(fn => fn && maybeStatFile(fn)))
}
+ inferFormattingOptions (packageJSONData) {
+ // don't use detect-indent, just pick the first line.
+ // if the file starts with {" then we have an indent of '', ie, none
+ // which will default to 2 at save time.
+ const {
+ [Symbol.for('indent')]: indent,
+ [Symbol.for('newline')]: newline,
+ } = packageJSONData
+ this.indent = indent !== undefined ? indent : this.indent
+ this.newline = newline !== undefined ? newline : this.newline
+ }
+
load () {
// we don't need to load package-lock.json except for top of tree nodes,
// only npm-shrinkwrap.json.
@@ -451,15 +463,7 @@ class Shrinkwrap {
return data ? parseJSON(data) : {}
}).then(async data => {
- // don't use detect-indent, just pick the first line.
- // if the file starts with {" then we have an indent of '', ie, none
- // which will default to 2 at save time.
- const {
- [Symbol.for('indent')]: indent,
- [Symbol.for('newline')]: newline,
- } = data
- this.indent = indent !== undefined ? indent : this.indent
- this.newline = newline !== undefined ? newline : this.newline
+ this.inferFormattingOptions(data)
if (!this.hiddenLockfile || !data.packages) {
return data
diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json
index ac2922bc9655d5..493a0a78c5c465 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.0",
+ "version": "4.2.1",
"description": "Manage node_modules trees",
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
@@ -12,7 +12,7 @@
"@npmcli/node-gyp": "^1.0.3",
"@npmcli/package-json": "^1.0.1",
"@npmcli/run-script": "^2.0.0",
- "bin-links": "^2.3.0",
+ "bin-links": "^3.0.0",
"cacache": "^15.0.3",
"common-ancestor-path": "^1.0.1",
"json-parse-even-better-errors": "^2.3.1",
diff --git a/deps/npm/node_modules/bin-links/lib/bin-target.js b/deps/npm/node_modules/bin-links/lib/bin-target.js
index 7ea0c2a96ed686..0629285d5144c4 100644
--- a/deps/npm/node_modules/bin-links/lib/bin-target.js
+++ b/deps/npm/node_modules/bin-links/lib/bin-target.js
@@ -1,9 +1,9 @@
const isWindows = require('./is-windows.js')
const getPrefix = require('./get-prefix.js')
const getNodeModules = require('./get-node-modules.js')
-const {dirname} = require('path')
+const { dirname } = require('path')
-module.exports = ({top, path}) =>
+module.exports = ({ top, path }) =>
!top ? getNodeModules(path) + '/.bin'
- : isWindows ? getPrefix(path)
- : dirname(getPrefix(path)) + '/bin'
+ : isWindows ? getPrefix(path)
+ : dirname(getPrefix(path)) + '/bin'
diff --git a/deps/npm/node_modules/bin-links/lib/check-bin.js b/deps/npm/node_modules/bin-links/lib/check-bin.js
index 45eec8affc92a9..8bbe45188a479c 100644
--- a/deps/npm/node_modules/bin-links/lib/check-bin.js
+++ b/deps/npm/node_modules/bin-links/lib/check-bin.js
@@ -2,53 +2,56 @@
// either rejects or resolves to nothing. return value not relevant.
const isWindows = require('./is-windows.js')
const binTarget = require('./bin-target.js')
-const {resolve, dirname} = require('path')
+const { resolve, dirname } = require('path')
const readCmdShim = require('read-cmd-shim')
const fs = require('fs')
-const {promisify} = require('util')
+const { promisify } = require('util')
const readlink = promisify(fs.readlink)
-const checkBin = async ({bin, path, top, global, force}) => {
+const checkBin = async ({ bin, path, top, global, force }) => {
// always ok to clobber when forced
// always ok to clobber local bins, or when forced
- if (force || !global || !top)
+ if (force || !global || !top) {
return
+ }
// ok, need to make sure, then
- const target = resolve(binTarget({path, top}), bin)
+ const target = resolve(binTarget({ path, top }), bin)
path = resolve(path)
- return isWindows ? checkShim({target, path}) : checkLink({target, path})
+ return isWindows ? checkShim({ target, path }) : checkLink({ target, path })
}
// only enoent is allowed. anything else is a problem.
-const handleReadLinkError = async ({er, target}) =>
+const handleReadLinkError = async ({ er, target }) =>
er.code === 'ENOENT' ? null
- : failEEXIST({target})
+ : failEEXIST({ target })
-const checkLink = async ({target, path}) => {
+const checkLink = async ({ target, path }) => {
const current = await readlink(target)
- .catch(er => handleReadLinkError({er, target}))
+ .catch(er => handleReadLinkError({ er, target }))
- if (!current)
+ if (!current) {
return
+ }
const resolved = resolve(dirname(target), current)
- if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0)
- return failEEXIST({target})
+ if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
+ return failEEXIST({ target })
+ }
}
-const handleReadCmdShimError = ({er, target}) =>
+const handleReadCmdShimError = ({ er, target }) =>
er.code === 'ENOENT' ? null
- : failEEXIST({target})
+ : failEEXIST({ target })
-const failEEXIST = ({target}) =>
+const failEEXIST = ({ target }) =>
Promise.reject(Object.assign(new Error('EEXIST: file already exists'), {
path: target,
code: 'EEXIST',
}))
-const checkShim = async ({target, path}) => {
+const checkShim = async ({ target, path }) => {
const shims = [
target,
target + '.cmd',
@@ -56,15 +59,17 @@ const checkShim = async ({target, path}) => {
]
await Promise.all(shims.map(async target => {
const current = await readCmdShim(target)
- .catch(er => handleReadCmdShimError({er, target}))
+ .catch(er => handleReadCmdShimError({ er, target }))
- if (!current)
+ if (!current) {
return
+ }
const resolved = resolve(dirname(target), current.replace(/\\/g, '/'))
- if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0)
- return failEEXIST({target})
+ if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
+ return failEEXIST({ target })
+ }
}))
}
diff --git a/deps/npm/node_modules/bin-links/lib/check-bins.js b/deps/npm/node_modules/bin-links/lib/check-bins.js
index 0addbffe55abb0..76a683c91d7c22 100644
--- a/deps/npm/node_modules/bin-links/lib/check-bins.js
+++ b/deps/npm/node_modules/bin-links/lib/check-bins.js
@@ -3,14 +3,16 @@ const normalize = require('npm-normalize-package-bin')
const checkBins = async ({ pkg, path, top, global, force }) => {
// always ok to clobber when forced
// always ok to clobber local bins, or when forced
- if (force || !global || !top)
+ if (force || !global || !top) {
return
+ }
pkg = normalize(pkg)
- if (!pkg.bin)
+ if (!pkg.bin) {
return
+ }
await Promise.all(Object.keys(pkg.bin)
- .map(bin => checkBin({bin, path, top, global, force})))
+ .map(bin => checkBin({ bin, path, top, global, force })))
}
module.exports = checkBins
diff --git a/deps/npm/node_modules/bin-links/lib/get-node-modules.js b/deps/npm/node_modules/bin-links/lib/get-node-modules.js
index b67c198eff3485..5c16b3b8afbfb5 100644
--- a/deps/npm/node_modules/bin-links/lib/get-node-modules.js
+++ b/deps/npm/node_modules/bin-links/lib/get-node-modules.js
@@ -2,12 +2,13 @@
// {prefix}/node_modules/{name}. Can't rely on pkg.name, because
// it might be installed as an alias.
-const {dirname, basename} = require('path')
+const { dirname, basename } = require('path')
// this gets called a lot and can't change, so memoize it
const memo = new Map()
module.exports = path => {
- if (memo.has(path))
+ if (memo.has(path)) {
return memo.get(path)
+ }
const scopeOrNm = dirname(path)
const nm = basename(scopeOrNm) === 'node_modules' ? scopeOrNm
diff --git a/deps/npm/node_modules/bin-links/lib/get-paths.js b/deps/npm/node_modules/bin-links/lib/get-paths.js
index 614c85652a1aa9..631aef9f9117f5 100644
--- a/deps/npm/node_modules/bin-links/lib/get-paths.js
+++ b/deps/npm/node_modules/bin-links/lib/get-paths.js
@@ -3,14 +3,15 @@
// are present, then we can assume that they're associated.
const binTarget = require('./bin-target.js')
const manTarget = require('./man-target.js')
-const {resolve, basename} = require('path')
+const { resolve, basename } = require('path')
const isWindows = require('./is-windows.js')
-module.exports = ({path, pkg, global, top}) => {
- if (top && !global)
+module.exports = ({ path, pkg, global, top }) => {
+ if (top && !global) {
return []
+ }
const binSet = []
- const binTarg = binTarget({path, top})
+ const binTarg = binTarget({ path, top })
if (pkg.bin) {
for (const bin of Object.keys(pkg.bin)) {
const b = resolve(binTarg, bin)
@@ -22,14 +23,15 @@ module.exports = ({path, pkg, global, top}) => {
}
}
- const manTarg = manTarget({path, top})
+ const manTarg = manTarget({ path, top })
const manSet = []
if (manTarg && pkg.man && Array.isArray(pkg.man) && pkg.man.length) {
for (const man of pkg.man) {
const parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/)
// invalid entries invalidate the entire man set
- if (!parseMan)
+ if (!parseMan) {
return binSet
+ }
const stem = parseMan[1]
const sxn = parseMan[2]
@@ -37,8 +39,9 @@ module.exports = ({path, pkg, global, top}) => {
const absFrom = resolve(path, man)
/* istanbul ignore if - should be impossible */
- if (absFrom.indexOf(path) !== 0)
+ if (absFrom.indexOf(path) !== 0) {
return binSet
+ }
manSet.push(resolve(manTarg, 'man' + sxn, base))
}
diff --git a/deps/npm/node_modules/bin-links/lib/get-prefix.js b/deps/npm/node_modules/bin-links/lib/get-prefix.js
index 96112bf0a2b979..d5cf9c9d01c202 100644
--- a/deps/npm/node_modules/bin-links/lib/get-prefix.js
+++ b/deps/npm/node_modules/bin-links/lib/get-prefix.js
@@ -1,3 +1,3 @@
-const {dirname} = require('path')
+const { dirname } = require('path')
const getNodeModules = require('./get-node-modules.js')
module.exports = path => dirname(getNodeModules(path))
diff --git a/deps/npm/node_modules/bin-links/index.js b/deps/npm/node_modules/bin-links/lib/index.js
similarity index 70%
rename from deps/npm/node_modules/bin-links/index.js
rename to deps/npm/node_modules/bin-links/lib/index.js
index 2e8519737220a2..ab3bd13c0be6b3 100644
--- a/deps/npm/node_modules/bin-links/index.js
+++ b/deps/npm/node_modules/bin-links/lib/index.js
@@ -1,5 +1,5 @@
-const linkBins = require('./lib/link-bins.js')
-const linkMans = require('./lib/link-mans.js')
+const linkBins = require('./link-bins.js')
+const linkMans = require('./link-mans.js')
const binLinks = opts => {
const { path, pkg, force, global, top } = opts
@@ -14,27 +14,28 @@ const binLinks = opts => {
// non-global top pkgs don't have any bins or mans linked. From here on
// out, if it's top, we know that it's global, so no need to pass that
// option further down the stack.
- if (top && !global)
+ if (top && !global) {
return Promise.resolve()
+ }
return Promise.all([
// allow clobbering within the local node_modules/.bin folder.
// only global bins are protected in this way, or else it is
// yet another vector for excessive dependency conflicts.
- linkBins({path, pkg, top, force: force || !top}),
- linkMans({path, pkg, top, force}),
+ linkBins({ path, pkg, top, force: force || !top }),
+ linkMans({ path, pkg, top, force }),
])
}
-const shimBin = require('./lib/shim-bin.js')
-const linkGently = require('./lib/link-gently.js')
+const shimBin = require('./shim-bin.js')
+const linkGently = require('./link-gently.js')
const resetSeen = () => {
shimBin.resetSeen()
linkGently.resetSeen()
}
-const checkBins = require('./lib/check-bins.js')
-const getPaths = require('./lib/get-paths.js')
+const checkBins = require('./check-bins.js')
+const getPaths = require('./get-paths.js')
module.exports = Object.assign(binLinks, {
checkBins,
diff --git a/deps/npm/node_modules/bin-links/lib/link-bin.js b/deps/npm/node_modules/bin-links/lib/link-bin.js
index 4c0bde489348a1..fb579350994d03 100644
--- a/deps/npm/node_modules/bin-links/lib/link-bin.js
+++ b/deps/npm/node_modules/bin-links/lib/link-bin.js
@@ -2,8 +2,8 @@ const linkGently = require('./link-gently.js')
const fixBin = require('./fix-bin.js')
// linking bins is simple. just symlink, and if we linked it, fix the bin up
-const linkBin = ({path, to, from, absFrom, force}) =>
- linkGently({path, to, from, absFrom, force})
+const linkBin = ({ path, to, from, absFrom, force }) =>
+ linkGently({ path, to, from, absFrom, force })
.then(linked => linked && fixBin(absFrom))
module.exports = linkBin
diff --git a/deps/npm/node_modules/bin-links/lib/link-bins.js b/deps/npm/node_modules/bin-links/lib/link-bins.js
index 6a1086b92b2649..9bf7d72117fbbe 100644
--- a/deps/npm/node_modules/bin-links/lib/link-bins.js
+++ b/deps/npm/node_modules/bin-links/lib/link-bins.js
@@ -4,17 +4,18 @@ const { dirname, resolve, relative } = require('path')
const linkBin = isWindows ? require('./shim-bin.js') : require('./link-bin.js')
const normalize = require('npm-normalize-package-bin')
-const linkBins = ({path, pkg, top, force}) => {
+const linkBins = ({ path, pkg, top, force }) => {
pkg = normalize(pkg)
- if (!pkg.bin)
+ if (!pkg.bin) {
return Promise.resolve([])
+ }
const promises = []
- const target = binTarget({path, top})
+ const target = binTarget({ path, top })
for (const [key, val] of Object.entries(pkg.bin)) {
const to = resolve(target, key)
const absFrom = resolve(path, val)
const from = relative(dirname(to), absFrom)
- promises.push(linkBin({path, from, to, absFrom, force}))
+ promises.push(linkBin({ path, from, to, absFrom, force }))
}
return Promise.all(promises)
}
diff --git a/deps/npm/node_modules/bin-links/lib/link-gently.js b/deps/npm/node_modules/bin-links/lib/link-gently.js
index 6a6e555de7cf52..671ce38a586e7d 100644
--- a/deps/npm/node_modules/bin-links/lib/link-gently.js
+++ b/deps/npm/node_modules/bin-links/lib/link-gently.js
@@ -11,7 +11,11 @@ const fs = require('fs')
const symlink = promisify(fs.symlink)
const readlink = promisify(fs.readlink)
const lstat = promisify(fs.lstat)
-const throwNonEnoent = er => { if (er.code !== 'ENOENT') throw er }
+const throwNonEnoent = er => {
+ if (er.code !== 'ENOENT') {
+ throw er
+ }
+}
// even in --force mode, we never create a link over a link we've
// already created. you can have multiple packages in a tree trying
@@ -24,11 +28,12 @@ const rimraf = promisify(require('rimraf'))
const rm = path => rimraf(path, { glob: false })
const SKIP = Symbol('skip - missing or already installed')
-const CLOBBER = Symbol('clobber - ours or in forceful mode')
+const CLOBBER = Symbol('clobber - ours or in forceful mode')
-const linkGently = async ({path, to, from, absFrom, force}) => {
- if (seen.has(to))
+const linkGently = async ({ path, to, from, absFrom, force }) => {
+ if (seen.has(to)) {
return true
+ }
seen.add(to)
// if the script or manpage isn't there, just ignore it.
@@ -40,36 +45,42 @@ const linkGently = async ({path, to, from, absFrom, force}) => {
lstat(to).catch(throwNonEnoent),
]).then(([stFrom, stTo]) => {
// not present in package, skip it
- if (!stFrom)
+ if (!stFrom) {
return SKIP
+ }
// exists! maybe clobber if we can
if (stTo) {
- if (!stTo.isSymbolicLink())
+ if (!stTo.isSymbolicLink()) {
return force && rm(to).then(() => CLOBBER)
+ }
return readlink(to).then(target => {
- if (target === from)
- return SKIP // skip it, already set up like we want it.
+ if (target === from) {
+ return SKIP
+ } // skip it, already set up like we want it.
target = resolve(dirname(to), target)
- if (target.indexOf(path) === 0 || force)
+ if (target.indexOf(path) === 0 || force) {
return rm(to).then(() => CLOBBER)
+ }
})
} else {
// doesn't exist, dir might not either
return mkdirp(dirname(to))
}
})
- .then(skipOrClobber => {
- if (skipOrClobber === SKIP)
- return false
- return symlink(from, to, 'file').catch(er => {
- if (skipOrClobber === CLOBBER || force)
- return rm(to).then(() => symlink(from, to, 'file'))
- throw er
- }).then(() => true)
- })
+ .then(skipOrClobber => {
+ if (skipOrClobber === SKIP) {
+ return false
+ }
+ return symlink(from, to, 'file').catch(er => {
+ if (skipOrClobber === CLOBBER || force) {
+ return rm(to).then(() => symlink(from, to, 'file'))
+ }
+ throw er
+ }).then(() => true)
+ })
}
const resetSeen = () => {
diff --git a/deps/npm/node_modules/bin-links/lib/link-mans.js b/deps/npm/node_modules/bin-links/lib/link-mans.js
index 6fb167e480a740..54b17d1fc16d4f 100644
--- a/deps/npm/node_modules/bin-links/lib/link-mans.js
+++ b/deps/npm/node_modules/bin-links/lib/link-mans.js
@@ -2,10 +2,11 @@ const { dirname, relative, join, resolve, basename } = require('path')
const linkGently = require('./link-gently.js')
const manTarget = require('./man-target.js')
-const linkMans = ({path, pkg, top, force}) => {
- const target = manTarget({path, top})
- if (!target || !pkg.man || !Array.isArray(pkg.man) || !pkg.man.length)
+const linkMans = ({ path, pkg, top, force }) => {
+ const target = manTarget({ path, top })
+ if (!target || !pkg.man || !Array.isArray(pkg.man) || !pkg.man.length) {
return Promise.resolve([])
+ }
// break any links to c:\\blah or /foo/blah or ../blah
// and filter out duplicates
@@ -44,7 +45,7 @@ const linkMans = ({path, pkg, top, force}) => {
const to = resolve(target, 'man' + sxn, base)
const from = relative(dirname(to), absFrom)
- return linkGently({from, to, path, absFrom, force})
+ return linkGently({ from, to, path, absFrom, force })
}))
}
diff --git a/deps/npm/node_modules/bin-links/lib/man-target.js b/deps/npm/node_modules/bin-links/lib/man-target.js
index 832d2ea35e43cf..efe66f38a5543f 100644
--- a/deps/npm/node_modules/bin-links/lib/man-target.js
+++ b/deps/npm/node_modules/bin-links/lib/man-target.js
@@ -1,6 +1,6 @@
const isWindows = require('./is-windows.js')
const getPrefix = require('./get-prefix.js')
-const {dirname} = require('path')
+const { dirname } = require('path')
-module.exports = ({top, path}) => !top || isWindows ? null
+module.exports = ({ top, path }) => !top || isWindows ? null
: dirname(getPrefix(path)) + '/share/man'
diff --git a/deps/npm/node_modules/bin-links/lib/shim-bin.js b/deps/npm/node_modules/bin-links/lib/shim-bin.js
index f2dfd7a7825d1e..70259a49e5b0c0 100644
--- a/deps/npm/node_modules/bin-links/lib/shim-bin.js
+++ b/deps/npm/node_modules/bin-links/lib/shim-bin.js
@@ -2,7 +2,11 @@ const { promisify } = require('util')
const { resolve, dirname } = require('path')
const fs = require('fs')
const lstat = promisify(fs.lstat)
-const throwNonEnoent = er => { if (er.code !== 'ENOENT') throw er }
+const throwNonEnoent = er => {
+ if (er.code !== 'ENOENT') {
+ throw er
+ }
+}
const cmdShim = require('cmd-shim')
const readCmdShim = require('read-cmd-shim')
@@ -15,20 +19,20 @@ const fixBin = require('./fix-bin.js')
// nondeterminism.
const seen = new Set()
-const failEEXIST = ({path, to, from}) =>
+const failEEXIST = ({ path, to, from }) =>
Promise.reject(Object.assign(new Error('EEXIST: file already exists'), {
path: to,
dest: from,
code: 'EEXIST',
}))
-const handleReadCmdShimError = ({er, from, to}) =>
+const handleReadCmdShimError = ({ er, from, to }) =>
er.code === 'ENOENT' ? null
- : er.code === 'ENOTASHIM' ? failEEXIST({from, to})
+ : er.code === 'ENOTASHIM' ? failEEXIST({ from, to })
: Promise.reject(er)
const SKIP = Symbol('skip - missing or already installed')
-const shimBin = ({path, to, from, absFrom, force}) => {
+const shimBin = ({ path, to, from, absFrom, force }) => {
const shims = [
to,
to + '.cmd',
@@ -36,8 +40,9 @@ const shimBin = ({path, to, from, absFrom, force}) => {
]
for (const shim of shims) {
- if (seen.has(shim))
+ if (seen.has(shim)) {
return true
+ }
seen.add(shim)
}
@@ -45,30 +50,29 @@ const shimBin = ({path, to, from, absFrom, force}) => {
...shims,
absFrom,
].map(f => lstat(f).catch(throwNonEnoent))).then((stats) => {
- const [
- stToBase,
- stToCmd,
- stToPs1,
- stFrom,
- ] = stats
- if (!stFrom)
+ const [, , , stFrom] = stats
+ if (!stFrom) {
return SKIP
+ }
- if (force)
+ if (force) {
return
+ }
return Promise.all(shims.map((s, i) => [s, stats[i]]).map(([s, st]) => {
- if (!st)
+ if (!st) {
return
+ }
return readCmdShim(s)
.then(target => {
target = resolve(dirname(to), target)
- if (target.indexOf(resolve(path)) !== 0)
- return failEEXIST({from, to, path})
- }, er => handleReadCmdShimError({er, from, to}))
+ if (target.indexOf(resolve(path)) !== 0) {
+ return failEEXIST({ from, to, path })
+ }
+ }, er => handleReadCmdShimError({ er, from, to }))
}))
})
- .then(skip => skip !== SKIP && doShim(absFrom, to))
+ .then(skip => skip !== SKIP && doShim(absFrom, to))
}
const doShim = (absFrom, to) =>
diff --git a/deps/npm/node_modules/bin-links/package.json b/deps/npm/node_modules/bin-links/package.json
index 8293d77d1a85af..0325ab4437656d 100644
--- a/deps/npm/node_modules/bin-links/package.json
+++ b/deps/npm/node_modules/bin-links/package.json
@@ -1,14 +1,18 @@
{
"name": "bin-links",
- "version": "2.3.0",
+ "version": "3.0.0",
"description": "JavaScript package binary linker",
- "main": "index.js",
+ "main": "./lib/index.js",
"scripts": {
- "preversion": "npm t",
+ "preversion": "npm test",
"postversion": "npm publish",
- "prepublishOnly": "git push --follow-tags",
+ "prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
- "test": "tap"
+ "test": "tap",
+ "lint": "eslint '**/*.js'",
+ "postlint": "npm-template-check",
+ "lintfix": "npm run lint -- --fix",
+ "posttest": "npm run lint"
},
"repository": {
"type": "git",
@@ -26,9 +30,10 @@
"npm-normalize-package-bin": "^1.0.0",
"read-cmd-shim": "^2.0.0",
"rimraf": "^3.0.0",
- "write-file-atomic": "^3.0.3"
+ "write-file-atomic": "^4.0.0"
},
"devDependencies": {
+ "@npmcli/template-oss": "^2.5.0",
"mkdirp": "^1.0.3",
"require-inject": "^1.4.4",
"tap": "^15.0.10"
@@ -38,10 +43,15 @@
"coverage-map": "map.js"
},
"files": [
- "index.js",
- "lib/*.js"
+ "bin",
+ "lib"
],
"engines": {
- "node": ">=10"
+ "node": "^12.13.0 || ^14.15.0 || >=16"
+ },
+ "author": "GitHub Inc.",
+ "templateOSS": {
+ "windowsCI": false,
+ "version": "2.5.0"
}
}
diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json
index 8c8812a651a053..ff728b5473bc96 100644
--- a/deps/npm/node_modules/libnpmexec/package.json
+++ b/deps/npm/node_modules/libnpmexec/package.json
@@ -46,7 +46,7 @@
},
"devDependencies": {
"@npmcli/template-oss": "^2.4.2",
- "bin-links": "^2.2.1",
+ "bin-links": "^3.0.0",
"tap": "^15.0.6"
},
"dependencies": {
diff --git a/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml b/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml
deleted file mode 100644
index 3417780255e8e2..00000000000000
--- a/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-sauce_connect: true
-loopback: airtap.local
-browsers:
- - name: chrome
- version: latest
- - name: firefox
- version: latest
- - name: safari
- version: latest
- - name: microsoftedge
- version: latest
- - name: ie
- version: latest
- - name: iphone
- version: latest
diff --git a/deps/npm/node_modules/typedarray-to-buffer/index.js b/deps/npm/node_modules/typedarray-to-buffer/index.js
index 5fa394dd201d2e..fd1e192b2656b1 100644
--- a/deps/npm/node_modules/typedarray-to-buffer/index.js
+++ b/deps/npm/node_modules/typedarray-to-buffer/index.js
@@ -1,3 +1,4 @@
+/*! typedarray-to-buffer. MIT License. Feross Aboukhadijeh */
/**
* Convert a typed array to a Buffer without a copy
*
@@ -7,19 +8,11 @@
* `npm install typedarray-to-buffer`
*/
-var isTypedArray = require('is-typedarray').strict
-
module.exports = function typedarrayToBuffer (arr) {
- if (isTypedArray(arr)) {
- // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer
- var buf = Buffer.from(arr.buffer)
- if (arr.byteLength !== arr.buffer.byteLength) {
- // Respect the "view", i.e. byteOffset and byteLength, without doing a copy
- buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength)
- }
- return buf
- } else {
+ return ArrayBuffer.isView(arr)
+ // To avoid a copy, use the typed array's underlying ArrayBuffer to back
+ // new Buffer, respecting the "view", i.e. byteOffset and byteLength
+ ? Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength)
// Pass through all other types to `Buffer.from`
- return Buffer.from(arr)
- }
+ : Buffer.from(arr)
}
diff --git a/deps/npm/node_modules/typedarray-to-buffer/package.json b/deps/npm/node_modules/typedarray-to-buffer/package.json
index 5ec5656157991e..502a322c6d7460 100644
--- a/deps/npm/node_modules/typedarray-to-buffer/package.json
+++ b/deps/npm/node_modules/typedarray-to-buffer/package.json
@@ -1,22 +1,20 @@
{
"name": "typedarray-to-buffer",
"description": "Convert a typed array to a Buffer without a copy",
- "version": "3.1.5",
+ "version": "4.0.0",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
- "url": "http://feross.org/"
+ "url": "https://feross.org"
},
"bugs": {
"url": "https://github.com/feross/typedarray-to-buffer/issues"
},
- "dependencies": {
- "is-typedarray": "^1.0.0"
- },
+ "dependencies": {},
"devDependencies": {
- "airtap": "0.0.4",
+ "airtap": "^3.0.0",
"standard": "*",
- "tape": "^4.0.0"
+ "tape": "^5.0.1"
},
"homepage": "http://feross.org",
"keywords": [
@@ -46,5 +44,19 @@
"test-browser": "airtap -- test/*.js",
"test-browser-local": "airtap --local -- test/*.js",
"test-node": "tape test/*.js"
- }
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
}
diff --git a/deps/npm/node_modules/typedarray-to-buffer/test/basic.js b/deps/npm/node_modules/typedarray-to-buffer/test/basic.js
deleted file mode 100644
index 352109682f5c12..00000000000000
--- a/deps/npm/node_modules/typedarray-to-buffer/test/basic.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var test = require('tape')
-var toBuffer = require('../')
-
-test('convert to buffer from Uint8Array', function (t) {
- if (typeof Uint8Array !== 'undefined') {
- var arr = new Uint8Array([1, 2, 3])
- arr = toBuffer(arr)
-
- t.deepEqual(arr, Buffer.from([1, 2, 3]), 'contents equal')
- t.ok(Buffer.isBuffer(arr), 'is buffer')
- t.equal(arr.readUInt8(0), 1)
- t.equal(arr.readUInt8(1), 2)
- t.equal(arr.readUInt8(2), 3)
- } else {
- t.pass('browser lacks Uint8Array support, skip test')
- }
- t.end()
-})
-
-test('convert to buffer from another arrayview type (Uint32Array)', function (t) {
- if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) {
- var arr = new Uint32Array([1, 2, 3])
- arr = toBuffer(arr)
-
- t.deepEqual(arr, Buffer.from([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]), 'contents equal')
- t.ok(Buffer.isBuffer(arr), 'is buffer')
- t.equal(arr.readUInt32LE(0), 1)
- t.equal(arr.readUInt32LE(4), 2)
- t.equal(arr.readUInt32LE(8), 3)
- t.equal(arr instanceof Uint8Array, true)
- } else {
- t.pass('browser lacks Uint32Array support, skip test')
- }
- t.end()
-})
-
-test('convert to buffer from ArrayBuffer', function (t) {
- if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) {
- var arr = new Uint32Array([1, 2, 3]).subarray(1, 2)
- arr = toBuffer(arr)
-
- t.deepEqual(arr, Buffer.from([2, 0, 0, 0]), 'contents equal')
- t.ok(Buffer.isBuffer(arr), 'is buffer')
- t.equal(arr.readUInt32LE(0), 2)
- t.equal(arr instanceof Uint8Array, true)
- } else {
- t.pass('browser lacks ArrayBuffer support, skip test')
- }
- t.end()
-})
diff --git a/deps/npm/node_modules/write-file-atomic/LICENSE b/deps/npm/node_modules/write-file-atomic/LICENSE.md
similarity index 99%
rename from deps/npm/node_modules/write-file-atomic/LICENSE
rename to deps/npm/node_modules/write-file-atomic/LICENSE.md
index 95e65a7706e0e9..af4588069db82d 100644
--- a/deps/npm/node_modules/write-file-atomic/LICENSE
+++ b/deps/npm/node_modules/write-file-atomic/LICENSE.md
@@ -3,4 +3,3 @@ Copyright (c) 2015, Rebecca Turner
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/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/lib/index.js
similarity index 94%
rename from deps/npm/node_modules/write-file-atomic/index.js
rename to deps/npm/node_modules/write-file-atomic/lib/index.js
index df5b72a14f74a4..9a7d183aecb4c6 100644
--- a/deps/npm/node_modules/write-file-atomic/index.js
+++ b/deps/npm/node_modules/write-file-atomic/lib/index.js
@@ -48,10 +48,14 @@ function cleanupOnExit (tmpfile) {
function serializeActiveFile (absoluteName) {
return new Promise(resolve => {
// make a queue if it doesn't already exist
- if (!activeFiles[absoluteName]) activeFiles[absoluteName] = []
+ if (!activeFiles[absoluteName]) {
+ activeFiles[absoluteName] = []
+ }
activeFiles[absoluteName].push(resolve) // add this job to the queue
- if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one
+ if (activeFiles[absoluteName].length === 1) {
+ resolve()
+ } // kick off the first one
})
}
@@ -151,7 +155,9 @@ async function writeFileAsync (filename, data, options = {}) {
activeFiles[absoluteName].shift() // remove the element added by serializeSameFile
if (activeFiles[absoluteName].length > 0) {
activeFiles[absoluteName][0]() // start next job if one is pending
- } else delete activeFiles[absoluteName]
+ } else {
+ delete activeFiles[absoluteName]
+ }
}
}
@@ -170,8 +176,11 @@ function writeFile (filename, data, options, callback) {
}
function writeFileSync (filename, data, options) {
- if (typeof options === 'string') options = { encoding: options }
- else if (!options) options = {}
+ if (typeof options === 'string') {
+ options = { encoding: options }
+ } else if (!options) {
+ options = {}
+ }
try {
filename = fs.realpathSync(filename)
} catch (ex) {
diff --git a/deps/npm/node_modules/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json
index 98a29a053453a6..031eccdba87071 100644
--- a/deps/npm/node_modules/write-file-atomic/package.json
+++ b/deps/npm/node_modules/write-file-atomic/package.json
@@ -1,16 +1,18 @@
{
"name": "write-file-atomic",
- "version": "3.0.3",
+ "version": "4.0.0",
"description": "Write files in an atomic fashion w/configurable ownership",
- "main": "index.js",
+ "main": "./lib/index.js",
"scripts": {
"test": "tap",
"posttest": "npm run lint",
- "lint": "standard",
- "postlint": "rimraf chowncopy good nochmod nochown nofsync nofsyncopt noopen norename \"norename nounlink\" nowrite",
+ "lint": "eslint '**/*.js'",
+ "postlint": "npm-template-check",
"preversion": "npm test",
"postversion": "npm publish",
- "prepublishOnly": "git push origin --follow-tags"
+ "prepublishOnly": "git push origin --follow-tags",
+ "lintfix": "npm run lint -- --fix",
+ "snap": "tap"
},
"repository": {
"type": "git",
@@ -20,7 +22,7 @@
"writeFile",
"atomic"
],
- "author": "Rebecca Turner (http://re-becca.org)",
+ "author": "GitHub Inc.",
"license": "ISC",
"bugs": {
"url": "https://github.com/npm/write-file-atomic/issues"
@@ -30,19 +32,23 @@
"imurmurhash": "^0.1.4",
"is-typedarray": "^1.0.0",
"signal-exit": "^3.0.2",
- "typedarray-to-buffer": "^3.1.5"
+ "typedarray-to-buffer": "^4.0.0"
},
"devDependencies": {
- "mkdirp": "^0.5.1",
- "require-inject": "^1.4.4",
- "rimraf": "^2.6.3",
- "standard": "^14.3.1",
- "tap": "^14.10.6"
+ "@npmcli/template-oss": "^2.5.1",
+ "mkdirp": "^1.0.4",
+ "rimraf": "^3.0.2",
+ "tap": "^15.1.6"
},
"files": [
- "index.js"
+ "bin",
+ "lib"
],
- "tap": {
- "100": true
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16"
+ },
+ "templateOSS": {
+ "windowsCI": false,
+ "version": "2.5.1"
}
}
diff --git a/deps/npm/package.json b/deps/npm/package.json
index a4a5fcc6e8d4db..508f6158471235 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "8.3.1",
+ "version": "8.3.2",
"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.0",
+ "@npmcli/arborist": "^4.2.1",
"@npmcli/ci-detect": "^1.4.0",
"@npmcli/config": "^2.4.0",
"@npmcli/map-workspaces": "^2.0.0",
@@ -124,7 +124,7 @@
"treeverse": "^1.0.4",
"validate-npm-package-name": "~3.0.0",
"which": "^2.0.2",
- "write-file-atomic": "^3.0.3"
+ "write-file-atomic": "^4.0.0"
},
"bundleDependencies": [
"@isaacs/string-locale-compare",
diff --git a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
index 6efecf2089e831..e7142c24923224 100644
--- a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
@@ -170,6 +170,7 @@ npm dedupe
Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
@@ -1061,8 +1062,10 @@ npm update [...]
Options:
[-g|--global] [--global-style] [--legacy-bundling] [--strict-peer-deps]
-[--no-package-lock] [--omit [--omit ...]]
-[--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
+[--no-package-lock]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[--omit [--omit ...]] [--ignore-scripts]
+[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
[-ws|--workspaces] [--include-workspace-root]
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 84bb22ff0ef59e..459c5de8dc2843 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
@@ -1406,13 +1406,16 @@ The base URL of the npm registry.
exports[`test/lib/utils/config/definitions.js TAP > config description for save 1`] = `
#### \`save\`
-* Default: true
+* Default: \`true\` unless when using \`npm update\` or \`npm dedupe\` where it
+ defaults to \`false\`
* Type: Boolean
-Save installed packages to a package.json file as dependencies.
+Save installed packages to a \`package.json\` file as dependencies.
When used with the \`npm rm\` command, removes the dependency from
-package.json.
+\`package.json\`.
+
+Will also prevent writing to \`package-lock.json\` if set to \`false\`.
`
exports[`test/lib/utils/config/definitions.js TAP > config description for save-bundle 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 3db90f7679d4ed..ffa6617328bc62 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
@@ -1200,13 +1200,16 @@ The base URL of the npm registry.
#### \`save\`
-* Default: true
+* Default: \`true\` unless when using \`npm update\` or \`npm dedupe\` where it
+ defaults to \`false\`
* Type: Boolean
-Save installed packages to a package.json file as dependencies.
+Save installed packages to a \`package.json\` file as dependencies.
When used with the \`npm rm\` command, removes the dependency from
-package.json.
+\`package.json\`.
+
+Will also prevent writing to \`package-lock.json\` if set to \`false\`.
diff --git a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
index ca4b745f5dd1d7..e3a572be459545 100644
--- a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
@@ -311,6 +311,7 @@ All commands:
Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
@@ -1096,8 +1097,10 @@ All commands:
Options:
[-g|--global] [--global-style] [--legacy-bundling] [--strict-peer-deps]
- [--no-package-lock] [--omit [--omit ...]]
- [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
+ [--no-package-lock]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [--omit [--omit ...]] [--ignore-scripts]
+ [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
[-ws|--workspaces] [--include-workspace-root]
diff --git a/deps/npm/test/fixtures/mock-npm.js b/deps/npm/test/fixtures/mock-npm.js
index 7518855319b4ae..c3dc47f5dde4f7 100644
--- a/deps/npm/test/fixtures/mock-npm.js
+++ b/deps/npm/test/fixtures/mock-npm.js
@@ -147,6 +147,8 @@ class MockNpm {
// for now just set `find` to what config.find should return
// this works cause `find` is not an existing config entry
find: (k) => ({ ...realConfig.defaults, ...config })[k],
+ // for now isDefault is going to just return false if a value was defined
+ isDefault: (k) => !Object.prototype.hasOwnProperty.call(config, k),
get: (k) => ({ ...realConfig.defaults, ...config })[k],
set: (k, v) => config[k] = v,
list: [{ ...realConfig.defaults, ...config }],
diff --git a/deps/npm/test/lib/arborist-cmd.js b/deps/npm/test/lib/arborist-cmd.js
index 3db862d233dc7e..91d8a7b333bf9d 100644
--- a/deps/npm/test/lib/arborist-cmd.js
+++ b/deps/npm/test/lib/arborist-cmd.js
@@ -98,7 +98,7 @@ t.test('handle getWorkspaces raising an error', async t => {
})
class TestCmd extends ArboristCmd {}
const cmd = new TestCmd()
- cmd.npm = {}
+ cmd.npm = { localPrefix: t.testdir() }
await t.rejects(
cmd.execWorkspaces(['foo'], ['a']),
diff --git a/deps/npm/test/lib/commands/dedupe.js b/deps/npm/test/lib/commands/dedupe.js
index 2e2fae238103ff..bf6964081ca79e 100644
--- a/deps/npm/test/lib/commands/dedupe.js
+++ b/deps/npm/test/lib/commands/dedupe.js
@@ -38,11 +38,12 @@ t.test('should remove dupes using Arborist', async (t) => {
})
t.test('should remove dupes using Arborist - no arguments', async (t) => {
- t.plan(1)
+ t.plan(2)
const { npm } = await loadMockNpm(t, {
mocks: {
'@npmcli/arborist': function (args) {
t.ok(args.dryRun, 'gets dryRun from config')
+ t.ok(args.save, 'gets user-set save value from config')
this.dedupe = () => {}
},
'../../lib/utils/reify-output.js': () => {},
@@ -50,6 +51,7 @@ t.test('should remove dupes using Arborist - no arguments', async (t) => {
},
config: {
'dry-run': true,
+ save: true,
},
})
await npm.exec('dedupe', [])
diff --git a/deps/npm/test/lib/commands/update.js b/deps/npm/test/lib/commands/update.js
index aecb2c32b5e3f1..2b464bfabbfcd6 100644
--- a/deps/npm/test/lib/commands/update.js
+++ b/deps/npm/test/lib/commands/update.js
@@ -27,7 +27,7 @@ t.afterEach(() => {
})
t.test('no args', async t => {
- t.plan(4)
+ t.plan(5)
npm.prefix = '/project/a'
@@ -39,6 +39,7 @@ t.test('no args', async t => {
{
...npm.flatOptions,
path: npm.prefix,
+ save: false,
workspaces: null,
},
'should call arborist contructor with expected args'
@@ -46,7 +47,8 @@ t.test('no args', async t => {
t.match(log, {}, 'log is passed in')
}
- reify ({ update }) {
+ reify ({ save, update }) {
+ t.equal(save, false, 'should default to save=false')
t.equal(update, true, 'should update all deps')
}
}
@@ -64,9 +66,10 @@ t.test('no args', async t => {
})
t.test('with args', async t => {
- t.plan(4)
+ t.plan(5)
npm.prefix = '/project/a'
+ config.save = true
class Arborist {
constructor (args) {
@@ -76,6 +79,7 @@ t.test('with args', async t => {
{
...npm.flatOptions,
path: npm.prefix,
+ save: true,
workspaces: null,
},
'should call arborist contructor with expected args'
@@ -83,7 +87,8 @@ t.test('with args', async t => {
t.match(log, {}, 'log is passed in')
}
- reify ({ update }) {
+ reify ({ save, update }) {
+ t.equal(save, true, 'should pass save if manually set')
t.same(update, ['ipt'], 'should update listed deps')
}
}
@@ -140,7 +145,7 @@ t.test('update --global', async t => {
const { path, log, ...rest } = args
t.same(
rest,
- { ...npm.flatOptions, workspaces: undefined },
+ { ...npm.flatOptions, save: true, workspaces: undefined },
'should call arborist contructor with expected options'
)
From b5783288d1143dc32d95d90d7792550aabddc5b8 Mon Sep 17 00:00:00 2001
From: npm-robot
Date: Mon, 7 Feb 2022 22:15:05 +0200
Subject: [PATCH 002/168] deps: upgrade npm to 8.4.1
PR-URL: https://github.com/nodejs/node/pull/41836
Reviewed-By: Ruy Adorno
Reviewed-By: Mohammed Keyvanzadeh
Reviewed-By: Beth Griggs
Reviewed-By: Colin Ihrig
Reviewed-By: Rich Trott
Reviewed-By: Luigi Pinca
Reviewed-By: Mestery
---
.../content/configuring-npm/package-json.md | 4 +
deps/npm/docs/content/using-npm/config.md | 2 +
deps/npm/docs/output/commands/npm-ls.html | 2 +-
deps/npm/docs/output/commands/npm.html | 2 +-
.../output/configuring-npm/package-json.html | 3 +
deps/npm/docs/output/using-npm/config.html | 1 +
deps/npm/lib/commands/access.js | 6 +-
deps/npm/lib/commands/ci.js | 24 +
deps/npm/lib/commands/deprecate.js | 3 +
deps/npm/lib/commands/diff.js | 2 +
deps/npm/lib/commands/dist-tag.js | 5 +-
deps/npm/lib/commands/hook.js | 6 +-
deps/npm/lib/commands/logout.js | 3 +-
deps/npm/lib/commands/outdated.js | 11 +-
deps/npm/lib/commands/owner.js | 6 +-
deps/npm/lib/commands/ping.js | 2 +-
deps/npm/lib/commands/profile.js | 8 +-
deps/npm/lib/commands/publish.js | 2 +-
deps/npm/lib/commands/star.js | 4 +-
deps/npm/lib/commands/team.js | 3 +-
deps/npm/lib/commands/token.js | 2 +-
deps/npm/lib/commands/unpublish.js | 2 +-
deps/npm/lib/commands/whoami.js | 3 +-
deps/npm/lib/utils/config/definitions.js | 2 +
deps/npm/lib/utils/validate-lockfile.js | 29 ++
deps/npm/man/man1/npm-access.1 | 2 +-
deps/npm/man/man1/npm-adduser.1 | 2 +-
deps/npm/man/man1/npm-audit.1 | 2 +-
deps/npm/man/man1/npm-bin.1 | 2 +-
deps/npm/man/man1/npm-bugs.1 | 2 +-
deps/npm/man/man1/npm-cache.1 | 2 +-
deps/npm/man/man1/npm-ci.1 | 2 +-
deps/npm/man/man1/npm-completion.1 | 2 +-
deps/npm/man/man1/npm-config.1 | 2 +-
deps/npm/man/man1/npm-dedupe.1 | 2 +-
deps/npm/man/man1/npm-deprecate.1 | 2 +-
deps/npm/man/man1/npm-diff.1 | 2 +-
deps/npm/man/man1/npm-dist-tag.1 | 2 +-
deps/npm/man/man1/npm-docs.1 | 2 +-
deps/npm/man/man1/npm-doctor.1 | 2 +-
deps/npm/man/man1/npm-edit.1 | 2 +-
deps/npm/man/man1/npm-exec.1 | 2 +-
deps/npm/man/man1/npm-explain.1 | 2 +-
deps/npm/man/man1/npm-explore.1 | 2 +-
deps/npm/man/man1/npm-find-dupes.1 | 2 +-
deps/npm/man/man1/npm-fund.1 | 2 +-
deps/npm/man/man1/npm-help-search.1 | 2 +-
deps/npm/man/man1/npm-help.1 | 2 +-
deps/npm/man/man1/npm-hook.1 | 2 +-
deps/npm/man/man1/npm-init.1 | 2 +-
deps/npm/man/man1/npm-install-ci-test.1 | 2 +-
deps/npm/man/man1/npm-install-test.1 | 2 +-
deps/npm/man/man1/npm-install.1 | 2 +-
deps/npm/man/man1/npm-link.1 | 2 +-
deps/npm/man/man1/npm-logout.1 | 2 +-
deps/npm/man/man1/npm-ls.1 | 4 +-
deps/npm/man/man1/npm-org.1 | 2 +-
deps/npm/man/man1/npm-outdated.1 | 2 +-
deps/npm/man/man1/npm-owner.1 | 2 +-
deps/npm/man/man1/npm-pack.1 | 2 +-
deps/npm/man/man1/npm-ping.1 | 2 +-
deps/npm/man/man1/npm-pkg.1 | 2 +-
deps/npm/man/man1/npm-prefix.1 | 2 +-
deps/npm/man/man1/npm-profile.1 | 2 +-
deps/npm/man/man1/npm-prune.1 | 2 +-
deps/npm/man/man1/npm-publish.1 | 2 +-
deps/npm/man/man1/npm-rebuild.1 | 2 +-
deps/npm/man/man1/npm-repo.1 | 2 +-
deps/npm/man/man1/npm-restart.1 | 2 +-
deps/npm/man/man1/npm-root.1 | 2 +-
deps/npm/man/man1/npm-run-script.1 | 2 +-
deps/npm/man/man1/npm-search.1 | 2 +-
deps/npm/man/man1/npm-set-script.1 | 2 +-
deps/npm/man/man1/npm-shrinkwrap.1 | 2 +-
deps/npm/man/man1/npm-star.1 | 2 +-
deps/npm/man/man1/npm-stars.1 | 2 +-
deps/npm/man/man1/npm-start.1 | 2 +-
deps/npm/man/man1/npm-stop.1 | 2 +-
deps/npm/man/man1/npm-team.1 | 2 +-
deps/npm/man/man1/npm-test.1 | 2 +-
deps/npm/man/man1/npm-token.1 | 2 +-
deps/npm/man/man1/npm-uninstall.1 | 2 +-
deps/npm/man/man1/npm-unpublish.1 | 2 +-
deps/npm/man/man1/npm-unstar.1 | 2 +-
deps/npm/man/man1/npm-update.1 | 2 +-
deps/npm/man/man1/npm-version.1 | 2 +-
deps/npm/man/man1/npm-view.1 | 2 +-
deps/npm/man/man1/npm-whoami.1 | 2 +-
deps/npm/man/man1/npm.1 | 4 +-
deps/npm/man/man1/npx.1 | 2 +-
deps/npm/man/man5/folders.5 | 2 +-
deps/npm/man/man5/install.5 | 2 +-
deps/npm/man/man5/npm-shrinkwrap-json.5 | 2 +-
deps/npm/man/man5/npmrc.5 | 2 +-
deps/npm/man/man5/package-json.5 | 6 +-
deps/npm/man/man5/package-lock-json.5 | 2 +-
deps/npm/man/man7/config.7 | 4 +-
deps/npm/man/man7/developers.7 | 2 +-
deps/npm/man/man7/logging.7 | 2 +-
deps/npm/man/man7/orgs.7 | 2 +-
deps/npm/man/man7/registry.7 | 2 +-
deps/npm/man/man7/removal.7 | 2 +-
deps/npm/man/man7/scope.7 | 2 +-
deps/npm/man/man7/scripts.7 | 2 +-
deps/npm/man/man7/workspaces.7 | 2 +-
.../arborist/lib/arborist/build-ideal-tree.js | 18 +-
.../arborist/lib/arborist/load-actual.js | 9 +-
.../@npmcli/arborist/lib/arborist/reify.js | 18 +
.../@npmcli/arborist/lib/shrinkwrap.js | 9 +-
.../@npmcli/arborist/package.json | 4 +-
deps/npm/node_modules/@npmcli/fs/LICENSE.md | 2 +
.../lib/common/file-url-to-path/polyfill.js | 3 +-
.../node_modules/@npmcli/fs/lib/cp/LICENSE | 15 +
.../node_modules/@npmcli/fs/lib/cp/index.js | 22 +
.../@npmcli/fs/lib/cp/polyfill.js | 428 ++++++++++++++++
.../npm/node_modules/@npmcli/fs/lib/errors.js | 129 +++++
deps/npm/node_modules/@npmcli/fs/lib/index.js | 1 +
.../@npmcli/fs/lib/rm/polyfill.js | 3 +-
deps/npm/node_modules/@npmcli/fs/package.json | 19 +-
.../license => @tootallnate/once/LICENSE} | 12 +-
.../@tootallnate/once/dist/index.d.ts | 15 +-
.../@tootallnate/once/dist/index.js | 57 +--
.../@tootallnate/once/dist/index.js.map | 2 +-
.../once/dist/overloaded-parameters.d.ts | 231 +++++++++
.../once/dist/overloaded-parameters.js | 3 +
.../once/dist/overloaded-parameters.js.map | 1 +
.../@tootallnate/once/dist/types.d.ts | 17 +
.../@tootallnate/once/dist/types.js | 3 +
.../@tootallnate/once/dist/types.js.map | 1 +
.../@tootallnate/once/package.json | 37 +-
deps/npm/node_modules/cli-table3/package.json | 9 +-
.../cli-table3/src/layout-manager.js | 7 +-
deps/npm/node_modules/cli-table3/src/utils.js | 9 +-
deps/npm/node_modules/debug/LICENSE | 19 +-
deps/npm/node_modules/debug/package.json | 12 +-
deps/npm/node_modules/debug/src/common.js | 2 +-
.../npm/node_modules/graceful-fs/package.json | 2 +-
.../npm/node_modules/graceful-fs/polyfills.js | 6 +-
.../http-proxy-agent/dist/agent.js | 6 +-
.../http-proxy-agent/dist/agent.js.map | 2 +-
.../http-proxy-agent/package.json | 8 +-
.../npm/node_modules/is-core-module/core.json | 10 +-
.../node_modules/is-core-module/package.json | 14 +-
.../node_modules/libnpmaccess/package.json | 4 +-
deps/npm/node_modules/libnpmexec/package.json | 2 +-
deps/npm/node_modules/libnpmhook/package.json | 4 +-
deps/npm/node_modules/libnpmorg/package.json | 4 +-
.../node_modules/libnpmpublish/package.json | 8 +-
.../node_modules/libnpmsearch/package.json | 4 +-
deps/npm/node_modules/libnpmteam/package.json | 4 +-
.../node_modules/make-fetch-happen/LICENSE | 2 +-
.../make-fetch-happen/lib/agent.js | 33 +-
.../make-fetch-happen/lib/cache/entry.js | 96 ++--
.../make-fetch-happen/lib/cache/errors.js | 1 +
.../make-fetch-happen/lib/cache/index.js | 12 +-
.../make-fetch-happen/lib/cache/policy.js | 42 +-
.../make-fetch-happen/lib/fetch.js | 62 ++-
.../make-fetch-happen/lib/options.js | 22 +-
.../make-fetch-happen/lib/remote.js | 18 +-
.../make-fetch-happen/package.json | 37 +-
deps/npm/node_modules/negotiator/HISTORY.md | 5 +
deps/npm/node_modules/negotiator/index.js | 50 +-
.../node_modules/negotiator/lib/language.js | 6 +-
deps/npm/node_modules/negotiator/package.json | 16 +-
.../@tootallnate/once/dist/index.d.ts | 14 +
.../@tootallnate/once/dist/index.js | 39 ++
.../@tootallnate/once/dist/index.js.map | 1 +
.../@tootallnate/once/package.json | 45 ++
.../http-proxy-agent/dist/agent.d.ts | 32 ++
.../http-proxy-agent/dist/agent.js | 145 ++++++
.../http-proxy-agent/dist/agent.js.map | 1 +
.../http-proxy-agent/dist/index.d.ts | 21 +
.../http-proxy-agent/dist/index.js | 14 +
.../http-proxy-agent/dist/index.js.map | 1 +
.../http-proxy-agent/package.json | 57 +++
.../node_modules/make-fetch-happen/LICENSE | 16 +
.../make-fetch-happen/lib/agent.js | 194 ++++++++
.../make-fetch-happen/lib/cache/entry.js | 460 ++++++++++++++++++
.../make-fetch-happen/lib/cache/errors.js | 10 +
.../make-fetch-happen/lib/cache/index.js | 45 ++
.../make-fetch-happen/lib/cache/key.js | 17 +
.../make-fetch-happen/lib/cache/policy.js | 161 ++++++
.../make-fetch-happen/lib/fetch.js | 100 ++++
.../make-fetch-happen/lib/index.js | 40 ++
.../make-fetch-happen/lib/options.js | 44 ++
.../make-fetch-happen/lib/remote.js | 102 ++++
.../make-fetch-happen/package.json | 76 +++
deps/npm/node_modules/npm-profile/LICENSE | 15 -
deps/npm/node_modules/npm-profile/LICENSE.md | 20 +
.../npm-profile/{ => lib}/index.js | 42 +-
.../npm/node_modules/npm-profile/package.json | 30 +-
.../npm-registry-fetch/LICENSE.md | 26 +-
.../npm-registry-fetch/{ => lib}/auth.js | 16 +-
.../{ => lib}/check-response.js | 16 +-
.../{ => lib}/default-opts.js | 2 +-
.../npm-registry-fetch/{ => lib}/errors.js | 5 +-
.../npm-registry-fetch/{ => lib}/index.js | 55 ++-
.../npm-registry-fetch/{ => lib}/silentlog.js | 0
.../npm-registry-fetch/package.json | 30 +-
deps/npm/node_modules/object-assign/index.js | 90 ----
.../node_modules/object-assign/package.json | 42 --
deps/npm/node_modules/object-assign/readme.md | 61 ---
deps/npm/node_modules/pacote/package.json | 4 +-
.../socks-proxy-agent/package.json | 4 +-
.../node_modules/spdx-license-ids/index.json | 4 +
.../spdx-license-ids/package.json | 11 +-
deps/npm/node_modules/wide-align/LICENSE | 0
deps/npm/node_modules/wide-align/align.js | 0
deps/npm/node_modules/wide-align/package.json | 10 +-
deps/npm/package.json | 30 +-
.../smoke-tests/index.js.test.cjs | 11 +
.../test/lib/commands/ci.js.test.cjs | 13 +
.../test/lib/commands/outdated.js.test.cjs | 6 +
.../lib/utils/config/definitions.js.test.cjs | 2 +
.../lib/utils/config/describe-all.js.test.cjs | 2 +
.../lib/utils/validate-lockfile.js.test.cjs | 35 ++
deps/npm/test/lib/commands/access.js | 5 +-
deps/npm/test/lib/commands/ci.js | 85 +++-
deps/npm/test/lib/commands/deprecate.js | 10 +
deps/npm/test/lib/commands/diff.js | 3 +-
deps/npm/test/lib/commands/dist-tag.js | 14 +-
deps/npm/test/lib/commands/hook.js | 63 ++-
deps/npm/test/lib/commands/logout.js | 15 +-
deps/npm/test/lib/commands/outdated.js | 25 +
deps/npm/test/lib/commands/owner.js | 26 +-
deps/npm/test/lib/commands/ping.js | 9 +-
deps/npm/test/lib/commands/publish.js | 20 +-
deps/npm/test/lib/commands/star.js | 44 +-
deps/npm/test/lib/utils/validate-lockfile.js | 82 ++++
229 files changed, 3692 insertions(+), 830 deletions(-)
create mode 100644 deps/npm/lib/utils/validate-lockfile.js
create mode 100644 deps/npm/node_modules/@npmcli/fs/lib/cp/LICENSE
create mode 100644 deps/npm/node_modules/@npmcli/fs/lib/cp/index.js
create mode 100644 deps/npm/node_modules/@npmcli/fs/lib/cp/polyfill.js
create mode 100644 deps/npm/node_modules/@npmcli/fs/lib/errors.js
rename deps/npm/node_modules/{object-assign/license => @tootallnate/once/LICENSE} (83%)
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/types.d.ts
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/types.js
create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/types.js.map
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/package.json
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/package.json
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js
create mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/package.json
delete mode 100644 deps/npm/node_modules/npm-profile/LICENSE
create mode 100644 deps/npm/node_modules/npm-profile/LICENSE.md
rename deps/npm/node_modules/npm-profile/{ => lib}/index.js (92%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/auth.js (94%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/check-response.js (89%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/default-opts.js (90%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/errors.js (97%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/index.js (87%)
rename deps/npm/node_modules/npm-registry-fetch/{ => lib}/silentlog.js (100%)
delete mode 100644 deps/npm/node_modules/object-assign/index.js
delete mode 100644 deps/npm/node_modules/object-assign/package.json
delete mode 100644 deps/npm/node_modules/object-assign/readme.md
mode change 100644 => 100755 deps/npm/node_modules/wide-align/LICENSE
mode change 100644 => 100755 deps/npm/node_modules/wide-align/align.js
mode change 100644 => 100755 deps/npm/node_modules/wide-align/package.json
create mode 100644 deps/npm/tap-snapshots/test/lib/commands/ci.js.test.cjs
create mode 100644 deps/npm/tap-snapshots/test/lib/utils/validate-lockfile.js.test.cjs
create mode 100644 deps/npm/test/lib/utils/validate-lockfile.js
diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md
index 5d61aac52a1822..530df0971c8ebe 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 83a385e08344f5..0af538fed52bc4 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`.
+
diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html
index 341a3fee9da0e6..8ec85513f733c4 100644
--- a/deps/npm/docs/output/commands/npm-ls.html
+++ b/deps/npm/docs/output/commands/npm-ls.html
@@ -160,7 +160,7 @@ Description
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard
in npm's source tree will show:
-npm@8.3.2 /path/to/npm
+npm@8.4.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index ab49c472ab6075..54650f61b9d0d1 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -149,7 +149,7 @@ Table of contents
npm <command> [args]
Version
-8.3.2
+8.4.1
Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html
index 590749131e99b4..9aed0d3070d90e 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 @@
bundledDependencies
can be installed in a new project by executing npm install awesome-web-framework-1.0.0.tgz
. Note that the package names do not
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
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 b96eecd3902657..96e6f781381153 100644
--- a/deps/npm/docs/output/using-npm/config.html
+++ b/deps/npm/docs/output/using-npm/config.html
@@ -1100,6 +1100,7 @@
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
.
package-lock-only
diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js
index f61c97d6f90de8..7d3930dacbce98 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 2c2f8da866653e..5e862a473a70ff 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 839e974caf09b7..5505b9bf77cf7e 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 d737a58dc43d8d..b3855aa08f3f18 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 bf2dffe9120308..e2b013206d3aa8 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 2881f044e8e286..c99a99585897a9 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 4e6bab9859551c..34fbace583562a 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 e1a6f8150aae1d..0cb5b4247a0009 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 c027ad6464557c..7b76b7be42ec68 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 993e029d45651a..27089be4e17145 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 1250ed7d1c756b..9786e9ba4d4cf1 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 b8209374925fe2..339c80daad65ec 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 ec116058994373..4974c39883e439 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 3d2fff0f069d72..e3fb9b83c5a274 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 df80f1afec44ee..cfb5ab666565a7 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 85c366381cc7af..42c9c1db963e1a 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 dbf32c0e737406..07ebe2e2447536 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 95d79f0f053253..79222881c97342 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 00000000000000..29161ec55bb797
--- /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 400e41ba630e3d..cd47aaac579ebe 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 43273a5c7f6ab2..7539f3d983884e 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 23ad2c4f5e35eb..8968fda01b9aba 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 a9fcca68865566..fc8787e881c67d 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 97431843d22977..a4375f62f4eca4 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 e696f17f7a8f7e..113d6aca915c8e 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 df1f1c9831e8aa..b54060b14d6362 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 7ac09937c939e1..865ddbd9cbb6fa 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 ce13c858854129..75561092f293c4 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 cf2734ac96a6e2..8d2d5082a10299 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 36b93d8d8b8855..40cd6b65eb63bd 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 995391d15f470c..97a5f7b73cf4e3 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 bc37884fab8534..ea472e34c82944 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 d794821a7cbdb0..41f3e723d52a99 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 49bfe6e2ddaf60..9306593324662b 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 e20c8af84383c7..b7e3a1258f7bb1 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 46140f0993ee9e..cdb86e43a76218 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 7467b24a155782..e036b1c10b71f8 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 1c4f90deb90ab3..9b9dcf3eae7b35 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 162dcf0d443588..5670e811dace3e 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 5a45391788f69c..181beaf362a765 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 299ae9e5945972..8a65bb39cab965 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 d84fbb58849ba8..7f7ac6ee6f0af3 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 4c3bd994398e8f..b4f772c73db1a6 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 7a540d2b14185a..2aa55d63a2de26 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 acc190c20b6661..50da8e31a59502 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 3f1a07292fa0b0..709523d9bf8f0d 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 d6f5c5f07bbe34..c77e379e5aeac7 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 3e7efd00ebbb18..378c342e459f85 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 7be9d44c006bea..f7f121d6dbd19d 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 038eb5e72ddd03..a6dd63ae88af26 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 8c147767fbfa18..45c366aa7dceee 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 947037359c8d51..6e001f2644f212 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 13937da64848cf..3a28988d01211a 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 9f0e0d8bc78463..5ab05b0105c1ea 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 82a42a75716465..410c2e3dd003b8 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 db5e89d1304514..08610b24d1e930 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 7219fbecd13d8a..d4d7139d984eea 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 7fe66a033ef14b..9cd5bfd055ca6e 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 37d62b460273f2..e7d4a13f801c22 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 80e66f59c30926..820d0d6850a5b4 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 7f4dd0934111f6..06c17d369a61d5 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 31fb205ece5158..fe752dbfcfb935 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 549e531902ad65..9c6f50e45d0c71 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 4b9816bfd59662..e2bfadbcb6b2e5 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 6587e358824948..4edb0b7dfd91f6 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 80e6eb14e260f8..2fd5032062a385 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 1d45353ddbdbaf..4ea8ba31c612eb 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 1a407c697ac307..63cdd183c7218a 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 705cc9fbc3a618..3de4cceda83298 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 20af164e278f4d..4325d32fddc2ad 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 314d3914fc1feb..756b08f22cd304 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 1bfa7443897b4a..dd2357ba5d8741 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 0ce06f382655be..3d7ebf14476b50 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 e71fef4ab041c0..c2fb13f42436bf 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 968fee9305c635..5d07f4bf99c4de 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 66aef70b046e9e..ddf5d307f36efa 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 41e8bee4da4b21..affff7d939242e 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 5fc5316a865ee4..eca58debaf8cc6 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 f4c4adf45f7f22..88db2f81166b42 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 38e9f9af68d54e..5e7f7d183e9787 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 5d2fdadfaf6b11..b9239bc5e5e7b6 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 60d67c543b18a9..c637584728724d 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 bdb9becfe23402..64dde670207ba1 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 [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 aee52e51203a1b..f8889038c7f741 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 3c449d41eef97e..5f0c9d7b3a5d30 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 432d11eda9ef44..c894e36b113610 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 01216bd0fdc5c3..ae6ade377178bf 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 983294e9c20ee0..96ea17a22cc532 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 2695e041e7e047..0637ee4f87b83b 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 98de34c0c59e10..8a1f2f35687956 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 0e9cbcb1f2a4b2..cb50d44069c0a6 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\|\.
diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7
index 9deb251a185f08..46eb4d16fc4512 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 0818e0debc0ef8..0630cc4615e100 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 6790323a4f79d4..29b1f57f994df1 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 8f0851011681c4..75607009bdc5cc 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 17a7d3dacb0965..53d96f5e3a2f09 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 b1fd4d17f1149e..44521ae945d2d2 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 33b70e92ca3bef..8190c97cba7052 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 a4c3eef8bebc80..9928675e894310 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 f20a554bd5ee8e..0375e1851495a1 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 0d260858d81c6b..c06ed80265e027 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 d5e70323830b61..45ef93985358b4 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 b45fea0ac61112..bb6971f7ad57ad 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 493a0a78c5c465..5c33f71678a705 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 845be76f64e789..5fc208ff122e08 100644
--- a/deps/npm/node_modules/@npmcli/fs/LICENSE.md
+++ b/deps/npm/node_modules/@npmcli/fs/LICENSE.md
@@ -1,3 +1,5 @@
+
+
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 794d9bba415aef..6cc90f0b07d79f 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 00000000000000..93546dfb7655bf
--- /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 00000000000000..5da4739bdd5282
--- /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 00000000000000..f83ccbf57ecc9e
--- /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 00000000000000..1cd1e05d0c533d
--- /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 f669efc1a91e0b..e40d748a7da607 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 77196b76beb06c..a25c17483b0015 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 b114b73d24e9e8..cb64ac82023f2a 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
similarity index 83%
rename from deps/npm/node_modules/object-assign/license
rename to deps/npm/node_modules/@tootallnate/once/LICENSE
index 654d0bfe943437..c4c56a2a53b2fe 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.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 a7efe943b2acbc..93d02a9a348b50 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 @@
///
import { EventEmitter } from 'events';
-declare function once(emitter: EventEmitter, name: string): once.CancelablePromise;
-declare namespace once {
- interface CancelFunction {
- (): void;
- }
- interface CancelablePromise extends Promise {
- cancel: CancelFunction;
- }
- type CancellablePromise = CancelablePromise;
- function spread(emitter: EventEmitter, name: string): once.CancelablePromise;
+import { EventNames, EventListenerParameters, AbortSignal } from './types';
+export interface OnceOptions {
+ signal?: AbortSignal;
}
-export = once;
+export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>;
diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js b/deps/npm/node_modules/@tootallnate/once/dist/index.js
index bfd0dc88f758b8..ca6385b1b82f88 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 30d20491dbca83..61708ca07f1b09 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 00000000000000..eb2bbc6c6275ec
--- /dev/null
+++ b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts
@@ -0,0 +1,231 @@
+export declare type OverloadedParameters = 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 00000000000000..207186d9e7cca0
--- /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 00000000000000..863f146d625f6c
--- /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 00000000000000..58be8284ab8d3e
--- /dev/null
+++ b/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts
@@ -0,0 +1,17 @@
+///
+import { EventEmitter } from 'events';
+import { OverloadedParameters } from './overloaded-parameters';
+export declare type FirstParameter = T extends [infer R, ...any[]] ? R : never;
+export declare type EventListener = F extends [
+ T,
+ infer R,
+ ...any[]
+] ? R : never;
+export declare type EventParameters = OverloadedParameters;
+export declare type EventNames = FirstParameter>;
+export declare type EventListenerParameters> = WithDefault, Event>>, unknown[]>;
+export declare type WithDefault = [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 00000000000000..11e638d1ee44ae
--- /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 00000000000000..c768b79002615c
--- /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 8343f9fad73aba..69ce947d9c3103 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": [
+ "/test/**/*.test.ts"
+ ]
}
}
diff --git a/deps/npm/node_modules/cli-table3/package.json b/deps/npm/node_modules/cli-table3/package.json
index 7d8542e17c008f..82a4905f6ec4e5 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 8bcef03a0e09e1..fe84ef844da794 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 3ac919c5326114..1e6254af984d0c 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 658c933d28255e..1a9820e262b26b 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
+Copyright (c) 2014-2017 TJ Holowaychuk
+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 b7d70acb9bee82..cb7efa8eec32da 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 ",
+ "author": "Josh Junon ",
"contributors": [
+ "TJ Holowaychuk ",
"Nathan Rajlich (http://n8.io)",
- "Andrew Rhyne ",
- "Josh Junon "
+ "Andrew Rhyne "
],
"license": "MIT",
"scripts": {
diff --git a/deps/npm/node_modules/debug/src/common.js b/deps/npm/node_modules/debug/src/common.js
index 50ce2925101d73..6d571d2844dd95 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 032c7d0b584485..e1cb584739202f 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 1287da1aa450d0..26804ef0a68524 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 02528505168192..aca82804314882 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 7a407620d8e50a..bd3b56aa6dfdbc 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 870dd5d8af267a..659d6e11e80e40 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 8f4ad128989662..d275294854868e 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 78470592517bb9..0caddef2e1676f 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 8d2ba3ad765fd2..760da6cc1be870 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 ff728b5473bc96..1de0cdfe26a956 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 a46de40ac9828a..4f305552732050 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 93297c36338d27..5c4909b1c95055 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 156503af7d3dd8..3fd2d6d5a39617 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 5479e41ae3c3d1..f524426dc65f84 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 1264402321ee75..23903551aa8c1b 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 8d28acf866d932..1808eb2844231c 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 3675dd8ae981a9..095c35c5a25230 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 a2acea156ee6f5..ae2ad8c7667f26 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 31e97c4b033c09..67a66573bebe66 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 cca93d9b4eb5d3..17a6425592bcf7 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 e0959f64ddf9df..ada3c8600dae92 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 dfded79295da1d..233ba67e165502 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 f6138e6e1d13a6..a0c8664adf02aa 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 7e4ed24edb5304..a8b8d2a0198d40 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 dae7b37da40691..7b61953e56f575 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 6d06c76aaa9650..a9a544914c43bb 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 8d4f6a226cb0d8..4788264b16c9f2 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 62f737f0060219..a23167252719be 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 0c7ff3c2e64682..297635f6d34177 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 ",
"Federico Romero ",
@@ -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 00000000000000..a7efe943b2acbc
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts
@@ -0,0 +1,14 @@
+///
+import { EventEmitter } from 'events';
+declare function once(emitter: EventEmitter, name: string): once.CancelablePromise;
+declare namespace once {
+ interface CancelFunction {
+ (): void;
+ }
+ interface CancelablePromise extends Promise {
+ cancel: CancelFunction;
+ }
+ type CancellablePromise = CancelablePromise;
+ function spread(emitter: EventEmitter, name: string): once.CancelablePromise;
+}
+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 00000000000000..bfd0dc88f758b8
--- /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 00000000000000..30d20491dbca83
--- /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 00000000000000..8343f9fad73aba
--- /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 (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 00000000000000..3f043f7f9f7561
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts
@@ -0,0 +1,32 @@
+///
+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;
+}
+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 00000000000000..02528505168192
--- /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 00000000000000..7a407620d8e50a
--- /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 00000000000000..24bdb52efcedcb
--- /dev/null
+++ b/deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts
@@ -0,0 +1,21 @@
+///
+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> {
+ }
+ 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 00000000000000..0a71180594605b
--- /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 00000000000000..e07dae5b08455a
--- /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 00000000000000..870dd5d8af267a
--- /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 (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 00000000000000..8d28acf866d932
--- /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 00000000000000..3675dd8ae981a9
--- /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 00000000000000..a2acea156ee6f5
--- /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 00000000000000..31e97c4b033c09
--- /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 00000000000000..cca93d9b4eb5d3
--- /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 00000000000000..f7684d562b7fae
--- /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 00000000000000..e0959f64ddf9df
--- /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 00000000000000..dfded79295da1d
--- /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 00000000000000..6028bc0725129a
--- /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 00000000000000..f6138e6e1d13a6
--- /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 00000000000000..7e4ed24edb5304
--- /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 00000000000000..dae7b37da40691
--- /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 7953647e7760b8..00000000000000
--- 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 00000000000000..5fc208ff122e08
--- /dev/null
+++ b/deps/npm/node_modules/npm-profile/LICENSE.md
@@ -0,0 +1,20 @@
+
+
+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
similarity index 92%
rename from deps/npm/node_modules/npm-profile/index.js
rename to deps/npm/node_modules/npm-profile/lib/index.js
index 4f2a2ae7cc2ff2..aa322e37f4824a 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 43cc7c921bb049..8745c2559f33fa 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 (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 8d28acf866d932..5fc208ff122e08 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 @@
+
+
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
similarity index 94%
rename from deps/npm/node_modules/npm-registry-fetch/auth.js
rename to deps/npm/node_modules/npm-registry-fetch/lib/auth.js
index 01a4436a5d2a88..e6b50b12eb2074 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
similarity index 89%
rename from deps/npm/node_modules/npm-registry-fetch/check-response.js
rename to deps/npm/node_modules/npm-registry-fetch/lib/check-response.js
index 8bd85661ee8cae..26043a96de854e 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
similarity index 90%
rename from deps/npm/node_modules/npm-registry-fetch/default-opts.js
rename to deps/npm/node_modules/npm-registry-fetch/lib/default-opts.js
index 9ca3f97d0352e9..e8e8221da4a589 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
similarity index 97%
rename from deps/npm/node_modules/npm-registry-fetch/errors.js
rename to deps/npm/node_modules/npm-registry-fetch/lib/errors.js
index e65e5fbd80ddaf..0efc923e3e900f 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
similarity index 87%
rename from deps/npm/node_modules/npm-registry-fetch/index.js
rename to deps/npm/node_modules/npm-registry-fetch/lib/index.js
index 35fab75bcade98..19c921403e5cd0 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
similarity index 100%
rename from deps/npm/node_modules/npm-registry-fetch/silentlog.js
rename to 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 e4eaabaa5b09a6..ff4482b1fdc9e0 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 0930cf8890b9af..00000000000000
--- 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 503eb1e6d0f5a1..00000000000000
--- 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 1be09d35c776cc..00000000000000
--- 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 d0fe0a065b414f..ffbc067f68dee6 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 (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 a6b7efa89bc7ef..460043188eb255 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 7c498132d469be..a2f18e40160aa7 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 1d696a7107a2d5..61b10edc24cebf 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
old mode 100644
new mode 100755
diff --git a/deps/npm/node_modules/wide-align/align.js b/deps/npm/node_modules/wide-align/align.js
old mode 100644
new mode 100755
diff --git a/deps/npm/node_modules/wide-align/package.json b/deps/npm/node_modules/wide-align/package.json
old mode 100644
new mode 100755
index 1c31f9984e8f7b..2dd27074c77770
--- 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 508f6158471235..10688636e66559 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 c1316e04d7ad99..2bcf58cb4919b0 100644
--- a/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs
+++ b/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs
@@ -40,6 +40,17 @@ Configuration fields: npm help 7 config
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/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 00000000000000..d6a7471778aebc
--- /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 c286ad734e6b8f..ef6baa96661955 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 459c5de8dc2843..ab706be89b8354 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 ffa6617328bc62..58958ebdab9549 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\`.
+
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 00000000000000..98a51267b1f4ee
--- /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 298897e4f5ffc6..c4e6f3167aa01f 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 537d0784f8963c..978cd03b877e60 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 02256d08edb847..aa158cca3a1a1a 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 ed0702e3784a6b..f73a543cb4c511 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 756a09d7de002f..b83c30e9c64ea7 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 cd4b38787280fd..a4eee711fe8e02 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 ee01e7500d1412..1a1fbb785c808f 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 245e93039c3f32..3bf42b10a26015 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 b5d4d1584289d7..a32a3df9b7dde6 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 no maintainers', async t => {
})
t.test('owner add ', 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 ', 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 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 cwd package', async t => {
})
t.test('owner add already an owner', async t => {
- t.plan(2)
+ t.plan(3)
result = ''
log.info = (title, msg) => {
@@ -285,6 +289,7 @@ t.test('owner add 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 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 fails to retrieve user', async t => {
t.test('owner add 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 fails to PUT updates', async t => {
})
t.test('owner add 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 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 fails to retrieve user info', async t => {
t.test('owner add 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 no cwd package', async t => {
})
t.test('owner rm ', 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 ', 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 ', async t => {
})
t.test('owner rm 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 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 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 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 f808e0ac3ba2ad..19ba9d586b7637 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 2a591fd4c75340..52d4c1b3429080 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 9a49036422d5e2..2f4ddc9dc64394 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 00000000000000..25939c5f89cda5
--- /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'
+ )
+})
From 74c0464572bd01c5d84848a4d2742a6bcfa7dba7 Mon Sep 17 00:00:00 2001
From: npm-robot
Date: Fri, 11 Feb 2022 11:51:11 +0200
Subject: [PATCH 003/168] deps: upgrade npm to 8.5.0
PR-URL: https://github.com/nodejs/node/pull/41925
Reviewed-By: Derek Lewis
Reviewed-By: Mohammed Keyvanzadeh
Reviewed-By: Luigi Pinca
Reviewed-By: Mestery
---
deps/npm/docs/content/commands/npm-exec.md | 1 +
deps/npm/docs/content/commands/npx.md | 1 +
deps/npm/docs/content/using-npm/config.md | 2 +-
deps/npm/docs/output/commands/npm-exec.html | 1 +
deps/npm/docs/output/commands/npm-ls.html | 2 +-
deps/npm/docs/output/commands/npm.html | 2 +-
deps/npm/docs/output/commands/npx.html | 1 +
deps/npm/docs/output/using-npm/config.html | 2 +-
deps/npm/lib/commands/org.js | 6 +-
deps/npm/lib/commands/pack.js | 17 +-
deps/npm/lib/commands/publish.js | 3 +-
deps/npm/lib/commands/unpublish.js | 2 +-
deps/npm/lib/utils/config/definitions.js | 5 +-
deps/npm/man/man1/npm-exec.1 | 2 +
deps/npm/man/man1/npm-ls.1 | 2 +-
deps/npm/man/man1/npm.1 | 2 +-
deps/npm/man/man1/npx.1 | 2 +
deps/npm/man/man7/config.7 | 2 +-
.../arborist/lib/arborist/build-ideal-tree.js | 50 +-
.../@npmcli/arborist/lib/arborist/reify.js | 5 +
.../@npmcli/arborist/package.json | 2 +-
.../@npmcli/config/lib/env-replace.js | 5 +-
.../node_modules/@npmcli/config/lib/index.js | 206 +++++--
.../@npmcli/config/lib/parse-field.js | 22 +-
.../@npmcli/config/lib/set-envs.js | 29 +-
.../@npmcli/config/lib/type-defs.js | 6 +-
.../@npmcli/config/lib/type-description.js | 9 +-
.../node_modules/@npmcli/config/lib/umask.js | 13 +-
.../node_modules/@npmcli/config/package.json | 20 +-
.../are-we-there-yet/package.json | 18 +-
deps/npm/node_modules/libnpmpack/lib/index.js | 11 +
deps/npm/node_modules/libnpmpack/package.json | 2 +-
.../make-fetch-happen/lib/agent.js | 2 +-
.../node_modules/lru-cache/LICENSE | 15 +
.../node_modules/lru-cache/index.js | 581 ++++++++++++++++++
.../node_modules/lru-cache/package.json | 34 +
.../make-fetch-happen/package.json | 34 +-
.../npm-registry-fetch/lib/auth.js | 1 +
.../npm-registry-fetch/package.json | 29 +-
deps/npm/node_modules/npmlog/lib/log.js | 9 +-
deps/npm/node_modules/npmlog/package.json | 15 +-
deps/npm/package.json | 14 +-
.../test/lib/load-all-commands.js.test.cjs | 12 +-
.../lib/utils/config/definitions.js.test.cjs | 2 +-
.../lib/utils/config/describe-all.js.test.cjs | 2 +-
.../test/lib/utils/npm-usage.js.test.cjs | 12 +-
deps/npm/test/lib/commands/org.js | 63 +-
deps/npm/test/lib/commands/unpublish.js | 9 +-
48 files changed, 1051 insertions(+), 236 deletions(-)
create mode 100644 deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE
create mode 100644 deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/index.js
create mode 100644 deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/package.json
diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md
index db23536628e476..d154f5780b9c9c 100644
--- a/deps/npm/docs/content/commands/npm-exec.md
+++ b/deps/npm/docs/content/commands/npm-exec.md
@@ -388,3 +388,4 @@ project.
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
* [npm workspaces](/using-npm/workspaces)
+* [npx](/commands/npx)
diff --git a/deps/npm/docs/content/commands/npx.md b/deps/npm/docs/content/commands/npx.md
index 625ac3d8cd6025..c1aae0b9ff0f86 100644
--- a/deps/npm/docs/content/commands/npx.md
+++ b/deps/npm/docs/content/commands/npx.md
@@ -175,3 +175,4 @@ This resulted in some shifts in its functionality:
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
+* [npm exec](/commands/npm-exec)
diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md
index 0af538fed52bc4..9fbb614564df88 100644
--- a/deps/npm/docs/content/using-npm/config.md
+++ b/deps/npm/docs/content/using-npm/config.md
@@ -1351,7 +1351,7 @@ If a package would be saved at install time by the use of `--save`,
`--save-dev`, or `--save-optional`, then also put it in the
`bundleDependencies` list.
-Ignore if `--save-peer` is set, since peerDependencies cannot be bundled.
+Ignored if `--save-peer` is set, since peerDependencies cannot be bundled.
diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html
index eeb8946b7db6a5..89398e3147cd52 100644
--- a/deps/npm/docs/output/commands/npm-exec.html
+++ b/deps/npm/docs/output/commands/npm-exec.html
@@ -440,6 +440,7 @@ See Also
npm stop
npm config
npm workspaces
+npx
diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html
index 8ec85513f733c4..aad51caaa78902 100644
--- a/deps/npm/docs/output/commands/npm-ls.html
+++ b/deps/npm/docs/output/commands/npm-ls.html
@@ -160,7 +160,7 @@ Description
the results to only the paths to the packages named. Note that nested
packages will also show the paths to the specified packages. For
example, running npm ls promzard
in npm's source tree will show:
-npm@8.4.1 /path/to/npm
+npm@8.5.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 54650f61b9d0d1..6ec841a55ebef3 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -149,7 +149,7 @@ Table of contents
npm <command> [args]
Version
-8.4.1
+8.5.0
Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
diff --git a/deps/npm/docs/output/commands/npx.html b/deps/npm/docs/output/commands/npx.html
index cd7fe02dd7865f..095de7ae0e9180 100644
--- a/deps/npm/docs/output/commands/npx.html
+++ b/deps/npm/docs/output/commands/npx.html
@@ -277,6 +277,7 @@
See Also
npm restart
npm stop
npm config
+npm exec
diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html
index 96e6f781381153..ef5a0f92634dc0 100644
--- a/deps/npm/docs/output/using-npm/config.html
+++ b/deps/npm/docs/output/using-npm/config.html
@@ -1229,7 +1229,7 @@ save-bundle
If a package would be saved at install time by the use of --save
,
--save-dev
, or --save-optional
, then also put it in the
bundleDependencies
list.
-Ignore if --save-peer
is set, since peerDependencies cannot be bundled.
+Ignored if --save-peer
is set, since peerDependencies cannot be bundled.
save-dev
diff --git a/deps/npm/lib/commands/org.js b/deps/npm/lib/commands/org.js
index c6882a8e263137..89859200fed6be 100644
--- a/deps/npm/lib/commands/org.js
+++ b/deps/npm/lib/commands/org.js
@@ -2,6 +2,7 @@ const liborg = require('libnpmorg')
const otplease = require('../utils/otplease.js')
const Table = require('cli-table3')
const BaseCommand = require('../base-command.js')
+const log = require('../utils/log-shim.js')
class Org extends BaseCommand {
static description = 'Manage orgs'
@@ -32,7 +33,10 @@ class Org extends BaseCommand {
}
async exec ([cmd, orgname, username, role], cb) {
- return otplease(this.npm.flatOptions, opts => {
+ return otplease({
+ ...this.npm.flatOptions,
+ log,
+ }, opts => {
switch (cmd) {
case 'add':
case 'set':
diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js
index 0719fa3b858285..74c29699a05c90 100644
--- a/deps/npm/lib/commands/pack.js
+++ b/deps/npm/lib/commands/pack.js
@@ -1,11 +1,8 @@
-const util = require('util')
const pacote = require('pacote')
const libpack = require('libnpmpack')
const npa = require('npm-package-arg')
-const path = require('path')
const log = require('../utils/log-shim')
const { getContents, logTar } = require('../utils/tar.js')
-const writeFile = util.promisify(require('fs').writeFile)
const BaseCommand = require('../base-command.js')
class Pack extends BaseCommand {
@@ -28,7 +25,6 @@ class Pack extends BaseCommand {
}
const unicode = this.npm.config.get('unicode')
- const dryRun = this.npm.config.get('dry-run')
const json = this.npm.config.get('json')
// Get the manifests and filenames first so we can bail early on manifest
@@ -40,24 +36,15 @@ class Pack extends BaseCommand {
if (!manifest._id) {
throw new Error('Invalid package, must have name and version')
}
-
- const filename = `${manifest.name}-${manifest.version}.tgz`
- .replace(/^@/, '').replace(/\//, '-')
- manifests.push({ arg, filename, manifest })
+ manifests.push({ arg, manifest })
}
// Load tarball names up for printing afterward to isolate from the
// noise generated during packing
const tarballs = []
- for (const { arg, filename, manifest } of manifests) {
+ for (const { arg, manifest } of manifests) {
const tarballData = await libpack(arg, this.npm.flatOptions)
const pkgContents = await getContents(manifest, tarballData)
- const tarballFilename = path.resolve(this.npm.config.get('pack-destination'), filename)
-
- if (!dryRun) {
- await writeFile(tarballFilename, tarballData)
- }
-
tarballs.push(pkgContents)
}
diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js
index 339c80daad65ec..63106c520bd587 100644
--- a/deps/npm/lib/commands/publish.js
+++ b/deps/npm/lib/commands/publish.js
@@ -83,7 +83,8 @@ class Publish extends BaseCommand {
})
}
- const tarballData = await pack(spec, opts)
+ // we pass dryRun: true to libnpmpack so it doesn't write the file to disk
+ const tarballData = await pack(spec, { ...opts, dryRun: true })
const pkgContents = await getContents(manifest, tarballData)
// The purpose of re-reading the manifest is in case it changed,
diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js
index 42c9c1db963e1a..d8410cc13481bc 100644
--- a/deps/npm/lib/commands/unpublish.js
+++ b/deps/npm/lib/commands/unpublish.js
@@ -84,7 +84,7 @@ class Unpublish extends BaseCommand {
)
}
- const opts = this.npm.flatOptions
+ const opts = { ...this.npm.flatOptions, log }
if (!spec || path.resolve(spec.name) === this.npm.localPrefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.
diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js
index 79222881c97342..79e686ca751341 100644
--- a/deps/npm/lib/utils/config/definitions.js
+++ b/deps/npm/lib/utils/config/definitions.js
@@ -1455,6 +1455,7 @@ define('pack-destination', {
description: `
Directory in which \`npm pack\` will save tarballs.
`,
+ flatten,
})
define('parseable', {
@@ -1587,7 +1588,7 @@ define('save', {
default: true,
defaultDescription: `\`true\` unless when using \`npm update\` or
\`npm dedupe\` where it defaults to \`false\``,
- usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer',
+ usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle',
type: Boolean,
short: 'S',
description: `
@@ -1610,7 +1611,7 @@ define('save-bundle', {
\`--save-dev\`, or \`--save-optional\`, then also put it in the
\`bundleDependencies\` list.
- Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled.
+ Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled.
`,
flatten (key, obj, flatOptions) {
// XXX update arborist to just ignore it if resulting saveType is peer
diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1
index cdb86e43a76218..a72d04d647ded3 100644
--- a/deps/npm/man/man1/npm-exec.1
+++ b/deps/npm/man/man1/npm-exec.1
@@ -462,5 +462,7 @@ npm help stop
npm help config
.IP \(bu 2
npm help workspaces
+.IP \(bu 2
+npm help npx
.RE
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index a6dd63ae88af26..ff44f277e9fab5 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
-npm@8\.4\.1 /path/to/npm
+npm@8\.5\.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 64dde670207ba1..45a7a1404083af 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -10,7 +10,7 @@ npm [args]
.RE
.SS Version
.P
-8\.4\.1
+8\.5\.0
.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 f8889038c7f741..80b9629e341489 100644
--- a/deps/npm/man/man1/npx.1
+++ b/deps/npm/man/man1/npx.1
@@ -209,5 +209,7 @@ npm help restart
npm help stop
.IP \(bu 2
npm help config
+.IP \(bu 2
+npm help exec
.RE
diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7
index cb50d44069c0a6..6a62b6a3f058d4 100644
--- a/deps/npm/man/man7/config.7
+++ b/deps/npm/man/man7/config.7
@@ -1704,7 +1704,7 @@ If a package would be saved at install time by the use of \fB\-\-save\fP,
\fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the
\fBbundleDependencies\fP list\.
.P
-Ignore if \fB\-\-save\-peer\fP is set, since peerDependencies cannot be bundled\.
+Ignored if \fB\-\-save\-peer\fP is set, since peerDependencies cannot be bundled\.
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 0375e1851495a1..b7bc56f3e9797b 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
@@ -1250,24 +1250,40 @@ This is a one-time fix-up, please be patient...
// Don't bother to load the manifest for link deps, because the target
// might be within another package that doesn't exist yet.
const { legacyPeerDeps } = this
- return spec.type === 'directory'
- ? this[_linkFromSpec](name, spec, parent, edge)
- : this[_fetchManifest](spec)
- .then(pkg => new Node({ name, pkg, parent, legacyPeerDeps }), error => {
- error.requiredBy = edge.from.location || '.'
-
- // failed to load the spec, either because of enotarget or
- // fetch failure of some other sort. save it so we can verify
- // later that it's optional, otherwise the error is fatal.
- const n = new Node({
- name,
- parent,
- error,
- legacyPeerDeps,
- })
- this[_loadFailures].add(n)
- return n
+
+ // spec is a directory, link it
+ if (spec.type === 'directory') {
+ return this[_linkFromSpec](name, spec, parent, edge)
+ }
+
+ // if the spec matches a workspace name, then see if the workspace node will
+ // satisfy the edge. if it does, we return the workspace node to make sure it
+ // takes priority.
+ if (this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name)) {
+ const existingNode = this.idealTree.edgesOut.get(spec.name).to
+ if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) {
+ return edge.to
+ }
+ }
+
+ // spec isn't a directory, and either isn't a workspace or the workspace we have
+ // doesn't satisfy the edge. try to fetch a manifest and build a node from that.
+ return this[_fetchManifest](spec)
+ .then(pkg => new Node({ name, pkg, parent, legacyPeerDeps }), error => {
+ error.requiredBy = edge.from.location || '.'
+
+ // failed to load the spec, either because of enotarget or
+ // fetch failure of some other sort. save it so we can verify
+ // later that it's optional, otherwise the error is fatal.
+ const n = new Node({
+ name,
+ parent,
+ error,
+ legacyPeerDeps,
})
+ this[_loadFailures].add(n)
+ return n
+ })
}
[_linkFromSpec] (name, spec, parent, edge) {
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 45ef93985358b4..91507fd791871c 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js
@@ -1369,6 +1369,10 @@ module.exports = cls => class Reifier extends cls {
devDependencies = {},
optionalDependencies = {},
peerDependencies = {},
+ // bundleDependencies is not required by PackageJson like the other fields here
+ // PackageJson also doesn't omit an empty array for this field so defaulting this
+ // to an empty array would add that field to every package.json file.
+ bundleDependencies,
} = tree.package
pkgJson.update({
@@ -1376,6 +1380,7 @@ module.exports = cls => class Reifier extends cls {
devDependencies,
optionalDependencies,
peerDependencies,
+ bundleDependencies,
})
await pkgJson.save()
}
diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json
index 5c33f71678a705..a915c9d8b1f6fc 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.3.0",
+ "version": "4.3.1",
"description": "Manage node_modules trees",
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
diff --git a/deps/npm/node_modules/@npmcli/config/lib/env-replace.js b/deps/npm/node_modules/@npmcli/config/lib/env-replace.js
index 464dc550b00fb7..a6e4b2968d04ef 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/env-replace.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/env-replace.js
@@ -3,11 +3,12 @@
const envExpr = /(\\*)\$\{([^}]+)\}/g
module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => {
- const val = env[name] !== undefined ? env[name] : `\$\{${name}\}`
+ const val = env[name] !== undefined ? env[name] : `$\{${name}}`
// consume the escape chars that are relevant.
- if (esc.length % 2)
+ if (esc.length % 2) {
return orig.substr((esc.length + 1) / 2)
+ }
return (esc.substr(esc.length / 2)) + val
})
diff --git a/deps/npm/node_modules/@npmcli/config/lib/index.js b/deps/npm/node_modules/@npmcli/config/lib/index.js
index 293fad2ec56c37..dc839a5389c3a8 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/index.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/index.js
@@ -3,6 +3,8 @@ const walkUp = require('walk-up-path')
const ini = require('ini')
const nopt = require('nopt')
const mkdirp = require('mkdirp-infer-owner')
+const mapWorkspaces = require('@npmcli/map-workspaces')
+const rpj = require('read-package-json-fast')
/* istanbul ignore next */
const myUid = process.getuid && process.getuid()
@@ -91,7 +93,6 @@ class Config {
execPath = process.execPath,
cwd = process.cwd(),
}) {
-
// turn the definitions into nopt's weirdo syntax
this.definitions = definitions
const types = {}
@@ -100,8 +101,9 @@ class Config {
for (const [key, def] of Object.entries(definitions)) {
defaults[key] = def.default
types[key] = def.type
- if (def.deprecated)
+ if (def.deprecated) {
this.deprecated[key] = def.deprecated.trim().replace(/\n +/, '\n')
+ }
}
// populated the first time we flatten the object
@@ -162,41 +164,48 @@ class Config {
// return the location where key is found.
find (key) {
- if (!this.loaded)
+ if (!this.loaded) {
throw new Error('call config.load() before reading values')
+ }
return this[_find](key)
}
+
[_find] (key) {
// have to look in reverse order
const entries = [...this.data.entries()]
for (let i = entries.length - 1; i > -1; i--) {
const [where, { data }] = entries[i]
- if (hasOwnProperty(data, key))
+ if (hasOwnProperty(data, key)) {
return where
+ }
}
return null
}
get (key, where) {
- if (!this.loaded)
+ if (!this.loaded) {
throw new Error('call config.load() before reading values')
+ }
return this[_get](key, where)
}
+
// we need to get values sometimes, so use this internal one to do so
// while in the process of loading.
[_get] (key, where = null) {
if (where !== null && !confTypes.has(where)) {
throw new Error('invalid config location param: ' + where)
}
- const { data, source } = this.data.get(where || 'cli')
+ const { data } = this.data.get(where || 'cli')
return where === null || hasOwnProperty(data, key) ? data[key] : undefined
}
set (key, val, where = 'cli') {
- if (!this.loaded)
+ if (!this.loaded) {
throw new Error('call config.load() before setting values')
- if (!confTypes.has(where))
+ }
+ if (!confTypes.has(where)) {
throw new Error('invalid config location param: ' + where)
+ }
this[_checkDeprecated](key)
const { data } = this.data.get(where)
data[key] = val
@@ -209,8 +218,9 @@ class Config {
}
get flat () {
- if (this[_flatOptions])
+ if (this[_flatOptions]) {
return this[_flatOptions]
+ }
// create the object for flat options passed to deps
process.emit('time', 'config:load:flatten')
@@ -225,16 +235,19 @@ class Config {
}
delete (key, where = 'cli') {
- if (!this.loaded)
+ if (!this.loaded) {
throw new Error('call config.load() before deleting values')
- if (!confTypes.has(where))
+ }
+ if (!confTypes.has(where)) {
throw new Error('invalid config location param: ' + where)
+ }
delete this.data.get(where).data[key]
}
async load () {
- if (this.loaded)
+ if (this.loaded) {
throw new Error('attempting to load npm config multiple times')
+ }
process.emit('time', 'config:load')
// first load the defaults, which sets the global prefix
@@ -282,7 +295,9 @@ class Config {
const creds = this.getCredentialsByURI(reg)
// ignore this error because a failed set will strip out anything that
// might be a security hazard, which was the intention.
- try { this.setCredentialsByURI(reg, creds) } catch (_) {}
+ try {
+ this.setCredentialsByURI(reg, creds)
+ } catch (_) {}
process.emit('timeEnd', 'config:load:credentials')
// set proper globalPrefix now that everything is loaded
@@ -319,14 +334,16 @@ class Config {
}
loadHome () {
- if (this.env.HOME)
+ if (this.env.HOME) {
return this.home = this.env.HOME
+ }
this.home = homedir()
}
loadGlobalPrefix () {
- if (this.globalPrefix)
+ if (this.globalPrefix) {
throw new Error('cannot load default global prefix more than once')
+ }
if (this.env.PREFIX) {
this.globalPrefix = this.env.PREFIX
@@ -338,17 +355,18 @@ class Config {
this.globalPrefix = dirname(dirname(this.execPath))
// destdir only is respected on Unix
- if (this.env.DESTDIR)
+ if (this.env.DESTDIR) {
this.globalPrefix = join(this.env.DESTDIR, this.globalPrefix)
+ }
}
}
loadEnv () {
- const prefix = 'npm_config_'
const conf = Object.create(null)
for (const [envKey, envVal] of Object.entries(this.env)) {
- if (!/^npm_config_/i.test(envKey) || envVal === '')
+ if (!/^npm_config_/i.test(envKey) || envVal === '') {
continue
+ }
const key = envKey.substr('npm_config_'.length)
.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key
.toLowerCase()
@@ -368,9 +386,10 @@ class Config {
}
get valid () {
- for (const [where, {valid}] of this.data.entries()) {
- if (valid === false || valid === null && !this.validate(where))
+ for (const [where, { valid }] of this.data.entries()) {
+ if (valid === false || valid === null && !this.validate(where)) {
return false
+ }
}
return true
}
@@ -378,11 +397,12 @@ class Config {
validate (where) {
if (!where) {
let valid = true
- for (const [where, obj] of this.data.entries()) {
+ for (const [where] of this.data.entries()) {
// no need to validate our defaults, we know they're fine
// cli was already validated when parsed the first time
- if (where === 'default' || where === 'builtin' || where === 'cli')
+ if (where === 'default' || where === 'builtin' || where === 'cli') {
continue
+ }
const ret = this.validate(where)
valid = valid && ret
}
@@ -424,14 +444,15 @@ class Config {
this.data.get(where)[_valid] = false
if (Array.isArray(type)) {
- if (type.includes(typeDefs.url.type))
+ if (type.includes(typeDefs.url.type)) {
type = typeDefs.url.type
- else {
+ } else {
/* istanbul ignore if - no actual configs matching this, but
* path types SHOULD be handled this way, like URLs, for the
* same reason */
- if (type.includes(typeDefs.path.type))
+ if (type.includes(typeDefs.path.type)) {
type = typeDefs.path.type
+ }
}
}
@@ -469,15 +490,17 @@ class Config {
this.sources.set(source, where)
if (er) {
conf.loadError = er
- if (er.code !== 'ENOENT')
+ if (er.code !== 'ENOENT') {
this.log.verbose('config', `error loading ${where} config`, er)
+ }
} else {
conf.raw = obj
for (const [key, value] of Object.entries(obj)) {
const k = envReplace(key, this.env)
const v = this.parseField(value, k)
- if (where !== 'default')
+ if (where !== 'default') {
this[_checkDeprecated](k, where, obj, [key, value])
+ }
conf.data[k] = v
}
}
@@ -528,9 +551,9 @@ class Config {
// up loading the "project" config where the "userconfig" will be,
// which causes some calamaties. So, we only load project config if
// it doesn't match what the userconfig will be.
- if (projectFile !== this[_get]('userconfig'))
+ if (projectFile !== this[_get]('userconfig')) {
return this[_loadFile](projectFile, 'project')
- else {
+ } else {
this.data.get('project').source = '(same as "user" config, ignored)'
this.sources.set(this.data.get('project').source, 'project')
}
@@ -543,23 +566,65 @@ class Config {
return
}
+ const cliWorkspaces = this[_get]('workspaces', 'cli')
+
for (const p of walkUp(this.cwd)) {
- // walk up until we have a nm dir or a pj file
- const hasAny = (await Promise.all([
- stat(resolve(p, 'node_modules'))
- .then(st => st.isDirectory())
- .catch(() => false),
- stat(resolve(p, 'package.json'))
- .then(st => st.isFile())
- .catch(() => false),
- ])).some(is => is)
- if (hasAny) {
+ const hasNodeModules = await stat(resolve(p, 'node_modules'))
+ .then((st) => st.isDirectory())
+ .catch(() => false)
+
+ const hasPackageJson = await stat(resolve(p, 'package.json'))
+ .then((st) => st.isFile())
+ .catch(() => false)
+
+ if (!this.localPrefix && (hasNodeModules || hasPackageJson)) {
this.localPrefix = p
- return
+
+ // if workspaces are disabled, return now
+ if (cliWorkspaces === false) {
+ return
+ }
+
+ // otherwise, continue the loop
+ continue
+ }
+
+ if (this.localPrefix && hasPackageJson) {
+ // if we already set localPrefix but this dir has a package.json
+ // then we need to see if `p` is a workspace root by reading its package.json
+ // however, if reading it fails then we should just move on
+ const pkg = await rpj(resolve(p, 'package.json')).catch(() => false)
+ if (!pkg) {
+ continue
+ }
+
+ const workspaces = await mapWorkspaces({ cwd: p, pkg })
+ for (const w of workspaces.values()) {
+ if (w === this.localPrefix) {
+ // see if there's a .npmrc file in the workspace, if so log a warning
+ const hasNpmrc = await stat(resolve(this.localPrefix, '.npmrc'))
+ .then((st) => st.isFile())
+ .catch(() => false)
+
+ if (hasNpmrc) {
+ this.log.warn(`ignoring workspace config at ${this.localPrefix}/.npmrc`)
+ }
+
+ // set the workspace in the default layer, which allows it to be overridden easily
+ const { data } = this.data.get('default')
+ data.workspace = [this.localPrefix]
+ this.localPrefix = p
+ this.log.info(`found workspace root at ${this.localPrefix}`)
+ // we found a root, so we return now
+ return
+ }
+ }
}
}
- this.localPrefix = this.cwd
+ if (!this.localPrefix) {
+ this.localPrefix = this.cwd
+ }
}
loadUserConfig () {
@@ -571,10 +636,12 @@ class Config {
}
async save (where) {
- if (!this.loaded)
+ if (!this.loaded) {
throw new Error('call config.load() before saving')
- if (!confFileTypes.has(where))
+ }
+ if (!confFileTypes.has(where)) {
throw new Error('invalid config location param: ' + where)
+ }
const conf = this.data.get(where)
conf[_raw] = { ...conf.data }
conf[_loadError] = null
@@ -586,7 +653,9 @@ class Config {
// we ignore this error because the failed set already removed
// anything that might be a security hazard, and it won't be
// saved back to the .npmrc file, so we're good.
- try { this.setCredentialsByURI(reg, creds) } catch (_) {}
+ try {
+ this.setCredentialsByURI(reg, creds)
+ } catch (_) {}
}
const iniData = ini.stringify(conf.data).trim() + '\n'
@@ -602,8 +671,9 @@ class Config {
/* istanbul ignore if - this is best-effort and a pita to test */
if (myUid === 0) {
const st = await stat(dir).catch(() => null)
- if (st && (st.uid !== myUid || st.gid !== myGid))
+ if (st && (st.uid !== myUid || st.gid !== myGid)) {
await chown(conf.source, st.uid, st.gid).catch(() => {})
+ }
}
const mode = where === 'user' ? 0o600 : 0o666
await chmod(conf.source, mode)
@@ -651,8 +721,9 @@ class Config {
email = email ||
this.get('email', 'user') ||
this.get(`${nerfed}:email`, 'user')
- if (email)
+ if (email) {
this.set('email', email, 'user')
+ }
}
// field that hasn't been used as documented for a LONG time,
@@ -668,10 +739,12 @@ class Config {
this.delete(`${nerfed}:_password`, 'user')
this.delete(`${nerfed}:username`, 'user')
} else if (username || password) {
- if (!username)
+ if (!username) {
throw new Error('must include username')
- if (!password)
+ }
+ if (!password) {
throw new Error('must include password')
+ }
this.delete(`${nerfed}:_authToken`, 'user')
this.set(`${nerfed}:username`, username, 'user')
// note: not encrypted, no idea why we bothered to do this, but oh well
@@ -689,8 +762,9 @@ class Config {
const creds = {}
const email = this.get(`${nerfed}:email`) || this.get('email')
- if (email)
+ if (email) {
creds.email = email
+ }
const tokenReg = this.get(`${nerfed}:_authToken`) ||
this.get(`${nerfed}:_authtoken`) ||
@@ -725,8 +799,9 @@ class Config {
// at this point, we can only use the values if the URI is the
// default registry.
const defaultNerf = nerfDart(this.get('registry'))
- if (nerfed !== defaultNerf)
+ if (nerfed !== defaultNerf) {
return creds
+ }
const userDef = this.get('username')
const passDef = this.get('_password')
@@ -741,8 +816,9 @@ class Config {
// Handle the old-style _auth= style for the default
// registry, if set.
const auth = this.get('_auth')
- if (!auth)
+ if (!auth) {
return creds
+ }
const authDecode = Buffer.from(auth, 'base64').toString('utf8')
const authSplit = authDecode.split(':')
@@ -755,7 +831,9 @@ class Config {
// set up the environment object we have with npm_config_* environs
// for all configs that are different from their default values, and
// set EDITOR and HOME.
- setEnvs () { setEnvs(this) }
+ setEnvs () {
+ setEnvs(this)
+ }
}
const _data = Symbol('data')
@@ -781,25 +859,37 @@ class ConfigData {
}
set source (s) {
- if (this[_source])
+ if (this[_source]) {
throw new Error('cannot set ConfigData source more than once')
+ }
this[_source] = s
}
- get source () { return this[_source] }
+
+ get source () {
+ return this[_source]
+ }
set loadError (e) {
- if (this[_loadError] || this[_raw])
+ if (this[_loadError] || this[_raw]) {
throw new Error('cannot set ConfigData loadError after load')
+ }
this[_loadError] = e
}
- get loadError () { return this[_loadError] }
+
+ get loadError () {
+ return this[_loadError]
+ }
set raw (r) {
- if (this[_raw] || this[_loadError])
+ if (this[_raw] || this[_loadError]) {
throw new Error('cannot set ConfigData raw after load')
+ }
this[_raw] = r
}
- get raw () { return this[_raw] }
+
+ get raw () {
+ return this[_raw]
+ }
}
module.exports = Config
diff --git a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
index 95b8d9f272003a..9428996c98a35c 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js
@@ -6,10 +6,11 @@ const { resolve } = require('path')
const { parse: umaskParse } = require('./umask.js')
const parseField = (f, key, opts, listElement = false) => {
- if (typeof f !== 'string' && !Array.isArray(f))
+ if (typeof f !== 'string' && !Array.isArray(f)) {
return f
+ }
- const { platform, types, log, home, env } = opts
+ const { platform, types, home, env } = opts
// type can be array or a single thing. coerce to array.
const typeList = new Set([].concat(types[key]))
@@ -20,8 +21,9 @@ const parseField = (f, key, opts, listElement = false) => {
const isNumber = typeList.has(typeDefs.Number.type)
const isList = !listElement && typeList.has(Array)
- if (Array.isArray(f))
+ if (Array.isArray(f)) {
return !isList ? f : f.map(field => parseField(field, key, opts, true))
+ }
// now we know it's a string
f = f.trim()
@@ -29,12 +31,14 @@ const parseField = (f, key, opts, listElement = false) => {
// list types get put in the environment separated by double-\n
// usually a single \n would suffice, but ca/cert configs can contain
// line breaks and multiple entries.
- if (isList)
+ if (isList) {
return parseField(f.split('\n\n'), key, opts)
+ }
// --foo is like --foo=true for boolean types
- if (isBool && !isString && f === '')
+ if (isBool && !isString && f === '') {
return true
+ }
// string types can be the string 'true', 'false', etc.
// otherwise, parse these values out
@@ -51,10 +55,11 @@ const parseField = (f, key, opts, listElement = false) => {
if (isPath) {
const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\//
- if (homePattern.test(f) && home)
+ if (homePattern.test(f) && home) {
f = resolve(home, f.substr(2))
- else
+ } else {
f = resolve(f)
+ }
}
if (isUmask) {
@@ -66,8 +71,9 @@ const parseField = (f, key, opts, listElement = false) => {
}
}
- if (isNumber && !isNaN(f))
+ if (isNumber && !isNaN(f)) {
f = +f
+ }
return f
}
diff --git a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
index 8eed0221ba80ec..0f5781aaf33959 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js
@@ -22,15 +22,17 @@ const sameConfigValue = (def, val) =>
: sameArrayValue(def, val)
const sameArrayValue = (def, val) => {
- if (def.length !== val.length)
+ if (def.length !== val.length) {
return false
+ }
for (let i = 0; i < def.length; i++) {
/* istanbul ignore next - there are no array configs where the default
* is not an empty array, so this loop is a no-op, but it's the correct
* thing to do if we ever DO add a config like that. */
- if (def[i] !== val[i])
+ if (def[i] !== val[i]) {
return false
+ }
}
return true
}
@@ -38,16 +40,15 @@ const sameArrayValue = (def, val) => {
const setEnv = (env, rawKey, rawVal) => {
const val = envVal(rawVal)
const key = envKey(rawKey, val)
- if (key && val !== null)
+ if (key && val !== null) {
env[key] = val
+ }
}
const setEnvs = (config) => {
// This ensures that all npm config values that are not the defaults are
// shared appropriately with child processes, without false positives.
const {
- globalPrefix,
- platform,
env,
defaults,
definitions,
@@ -68,19 +69,22 @@ const setEnvs = (config) => {
const envSet = new Set(Object.keys(envConf))
for (const key in cliConf) {
const { deprecated, envExport = true } = definitions[key] || {}
- if (deprecated || envExport === false)
+ if (deprecated || envExport === false) {
continue
+ }
if (sameConfigValue(defaults[key], cliConf[key])) {
// config is the default, if the env thought different, then we
// have to set it BACK to the default in the environment.
- if (!sameConfigValue(envConf[key], cliConf[key]))
+ if (!sameConfigValue(envConf[key], cliConf[key])) {
setEnv(env, key, cliConf[key])
+ }
} else {
// config is not the default. if the env wasn't the one to set
// it that way, then we have to put it in the env
- if (!(envSet.has(key) && !cliSet.has(key)))
+ if (!(envSet.has(key) && !cliSet.has(key))) {
setEnv(env, key, cliConf[key])
+ }
}
}
@@ -88,16 +92,19 @@ const setEnvs = (config) => {
env.HOME = config.home
env.npm_config_global_prefix = config.globalPrefix
env.npm_config_local_prefix = config.localPrefix
- if (cliConf.editor)
+ if (cliConf.editor) {
env.EDITOR = cliConf.editor
+ }
// note: this doesn't afect the *current* node process, of course, since
// it's already started, but it does affect the options passed to scripts.
- if (cliConf['node-options'])
+ if (cliConf['node-options']) {
env.NODE_OPTIONS = cliConf['node-options']
+ }
- if (require.main && require.main.filename)
+ if (require.main && require.main.filename) {
env.npm_execpath = require.main.filename
+ }
env.NODE = env.npm_node_execpath = config.execPath
}
diff --git a/deps/npm/node_modules/@npmcli/config/lib/type-defs.js b/deps/npm/node_modules/@npmcli/config/lib/type-defs.js
index 049945a3e58123..20a827c3d164e9 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/type-defs.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/type-defs.js
@@ -5,15 +5,17 @@ const { Umask, validate: validateUmask } = require('./umask.js')
const semver = require('semver')
const validateSemver = (data, k, val) => {
const valid = semver.valid(val)
- if (!valid)
+ if (!valid) {
return false
+ }
data[k] = valid
}
const noptValidatePath = nopt.typeDefs.path.validate
const validatePath = (data, k, val) => {
- if (typeof val !== 'string')
+ if (typeof val !== 'string') {
return false
+ }
return noptValidatePath(data, k, val)
}
diff --git a/deps/npm/node_modules/@npmcli/config/lib/type-description.js b/deps/npm/node_modules/@npmcli/config/lib/type-description.js
index 828a747db4aac5..f5e0d164f9edcf 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/type-description.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/type-description.js
@@ -2,15 +2,18 @@
// returns a string for one thing, or an array of descriptions
const typeDefs = require('./type-defs.js')
const typeDescription = t => {
- if (!t || typeof t !== 'function' && typeof t !== 'object')
+ if (!t || typeof t !== 'function' && typeof t !== 'object') {
return t
+ }
- if (Array.isArray(t))
+ if (Array.isArray(t)) {
return t.map(t => typeDescription(t))
+ }
for (const { type, description } of Object.values(typeDefs)) {
- if (type === t)
+ if (type === t) {
return description || type
+ }
}
return t
diff --git a/deps/npm/node_modules/@npmcli/config/lib/umask.js b/deps/npm/node_modules/@npmcli/config/lib/umask.js
index b445c6fca95bfa..195fad23867024 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/umask.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/umask.js
@@ -1,18 +1,21 @@
class Umask {}
const parse = val => {
if (typeof val === 'string') {
- if (/^0o?[0-7]+$/.test(val))
+ if (/^0o?[0-7]+$/.test(val)) {
return parseInt(val.replace(/^0o?/, ''), 8)
- else if (/^[1-9][0-9]*$/.test(val))
+ } else if (/^[1-9][0-9]*$/.test(val)) {
return parseInt(val, 10)
- else
+ } else {
throw new Error(`invalid umask value: ${val}`)
+ }
}
- if (typeof val !== 'number')
+ if (typeof val !== 'number') {
throw new Error(`invalid umask value: ${val}`)
+ }
val = Math.floor(val)
- if (val < 0 || val > 511)
+ if (val < 0 || val > 511) {
throw new Error(`invalid umask value: ${val}`)
+ }
return val
}
diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json
index 83d8a349d224dc..b0722db413e5be 100644
--- a/deps/npm/node_modules/@npmcli/config/package.json
+++ b/deps/npm/node_modules/@npmcli/config/package.json
@@ -1,7 +1,8 @@
{
"name": "@npmcli/config",
- "version": "2.4.0",
+ "version": "3.0.0",
"files": [
+ "bin",
"lib"
],
"main": "lib/index.js",
@@ -10,30 +11,41 @@
"type": "git",
"url": "git+https://github.com/npm/config"
},
- "author": "Isaac Z. Schlueter (https://izs.me)",
+ "author": "GitHub Inc.",
"license": "ISC",
"scripts": {
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
- "prepublishOnly": "git push origin --follow-tags"
+ "prepublishOnly": "git push origin --follow-tags",
+ "lint": "eslint '**/*.js'",
+ "postlint": "npm-template-check",
+ "lintfix": "npm run lint -- --fix",
+ "posttest": "npm run lint",
+ "template-copy": "npm-template-copy --force"
},
"tap": {
"check-coverage": true,
"coverage-map": "map.js"
},
"devDependencies": {
+ "@npmcli/template-oss": "^2.5.1",
"tap": "^15.0.4"
},
"dependencies": {
+ "@npmcli/map-workspaces": "^2.0.0",
"ini": "^2.0.0",
"mkdirp-infer-owner": "^2.0.0",
"nopt": "^5.0.0",
+ "read-package-json-fast": "^2.0.3",
"semver": "^7.3.4",
"walk-up-path": "^1.0.0"
},
"engines": {
- "node": ">=10"
+ "node": "^12.13.0 || ^14.15.0 || >=16"
+ },
+ "templateOSS": {
+ "version": "2.6.0"
}
}
diff --git a/deps/npm/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/are-we-there-yet/package.json
index 5714e09c3b3714..67c01e9cbc8e4f 100644
--- a/deps/npm/node_modules/are-we-there-yet/package.json
+++ b/deps/npm/node_modules/are-we-there-yet/package.json
@@ -1,6 +1,6 @@
{
"name": "are-we-there-yet",
- "version": "2.0.0",
+ "version": "3.0.0",
"description": "Keep track of the overall completion of many disparate processes",
"main": "lib/index.js",
"scripts": {
@@ -13,7 +13,9 @@
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
- "snap": "tap"
+ "snap": "tap",
+ "postlint": "npm-template-check",
+ "template-copy": "npm-template-copy --force"
},
"repository": {
"type": "git",
@@ -26,9 +28,9 @@
},
"homepage": "https://github.com/npm/are-we-there-yet",
"devDependencies": {
- "@npmcli/eslint-config": "^1.0.0",
- "@npmcli/template-oss": "^1.0.2",
- "eslint": "^7.32.0",
+ "@npmcli/eslint-config": "^2.0.0",
+ "@npmcli/template-oss": "^2.7.1",
+ "eslint": "^8.8.0",
"eslint-plugin-node": "^11.1.0",
"tap": "^15.0.9"
},
@@ -41,7 +43,7 @@
"lib"
],
"engines": {
- "node": ">=10"
+ "node": "^12.13.0 || ^14.15.0 || >=16"
},
"tap": {
"branches": 68,
@@ -49,5 +51,7 @@
"functions": 86,
"lines": 92
},
- "templateVersion": "1.0.2"
+ "templateOSS": {
+ "version": "2.7.1"
+ }
}
diff --git a/deps/npm/node_modules/libnpmpack/lib/index.js b/deps/npm/node_modules/libnpmpack/lib/index.js
index 23bb9df4b2247c..a2c95cf938dcf9 100644
--- a/deps/npm/node_modules/libnpmpack/lib/index.js
+++ b/deps/npm/node_modules/libnpmpack/lib/index.js
@@ -3,6 +3,9 @@
const pacote = require('pacote')
const npa = require('npm-package-arg')
const runScript = require('@npmcli/run-script')
+const path = require('path')
+const util = require('util')
+const writeFile = util.promisify(require('fs').writeFile)
module.exports = pack
async function pack (spec = 'file:.', opts = {}) {
@@ -33,6 +36,14 @@ async function pack (spec = 'file:.', opts = {}) {
integrity: manifest._integrity,
})
+ // check for explicit `false` so the default behavior is to skip writing to disk
+ if (opts.dryRun === false) {
+ const filename = `${manifest.name}-${manifest.version}.tgz`
+ .replace(/^@/, '').replace(/\//, '-')
+ const destination = path.resolve(opts.packDestination, filename)
+ await writeFile(destination, tarball)
+ }
+
if (spec.type === 'directory') {
// postpack
await runScript({
diff --git a/deps/npm/node_modules/libnpmpack/package.json b/deps/npm/node_modules/libnpmpack/package.json
index dad28c398585f1..7317c272f7e223 100644
--- a/deps/npm/node_modules/libnpmpack/package.json
+++ b/deps/npm/node_modules/libnpmpack/package.json
@@ -1,6 +1,6 @@
{
"name": "libnpmpack",
- "version": "3.0.1",
+ "version": "3.1.0",
"description": "Programmatic API for the bits behind npm pack",
"author": "GitHub Inc.",
"main": "lib/index.js",
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 095c35c5a25230..b87427755efedf 100644
--- a/deps/npm/node_modules/make-fetch-happen/lib/agent.js
+++ b/deps/npm/node_modules/make-fetch-happen/lib/agent.js
@@ -89,7 +89,7 @@ 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)
+ noproxy = noproxy.split(',').map(n => n.trim())
}
return noproxy && noproxy.some(no => {
diff --git a/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE
new file mode 100644
index 00000000000000..9b58a3e03d1df1
--- /dev/null
+++ b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors
+
+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/make-fetch-happen/node_modules/lru-cache/index.js b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/index.js
new file mode 100644
index 00000000000000..ede2f30cc4b236
--- /dev/null
+++ b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/index.js
@@ -0,0 +1,581 @@
+const perf = typeof performance === 'object' && performance &&
+ typeof performance.now === 'function' ? performance : Date
+
+const warned = new Set()
+const deprecatedOption = (opt, msg) => {
+ const code = `LRU_CACHE_OPTION_${opt}`
+ if (shouldWarn(code)) {
+ warn(code, `The ${opt} option is deprecated. ${msg}`, LRUCache)
+ }
+}
+const deprecatedMethod = (method, msg) => {
+ const code = `LRU_CACHE_METHOD_${method}`
+ if (shouldWarn(code)) {
+ const { prototype } = LRUCache
+ const { get } = Object.getOwnPropertyDescriptor(prototype, method)
+ warn(code, `The ${method} method is deprecated. ${msg}`, get)
+ }
+}
+const deprecatedProperty = (field, msg) => {
+ const code = `LRU_CACHE_PROPERTY_${field}`
+ if (shouldWarn(code)) {
+ const { prototype } = LRUCache
+ const { get } = Object.getOwnPropertyDescriptor(prototype, field)
+ warn(code, `The ${field} property is deprecated. ${msg}`, get)
+ }
+}
+const shouldWarn = (code) => !(process.noDeprecation || warned.has(code))
+const warn = (code, msg, fn) => {
+ warned.add(code)
+ process.emitWarning(msg, 'DeprecationWarning', code, fn)
+}
+
+const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n)
+
+/* istanbul ignore next - This is a little bit ridiculous, tbh.
+ * The maximum array length is 2^32-1 or thereabouts on most JS impls.
+ * And well before that point, you're caching the entire world, I mean,
+ * that's ~32GB of just integers for the next/prev links, plus whatever
+ * else to hold that many keys and values. Just filling the memory with
+ * zeroes at init time is brutal when you get that big.
+ * But why not be complete?
+ * Maybe in the future, these limits will have expanded. */
+const getUintArray = max => !isPosInt(max) ? null
+: max <= Math.pow(2, 8) ? Uint8Array
+: max <= Math.pow(2, 16) ? Uint16Array
+: max <= Math.pow(2, 32) ? Uint32Array
+: max <= Number.MAX_SAFE_INTEGER ? ZeroArray
+: null
+
+class ZeroArray extends Array {
+ constructor (size) {
+ super(size)
+ this.fill(0)
+ }
+}
+
+class Stack {
+ constructor (max) {
+ const UintArray = getUintArray(max)
+ this.heap = new UintArray(max)
+ this.length = 0
+ }
+ push (n) {
+ this.heap[this.length++] = n
+ }
+ pop () {
+ return this.heap[--this.length]
+ }
+}
+
+class LRUCache {
+ constructor (options = {}) {
+ const {
+ max,
+ ttl,
+ ttlResolution = 1,
+ ttlAutopurge,
+ updateAgeOnGet,
+ allowStale,
+ dispose,
+ disposeAfter,
+ noDisposeOnSet,
+ maxSize,
+ sizeCalculation,
+ } = options
+
+ // deprecated options, don't trigger a warning for getting them if
+ // the thing being passed in is another LRUCache we're copying.
+ const {
+ length,
+ maxAge,
+ stale,
+ } = options instanceof LRUCache ? {} : options
+
+ if (!isPosInt(max)) {
+ throw new TypeError('max option must be an integer')
+ }
+
+ const UintArray = getUintArray(max)
+ if (!UintArray) {
+ throw new Error('invalid max value: ' + max)
+ }
+
+ this.max = max
+ this.maxSize = maxSize || 0
+ this.sizeCalculation = sizeCalculation || length
+ if (this.sizeCalculation) {
+ if (!this.maxSize) {
+ throw new TypeError('cannot set sizeCalculation without setting maxSize')
+ }
+ if (typeof this.sizeCalculation !== 'function') {
+ throw new TypeError('sizeCalculating set to non-function')
+ }
+ }
+ this.keyMap = new Map()
+ this.keyList = new Array(max).fill(null)
+ this.valList = new Array(max).fill(null)
+ this.next = new UintArray(max)
+ this.prev = new UintArray(max)
+ this.head = 0
+ this.tail = 0
+ this.free = new Stack(max)
+ this.initialFill = 1
+ this.size = 0
+
+ if (typeof dispose === 'function') {
+ this.dispose = dispose
+ }
+ if (typeof disposeAfter === 'function') {
+ this.disposeAfter = disposeAfter
+ this.disposed = []
+ } else {
+ this.disposeAfter = null
+ this.disposed = null
+ }
+ this.noDisposeOnSet = !!noDisposeOnSet
+
+ if (this.maxSize) {
+ if (!isPosInt(this.maxSize)) {
+ throw new TypeError('maxSize must be a positive integer if specified')
+ }
+ this.initializeSizeTracking()
+ }
+
+ this.allowStale = !!allowStale || !!stale
+ this.updateAgeOnGet = !!updateAgeOnGet
+ this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0
+ ? ttlResolution : 1
+ this.ttlAutopurge = !!ttlAutopurge
+ this.ttl = ttl || maxAge || 0
+ if (this.ttl) {
+ if (!isPosInt(this.ttl)) {
+ throw new TypeError('ttl must be a positive integer if specified')
+ }
+ this.initializeTTLTracking()
+ }
+
+ if (stale) {
+ deprecatedOption('stale', 'please use options.allowStale instead')
+ }
+ if (maxAge) {
+ deprecatedOption('maxAge', 'please use options.ttl instead')
+ }
+ if (length) {
+ deprecatedOption('length', 'please use options.sizeCalculation instead')
+ }
+ }
+
+ initializeTTLTracking () {
+ this.ttls = new ZeroArray(this.max)
+ this.starts = new ZeroArray(this.max)
+ this.setItemTTL = (index, ttl) => {
+ this.starts[index] = ttl !== 0 ? perf.now() : 0
+ this.ttls[index] = ttl
+ if (ttl !== 0 && this.ttlAutopurge) {
+ const t = setTimeout(() => {
+ if (this.isStale(index)) {
+ this.delete(this.keyList[index])
+ }
+ }, ttl + 1)
+ /* istanbul ignore else - unref() not supported on all platforms */
+ if (t.unref) {
+ t.unref()
+ }
+ }
+ }
+ this.updateItemAge = (index) => {
+ this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0
+ }
+ // debounce calls to perf.now() to 1s so we're not hitting
+ // that costly call repeatedly.
+ let cachedNow = 0
+ const getNow = () => {
+ const n = perf.now()
+ if (this.ttlResolution > 0) {
+ cachedNow = n
+ const t = setTimeout(() => cachedNow = 0, this.ttlResolution)
+ /* istanbul ignore else - not available on all platforms */
+ if (t.unref) {
+ t.unref()
+ }
+ }
+ return n
+ }
+ this.isStale = (index) => {
+ return this.ttls[index] !== 0 && this.starts[index] !== 0 &&
+ ((cachedNow || getNow()) - this.starts[index] > this.ttls[index])
+ }
+ }
+ updateItemAge (index) {}
+ setItemTTL (index, ttl) {}
+ isStale (index) { return false }
+
+ initializeSizeTracking () {
+ this.calculatedSize = 0
+ this.sizes = new ZeroArray(this.max)
+ this.removeItemSize = index => this.calculatedSize -= this.sizes[index]
+ this.addItemSize = (index, v, k, size, sizeCalculation) => {
+ const s = size || (sizeCalculation ? sizeCalculation(v, k) : 0)
+ this.sizes[index] = isPosInt(s) ? s : 0
+ const maxSize = this.maxSize - this.sizes[index]
+ while (this.calculatedSize > maxSize) {
+ this.evict()
+ }
+ this.calculatedSize += this.sizes[index]
+ }
+ this.delete = k => {
+ if (this.size !== 0) {
+ const index = this.keyMap.get(k)
+ if (index !== undefined) {
+ this.calculatedSize -= this.sizes[index]
+ }
+ }
+ return LRUCache.prototype.delete.call(this, k)
+ }
+ }
+ removeItemSize (index) {}
+ addItemSize (index, v, k, size, sizeCalculation) {}
+
+ *indexes () {
+ if (this.size) {
+ for (let i = this.tail; true; i = this.prev[i]) {
+ if (!this.isStale(i)) {
+ yield i
+ }
+ if (i === this.head) {
+ break
+ }
+ }
+ }
+ }
+ *rindexes () {
+ if (this.size) {
+ for (let i = this.head; true; i = this.next[i]) {
+ if (!this.isStale(i)) {
+ yield i
+ }
+ if (i === this.tail) {
+ break
+ }
+ }
+ }
+ }
+
+ *entries () {
+ for (const i of this.indexes()) {
+ yield [this.keyList[i], this.valList[i]]
+ }
+ }
+
+ *keys () {
+ for (const i of this.indexes()) {
+ yield this.keyList[i]
+ }
+ }
+
+ *values () {
+ for (const i of this.indexes()) {
+ yield this.valList[i]
+ }
+ }
+
+ [Symbol.iterator] () {
+ return this.entries()
+ }
+
+ find (fn, getOptions = {}) {
+ for (const i of this.indexes()) {
+ if (fn(this.valList[i], this.keyList[i], this)) {
+ return this.get(this.keyList[i], getOptions)
+ }
+ }
+ }
+
+ forEach (fn, thisp = this) {
+ for (const i of this.indexes()) {
+ fn.call(thisp, this.valList[i], this.keyList[i], this)
+ }
+ }
+
+ rforEach (fn, thisp = this) {
+ for (const i of this.rindexes()) {
+ fn.call(thisp, this.valList[i], this.keyList[i], this)
+ }
+ }
+
+ get prune () {
+ deprecatedMethod('prune', 'Please use cache.purgeStale() instead.')
+ return this.purgeStale
+ }
+
+ purgeStale () {
+ let deleted = false
+ if (this.size) {
+ for (let i = this.head; true; i = this.next[i]) {
+ const b = i === this.tail
+ if (this.isStale(i)) {
+ this.delete(this.keyList[i])
+ deleted = true
+ }
+ if (b) {
+ break
+ }
+ }
+ }
+ return deleted
+ }
+
+ dump () {
+ const arr = []
+ for (const i of this.indexes()) {
+ const key = this.keyList[i]
+ const value = this.valList[i]
+ const entry = { value }
+ if (this.ttls) {
+ entry.ttl = this.ttls[i]
+ }
+ if (this.sizes) {
+ entry.size = this.sizes[i]
+ }
+ arr.unshift([key, entry])
+ }
+ return arr
+ }
+
+ load (arr) {
+ this.clear()
+ for (const [key, entry] of arr) {
+ this.set(key, entry.value, entry)
+ }
+ }
+
+ dispose (v, k, reason) {}
+
+ set (k, v, {
+ ttl = this.ttl,
+ noDisposeOnSet = this.noDisposeOnSet,
+ size = 0,
+ sizeCalculation = this.sizeCalculation,
+ } = {}) {
+ let index = this.size === 0 ? undefined : this.keyMap.get(k)
+ if (index === undefined) {
+ // addition
+ index = this.newIndex()
+ this.keyList[index] = k
+ this.valList[index] = v
+ this.keyMap.set(k, index)
+ this.next[this.tail] = index
+ this.prev[index] = this.tail
+ this.tail = index
+ this.size ++
+ this.addItemSize(index, v, k, size, sizeCalculation)
+ } else {
+ // update
+ const oldVal = this.valList[index]
+ if (v !== oldVal) {
+ if (!noDisposeOnSet) {
+ this.dispose(oldVal, k, 'set')
+ if (this.disposeAfter) {
+ this.disposed.push([oldVal, k, 'set'])
+ }
+ }
+ this.removeItemSize(index)
+ this.valList[index] = v
+ this.addItemSize(index, v, k, size, sizeCalculation)
+ }
+ this.moveToTail(index)
+ }
+ if (ttl !== 0 && this.ttl === 0 && !this.ttls) {
+ this.initializeTTLTracking()
+ }
+ this.setItemTTL(index, ttl)
+ if (this.disposeAfter) {
+ while (this.disposed.length) {
+ this.disposeAfter(...this.disposed.shift())
+ }
+ }
+ return this
+ }
+
+ newIndex () {
+ if (this.size === 0) {
+ return this.tail
+ }
+ if (this.size === this.max) {
+ return this.evict()
+ }
+ if (this.free.length !== 0) {
+ return this.free.pop()
+ }
+ // initial fill, just keep writing down the list
+ return this.initialFill++
+ }
+
+ pop () {
+ if (this.size) {
+ const val = this.valList[this.head]
+ this.evict()
+ return val
+ }
+ }
+
+ evict () {
+ const head = this.head
+ const k = this.keyList[head]
+ const v = this.valList[head]
+ this.dispose(v, k, 'evict')
+ if (this.disposeAfter) {
+ this.disposed.push([v, k, 'evict'])
+ }
+ this.removeItemSize(head)
+ this.head = this.next[head]
+ this.keyMap.delete(k)
+ this.size --
+ return head
+ }
+
+ has (k) {
+ return this.keyMap.has(k) && !this.isStale(this.keyMap.get(k))
+ }
+
+ // like get(), but without any LRU updating or TTL expiration
+ peek (k, { allowStale = this.allowStale } = {}) {
+ const index = this.keyMap.get(k)
+ if (index !== undefined && (allowStale || !this.isStale(index))) {
+ return this.valList[index]
+ }
+ }
+
+ get (k, {
+ allowStale = this.allowStale,
+ updateAgeOnGet = this.updateAgeOnGet,
+ } = {}) {
+ const index = this.keyMap.get(k)
+ if (index !== undefined) {
+ if (this.isStale(index)) {
+ const value = allowStale ? this.valList[index] : undefined
+ this.delete(k)
+ return value
+ } else {
+ this.moveToTail(index)
+ if (updateAgeOnGet) {
+ this.updateItemAge(index)
+ }
+ return this.valList[index]
+ }
+ }
+ }
+
+ connect (p, n) {
+ this.prev[n] = p
+ this.next[p] = n
+ }
+
+ moveToTail (index) {
+ // if tail already, nothing to do
+ // if head, move head to next[index]
+ // else
+ // move next[prev[index]] to next[index] (head has no prev)
+ // move prev[next[index]] to prev[index]
+ // prev[index] = tail
+ // next[tail] = index
+ // tail = index
+ if (index !== this.tail) {
+ if (index === this.head) {
+ this.head = this.next[index]
+ } else {
+ this.connect(this.prev[index], this.next[index])
+ }
+ this.connect(this.tail, index)
+ this.tail = index
+ }
+ }
+
+ get del () {
+ deprecatedMethod('del', 'Please use cache.delete() instead.')
+ return this.delete
+ }
+ delete (k) {
+ let deleted = false
+ if (this.size !== 0) {
+ const index = this.keyMap.get(k)
+ if (index !== undefined) {
+ deleted = true
+ if (this.size === 1) {
+ this.clear()
+ } else {
+ this.removeItemSize(index)
+ this.dispose(this.valList[index], k, 'delete')
+ if (this.disposeAfter) {
+ this.disposed.push([this.valList[index], k, 'delete'])
+ }
+ this.keyMap.delete(k)
+ this.keyList[index] = null
+ this.valList[index] = null
+ if (index === this.tail) {
+ this.tail = this.prev[index]
+ } else if (index === this.head) {
+ this.head = this.next[index]
+ } else {
+ this.next[this.prev[index]] = this.next[index]
+ this.prev[this.next[index]] = this.prev[index]
+ }
+ this.size --
+ this.free.push(index)
+ }
+ }
+ }
+ if (this.disposed) {
+ while (this.disposed.length) {
+ this.disposeAfter(...this.disposed.shift())
+ }
+ }
+ return deleted
+ }
+
+ clear () {
+ if (this.dispose !== LRUCache.prototype.dispose) {
+ for (const index of this.rindexes()) {
+ this.dispose(this.valList[index], this.keyList[index], 'delete')
+ }
+ }
+ if (this.disposeAfter) {
+ for (const index of this.rindexes()) {
+ this.disposed.push([this.valList[index], this.keyList[index], 'delete'])
+ }
+ }
+ this.keyMap.clear()
+ this.valList.fill(null)
+ this.keyList.fill(null)
+ if (this.ttls) {
+ this.ttls.fill(0)
+ this.starts.fill(0)
+ }
+ if (this.sizes) {
+ this.sizes.fill(0)
+ }
+ this.head = 0
+ this.tail = 0
+ this.initialFill = 1
+ this.free.length = 0
+ this.calculatedSize = 0
+ this.size = 0
+ if (this.disposed) {
+ while (this.disposed.length) {
+ this.disposeAfter(...this.disposed.shift())
+ }
+ }
+ }
+ get reset () {
+ deprecatedMethod('reset', 'Please use cache.clear() instead.')
+ return this.clear
+ }
+
+ get length () {
+ deprecatedProperty('length', 'Please use cache.size instead.')
+ return this.size
+ }
+}
+
+module.exports = LRUCache
diff --git a/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/package.json b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/package.json
new file mode 100644
index 00000000000000..66dbbd9c115038
--- /dev/null
+++ b/deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "lru-cache",
+ "description": "A cache object that deletes the least-recently-used items.",
+ "version": "7.3.1",
+ "author": "Isaac Z. Schlueter ",
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags"
+ },
+ "main": "index.js",
+ "repository": "git://github.com/isaacs/node-lru-cache.git",
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "tap": "^15.1.6"
+ },
+ "license": "ISC",
+ "files": [
+ "index.js"
+ ],
+ "engines": {
+ "node": ">=12"
+ },
+ "tap": {
+ "coverage-map": "map.js"
+ }
+}
diff --git a/deps/npm/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/make-fetch-happen/package.json
index 7b61953e56f575..bd11b7cddbf5ee 100644
--- a/deps/npm/node_modules/make-fetch-happen/package.json
+++ b/deps/npm/node_modules/make-fetch-happen/package.json
@@ -1,6 +1,6 @@
{
"name": "make-fetch-happen",
- "version": "10.0.0",
+ "version": "10.0.2",
"description": "Opinionated, caching, retrying fetch client",
"main": "lib/index.js",
"files": [
@@ -17,7 +17,8 @@
"lint": "eslint '**/*.js'",
"lintfix": "npm run lint -- --fix",
"postlint": "npm-template-check",
- "snap": "tap"
+ "snap": "tap",
+ "template-copy": "npm-template-copy --force"
},
"repository": "https://github.com/npm/make-fetch-happen",
"keywords": [
@@ -32,34 +33,33 @@
"author": "GitHub Inc.",
"license": "ISC",
"dependencies": {
- "agentkeepalive": "^4.1.3",
- "cacache": "^15.2.0",
+ "agentkeepalive": "^4.2.0",
+ "cacache": "^15.3.0",
"http-cache-semantics": "^4.1.0",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.0",
"is-lambda": "^1.0.1",
- "lru-cache": "^6.0.0",
- "minipass": "^3.1.3",
+ "lru-cache": "^7.3.1",
+ "minipass": "^3.1.6",
"minipass-collect": "^1.0.2",
- "minipass-fetch": "^1.3.2",
+ "minipass-fetch": "^1.4.1",
"minipass-flush": "^1.0.5",
"minipass-pipeline": "^1.2.4",
"negotiator": "^0.6.3",
"promise-retry": "^2.0.1",
- "socks-proxy-agent": "^6.0.0",
- "ssri": "^8.0.0"
+ "socks-proxy-agent": "^6.1.1",
+ "ssri": "^8.0.1"
},
"devDependencies": {
- "@npmcli/template-oss": "^2.5.1",
- "eslint": "^8.7.0",
+ "@npmcli/template-oss": "^2.7.1",
+ "eslint": "^8.8.0",
"mkdirp": "^1.0.4",
- "nock": "^13.0.11",
- "npmlog": "^6.0.0",
- "require-inject": "^1.4.2",
+ "nock": "^13.2.4",
+ "npmlog": "^6.0.1",
"rimraf": "^3.0.2",
"safe-buffer": "^5.2.1",
- "standard-version": "^9.3.0",
- "tap": "^15.0.9"
+ "standard-version": "^9.3.2",
+ "tap": "^15.1.6"
},
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
@@ -70,6 +70,6 @@
"check-coverage": true
},
"templateOSS": {
- "version": "2.5.1"
+ "version": "2.7.1"
}
}
diff --git a/deps/npm/node_modules/npm-registry-fetch/lib/auth.js b/deps/npm/node_modules/npm-registry-fetch/lib/auth.js
index e6b50b12eb2074..17da6a17d7193b 100644
--- a/deps/npm/node_modules/npm-registry-fetch/lib/auth.js
+++ b/deps/npm/node_modules/npm-registry-fetch/lib/auth.js
@@ -1,5 +1,6 @@
'use strict'
const npa = require('npm-package-arg')
+const { URL } = require('url')
// Find the longest registry key that is used for some kind of auth
// in the options.
diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json
index ff4482b1fdc9e0..f1aab5c7bb4a85 100644
--- a/deps/npm/node_modules/npm-registry-fetch/package.json
+++ b/deps/npm/node_modules/npm-registry-fetch/package.json
@@ -1,6 +1,6 @@
{
"name": "npm-registry-fetch",
- "version": "12.0.1",
+ "version": "12.0.2",
"description": "Fetch-based http client for use with npm registry APIs",
"main": "lib",
"files": [
@@ -19,7 +19,8 @@
"npmclilint": "npmcli-lint",
"postsnap": "npm run lintfix --",
"postlint": "npm-template-check",
- "snap": "tap"
+ "snap": "tap",
+ "template-copy": "npm-template-copy --force"
},
"repository": "https://github.com/npm/npm-registry-fetch",
"keywords": [
@@ -30,21 +31,21 @@
"author": "GitHub Inc.",
"license": "ISC",
"dependencies": {
- "make-fetch-happen": "^10.0.0",
- "minipass": "^3.1.3",
- "minipass-fetch": "^1.3.0",
+ "make-fetch-happen": "^10.0.1",
+ "minipass": "^3.1.6",
+ "minipass-fetch": "^1.4.1",
"minipass-json-stream": "^1.0.1",
- "minizlib": "^2.0.0",
- "npm-package-arg": "^8.0.0"
+ "minizlib": "^2.1.2",
+ "npm-package-arg": "^8.1.5"
},
"devDependencies": {
- "@npmcli/template-oss": "^2.5.1",
- "cacache": "^15.0.0",
- "nock": "^13.1.0",
- "npmlog": "^4.1.2",
+ "@npmcli/template-oss": "^2.7.1",
+ "cacache": "^15.3.0",
+ "nock": "^13.2.4",
+ "npmlog": "^6.0.0",
"require-inject": "^1.4.4",
- "ssri": "^8.0.0",
- "tap": "^15.0.4"
+ "ssri": "^8.0.1",
+ "tap": "^15.1.6"
},
"tap": {
"check-coverage": true,
@@ -54,6 +55,6 @@
"node": "^12.13.0 || ^14.15.0 || >=16"
},
"templateOSS": {
- "version": "2.5.1"
+ "version": "2.7.1"
}
}
diff --git a/deps/npm/node_modules/npmlog/lib/log.js b/deps/npm/node_modules/npmlog/lib/log.js
index aec98d7bdd62ac..be650c6a426080 100644
--- a/deps/npm/node_modules/npmlog/lib/log.js
+++ b/deps/npm/node_modules/npmlog/lib/log.js
@@ -292,8 +292,9 @@ log.emitLog = function (m) {
var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level
this.clearProgress()
m.message.split(/\r?\n/).forEach(function (line) {
- if (this.heading) {
- this.write(this.heading, this.headingStyle)
+ var heading = this.heading
+ if (heading) {
+ this.write(heading, this.headingStyle)
this.write(' ')
}
this.write(disp, log.style[m.level])
@@ -390,11 +391,11 @@ log.style = {}
log.levels = {}
log.disp = {}
log.addLevel('silly', -Infinity, { inverse: true }, 'sill')
-log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb')
+log.addLevel('verbose', 1000, { fg: 'cyan', bg: 'black' }, 'verb')
log.addLevel('info', 2000, { fg: 'green' })
log.addLevel('timing', 2500, { fg: 'green', bg: 'black' })
log.addLevel('http', 3000, { fg: 'green', bg: 'black' })
-log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' })
+log.addLevel('notice', 3500, { fg: 'cyan', bg: 'black' })
log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN')
log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!')
log.addLevel('silent', Infinity)
diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json
index 36abf1e44332d4..cf38f7fca475ca 100644
--- a/deps/npm/node_modules/npmlog/package.json
+++ b/deps/npm/node_modules/npmlog/package.json
@@ -2,7 +2,7 @@
"author": "GitHub Inc.",
"name": "npmlog",
"description": "logger for npm",
- "version": "6.0.0",
+ "version": "6.0.1",
"repository": {
"type": "git",
"url": "https://github.com/npm/npmlog.git"
@@ -23,24 +23,27 @@
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
- "snap": "tap"
+ "snap": "tap",
+ "template-copy": "npm-template-copy --force"
},
"dependencies": {
- "are-we-there-yet": "^2.0.0",
+ "are-we-there-yet": "^3.0.0",
"console-control-strings": "^1.1.0",
"gauge": "^4.0.0",
"set-blocking": "^2.0.0"
},
"devDependencies": {
- "@npmcli/template-oss": "^2.3.0",
- "tap": "^15.0.9"
+ "@npmcli/template-oss": "^2.7.1",
+ "tap": "^15.1.6"
},
"license": "ISC",
- "templateVersion": "2.3.0",
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16"
},
"tap": {
"branches": 95
+ },
+ "templateOSS": {
+ "version": "2.7.1"
}
}
diff --git a/deps/npm/package.json b/deps/npm/package.json
index 10688636e66559..ef564abd0aca0c 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "8.4.1",
+ "version": "8.5.0",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
@@ -55,9 +55,9 @@
},
"dependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
- "@npmcli/arborist": "^4.3.0",
+ "@npmcli/arborist": "^4.3.1",
"@npmcli/ci-detect": "^1.4.0",
- "@npmcli/config": "^2.4.0",
+ "@npmcli/config": "^3.0.0",
"@npmcli/map-workspaces": "^2.0.0",
"@npmcli/package-json": "^1.0.1",
"@npmcli/run-script": "^2.0.0",
@@ -85,12 +85,12 @@
"libnpmfund": "^2.0.2",
"libnpmhook": "^7.0.1",
"libnpmorg": "^3.0.1",
- "libnpmpack": "^3.0.1",
+ "libnpmpack": "^3.1.0",
"libnpmpublish": "^5.0.1",
"libnpmsearch": "^4.0.1",
"libnpmteam": "^3.0.1",
"libnpmversion": "^2.0.2",
- "make-fetch-happen": "^10.0.0",
+ "make-fetch-happen": "^10.0.2",
"minipass": "^3.1.6",
"minipass-pipeline": "^1.2.4",
"mkdirp": "^1.0.4",
@@ -103,9 +103,9 @@
"npm-package-arg": "^8.1.5",
"npm-pick-manifest": "^6.1.1",
"npm-profile": "^6.0.0",
- "npm-registry-fetch": "^12.0.1",
+ "npm-registry-fetch": "^12.0.2",
"npm-user-validate": "^1.0.1",
- "npmlog": "^6.0.0",
+ "npmlog": "^6.0.1",
"opener": "^1.5.2",
"pacote": "^12.0.3",
"parse-conflict-json": "^2.0.1",
diff --git a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
index e7142c24923224..c9da1e23671ea5 100644
--- a/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/load-all-commands.js.test.cjs
@@ -170,7 +170,7 @@ npm dedupe
Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
@@ -447,7 +447,7 @@ npm install
npm install /
Options:
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -494,7 +494,7 @@ npm install-test
npm install-test /
Options:
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -517,7 +517,7 @@ npm link (in package dir)
npm link [<@scope>/][@]
Options:
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -1013,7 +1013,7 @@ Usage:
npm uninstall [<@scope>/]...
Options:
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-w|--workspace [-w|--workspace ...]]
[-ws|--workspaces] [--include-workspace-root]
@@ -1063,7 +1063,7 @@ npm update [...]
Options:
[-g|--global] [--global-style] [--legacy-bundling] [--strict-peer-deps]
[--no-package-lock]
-[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
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 ab706be89b8354..d75d32d9b74eaf 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
@@ -1430,7 +1430,7 @@ If a package would be saved at install time by the use of \`--save\`,
\`--save-dev\`, or \`--save-optional\`, then also put it in the
\`bundleDependencies\` list.
-Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled.
+Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled.
`
exports[`test/lib/utils/config/definitions.js TAP > config description for save-dev 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 58958ebdab9549..27b8278fd388e7 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
@@ -1225,7 +1225,7 @@ If a package would be saved at install time by the use of \`--save\`,
\`--save-dev\`, or \`--save-optional\`, then also put it in the
\`bundleDependencies\` list.
-Ignore if \`--save-peer\` is set, since peerDependencies cannot be bundled.
+Ignored if \`--save-peer\` is set, since peerDependencies cannot be bundled.
diff --git a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
index e3a572be459545..62307020cc0f21 100644
--- a/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs
@@ -311,7 +311,7 @@ All commands:
Options:
[--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock]
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
@@ -556,7 +556,7 @@ All commands:
npm install /
Options:
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -599,7 +599,7 @@ All commands:
npm install-test /
Options:
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -620,7 +620,7 @@ All commands:
npm link [<@scope>/][@]
Options:
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
[--strict-peer-deps] [--no-package-lock]
[--omit [--omit ...]] [--ignore-scripts]
@@ -1054,7 +1054,7 @@ All commands:
npm uninstall [<@scope>/]...
Options:
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[-w|--workspace [-w|--workspace ...]]
[-ws|--workspaces] [--include-workspace-root]
@@ -1098,7 +1098,7 @@ All commands:
Options:
[-g|--global] [--global-style] [--legacy-bundling] [--strict-peer-deps]
[--no-package-lock]
- [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer]
+ [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
[--omit [--omit ...]] [--ignore-scripts]
[--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
[-w|--workspace [-w|--workspace ...]]
diff --git a/deps/npm/test/lib/commands/org.js b/deps/npm/test/lib/commands/org.js
index 903b9de4f60840..b716adc0975230 100644
--- a/deps/npm/test/lib/commands/org.js
+++ b/deps/npm/test/lib/commands/org.js
@@ -83,7 +83,8 @@ t.test('npm org add', async t => {
await org.exec(['add', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgSetArgs.opts.log, 'got passed a logger')
+ t.match(
orgSetArgs,
{
org: 'orgname',
@@ -148,7 +149,8 @@ t.test('npm org add - more users', async t => {
})
await org.exec(['add', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgSetArgs.opts.log, 'got passed a logger')
+ t.match(
orgSetArgs,
{
org: 'orgname',
@@ -175,7 +177,8 @@ t.test('npm org add - json output', async t => {
await org.exec(['add', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgSetArgs.opts.log, 'got passed a logger')
+ t.match(
orgSetArgs,
{
org: 'orgname',
@@ -209,7 +212,8 @@ t.test('npm org add - parseable output', async t => {
await org.exec(['add', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgSetArgs.opts.log, 'got passed a logger')
+ t.match(
orgSetArgs,
{
org: 'orgname',
@@ -239,7 +243,8 @@ t.test('npm org add - silent output', async t => {
await org.exec(['add', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgSetArgs.opts.log, 'got passed a logger')
+ t.match(
orgSetArgs,
{
org: 'orgname',
@@ -261,7 +266,8 @@ t.test('npm org rm', async t => {
await org.exec(['rm', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgRmArgs.opts.log, 'got passed a logger')
+ t.match(
orgRmArgs,
{
org: 'orgname',
@@ -270,7 +276,8 @@ t.test('npm org rm', async t => {
},
'libnpmorg.rm received the correct args'
)
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -323,7 +330,8 @@ t.test('npm org rm - one user left', async t => {
await org.exec(['rm', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgRmArgs.opts.log, 'got passed a logger')
+ t.match(
orgRmArgs,
{
org: 'orgname',
@@ -332,7 +340,8 @@ t.test('npm org rm - one user left', async t => {
},
'libnpmorg.rm received the correct args'
)
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -358,7 +367,8 @@ t.test('npm org rm - json output', async t => {
await org.exec(['rm', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgRmArgs.opts.log, 'got passed a logger')
+ t.match(
orgRmArgs,
{
org: 'orgname',
@@ -367,7 +377,8 @@ t.test('npm org rm - json output', async t => {
},
'libnpmorg.rm received the correct args'
)
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -398,7 +409,8 @@ t.test('npm org rm - parseable output', async t => {
await org.exec(['rm', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgRmArgs.opts.log, 'got passed a logger')
+ t.match(
orgRmArgs,
{
org: 'orgname',
@@ -407,7 +419,8 @@ t.test('npm org rm - parseable output', async t => {
},
'libnpmorg.rm received the correct args'
)
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -436,7 +449,8 @@ t.test('npm org rm - silent output', async t => {
await org.exec(['rm', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgRmArgs.opts.log, 'got passed a logger')
+ t.match(
orgRmArgs,
{
org: 'orgname',
@@ -445,7 +459,8 @@ t.test('npm org rm - silent output', async t => {
},
'libnpmorg.rm received the correct args'
)
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -470,7 +485,8 @@ t.test('npm org ls', async t => {
await org.exec(['ls', 'orgname'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -497,7 +513,8 @@ t.test('npm org ls - user filter', async t => {
await org.exec(['ls', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -522,7 +539,8 @@ t.test('npm org ls - user filter, missing user', async t => {
await org.exec(['ls', 'orgname', 'username'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -560,7 +578,8 @@ t.test('npm org ls - json output', async t => {
await org.exec(['ls', 'orgname'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -587,7 +606,8 @@ t.test('npm org ls - parseable output', async t => {
await org.exec(['ls', 'orgname'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
@@ -623,7 +643,8 @@ t.test('npm org ls - silent output', async t => {
await org.exec(['ls', 'orgname'])
- t.strictSame(
+ t.ok(orgLsArgs.opts.log, 'got passed a logger')
+ t.match(
orgLsArgs,
{
org: 'orgname',
diff --git a/deps/npm/test/lib/commands/unpublish.js b/deps/npm/test/lib/commands/unpublish.js
index b1b148a7c27ec2..99d55294fbacf2 100644
--- a/deps/npm/test/lib/commands/unpublish.js
+++ b/deps/npm/test/lib/commands/unpublish.js
@@ -76,8 +76,9 @@ t.test('no args --force', async t => {
const libnpmpublish = {
unpublish (spec, opts) {
+ t.ok(opts.log, 'gets passed a logger')
t.equal(spec.raw, 'pkg@1.0.0', 'should unpublish expected spec')
- t.same(
+ t.match(
opts,
{
publishConfig: undefined,
@@ -177,12 +178,8 @@ t.test('unpublish @version', async t => {
const libnpmpublish = {
unpublish (spec, opts) {
+ t.ok(opts.log, 'gets passed a logger')
t.equal(spec.raw, 'pkg@1.0.0', 'should unpublish expected parsed spec')
- t.same(
- opts,
- {},
- 'should unpublish with expected opts'
- )
},
}
From 23fc20558650a744ab01fb48260f88a4bdf91fa4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?=
Date: Wed, 27 Oct 2021 16:15:11 +0000
Subject: [PATCH 004/168] test: avoid deep comparisons with literals
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Comparing any value to any non-RegExp literal or undefined using
strictEqual (or notStrictEqual) passes if and only if deepStrictEqual
(or notDeepStrictEqual, respectively) passes.
Unnecessarily using deep comparisons adds confusion.
This patch adds an ESLint rule that forbids the use of deepStrictEqual
and notDeepStrictEqual when the expected value (i.e., the second
argument) is a non-RegExp literal or undefined.
For reference, an ESTree literal is defined as follows.
extend interface Literal <: Expression {
type: "Literal";
value: string | boolean | null | number | RegExp | bigint;
}
The value `undefined` is an `Identifier` with `name: 'undefined'`.
PR-URL: https://github.com/nodejs/node/pull/40634
Backport-PR-URL: https://github.com/nodejs/node/pull/42021
Reviewed-By: Rich Trott
Reviewed-By: Colin Ihrig
Reviewed-By: Ruben Bridgewater
Reviewed-By: James M Snell
Reviewed-By: Michaël Zasso
Reviewed-By: Voltrex
---
test/.eslintrc.yaml | 4 ++++
test/es-module/test-esm-data-urls.js | 18 +++++++++---------
test/js-native-api/test_conversions/test.js | 8 ++++----
test/parallel/test-assert-deep.js | 2 ++
test/parallel/test-assert.js | 1 +
test/parallel/test-crypto-hmac.js | 8 ++++----
test/parallel/test-dns-lookup.js | 2 +-
test/parallel/test-dns.js | 8 ++++----
test/parallel/test-error-serdes.js | 2 +-
.../test-fs-promises-file-handle-chmod.js | 2 +-
.../test-fs-promises-file-handle-truncate.js | 4 ++--
.../test-fs-promises-readfile-with-fd.js | 4 ++--
.../test-fs-promises-writefile-with-fd.js | 2 +-
test/parallel/test-fs-promises.js | 2 +-
test/parallel/test-fs-readfile-fd.js | 10 +++++-----
test/parallel/test-fs-readv-promises.js | 8 ++++----
test/parallel/test-fs-readv-sync.js | 8 ++++----
test/parallel/test-fs-writefile-with-fd.js | 10 +++++-----
test/parallel/test-fs-writev-promises.js | 4 ++--
test/parallel/test-fs-writev-sync.js | 8 ++++----
test/parallel/test-http-agent-keepalive.js | 4 ++--
test/parallel/test-http-mutable-headers.js | 4 ++--
test/parallel/test-http.js | 2 +-
test/parallel/test-http2-goaway-opaquedata.js | 4 ++--
test/parallel/test-http2-multiheaders.js | 15 ++++++---------
.../test-http2-removed-header-stays-removed.js | 2 +-
test/parallel/test-inspector-bindings.js | 2 +-
test/parallel/test-perf-hooks-usertiming.js | 2 +-
test/parallel/test-querystring-escape.js | 16 ++++++++--------
test/parallel/test-stream-consumers.js | 8 ++++----
test/parallel/test-stream-push-order.js | 2 +-
test/parallel/test-stream2-objects.js | 2 +-
test/parallel/test-tls-peer-certificate.js | 2 +-
test/parallel/test-util-promisify.js | 2 +-
...test-worker-message-port-receive-message.js | 6 +++---
.../test-worker-workerdata-messageport.js | 4 ++--
test/parallel/test-zlib-reset-before-write.js | 2 +-
.../test-zlib-unzip-one-byte-chunks.js | 8 ++++----
.../test-assert-position-indicator.js | 4 ++--
test/report/test-report-uv-handles.js | 8 ++++----
.../test-diagnostic-dir-heap-prof.js | 2 +-
test/sequential/test-heap-prof.js | 2 +-
42 files changed, 111 insertions(+), 107 deletions(-)
diff --git a/test/.eslintrc.yaml b/test/.eslintrc.yaml
index 50c51ae5010da3..55e8ff6af8c390 100644
--- a/test/.eslintrc.yaml
+++ b/test/.eslintrc.yaml
@@ -13,6 +13,10 @@ rules:
no-restricted-syntax:
# Config copied from .eslintrc.js
- error
+ - selector: "CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])"
+ message: "Use strictEqual instead of deepStrictEqual for literals or undefined."
+ - selector: "CallExpression:matches([callee.name='notDeepStrictEqual'], [callee.property.name='notDeepStrictEqual']):matches([arguments.1.type='Literal']:not([arguments.1.regex]), [arguments.1.type='Identifier'][arguments.1.name='undefined'])"
+ message: "Use notStrictEqual instead of notDeepStrictEqual for literals or undefined."
- selector: "CallExpression:matches([callee.name='deepStrictEqual'], [callee.property.name='deepStrictEqual'])[arguments.2.type='Literal']"
message: "Do not use a literal for the third argument of assert.deepStrictEqual()"
- selector: "CallExpression:matches([callee.name='doesNotThrow'], [callee.property.name='doesNotThrow'])"
diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js
index 3c0e276b2c0f44..85a693b54221a7 100644
--- a/test/es-module/test-esm-data-urls.js
+++ b/test/es-module/test-esm-data-urls.js
@@ -15,7 +15,7 @@ function createBase64URL(mime, body) {
const plainESMURL = createURL('text/javascript', body);
const ns = await import(plainESMURL);
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default.a, 'aaa');
+ assert.strictEqual(ns.default.a, 'aaa');
const importerOfURL = createURL(
'text/javascript',
`export {default as default} from ${JSON.stringify(plainESMURL)}`
@@ -35,41 +35,41 @@ function createBase64URL(mime, body) {
const plainESMURL = createURL('text/javascript', body);
const ns = await import(plainESMURL);
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, plainESMURL);
+ assert.strictEqual(ns.default, plainESMURL);
}
{
const body = 'export default import.meta.url;';
const plainESMURL = createURL('text/javascript;charset=UTF-8', body);
const ns = await import(plainESMURL);
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, plainESMURL);
+ assert.strictEqual(ns.default, plainESMURL);
}
{
const body = 'export default import.meta.url;';
const plainESMURL = createURL('text/javascript;charset="UTF-8"', body);
const ns = await import(plainESMURL);
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, plainESMURL);
+ assert.strictEqual(ns.default, plainESMURL);
}
{
const body = 'export default import.meta.url;';
const plainESMURL = createURL('text/javascript;;a=a;b=b;;', body);
const ns = await import(plainESMURL);
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, plainESMURL);
+ assert.strictEqual(ns.default, plainESMURL);
}
{
const ns = await import('data:application/json;foo="test,"this"',
{ assert: { type: 'json' } });
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, 'this');
+ assert.strictEqual(ns.default, 'this');
}
{
const ns = await import(`data:application/json;foo=${
encodeURIComponent('test,')
},0`, { assert: { type: 'json' } });
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default, 0);
+ assert.strictEqual(ns.default, 0);
}
{
await assert.rejects(async () =>
@@ -84,14 +84,14 @@ function createBase64URL(mime, body) {
const plainESMURL = createURL('application/json', body);
const ns = await import(plainESMURL, { assert: { type: 'json' } });
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default.x, 1);
+ assert.strictEqual(ns.default.x, 1);
}
{
const body = '{"default": 2}';
const plainESMURL = createURL('application/json', body);
const ns = await import(plainESMURL, { assert: { type: 'json' } });
assert.deepStrictEqual(Object.keys(ns), ['default']);
- assert.deepStrictEqual(ns.default.default, 2);
+ assert.strictEqual(ns.default.default, 2);
}
{
const body = 'null';
diff --git a/test/js-native-api/test_conversions/test.js b/test/js-native-api/test_conversions/test.js
index 2fd6ace593840e..f7054f52744714 100644
--- a/test/js-native-api/test_conversions/test.js
+++ b/test/js-native-api/test_conversions/test.js
@@ -118,10 +118,10 @@ assert.deepStrictEqual(new String(''), test.toObject(''));
assert.deepStrictEqual(new Number(0), test.toObject(0));
assert.deepStrictEqual(new Number(Number.NaN), test.toObject(Number.NaN));
assert.deepStrictEqual(new Object(testSym), test.toObject(testSym));
-assert.notDeepStrictEqual(test.toObject(false), false);
-assert.notDeepStrictEqual(test.toObject(true), true);
-assert.notDeepStrictEqual(test.toObject(''), '');
-assert.notDeepStrictEqual(test.toObject(0), 0);
+assert.notStrictEqual(test.toObject(false), false);
+assert.notStrictEqual(test.toObject(true), true);
+assert.notStrictEqual(test.toObject(''), '');
+assert.notStrictEqual(test.toObject(0), 0);
assert.ok(!Number.isNaN(test.toObject(Number.NaN)));
assert.strictEqual(test.toString(''), '');
diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js
index 87d5328d6afc63..97c3386fdfd15d 100644
--- a/test/parallel/test-assert-deep.js
+++ b/test/parallel/test-assert-deep.js
@@ -858,11 +858,13 @@ assert.throws(
}
assert.throws(
+ // eslint-disable-next-line no-restricted-syntax
() => assert.deepStrictEqual(4, '4'),
{ message: `${defaultMsgStart}\n4 !== '4'\n` }
);
assert.throws(
+ // eslint-disable-next-line no-restricted-syntax
() => assert.deepStrictEqual(true, 1),
{ message: `${defaultMsgStart}\ntrue !== 1\n` }
);
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index b6cc1ea7f1558d..24a72091c08399 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -1243,6 +1243,7 @@ assert.throws(
{
let threw = false;
try {
+ // eslint-disable-next-line no-restricted-syntax
assert.deepStrictEqual(Array(100).fill(1), 'foobar');
} catch (err) {
threw = true;
diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js
index cfaa041c0622d9..de0a59423d4b2a 100644
--- a/test/parallel/test-crypto-hmac.js
+++ b/test/parallel/test-crypto-hmac.js
@@ -422,8 +422,8 @@ assert.strictEqual(
}
{
const h = crypto.createHmac('sha1', 'key').update('data');
- assert.deepStrictEqual(h.digest('latin1'), expected);
- assert.deepStrictEqual(h.digest('latin1'), '');
+ assert.strictEqual(h.digest('latin1'), expected);
+ assert.strictEqual(h.digest('latin1'), '');
}
}
@@ -440,8 +440,8 @@ assert.strictEqual(
}
{
const h = crypto.createHmac('sha1', 'key');
- assert.deepStrictEqual(h.digest('latin1'), expected);
- assert.deepStrictEqual(h.digest('latin1'), '');
+ assert.strictEqual(h.digest('latin1'), expected);
+ assert.strictEqual(h.digest('latin1'), '');
}
}
diff --git a/test/parallel/test-dns-lookup.js b/test/parallel/test-dns-lookup.js
index 14dfec61ee08f6..aa4a1b8abef6df 100644
--- a/test/parallel/test-dns-lookup.js
+++ b/test/parallel/test-dns-lookup.js
@@ -137,7 +137,7 @@ dns.lookup('127.0.0.1', {
family: 4,
all: false
}, common.mustSucceed((result, addressType) => {
- assert.deepStrictEqual(result, '127.0.0.1');
+ assert.strictEqual(result, '127.0.0.1');
assert.strictEqual(addressType, 4);
}));
diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js
index 357f697a000595..6f3790d427d353 100644
--- a/test/parallel/test-dns.js
+++ b/test/parallel/test-dns.js
@@ -337,10 +337,10 @@ assert.throws(() => {
{
dns.resolveMx('foo.onion', function(err) {
- assert.deepStrictEqual(err.code, 'ENOTFOUND');
- assert.deepStrictEqual(err.syscall, 'queryMx');
- assert.deepStrictEqual(err.hostname, 'foo.onion');
- assert.deepStrictEqual(err.message, 'queryMx ENOTFOUND foo.onion');
+ assert.strictEqual(err.code, 'ENOTFOUND');
+ assert.strictEqual(err.syscall, 'queryMx');
+ assert.strictEqual(err.hostname, 'foo.onion');
+ assert.strictEqual(err.message, 'queryMx ENOTFOUND foo.onion');
});
}
diff --git a/test/parallel/test-error-serdes.js b/test/parallel/test-error-serdes.js
index 82db8582444af3..92d0864348a831 100644
--- a/test/parallel/test-error-serdes.js
+++ b/test/parallel/test-error-serdes.js
@@ -64,5 +64,5 @@ assert.strictEqual(cycle(Function), '[Function: Function]');
}
serializeError(new DynamicError());
- assert.deepStrictEqual(called, true);
+ assert.strictEqual(called, true);
}
diff --git a/test/parallel/test-fs-promises-file-handle-chmod.js b/test/parallel/test-fs-promises-file-handle-chmod.js
index 5a5f84be80ffd9..5c7414a9b1b134 100644
--- a/test/parallel/test-fs-promises-file-handle-chmod.js
+++ b/test/parallel/test-fs-promises-file-handle-chmod.js
@@ -19,7 +19,7 @@ async function validateFilePermission() {
const fileHandle = await open(filePath, 'w+', 0o444);
// File created with r--r--r-- 444
const statsBeforeMod = fs.statSync(filePath);
- assert.deepStrictEqual(statsBeforeMod.mode & 0o444, 0o444);
+ assert.strictEqual(statsBeforeMod.mode & 0o444, 0o444);
let expectedAccess;
const newPermissions = 0o765;
diff --git a/test/parallel/test-fs-promises-file-handle-truncate.js b/test/parallel/test-fs-promises-file-handle-truncate.js
index ca83755f19e111..13db8f03155dfc 100644
--- a/test/parallel/test-fs-promises-file-handle-truncate.js
+++ b/test/parallel/test-fs-promises-file-handle-truncate.js
@@ -16,10 +16,10 @@ async function validateTruncate() {
const buffer = Buffer.from(text, 'utf8');
await fileHandle.write(buffer, 0, buffer.length);
- assert.deepStrictEqual((await readFile(filename)).toString(), text);
+ assert.strictEqual((await readFile(filename)).toString(), text);
await fileHandle.truncate(5);
- assert.deepStrictEqual((await readFile(filename)).toString(), 'Hello');
+ assert.strictEqual((await readFile(filename)).toString(), 'Hello');
await fileHandle.close();
}
diff --git a/test/parallel/test-fs-promises-readfile-with-fd.js b/test/parallel/test-fs-promises-readfile-with-fd.js
index 3d4b1dc168fe30..999a0a4c94b941 100644
--- a/test/parallel/test-fs-promises-readfile-with-fd.js
+++ b/test/parallel/test-fs-promises-readfile-with-fd.js
@@ -22,10 +22,10 @@ async function readFileTest() {
const buf = Buffer.alloc(5);
const { bytesRead } = await handle.read(buf, 0, 5, null);
assert.strictEqual(bytesRead, 5);
- assert.deepStrictEqual(buf.toString(), 'Hello');
+ assert.strictEqual(buf.toString(), 'Hello');
/* readFile() should read from position five, instead of zero. */
- assert.deepStrictEqual((await handle.readFile()).toString(), ' World');
+ assert.strictEqual((await handle.readFile()).toString(), ' World');
await handle.close();
}
diff --git a/test/parallel/test-fs-promises-writefile-with-fd.js b/test/parallel/test-fs-promises-writefile-with-fd.js
index 35a493f8cdd25c..12ba9954c2f1b2 100644
--- a/test/parallel/test-fs-promises-writefile-with-fd.js
+++ b/test/parallel/test-fs-promises-writefile-with-fd.js
@@ -26,7 +26,7 @@ async function writeFileTest() {
await handle.writeFile('World');
/* New content should be written at position five, instead of zero. */
- assert.deepStrictEqual(readFileSync(fn).toString(), 'HelloWorld');
+ assert.strictEqual(readFileSync(fn).toString(), 'HelloWorld');
await handle.close();
}
diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js
index f0140084732056..44b50c973ee960 100644
--- a/test/parallel/test-fs-promises.js
+++ b/test/parallel/test-fs-promises.js
@@ -170,7 +170,7 @@ async function getHandle(dest) {
assert.strictEqual(ret.bytesRead, bufLen);
assert.deepStrictEqual(ret.buffer, buf);
await truncate(dest, 5);
- assert.deepStrictEqual((await readFile(dest)).toString(), 'hello');
+ assert.strictEqual((await readFile(dest)).toString(), 'hello');
await handle.close();
}
diff --git a/test/parallel/test-fs-readfile-fd.js b/test/parallel/test-fs-readfile-fd.js
index d7bf11c2d8d671..933b3c9748ed3c 100644
--- a/test/parallel/test-fs-readfile-fd.js
+++ b/test/parallel/test-fs-readfile-fd.js
@@ -64,11 +64,11 @@ function tempFdSync(callback) {
// Read only five bytes, so that the position moves to five.
const buf = Buffer.alloc(5);
- assert.deepStrictEqual(fs.readSync(fd, buf, 0, 5), 5);
- assert.deepStrictEqual(buf.toString(), 'Hello');
+ assert.strictEqual(fs.readSync(fd, buf, 0, 5), 5);
+ assert.strictEqual(buf.toString(), 'Hello');
// readFileSync() should read from position five, instead of zero.
- assert.deepStrictEqual(fs.readFileSync(fd).toString(), ' World');
+ assert.strictEqual(fs.readFileSync(fd).toString(), ' World');
fs.closeSync(fd);
}
@@ -81,11 +81,11 @@ function tempFdSync(callback) {
// Read only five bytes, so that the position moves to five.
fs.read(fd, buf, 0, 5, null, common.mustSucceed((bytes) => {
assert.strictEqual(bytes, 5);
- assert.deepStrictEqual(buf.toString(), 'Hello');
+ assert.strictEqual(buf.toString(), 'Hello');
fs.readFile(fd, common.mustSucceed((data) => {
// readFile() should read from position five, instead of zero.
- assert.deepStrictEqual(data.toString(), ' World');
+ assert.strictEqual(data.toString(), ' World');
fs.closeSync(fd);
}));
diff --git a/test/parallel/test-fs-readv-promises.js b/test/parallel/test-fs-readv-promises.js
index 1d12126e557683..ae3c92926ea221 100644
--- a/test/parallel/test-fs-readv-promises.js
+++ b/test/parallel/test-fs-readv-promises.js
@@ -35,11 +35,11 @@ const allocateEmptyBuffers = (combinedLength) => {
let { bytesRead, buffers } = await handle.readv([Buffer.from('')],
null);
- assert.deepStrictEqual(bytesRead, 0);
+ assert.strictEqual(bytesRead, 0);
assert.deepStrictEqual(buffers, [Buffer.from('')]);
({ bytesRead, buffers } = await handle.readv(bufferArr, null));
- assert.deepStrictEqual(bytesRead, expectedLength);
+ assert.strictEqual(bytesRead, expectedLength);
assert.deepStrictEqual(buffers, bufferArr);
assert(Buffer.concat(bufferArr).equals(await fs.readFile(filename)));
handle.close();
@@ -54,11 +54,11 @@ const allocateEmptyBuffers = (combinedLength) => {
const expectedLength = exptectedBuff.length;
let { bytesRead, buffers } = await handle.readv([Buffer.from('')]);
- assert.deepStrictEqual(bytesRead, 0);
+ assert.strictEqual(bytesRead, 0);
assert.deepStrictEqual(buffers, [Buffer.from('')]);
({ bytesRead, buffers } = await handle.readv(bufferArr));
- assert.deepStrictEqual(bytesRead, expectedLength);
+ assert.strictEqual(bytesRead, expectedLength);
assert.deepStrictEqual(buffers, bufferArr);
assert(Buffer.concat(bufferArr).equals(await fs.readFile(filename)));
handle.close();
diff --git a/test/parallel/test-fs-readv-sync.js b/test/parallel/test-fs-readv-sync.js
index 9da39824d7f583..6a09de7466de5a 100644
--- a/test/parallel/test-fs-readv-sync.js
+++ b/test/parallel/test-fs-readv-sync.js
@@ -32,10 +32,10 @@ const allocateEmptyBuffers = (combinedLength) => {
const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
let read = fs.readvSync(fd, [Buffer.from('')], 0);
- assert.deepStrictEqual(read, 0);
+ assert.strictEqual(read, 0);
read = fs.readvSync(fd, bufferArr, 0);
- assert.deepStrictEqual(read, expectedLength);
+ assert.strictEqual(read, expectedLength);
fs.closeSync(fd);
@@ -49,10 +49,10 @@ const allocateEmptyBuffers = (combinedLength) => {
const bufferArr = allocateEmptyBuffers(exptectedBuff.length);
let read = fs.readvSync(fd, [Buffer.from('')]);
- assert.deepStrictEqual(read, 0);
+ assert.strictEqual(read, 0);
read = fs.readvSync(fd, bufferArr);
- assert.deepStrictEqual(read, expectedLength);
+ assert.strictEqual(read, expectedLength);
fs.closeSync(fd);
diff --git a/test/parallel/test-fs-writefile-with-fd.js b/test/parallel/test-fs-writefile-with-fd.js
index 629738ab0e79f0..1af92c2a940da9 100644
--- a/test/parallel/test-fs-writefile-with-fd.js
+++ b/test/parallel/test-fs-writefile-with-fd.js
@@ -20,14 +20,14 @@ tmpdir.refresh();
const fd = fs.openSync(filename, 'w');
try {
/* Write only five characters, so that the position moves to five. */
- assert.deepStrictEqual(fs.writeSync(fd, 'Hello'), 5);
- assert.deepStrictEqual(fs.readFileSync(filename).toString(), 'Hello');
+ assert.strictEqual(fs.writeSync(fd, 'Hello'), 5);
+ assert.strictEqual(fs.readFileSync(filename).toString(), 'Hello');
/* Write some more with writeFileSync(). */
fs.writeFileSync(fd, 'World');
/* New content should be written at position five, instead of zero. */
- assert.deepStrictEqual(fs.readFileSync(filename).toString(), 'HelloWorld');
+ assert.strictEqual(fs.readFileSync(filename).toString(), 'HelloWorld');
} finally {
fs.closeSync(fd);
}
@@ -54,12 +54,12 @@ process.on('beforeExit', common.mustCall(() => {
/* Write only five characters, so that the position moves to five. */
fs.write(fd, 'Hello', common.mustSucceed((bytes) => {
assert.strictEqual(bytes, 5);
- assert.deepStrictEqual(fs.readFileSync(file).toString(), 'Hello');
+ assert.strictEqual(fs.readFileSync(file).toString(), 'Hello');
/* Write some more with writeFile(). */
fs.writeFile(fd, 'World', common.mustSucceed(() => {
/* New content should be written at position five, instead of zero. */
- assert.deepStrictEqual(fs.readFileSync(file).toString(), 'HelloWorld');
+ assert.strictEqual(fs.readFileSync(file).toString(), 'HelloWorld');
}));
}));
}));
diff --git a/test/parallel/test-fs-writev-promises.js b/test/parallel/test-fs-writev-promises.js
index 02da6799699946..7c610adb4e50c2 100644
--- a/test/parallel/test-fs-writev-promises.js
+++ b/test/parallel/test-fs-writev-promises.js
@@ -22,7 +22,7 @@ tmpdir.refresh();
const expectedLength = bufferArr.length * buffer.byteLength;
let { bytesWritten, buffers } = await handle.writev([Buffer.from('')],
null);
- assert.deepStrictEqual(bytesWritten, 0);
+ assert.strictEqual(bytesWritten, 0);
assert.deepStrictEqual(buffers, [Buffer.from('')]);
({ bytesWritten, buffers } = await handle.writev(bufferArr, null));
assert.deepStrictEqual(bytesWritten, expectedLength);
@@ -39,7 +39,7 @@ tmpdir.refresh();
const bufferArr = [buffer, buffer, buffer];
const expectedLength = bufferArr.length * buffer.byteLength;
let { bytesWritten, buffers } = await handle.writev([Buffer.from('')]);
- assert.deepStrictEqual(bytesWritten, 0);
+ assert.strictEqual(bytesWritten, 0);
assert.deepStrictEqual(buffers, [Buffer.from('')]);
({ bytesWritten, buffers } = await handle.writev(bufferArr));
assert.deepStrictEqual(bytesWritten, expectedLength);
diff --git a/test/parallel/test-fs-writev-sync.js b/test/parallel/test-fs-writev-sync.js
index b01e85bcae19f7..33b76c7af25d9f 100644
--- a/test/parallel/test-fs-writev-sync.js
+++ b/test/parallel/test-fs-writev-sync.js
@@ -26,10 +26,10 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_sync_${i}.txt`);
const expectedLength = bufferArr.length * buffer.byteLength;
let written = fs.writevSync(fd, [Buffer.from('')], null);
- assert.deepStrictEqual(written, 0);
+ assert.strictEqual(written, 0);
written = fs.writevSync(fd, bufferArr, null);
- assert.deepStrictEqual(written, expectedLength);
+ assert.strictEqual(written, expectedLength);
fs.closeSync(fd);
@@ -46,10 +46,10 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_sync_${i}.txt`);
const expectedLength = bufferArr.length * buffer.byteLength;
let written = fs.writevSync(fd, [Buffer.from('')]);
- assert.deepStrictEqual(written, 0);
+ assert.strictEqual(written, 0);
written = fs.writevSync(fd, bufferArr);
- assert.deepStrictEqual(written, expectedLength);
+ assert.strictEqual(written, expectedLength);
fs.closeSync(fd);
diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js
index 5363c7d98fb654..f7424634df1bd5 100644
--- a/test/parallel/test-http-agent-keepalive.js
+++ b/test/parallel/test-http-agent-keepalive.js
@@ -84,8 +84,8 @@ function second() {
function remoteClose() {
// Mock remote server close the socket
const req = get('/remote_close', common.mustCall((res) => {
- assert.deepStrictEqual(req.reusedSocket, true);
- assert.deepStrictEqual(res.statusCode, 200);
+ assert.strictEqual(req.reusedSocket, true);
+ assert.strictEqual(res.statusCode, 200);
res.on('data', checkDataAndSockets);
res.on('end', common.mustCall(() => {
assert.strictEqual(agent.sockets[name].length, 1);
diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js
index ea49c8a4f0748e..9b31dd44dda0ef 100644
--- a/test/parallel/test-http-mutable-headers.js
+++ b/test/parallel/test-http-mutable-headers.js
@@ -48,8 +48,8 @@ const s = http.createServer(common.mustCall((req, res) => {
assert.deepStrictEqual(headers, exoticObj);
assert.deepStrictEqual(res.getHeaderNames(), []);
assert.deepStrictEqual(res.getRawHeaderNames(), []);
- assert.deepStrictEqual(res.hasHeader('Connection'), false);
- assert.deepStrictEqual(res.getHeader('Connection'), undefined);
+ assert.strictEqual(res.hasHeader('Connection'), false);
+ assert.strictEqual(res.getHeader('Connection'), undefined);
assert.throws(
() => res.setHeader(),
diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js
index b4916efcc96cb0..1d5b74b879750b 100644
--- a/test/parallel/test-http.js
+++ b/test/parallel/test-http.js
@@ -43,7 +43,7 @@ const server = http.Server(common.mustCall((req, res) => {
break;
case '/world':
assert.strictEqual(req.method, 'POST');
- assert.deepStrictEqual(req.headers.cookie, 'abc=123; def=456; ghi=789');
+ assert.strictEqual(req.headers.cookie, 'abc=123; def=456; ghi=789');
break;
default:
assert(false, `Unexpected request for ${req.url}`);
diff --git a/test/parallel/test-http2-goaway-opaquedata.js b/test/parallel/test-http2-goaway-opaquedata.js
index 56c0ae168c0c8b..538522883a1cfe 100644
--- a/test/parallel/test-http2-goaway-opaquedata.js
+++ b/test/parallel/test-http2-goaway-opaquedata.js
@@ -22,8 +22,8 @@ server.on('close', common.mustCall());
server.listen(0, () => {
const client = http2.connect(`http://localhost:${server.address().port}`);
client.once('goaway', common.mustCall((code, lastStreamID, buf) => {
- assert.deepStrictEqual(code, 0);
- assert.deepStrictEqual(lastStreamID, 1);
+ assert.strictEqual(code, 0);
+ assert.strictEqual(lastStreamID, 1);
assert.deepStrictEqual(data, buf);
session.close();
server.close();
diff --git a/test/parallel/test-http2-multiheaders.js b/test/parallel/test-http2-multiheaders.js
index 6611dcf054d42a..8171df52507350 100644
--- a/test/parallel/test-http2-multiheaders.js
+++ b/test/parallel/test-http2-multiheaders.js
@@ -29,16 +29,13 @@ src.__PROTO__ = 'bar';
src.__Proto__ = 'baz';
function checkHeaders(headers) {
- assert.deepStrictEqual(headers.accept,
- 'abc, def, ghijklmnop');
- assert.deepStrictEqual(headers['www-authenticate'],
- 'foo, bar, baz');
- assert.deepStrictEqual(headers['proxy-authenticate'],
- 'foo, bar, baz');
- assert.deepStrictEqual(headers['x-foo'], 'foo, bar, baz');
- assert.deepStrictEqual(headers.constructor, 'foo, bar, baz');
+ assert.strictEqual(headers.accept, 'abc, def, ghijklmnop');
+ assert.strictEqual(headers['www-authenticate'], 'foo, bar, baz');
+ assert.strictEqual(headers['proxy-authenticate'], 'foo, bar, baz');
+ assert.strictEqual(headers['x-foo'], 'foo, bar, baz');
+ assert.strictEqual(headers.constructor, 'foo, bar, baz');
// eslint-disable-next-line no-proto
- assert.deepStrictEqual(headers.__proto__, 'foo, bar, baz');
+ assert.strictEqual(headers.__proto__, 'foo, bar, baz');
}
server.on('stream', common.mustCall((stream, headers) => {
diff --git a/test/parallel/test-http2-removed-header-stays-removed.js b/test/parallel/test-http2-removed-header-stays-removed.js
index 6ba7bba474d9b1..663249749a92b9 100644
--- a/test/parallel/test-http2-removed-header-stays-removed.js
+++ b/test/parallel/test-http2-removed-header-stays-removed.js
@@ -13,7 +13,7 @@ server.listen(0, common.mustCall(() => {
const session = http2.connect(`http://localhost:${server.address().port}`);
const req = session.request();
req.on('response', (headers, flags) => {
- assert.deepStrictEqual(headers.date, 'snacks o clock');
+ assert.strictEqual(headers.date, 'snacks o clock');
});
req.on('end', () => {
session.close();
diff --git a/test/parallel/test-inspector-bindings.js b/test/parallel/test-inspector-bindings.js
index 3e88c858f8de9e..1f1d3699146814 100644
--- a/test/parallel/test-inspector-bindings.js
+++ b/test/parallel/test-inspector-bindings.js
@@ -92,7 +92,7 @@ function testSampleDebugSession() {
});
debuggedFunction();
- assert.deepStrictEqual(cbAsSecondArgCalled, true);
+ assert.strictEqual(cbAsSecondArgCalled, true);
assert.deepStrictEqual(failures, []);
assert.strictEqual(cur, 5);
scopeCallback = null;
diff --git a/test/parallel/test-perf-hooks-usertiming.js b/test/parallel/test-perf-hooks-usertiming.js
index e7ef26889eae0f..db83e8db5d79d3 100644
--- a/test/parallel/test-perf-hooks-usertiming.js
+++ b/test/parallel/test-perf-hooks-usertiming.js
@@ -42,7 +42,7 @@ assert.throws(() => mark(Symbol('a')), {
const m = mark('a', { detail });
assert.strictEqual(m.name, 'a');
assert.strictEqual(m.entryType, 'mark');
- assert.deepStrictEqual(m.detail, null);
+ assert.strictEqual(m.detail, null);
});
[1, 'any', {}, []].forEach((detail) => {
const m = mark('a', { detail });
diff --git a/test/parallel/test-querystring-escape.js b/test/parallel/test-querystring-escape.js
index fdc62c7cdb5a3a..5f3ea3aedc4d05 100644
--- a/test/parallel/test-querystring-escape.js
+++ b/test/parallel/test-querystring-escape.js
@@ -4,14 +4,14 @@ const assert = require('assert');
const qs = require('querystring');
-assert.deepStrictEqual(qs.escape(5), '5');
-assert.deepStrictEqual(qs.escape('test'), 'test');
-assert.deepStrictEqual(qs.escape({}), '%5Bobject%20Object%5D');
-assert.deepStrictEqual(qs.escape([5, 10]), '5%2C10');
-assert.deepStrictEqual(qs.escape('Ŋōđĕ'), '%C5%8A%C5%8D%C4%91%C4%95');
-assert.deepStrictEqual(qs.escape('testŊōđĕ'), 'test%C5%8A%C5%8D%C4%91%C4%95');
-assert.deepStrictEqual(qs.escape(`${String.fromCharCode(0xD800 + 1)}test`),
- '%F0%90%91%B4est');
+assert.strictEqual(qs.escape(5), '5');
+assert.strictEqual(qs.escape('test'), 'test');
+assert.strictEqual(qs.escape({}), '%5Bobject%20Object%5D');
+assert.strictEqual(qs.escape([5, 10]), '5%2C10');
+assert.strictEqual(qs.escape('Ŋōđĕ'), '%C5%8A%C5%8D%C4%91%C4%95');
+assert.strictEqual(qs.escape('testŊōđĕ'), 'test%C5%8A%C5%8D%C4%91%C4%95');
+assert.strictEqual(qs.escape(`${String.fromCharCode(0xD800 + 1)}test`),
+ '%F0%90%91%B4est');
assert.throws(
() => qs.escape(String.fromCharCode(0xD800 + 1)),
diff --git a/test/parallel/test-stream-consumers.js b/test/parallel/test-stream-consumers.js
index bdcc6fc6ff1b21..4abd0f842e82bf 100644
--- a/test/parallel/test-stream-consumers.js
+++ b/test/parallel/test-stream-consumers.js
@@ -67,7 +67,7 @@ const kArrayBuffer =
text(passthrough).then(common.mustCall(async (str) => {
assert.strictEqual(str.length, 10);
- assert.deepStrictEqual(str, 'hellothere');
+ assert.strictEqual(str, 'hellothere');
}));
passthrough.write('hello');
@@ -92,7 +92,7 @@ const kArrayBuffer =
json(passthrough).then(common.mustCall(async (str) => {
assert.strictEqual(str.length, 10);
- assert.deepStrictEqual(str, 'hellothere');
+ assert.strictEqual(str, 'hellothere');
}));
passthrough.write('"hello');
@@ -140,7 +140,7 @@ const kArrayBuffer =
text(readable).then(common.mustCall(async (str) => {
assert.strictEqual(str.length, 10);
- assert.deepStrictEqual(str, 'hellothere');
+ assert.strictEqual(str, 'hellothere');
}));
const writer = writable.getWriter();
@@ -158,7 +158,7 @@ const kArrayBuffer =
json(readable).then(common.mustCall(async (str) => {
assert.strictEqual(str.length, 10);
- assert.deepStrictEqual(str, 'hellothere');
+ assert.strictEqual(str, 'hellothere');
}));
const writer = writable.getWriter();
diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js
index ce4f336b0254d5..f026cb5b8a0b15 100644
--- a/test/parallel/test-stream-push-order.js
+++ b/test/parallel/test-stream-push-order.js
@@ -47,6 +47,6 @@ s.read(0);
// ACTUALLY [1, 3, 5, 6, 4, 2]
process.on('exit', function() {
- assert.deepStrictEqual(s.readableBuffer.join(','), '1,2,3,4,5,6');
+ assert.strictEqual(s.readableBuffer.join(','), '1,2,3,4,5,6');
console.log('ok');
});
diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js
index a713a5de189cfa..b7ad074628133d 100644
--- a/test/parallel/test-stream2-objects.js
+++ b/test/parallel/test-stream2-objects.js
@@ -60,7 +60,7 @@ function fromArray(list) {
assert.deepStrictEqual(v1, { one: '1' });
assert.deepStrictEqual(v2, { two: '2' });
- assert.deepStrictEqual(v3, null);
+ assert.strictEqual(v3, null);
}
{
diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js
index f220bbc992f7e9..5ca086723a6fa1 100644
--- a/test/parallel/test-tls-peer-certificate.js
+++ b/test/parallel/test-tls-peer-certificate.js
@@ -140,7 +140,7 @@ connect({
assert.strictEqual(peerCert.nistCurve, 'P-256');
assert.strictEqual(peerCert.bits, 256);
- assert.deepStrictEqual(peerCert.infoAccess, undefined);
+ assert.strictEqual(peerCert.infoAccess, undefined);
const issuer = peerCert.issuerCertificate;
assert.strictEqual(issuer.issuerCertificate, issuer);
diff --git a/test/parallel/test-util-promisify.js b/test/parallel/test-util-promisify.js
index 7edeb6e493993e..0fc2d650ee9272 100644
--- a/test/parallel/test-util-promisify.js
+++ b/test/parallel/test-util-promisify.js
@@ -83,7 +83,7 @@ const stat = promisify(fs.stat);
callback(null, 'foo', 'bar');
}
promisify(fn)().then(common.mustCall((value) => {
- assert.deepStrictEqual(value, 'foo');
+ assert.strictEqual(value, 'foo');
}));
}
diff --git a/test/parallel/test-worker-message-port-receive-message.js b/test/parallel/test-worker-message-port-receive-message.js
index 8e5dc91a0790ae..bafcd3f7a7042f 100644
--- a/test/parallel/test-worker-message-port-receive-message.js
+++ b/test/parallel/test-worker-message-port-receive-message.js
@@ -10,13 +10,13 @@ const message2 = { foo: 'bar' };
// Make sure receiveMessageOnPort() works in a FIFO way, the same way it does
// when we’re using events.
-assert.deepStrictEqual(receiveMessageOnPort(port2), undefined);
+assert.strictEqual(receiveMessageOnPort(port2), undefined);
port1.postMessage(message1);
port1.postMessage(message2);
assert.deepStrictEqual(receiveMessageOnPort(port2), { message: message1 });
assert.deepStrictEqual(receiveMessageOnPort(port2), { message: message2 });
-assert.deepStrictEqual(receiveMessageOnPort(port2), undefined);
-assert.deepStrictEqual(receiveMessageOnPort(port2), undefined);
+assert.strictEqual(receiveMessageOnPort(port2), undefined);
+assert.strictEqual(receiveMessageOnPort(port2), undefined);
// Make sure message handlers aren’t called.
port2.on('message', common.mustNotCall());
diff --git a/test/parallel/test-worker-workerdata-messageport.js b/test/parallel/test-worker-workerdata-messageport.js
index 29a06a3196ae86..18f05731e8f635 100644
--- a/test/parallel/test-worker-workerdata-messageport.js
+++ b/test/parallel/test-worker-workerdata-messageport.js
@@ -28,7 +28,7 @@ const meowScript = () => 'meow';
{
const uint8Array = new Uint8Array([ 1, 2, 3, 4 ]);
- assert.deepStrictEqual(uint8Array.length, 4);
+ assert.strictEqual(uint8Array.length, 4);
new Worker(`
const { parentPort, workerData } = require('worker_threads');
parentPort.postMessage(workerData);
@@ -41,7 +41,7 @@ const meowScript = () => 'meow';
(message) =>
assert.deepStrictEqual(message, Uint8Array.of(1, 2, 3, 4))
);
- assert.deepStrictEqual(uint8Array.length, 0);
+ assert.strictEqual(uint8Array.length, 0);
}
{
diff --git a/test/parallel/test-zlib-reset-before-write.js b/test/parallel/test-zlib-reset-before-write.js
index 57bd7083803810..afa207f12c1b30 100644
--- a/test/parallel/test-zlib-reset-before-write.js
+++ b/test/parallel/test-zlib-reset-before-write.js
@@ -26,7 +26,7 @@ for (const fn of [
})
.on('data', (chunk) => output.push(chunk))
.on('end', common.mustCall(
- () => assert.deepStrictEqual(Buffer.concat(output).toString(), 'abc')));
+ () => assert.strictEqual(Buffer.concat(output).toString(), 'abc')));
fn(deflate, () => {
fn(inflate, () => {
diff --git a/test/parallel/test-zlib-unzip-one-byte-chunks.js b/test/parallel/test-zlib-unzip-one-byte-chunks.js
index 3d3d9c37ff0198..51af5153a4dd48 100644
--- a/test/parallel/test-zlib-unzip-one-byte-chunks.js
+++ b/test/parallel/test-zlib-unzip-one-byte-chunks.js
@@ -16,10 +16,10 @@ const unzip = zlib.createUnzip()
})
.on('data', (data) => resultBuffers.push(data))
.on('finish', common.mustCall(() => {
- assert.deepStrictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef',
- `'${Buffer.concat(resultBuffers).toString()}' ` +
- 'should match \'abcdef\' after ' +
- 'zipping and unzipping');
+ const unzipped = Buffer.concat(resultBuffers).toString();
+ assert.strictEqual(unzipped, 'abcdef',
+ `'${unzipped}' should match 'abcdef' after zipping ` +
+ 'and unzipping');
}));
for (let i = 0; i < data.length; i++) {
diff --git a/test/pseudo-tty/test-assert-position-indicator.js b/test/pseudo-tty/test-assert-position-indicator.js
index e56299d2744761..68baecbd7b445a 100644
--- a/test/pseudo-tty/test-assert-position-indicator.js
+++ b/test/pseudo-tty/test-assert-position-indicator.js
@@ -7,12 +7,12 @@ process.stderr.columns = 20;
// Confirm that there is no position indicator.
assert.throws(
- () => { assert.deepStrictEqual('a'.repeat(30), 'a'.repeat(31)); },
+ () => { assert.strictEqual('a'.repeat(30), 'a'.repeat(31)); },
(err) => !err.message.includes('^')
);
// Confirm that there is a position indicator.
assert.throws(
- () => { assert.deepStrictEqual('aaaa', 'aaaaa'); },
+ () => { assert.strictEqual('aaaa', 'aaaaa'); },
(err) => err.message.includes('^')
);
diff --git a/test/report/test-report-uv-handles.js b/test/report/test-report-uv-handles.js
index 6a60aa4c4bcc84..daa2cc2c8f5802 100644
--- a/test/report/test-report-uv-handles.js
+++ b/test/report/test-report-uv-handles.js
@@ -161,10 +161,10 @@ if (process.argv[2] === 'child') {
child.stdout.on('data', (chunk) => { stdout += chunk; });
child.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(stderr.trim(), '');
- assert.deepStrictEqual(code, 0, 'Process exited unexpectedly with code: ' +
- `${code}`);
- assert.deepStrictEqual(signal, null, 'Process should have exited cleanly,' +
- ` but did not: ${signal}`);
+ assert.strictEqual(code, 0, 'Process exited unexpectedly with code: ' +
+ `${code}`);
+ assert.strictEqual(signal, null, 'Process should have exited cleanly,' +
+ ` but did not: ${signal}`);
const reports = helper.findReports(child.pid, tmpdir.path);
assert.deepStrictEqual(reports, [], report_msg, reports);
diff --git a/test/sequential/test-diagnostic-dir-heap-prof.js b/test/sequential/test-diagnostic-dir-heap-prof.js
index 10ce58f72b1d4b..0ec68ab49efdf7 100644
--- a/test/sequential/test-diagnostic-dir-heap-prof.js
+++ b/test/sequential/test-diagnostic-dir-heap-prof.js
@@ -44,7 +44,7 @@ function verifyFrames(output, file, func) {
console.log(output.stderr.toString());
console.log(roots);
}
- assert.notDeepStrictEqual(frame, undefined);
+ assert.notStrictEqual(frame, undefined);
}
const kHeapProfInterval = 128;
diff --git a/test/sequential/test-heap-prof.js b/test/sequential/test-heap-prof.js
index cf70fa926091a6..1dda8f367433e8 100644
--- a/test/sequential/test-heap-prof.js
+++ b/test/sequential/test-heap-prof.js
@@ -51,7 +51,7 @@ function verifyFrames(output, file, func) {
console.log(output.stderr.toString());
console.log(roots);
}
- assert.notDeepStrictEqual(frame, undefined);
+ assert.notStrictEqual(frame, undefined);
}
// We need to set --heap-prof-interval to a small enough value to make
From 18e6316bf1ef0c64c67bc4d06b8170aaa9402f37 Mon Sep 17 00:00:00 2001
From: "Node.js GitHub Bot"
Date: Sun, 16 Jan 2022 07:18:27 -0800
Subject: [PATCH 005/168] meta: update AUTHORS
PR-URL: https://github.com/nodejs/node/pull/41548
Reviewed-By: Rich Trott
Reviewed-By: Mestery
---
.mailmap | 1 +
AUTHORS | 2 ++
2 files changed, 3 insertions(+)
diff --git a/.mailmap b/.mailmap
index 4f0163e9e161e4..c76b2932e38728 100644
--- a/.mailmap
+++ b/.mailmap
@@ -82,6 +82,7 @@ Caralyn Reisle
Charles
Charles Rudolph
Chen Gang
+Chen Gang <13298548+MoonBall@users.noreply.github.com>
Chew Choon Keat
Chris Andrews
Chris Johnson
diff --git a/AUTHORS b/AUTHORS
index f760e06262637d..905a7f6a4d7b26 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3394,5 +3394,7 @@ alexcfyung
Gaby Baghdadi
Wayne Zhang
nikoladev <15011519+nikoladev@users.noreply.github.com>
+Antonio Román
+JoostK
# Generated by tools/update-authors.js
From f2ca172a08445b26289cbe2386fe1bb4ecbae820 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?=
Date: Fri, 14 Jan 2022 17:43:40 +0100
Subject: [PATCH 006/168] doc: remove statement about (EC)DHE performance
This statement is misleading in that it says "key generation is
expensive". ECDHE key generation (over the elliptic curves that are
commonly used for TLS) is insanely fast compared to most other types
of key generation.
This statement is irrelevant for TLS 1.3, which requires (EC)DHE.
Even if this statement is somewhat true for TLS 1.2, it does not
justify discouraging the use of (EC)DHE.
PR-URL: https://github.com/nodejs/node/pull/41528
Reviewed-By: Rich Trott
Reviewed-By: Anna Henningsen
Reviewed-By: Benjamin Gruenbaum
---
doc/api/tls.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/doc/api/tls.md b/doc/api/tls.md
index 955c46a91770a0..9f12b689de1e83 100644
--- a/doc/api/tls.md
+++ b/doc/api/tls.md
@@ -89,9 +89,6 @@ the character "E" appended to the traditional abbreviations):
* [ECDHE][]: An ephemeral version of the Elliptic Curve Diffie-Hellman
key-agreement protocol.
-Ephemeral methods may have some performance drawbacks, because key generation
-is expensive.
-
To use perfect forward secrecy using `DHE` with the `tls` module, it is required
to generate Diffie-Hellman parameters and specify them with the `dhparam`
option to [`tls.createSecureContext()`][]. The following illustrates the use of
From ec72cb401938a3767e61f3e389d0a92ed2620d7c Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Sun, 16 Jan 2022 21:31:21 -0800
Subject: [PATCH 007/168] benchmark: remove unreachable code from
crypto/hash-stream-creation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
`hash.digest('buffer')` has returned a Buffer and not a string since at
least Node.js 0.10.6. The benchmark, as it is written, will not work on
any version of Node.js prior to 16.x (due to `Object.hasOwn()`) and
certainly won't run on versions earlier than 0.10.6 due to const/let and
probably other things. Remove impossible-to-reach code intended to
accommodate Node.js earlier than 0.10.6.
PR-URL: https://github.com/nodejs/node/pull/41535
Reviewed-By: Tobias Nießen
Reviewed-By: Luigi Pinca
---
benchmark/crypto/hash-stream-creation.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js
index c21eb6eaaaed99..e480c7b6edcc41 100644
--- a/benchmark/crypto/hash-stream-creation.js
+++ b/benchmark/crypto/hash-stream-creation.js
@@ -52,11 +52,7 @@ function legacyWrite(algo, message, encoding, writes, len, outEnc) {
while (writes-- > 0) {
const h = crypto.createHash(algo);
h.update(message, encoding);
- let res = h.digest(outEnc);
-
- // Include buffer creation costs for older versions
- if (outEnc === 'buffer' && typeof res === 'string')
- res = Buffer.from(res, 'binary');
+ h.digest(outEnc);
}
bench.end(gbits);
From 1425e75093799f8ce5325f2f341fc5864f84ab17 Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Sun, 16 Jan 2022 21:31:30 -0800
Subject: [PATCH 008/168] stream: avoid function call where possible
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Instead of assigning a boolean, move the function call that assigns a
value to the boolean to the only place that boolean is checked. This
avoids the function call in cases where it is not needed.
Refs: https://github.com/nodejs/node/pull/41488#pullrequestreview-850626528
PR-URL: https://github.com/nodejs/node/pull/41534
Reviewed-By: Tobias Nießen
Reviewed-By: Luigi Pinca
Reviewed-By: Antoine du Hamel
Reviewed-By: Gerhard Stöbich
Reviewed-By: Matteo Collina
---
lib/internal/streams/utils.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/internal/streams/utils.js b/lib/internal/streams/utils.js
index 1b317eeb7e5cb5..b72fb93b67740d 100644
--- a/lib/internal/streams/utils.js
+++ b/lib/internal/streams/utils.js
@@ -113,17 +113,19 @@ function isReadableFinished(stream, strict) {
function isReadable(stream) {
if (stream && stream[kIsReadable] != null) return stream[kIsReadable];
- const r = isReadableNodeStream(stream);
if (typeof stream?.readable !== 'boolean') return null;
if (isDestroyed(stream)) return false;
- return r && stream.readable && !isReadableFinished(stream);
+ return isReadableNodeStream(stream) &&
+ stream.readable &&
+ !isReadableFinished(stream);
}
function isWritable(stream) {
- const r = isWritableNodeStream(stream);
if (typeof stream?.writable !== 'boolean') return null;
if (isDestroyed(stream)) return false;
- return r && stream.writable && !isWritableEnded(stream);
+ return isWritableNodeStream(stream) &&
+ stream.writable &&
+ !isWritableEnded(stream);
}
function isFinished(stream, opts) {
From a8558ecfcfe808bd7b8b82461261dfe3007fe374 Mon Sep 17 00:00:00 2001
From: Rich Trott
Date: Fri, 14 Jan 2022 16:25:00 +0000
Subject: [PATCH 009/168] test: add coverage for util.inspect()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Coverage stats indicate that there is no coverage for util.inspect()
with a negative number and a numeric separator. Add a test case.
Refs: https://coverage.nodejs.org/coverage-df507758e6c35534/lib/internal/util/inspect.js.html#L1463
PR-URL: https://github.com/nodejs/node/pull/41527
Reviewed-By: Benjamin Gruenbaum
Reviewed-By: Antoine du Hamel
Reviewed-By: Luigi Pinca
Reviewed-By: Mohammed Keyvanzadeh
Reviewed-By: Tobias Nießen
---
test/parallel/test-util-inspect.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 029b7cde8a06f8..64852a8bca38b7 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -3231,4 +3231,9 @@ assert.strictEqual(
util.inspect(123456789.12345678, { numericSeparator: true }),
'123_456_789.123_456_78'
);
+
+ assert.strictEqual(
+ util.inspect(-123456789.12345678, { numericSeparator: true }),
+ '-123_456_789.123_456_78'
+ );
}
From db17a529a8943fab138c4cffc8f7bfc0327404dd Mon Sep 17 00:00:00 2001
From: Bryan English
Date: Wed, 23 Feb 2022 19:04:44 -0500
Subject: [PATCH 010/168] doc: add release key for Bryan English
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Adds Bryan English and his public key to the README for releases.
PR-URL: https://github.com/nodejs/node/pull/42102
Reviewed-By: Colin Ihrig
Reviewed-By: Beth Griggs
Reviewed-By: Rich Trott
Reviewed-By: Michaël Zasso
Reviewed-By: Richard Lau
Reviewed-By: Luigi Pinca
Reviewed-By: Mestery
Reviewed-By: Michael Dawson
Reviewed-By: Danielle Adams
---
README.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/README.md b/README.md
index 53de55288a06a9..86acaa40ab2361 100644
--- a/README.md
+++ b/README.md
@@ -663,6 +663,8 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):
* **Beth Griggs** <>
`4ED778F539E3634C779C87C6D7062848A1AB005C`
+* **Bryan English** <>
+ `141F07595B7B3FFE74309A937405533BE57C7D57`
* **Colin Ihrig** <>
`94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
* **Danielle Adams** <>
@@ -689,6 +691,7 @@ to sign releases):
```bash
gpg --keyserver pool.sks-keyservers.net --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
+gpg --keyserver pool.sks-keyservers.net --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57
gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg --keyserver pool.sks-keyservers.net --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201
gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
From a6758d12e3259919c59b9cd43e18de11f90d370b Mon Sep 17 00:00:00 2001
From: Antoine du Hamel
Date: Mon, 17 Jan 2022 11:36:19 +0100
Subject: [PATCH 011/168] doc: clarify module system selection
Refs: https://github.com/nodejs/node/pull/41345#discussion_r777115823
PR-URL: https://github.com/nodejs/node/pull/41383
Reviewed-By: Guy Bedford
Reviewed-By: Geoffrey Booth
---
doc/api/cli.md | 44 ++++++++++++++++++++++----
doc/api/esm.md | 12 ++++---
doc/api/modules.md | 35 ++++++++++++++++++++-
doc/api/packages.md | 63 ++++++++++++++++++++++++++++++++-----
doc/api/synopsis.md | 2 +-
tools/doc/links-mapper.json | 4 +--
6 files changed, 137 insertions(+), 23 deletions(-)
diff --git a/doc/api/cli.md b/doc/api/cli.md
index c455d29859f68b..6c469ae656bf66 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -1,4 +1,4 @@
-# Command-line options
+# Command-line API
@@ -11,9 +11,9 @@ To view this documentation as a manual page in a terminal, run `man node`.
## Synopsis
-`node [options] [V8 options] [script.js | -e "script" | -] [--] [arguments]`
+`node [options] [V8 options] [ | -e "script" | -] [--] [arguments]`
-`node inspect [script.js | -e "script" | :] …`
+`node inspect [ | -e "script" | :] …`
`node --v8-options`
@@ -21,6 +21,33 @@ Execute without arguments to start the [REPL][].
For more info about `node inspect`, see the [debugger][] documentation.
+## Program entry point
+
+The program entry point is a specifier-like string. If the string is not an
+absolute path, it's resolved as a relative path from the current working
+directory. That path is then resolved by [CommonJS][] module loader. If no
+corresponding file is found, an error is thrown.
+
+If a file is found, its path will be passed to the [ECMAScript module loader][]
+under any of the following conditions:
+
+* The program was started with a command-line flag that forces the entry
+ point to be loaded with ECMAScript module loader.
+* The file has an `.mjs` extension.
+* The file does not have a `.cjs` extension, and the nearest parent
+ `package.json` file contains a top-level [`"type"`][] field with a value of
+ `"module"`.
+
+Otherwise, the file is loaded using the CommonJS module loader. See
+[Modules loaders][] for more details.
+
+### ECMAScript modules loader entry point caveat
+
+When loading [ECMAScript module loader][] loads the program entry point, the `node`
+command will only accept as input only files with `.js`, `.mjs`, or `.cjs`
+extensions; and with `.wasm` extensions when
+[`--experimental-wasm-modules`][] is enabled.
+
## Options
-Specify the `module` of a custom experimental [ECMAScript Module loader][].
-`module` may be either a path to a file, or an ECMAScript Module name.
+Specify the `module` of a custom experimental [ECMAScript module loader][].
+`module` may be any string accepted as an [`import` specifier][].
### `--experimental-policy`
@@ -1900,14 +1927,18 @@ $ node --max-old-space-size=1536 index.js
```
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
-[ECMAScript Module loader]: esm.md#loaders
+[CommonJS]: modules.md
+[ECMAScript module loader]: esm.md#loaders
+[Modules loaders]: packages.md#modules-loaders
[REPL]: repl.md
[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
[Source Map]: https://sourcemaps.info/spec.html
[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
+[`"type"`]: packages.md#type
[`--cpu-prof-dir`]: #--cpu-prof-dir
[`--diagnostic-dir`]: #--diagnostic-dirdirectory
+[`--experimental-wasm-modules`]: #--experimental-wasm-modules
[`--heap-prof-dir`]: #--heap-prof-dir
[`--openssl-config`]: #--openssl-configfile
[`--redirect-warnings`]: #--redirect-warningsfile
@@ -1920,6 +1951,7 @@ $ node --max-old-space-size=1536 index.js
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
[`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder
[`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options
+[`import` specifier]: esm.md#import-specifiers
[`process.setUncaughtExceptionCaptureCallback()`]: process.md#processsetuncaughtexceptioncapturecallbackfn
[`tls.DEFAULT_MAX_VERSION`]: tls.md#tlsdefault_max_version
[`tls.DEFAULT_MIN_VERSION`]: tls.md#tlsdefault_min_version
diff --git a/doc/api/esm.md b/doc/api/esm.md
index 91f76ed6955a09..80efae77eb49c2 100644
--- a/doc/api/esm.md
+++ b/doc/api/esm.md
@@ -92,12 +92,12 @@ provides interoperability between them and its original module format,
-Node.js treats JavaScript code as CommonJS modules by default.
-Authors can tell Node.js to treat JavaScript code as ECMAScript modules
+Node.js has two module systems: [CommonJS][] modules and ECMAScript modules.
+
+Authors can tell Node.js to use the ECMAScript modules loader
via the `.mjs` file extension, the `package.json` [`"type"`][] field, or the
-`--input-type` flag. See
-[Modules: Packages](packages.md#determining-module-system) for more
-details.
+[`--input-type`][] flag. Outside of those cases, Node.js will use the CommonJS
+module loader. See [Determining module system][] for more details.
@@ -1458,6 +1458,7 @@ success!
[CommonJS]: modules.md
[Conditional exports]: packages.md#conditional-exports
[Core modules]: modules.md#core-modules
+[Determining module system]: packages.md#determining-module-system
[Dynamic `import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports
[ES Module Integration Proposal for WebAssembly]: https://github.com/webassembly/esm-integration
[Import Assertions]: #import-assertions
@@ -1469,6 +1470,7 @@ success!
[WHATWG JSON modules specification]: https://html.spec.whatwg.org/#creating-a-json-module-script
[`"exports"`]: packages.md#exports
[`"type"`]: packages.md#type
+[`--input-type`]: cli.md#--input-typetype
[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 63629350d49503..c4835b38ca9a64 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -61,7 +61,38 @@ module.exports = class Square {
};
```
-The module system is implemented in the `require('module')` module.
+The CommonJS module system is implemented in the [`module` core module][].
+
+## Enabling
+
+
+
+Node.js has two module systems: CommonJS modules and [ECMAScript modules][].
+
+By default, Node.js will treat the following as CommonJS modules:
+
+* Files with a `.cjs` extension;
+
+* Files with a `.js` extension when the nearest parent `package.json` file
+ contains a top-level field [`"type"`][] with a value of `"commonjs"`.
+
+* Files with a `.js` extension when the nearest parent `package.json` file
+ doesn't contain a top-level field [`"type"`][]. Package authors should include
+ the [`"type"`][] field, even in packages where all sources are CommonJS. Being
+ explicit about the `type` of the package will make things easier for build
+ tools and loaders to determine how the files in the package should be
+ interpreted.
+
+* Files with an extension that is not `.mjs`, `.cjs`, `.json`, `.node`, or `.js`
+ (when the nearest parent `package.json` file contains a top-level field
+ [`"type"`][] with a value of `"module"`, those files will be recognized as
+ CommonJS modules only if they are being `require`d, not when used as the
+ command-line entry point of the program).
+
+See [Determining module system][] for more details.
+
+Calling `require()` always use the CommonJS module loader. Calling `import()`
+always use the ECMAScript module loader.
## Accessing the main module
@@ -1043,6 +1074,7 @@ This section was moved to
[ECMAScript Modules]: esm.md
[GLOBAL_FOLDERS]: #loading-from-the-global-folders
[`"main"`]: packages.md#main
+[`"type"`]: packages.md#type
[`ERR_REQUIRE_ESM`]: errors.md#err_require_esm
[`Error`]: errors.md#class-error
[`__dirname`]: #__dirname
@@ -1050,6 +1082,7 @@ This section was moved to
[`import()`]: https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports
[`module.children`]: #modulechildren
[`module.id`]: #moduleid
+[`module` core module]: module.md
[`module` object]: #the-module-object
[`package.json`]: packages.md#nodejs-packagejson-field-definitions
[`path.dirname()`]: path.md#pathdirnamepath
diff --git a/doc/api/packages.md b/doc/api/packages.md
index 913828bd8a4b56..a846907b71417e 100644
--- a/doc/api/packages.md
+++ b/doc/api/packages.md
@@ -51,12 +51,13 @@ along with a reference for the [`package.json`][] fields defined by Node.js.
## Determining module system
Node.js will treat the following as [ES modules][] when passed to `node` as the
-initial input, or when referenced by `import` statements within ES module code:
+initial input, or when referenced by `import` statements or `import()`
+expressions:
-* Files ending in `.mjs`.
+* Files with an `.mjs` extension.
-* Files ending in `.js` when the nearest parent `package.json` file contains a
- top-level [`"type"`][] field with a value of `"module"`.
+* Files with a `.js` extension when the nearest parent `package.json` file
+ contains a top-level [`"type"`][] field with a value of `"module"`.
* Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`,
with the flag `--input-type=module`.
@@ -67,12 +68,13 @@ field, or string input without the flag `--input-type`. This behavior is to
preserve backward compatibility. However, now that Node.js supports both
CommonJS and ES modules, it is best to be explicit whenever possible. Node.js
will treat the following as CommonJS when passed to `node` as the initial input,
-or when referenced by `import` statements within ES module code:
+or when referenced by `import` statements, `import()` expressions, or
+`require()` expressions:
-* Files ending in `.cjs`.
+* Files with a `.cjs` extension.
-* Files ending in `.js` when the nearest parent `package.json` file contains a
- top-level field [`"type"`][] with a value of `"commonjs"`.
+* Files with a `.js` extension when the nearest parent `package.json` file
+ contains a top-level field [`"type"`][] with a value of `"commonjs"`.
* Strings passed in as an argument to `--eval` or `--print`, or piped to `node`
via `STDIN`, with the flag `--input-type=commonjs`.
@@ -83,6 +85,48 @@ future-proof the package in case the default type of Node.js ever changes, and
it will also make things easier for build tools and loaders to determine how the
files in the package should be interpreted.
+### Modules loaders
+
+Node.js has two systems for resolving a specifier and loading modules.
+
+There is the CommonJS module loader:
+
+* It is fully synchronous.
+* It is responsible for handling `require()` calls.
+* It is monkey patchable.
+* It supports [folders as modules][].
+* When resolving a specifier, if no exact match is found, it will try to add
+ extensions (`.js`, `.json`, and finally `.node`) and then attempt to resolve
+ [folders as modules][].
+* It treats `.json` as JSON text files.
+* `.node` files are interpreted as compiled addon modules loaded with
+ `process.dlopen()`.
+* It treats all files that lack `.json` or `.node` extensions as JavaScript
+ text files.
+* It cannot be used to load ECMAScript modules (although it is possible to
+ [load ECMASCript modules from CommonJS modules][]). When used to load a
+ JavaScript text file that is not an ECMAScript module, it loads it as a
+ CommonJS module.
+
+There is the ECMAScript module loader:
+
+* It is asynchronous.
+* It is responsible for handling `import` statements and `import()` expressions.
+* It is not monkey patchable, can be customized using [loader hooks][].
+* It does not support folders as modules, directory indexes (e.g.
+ `'./startup/index.js'`) must be fully specified.
+* It does no extension searching. A file extension must be provided
+ when the specifier is a relative or absolute file URL.
+* It can load JSON modules, but an import assertion is required (behind
+ `--experimental-json-modules` flag).
+* It accepts only `.js`, `.mjs`, and `.cjs` extensions for JavaScript text
+ files.
+* It can be used to load JavaScript CommonJS modules. Such modules
+ are passed through the `es-module-lexer` to try to identify named exports,
+ which are available if they can be determined through static analysis.
+ Imported CommonJS modules have their URLs converted to absolute
+ paths and are then loaded via the CommonJS module loader.
+
### `package.json` and file extensions
Within a package, the [`package.json`][] [`"type"`][] field defines how
@@ -1281,6 +1325,9 @@ This field defines [subpath imports][] for the current package.
[`esm`]: https://github.com/standard-things/esm#readme
[`package.json`]: #nodejs-packagejson-field-definitions
[entry points]: #package-entry-points
+[folders as modules]: modules.md#folders-as-modules
+[load ECMASCript modules from CommonJS modules]: modules.md#the-mjs-extension
+[loader hooks]: esm.md#loaders
[self-reference]: #self-referencing-a-package-using-its-name
[subpath exports]: #subpath-exports
[subpath imports]: #subpath-imports
diff --git a/doc/api/synopsis.md b/doc/api/synopsis.md
index cbc1888e201ba2..79b881952475f6 100644
--- a/doc/api/synopsis.md
+++ b/doc/api/synopsis.md
@@ -88,6 +88,6 @@ Now, open any preferred web browser and visit `http://127.0.0.1:3000`.
If the browser displays the string `Hello, World!`, that indicates
the server is working.
-[Command-line options]: cli.md#command-line-options
+[Command-line options]: cli.md#options
[Installing Node.js via package manager]: https://nodejs.org/en/download/package-manager/
[web server]: http.md
diff --git a/tools/doc/links-mapper.json b/tools/doc/links-mapper.json
index 7232539ca461f5..211ba70c0b5991 100644
--- a/tools/doc/links-mapper.json
+++ b/tools/doc/links-mapper.json
@@ -1,6 +1,6 @@
{
"doc/api/synopsis.md": {
- "command line options": "cli.html#command-line-options",
+ "command line options": "cli.html#options",
"web server": "http.html"
}
-}
\ No newline at end of file
+}
From e439f32a4b2185012607438741942e0e1be50fc3 Mon Sep 17 00:00:00 2001
From: "Node.js GitHub Bot"
Date: Mon, 17 Jan 2022 07:20:02 -0800
Subject: [PATCH 012/168] tools: update doc to highlight.js@11.4.0
to-vfile@7.2.3
PR-URL: https://github.com/nodejs/node/pull/41441
Reviewed-By: Rich Trott
---
tools/doc/package-lock.json | 85 +++++++++++++++----------------------
tools/doc/package.json | 4 +-
2 files changed, 36 insertions(+), 53 deletions(-)
diff --git a/tools/doc/package-lock.json b/tools/doc/package-lock.json
index 596cc5d153b171..4af589427e5a50 100644
--- a/tools/doc/package-lock.json
+++ b/tools/doc/package-lock.json
@@ -11,7 +11,7 @@
"node-doc-generator": "generate.js"
},
"devDependencies": {
- "highlight.js": "^11.3.1",
+ "highlight.js": "^11.4.0",
"js-yaml": "^4.1.0",
"rehype-raw": "^6.1.1",
"rehype-stringify": "^9.0.2",
@@ -20,7 +20,7 @@
"remark-html": "^15.0.1",
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
- "to-vfile": "^7.2.2",
+ "to-vfile": "^7.2.3",
"unified": "^10.1.1",
"unist-util-select": "^4.0.1",
"unist-util-visit": "^4.1.0"
@@ -416,9 +416,9 @@
}
},
"node_modules/highlight.js": {
- "version": "11.3.1",
- "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.3.1.tgz",
- "integrity": "sha512-PUhCRnPjLtiLHZAQ5A/Dt5F8cWZeMyj9KRsACsWT+OD6OP0x6dp5OmT5jdx0JgEyPxPZZIPQpRN2TciUT7occw==",
+ "version": "11.4.0",
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.4.0.tgz",
+ "integrity": "sha512-nawlpCBCSASs7EdvZOYOYVkJpGmAOKMYZgZtUqSRqodZE0GRVcFKwo1RcpeOemqh9hyttTdd5wDBwHkuSyUfnA==",
"dev": true,
"engines": {
"node": ">=12.0.0"
@@ -1479,9 +1479,9 @@
}
},
"node_modules/sade": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.0.tgz",
- "integrity": "sha512-NRfCA8AVYuAA7Hu8bs18od6J4BdcXXwOv6OJuNgwbw8LcLK8JKwaM3WckLZ+MGyPJUS/ivVgK3twltrOIJJnug==",
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
"dev": true,
"dependencies": {
"mri": "^1.1.0"
@@ -1524,9 +1524,9 @@
}
},
"node_modules/to-vfile": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.2.tgz",
- "integrity": "sha512-7WL+coet3qyaYb5vrVrfLtOUHgNv9E1D5SIsyVKmHKcgZefy77WMQRk7FByqGKNInoHOlY6xkTGymo29AwjUKg==",
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.3.tgz",
+ "integrity": "sha512-QO0A9aE6Z/YkmQadJ0syxpmNXtcQiu0qAtCKYKD5cS3EfgfFTAXfgLX6AOaBrSfWSek5nfsMf3gBZ9KGVFcLuw==",
"dev": true,
"dependencies": {
"is-buffer": "^2.0.0",
@@ -1537,15 +1537,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/totalist": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
- "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/trough": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz",
@@ -1692,16 +1683,15 @@
}
},
"node_modules/uvu": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz",
- "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==",
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.3.tgz",
+ "integrity": "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==",
"dev": true,
"dependencies": {
"dequal": "^2.0.0",
"diff": "^5.0.0",
"kleur": "^4.0.3",
- "sade": "^1.7.3",
- "totalist": "^2.0.0"
+ "sade": "^1.7.3"
},
"bin": {
"uvu": "bin.js"
@@ -1711,9 +1701,9 @@
}
},
"node_modules/vfile": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.2.1.tgz",
- "integrity": "sha512-vXW5XKbELM6mLj88kmkJ+gjFGZ/2gTmpdqPDjs3y+qbvI5i7md7rba/+pbYEawa7t22W7ynywPV6lUUAS1WiYg==",
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.0.tgz",
+ "integrity": "sha512-Tj44nY/48OQvarrE4FAjUfrv7GZOYzPbl5OD65HxVKwLJKMPU7zmfV8cCgCnzKWnSfYG2f3pxu+ALqs7j22xQQ==",
"dev": true,
"dependencies": {
"@types/unist": "^2.0.0",
@@ -2068,9 +2058,9 @@
}
},
"highlight.js": {
- "version": "11.3.1",
- "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.3.1.tgz",
- "integrity": "sha512-PUhCRnPjLtiLHZAQ5A/Dt5F8cWZeMyj9KRsACsWT+OD6OP0x6dp5OmT5jdx0JgEyPxPZZIPQpRN2TciUT7occw==",
+ "version": "11.4.0",
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.4.0.tgz",
+ "integrity": "sha512-nawlpCBCSASs7EdvZOYOYVkJpGmAOKMYZgZtUqSRqodZE0GRVcFKwo1RcpeOemqh9hyttTdd5wDBwHkuSyUfnA==",
"dev": true
},
"html-void-elements": {
@@ -2753,9 +2743,9 @@
}
},
"sade": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.0.tgz",
- "integrity": "sha512-NRfCA8AVYuAA7Hu8bs18od6J4BdcXXwOv6OJuNgwbw8LcLK8JKwaM3WckLZ+MGyPJUS/ivVgK3twltrOIJJnug==",
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
+ "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
"dev": true,
"requires": {
"mri": "^1.1.0"
@@ -2787,21 +2777,15 @@
}
},
"to-vfile": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.2.tgz",
- "integrity": "sha512-7WL+coet3qyaYb5vrVrfLtOUHgNv9E1D5SIsyVKmHKcgZefy77WMQRk7FByqGKNInoHOlY6xkTGymo29AwjUKg==",
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/to-vfile/-/to-vfile-7.2.3.tgz",
+ "integrity": "sha512-QO0A9aE6Z/YkmQadJ0syxpmNXtcQiu0qAtCKYKD5cS3EfgfFTAXfgLX6AOaBrSfWSek5nfsMf3gBZ9KGVFcLuw==",
"dev": true,
"requires": {
"is-buffer": "^2.0.0",
"vfile": "^5.1.0"
}
},
- "totalist": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
- "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
- "dev": true
- },
"trough": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/trough/-/trough-2.0.2.tgz",
@@ -2906,22 +2890,21 @@
}
},
"uvu": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz",
- "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==",
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.3.tgz",
+ "integrity": "sha512-brFwqA3FXzilmtnIyJ+CxdkInkY/i4ErvP7uV0DnUVxQcQ55reuHphorpF+tZoVHK2MniZ/VJzI7zJQoc9T9Yw==",
"dev": true,
"requires": {
"dequal": "^2.0.0",
"diff": "^5.0.0",
"kleur": "^4.0.3",
- "sade": "^1.7.3",
- "totalist": "^2.0.0"
+ "sade": "^1.7.3"
}
},
"vfile": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.2.1.tgz",
- "integrity": "sha512-vXW5XKbELM6mLj88kmkJ+gjFGZ/2gTmpdqPDjs3y+qbvI5i7md7rba/+pbYEawa7t22W7ynywPV6lUUAS1WiYg==",
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.0.tgz",
+ "integrity": "sha512-Tj44nY/48OQvarrE4FAjUfrv7GZOYzPbl5OD65HxVKwLJKMPU7zmfV8cCgCnzKWnSfYG2f3pxu+ALqs7j22xQQ==",
"dev": true,
"requires": {
"@types/unist": "^2.0.0",
diff --git a/tools/doc/package.json b/tools/doc/package.json
index a731ba68a6f44f..907f4962bccbe2 100644
--- a/tools/doc/package.json
+++ b/tools/doc/package.json
@@ -7,7 +7,7 @@
"node": ">=14.8.0"
},
"devDependencies": {
- "highlight.js": "^11.3.1",
+ "highlight.js": "^11.4.0",
"js-yaml": "^4.1.0",
"rehype-raw": "^6.1.1",
"rehype-stringify": "^9.0.2",
@@ -16,7 +16,7 @@
"remark-html": "^15.0.1",
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
- "to-vfile": "^7.2.2",
+ "to-vfile": "^7.2.3",
"unified": "^10.1.1",
"unist-util-select": "^4.0.1",
"unist-util-visit": "^4.1.0"
From 1128b1c2160045df8f40c34f7ea43e44838f173e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?=
Date: Sat, 15 Jan 2022 15:34:38 +0100
Subject: [PATCH 013/168] doc: improve Web Crypto headings related to ECC
PR-URL: https://github.com/nodejs/node/pull/41542
Reviewed-By: Benjamin Gruenbaum
Reviewed-By: Filip Skokan