diff --git a/deps/npm/README.md b/deps/npm/README.md index 01de9e8f694456..822cdecc292948 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -29,6 +29,7 @@ If you're looking to manage multiple versions of **`node`** &/or **`npm`**, cons * [**`volta`**](https://github.com/volta-cli/volta) * [**`nodenv`**](https://github.com/nodenv/nodenv) * [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs) +* [**`nvm-windows`**](https://github.com/coreybutler/nvm-windows) ### Usage diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 0d25d7d29da8dc..9eb060a78be29f 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -132,6 +132,11 @@ If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for `access` are `public` and `restricted`. Unscoped packages _always_ have an access level of `public`. +Note: Using the `--access` flag on the `npm publish` command will only set +the package access level on the initial publish of the package. Any subsequent `npm publish` +commands using the `--access` flag will not have an effect to the access level. +To make changes to the access level after the initial publish use `npm access`. + #### `dry-run` * Default: false diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 0fc5dc5075ee3c..856adb3366cb05 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -286,12 +286,10 @@ Certain files are always included, regardless of settings: * `package.json` * `README` -* `CHANGES` / `CHANGELOG` / `HISTORY` * `LICENSE` / `LICENCE` -* `NOTICE` * The file in the "main" field -`README`, `CHANGES`, `LICENSE` & `NOTICE` can have any case and extension. +`README` & `LICENSE` can have any case and extension. Conversely, some files are always ignored: diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 324980536dc102..3a4d7303c6c437 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -159,7 +159,7 @@
npm ls promzard in npm’s source tree will show:
-npm@7.20.3 /path/to/npm
+npm@7.20.6 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html
index cff5dade6a50e8..f61da12be082e9 100644
--- a/deps/npm/docs/output/commands/npm-publish.html
+++ b/deps/npm/docs/output/commands/npm-publish.html
@@ -269,6 +269,10 @@ access
If you want your scoped package to be publicly viewable (and installable)
set --access=public. The only valid values for access are public and
restricted. Unscoped packages always have an access level of public.
+Note: Using the --access flag on the npm publish command will only set
+the package access level on the initial publish of the package. Any subsequent npm publish
+commands using the --access flag will not have an effect to the access level.
+To make changes to the access level after the initial publish use npm access.
dry-run
- Default: false
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html
index 672238cee09d97..c621b3c5afc256 100644
--- a/deps/npm/docs/output/commands/npm.html
+++ b/deps/npm/docs/output/commands/npm.html
@@ -148,7 +148,7 @@ Table of contents
npm <command> [args]
Version
-7.20.3
+7.20.6
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 f7e5555b57367f..9c1bb63efe5040 100644
--- a/deps/npm/docs/output/configuring-npm/package-json.html
+++ b/deps/npm/docs/output/configuring-npm/package-json.html
@@ -358,12 +358,10 @@
files
package.json
README
-CHANGES / CHANGELOG / HISTORY
LICENSE / LICENCE
-NOTICE
- The file in the “main” field
-README, CHANGES, LICENSE & NOTICE can have any case and extension.
+README & LICENSE can have any case and extension.
Conversely, some files are always ignored:
.git
diff --git a/deps/npm/lib/set.js b/deps/npm/lib/set.js
index 74a002cd638be2..a9f16f3b345121 100644
--- a/deps/npm/lib/set.js
+++ b/deps/npm/lib/set.js
@@ -22,7 +22,7 @@ class Set extends BaseCommand {
exec (args, cb) {
if (!args.length)
- return cb(this.usage)
+ return cb(this.usageError())
this.npm.commands.config(['set'].concat(args), cb)
}
}
diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js
index e78fdf0c786c80..8ab1e8582340ff 100644
--- a/deps/npm/lib/test.js
+++ b/deps/npm/lib/test.js
@@ -19,15 +19,5 @@ class Test extends LifecycleCmd {
'script-shell',
]
}
-
- exec (args, cb) {
- super.exec(args, er => {
- if (er && er.code === 'ELIFECYCLE') {
- /* eslint-disable standard/no-callback-literal */
- cb('Test failed. See above for more details.')
- } else
- cb(er)
- })
- }
}
module.exports = Test
diff --git a/deps/npm/lib/utils/format-bytes.js b/deps/npm/lib/utils/format-bytes.js
new file mode 100644
index 00000000000000..87fb561aabef1d
--- /dev/null
+++ b/deps/npm/lib/utils/format-bytes.js
@@ -0,0 +1,22 @@
+// Convert bytes to printable output, for file reporting in tarballs
+// Only supports up to GB because that's way larger than anything the registry
+// supports anyways.
+
+const formatBytes = (bytes, space = true) => {
+ let spacer = ''
+ if (space)
+ spacer = ' '
+
+ if (bytes < 1000) // B
+ return `${bytes}${spacer}B`
+
+ if (bytes < 1000000) // kB
+ return `${(bytes / 1000).toFixed(1)}${spacer}kB`
+
+ if (bytes < 1000000000) // MB
+ return `${(bytes / 1000000).toFixed(1)}${spacer}MB`
+
+ return `${(bytes / 1000000000).toFixed(1)}${spacer}GB`
+}
+
+module.exports = formatBytes
diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js
index 9e7c3329530eeb..c3071c1bd47a5f 100644
--- a/deps/npm/lib/utils/tar.js
+++ b/deps/npm/lib/utils/tar.js
@@ -1,7 +1,7 @@
const tar = require('tar')
const ssri = require('ssri')
const npmlog = require('npmlog')
-const byteSize = require('byte-size')
+const formatBytes = require('./format-bytes.js')
const columnify = require('columnify')
const logTar = (tarball, opts = {}) => {
@@ -11,9 +11,9 @@ const logTar = (tarball, opts = {}) => {
log.notice('=== Tarball Contents ===')
if (tarball.files.length) {
log.notice('', columnify(tarball.files.map((f) => {
- const bytes = byteSize(f.size)
+ const bytes = formatBytes(f.size, false)
return (/^node_modules\//.test(f.path)) ? null
- : { path: f.path, size: `${bytes.value}${bytes.unit}` }
+ : { path: f.path, size: `${bytes}` }
}).filter(f => f), {
include: ['size', 'path'],
showHeaders: false,
@@ -28,8 +28,8 @@ const logTar = (tarball, opts = {}) => {
{ name: 'name:', value: tarball.name },
{ name: 'version:', value: tarball.version },
tarball.filename && { name: 'filename:', value: tarball.filename },
- { name: 'package size:', value: byteSize(tarball.size) },
- { name: 'unpacked size:', value: byteSize(tarball.unpackedSize) },
+ { name: 'package size:', value: formatBytes(tarball.size) },
+ { name: 'unpacked size:', value: formatBytes(tarball.unpackedSize) },
{ name: 'shasum:', value: tarball.shasum },
{
name: 'integrity:',
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js
index 47e631f5565c0d..f4fc5974eeeca7 100644
--- a/deps/npm/lib/view.js
+++ b/deps/npm/lib/view.js
@@ -1,6 +1,5 @@
// npm view [pkg [pkg ...]]
-const byteSize = require('byte-size')
const color = require('ansicolors')
const columns = require('cli-columns')
const fs = require('fs')
@@ -8,6 +7,7 @@ const jsonParse = require('json-parse-even-better-errors')
const log = require('npmlog')
const npa = require('npm-package-arg')
const { resolve } = require('path')
+const formatBytes = require('./utils/format-bytes.js')
const relativeDate = require('tiny-relative-date')
const semver = require('semver')
const style = require('ansistyles')
@@ -315,7 +315,7 @@ class View extends BaseCommand {
tags.push(`${style.bright(color.green(t))}: ${version}`)
})
const unpackedSize = manifest.dist.unpackedSize &&
- byteSize(manifest.dist.unpackedSize)
+ formatBytes(manifest.dist.unpackedSize, true)
const licenseField = manifest.license || 'Proprietary'
const info = {
name: color.green(manifest.name),
@@ -356,7 +356,7 @@ class View extends BaseCommand {
manifest.dist.integrity && color.yellow(manifest.dist.integrity),
fileCount:
manifest.dist.fileCount && color.yellow(manifest.dist.fileCount),
- unpackedSize: unpackedSize && color.yellow(unpackedSize.value) + ' ' + unpackedSize.unit,
+ unpackedSize: unpackedSize && color.yellow(unpackedSize),
}
if (info.license.toLowerCase().trim() === 'proprietary')
info.license = style.bright(color.red(info.license))
diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1
index 4e2f20ef30c66e..06e36e43552d15 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" "July 2021" "" ""
+.TH "NPM\-ACCESS" "1" "August 2021" "" ""
.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 9dcb4036f3359d..21184ac853b822 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" "July 2021" "" ""
+.TH "NPM\-ADDUSER" "1" "August 2021" "" ""
.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 b1638993cf8a5d..f0eaa99b3e782b 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" "July 2021" "" ""
+.TH "NPM\-AUDIT" "1" "August 2021" "" ""
.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 fd7e3129c6c9db..fd16515d63b146 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" "July 2021" "" ""
+.TH "NPM\-BIN" "1" "August 2021" "" ""
.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 1246f39bed7df1..48f6307f6ad9f9 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" "July 2021" "" ""
+.TH "NPM\-BUGS" "1" "August 2021" "" ""
.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 e2807ca57a817f..9053c09960cf97 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" "July 2021" "" ""
+.TH "NPM\-CACHE" "1" "August 2021" "" ""
.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 f4ad77607e77ae..1b853353e1e426 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" "July 2021" "" ""
+.TH "NPM\-CI" "1" "August 2021" "" ""
.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 1fc1ec9a778598..41fd2ae6037697 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" "July 2021" "" ""
+.TH "NPM\-COMPLETION" "1" "August 2021" "" ""
.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 405160025f1895..8a2bad925a1870 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" "July 2021" "" ""
+.TH "NPM\-CONFIG" "1" "August 2021" "" ""
.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 2930a90609d4ea..0325f013ce2326 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" "July 2021" "" ""
+.TH "NPM\-DEDUPE" "1" "August 2021" "" ""
.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 54d3eae897f370..3a491cfef4c2bb 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" "July 2021" "" ""
+.TH "NPM\-DEPRECATE" "1" "August 2021" "" ""
.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 5464370bfd5d2d..1a3cbcfbeddf6a 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" "July 2021" "" ""
+.TH "NPM\-DIFF" "1" "August 2021" "" ""
.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 5b403c4b19751c..e9213973982c30 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" "July 2021" "" ""
+.TH "NPM\-DIST\-TAG" "1" "August 2021" "" ""
.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 880d4f8cb75556..ac3328c8696274 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" "July 2021" "" ""
+.TH "NPM\-DOCS" "1" "August 2021" "" ""
.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 e803e49cab6c56..af40db2dd28dbe 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" "July 2021" "" ""
+.TH "NPM\-DOCTOR" "1" "August 2021" "" ""
.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 56404e9bb570c2..8c7a87432fee02 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" "July 2021" "" ""
+.TH "NPM\-EDIT" "1" "August 2021" "" ""
.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 4a0cc4e9a9d0b2..ffe52336a348b0 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" "July 2021" "" ""
+.TH "NPM\-EXEC" "1" "August 2021" "" ""
.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 dee71496115b35..08701546c0fc4f 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" "July 2021" "" ""
+.TH "NPM\-EXPLAIN" "1" "August 2021" "" ""
.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 4782519127cdb0..0cbcfea4e18372 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" "July 2021" "" ""
+.TH "NPM\-EXPLORE" "1" "August 2021" "" ""
.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 285dc3128d8cf0..c66dc4a7d91b4f 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" "July 2021" "" ""
+.TH "NPM\-FIND\-DUPES" "1" "August 2021" "" ""
.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 a1fc486010dc17..487dc371222ed7 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" "July 2021" "" ""
+.TH "NPM\-FUND" "1" "August 2021" "" ""
.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 ca85068745f41b..2c7aa246e27f2e 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" "July 2021" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "August 2021" "" ""
.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 7564968067cf25..2b501ea241d111 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" "July 2021" "" ""
+.TH "NPM\-HELP" "1" "August 2021" "" ""
.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 52dd622c0090aa..712f89911bbee0 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" "July 2021" "" ""
+.TH "NPM\-HOOK" "1" "August 2021" "" ""
.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 bce9c09f6ed0ca..efaa6c82e69dc7 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" "July 2021" "" ""
+.TH "NPM\-INIT" "1" "August 2021" "" ""
.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 b2fad00b06b2f1..3f0f8f8f1a1784 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" "July 2021" "" ""
+.TH "NPM\-INSTALL\-CI\-TEST" "1" "August 2021" "" ""
.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 0b403e8fee7865..b34c1b2bc5da60 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" "July 2021" "" ""
+.TH "NPM\-INSTALL\-TEST" "1" "August 2021" "" ""
.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 5ad3b9024fddfe..09ef828b6fb256 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" "July 2021" "" ""
+.TH "NPM\-INSTALL" "1" "August 2021" "" ""
.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 3527512232360d..8a2716753ff1c3 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" "July 2021" "" ""
+.TH "NPM\-LINK" "1" "August 2021" "" ""
.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 650e6f1b511e6d..eb9f8ee1421938 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" "July 2021" "" ""
+.TH "NPM\-LOGOUT" "1" "August 2021" "" ""
.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 0c6d83ee6d9161..a5bca3cb9cbf3b 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" "July 2021" "" ""
+.TH "NPM\-LS" "1" "August 2021" "" ""
.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@7\.20\.3 /path/to/npm
+npm@7\.20\.6 /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 ca4d12eb3b466b..053c9ff65e7369 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" "July 2021" "" ""
+.TH "NPM\-ORG" "1" "August 2021" "" ""
.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 5bea638d57d8e9..acf6494bcebea2 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" "July 2021" "" ""
+.TH "NPM\-OUTDATED" "1" "August 2021" "" ""
.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 8e172d6955e1ab..8c50a9780bee8f 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" "July 2021" "" ""
+.TH "NPM\-OWNER" "1" "August 2021" "" ""
.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 7402a53f7c9c9d..2d8824c9851d5c 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" "July 2021" "" ""
+.TH "NPM\-PACK" "1" "August 2021" "" ""
.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 405ec2edac12ec..57b4cb21dcfae3 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" "July 2021" "" ""
+.TH "NPM\-PING" "1" "August 2021" "" ""
.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 8652df525ebf25..5ab2dfb5f98f77 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" "July 2021" "" ""
+.TH "NPM\-PKG" "1" "August 2021" "" ""
.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 369b13397bfddb..257739d43adeb0 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" "July 2021" "" ""
+.TH "NPM\-PREFIX" "1" "August 2021" "" ""
.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 930fbf2d9402af..e84421484c2ff3 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" "July 2021" "" ""
+.TH "NPM\-PROFILE" "1" "August 2021" "" ""
.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 41b7b00a5cdb1c..8532f3b21c5267 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" "July 2021" "" ""
+.TH "NPM\-PRUNE" "1" "August 2021" "" ""
.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 69637ce9799d36..8328d098e03ee4 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" "July 2021" "" ""
+.TH "NPM\-PUBLISH" "1" "August 2021" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SS Synopsis
@@ -137,6 +137,11 @@ When publishing scoped packages, the access level defaults to \fBrestricted\fP\|
If you want your scoped package to be publicly viewable (and installable)
set \fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and
\fBrestricted\fP\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fP\|\.
+.P
+Note: Using the \fB\-\-access\fP flag on the \fBnpm publish\fP command will only set
+the package access level on the initial publish of the package\. Any subsequent \fBnpm publish\fP
+commands using the \fB\-\-access\fP flag will not have an effect to the access level\.
+To make changes to the access level after the initial publish use \fBnpm access\fP\|\.
.SS \fBdry\-run\fP
.RS 0
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1
index 18b54c7bf75477..1bd8b9e27063c2 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" "July 2021" "" ""
+.TH "NPM\-REBUILD" "1" "August 2021" "" ""
.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 1f19785deda99c..3c72468ad4fa13 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" "July 2021" "" ""
+.TH "NPM\-REPO" "1" "August 2021" "" ""
.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 fa47d5255478a2..546344c72213e9 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" "July 2021" "" ""
+.TH "NPM\-RESTART" "1" "August 2021" "" ""
.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 84722286504842..c46329aeb0817b 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" "July 2021" "" ""
+.TH "NPM\-ROOT" "1" "August 2021" "" ""
.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 ddb01fa95bd913..5504993a0da7e1 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" "July 2021" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "August 2021" "" ""
.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 d500a4e8ef8b92..377a26151058bc 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" "July 2021" "" ""
+.TH "NPM\-SEARCH" "1" "August 2021" "" ""
.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 064dd267e26f44..510fe600eb64a9 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" "July 2021" "" ""
+.TH "NPM\-SET\-SCRIPT" "1" "August 2021" "" ""
.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 3f10fe80c9b824..4cf505d65ddedd 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" "July 2021" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "August 2021" "" ""
.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 174161972911cc..e89cccc6516570 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" "July 2021" "" ""
+.TH "NPM\-STAR" "1" "August 2021" "" ""
.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 adb87c1c9c654e..27636ccfb9e004 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" "July 2021" "" ""
+.TH "NPM\-STARS" "1" "August 2021" "" ""
.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 59c3806112ad6e..69e37577b1a506 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" "July 2021" "" ""
+.TH "NPM\-START" "1" "August 2021" "" ""
.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 2415db060fd216..4877acd83e096b 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" "July 2021" "" ""
+.TH "NPM\-STOP" "1" "August 2021" "" ""
.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 54e27248b54b80..7429bdd0f055a5 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" "July 2021" "" ""
+.TH "NPM\-TEAM" "1" "August 2021" "" ""
.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 c84d9bd8d1f01b..12557e4597d45a 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" "July 2021" "" ""
+.TH "NPM\-TEST" "1" "August 2021" "" ""
.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 d24138b9395c89..f0cb59cc1b6680 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" "July 2021" "" ""
+.TH "NPM\-TOKEN" "1" "August 2021" "" ""
.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 22875c6cfbe4c3..12f6dd40861d6a 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" "July 2021" "" ""
+.TH "NPM\-UNINSTALL" "1" "August 2021" "" ""
.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 50b4bd5e3b49e1..a226cb7ec3c23c 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" "July 2021" "" ""
+.TH "NPM\-UNPUBLISH" "1" "August 2021" "" ""
.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 29c18e8916e131..2cd38414aec180 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" "July 2021" "" ""
+.TH "NPM\-UNSTAR" "1" "August 2021" "" ""
.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 ca717f8d02fb2e..a768c65961db82 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" "July 2021" "" ""
+.TH "NPM\-UPDATE" "1" "August 2021" "" ""
.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 f798ed97a15223..5a8fee83e7d422 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" "July 2021" "" ""
+.TH "NPM\-VERSION" "1" "August 2021" "" ""
.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 a63cab9feec386..91080c1e70952b 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" "July 2021" "" ""
+.TH "NPM\-VIEW" "1" "August 2021" "" ""
.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 506470abe2269f..df05868a8fcdd3 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" "July 2021" "" ""
+.TH "NPM\-WHOAMI" "1" "August 2021" "" ""
.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 d59e7cbce03178..ac2d2ae6e6f411 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -1,4 +1,4 @@
-.TH "NPM" "1" "July 2021" "" ""
+.TH "NPM" "1" "August 2021" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SS Synopsis
@@ -10,7 +10,7 @@ npm [args]
.RE
.SS Version
.P
-7\.20\.3
+7\.20\.6
.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 c58b481079eacc..982127c8ad6dd5 100644
--- a/deps/npm/man/man1/npx.1
+++ b/deps/npm/man/man1/npx.1
@@ -1,4 +1,4 @@
-.TH "NPX" "1" "July 2021" "" ""
+.TH "NPX" "1" "August 2021" "" ""
.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 80b6db8074002f..de49122f3cec91 100644
--- a/deps/npm/man/man5/folders.5
+++ b/deps/npm/man/man5/folders.5
@@ -1,4 +1,4 @@
-.TH "FOLDERS" "5" "July 2021" "" ""
+.TH "FOLDERS" "5" "August 2021" "" ""
.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 70b3d2632a24f1..0759e770bea6a2 100644
--- a/deps/npm/man/man5/install.5
+++ b/deps/npm/man/man5/install.5
@@ -1,4 +1,4 @@
-.TH "INSTALL" "5" "July 2021" "" ""
+.TH "INSTALL" "5" "August 2021" "" ""
.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 008e6f3bec0de2..2e3aa79adb1d60 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" "July 2021" "" ""
+.TH "NPM\-SHRINKWRAP\.JSON" "5" "August 2021" "" ""
.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 b0ee6ac4cfaa45..84a0ffadbee25a 100644
--- a/deps/npm/man/man5/npmrc.5
+++ b/deps/npm/man/man5/npmrc.5
@@ -1,4 +1,4 @@
-.TH "NPMRC" "5" "July 2021" "" ""
+.TH "NPMRC" "5" "August 2021" "" ""
.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 323394188a455b..7d4574186e73f9 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" "July 2021" "" ""
+.TH "PACKAGE\.JSON" "5" "August 2021" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SS Description
@@ -314,17 +314,13 @@ Certain files are always included, regardless of settings:
.IP \(bu 2
\fBREADME\fP
.IP \(bu 2
-\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP
-.IP \(bu 2
\fBLICENSE\fP / \fBLICENCE\fP
.IP \(bu 2
-\fBNOTICE\fP
-.IP \(bu 2
The file in the "main" field
.RE
.P
-\fBREADME\fP, \fBCHANGES\fP, \fBLICENSE\fP & \fBNOTICE\fP can have any case and extension\.
+\fBREADME\fP & \fBLICENSE\fP can have any case and extension\.
.P
Conversely, some files are always ignored:
.RS 0
diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5
index 0a6b97fee7904c..18f968ee6d8d1f 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" "July 2021" "" ""
+.TH "PACKAGE\-LOCK\.JSON" "5" "August 2021" "" ""
.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 ac0a415f10a363..71ca215d4ec0cc 100644
--- a/deps/npm/man/man7/config.7
+++ b/deps/npm/man/man7/config.7
@@ -1,4 +1,4 @@
-.TH "CONFIG" "7" "July 2021" "" ""
+.TH "CONFIG" "7" "August 2021" "" ""
.SH "NAME"
\fBconfig\fR \- More than you probably want to know about npm configuration
.SS Description
diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7
index 91132f0276b2dc..9c226dfc3715a4 100644
--- a/deps/npm/man/man7/developers.7
+++ b/deps/npm/man/man7/developers.7
@@ -1,4 +1,4 @@
-.TH "DEVELOPERS" "7" "July 2021" "" ""
+.TH "DEVELOPERS" "7" "August 2021" "" ""
.SH "NAME"
\fBdevelopers\fR \- Developer Guide
.SS Description
diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7
index 68b968eea2a4fa..983a41c9c2daeb 100644
--- a/deps/npm/man/man7/orgs.7
+++ b/deps/npm/man/man7/orgs.7
@@ -1,4 +1,4 @@
-.TH "ORGS" "7" "July 2021" "" ""
+.TH "ORGS" "7" "August 2021" "" ""
.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 772d4b48220b5a..07f090af82e869 100644
--- a/deps/npm/man/man7/registry.7
+++ b/deps/npm/man/man7/registry.7
@@ -1,4 +1,4 @@
-.TH "REGISTRY" "7" "July 2021" "" ""
+.TH "REGISTRY" "7" "August 2021" "" ""
.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 a0c1c0073a8847..7e8a85039b8437 100644
--- a/deps/npm/man/man7/removal.7
+++ b/deps/npm/man/man7/removal.7
@@ -1,4 +1,4 @@
-.TH "REMOVAL" "7" "July 2021" "" ""
+.TH "REMOVAL" "7" "August 2021" "" ""
.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 218f4ee5a7dcd1..6cf9946d01aa44 100644
--- a/deps/npm/man/man7/scope.7
+++ b/deps/npm/man/man7/scope.7
@@ -1,4 +1,4 @@
-.TH "SCOPE" "7" "July 2021" "" ""
+.TH "SCOPE" "7" "August 2021" "" ""
.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 cac6ab0a2a3565..086f7289b5117b 100644
--- a/deps/npm/man/man7/scripts.7
+++ b/deps/npm/man/man7/scripts.7
@@ -1,4 +1,4 @@
-.TH "SCRIPTS" "7" "July 2021" "" ""
+.TH "SCRIPTS" "7" "August 2021" "" ""
.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 52128895a4acb7..0e6e4c410cc3af 100644
--- a/deps/npm/man/man7/workspaces.7
+++ b/deps/npm/man/man7/workspaces.7
@@ -1,4 +1,4 @@
-.TH "WORKSPACES" "7" "July 2021" "" ""
+.TH "WORKSPACES" "7" "August 2021" "" ""
.SH "NAME"
\fBworkspaces\fR \- Working with workspaces
.SS Description
diff --git a/deps/npm/node_modules/@npmcli/arborist/bin/dedupe.js b/deps/npm/node_modules/@npmcli/arborist/bin/dedupe.js
new file mode 100644
index 00000000000000..96f754e34ca9ee
--- /dev/null
+++ b/deps/npm/node_modules/@npmcli/arborist/bin/dedupe.js
@@ -0,0 +1,46 @@
+const Arborist = require('../')
+
+const options = require('./lib/options.js')
+const print = require('./lib/print-tree.js')
+require('./lib/logging.js')
+require('./lib/timers.js')
+
+const printDiff = diff => {
+ const {depth} = require('treeverse')
+ depth({
+ tree: diff,
+ visit: d => {
+ if (d.location === '')
+ return
+ switch (d.action) {
+ case 'REMOVE':
+ console.error('REMOVE', d.actual.location)
+ break
+ case 'ADD':
+ console.error('ADD', d.ideal.location, d.ideal.resolved)
+ break
+ case 'CHANGE':
+ console.error('CHANGE', d.actual.location, {
+ from: d.actual.resolved,
+ to: d.ideal.resolved,
+ })
+ break
+ }
+ },
+ getChildren: d => d.children,
+ })
+}
+
+const start = process.hrtime()
+process.emit('time', 'install')
+const arb = new Arborist(options)
+arb.dedupe(options).then(tree => {
+ process.emit('timeEnd', 'install')
+ const end = process.hrtime(start)
+ print(tree)
+ if (options.dryRun)
+ printDiff(arb.diff)
+ console.error(`resolved ${tree.inventory.size} deps in ${end[0] + end[1] / 1e9}s`)
+ if (tree.meta && options.save)
+ tree.meta.save()
+}).catch(er => console.error(require('util').inspect(er, { depth: Infinity })))
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js
index 7ef42289d297bb..679d52582cb25f 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
@@ -982,7 +982,6 @@ This is a one-time fix-up, please be patient...
// Note that the virtual root will also have virtual copies of the
// targets of any child Links, so that they resolve appropriately.
const parent = parent_ || this[_virtualRoot](edge.from)
- const realParent = edge.peer ? edge.from.resolveParent : edge.from
const spec = npa.resolve(edge.name, edge.spec, edge.from.path)
const first = await this[_nodeFromSpec](edge.name, spec, parent, edge)
@@ -1013,16 +1012,6 @@ This is a one-time fix-up, please be patient...
required.has(secondEdge.from) && secondEdge.type !== 'peerOptional'))
required.add(node)
- // handle otherwise unresolvable dependency nesting loops by
- // creating a symbolic link
- // a1 -> b1 -> a2 -> b2 -> a1 -> ...
- // instead of nesting forever, when the loop occurs, create
- // a symbolic link to the earlier instance
- for (let p = edge.from.resolveParent; p; p = p.resolveParent) {
- if (p.matches(node) && !p.isTop)
- return new Link({ parent: realParent, target: p })
- }
-
// keep track of the thing that caused this node to be included.
const src = parent.sourceReference
this[_peerSetSource].set(node, src)
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js b/deps/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js
index cf6b800c44ea23..9601ad7af31631 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/can-place-dep.js
@@ -73,8 +73,10 @@ class CanPlaceDep {
if (!edge)
throw new Error('no edge provided to CanPlaceDep')
- this._nodeSnapshot = JSON.stringify(dep)
- this._treeSnapshot = JSON.stringify(target.root)
+ this._treeSnapshot = JSON.stringify([...target.root.inventory.entries()]
+ .map(([loc, {packageName, version, resolved}]) => {
+ return [loc, packageName, version, resolved]
+ }).sort(([a], [b]) => a.localeCompare(b, 'en')))
})
// the result of whether we can place it or not
@@ -110,15 +112,10 @@ class CanPlaceDep {
this.canPlaceSelf = this.canPlace
debug(() => {
- const nodeSnapshot = JSON.stringify(dep)
- const treeSnapshot = JSON.stringify(target.root)
- /* istanbul ignore if */
- if (this._nodeSnapshot !== nodeSnapshot) {
- throw Object.assign(new Error('dep changed in CanPlaceDep'), {
- expect: this._nodeSnapshot,
- actual: nodeSnapshot,
- })
- }
+ const treeSnapshot = JSON.stringify([...target.root.inventory.entries()]
+ .map(([loc, {packageName, version, resolved}]) => {
+ return [loc, packageName, version, resolved]
+ }).sort(([a], [b]) => a.localeCompare(b, 'en')))
/* istanbul ignore if */
if (this._treeSnapshot !== treeSnapshot) {
throw Object.assign(new Error('tree changed in CanPlaceDep'), {
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/place-dep.js b/deps/npm/node_modules/@npmcli/arborist/lib/place-dep.js
index 913b2ba6c2bc73..c0023e74ad8eae 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/place-dep.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/place-dep.js
@@ -16,6 +16,7 @@ const {
} = CanPlaceDep
const debug = require('./debug.js')
+const Link = require('./link.js')
const gatherDepSet = require('./gather-dep-set.js')
const peerEntrySets = require('./peer-entry-sets.js')
@@ -256,6 +257,20 @@ class PlaceDep {
return
}
+ // we were told to place it here in the target, so either it does not
+ // already exist in the tree, OR it's shadowed.
+ // handle otherwise unresolvable dependency nesting loops by
+ // creating a symbolic link
+ // a1 -> b1 -> a2 -> b2 -> a1 -> ...
+ // instead of nesting forever, when the loop occurs, create
+ // a symbolic link to the earlier instance
+ for (let p = target; p; p = p.resolveParent) {
+ if (p.matches(dep) && !p.isTop) {
+ this.placed = new Link({ parent: target, target: p })
+ return
+ }
+ }
+
// XXX if we are replacing SOME of a peer entry group, we will need to
// remove any that are not being replaced and will now be invalid, and
// re-evaluate them deeper into the tree.
@@ -268,7 +283,7 @@ class PlaceDep {
integrity: dep.integrity,
legacyPeerDeps: this.legacyPeerDeps,
error: dep.errors[0],
- ...(dep.isLink ? { target: dep.target, realpath: dep.target.path } : {}),
+ ...(dep.isLink ? { target: dep.target, realpath: dep.realpath } : {}),
})
this.oldDep = target.children.get(this.name)
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
index ebbe004de72d66..83cb1f66f3a105 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
@@ -255,9 +255,11 @@ class Shrinkwrap {
if (val)
meta[key.replace(/^_/, '')] = val
})
- // we only include name if different from the node path name
+ // we only include name if different from the node path name, and for the
+ // root to help prevent churn based on the name of the directory the
+ // project is in
const pname = node.packageName
- if (pname && pname !== node.name)
+ if (pname && (node === node.root || pname !== node.name))
meta.name = pname
if (node.isTop && node.package.devDependencies)
diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json
index 56046eaa5f3578..01f018a629339c 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": "2.8.0",
+ "version": "2.8.1",
"description": "Manage node_modules trees",
"dependencies": {
"@npmcli/installed-package-contents": "^1.0.7",
diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/index.js b/deps/npm/node_modules/@npmcli/map-workspaces/index.js
index b06662154a83a1..7587db717f3625 100644
--- a/deps/npm/node_modules/@npmcli/map-workspaces/index.js
+++ b/deps/npm/node_modules/@npmcli/map-workspaces/index.js
@@ -129,7 +129,12 @@ async function mapWorkspaces (opts = {}) {
if (seen.has(name) && seen.get(name) !== packagePathname) {
throw getError({
Type: Error,
- message: 'must not have multiple workspaces with the same name',
+ message: [
+ 'must not have multiple workspaces with the same name',
+ `package '${name}' has conflicts in the following paths:`,
+ ' ' + seen.get(name),
+ ' ' + packagePathname
+ ].join('\n'),
code: 'EDUPLICATEWORKSPACE'
})
}
diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/package.json b/deps/npm/node_modules/@npmcli/map-workspaces/package.json
index 2445c12f9c3081..17cc4197e9e2b4 100644
--- a/deps/npm/node_modules/@npmcli/map-workspaces/package.json
+++ b/deps/npm/node_modules/@npmcli/map-workspaces/package.json
@@ -1,6 +1,6 @@
{
"name": "@npmcli/map-workspaces",
- "version": "1.0.3",
+ "version": "1.0.4",
"files": [
"index.js"
],
diff --git a/deps/npm/node_modules/byte-size/LICENSE b/deps/npm/node_modules/byte-size/LICENSE
deleted file mode 100644
index 5699dfbe518305..00000000000000
--- a/deps/npm/node_modules/byte-size/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014-21 Lloyd Brookes <75pound@gmail.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/deps/npm/node_modules/byte-size/dist/index.js b/deps/npm/node_modules/byte-size/dist/index.js
deleted file mode 100644
index dd1debda59abd4..00000000000000
--- a/deps/npm/node_modules/byte-size/dist/index.js
+++ /dev/null
@@ -1,123 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.byteSize = factory());
-}(this, (function () { 'use strict';
-
- /**
- * @module byte-size
- */
-
- let defaultOptions = {};
- const _options = new WeakMap();
-
- class ByteSize {
- constructor (bytes, options) {
- options = Object.assign({
- units: 'metric',
- precision: 1
- }, defaultOptions, options);
- _options.set(this, options);
-
- const tables = {
- metric: [
- { from: 0 , to: 1e3 , unit: 'B' , long: 'bytes' },
- { from: 1e3 , to: 1e6 , unit: 'kB', long: 'kilobytes' },
- { from: 1e6 , to: 1e9 , unit: 'MB', long: 'megabytes' },
- { from: 1e9 , to: 1e12, unit: 'GB', long: 'gigabytes' },
- { from: 1e12, to: 1e15, unit: 'TB', long: 'terabytes' },
- { from: 1e15, to: 1e18, unit: 'PB', long: 'petabytes' },
- { from: 1e18, to: 1e21, unit: 'EB', long: 'exabytes' },
- { from: 1e21, to: 1e24, unit: 'ZB', long: 'zettabytes' },
- { from: 1e24, to: 1e27, unit: 'YB', long: 'yottabytes' },
- ],
- metric_octet: [
- { from: 0 , to: 1e3 , unit: 'o' , long: 'octets' },
- { from: 1e3 , to: 1e6 , unit: 'ko', long: 'kilooctets' },
- { from: 1e6 , to: 1e9 , unit: 'Mo', long: 'megaoctets' },
- { from: 1e9 , to: 1e12, unit: 'Go', long: 'gigaoctets' },
- { from: 1e12, to: 1e15, unit: 'To', long: 'teraoctets' },
- { from: 1e15, to: 1e18, unit: 'Po', long: 'petaoctets' },
- { from: 1e18, to: 1e21, unit: 'Eo', long: 'exaoctets' },
- { from: 1e21, to: 1e24, unit: 'Zo', long: 'zettaoctets' },
- { from: 1e24, to: 1e27, unit: 'Yo', long: 'yottaoctets' },
- ],
- iec: [
- { from: 0 , to: Math.pow(1024, 1), unit: 'B' , long: 'bytes' },
- { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'KiB', long: 'kibibytes' },
- { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'MiB', long: 'mebibytes' },
- { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'GiB', long: 'gibibytes' },
- { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'TiB', long: 'tebibytes' },
- { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'PiB', long: 'pebibytes' },
- { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'EiB', long: 'exbibytes' },
- { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'ZiB', long: 'zebibytes' },
- { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'YiB', long: 'yobibytes' },
- ],
- iec_octet: [
- { from: 0 , to: Math.pow(1024, 1), unit: 'o' , long: 'octets' },
- { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'Kio', long: 'kibioctets' },
- { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'Mio', long: 'mebioctets' },
- { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'Gio', long: 'gibioctets' },
- { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'Tio', long: 'tebioctets' },
- { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'Pio', long: 'pebioctets' },
- { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'Eio', long: 'exbioctets' },
- { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'Zio', long: 'zebioctets' },
- { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'Yio', long: 'yobioctets' },
- ],
- };
- Object.assign(tables, options.customUnits);
-
- const prefix = bytes < 0 ? '-' : '';
- bytes = Math.abs(bytes);
- const table = tables[options.units];
- if (table) {
- const units = table.find(u => bytes >= u.from && bytes < u.to);
- if (units) {
- const value = units.from === 0
- ? prefix + bytes
- : prefix + (bytes / units.from).toFixed(options.precision);
- this.value = value;
- this.unit = units.unit;
- this.long = units.long;
- } else {
- this.value = prefix + bytes;
- this.unit = '';
- this.long = '';
- }
- } else {
- throw new Error(`Invalid units specified: ${options.units}`)
- }
- }
-
- toString () {
- const options = _options.get(this);
- return options.toStringFn ? options.toStringFn.bind(this)() : `${this.value} ${this.unit}`
- }
- }
-
- /**
- * Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context.
- * @param {number} - The bytes value to convert.
- * @param [options] {object} - Optional config.
- * @param [options.precision] {number} - Number of decimal places. Defaults to `1`.
- * @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`.
- * @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables.
- * @param [options.toStringFn] {function} - A `toString` function to override the default.
- * @returns {object}
- * @alias module:byte-size
- */
- function byteSize (bytes, options) {
- return new ByteSize(bytes, options)
- }
-
- /**
- * Set the default `byteSize` options for the duration of the process.
- * @param options {object} - A `byteSize` options object.
- */
- byteSize.defaultOptions = function (options) {
- defaultOptions = options;
- };
-
- return byteSize;
-
-})));
diff --git a/deps/npm/node_modules/byte-size/index.mjs b/deps/npm/node_modules/byte-size/index.mjs
deleted file mode 100644
index bd6548c686aa56..00000000000000
--- a/deps/npm/node_modules/byte-size/index.mjs
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * @module byte-size
- */
-
-let defaultOptions = {}
-const _options = new WeakMap()
-
-class ByteSize {
- constructor (bytes, options) {
- options = Object.assign({
- units: 'metric',
- precision: 1
- }, defaultOptions, options)
- _options.set(this, options)
-
- const tables = {
- metric: [
- { from: 0 , to: 1e3 , unit: 'B' , long: 'bytes' },
- { from: 1e3 , to: 1e6 , unit: 'kB', long: 'kilobytes' },
- { from: 1e6 , to: 1e9 , unit: 'MB', long: 'megabytes' },
- { from: 1e9 , to: 1e12, unit: 'GB', long: 'gigabytes' },
- { from: 1e12, to: 1e15, unit: 'TB', long: 'terabytes' },
- { from: 1e15, to: 1e18, unit: 'PB', long: 'petabytes' },
- { from: 1e18, to: 1e21, unit: 'EB', long: 'exabytes' },
- { from: 1e21, to: 1e24, unit: 'ZB', long: 'zettabytes' },
- { from: 1e24, to: 1e27, unit: 'YB', long: 'yottabytes' },
- ],
- metric_octet: [
- { from: 0 , to: 1e3 , unit: 'o' , long: 'octets' },
- { from: 1e3 , to: 1e6 , unit: 'ko', long: 'kilooctets' },
- { from: 1e6 , to: 1e9 , unit: 'Mo', long: 'megaoctets' },
- { from: 1e9 , to: 1e12, unit: 'Go', long: 'gigaoctets' },
- { from: 1e12, to: 1e15, unit: 'To', long: 'teraoctets' },
- { from: 1e15, to: 1e18, unit: 'Po', long: 'petaoctets' },
- { from: 1e18, to: 1e21, unit: 'Eo', long: 'exaoctets' },
- { from: 1e21, to: 1e24, unit: 'Zo', long: 'zettaoctets' },
- { from: 1e24, to: 1e27, unit: 'Yo', long: 'yottaoctets' },
- ],
- iec: [
- { from: 0 , to: Math.pow(1024, 1), unit: 'B' , long: 'bytes' },
- { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'KiB', long: 'kibibytes' },
- { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'MiB', long: 'mebibytes' },
- { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'GiB', long: 'gibibytes' },
- { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'TiB', long: 'tebibytes' },
- { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'PiB', long: 'pebibytes' },
- { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'EiB', long: 'exbibytes' },
- { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'ZiB', long: 'zebibytes' },
- { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'YiB', long: 'yobibytes' },
- ],
- iec_octet: [
- { from: 0 , to: Math.pow(1024, 1), unit: 'o' , long: 'octets' },
- { from: Math.pow(1024, 1), to: Math.pow(1024, 2), unit: 'Kio', long: 'kibioctets' },
- { from: Math.pow(1024, 2), to: Math.pow(1024, 3), unit: 'Mio', long: 'mebioctets' },
- { from: Math.pow(1024, 3), to: Math.pow(1024, 4), unit: 'Gio', long: 'gibioctets' },
- { from: Math.pow(1024, 4), to: Math.pow(1024, 5), unit: 'Tio', long: 'tebioctets' },
- { from: Math.pow(1024, 5), to: Math.pow(1024, 6), unit: 'Pio', long: 'pebioctets' },
- { from: Math.pow(1024, 6), to: Math.pow(1024, 7), unit: 'Eio', long: 'exbioctets' },
- { from: Math.pow(1024, 7), to: Math.pow(1024, 8), unit: 'Zio', long: 'zebioctets' },
- { from: Math.pow(1024, 8), to: Math.pow(1024, 9), unit: 'Yio', long: 'yobioctets' },
- ],
- }
- Object.assign(tables, options.customUnits)
-
- const prefix = bytes < 0 ? '-' : ''
- bytes = Math.abs(bytes)
- const table = tables[options.units]
- if (table) {
- const units = table.find(u => bytes >= u.from && bytes < u.to)
- if (units) {
- const value = units.from === 0
- ? prefix + bytes
- : prefix + (bytes / units.from).toFixed(options.precision)
- this.value = value
- this.unit = units.unit
- this.long = units.long
- } else {
- this.value = prefix + bytes
- this.unit = ''
- this.long = ''
- }
- } else {
- throw new Error(`Invalid units specified: ${options.units}`)
- }
- }
-
- toString () {
- const options = _options.get(this)
- return options.toStringFn ? options.toStringFn.bind(this)() : `${this.value} ${this.unit}`
- }
-}
-
-/**
- * Returns an object with the spec `{ value: string, unit: string, long: string }`. The returned object defines a `toString` method meaning it can be used in any string context.
- * @param {number} - The bytes value to convert.
- * @param [options] {object} - Optional config.
- * @param [options.precision] {number} - Number of decimal places. Defaults to `1`.
- * @param [options.units] {string} - Specify `'metric'`, `'iec'`, `'metric_octet'`, `'iec_octet'` or the name of a property from the custom units table in `options.customUnits`. Defaults to `metric`.
- * @param [options.customUnits] {object} - An object containing one or more custom unit lookup tables.
- * @param [options.toStringFn] {function} - A `toString` function to override the default.
- * @returns {object}
- * @alias module:byte-size
- */
-function byteSize (bytes, options) {
- return new ByteSize(bytes, options)
-}
-
-/**
- * Set the default `byteSize` options for the duration of the process.
- * @param options {object} - A `byteSize` options object.
- */
-byteSize.defaultOptions = function (options) {
- defaultOptions = options
-}
-
-export default byteSize
diff --git a/deps/npm/node_modules/byte-size/package.json b/deps/npm/node_modules/byte-size/package.json
deleted file mode 100644
index b5f454592da10a..00000000000000
--- a/deps/npm/node_modules/byte-size/package.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "name": "byte-size",
- "author": "Lloyd Brookes <75pound@gmail.com>",
- "contributors": [
- {
- "name": "Raul Perez",
- "email": "repejota@gmail.com",
- "url": "http://repejota.com"
- }
- ],
- "version": "7.0.1",
- "main": "dist/index.js",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "description": "Convert a bytes or octets value (e.g. 34565346) to a human-readable string ('34.6 MB'). Choose between metric or IEC units.",
- "repository": "https://github.com/75lb/byte-size",
- "files": [
- "index.mjs",
- "dist/index.js"
- ],
- "keywords": [
- "convert",
- "bytes",
- "octet",
- "size",
- "human",
- "readable",
- "metric",
- "IEC"
- ],
- "scripts": {
- "test": "npm run dist && npm run test:esm && npm run test:web",
- "test:esm": "esm-runner test.mjs",
- "test:web": "web-runner test.mjs",
- "docs": "jsdoc2md -t README.hbs dist/index.js > README.md",
- "cover": "c8 npm test && c8 report --reporter=text-lcov | coveralls",
- "dist": "rollup -f umd -n byteSize -o dist/index.js index.mjs"
- },
- "devDependencies": {
- "@test-runner/web": "^0.3.5",
- "coveralls": "^3.1.0",
- "esm-runner": "^0.3.4",
- "isomorphic-assert": "^0.1.1",
- "jsdoc-to-markdown": "^7.0.0",
- "rollup": "^2.40.0",
- "test-object-model": "^0.6.1"
- },
- "standard": {
- "ignore": [
- "dist"
- ]
- }
-}
diff --git a/deps/npm/node_modules/chalk/package.json b/deps/npm/node_modules/chalk/package.json
index c2d63f67e5e955..47c23f29068caa 100644
--- a/deps/npm/node_modules/chalk/package.json
+++ b/deps/npm/node_modules/chalk/package.json
@@ -1,6 +1,6 @@
{
"name": "chalk",
- "version": "4.1.1",
+ "version": "4.1.2",
"description": "Terminal string styling done right",
"license": "MIT",
"repository": "chalk/chalk",
diff --git a/deps/npm/node_modules/chalk/readme.md b/deps/npm/node_modules/chalk/readme.md
index 851259216bc193..a055d21c97ed76 100644
--- a/deps/npm/node_modules/chalk/readme.md
+++ b/deps/npm/node_modules/chalk/readme.md
@@ -33,7 +33,7 @@
-
+
@@ -48,6 +48,12 @@
and avoiding access controls. Keep your team and servers in sync with Doppler.
+
+
+
+
+
+
diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js
index e15042da910306..947cd94bb41bca 100644
--- a/deps/npm/node_modules/graceful-fs/graceful-fs.js
+++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js
@@ -54,7 +54,7 @@ if (!fs[gracefulQueue]) {
return fs$close.call(fs, fd, function (err) {
// This function uses the graceful-fs shared queue
if (!err) {
- retry()
+ resetQueue()
}
if (typeof cb === 'function')
@@ -72,7 +72,7 @@ if (!fs[gracefulQueue]) {
function closeSync (fd) {
// This function uses the graceful-fs shared queue
fs$closeSync.apply(fs, arguments)
- retry()
+ resetQueue()
}
Object.defineProperty(closeSync, previousSymbol, {
@@ -114,14 +114,13 @@ function patch (fs) {
return go$readFile(path, options, cb)
- function go$readFile (path, options, cb) {
+ function go$readFile (path, options, cb, startTime) {
return fs$readFile(path, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([go$readFile, [path, options, cb]])
+ enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
cb.apply(this, arguments)
- retry()
}
})
}
@@ -135,14 +134,13 @@ function patch (fs) {
return go$writeFile(path, data, options, cb)
- function go$writeFile (path, data, options, cb) {
+ function go$writeFile (path, data, options, cb, startTime) {
return fs$writeFile(path, data, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([go$writeFile, [path, data, options, cb]])
+ enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
cb.apply(this, arguments)
- retry()
}
})
}
@@ -157,14 +155,13 @@ function patch (fs) {
return go$appendFile(path, data, options, cb)
- function go$appendFile (path, data, options, cb) {
+ function go$appendFile (path, data, options, cb, startTime) {
return fs$appendFile(path, data, options, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([go$appendFile, [path, data, options, cb]])
+ enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
cb.apply(this, arguments)
- retry()
}
})
}
@@ -178,49 +175,43 @@ function patch (fs) {
cb = flags
flags = 0
}
- return fs$copyFile(src, dest, flags, function (err) {
- if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([fs$copyFile, [src, dest, flags, cb]])
- else {
- if (typeof cb === 'function')
- cb.apply(this, arguments)
- retry()
- }
- })
+ return go$copyFile(src, dest, flags, cb)
+
+ function go$copyFile (src, dest, flags, cb, startTime) {
+ return fs$copyFile(src, dest, flags, function (err) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (typeof cb === 'function')
+ cb.apply(this, arguments)
+ }
+ })
+ }
}
var fs$readdir = fs.readdir
fs.readdir = readdir
function readdir (path, options, cb) {
- var args = [path]
- if (typeof options !== 'function') {
- args.push(options)
- } else {
- cb = options
- }
- args.push(go$readdir$cb)
-
- return go$readdir(args)
+ if (typeof options === 'function')
+ cb = options, options = null
- function go$readdir$cb (err, files) {
- if (files && files.sort)
- files.sort()
+ return go$readdir(path, options, cb)
- if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([go$readdir, [args]])
+ function go$readdir (path, options, cb, startTime) {
+ return fs$readdir(path, options, function (err, files) {
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
+ enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()])
+ else {
+ if (files && files.sort)
+ files.sort()
- else {
- if (typeof cb === 'function')
- cb.apply(this, arguments)
- retry()
- }
+ if (typeof cb === 'function')
+ cb.call(this, err, files)
+ }
+ })
}
}
- function go$readdir (args) {
- return fs$readdir.apply(fs, args)
- }
-
if (process.version.substr(0, 4) === 'v0.8') {
var legStreams = legacy(fs)
ReadStream = legStreams.ReadStream
@@ -343,14 +334,13 @@ function patch (fs) {
return go$open(path, flags, mode, cb)
- function go$open (path, flags, mode, cb) {
+ function go$open (path, flags, mode, cb, startTime) {
return fs$open(path, flags, mode, function (err, fd) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
- enqueue([go$open, [path, flags, mode, cb]])
+ enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
cb.apply(this, arguments)
- retry()
}
})
}
@@ -362,12 +352,78 @@ function patch (fs) {
function enqueue (elem) {
debug('ENQUEUE', elem[0].name, elem[1])
fs[gracefulQueue].push(elem)
+ retry()
+}
+
+// keep track of the timeout between retry() calls
+var retryTimer
+
+// reset the startTime and lastTime to now
+// this resets the start of the 60 second overall timeout as well as the
+// delay between attempts so that we'll retry these jobs sooner
+function resetQueue () {
+ var now = Date.now()
+ for (var i = 0; i < fs[gracefulQueue].length; ++i) {
+ // entries that are only a length of 2 are from an older version, don't
+ // bother modifying those since they'll be retried anyway.
+ if (fs[gracefulQueue][i].length > 2) {
+ fs[gracefulQueue][i][3] = now // startTime
+ fs[gracefulQueue][i][4] = now // lastTime
+ }
+ }
+ // call retry to make sure we're actively processing the queue
+ retry()
}
function retry () {
+ // clear the timer and remove it to help prevent unintended concurrency
+ clearTimeout(retryTimer)
+ retryTimer = undefined
+
+ if (fs[gracefulQueue].length === 0)
+ return
+
var elem = fs[gracefulQueue].shift()
- if (elem) {
- debug('RETRY', elem[0].name, elem[1])
- elem[0].apply(null, elem[1])
+ var fn = elem[0]
+ var args = elem[1]
+ // these items may be unset if they were added by an older graceful-fs
+ var err = elem[2]
+ var startTime = elem[3]
+ var lastTime = elem[4]
+
+ // if we don't have a startTime we have no way of knowing if we've waited
+ // long enough, so go ahead and retry this item now
+ if (startTime === undefined) {
+ debug('RETRY', fn.name, args)
+ fn.apply(null, args)
+ } else if (Date.now() - startTime >= 60000) {
+ // it's been more than 60 seconds total, bail now
+ debug('TIMEOUT', fn.name, args)
+ var cb = args.pop()
+ if (typeof cb === 'function')
+ cb.call(null, err)
+ } else {
+ // the amount of time between the last attempt and right now
+ var sinceAttempt = Date.now() - lastTime
+ // the amount of time between when we first tried, and when we last tried
+ // rounded up to at least 1
+ var sinceStart = Math.max(lastTime - startTime, 1)
+ // backoff. wait longer than the total time we've been retrying, but only
+ // up to a maximum of 100ms
+ var desiredDelay = Math.min(sinceStart * 1.2, 100)
+ // it's been long enough since the last retry, do it again
+ if (sinceAttempt >= desiredDelay) {
+ debug('RETRY', fn.name, args)
+ fn.apply(null, args.concat([startTime]))
+ } else {
+ // if we can't do this job yet, push it to the end of the queue
+ // and let the next iteration check again
+ fs[gracefulQueue].push(elem)
+ }
+ }
+
+ // schedule our next run if one isn't already scheduled
+ if (retryTimer === undefined) {
+ retryTimer = setTimeout(retry, 0)
}
}
diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json
index d73f971fc22f56..032c7d0b584485 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.6",
+ "version": "4.2.8",
"repository": {
"type": "git",
"url": "https://github.com/isaacs/node-graceful-fs"
diff --git a/deps/npm/node_modules/libnpmexec/lib/index.js b/deps/npm/node_modules/libnpmexec/lib/index.js
index 57c2a148d34892..3f1463d767a8e0 100644
--- a/deps/npm/node_modules/libnpmexec/lib/index.js
+++ b/deps/npm/node_modules/libnpmexec/lib/index.js
@@ -165,6 +165,8 @@ const exec = async (opts) => {
const prompt = `Need to install the following packages:\n${
addList
}Ok to proceed? `
+ if (typeof log.clearProgress === 'function')
+ log.clearProgress()
const confirm = await read({ prompt, default: 'y' })
if (confirm.trim().toLowerCase().charAt(0) !== 'y')
throw new Error('canceled')
diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json
index dff91077d148a0..2668f11731e6f5 100644
--- a/deps/npm/node_modules/libnpmexec/package.json
+++ b/deps/npm/node_modules/libnpmexec/package.json
@@ -1,6 +1,6 @@
{
"name": "libnpmexec",
- "version": "2.0.0",
+ "version": "2.0.1",
"files": [
"lib"
],
diff --git a/deps/npm/node_modules/tar/lib/extract.js b/deps/npm/node_modules/tar/lib/extract.js
index f269145edef7ad..98e946ec5bfbbc 100644
--- a/deps/npm/node_modules/tar/lib/extract.js
+++ b/deps/npm/node_modules/tar/lib/extract.js
@@ -6,6 +6,7 @@ const Unpack = require('./unpack.js')
const fs = require('fs')
const fsm = require('fs-minipass')
const path = require('path')
+const stripSlash = require('./strip-trailing-slashes.js')
module.exports = (opt_, files, cb) => {
if (typeof opt_ === 'function')
@@ -41,7 +42,7 @@ module.exports = (opt_, files, cb) => {
// construct a filter that limits the file entries listed
// include child entries if a dir is included
const filesFilter = (opt, files) => {
- const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true]))
+ const map = new Map(files.map(f => [stripSlash(f), true]))
const filter = opt.filter
const mapHas = (file, r) => {
@@ -55,8 +56,8 @@ const filesFilter = (opt, files) => {
}
opt.filter = filter
- ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, ''))
- : file => mapHas(file.replace(/\/+$/, ''))
+ ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file))
+ : file => mapHas(stripSlash(file))
}
const extractFileSync = opt => {
diff --git a/deps/npm/node_modules/tar/lib/list.js b/deps/npm/node_modules/tar/lib/list.js
index 702cfea808d421..a0c1cf2fbc7eac 100644
--- a/deps/npm/node_modules/tar/lib/list.js
+++ b/deps/npm/node_modules/tar/lib/list.js
@@ -9,6 +9,7 @@ const Parser = require('./parse.js')
const fs = require('fs')
const fsm = require('fs-minipass')
const path = require('path')
+const stripSlash = require('./strip-trailing-slashes.js')
module.exports = (opt_, files, cb) => {
if (typeof opt_ === 'function')
@@ -54,7 +55,7 @@ const onentryFunction = opt => {
// construct a filter that limits the file entries listed
// include child entries if a dir is included
const filesFilter = (opt, files) => {
- const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true]))
+ const map = new Map(files.map(f => [stripSlash(f), true]))
const filter = opt.filter
const mapHas = (file, r) => {
@@ -68,8 +69,8 @@ const filesFilter = (opt, files) => {
}
opt.filter = filter
- ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, ''))
- : file => mapHas(file.replace(/\/+$/, ''))
+ ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file))
+ : file => mapHas(stripSlash(file))
}
const listFileSync = opt => {
diff --git a/deps/npm/node_modules/tar/lib/mkdir.js b/deps/npm/node_modules/tar/lib/mkdir.js
index aed398fcdcd441..a0719e6c36ed33 100644
--- a/deps/npm/node_modules/tar/lib/mkdir.js
+++ b/deps/npm/node_modules/tar/lib/mkdir.js
@@ -8,6 +8,7 @@ const mkdirp = require('mkdirp')
const fs = require('fs')
const path = require('path')
const chownr = require('chownr')
+const normPath = require('./normalize-windows-path.js')
class SymlinkError extends Error {
constructor (symlink, path) {
@@ -33,7 +34,20 @@ class CwdError extends Error {
}
}
+const cGet = (cache, key) => cache.get(normPath(key))
+const cSet = (cache, key, val) => cache.set(normPath(key), val)
+
+const checkCwd = (dir, cb) => {
+ fs.stat(dir, (er, st) => {
+ if (er || !st.isDirectory())
+ er = new CwdError(dir, er && er.code || 'ENOTDIR')
+ cb(er)
+ })
+}
+
module.exports = (dir, opt, cb) => {
+ dir = normPath(dir)
+
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
const umask = opt.umask
@@ -49,13 +63,13 @@ module.exports = (dir, opt, cb) => {
const preserve = opt.preserve
const unlink = opt.unlink
const cache = opt.cache
- const cwd = opt.cwd
+ const cwd = normPath(opt.cwd)
const done = (er, created) => {
if (er)
cb(er)
else {
- cache.set(dir, true)
+ cSet(cache, dir, true)
if (created && doChown)
chownr(created, uid, gid, er => done(er))
else if (needChmod)
@@ -65,22 +79,17 @@ module.exports = (dir, opt, cb) => {
}
}
- if (cache && cache.get(dir) === true)
+ if (cache && cGet(cache, dir) === true)
return done()
- if (dir === cwd) {
- return fs.stat(dir, (er, st) => {
- if (er || !st.isDirectory())
- er = new CwdError(dir, er && er.code || 'ENOTDIR')
- done(er)
- })
- }
+ if (dir === cwd)
+ return checkCwd(dir, done)
if (preserve)
return mkdirp(dir, {mode}).then(made => done(null, made), done)
- const sub = path.relative(cwd, dir)
- const parts = sub.split(/\/|\\/)
+ const sub = normPath(path.relative(cwd, dir))
+ const parts = sub.split('/')
mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)
}
@@ -88,22 +97,19 @@ const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {
if (!parts.length)
return cb(null, created)
const p = parts.shift()
- const part = base + '/' + p
- if (cache.get(part))
+ const part = normPath(path.resolve(base + '/' + p))
+ if (cGet(cache, part))
return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))
}
const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {
if (er) {
- if (er.path && path.dirname(er.path) === cwd &&
- (er.code === 'ENOTDIR' || er.code === 'ENOENT'))
- return cb(new CwdError(cwd, er.code))
-
fs.lstat(part, (statEr, st) => {
- if (statEr)
+ if (statEr) {
+ statEr.path = statEr.path && normPath(statEr.path)
cb(statEr)
- else if (st.isDirectory())
+ } else if (st.isDirectory())
mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
else if (unlink) {
fs.unlink(part, er => {
@@ -122,7 +128,21 @@ const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {
}
}
+const checkCwdSync = dir => {
+ let ok = false
+ let code = 'ENOTDIR'
+ try {
+ ok = fs.statSync(dir).isDirectory()
+ } catch (er) {
+ code = er.code
+ } finally {
+ if (!ok)
+ throw new CwdError(dir, code)
+ }
+}
+
module.exports.sync = (dir, opt) => {
+ dir = normPath(dir)
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
const umask = opt.umask
@@ -138,64 +158,51 @@ module.exports.sync = (dir, opt) => {
const preserve = opt.preserve
const unlink = opt.unlink
const cache = opt.cache
- const cwd = opt.cwd
+ const cwd = normPath(opt.cwd)
const done = (created) => {
- cache.set(dir, true)
+ cSet(cache, dir, true)
if (created && doChown)
chownr.sync(created, uid, gid)
if (needChmod)
fs.chmodSync(dir, mode)
}
- if (cache && cache.get(dir) === true)
+ if (cache && cGet(cache, dir) === true)
return done()
if (dir === cwd) {
- let ok = false
- let code = 'ENOTDIR'
- try {
- ok = fs.statSync(dir).isDirectory()
- } catch (er) {
- code = er.code
- } finally {
- if (!ok)
- throw new CwdError(dir, code)
- }
- done()
- return
+ checkCwdSync(cwd)
+ return done()
}
if (preserve)
return done(mkdirp.sync(dir, mode))
- const sub = path.relative(cwd, dir)
- const parts = sub.split(/\/|\\/)
+ const sub = normPath(path.relative(cwd, dir))
+ const parts = sub.split('/')
let created = null
for (let p = parts.shift(), part = cwd;
p && (part += '/' + p);
p = parts.shift()) {
- if (cache.get(part))
+ part = normPath(path.resolve(part))
+ if (cGet(cache, part))
continue
try {
fs.mkdirSync(part, mode)
created = created || part
- cache.set(part, true)
+ cSet(cache, part, true)
} catch (er) {
- if (er.path && path.dirname(er.path) === cwd &&
- (er.code === 'ENOTDIR' || er.code === 'ENOENT'))
- return new CwdError(cwd, er.code)
-
const st = fs.lstatSync(part)
if (st.isDirectory()) {
- cache.set(part, true)
+ cSet(cache, part, true)
continue
} else if (unlink) {
fs.unlinkSync(part)
fs.mkdirSync(part, mode)
created = created || part
- cache.set(part, true)
+ cSet(cache, part, true)
continue
} else if (st.isSymbolicLink())
return new SymlinkError(part, part + '/' + parts.join('/'))
diff --git a/deps/npm/node_modules/tar/lib/normalize-windows-path.js b/deps/npm/node_modules/tar/lib/normalize-windows-path.js
new file mode 100644
index 00000000000000..eb13ba01b7b044
--- /dev/null
+++ b/deps/npm/node_modules/tar/lib/normalize-windows-path.js
@@ -0,0 +1,8 @@
+// on windows, either \ or / are valid directory separators.
+// on unix, \ is a valid character in filenames.
+// so, on windows, and only on windows, we replace all \ chars with /,
+// so that we can use / as our one and only directory separator char.
+
+const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform
+module.exports = platform !== 'win32' ? p => p
+ : p => p && p.replace(/\\/g, '/')
diff --git a/deps/npm/node_modules/tar/lib/pack.js b/deps/npm/node_modules/tar/lib/pack.js
index 492fe18ec47ee4..9522c10bfe4a4d 100644
--- a/deps/npm/node_modules/tar/lib/pack.js
+++ b/deps/npm/node_modules/tar/lib/pack.js
@@ -54,6 +54,7 @@ const ONDRAIN = Symbol('ondrain')
const fs = require('fs')
const path = require('path')
const warner = require('./warn-mixin.js')
+const normPath = require('./normalize-windows-path.js')
const Pack = warner(class Pack extends MiniPass {
constructor (opt) {
@@ -66,7 +67,7 @@ const Pack = warner(class Pack extends MiniPass {
this.preservePaths = !!opt.preservePaths
this.strict = !!opt.strict
this.noPax = !!opt.noPax
- this.prefix = (opt.prefix || '').replace(/(\\|\/)+$/, '')
+ this.prefix = normPath(opt.prefix || '')
this.linkCache = opt.linkCache || new Map()
this.statCache = opt.statCache || new Map()
this.readdirCache = opt.readdirCache || new Map()
@@ -133,10 +134,7 @@ const Pack = warner(class Pack extends MiniPass {
}
[ADDTARENTRY] (p) {
- const absolute = path.resolve(this.cwd, p.path)
- if (this.prefix)
- p.path = this.prefix + '/' + p.path.replace(/^\.(\/+|$)/, '')
-
+ const absolute = normPath(path.resolve(this.cwd, p.path))
// in this case, we don't have to wait for the stat
if (!this.filter(p.path, p))
p.resume()
@@ -152,10 +150,7 @@ const Pack = warner(class Pack extends MiniPass {
}
[ADDFSENTRY] (p) {
- const absolute = path.resolve(this.cwd, p)
- if (this.prefix)
- p = this.prefix + '/' + p.replace(/^\.(\/+|$)/, '')
-
+ const absolute = normPath(path.resolve(this.cwd, p))
this[QUEUE].push(new PackJob(p, absolute))
this[PROCESS]()
}
@@ -298,6 +293,7 @@ const Pack = warner(class Pack extends MiniPass {
statCache: this.statCache,
noMtime: this.noMtime,
mtime: this.mtime,
+ prefix: this.prefix,
}
}
@@ -323,10 +319,7 @@ const Pack = warner(class Pack extends MiniPass {
if (job.readdir) {
job.readdir.forEach(entry => {
- const p = this.prefix ?
- job.path.slice(this.prefix.length + 1) || './'
- : job.path
-
+ const p = job.path
const base = p === './' ? '' : p.replace(/\/*$/, '/')
this[ADDFSENTRY](base + entry)
})
@@ -381,10 +374,7 @@ class PackSync extends Pack {
if (job.readdir) {
job.readdir.forEach(entry => {
- const p = this.prefix ?
- job.path.slice(this.prefix.length + 1) || './'
- : job.path
-
+ const p = job.path
const base = p === './' ? '' : p.replace(/\/*$/, '/')
this[ADDFSENTRY](base + entry)
})
diff --git a/deps/npm/node_modules/tar/lib/path-reservations.js b/deps/npm/node_modules/tar/lib/path-reservations.js
index c0a16b0a1f901e..167447af08057b 100644
--- a/deps/npm/node_modules/tar/lib/path-reservations.js
+++ b/deps/npm/node_modules/tar/lib/path-reservations.js
@@ -7,6 +7,8 @@
// while still allowing maximal safe parallelization.
const assert = require('assert')
+const normPath = require('./normalize-windows-path.js')
+const { join } = require('path')
module.exports = () => {
// path => [function or Set]
@@ -18,10 +20,10 @@ module.exports = () => {
const reservations = new Map()
// return a set of parent dirs for a given path
- const { join } = require('path')
const getDirs = path =>
- join(path).split(/[\\/]/).slice(0, -1).reduce((set, path) =>
- set.length ? set.concat(join(set[set.length - 1], path)) : [path], [])
+ path.split('/').slice(0, -1).reduce((set, path) =>
+ set.length ? set.concat(normPath(join(set[set.length - 1], path)))
+ : [path], [])
// functions currently running
const running = new Set()
@@ -97,6 +99,7 @@ module.exports = () => {
}
const reserve = (paths, fn) => {
+ paths = paths.map(p => normPath(join(p)).toLowerCase())
const dirs = new Set(
paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))
)
diff --git a/deps/npm/node_modules/tar/lib/read-entry.js b/deps/npm/node_modules/tar/lib/read-entry.js
index 6661cba5ff9ef3..183a6050ba0d27 100644
--- a/deps/npm/node_modules/tar/lib/read-entry.js
+++ b/deps/npm/node_modules/tar/lib/read-entry.js
@@ -1,5 +1,6 @@
'use strict'
const MiniPass = require('minipass')
+const normPath = require('./normalize-windows-path.js')
const SLURP = Symbol('slurp')
module.exports = class ReadEntry extends MiniPass {
@@ -46,7 +47,7 @@ module.exports = class ReadEntry extends MiniPass {
this.ignore = true
}
- this.path = header.path
+ this.path = normPath(header.path)
this.mode = header.mode
if (this.mode)
this.mode = this.mode & 0o7777
@@ -58,7 +59,7 @@ module.exports = class ReadEntry extends MiniPass {
this.mtime = header.mtime
this.atime = header.atime
this.ctime = header.ctime
- this.linkpath = header.linkpath
+ this.linkpath = normPath(header.linkpath)
this.uname = header.uname
this.gname = header.gname
@@ -93,7 +94,7 @@ module.exports = class ReadEntry extends MiniPass {
// a global extended header, because that's weird.
if (ex[k] !== null && ex[k] !== undefined &&
!(global && k === 'path'))
- this[k] = ex[k]
+ this[k] = k === 'path' || k === 'linkpath' ? normPath(ex[k]) : ex[k]
}
}
}
diff --git a/deps/npm/node_modules/tar/lib/replace.js b/deps/npm/node_modules/tar/lib/replace.js
index e5e2a425536d6d..1374f3f29c6199 100644
--- a/deps/npm/node_modules/tar/lib/replace.js
+++ b/deps/npm/node_modules/tar/lib/replace.js
@@ -170,7 +170,8 @@ const replace = (opt, files, cb) => {
fs.fstat(fd, (er, st) => {
if (er)
- return reject(er)
+ return fs.close(fd, () => reject(er))
+
getPos(fd, st.size, (er, position) => {
if (er)
return reject(er)
diff --git a/deps/npm/node_modules/tar/lib/strip-trailing-slashes.js b/deps/npm/node_modules/tar/lib/strip-trailing-slashes.js
new file mode 100644
index 00000000000000..f702ed5a5c0ce5
--- /dev/null
+++ b/deps/npm/node_modules/tar/lib/strip-trailing-slashes.js
@@ -0,0 +1,24 @@
+// this is the only approach that was significantly faster than using
+// str.replace(/\/+$/, '') for strings ending with a lot of / chars and
+// containing multiple / chars.
+const batchStrings = [
+ '/'.repeat(1024),
+ '/'.repeat(512),
+ '/'.repeat(256),
+ '/'.repeat(128),
+ '/'.repeat(64),
+ '/'.repeat(32),
+ '/'.repeat(16),
+ '/'.repeat(8),
+ '/'.repeat(4),
+ '/'.repeat(2),
+ '/',
+]
+
+module.exports = str => {
+ for (const s of batchStrings) {
+ while (str.length >= s.length && str.slice(-1 * s.length) === s)
+ str = str.slice(0, -1 * s.length)
+ }
+ return str
+}
diff --git a/deps/npm/node_modules/tar/lib/unpack.js b/deps/npm/node_modules/tar/lib/unpack.js
index edaf7833cdb5b7..cf10d07347b695 100644
--- a/deps/npm/node_modules/tar/lib/unpack.js
+++ b/deps/npm/node_modules/tar/lib/unpack.js
@@ -15,6 +15,7 @@ const mkdir = require('./mkdir.js')
const wc = require('./winchars.js')
const pathReservations = require('./path-reservations.js')
const stripAbsolutePath = require('./strip-absolute-path.js')
+const normPath = require('./normalize-windows-path.js')
const ONENTRY = Symbol('onEntry')
const CHECKFS = Symbol('checkFs')
@@ -39,14 +40,10 @@ const SKIP = Symbol('skip')
const DOCHOWN = Symbol('doChown')
const UID = Symbol('uid')
const GID = Symbol('gid')
+const CHECKED_CWD = Symbol('checkedCwd')
const crypto = require('crypto')
const getFlag = require('./get-write-flag.js')
-/* istanbul ignore next */
-const neverCalled = () => {
- throw new Error('sync function called cb somehow?!?')
-}
-
// Unlinks on Windows are not atomic.
//
// This means that if you have a file entry, followed by another
@@ -91,6 +88,17 @@ const uint32 = (a, b, c) =>
: b === b >>> 0 ? b
: c
+const pruneCache = (cache, abs) => {
+ // clear the cache if it's a case-insensitive match, since we can't
+ // know if the current file system is case-sensitive or not.
+ abs = normPath(abs).toLowerCase()
+ for (const path of cache.keys()) {
+ const plower = path.toLowerCase()
+ if (plower === abs || plower.toLowerCase().indexOf(abs + '/') === 0)
+ cache.delete(path)
+ }
+}
+
class Unpack extends Parser {
constructor (opt) {
if (!opt)
@@ -103,6 +111,8 @@ class Unpack extends Parser {
super(opt)
+ this[CHECKED_CWD] = false
+
this.reservations = pathReservations()
this.transform = typeof opt.transform === 'function' ? opt.transform : null
@@ -168,7 +178,7 @@ class Unpack extends Parser {
// links, and removes symlink directories rather than erroring
this.unlink = !!opt.unlink
- this.cwd = path.resolve(opt.cwd || process.cwd())
+ this.cwd = normPath(path.resolve(opt.cwd || process.cwd()))
this.strip = +opt.strip || 0
// if we're not chmodding, then we don't need the process umask
this.processUmask = opt.noChmod ? 0 : process.umask()
@@ -201,21 +211,23 @@ class Unpack extends Parser {
[CHECKPATH] (entry) {
if (this.strip) {
- const parts = entry.path.split(/\/|\\/)
+ const parts = normPath(entry.path).split('/')
if (parts.length < this.strip)
return false
entry.path = parts.slice(this.strip).join('/')
if (entry.type === 'Link') {
- const linkparts = entry.linkpath.split(/\/|\\/)
+ const linkparts = normPath(entry.linkpath).split('/')
if (linkparts.length >= this.strip)
entry.linkpath = linkparts.slice(this.strip).join('/')
+ else
+ return false
}
}
if (!this.preservePaths) {
- const p = entry.path
- if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) {
+ const p = normPath(entry.path)
+ if (p.split('/').includes('..')) {
this.warn('TAR_ENTRY_ERROR', `path contains '..'`, {
entry,
path: p,
@@ -235,18 +247,26 @@ class Unpack extends Parser {
}
}
+ if (path.isAbsolute(entry.path))
+ entry.absolute = normPath(path.resolve(entry.path))
+ else
+ entry.absolute = normPath(path.resolve(this.cwd, entry.path))
+
+ // an archive can set properties on the extraction directory, but it
+ // may not replace the cwd with a different kind of thing entirely.
+ if (entry.absolute === this.cwd &&
+ entry.type !== 'Directory' &&
+ entry.type !== 'GNUDumpDir')
+ return false
+
// only encode : chars that aren't drive letter indicators
if (this.win32) {
- const parsed = path.win32.parse(entry.path)
- entry.path = parsed.root === '' ? wc.encode(entry.path)
- : parsed.root + wc.encode(entry.path.substr(parsed.root.length))
+ const { root: aRoot } = path.win32.parse(entry.absolute)
+ entry.absolute = aRoot + wc.encode(entry.absolute.substr(aRoot.length))
+ const { root: pRoot } = path.win32.parse(entry.path)
+ entry.path = pRoot + wc.encode(entry.path.substr(pRoot.length))
}
- if (path.isAbsolute(entry.path))
- entry.absolute = entry.path
- else
- entry.absolute = path.resolve(this.cwd, entry.path)
-
return true
}
@@ -291,7 +311,7 @@ class Unpack extends Parser {
}
[MKDIR] (dir, mode, cb) {
- mkdir(dir, {
+ mkdir(normPath(dir), {
uid: this.uid,
gid: this.gid,
processUid: this.processUid,
@@ -333,17 +353,37 @@ class Unpack extends Parser {
mode: mode,
autoClose: false,
})
- stream.on('error', er => this[ONERROR](er, entry))
+ stream.on('error', er => {
+ if (stream.fd)
+ fs.close(stream.fd, () => {})
+
+ // flush all the data out so that we aren't left hanging
+ // if the error wasn't actually fatal. otherwise the parse
+ // is blocked, and we never proceed.
+ stream.write = () => true
+ this[ONERROR](er, entry)
+ fullyDone()
+ })
let actions = 1
const done = er => {
- if (er)
- return this[ONERROR](er, entry)
+ if (er) {
+ /* istanbul ignore else - we should always have a fd by now */
+ if (stream.fd)
+ fs.close(stream.fd, () => {})
+
+ this[ONERROR](er, entry)
+ fullyDone()
+ return
+ }
if (--actions === 0) {
fs.close(stream.fd, er => {
+ if (er)
+ this[ONERROR](er, entry)
+ else
+ this[UNPEND]()
fullyDone()
- er ? this[ONERROR](er, entry) : this[UNPEND]()
})
}
}
@@ -378,7 +418,10 @@ class Unpack extends Parser {
const tx = this.transform ? this.transform(entry) || entry : entry
if (tx !== entry) {
- tx.on('error', er => this[ONERROR](er, entry))
+ tx.on('error', er => {
+ this[ONERROR](er, entry)
+ fullyDone()
+ })
entry.pipe(tx)
}
tx.pipe(stream)
@@ -388,8 +431,9 @@ class Unpack extends Parser {
const mode = entry.mode & 0o7777 || this.dmode
this[MKDIR](entry.absolute, mode, er => {
if (er) {
+ this[ONERROR](er, entry)
fullyDone()
- return this[ONERROR](er, entry)
+ return
}
let actions = 1
@@ -427,7 +471,8 @@ class Unpack extends Parser {
}
[HARDLINK] (entry, done) {
- this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done)
+ const linkpath = normPath(path.resolve(this.cwd, entry.linkpath))
+ this[LINK](entry, linkpath, 'link', done)
}
[PEND] () {
@@ -469,46 +514,87 @@ class Unpack extends Parser {
// then that means we are about to delete the directory we created
// previously, and it is no longer going to be a directory, and neither
// is any of its children.
- if (entry.type !== 'Directory') {
- for (const path of this.dirCache.keys()) {
- if (path === entry.absolute ||
- path.indexOf(entry.absolute + '/') === 0 ||
- path.indexOf(entry.absolute + '\\') === 0)
- this.dirCache.delete(path)
- }
+ if (entry.type !== 'Directory')
+ pruneCache(this.dirCache, entry.absolute)
+
+ const checkCwd = () => {
+ this[MKDIR](this.cwd, this.dmode, er => {
+ if (er) {
+ this[ONERROR](er, entry)
+ done()
+ return
+ }
+ this[CHECKED_CWD] = true
+ start()
+ })
}
- this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {
- if (er) {
- done()
- return this[ONERROR](er, entry)
+ const start = () => {
+ if (entry.absolute !== this.cwd) {
+ const parent = normPath(path.dirname(entry.absolute))
+ if (parent !== this.cwd) {
+ return this[MKDIR](parent, this.dmode, er => {
+ if (er) {
+ this[ONERROR](er, entry)
+ done()
+ return
+ }
+ afterMakeParent()
+ })
+ }
}
- fs.lstat(entry.absolute, (er, st) => {
+ afterMakeParent()
+ }
+
+ const afterMakeParent = () => {
+ fs.lstat(entry.absolute, (lstatEr, st) => {
if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
this[SKIP](entry)
done()
- } else if (er || this[ISREUSABLE](entry, st))
- this[MAKEFS](null, entry, done)
+ return
+ }
+ if (lstatEr || this[ISREUSABLE](entry, st))
+ return this[MAKEFS](null, entry, done)
- else if (st.isDirectory()) {
+ if (st.isDirectory()) {
if (entry.type === 'Directory') {
- if (!this.noChmod && (!entry.mode || (st.mode & 0o7777) === entry.mode))
- this[MAKEFS](null, entry, done)
- else {
- fs.chmod(entry.absolute, entry.mode,
- er => this[MAKEFS](er, entry, done))
- }
- } else
- fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done))
- } else
- unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done))
+ const needChmod = !this.noChmod &&
+ entry.mode &&
+ (st.mode & 0o7777) !== entry.mode
+ const afterChmod = er => this[MAKEFS](er, entry, done)
+ if (!needChmod)
+ return afterChmod()
+ return fs.chmod(entry.absolute, entry.mode, afterChmod)
+ }
+ // not a dir entry, have to remove it.
+ if (entry.absolute !== this.cwd) {
+ return fs.rmdir(entry.absolute, er =>
+ this[MAKEFS](er, entry, done))
+ }
+ }
+
+ // not a dir, and not reusable
+ // don't remove if the cwd, we want that error
+ if (entry.absolute === this.cwd)
+ return this[MAKEFS](null, entry, done)
+
+ unlinkFile(entry.absolute, er =>
+ this[MAKEFS](er, entry, done))
})
- })
+ }
+
+ if (this[CHECKED_CWD])
+ start()
+ else
+ checkCwd()
}
[MAKEFS] (er, entry, done) {
- if (er)
- return this[ONERROR](er, entry)
+ if (er) {
+ this[ONERROR](er, entry)
+ done()
+ return
+ }
switch (entry.type) {
case 'File':
@@ -529,55 +615,80 @@ class Unpack extends Parser {
}
[LINK] (entry, linkpath, link, done) {
- // XXX: get the type ('file' or 'dir') for windows
+ // XXX: get the type ('symlink' or 'junction') for windows
fs[link](linkpath, entry.absolute, er => {
if (er)
- return this[ONERROR](er, entry)
+ this[ONERROR](er, entry)
+ else {
+ this[UNPEND]()
+ entry.resume()
+ }
done()
- this[UNPEND]()
- entry.resume()
})
}
}
+const callSync = fn => {
+ try {
+ return [null, fn()]
+ } catch (er) {
+ return [er, null]
+ }
+}
class UnpackSync extends Unpack {
+ [MAKEFS] (er, entry) {
+ return super[MAKEFS](er, entry, () => {})
+ }
+
[CHECKFS] (entry) {
- if (entry.type !== 'Directory') {
- for (const path of this.dirCache.keys()) {
- if (path === entry.absolute ||
- path.indexOf(entry.absolute + '/') === 0 ||
- path.indexOf(entry.absolute + '\\') === 0)
- this.dirCache.delete(path)
+ if (entry.type !== 'Directory')
+ pruneCache(this.dirCache, entry.absolute)
+
+ if (!this[CHECKED_CWD]) {
+ const er = this[MKDIR](this.cwd, this.dmode)
+ if (er)
+ return this[ONERROR](er, entry)
+ this[CHECKED_CWD] = true
+ }
+
+ // don't bother to make the parent if the current entry is the cwd,
+ // we've already checked it.
+ if (entry.absolute !== this.cwd) {
+ const parent = normPath(path.dirname(entry.absolute))
+ if (parent !== this.cwd) {
+ const mkParent = this[MKDIR](parent, this.dmode)
+ if (mkParent)
+ return this[ONERROR](mkParent, entry)
}
}
- const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled)
- if (er)
- return this[ONERROR](er, entry)
- try {
- const st = fs.lstatSync(entry.absolute)
- if (this.keep || this.newer && st.mtime > entry.mtime)
- return this[SKIP](entry)
- else if (this[ISREUSABLE](entry, st))
- return this[MAKEFS](null, entry, neverCalled)
- else {
- try {
- if (st.isDirectory()) {
- if (entry.type === 'Directory') {
- if (!this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode)
- fs.chmodSync(entry.absolute, entry.mode)
- } else
- fs.rmdirSync(entry.absolute)
- } else
- unlinkFileSync(entry.absolute)
- return this[MAKEFS](null, entry, neverCalled)
- } catch (er) {
- return this[ONERROR](er, entry)
- }
+ const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute))
+ if (st && (this.keep || this.newer && st.mtime > entry.mtime))
+ return this[SKIP](entry)
+
+ if (lstatEr || this[ISREUSABLE](entry, st))
+ return this[MAKEFS](null, entry)
+
+ if (st.isDirectory()) {
+ if (entry.type === 'Directory') {
+ const needChmod = !this.noChmod &&
+ entry.mode &&
+ (st.mode & 0o7777) !== entry.mode
+ const [er] = needChmod ? callSync(() => {
+ fs.chmodSync(entry.absolute, entry.mode)
+ }) : []
+ return this[MAKEFS](er, entry)
}
- } catch (er) {
- return this[MAKEFS](null, entry, neverCalled)
+ // not a dir entry, have to remove it
+ const [er] = callSync(() => fs.rmdirSync(entry.absolute))
+ this[MAKEFS](er, entry)
}
+
+ // not a dir, and not reusable.
+ // don't remove if it's the cwd, since we want that error.
+ const [er] = entry.absolute === this.cwd ? []
+ : callSync(() => unlinkFileSync(entry.absolute))
+ this[MAKEFS](er, entry)
}
[FILE] (entry, _) {
@@ -671,7 +782,7 @@ class UnpackSync extends Unpack {
[MKDIR] (dir, mode) {
try {
- return mkdir.sync(dir, {
+ return mkdir.sync(normPath(dir), {
uid: this.uid,
gid: this.gid,
processUid: this.processUid,
diff --git a/deps/npm/node_modules/tar/lib/write-entry.js b/deps/npm/node_modules/tar/lib/write-entry.js
index 0301759ad386f2..3702f2ae519796 100644
--- a/deps/npm/node_modules/tar/lib/write-entry.js
+++ b/deps/npm/node_modules/tar/lib/write-entry.js
@@ -4,6 +4,15 @@ const Pax = require('./pax.js')
const Header = require('./header.js')
const fs = require('fs')
const path = require('path')
+const normPath = require('./normalize-windows-path.js')
+const stripSlash = require('./strip-trailing-slashes.js')
+
+const prefixPath = (path, prefix) => {
+ if (!prefix)
+ return normPath(path)
+ path = normPath(path).replace(/^\.(\/|$)/, '')
+ return stripSlash(prefix) + '/' + path
+}
const maxReadSize = 16 * 1024 * 1024
const PROCESS = Symbol('process')
@@ -21,6 +30,10 @@ const OPENFILE = Symbol('openfile')
const ONOPENFILE = Symbol('onopenfile')
const CLOSE = Symbol('close')
const MODE = Symbol('mode')
+const AWAITDRAIN = Symbol('awaitDrain')
+const ONDRAIN = Symbol('ondrain')
+const PREFIX = Symbol('prefix')
+const HAD_ERROR = Symbol('hadError')
const warner = require('./warn-mixin.js')
const winchars = require('./winchars.js')
const stripAbsolutePath = require('./strip-absolute-path.js')
@@ -33,21 +46,31 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
super(opt)
if (typeof p !== 'string')
throw new TypeError('path is required')
- this.path = p
+ this.path = normPath(p)
// suppress atime, ctime, uid, gid, uname, gname
this.portable = !!opt.portable
// until node has builtin pwnam functions, this'll have to do
- this.myuid = process.getuid && process.getuid()
+ this.myuid = process.getuid && process.getuid() || 0
this.myuser = process.env.USER || ''
this.maxReadSize = opt.maxReadSize || maxReadSize
this.linkCache = opt.linkCache || new Map()
this.statCache = opt.statCache || new Map()
this.preservePaths = !!opt.preservePaths
- this.cwd = opt.cwd || process.cwd()
+ this.cwd = normPath(opt.cwd || process.cwd())
this.strict = !!opt.strict
this.noPax = !!opt.noPax
this.noMtime = !!opt.noMtime
this.mtime = opt.mtime || null
+ this.prefix = opt.prefix ? normPath(opt.prefix) : null
+
+ this.fd = null
+ this.blockLen = null
+ this.blockRemain = null
+ this.buf = null
+ this.offset = null
+ this.length = null
+ this.pos = null
+ this.remain = null
if (typeof opt.onwarn === 'function')
this.on('warn', opt.onwarn)
@@ -63,11 +86,13 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
this.win32 = !!opt.win32 || process.platform === 'win32'
if (this.win32) {
+ // force the \ to / normalization, since we might not *actually*
+ // be on windows, but want \ to be considered a path separator.
this.path = winchars.decode(this.path.replace(/\\/g, '/'))
p = p.replace(/\\/g, '/')
}
- this.absolute = opt.absolute || path.resolve(this.cwd, p)
+ this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p))
if (this.path === '')
this.path = './'
@@ -85,6 +110,12 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
this[LSTAT]()
}
+ emit (ev, ...data) {
+ if (ev === 'error')
+ this[HAD_ERROR] = true
+ return super.emit(ev, ...data)
+ }
+
[LSTAT] () {
fs.lstat(this.absolute, (er, stat) => {
if (er)
@@ -117,13 +148,19 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
return modeFix(mode, this.type === 'Directory', this.portable)
}
+ [PREFIX] (path) {
+ return prefixPath(path, this.prefix)
+ }
+
[HEADER] () {
if (this.type === 'Directory' && this.portable)
this.noMtime = true
this.header = new Header({
- path: this.path,
- linkpath: this.linkpath,
+ path: this[PREFIX](this.path),
+ // only apply the prefix to hard links.
+ linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)
+ : this.linkpath,
// only the permissions and setuid/setgid/sticky bitflags
// not the higher-order bits that specify file type
mode: this[MODE](this.stat.mode),
@@ -139,13 +176,14 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
})
if (this.header.encode() && !this.noPax) {
- this.write(new Pax({
+ super.write(new Pax({
atime: this.portable ? null : this.header.atime,
ctime: this.portable ? null : this.header.ctime,
gid: this.portable ? null : this.header.gid,
mtime: this.noMtime ? null : this.mtime || this.header.mtime,
- path: this.path,
- linkpath: this.linkpath,
+ path: this[PREFIX](this.path),
+ linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)
+ : this.linkpath,
size: this.header.size,
uid: this.portable ? null : this.header.uid,
uname: this.portable ? null : this.header.uname,
@@ -154,7 +192,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
nlink: this.portable ? null : this.stat.nlink,
}).encode())
}
- this.write(this.header.block)
+ super.write(this.header.block)
}
[DIRECTORY] () {
@@ -174,14 +212,14 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
}
[ONREADLINK] (linkpath) {
- this.linkpath = linkpath.replace(/\\/g, '/')
+ this.linkpath = normPath(linkpath)
this[HEADER]()
this.end()
}
[HARDLINK] (linkpath) {
this.type = 'Link'
- this.linkpath = path.relative(this.cwd, linkpath).replace(/\\/g, '/')
+ this.linkpath = normPath(path.relative(this.cwd, linkpath))
this.stat.size = 0
this[HEADER]()
this.end()
@@ -214,74 +252,110 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
}
[ONOPENFILE] (fd) {
- const blockLen = 512 * Math.ceil(this.stat.size / 512)
- const bufLen = Math.min(blockLen, this.maxReadSize)
- const buf = Buffer.allocUnsafe(bufLen)
- this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen)
+ this.fd = fd
+ if (this[HAD_ERROR])
+ return this[CLOSE]()
+
+ this.blockLen = 512 * Math.ceil(this.stat.size / 512)
+ this.blockRemain = this.blockLen
+ const bufLen = Math.min(this.blockLen, this.maxReadSize)
+ this.buf = Buffer.allocUnsafe(bufLen)
+ this.offset = 0
+ this.pos = 0
+ this.remain = this.stat.size
+ this.length = this.buf.length
+ this[READ]()
}
- [READ] (fd, buf, offset, length, pos, remain, blockRemain) {
+ [READ] () {
+ const { fd, buf, offset, length, pos } = this
fs.read(fd, buf, offset, length, pos, (er, bytesRead) => {
if (er) {
// ignoring the error from close(2) is a bad practice, but at
// this point we already have an error, don't need another one
- return this[CLOSE](fd, () => this.emit('error', er))
+ return this[CLOSE](() => this.emit('error', er))
}
- this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)
+ this[ONREAD](bytesRead)
})
}
- [CLOSE] (fd, cb) {
- fs.close(fd, cb)
+ [CLOSE] (cb) {
+ fs.close(this.fd, cb)
}
- [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) {
- if (bytesRead <= 0 && remain > 0) {
+ [ONREAD] (bytesRead) {
+ if (bytesRead <= 0 && this.remain > 0) {
const er = new Error('encountered unexpected EOF')
er.path = this.absolute
er.syscall = 'read'
er.code = 'EOF'
- return this[CLOSE](fd, () => this.emit('error', er))
+ return this[CLOSE](() => this.emit('error', er))
}
- if (bytesRead > remain) {
+ if (bytesRead > this.remain) {
const er = new Error('did not encounter expected EOF')
er.path = this.absolute
er.syscall = 'read'
er.code = 'EOF'
- return this[CLOSE](fd, () => this.emit('error', er))
+ return this[CLOSE](() => this.emit('error', er))
}
// null out the rest of the buffer, if we could fit the block padding
- if (bytesRead === remain) {
- for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) {
- buf[i + offset] = 0
+ // at the end of this loop, we've incremented bytesRead and this.remain
+ // to be incremented up to the blockRemain level, as if we had expected
+ // to get a null-padded file, and read it until the end. then we will
+ // decrement both remain and blockRemain by bytesRead, and know that we
+ // reached the expected EOF, without any null buffer to append.
+ if (bytesRead === this.remain) {
+ for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) {
+ this.buf[i + this.offset] = 0
bytesRead++
- remain++
+ this.remain++
}
}
- const writeBuf = offset === 0 && bytesRead === buf.length ?
- buf : buf.slice(offset, offset + bytesRead)
- remain -= bytesRead
- blockRemain -= bytesRead
- pos += bytesRead
- offset += bytesRead
+ const writeBuf = this.offset === 0 && bytesRead === this.buf.length ?
+ this.buf : this.buf.slice(this.offset, this.offset + bytesRead)
+
+ const flushed = this.write(writeBuf)
+ if (!flushed)
+ this[AWAITDRAIN](() => this[ONDRAIN]())
+ else
+ this[ONDRAIN]()
+ }
+
+ [AWAITDRAIN] (cb) {
+ this.once('drain', cb)
+ }
- this.write(writeBuf)
+ write (writeBuf) {
+ if (this.blockRemain < writeBuf.length) {
+ const er = new Error('writing more data than expected')
+ er.path = this.absolute
+ return this.emit('error', er)
+ }
+ this.remain -= writeBuf.length
+ this.blockRemain -= writeBuf.length
+ this.pos += writeBuf.length
+ this.offset += writeBuf.length
+ return super.write(writeBuf)
+ }
- if (!remain) {
- if (blockRemain)
- this.write(Buffer.alloc(blockRemain))
- return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end())
+ [ONDRAIN] () {
+ if (!this.remain) {
+ if (this.blockRemain)
+ super.write(Buffer.alloc(this.blockRemain))
+ return this[CLOSE](er => er ? this.emit('error', er) : this.end())
}
- if (offset >= length) {
- buf = Buffer.allocUnsafe(length)
- offset = 0
+ if (this.offset >= this.length) {
+ // if we only have a smaller bit left to read, alloc a smaller buffer
+ // otherwise, keep it the same length it was before.
+ this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length))
+ this.offset = 0
}
- length = buf.length - offset
- this[READ](fd, buf, offset, length, pos, remain, blockRemain)
+ this.length = this.buf.length - this.offset
+ this[READ]()
}
})
@@ -298,25 +372,30 @@ class WriteEntrySync extends WriteEntry {
this[ONOPENFILE](fs.openSync(this.absolute, 'r'))
}
- [READ] (fd, buf, offset, length, pos, remain, blockRemain) {
+ [READ] () {
let threw = true
try {
+ const { fd, buf, offset, length, pos } = this
const bytesRead = fs.readSync(fd, buf, offset, length, pos)
- this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)
+ this[ONREAD](bytesRead)
threw = false
} finally {
// ignoring the error from close(2) is a bad practice, but at
// this point we already have an error, don't need another one
if (threw) {
try {
- this[CLOSE](fd, () => {})
+ this[CLOSE](() => {})
} catch (er) {}
}
}
}
- [CLOSE] (fd, cb) {
- fs.closeSync(fd)
+ [AWAITDRAIN] (cb) {
+ cb()
+ }
+
+ [CLOSE] (cb) {
+ fs.closeSync(this.fd)
cb()
}
}
@@ -336,7 +415,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
if (this.type === 'Directory' && this.portable)
this.noMtime = true
- this.path = readEntry.path
+ this.prefix = opt.prefix || null
+
+ this.path = normPath(readEntry.path)
this.mode = this[MODE](readEntry.mode)
this.uid = this.portable ? null : readEntry.uid
this.gid = this.portable ? null : readEntry.gid
@@ -346,7 +427,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime
this.atime = this.portable ? null : readEntry.atime
this.ctime = this.portable ? null : readEntry.ctime
- this.linkpath = readEntry.linkpath
+ this.linkpath = normPath(readEntry.linkpath)
if (typeof opt.onwarn === 'function')
this.on('warn', opt.onwarn)
@@ -364,8 +445,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
this.blockRemain = readEntry.startBlockSize
this.header = new Header({
- path: this.path,
- linkpath: this.linkpath,
+ path: this[PREFIX](this.path),
+ linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)
+ : this.linkpath,
// only the permissions and setuid/setgid/sticky bitflags
// not the higher-order bits that specify file type
mode: this.mode,
@@ -392,8 +474,9 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
ctime: this.portable ? null : this.ctime,
gid: this.portable ? null : this.gid,
mtime: this.noMtime ? null : this.mtime,
- path: this.path,
- linkpath: this.linkpath,
+ path: this[PREFIX](this.path),
+ linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)
+ : this.linkpath,
size: this.size,
uid: this.portable ? null : this.uid,
uname: this.portable ? null : this.uname,
@@ -407,6 +490,10 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
readEntry.pipe(this)
}
+ [PREFIX] (path) {
+ return prefixPath(path, this.prefix)
+ }
+
[MODE] (mode) {
return modeFix(mode, this.type === 'Directory', this.portable)
}
@@ -421,7 +508,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
end () {
if (this.blockRemain)
- this.write(Buffer.alloc(this.blockRemain))
+ super.write(Buffer.alloc(this.blockRemain))
return super.end()
}
})
diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json
index 1c82ac7291631e..42f55d0356ca49 100644
--- a/deps/npm/node_modules/tar/package.json
+++ b/deps/npm/node_modules/tar/package.json
@@ -2,13 +2,15 @@
"author": "Isaac Z. Schlueter (http://blog.izs.me/)",
"name": "tar",
"description": "tar for node",
- "version": "6.1.2",
+ "version": "6.1.8",
"repository": {
"type": "git",
"url": "https://github.com/npm/node-tar.git"
},
"scripts": {
- "test": "tap",
+ "test:posix": "tap",
+ "test:win32": "tap --lines=98 --branches=98 --statements=98 --functions=98",
+ "test": "node test/fixtures/test.js",
"posttest": "npm run lint",
"eslint": "eslint",
"lint": "npm run eslint -- test lib",
diff --git a/deps/npm/package.json b/deps/npm/package.json
index b728f9f88d1ec7..cee4f44d8cb68a 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "7.20.3",
+ "version": "7.20.6",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
@@ -53,24 +53,24 @@
"./package.json": "./package.json"
},
"dependencies": {
- "@npmcli/arborist": "^2.8.0",
+ "@npmcli/arborist": "^2.8.1",
"@npmcli/ci-detect": "^1.2.0",
"@npmcli/config": "^2.2.0",
+ "@npmcli/map-workspaces": "^1.0.4",
"@npmcli/package-json": "^1.0.1",
"@npmcli/run-script": "^1.8.5",
"abbrev": "~1.1.1",
"ansicolors": "~0.3.2",
"ansistyles": "~0.1.3",
"archy": "~1.0.0",
- "byte-size": "^7.0.1",
"cacache": "^15.2.0",
- "chalk": "^4.1.0",
+ "chalk": "^4.1.2",
"chownr": "^2.0.0",
"cli-columns": "^3.1.2",
"cli-table3": "^0.6.0",
"columnify": "~1.5.4",
"glob": "^7.1.7",
- "graceful-fs": "^4.2.6",
+ "graceful-fs": "^4.2.8",
"hosted-git-info": "^4.0.2",
"ini": "^2.0.0",
"init-package-json": "^2.0.3",
@@ -79,7 +79,7 @@
"leven": "^3.1.0",
"libnpmaccess": "^4.0.2",
"libnpmdiff": "^2.0.4",
- "libnpmexec": "^2.0.0",
+ "libnpmexec": "^2.0.1",
"libnpmfund": "^1.1.0",
"libnpmhook": "^6.0.2",
"libnpmorg": "^2.0.2",
@@ -114,7 +114,7 @@
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"ssri": "^8.0.1",
- "tar": "^6.1.2",
+ "tar": "^6.1.8",
"text-table": "~0.2.0",
"tiny-relative-date": "^1.3.0",
"treeverse": "^1.0.4",
@@ -126,13 +126,13 @@
"@npmcli/arborist",
"@npmcli/ci-detect",
"@npmcli/config",
+ "@npmcli/map-workspaces",
"@npmcli/package-json",
"@npmcli/run-script",
"abbrev",
"ansicolors",
"ansistyles",
"archy",
- "byte-size",
"cacache",
"chalk",
"chownr",
@@ -199,6 +199,7 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"licensee": "^8.2.0",
+ "spawk": "^1.7.1",
"tap": "^15.0.9"
},
"scripts": {
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 0a79e38cdfa031..c1316e04d7ad99 100644
--- a/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs
+++ b/deps/npm/tap-snapshots/smoke-tests/index.js.test.cjs
@@ -340,6 +340,7 @@ exports[`smoke-tests/index.js TAP npm install dev dep > should have expected dev
"requires": true,
"packages": {
"": {
+ "name": "project",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
@@ -426,6 +427,7 @@ exports[`smoke-tests/index.js TAP npm install prodDep@version > should have expe
"requires": true,
"packages": {
"": {
+ "name": "project",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
@@ -614,6 +616,7 @@ exports[`smoke-tests/index.js TAP npm uninstall > should have expected uninstall
"requires": true,
"packages": {
"": {
+ "name": "project",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
@@ -671,6 +674,7 @@ exports[`smoke-tests/index.js TAP npm update dep > should have expected update l
"requires": true,
"packages": {
"": {
+ "name": "project",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
diff --git a/deps/npm/tap-snapshots/test/lib/view.js.test.cjs b/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
index 41d7a80fe3b16f..27ba7b1eb69276 100644
--- a/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
+++ b/deps/npm/tap-snapshots/test/lib/view.js.test.cjs
@@ -77,7 +77,7 @@ dist
.tarball:[36mhttp://hm.blue.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -94,7 +94,7 @@ dist
.tarball:[36mhttp://hm.blue.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -118,7 +118,7 @@ dist
.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dependencies:
[33mred[39m: 1.0.0
@@ -178,7 +178,7 @@ dist
.tarball:[36mhttp://hm.orange.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -200,7 +200,7 @@ dist
.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dependencies:
[33mred[39m: 1.0.0
@@ -223,7 +223,7 @@ dist
.tarball:[36mhttp://hm.pink.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -238,7 +238,7 @@ dist
.tarball:[36mhttp://hm.black.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dependencies:
[33m0[39m: 1.0.0
@@ -280,7 +280,7 @@ dist
.tarball:[36mhttp://hm.cyan.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -297,7 +297,7 @@ dist
.tarball:[36mhttp://hm.blue.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -401,7 +401,7 @@ dist
.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dependencies:
[33mred[39m: 1.0.0
@@ -421,7 +421,7 @@ dist
.tarball:[36mhttp://hm.orange.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
@@ -469,7 +469,7 @@ dist
.tarball:[36mhttp://hm.green.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dependencies:
[33mred[39m: 1.0.0
@@ -496,7 +496,7 @@ dist
.tarball:[36mhttp://hm.pink.com/1.0.0.tgz[39m
.shasum:[33m123[39m
.integrity:[33m---[39m
-.unpackedSize:[33m1[39m B
+.unpackedSize:[33m1 B[39m
dist-tags:
[1m[32mlatest[39m[22m: 1.0.0
diff --git a/deps/npm/test/fixtures/mock-npm.js b/deps/npm/test/fixtures/mock-npm.js
index e3be10b4b9aa3f..3faf8d5cf4f6be 100644
--- a/deps/npm/test/fixtures/mock-npm.js
+++ b/deps/npm/test/fixtures/mock-npm.js
@@ -9,6 +9,10 @@ for (const level in npmlog.levels)
const { title, execPath } = process
const RealMockNpm = (t, otherMocks = {}) => {
+ t.afterEach(() => {
+ outputs.length = 0
+ logs.length = 0
+ })
t.teardown(() => {
npm.perfStop()
npmlog.record.length = 0
@@ -22,6 +26,9 @@ const RealMockNpm = (t, otherMocks = {}) => {
})
const logs = []
const outputs = []
+ const joinedOutput = () => {
+ return outputs.map(o => o.join(' ')).join('\n')
+ }
const npm = t.mock('../../lib/npm.js', otherMocks)
const command = async (command, args = []) => {
return new Promise((resolve, reject) => {
@@ -43,7 +50,7 @@ const RealMockNpm = (t, otherMocks = {}) => {
}
}
npm.output = (...msg) => outputs.push(msg)
- return { npm, logs, outputs, command }
+ return { npm, logs, outputs, command, joinedOutput }
}
const realConfig = require('../../lib/utils/config')
diff --git a/deps/npm/test/lib/find-dupes.js b/deps/npm/test/lib/find-dupes.js
index c7b33ceb6ed343..17940764b94a59 100644
--- a/deps/npm/test/lib/find-dupes.js
+++ b/deps/npm/test/lib/find-dupes.js
@@ -1,24 +1,26 @@
const t = require('tap')
-const FindDupes = require('../../lib/find-dupes.js')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('should run dedupe in dryRun mode', (t) => {
- t.plan(3)
- const findDupesTest = new FindDupes({
- config: {
- set: (k, v) => {
- t.match(k, 'dry-run')
- t.match(v, true)
- },
+t.test('should run dedupe in dryRun mode', async (t) => {
+ t.plan(5)
+ const { npm, command } = mockNpm(t, {
+ '@npmcli/arborist': function (args) {
+ t.ok(args, 'gets options object')
+ t.ok(args.path, 'gets path option')
+ t.ok(args.dryRun, 'is called in dryRun mode')
+ this.dedupe = () => {
+ t.ok(true, 'dedupe is called')
+ }
},
- commands: {
- dedupe: (args, cb) => {
- t.match(args, [])
- cb()
- },
+ '../../lib/utils/reify-finish.js': (npm, arb) => {
+ t.ok(arb, 'gets arborist tree')
},
})
- findDupesTest.exec({}, () => {
- t.end()
- })
+ await npm.load()
+ // explicitly set to false so we can be 100% sure it's always true when it
+ // hits arborist
+ npm.config.set('dry-run', false)
+ npm.config.set('prefix', 'foo')
+ await command('find-dupes')
})
diff --git a/deps/npm/test/lib/get.js b/deps/npm/test/lib/get.js
index 9b77fbba3e6f40..30e26b7453fe8c 100644
--- a/deps/npm/test/lib/get.js
+++ b/deps/npm/test/lib/get.js
@@ -1,16 +1,16 @@
const t = require('tap')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('should retrieve values from npm.commands.config', (t) => {
- const Get = t.mock('../../lib/get.js')
- const get = new Get({
- commands: {
- config: ([action, arg]) => {
- t.equal(action, 'get', 'should use config get action')
- t.equal(arg, 'foo', 'should use expected key')
- t.end()
- },
- },
- })
-
- get.exec(['foo'])
+t.test('should retrieve values from config', async t => {
+ const { joinedOutput, command, npm } = mockNpm(t)
+ const name = 'editor'
+ const value = 'vigor'
+ await npm.load()
+ npm.config.set(name, value)
+ await command('get', [name])
+ t.equal(
+ joinedOutput(),
+ value,
+ 'outputs config item'
+ )
})
diff --git a/deps/npm/test/lib/load-all.js b/deps/npm/test/lib/load-all.js
index e6e407805346d5..c38c244934ec39 100644
--- a/deps/npm/test/lib/load-all.js
+++ b/deps/npm/test/lib/load-all.js
@@ -1,15 +1,24 @@
const t = require('tap')
const glob = require('glob')
const { resolve } = require('path')
+const { real: mockNpm } = require('../fixtures/mock-npm')
const full = process.env.npm_lifecycle_event === 'check-coverage'
if (!full)
t.pass('nothing to do here, not checking for full coverage')
else {
- // some files do config.get() on load, so have to load npm first
- const npm = require('../../lib/npm.js')
- t.test('load npm first', t => npm.load(t.end))
+ const { npm } = mockNpm(t)
+
+ t.teardown(() => {
+ const exitHandler = require('../../lib/utils/exit-handler.js')
+ exitHandler.setNpm(npm)
+ exitHandler()
+ })
+
+ t.test('load npm first', async t => {
+ await npm.load()
+ })
t.test('load all the files', t => {
// just load all the files so we measure coverage for the missing tests
@@ -21,11 +30,4 @@ else {
t.pass('loaded all files')
t.end()
})
-
- t.test('call the exit handler so we dont freak out', t => {
- const exitHandler = require('../../lib/utils/exit-handler.js')
- exitHandler.setNpm(npm)
- exitHandler()
- t.end()
- })
}
diff --git a/deps/npm/test/lib/prefix.js b/deps/npm/test/lib/prefix.js
index 526631388e74ff..18a37f3ccd1e0e 100644
--- a/deps/npm/test/lib/prefix.js
+++ b/deps/npm/test/lib/prefix.js
@@ -1,19 +1,13 @@
const t = require('tap')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('prefix', (t) => {
- t.plan(3)
- const dir = '/prefix/dir'
-
- const Prefix = require('../../lib/prefix.js')
- const prefix = new Prefix({
- prefix: dir,
- output: (output) => {
- t.equal(output, dir, 'prints the correct directory')
- },
- })
-
- prefix.exec([], (err) => {
- t.error(err, 'npm prefix')
- t.ok('should have printed directory')
- })
+t.test('prefix', async (t) => {
+ const { joinedOutput, command, npm } = mockNpm(t)
+ await npm.load()
+ await command('prefix')
+ t.equal(
+ joinedOutput(),
+ npm.prefix,
+ 'outputs npm.prefix'
+ )
})
diff --git a/deps/npm/test/lib/prune.js b/deps/npm/test/lib/prune.js
index 87bb1370f3a194..3e47feb4613942 100644
--- a/deps/npm/test/lib/prune.js
+++ b/deps/npm/test/lib/prune.js
@@ -1,7 +1,9 @@
const t = require('tap')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('should prune using Arborist', (t) => {
- const Prune = t.mock('../../lib/prune.js', {
+t.test('should prune using Arborist', async (t) => {
+ t.plan(4)
+ const { command, npm } = mockNpm(t, {
'@npmcli/arborist': function (args) {
t.ok(args, 'gets options object')
t.ok(args.path, 'gets path option')
@@ -13,16 +15,6 @@ t.test('should prune using Arborist', (t) => {
t.ok(arb, 'gets arborist tree')
},
})
- const prune = new Prune({
- prefix: 'foo',
- flatOptions: {
- foo: 'bar',
- },
- })
- prune.exec(null, er => {
- if (er)
- throw er
- t.ok(true, 'callback is called')
- t.end()
- })
+ await npm.load()
+ await command('prune')
})
diff --git a/deps/npm/test/lib/restart.js b/deps/npm/test/lib/restart.js
index 9719476c418073..153c31447282cd 100644
--- a/deps/npm/test/lib/restart.js
+++ b/deps/npm/test/lib/restart.js
@@ -1,16 +1,36 @@
const t = require('tap')
-let runArgs
-const npm = {
- commands: {
- 'run-script': (args, cb) => {
- runArgs = args
- cb()
- },
- },
-}
-const Restart = require('../../lib/restart.js')
-const restart = new Restart(npm)
-restart.exec(['foo'], () => {
- t.match(runArgs, ['restart', 'foo'])
- t.end()
+const spawk = require('spawk')
+const { real: mockNpm } = require('../fixtures/mock-npm')
+
+spawk.preventUnmatched()
+t.teardown(() => {
+ spawk.unload()
+})
+
+// TODO this ... smells. npm "script-shell" config mentions defaults but those
+// are handled by run-script, not npm. So for now we have to tie tests to some
+// pretty specific internals of runScript
+const makeSpawnArgs = require('@npmcli/run-script/lib/make-spawn-args.js')
+
+t.test('should run stop script from package.json', async t => {
+ const prefix = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'x',
+ version: '1.2.3',
+ scripts: {
+ restart: 'node ./test-restart.js',
+ },
+ }),
+ })
+ const { command, npm } = mockNpm(t)
+ await npm.load()
+ npm.log.level = 'silent'
+ npm.localPrefix = prefix
+ const [scriptShell] = makeSpawnArgs({ path: prefix })
+ const script = spawk.spawn(scriptShell, (args) => {
+ t.ok(args.includes('node ./test-restart.js "foo"'), 'ran stop script with extra args')
+ return true
+ })
+ await command('restart', ['foo'])
+ t.ok(script.called, 'script ran')
})
diff --git a/deps/npm/test/lib/root.js b/deps/npm/test/lib/root.js
index 5460f3d4985c22..7b91654c6c98fe 100644
--- a/deps/npm/test/lib/root.js
+++ b/deps/npm/test/lib/root.js
@@ -1,19 +1,13 @@
const t = require('tap')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('root', (t) => {
- t.plan(3)
- const dir = '/root/dir'
-
- const Root = require('../../lib/root.js')
- const root = new Root({
- dir,
- output: (output) => {
- t.equal(output, dir, 'prints the correct directory')
- },
- })
-
- root.exec([], (err) => {
- t.error(err, 'npm root')
- t.ok('should have printed directory')
- })
+t.test('prefix', async (t) => {
+ const { joinedOutput, command, npm } = mockNpm(t)
+ await npm.load()
+ await command('root')
+ t.equal(
+ joinedOutput(),
+ npm.dir,
+ 'outputs npm.dir'
+ )
})
diff --git a/deps/npm/test/lib/set.js b/deps/npm/test/lib/set.js
index f51065a4b293db..14d094001b446a 100644
--- a/deps/npm/test/lib/set.js
+++ b/deps/npm/test/lib/set.js
@@ -1,5 +1,32 @@
const t = require('tap')
+// can't run this until npm set can save to npm.localPrefix
+t.skip('npm set', async t => {
+ const { real: mockNpm } = require('../fixtures/mock-npm')
+ const { joinedOutput, command, npm } = mockNpm(t)
+ await npm.load()
+
+ t.test('no args', async t => {
+ t.rejects(
+ command('set'),
+ /Usage:/,
+ 'prints usage'
+ )
+ })
+
+ t.test('test-config-item', async t => {
+ npm.localPrefix = t.testdir({})
+ t.not(npm.config.get('test-config-item', 'project'), 'test config value', 'config is not already new value')
+ // This will write to ~/.npmrc!
+ // Don't unskip until we can write to project level
+ await command('set', ['test-config-item=test config value'])
+ t.equal(joinedOutput(), '', 'outputs nothing')
+ t.equal(npm.config.get('test-config-item', 'project'), 'test config value', 'config is set to new value')
+ })
+})
+
+// Everything after this can go away once the above test is unskipped
+
let configArgs = null
const npm = {
commands: {
diff --git a/deps/npm/test/lib/start.js b/deps/npm/test/lib/start.js
index 4e77f9691b815b..5c38c71a9a6499 100644
--- a/deps/npm/test/lib/start.js
+++ b/deps/npm/test/lib/start.js
@@ -1,16 +1,36 @@
const t = require('tap')
-let runArgs
-const npm = {
- commands: {
- 'run-script': (args, cb) => {
- runArgs = args
- cb()
- },
- },
-}
-const Start = require('../../lib/start.js')
-const start = new Start(npm)
-start.exec(['foo'], () => {
- t.match(runArgs, ['start', 'foo'])
- t.end()
+const spawk = require('spawk')
+const { real: mockNpm } = require('../fixtures/mock-npm')
+
+spawk.preventUnmatched()
+t.teardown(() => {
+ spawk.unload()
+})
+
+// TODO this ... smells. npm "script-shell" config mentions defaults but those
+// are handled by run-script, not npm. So for now we have to tie tests to some
+// pretty specific internals of runScript
+const makeSpawnArgs = require('@npmcli/run-script/lib/make-spawn-args.js')
+
+t.test('should run stop script from package.json', async t => {
+ const prefix = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'x',
+ version: '1.2.3',
+ scripts: {
+ start: 'node ./test-start.js',
+ },
+ }),
+ })
+ const { command, npm } = mockNpm(t)
+ await npm.load()
+ npm.log.level = 'silent'
+ npm.localPrefix = prefix
+ const [scriptShell] = makeSpawnArgs({ path: prefix })
+ const script = spawk.spawn(scriptShell, (args) => {
+ t.ok(args.includes('node ./test-start.js "foo"'), 'ran start script with extra args')
+ return true
+ })
+ await command('start', ['foo'])
+ t.ok(script.called, 'script ran')
})
diff --git a/deps/npm/test/lib/stop.js b/deps/npm/test/lib/stop.js
index 92ca84bd8741ab..04cdb4e5e7516e 100644
--- a/deps/npm/test/lib/stop.js
+++ b/deps/npm/test/lib/stop.js
@@ -1,16 +1,36 @@
const t = require('tap')
-let runArgs
-const npm = {
- commands: {
- 'run-script': (args, cb) => {
- runArgs = args
- cb()
- },
- },
-}
-const Stop = require('../../lib/stop.js')
-const stop = new Stop(npm)
-stop.exec(['foo'], () => {
- t.match(runArgs, ['stop', 'foo'])
- t.end()
+const spawk = require('spawk')
+const { real: mockNpm } = require('../fixtures/mock-npm')
+
+spawk.preventUnmatched()
+t.teardown(() => {
+ spawk.unload()
+})
+
+// TODO this ... smells. npm "script-shell" config mentions defaults but those
+// are handled by run-script, not npm. So for now we have to tie tests to some
+// pretty specific internals of runScript
+const makeSpawnArgs = require('@npmcli/run-script/lib/make-spawn-args.js')
+
+t.test('should run stop script from package.json', async t => {
+ const prefix = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'x',
+ version: '1.2.3',
+ scripts: {
+ stop: 'node ./test-stop.js',
+ },
+ }),
+ })
+ const { command, npm } = mockNpm(t)
+ await npm.load()
+ npm.log.level = 'silent'
+ npm.localPrefix = prefix
+ const [scriptShell] = makeSpawnArgs({ path: prefix })
+ const script = spawk.spawn(scriptShell, (args) => {
+ t.ok(args.includes('node ./test-stop.js "foo"'), 'ran stop script with extra args')
+ return true
+ })
+ await command('stop', ['foo'])
+ t.ok(script.called, 'script ran')
})
diff --git a/deps/npm/test/lib/test.js b/deps/npm/test/lib/test.js
index c151b1e825343f..d597ba2743837e 100644
--- a/deps/npm/test/lib/test.js
+++ b/deps/npm/test/lib/test.js
@@ -1,38 +1,36 @@
const t = require('tap')
-let RUN_ARGS = null
-const npm = {
- commands: {
- 'run-script': (args, cb) => {
- RUN_ARGS = args
- cb()
- },
- },
-}
-const Test = require('../../lib/test.js')
-const test = new Test(npm)
+const spawk = require('spawk')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('run a test', t => {
- test.exec([], (er) => {
- t.strictSame(RUN_ARGS, ['test'], 'added "test" to the args')
- })
- test.exec(['hello', 'world'], (er) => {
- t.strictSame(RUN_ARGS, ['test', 'hello', 'world'], 'added positional args')
- })
+spawk.preventUnmatched()
+t.teardown(() => {
+ spawk.unload()
+})
- const lcErr = Object.assign(new Error('should not see this'), {
- code: 'ELIFECYCLE',
- })
- const otherErr = new Error('should see this')
+// TODO this ... smells. npm "script-shell" config mentions defaults but those
+// are handled by run-script, not npm. So for now we have to tie tests to some
+// pretty specific internals of runScript
+const makeSpawnArgs = require('@npmcli/run-script/lib/make-spawn-args.js')
- npm.commands['run-script'] = (args, cb) => cb(lcErr)
- test.exec([], (er) => {
- t.equal(er, 'Test failed. See above for more details.')
+t.test('should run stop script from package.json', async t => {
+ const prefix = t.testdir({
+ 'package.json': JSON.stringify({
+ name: 'x',
+ version: '1.2.3',
+ scripts: {
+ test: 'node ./test-test.js',
+ },
+ }),
})
-
- npm.commands['run-script'] = (args, cb) => cb(otherErr)
- test.exec([], (er) => {
- t.match(er, { message: 'should see this' })
+ const { command, npm } = mockNpm(t)
+ await npm.load()
+ npm.log.level = 'silent'
+ npm.localPrefix = prefix
+ const [scriptShell] = makeSpawnArgs({ path: prefix })
+ const script = spawk.spawn(scriptShell, (args) => {
+ t.ok(args.includes('node ./test-test.js "foo"'), 'ran test script with extra args')
+ return true
})
-
- t.end()
+ await command('test', ['foo'])
+ t.ok(script.called, 'script ran')
})
diff --git a/deps/npm/test/lib/utils/tar.js b/deps/npm/test/lib/utils/tar.js
index 2662d47ace4863..19d94916945dbd 100644
--- a/deps/npm/test/lib/utils/tar.js
+++ b/deps/npm/test/lib/utils/tar.js
@@ -57,6 +57,8 @@ t.test('should log tarball contents with unicode', async (t) => {
logTar({
files: [],
bundled: [],
+ size: 0,
+ unpackedSize: 0,
integrity: '',
}, { unicode: true })
t.end()
@@ -75,6 +77,8 @@ t.test('should default to npmlog', async (t) => {
logTar({
files: [],
bundled: [],
+ size: 0,
+ unpackedSize: 0,
integrity: '',
})
t.end()
diff --git a/deps/npm/test/lib/whoami.js b/deps/npm/test/lib/whoami.js
index 9190e3858b137a..c54ee2a5a2be78 100644
--- a/deps/npm/test/lib/whoami.js
+++ b/deps/npm/test/lib/whoami.js
@@ -1,41 +1,25 @@
const t = require('tap')
-const { fake: mockNpm } = require('../fixtures/mock-npm')
+const { real: mockNpm } = require('../fixtures/mock-npm')
-t.test('whoami', (t) => {
- t.plan(3)
- const Whoami = t.mock('../../lib/whoami.js', {
- '../../lib/utils/get-identity.js': () => Promise.resolve('foo'),
- })
- const npm = mockNpm({
- config: { json: false },
- output: (output) => {
- t.equal(output, 'foo', 'should output the username')
- },
- })
-
- const whoami = new Whoami(npm)
+const username = 'foo'
+const { joinedOutput, command, npm } = mockNpm(t, {
+ '../../lib/utils/get-identity.js': () => Promise.resolve(username),
+})
- whoami.exec([], (err) => {
- t.error(err, 'npm whoami')
- t.ok('should successfully print username')
- })
+t.before(async () => {
+ await npm.load()
})
-t.test('whoami json', (t) => {
- t.plan(3)
- const Whoami = t.mock('../../lib/whoami.js', {
- '../../lib/utils/get-identity.js': () => Promise.resolve('foo'),
- })
- const npm = mockNpm({
- config: { json: true },
- output: (output) => {
- t.equal(output, '"foo"', 'should output the username')
- },
- })
- const whoami = new Whoami(npm)
+t.test('npm whoami', async (t) => {
+ await command('whoami')
+ t.equal(joinedOutput(), username, 'should print username')
+})
- whoami.exec([], (err) => {
- t.error(err, 'npm whoami')
- t.ok('should successfully print username as json')
+t.test('npm whoami --json', async (t) => {
+ t.teardown(() => {
+ npm.config.set('json', false)
})
+ npm.config.set('json', true)
+ await command('whoami')
+ t.equal(JSON.parse(joinedOutput()), username, 'should print username')
})