diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 2b3e48e7651..3c3d13b2369 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -772,3 +772,5 @@ Seth Thomas Andreas Felipe Santos Luigi Pinca +Marco Sirabella +wangsai diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index ce79e9368a6..02d66dfc323 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,44 @@ +## v7.12.0 (2021-05-06) + +### FEATURES + +* [`701627c51`](https://github.com/npm/cli/commit/701627c5169934e59da2959d76a49c77278cc9dc) + [#3098](https://github.com/npm/cli/issues/3098) + feat(cache): Allow `add` to accept multiple specs + ([@mjsir911](https://github.com/mjsir911)) +* [`59171f030`](https://github.com/npm/cli/commit/59171f0304f048a009f1697eec6f74f778bc52ff) + [#3187](https://github.com/npm/cli/issues/3187) + feat(config): add workspaces boolean to user-agent + ([@nlf](https://github.com/nlf)) + +### BUG FIXES + +* [`2c9b8713c`](https://github.com/npm/cli/commit/2c9b8713c4c88fbd0c3c48eb0de84dbd7269398f) + [#3182](https://github.com/npm/cli/issues/3182) + fix(docs): fix broken links + ([@wangsai](https://github.com/wangsai)) +* [`88cbc8c44`](https://github.com/npm/cli/commit/88cbc8c447cbaef20b5a8f19246211ce4918f4d8) + [#3198](https://github.com/npm/cli/issues/3198) + fix(tests): reflect new libnpmexec logic + +### DEPENDENCIES + +* [`d01ce5e13`](https://github.com/npm/cli/commit/d01ce5e132cb4661698012fd5017753c2bdb660b) + `libnpmexec@1.1.0`: + * feat: add walk up dir lookup to satisfy local bins +* [`81c1dfaaa`](https://github.com/npm/cli/commit/81c1dfaaaf918229316a975aa8075769ffafdb6d) + `@npmcli/arborist@2.4.2`: + * fix(add): save packages in the right place + * fix(reify): do not clean up nodes with no parent + * fix(audit): support alias specs & root package names +* [`87c2303ea`](https://github.com/npm/cli/commit/87c2303eaa6edfa5309da0a30f5ad291b6d57640) + `@npmcli/git@2.0.9`: + * fix(clone): Do not allow git replacement objects by default +* [`99ff40dff`](https://github.com/npm/cli/commit/99ff40dff5e5e55a5d5f045ba90e76c08174ca38) + `npm-packlist@2.2.0`: + * feat(npmignore): Do not force include history, changelogs, notice + * fix(package.json): add missing bin/index.js to files + ## v7.11.2 (2021-04-29) ### BUG FIXES @@ -76,8 +117,8 @@ [#3126](https://github.com/npm/cli/issues/3126) fix(logout): use isBasicAuth attribute ([@wraithgar](https://github.com/wraithgar)) -### DOCUMENTATION +### DOCUMENTATION * [`c93f1c39e`](https://github.com/npm/cli/commit/c93f1c39e326feff0857712a10ef6183fbafe1ab) [#3101](https://github.com/npm/cli/issues/3101) @@ -89,7 +130,6 @@ fix(usage): fix refs to ws shorthand ([@ruyadorno](https://github.com/ruyadorno)) - ### DEPENDENCIES * [`83166ebcc`](https://github.com/npm/cli/commit/83166ebcc4ba5e3bf215f08151437d96637f4f33) diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index bcc2989b7d3..0bbb2756a40 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -7,10 +7,10 @@ description: Manipulates packages cache ### Synopsis ```bash -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add ... +npm cache add ... +npm cache add ... +npm cache add @... npm cache clean aliases: npm cache clear, npm cache rm @@ -25,7 +25,7 @@ Note: This command is unaware of workspaces. Used to add, list, or clean the npm cache folder. * add: - Add the specified package to the local cache. This command is primarily + Add the specified packages to the local cache. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly. diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 925ba8de2e5..937553631ac 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -12,7 +12,7 @@ npm ci ### Description -This command is similar to [`npm install`](/cli-commands/install), except +This command is similar to [`npm install`](/commands/npm-install), except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies. diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index c6d26126d30..f9bfd9e0153 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -74,7 +74,7 @@ Using `npm find-dupes` will run the command in `--dry-run` mode. ### See Also -* [npm find-dupes](/cli-commands/find-dupes) -* [npm ls](/cli-commands/ls) -* [npm update](/cli-commands/update) -* [npm install](/cli-commands/install) +* [npm find-dupes](/commands/npm-find-dupes) +* [npm ls](/commands/npm-ls) +* [npm update](/commands/npm-update) +* [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 06037976610..73d88b3717b 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -44,5 +44,5 @@ format an empty string. * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) -* [npm owner](/cli-commands/owner) -* [npm owner](/cli-commands/adduser) +* [npm owner](/commands/npm-owner) +* [npm owner](/commands/npm-adduser) diff --git a/deps/npm/docs/content/commands/npm-explore.md b/deps/npm/docs/content/commands/npm-explore.md index 7e2004b84c0..8bad293052e 100644 --- a/deps/npm/docs/content/commands/npm-explore.md +++ b/deps/npm/docs/content/commands/npm-explore.md @@ -44,5 +44,4 @@ The shell to run for the `npm explore` command. * [npm folders](/configuring-npm/folders) * [npm edit](/commands/npm-edit) * [npm rebuild](/commands/npm-rebuild) -* [npm build](/commands/npm-build) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index 6f55d47bfd7..6557a071c82 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -17,8 +17,8 @@ duplications, without actually changing the package tree. ### See Also -* [npm dedupe](/cli-commands/dedupe) -* [npm ls](/cli-commands/ls) -* [npm update](/cli-commands/update) -* [npm install](/cli-commands/install) +* [npm dedupe](/commands/npm-dedupe) +* [npm ls](/commands/npm-ls) +* [npm update](/commands/npm-update) +* [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index 5ab9275ee4e..f81a8a24639 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -538,7 +538,6 @@ the specific folder structures that npm creates. * [npm link](/commands/npm-link) * [npm rebuild](/commands/npm-rebuild) * [npm scripts](/using-npm/scripts) -* [npm build](/commands/npm-build) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index e9d6e9045c6..2ce52d3f8cd 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -34,7 +34,7 @@ This removes a package version from the registry, deleting its entry and removing the tarball. The npm registry will return an error if you are not [logged -in](/commands/npm-login). +in](/commands/npm-adduser). If you do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely. @@ -52,4 +52,4 @@ passed. * [npm registry](/using-npm/registry) * [npm adduser](/commands/npm-adduser) * [npm owner](/commands/npm-owner) -* [npm login](/commands/npm-login) +* [npm login](/commands/npm-adduser) diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index 8f7e886ed19..982ba299551 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -73,7 +73,7 @@ npm view express contributors.name contributors.email "Person" fields are shown as a string if they would be shown as an object. So, for example, this will show the list of `npm` contributors in -the shortened string format. (See [`package.json`](/configuring-npm/package.json) for more on this.) +the shortened string format. (See [`package.json`](/configuring-npm/package-json) for more on this.) ```bash npm view npm contributors diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index d01146d3704..2d86aa62c00 100644 --- a/deps/npm/docs/content/commands/npm.md +++ b/deps/npm/docs/content/commands/npm.md @@ -107,7 +107,7 @@ following help topics: Create an account or log in. When you do this, npm will store credentials in the user config file config file. * publish: - Use the [`npm publish`](/commands/npm-publish`) command to upload your + Use the [`npm publish`](/commands/npm-publish) command to upload your code to the registry. #### Configuration diff --git a/deps/npm/docs/content/configuring-npm/folders.md b/deps/npm/docs/content/configuring-npm/folders.md index 3ec716f2c67..75e31cd7331 100644 --- a/deps/npm/docs/content/configuring-npm/folders.md +++ b/deps/npm/docs/content/configuring-npm/folders.md @@ -205,7 +205,7 @@ not be included in the package tarball. This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See [`package.json`](/configuring-npm/package.json) for more information. +cannot be found elsewhere. See [`package.json`](/configuring-npm/package-json) for more information. ### See also diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index f5519f62bb3..3ed03990214 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -566,7 +566,7 @@ tarball or git URL. **Please do not put test harnesses or transpilers or other "development" time tools in your `dependencies` object.** See `devDependencies`, below. -See [semver](/using-npm/semver#versions) for more details about specifying version ranges. +See [semver](https://github.com/npm/node-semver#versions) for more details about specifying version ranges. * `version` Must match `version` exactly * `>version` Must be greater than `version` diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 76ac4192f13..d8fb70fb74b 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1253,7 +1253,8 @@ Show short usage output about the command specified. #### `user-agent` -* Default: "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" +* Default: "npm/{npm-version} node/{node-version} {platform} {arch} + workspaces/{workspaces} {ci}" * Type: String Sets the User-Agent request header. The following fields are replaced with @@ -1263,6 +1264,8 @@ their actual counterparts: * `{node-version}` - The Node.js version in use * `{platform}` - The value of `process.platform` * `{arch}` - The value of `process.arch` +* `{workspaces}` - Set to `true` if the `workspaces` or `workspace` options + are set. * `{ci}` - The value of the `ci-name` config, if set, prefixed with `ci/`, or an empty string if `ci-name` is empty. diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index 9312a21546d..82cde7d7909 100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -118,11 +118,6 @@ The advantage of doing these things at `prepublish` time is that they can be don * `prepare` -#### [`npm env`](/commands/npm-env) - -* `env` (You can override the default behavior of `npm env` by defining - a custom `env` entry in your `scripts` object) - #### [`npm install`](/commands/npm-install) These also run when you run `npm install -g ` @@ -179,7 +174,7 @@ If there is a `restart` script defined, these events are run, otherwise * `restart` * `postrestart` -#### [`npm run `](/commands/npm-run) +#### [`npm run `](/commands/npm-run-script) * `pre` * `` diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html index 22ca6f1999b..cb886d3c7be 100644 --- a/deps/npm/docs/output/commands/npm-cache.html +++ b/deps/npm/docs/output/commands/npm-cache.html @@ -145,10 +145,10 @@

Table of contents

Synopsis

-
npm cache add <tarball file>
-npm cache add <folder>
-npm cache add <tarball url>
-npm cache add <name>@<version>
+
npm cache add <tarball file>...
+npm cache add <folder>...
+npm cache add <tarball url>...
+npm cache add <name>@<version>...
 
 npm cache clean
 aliases: npm cache clear, npm cache rm
@@ -161,7 +161,7 @@ 

Description

  • add: -Add the specified package to the local cache. This command is primarily +Add the specified packages to the local cache. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly.

  • diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index 8361e995b3a..be6f8acb4c8 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -148,7 +148,7 @@

    Table of contents

    npm ci
     

    Description

    -

    This command is similar to npm install, except +

    This command is similar to npm install, except it’s meant to be used in automated environments such as test platforms, continuous integration, and deployment – or any situation where you want to make sure you’re doing a clean install of your dependencies.

    diff --git a/deps/npm/docs/output/commands/npm-dedupe.html b/deps/npm/docs/output/commands/npm-dedupe.html index ccd9a03f4d8..795659a6103 100644 --- a/deps/npm/docs/output/commands/npm-dedupe.html +++ b/deps/npm/docs/output/commands/npm-dedupe.html @@ -193,10 +193,10 @@

    Description

    Using npm find-dupes will run the command in --dry-run mode.

    See Also

diff --git a/deps/npm/docs/output/commands/npm-deprecate.html b/deps/npm/docs/output/commands/npm-deprecate.html index 88299a80bcf..7f4409cd3ac 100644 --- a/deps/npm/docs/output/commands/npm-deprecate.html +++ b/deps/npm/docs/output/commands/npm-deprecate.html @@ -169,8 +169,8 @@

See Also

diff --git a/deps/npm/docs/output/commands/npm-explore.html b/deps/npm/docs/output/commands/npm-explore.html index cd52ff96a68..8d1e2843d73 100644 --- a/deps/npm/docs/output/commands/npm-explore.html +++ b/deps/npm/docs/output/commands/npm-explore.html @@ -171,7 +171,6 @@

See Also

  • npm folders
  • npm edit
  • npm rebuild
  • -
  • npm build
  • npm install
  • diff --git a/deps/npm/docs/output/commands/npm-find-dupes.html b/deps/npm/docs/output/commands/npm-find-dupes.html index 32d8993b99c..7f7f3c101b2 100644 --- a/deps/npm/docs/output/commands/npm-find-dupes.html +++ b/deps/npm/docs/output/commands/npm-find-dupes.html @@ -152,10 +152,10 @@

    Description

    duplications, without actually changing the package tree.

    See Also

    diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 2794b9a983d..8fff20fe836 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -614,7 +614,6 @@

    See Also

  • npm link
  • npm rebuild
  • npm scripts
  • -
  • npm build
  • npm config
  • npmrc
  • npm registry
  • diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index ede5cb04290..d11c865c9d9 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -159,7 +159,7 @@

    Description

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

    -
    npm@7.11.2 /path/to/npm
    +
    npm@7.12.0 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     
    diff --git a/deps/npm/docs/output/commands/npm-unpublish.html b/deps/npm/docs/output/commands/npm-unpublish.html index 75751d3408c..737d5336c83 100644 --- a/deps/npm/docs/output/commands/npm-unpublish.html +++ b/deps/npm/docs/output/commands/npm-unpublish.html @@ -159,7 +159,7 @@

    Warning

    Description

    This removes a package version from the registry, deleting its entry and removing the tarball.

    -

    The npm registry will return an error if you are not logged +

    The npm registry will return an error if you are not logged in.

    If you do not specify a version or if you remove all of a package’s versions then the registry will remove the root package entry entirely.

    @@ -175,7 +175,7 @@

    See Also

  • npm registry
  • npm adduser
  • npm owner
  • -
  • npm login
  • +
  • npm login
  • diff --git a/deps/npm/docs/output/commands/npm-view.html b/deps/npm/docs/output/commands/npm-view.html index 7489b17b1cd..77786b74fd8 100644 --- a/deps/npm/docs/output/commands/npm-view.html +++ b/deps/npm/docs/output/commands/npm-view.html @@ -186,7 +186,7 @@

    Description

    “Person” fields are shown as a string if they would be shown as an object. So, for example, this will show the list of npm contributors in -the shortened string format. (See package.json for more on this.)

    +the shortened string format. (See package.json for more on this.)

    npm view npm contributors
     

    If a version range is provided, then data will be printed for every diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 311c581f681..405d56f623b 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.11.2

    +

    7.12.0

    Description

    npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -222,7 +222,7 @@

    Developer Usage

    Create an account or log in. When you do this, npm will store credentials in the user config file config file.
  • publish: -Use the npm publish command to upload your +Use the npm publish command to upload your code to the registry.
  • Configuration

    diff --git a/deps/npm/docs/output/configuring-npm/folders.html b/deps/npm/docs/output/configuring-npm/folders.html index 20027ea3a9f..6cdae3cd1ec 100644 --- a/deps/npm/docs/output/configuring-npm/folders.html +++ b/deps/npm/docs/output/configuring-npm/folders.html @@ -292,7 +292,7 @@

    Publishing

    not be included in the package tarball.

    This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See package.json for more information.

    +cannot be found elsewhere. See package.json for more information.

    See also

    • package.json
    • diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 84956dede7d..f9c3ee6e4f5 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -567,7 +567,7 @@

      dependencies

      tarball or git URL.

      Please do not put test harnesses or transpilers or other “development” time tools in your dependencies object. See devDependencies, below.

      -

      See semver for more details about specifying version ranges.

      +

      See semver for more details about specifying version ranges.

      • version Must match version exactly
      • >version Must be greater than version
      • diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 4435ce53bba..881080eb121 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -1193,7 +1193,8 @@

        usage

        Show short usage output about the command specified.

        user-agent

          -
        • Default: “npm/{npm-version} node/{node-version} {platform} {arch} {ci}”
        • +
        • Default: “npm/{npm-version} node/{node-version} {platform} {arch} +workspaces/{workspaces} {ci}”
        • Type: String

        Sets the User-Agent request header. The following fields are replaced with @@ -1203,6 +1204,8 @@

        user-agent

      • {node-version} - The Node.js version in use
      • {platform} - The value of process.platform
      • {arch} - The value of process.arch
      • +
      • {workspaces} - Set to true if the workspaces or workspace options +are set.
      • {ci} - The value of the ci-name config, if set, prefixed with ci/, or an empty string if ci-name is empty.
      diff --git a/deps/npm/docs/output/using-npm/scripts.html b/deps/npm/docs/output/using-npm/scripts.html index e231cfec2ab..dde9b1b75d7 100644 --- a/deps/npm/docs/output/using-npm/scripts.html +++ b/deps/npm/docs/output/using-npm/scripts.html @@ -141,7 +141,7 @@

      scripts

      Table of contents

      - +

      Description

      @@ -260,11 +260,6 @@

      npm diff<
      • prepare
      -

      npm env

      -
        -
      • env (You can override the default behavior of npm env by defining -a custom env entry in your scripts object)
      • -

      npm install

      These also run when you run npm install -g <pkg-name>

      -

      npm run <user defined>

      +

      npm run <user defined>

      • pre<user-defined>
      • <user-defined>
      • diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 43902f43bbe..5d544b2dbd1 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -86,32 +86,30 @@ with --force.`) return rimraf(cachePath) } - // npm cache add - // npm cache add - // npm cache add - // npm cache add + // npm cache add ... + // npm cache add ... + // npm cache add ... + // npm cache add ... async add (args) { const usage = 'Usage:\n' + - ' npm cache add \n' + - ' npm cache add @\n' + - ' npm cache add \n' + - ' npm cache add \n' + ' npm cache add ...\n' + + ' npm cache add @...\n' + + ' npm cache add ...\n' + + ' npm cache add ...\n' log.silly('cache add', 'args', args) - const spec = args[0] && args[0] + - (args[1] === undefined || args[1] === null ? '' : `@${args[1]}`) - - if (!spec) + if (args.length === 0) throw Object.assign(new Error(usage), { code: 'EUSAGE' }) - log.silly('cache add', 'spec', spec) - - // we ask pacote for the thing, and then just throw the data - // away so that it tee-pipes it into the cache like it does - // for a normal request. - await pacote.tarball.stream(spec, stream => { - stream.resume() - return stream.promise() - }, this.npm.flatOptions) + return Promise.all(args.map(spec => { + log.silly('cache add', 'spec', spec) + // we ask pacote for the thing, and then just throw the data + // away so that it tee-pipes it into the cache like it does + // for a normal request. + return pacote.tarball.stream(spec, stream => { + stream.resume() + return stream.promise() + }, this.npm.flatOptions) + })) } async verify () { diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js index 3a50175d5db..aa90de8e760 100644 --- a/deps/npm/lib/utils/config/definitions.js +++ b/deps/npm/lib/utils/config/definitions.js @@ -1943,6 +1943,7 @@ define('user-agent', { 'node/{node-version} ' + '{platform} ' + '{arch} ' + + 'workspaces/{workspaces} ' + '{ci}', type: String, description: ` @@ -1953,17 +1954,23 @@ define('user-agent', { * \`{node-version}\` - The Node.js version in use * \`{platform}\` - The value of \`process.platform\` * \`{arch}\` - The value of \`process.arch\` + * \`{workspaces}\` - Set to \`true\` if the \`workspaces\` or \`workspace\` + options are set. * \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with \`ci/\`, or an empty string if \`ci-name\` is empty. `, flatten (key, obj, flatOptions) { const value = obj[key] const ciName = obj['ci-name'] + let inWorkspaces = false + if (obj.workspaces || obj.workspace && obj.workspace.length) + inWorkspaces = true flatOptions.userAgent = value.replace(/\{node-version\}/gi, obj['node-version']) .replace(/\{npm-version\}/gi, obj['npm-version']) .replace(/\{platform\}/gi, process.platform) .replace(/\{arch\}/gi, process.arch) + .replace(/\{workspaces\}/gi, inWorkspaces) .replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '') .trim() // user-agent is a unique kind of config item that gets set from a template diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index f1deed4c428..8165ccd46d5 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" "April 2021" "" "" +.TH "NPM\-ACCESS" "1" "May 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 aa7d0e5e527..26f42858694 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" "April 2021" "" "" +.TH "NPM\-ADDUSER" "1" "May 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 ebbb019ec8a..cd63c284730 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" "April 2021" "" "" +.TH "NPM\-AUDIT" "1" "May 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 d7ddf05cb75..61e2ab1ea91 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" "April 2021" "" "" +.TH "NPM\-BIN" "1" "May 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 9d453b825b9..c4297521de2 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" "April 2021" "" "" +.TH "NPM\-BUGS" "1" "May 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 08913baa632..25b9d0d7911 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,14 +1,14 @@ -.TH "NPM\-CACHE" "1" "April 2021" "" "" +.TH "NPM\-CACHE" "1" "May 2021" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SS Synopsis .P .RS 2 .nf -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add \.\.\. +npm cache add \.\.\. +npm cache add \.\.\. +npm cache add @\.\.\. npm cache clean aliases: npm cache clear, npm cache rm @@ -24,7 +24,7 @@ Used to add, list, or clean the npm cache folder\. .RS 0 .IP \(bu 2 add: -Add the specified package to the local cache\. This command is primarily +Add the specified packages to the local cache\. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly\. .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 67f7245d01b..481d3d23c95 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" "April 2021" "" "" +.TH "NPM\-CI" "1" "May 2021" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SS Synopsis @@ -10,7 +10,7 @@ npm ci .RE .SS Description .P -This command is similar to \fBnpm install\fP \fI/cli\-commands/install\fR, except +This command is similar to npm help \fBinstall\fP, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment \-\- or any situation where you want to make sure you're doing a clean install of your dependencies\. diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index cb3e2d99435..dffedb6b639 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" "April 2021" "" "" +.TH "NPM\-COMPLETION" "1" "May 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 c19d0411cb7..2ab14312a86 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" "April 2021" "" "" +.TH "NPM\-CONFIG" "1" "May 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 fd6cce4bc1b..bd65bd3853c 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" "April 2021" "" "" +.TH "NPM\-DEDUPE" "1" "May 2021" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication in the package tree .SS Synopsis @@ -78,12 +78,12 @@ Using \fBnpm find\-dupes\fP will run the command in \fB\-\-dry\-run\fP mode\. .SS See Also .RS 0 .IP \(bu 2 -npm find\-dupes \fI/cli\-commands/find\-dupes\fR +npm help find\-dupes .IP \(bu 2 -npm ls \fI/cli\-commands/ls\fR +npm help ls .IP \(bu 2 -npm update \fI/cli\-commands/update\fR +npm help update .IP \(bu 2 -npm install \fI/cli\-commands/install\fR +npm help install .RE diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 33922d2e834..c57decbba87 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" "April 2021" "" "" +.TH "NPM\-DEPRECATE" "1" "May 2021" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SS Synopsis @@ -48,8 +48,8 @@ npm help publish .IP \(bu 2 npm help registry .IP \(bu 2 -npm owner \fI/cli\-commands/owner\fR +npm help owner .IP \(bu 2 -npm owner \fI/cli\-commands/adduser\fR +npm help owner .RE diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index 97092215bd8..079c73e46a4 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" "April 2021" "" "" +.TH "NPM\-DIFF" "1" "May 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 6be3351be3c..95ed3584723 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" "April 2021" "" "" +.TH "NPM\-DIST\-TAG" "1" "May 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 5da2b661a54..1aec0eb795f 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" "April 2021" "" "" +.TH "NPM\-DOCS" "1" "May 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 c3b11a90259..df05a562f95 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" "April 2021" "" "" +.TH "NPM\-DOCTOR" "1" "May 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 445439d1554..425c769cfed 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" "April 2021" "" "" +.TH "NPM\-EDIT" "1" "May 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 1ac663ff18e..5bb3736ae62 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" "April 2021" "" "" +.TH "NPM\-EXEC" "1" "May 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 efc53147882..87c84f1aaf2 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" "April 2021" "" "" +.TH "NPM\-EXPLAIN" "1" "May 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 7863f3a0711..205f0518e90 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" "April 2021" "" "" +.TH "NPM\-EXPLORE" "1" "May 2021" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SS Synopsis @@ -49,8 +49,6 @@ npm help edit .IP \(bu 2 npm help rebuild .IP \(bu 2 -npm help build -.IP \(bu 2 npm help install .RE diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index 03ff67e95b5..e88c89408b3 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" "April 2021" "" "" +.TH "NPM\-FIND\-DUPES" "1" "May 2021" "" "" .SH "NAME" \fBnpm-find-dupes\fR \- Find duplication in the package tree .SS Synopsis @@ -15,12 +15,12 @@ duplications, without actually changing the package tree\. .SS See Also .RS 0 .IP \(bu 2 -npm dedupe \fI/cli\-commands/dedupe\fR +npm help dedupe .IP \(bu 2 -npm ls \fI/cli\-commands/ls\fR +npm help ls .IP \(bu 2 -npm update \fI/cli\-commands/update\fR +npm help update .IP \(bu 2 -npm install \fI/cli\-commands/install\fR +npm help install .RE diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index dc67600e6ac..81a277bb008 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" "April 2021" "" "" +.TH "NPM\-FUND" "1" "May 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 a7bc089b196..2f85992550d 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" "April 2021" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "May 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 8e328293000..f97f9117b68 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" "April 2021" "" "" +.TH "NPM\-HELP" "1" "May 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 06cb0959fcc..bb6b553a60c 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" "April 2021" "" "" +.TH "NPM\-HOOK" "1" "May 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 b4b09e598d2..9ba1cf0a645 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" "April 2021" "" "" +.TH "NPM\-INIT" "1" "May 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 22eb734e21e..448a8514812 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" "April 2021" "" "" +.TH "NPM\-INSTALL\-CI\-TEST" "1" "May 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 521d0bc5ebf..03efe308f2e 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" "April 2021" "" "" +.TH "NPM\-INSTALL\-TEST" "1" "May 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 5ac2700d829..c4567fb2920 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" "April 2021" "" "" +.TH "NPM\-INSTALL" "1" "May 2021" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis @@ -576,8 +576,6 @@ npm help rebuild .IP \(bu 2 npm help scripts .IP \(bu 2 -npm help build -.IP \(bu 2 npm help config .IP \(bu 2 npm help npmrc diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 94afe9c3fdf..404b04a5ce4 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" "April 2021" "" "" +.TH "NPM\-LINK" "1" "May 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 0f94b466398..84a6851b284 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" "April 2021" "" "" +.TH "NPM\-LOGOUT" "1" "May 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 2d4720ad8a4..e2d6c980c27 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" "April 2021" "" "" +.TH "NPM\-LS" "1" "May 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\.11\.2 /path/to/npm +npm@7\.12\.0 /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 7d85be8760a..18cb791b071 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" "April 2021" "" "" +.TH "NPM\-ORG" "1" "May 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 d90143428f2..a7309f2dfb9 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" "April 2021" "" "" +.TH "NPM\-OUTDATED" "1" "May 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 3731b383d76..7140aef06b6 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" "April 2021" "" "" +.TH "NPM\-OWNER" "1" "May 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 adedbef0c1f..ab34dc891d1 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" "April 2021" "" "" +.TH "NPM\-PACK" "1" "May 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 9eb5ec12842..385e4b8a810 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" "April 2021" "" "" +.TH "NPM\-PING" "1" "May 2021" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index c4b8a36e954..82de74199e9 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" "April 2021" "" "" +.TH "NPM\-PREFIX" "1" "May 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 7b2ff13efae..d2d412fe8bf 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" "April 2021" "" "" +.TH "NPM\-PROFILE" "1" "May 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 df8b82eb7b5..18d5e14dd1a 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" "April 2021" "" "" +.TH "NPM\-PRUNE" "1" "May 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 ac7a0323a72..c405f64f27e 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" "April 2021" "" "" +.TH "NPM\-PUBLISH" "1" "May 2021" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 995c8ab5ea1..3a78852b543 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" "April 2021" "" "" +.TH "NPM\-REBUILD" "1" "May 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 30b05534836..bdb5452181e 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" "April 2021" "" "" +.TH "NPM\-REPO" "1" "May 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 bd212fb466a..4ecb71f177e 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" "April 2021" "" "" +.TH "NPM\-RESTART" "1" "May 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 ddff01d429e..e552a650986 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" "April 2021" "" "" +.TH "NPM\-ROOT" "1" "May 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 53b88e6fab9..22222c6541e 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" "April 2021" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "May 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 068499dc99c..5e889b15f62 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" "April 2021" "" "" +.TH "NPM\-SEARCH" "1" "May 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 f348099fb48..e9a380ee460 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" "April 2021" "" "" +.TH "NPM\-SET\-SCRIPT" "1" "May 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 d349510e5a9..a57ffb18187 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" "April 2021" "" "" +.TH "NPM\-SHRINKWRAP" "1" "May 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 e95168e243f..49f91c6466e 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" "April 2021" "" "" +.TH "NPM\-STAR" "1" "May 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 fa16060953c..397cfea91fe 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" "April 2021" "" "" +.TH "NPM\-STARS" "1" "May 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 42d8b6cc96f..84bdff0140d 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" "April 2021" "" "" +.TH "NPM\-START" "1" "May 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 55be734ed48..143aa56462d 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" "April 2021" "" "" +.TH "NPM\-STOP" "1" "May 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 94aa9d89cca..5816ea1d21b 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" "April 2021" "" "" +.TH "NPM\-TEAM" "1" "May 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 cedbe681982..4dd4bc2335f 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" "April 2021" "" "" +.TH "NPM\-TEST" "1" "May 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 5adf0cda6d8..2b45db5fc4e 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" "April 2021" "" "" +.TH "NPM\-TOKEN" "1" "May 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 0de9f431be3..0ee2fded986 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" "April 2021" "" "" +.TH "NPM\-UNINSTALL" "1" "May 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 9645ab106d0..e0e2a6c81b2 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" "April 2021" "" "" +.TH "NPM\-UNPUBLISH" "1" "May 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 86c152eb6d2..ec4cf6d2d1f 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" "April 2021" "" "" +.TH "NPM\-UNSTAR" "1" "May 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 adaebe92db3..2ac1f9e8478 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" "April 2021" "" "" +.TH "NPM\-UPDATE" "1" "May 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 d926c9e5282..02de076a10c 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" "April 2021" "" "" +.TH "NPM\-VERSION" "1" "May 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 498821fbb6b..b3dac21b757 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" "April 2021" "" "" +.TH "NPM\-VIEW" "1" "May 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 c38b46dff07..ed54f2f00bc 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" "April 2021" "" "" +.TH "NPM\-WHOAMI" "1" "May 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 8dbeca5362b..19f5b3c30b5 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "April 2021" "" "" +.TH "NPM" "1" "May 2021" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis @@ -10,7 +10,7 @@ npm [args] .RE .SS Version .P -7\.11\.2 +7\.12\.0 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index 87c018f4121..76305688fb0 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "April 2021" "" "" +.TH "NPX" "1" "May 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 cacb710a03b..ccf0c4f6e8f 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "April 2021" "" "" +.TH "FOLDERS" "5" "May 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 445353eb856..5fc6f442a92 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "April 2021" "" "" +.TH "INSTALL" "5" "May 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 27076ba3361..2fdbdd139a9 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" "April 2021" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "May 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 f880a269513..1ecd71ff214 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "April 2021" "" "" +.TH "NPMRC" "5" "May 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 a882e445ca0..8b5b12e0382 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" "April 2021" "" "" +.TH "PACKAGE\.JSON" "5" "May 2021" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description @@ -624,7 +624,7 @@ tarball or git URL\. \fBPlease do not put test harnesses or transpilers or other "development" time tools in your \fBdependencies\fP object\.\fR See \fBdevDependencies\fP, below\. .P -See npm help semver for more details about specifying version ranges\. +See semver \fIhttps://github\.com/npm/node\-semver#versions\fR for more details about specifying version ranges\. .RS 0 .IP \(bu 2 \fBversion\fP Must match \fBversion\fP exactly diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 765dd849994..20bedd30009 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" "April 2021" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "May 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 522e974fc07..b8884ded13e 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "April 2021" "" "" +.TH "CONFIG" "7" "May 2021" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -1666,7 +1666,8 @@ Show short usage output about the command specified\. .SS \fBuser\-agent\fP .RS 0 .IP \(bu 2 -Default: "npm/{npm\-version} node/{node\-version} {platform} {arch} {ci}" +Default: "npm/{npm\-version} node/{node\-version} {platform} {arch} +workspaces/{workspaces} {ci}" .IP \(bu 2 Type: String @@ -1684,6 +1685,9 @@ their actual counterparts: .IP \(bu 2 \fB{arch}\fP \- The value of \fBprocess\.arch\fP .IP \(bu 2 +\fB{workspaces}\fP \- Set to \fBtrue\fP if the \fBworkspaces\fP or \fBworkspace\fP options +are set\. +.IP \(bu 2 \fB{ci}\fP \- The value of the \fBci\-name\fP config, if set, prefixed with \fBci/\fP, or an empty string if \fBci\-name\fP is empty\. diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index 00dc1b14e24..0935fea65f5 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "April 2021" "" "" +.TH "DEVELOPERS" "7" "May 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 7f29cf2c239..13c9b9dbadf 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "April 2021" "" "" +.TH "ORGS" "7" "May 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 2ff87e4a4c4..941a1450073 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "April 2021" "" "" +.TH "REGISTRY" "7" "May 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 e3508f6696d..ead032bfdf4 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "April 2021" "" "" +.TH "REMOVAL" "7" "May 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 2a0fa9e1c8e..716946d732a 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "April 2021" "" "" +.TH "SCOPE" "7" "May 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 2dc2486de7d..63ebce805b4 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "April 2021" "" "" +.TH "SCRIPTS" "7" "May 2021" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description @@ -160,13 +160,6 @@ These all run after the actual installation of modules into .IP \(bu 2 \fBprepare\fP -.RE -.SS npm help \fBenv\fP -.RS 0 -.IP \(bu 2 -\fBenv\fP (You can override the default behavior of \fBnpm env\fP by defining - a custom \fBenv\fP entry in your \fBscripts\fP object) - .RE .SS npm help \fBinstall\fP .P diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index 5b28ac54c5d..dbb63528d6d 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "April 2021" "" "" +.TH "WORKSPACES" "7" "May 2021" "" "" .SH "NAME" \fBworkspaces\fR \- Working with workspaces .SS Description diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js b/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js index 9a96fd1b379..25113cbedff 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js @@ -1,60 +1,60 @@ // add and remove dependency specs to/from pkg manifest -const removeFromOthers = (name, type, pkg) => { - const others = new Set([ - 'dependencies', - 'optionalDependencies', - 'devDependencies', - 'peerDependenciesMeta', - 'peerDependencies', - ]) - - switch (type) { - case 'prod': - others.delete('dependencies') - break - case 'dev': - others.delete('devDependencies') - others.delete('peerDependencies') - others.delete('peerDependenciesMeta') - break - case 'optional': - others.delete('optionalDependencies') - break - case 'peer': - case 'peerOptional': - others.delete('devDependencies') - others.delete('peerDependencies') - others.delete('peerDependenciesMeta') - break - } - - for (const other of others) - deleteSubKey(pkg, other, name) -} - -const add = ({pkg, add, saveBundle, saveType}) => { +const add = ({pkg, add, saveBundle, saveType, log}) => { for (const spec of add) - addSingle({pkg, spec, saveBundle, saveType}) + addSingle({pkg, spec, saveBundle, saveType, log}) return pkg } -const addSingle = ({pkg, spec, saveBundle, saveType}) => { - if (!saveType) - saveType = getSaveType(pkg, spec) +// Canonical source of both the map between saveType and where it correlates to +// in the package, and the names of all our dependencies attributes +const saveTypeMap = new Map([ + ['dev', 'devDependencies'], + ['optional', 'optionalDependencies'], + ['prod', 'dependencies'], + ['peerOptional', 'peerDependencies'], + ['peer', 'peerDependencies'], +]) +const addSingle = ({pkg, spec, saveBundle, saveType, log}) => { const { name, rawSpec } = spec - removeFromOthers(name, saveType, pkg) - const type = saveType === 'prod' ? 'dependencies' - : saveType === 'optional' ? 'optionalDependencies' - : saveType === 'peer' || saveType === 'peerOptional' ? 'peerDependencies' - : saveType === 'dev' ? 'devDependencies' - : /* istanbul ignore next */ null - pkg[type] = pkg[type] || {} - if (rawSpec !== '' || pkg[type][name] === undefined) - pkg[type][name] = rawSpec || '*' + // if the user does not give us a type, we infer which type(s) + // to keep based on the same order of priority we do when + // building the tree as defined in the _loadDeps method of + // the node class. + if (!saveType) + saveType = inferSaveType(pkg, spec.name) + + if (saveType === 'prod') { + // a production dependency can only exist as production (rpj ensures it + // doesn't coexist w/ optional) + deleteSubKey(pkg, 'devDependencies', name, 'dependencies', log) + deleteSubKey(pkg, 'peerDependencies', name, 'dependencies', log) + } else if (saveType === 'dev') { + // a dev dependency may co-exist as peer, or optional, but not production + deleteSubKey(pkg, 'dependencies', name, 'devDependencies', log) + } else if (saveType === 'optional') { + // an optional dependency may co-exist as dev (rpj ensures it doesn't + // coexist w/ prod) + deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies', log) + } else { // peer or peerOptional is all that's left + // a peer dependency may coexist as dev + deleteSubKey(pkg, 'dependencies', name, 'peerDependencies', log) + deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies', log) + } + + const depType = saveTypeMap.get(saveType) + + pkg[depType] = pkg[depType] || {} + if (rawSpec !== '' || pkg[depType][name] === undefined) + pkg[depType][name] = rawSpec || '*' + if (saveType === 'optional') { + // Affordance for previous npm versions that require this behaviour + pkg.dependencies = pkg.dependencies || {} + pkg.dependencies[name] = pkg.optionalDependencies[name] + } if (saveType === 'peer' || saveType === 'peerOptional') { const pdm = pkg.peerDependenciesMeta || {} @@ -79,47 +79,49 @@ const addSingle = ({pkg, spec, saveBundle, saveType}) => { } } -const getSaveType = (pkg, spec) => { - const {name} = spec - const { - // these names are so lonnnnngggg - devDependencies: devDeps, - optionalDependencies: optDeps, - peerDependencies: peerDeps, - peerDependenciesMeta: peerDepsMeta, - } = pkg - - if (peerDeps && peerDeps[name] !== undefined) { - if (peerDepsMeta && peerDepsMeta[name] && peerDepsMeta[name].optional) - return 'peerOptional' - else - return 'peer' - } else if (devDeps && devDeps[name] !== undefined) - return 'dev' - else if (optDeps && optDeps[name] !== undefined) - return 'optional' - else - return 'prod' +// Finds where the package is already in the spec and infers saveType from that +const inferSaveType = (pkg, name) => { + for (const saveType of saveTypeMap.keys()) { + if (hasSubKey(pkg, saveTypeMap.get(saveType), name)) { + if ( + saveType === 'peerOptional' && + (!hasSubKey(pkg, 'peerDependenciesMeta', name) || + !pkg.peerDependenciesMeta[name].optional) + ) + return 'peer' + return saveType + } + } + return 'prod' } -const deleteSubKey = (obj, k, sk) => { - if (obj[k]) { - delete obj[k][sk] - if (!Object.keys(obj[k]).length) - delete obj[k] +const hasSubKey = (pkg, depType, name) => { + return pkg[depType] && Object.prototype.hasOwnProperty.call(pkg[depType], name) +} + +// Removes a subkey and warns about it if it's being replaced +const deleteSubKey = (pkg, depType, name, replacedBy, log) => { + if (hasSubKey(pkg, depType, name)) { + if (replacedBy && log) + log.warn('idealTree', `Removing ${depType}.${name} in favor of ${replacedBy}.${name}`) + delete pkg[depType][name] + + // clean up peerDependenciesMeta if we are removing something from peerDependencies + if (depType === 'peerDependencies' && pkg.peerDependenciesMeta) { + delete pkg.peerDependenciesMeta[name] + if (!Object.keys(pkg.peerDependenciesMeta).length) + delete pkg.peerDependenciesMeta + } + + if (!Object.keys(pkg[depType]).length) + delete pkg[depType] } } const rm = (pkg, rm) => { - for (const type of [ - 'dependencies', - 'optionalDependencies', - 'peerDependencies', - 'peerDependenciesMeta', - 'devDependencies', - ]) { + for (const depType of new Set(saveTypeMap.values())) { for (const name of rm) - deleteSubKey(pkg, type, name) + deleteSubKey(pkg, depType, name) } if (pkg.bundleDependencies) { pkg.bundleDependencies = pkg.bundleDependencies @@ -130,4 +132,4 @@ const rm = (pkg, rm) => { return pkg } -module.exports = { add, rm } +module.exports = { add, rm, saveTypeMap, hasSubKey } 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 7ee8dae35be..6176707c3c6 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 @@ -504,6 +504,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { saveBundle, saveType, path: this.path, + log: this.log, }) }) } diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js index 93b9aa38298..3578d50389e 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -29,6 +29,7 @@ const {resolve} = require('path') const {homedir} = require('os') const procLog = require('../proc-log.js') +const { saveTypeMap } = require('../add-rm-pkg-deps.js') const mixins = [ require('../tracker.js'), @@ -57,6 +58,8 @@ class Arborist extends Base { packumentCache: options.packumentCache || new Map(), log: options.log || procLog, } + if (options.saveType && !saveTypeMap.get(options.saveType)) + throw new Error(`Invalid saveType ${options.saveType}`) this.cache = resolve(this.options.cache) this.path = resolve(this.options.path) process.emit('timeEnd', 'arborist:ctor') diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index 64f08756263..f7731e1c90d 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -3,9 +3,8 @@ const onExit = require('../signal-handling.js') const pacote = require('pacote') const rpj = require('read-package-json-fast') -const { updateDepSpec } = require('../dep-spec.js') const AuditReport = require('../audit-report.js') -const {subset} = require('semver') +const {subset, intersects} = require('semver') const npa = require('npm-package-arg') const {dirname, resolve, relative} = require('path') @@ -28,6 +27,7 @@ const promiseAllRejectLate = require('promise-all-reject-late') const optionalSet = require('../optional-set.js') const updateRootPackageJson = require('../update-root-package-json.js') const calcDepFlags = require('../calc-dep-flags.js') +const { saveTypeMap, hasSubKey } = require('../add-rm-pkg-deps.js') const _retiredPaths = Symbol('retiredPaths') const _retiredUnchanged = Symbol('retiredUnchanged') @@ -406,11 +406,14 @@ module.exports = cls => class Reifier extends cls { return process.emit('time', 'reify:trashOmits') + // node.parent is checked to make sure this is a node that's in the tree, and + // not the parent-less top level nodes const filter = node => - node.peer && this[_omitPeer] || - node.dev && this[_omitDev] || - node.optional && this[_omitOptional] || - node.devOptional && this[_omitOptional] && this[_omitDev] + node.isDescendantOf(this.idealTree) && + (node.peer && this[_omitPeer] || + node.dev && this[_omitDev] || + node.optional && this[_omitOptional] || + node.devOptional && this[_omitOptional] && this[_omitDev]) for (const node of this.idealTree.inventory.filter(filter)) this[_addNodeToTrashList](node) @@ -539,8 +542,8 @@ module.exports = cls => class Reifier extends cls { // Do the best with what we have, or else remove it from the tree // entirely, since we can't possibly reify it. const res = node.resolved ? `${node.name}@${this[_registryResolved](node.resolved)}` - : node.package.name && node.version - ? `${node.package.name}@${node.version}` + : node.packageName && node.version + ? `${node.packageName}@${node.version}` : null // no idea what this thing is. remove it from the tree. @@ -959,6 +962,7 @@ module.exports = cls => class Reifier extends cls { const spec = subSpec ? subSpec.rawSpec : rawSpec const child = root.children.get(name) + let newSpec if (req.registry) { const version = child.version const prefixRange = version ? this[_savePrefix] + version : '*' @@ -970,16 +974,17 @@ module.exports = cls => class Reifier extends cls { const isRange = (subSpec || req).type === 'range' const range = !isRange || subset(prefixRange, spec, { loose: true }) ? prefixRange : spec - const pname = child.package.name + const pname = child.packageName const alias = name !== pname - updateDepSpec(pkg, name, (alias ? `npm:${pname}@` : '') + range) + newSpec = alias ? `npm:${pname}@${range}` : range } else if (req.hosted) { // save the git+https url if it has auth, otherwise shortcut const h = req.hosted const opt = { noCommittish: false } - const save = h.https && h.auth ? `git+${h.https(opt)}` - : h.shortcut(opt) - updateDepSpec(pkg, name, save) + if (h.https && h.auth) + newSpec = `git+${h.https(opt)}` + else + newSpec = h.shortcut(opt) } else if (req.type === 'directory' || req.type === 'file') { // save the relative path in package.json // Normally saveSpec is updated with the proper relative @@ -988,9 +993,37 @@ module.exports = cls => class Reifier extends cls { // thing, so just get the ultimate fetchSpec and relativize it. const p = req.fetchSpec.replace(/^file:/, '') const rel = relpath(root.realpath, p) - updateDepSpec(pkg, name, `file:${rel}`) + newSpec = `file:${rel}` } else - updateDepSpec(pkg, name, req.saveSpec) + newSpec = req.saveSpec + + if (options.saveType) { + const depType = saveTypeMap.get(options.saveType) + pkg[depType][name] = newSpec + // rpj will have moved it here if it was in both + // if it is empty it will be deleted later + if (options.saveType === 'prod' && pkg.optionalDependencies) + delete pkg.optionalDependencies[name] + } else { + if (hasSubKey(pkg, 'dependencies', name)) + pkg.dependencies[name] = newSpec + + if (hasSubKey(pkg, 'devDependencies', name)) { + pkg.devDependencies[name] = newSpec + // don't update peer or optional if we don't have to + if (hasSubKey(pkg, 'peerDependencies', name) && !intersects(newSpec, pkg.peerDependencies[name])) + pkg.peerDependencies[name] = newSpec + + if (hasSubKey(pkg, 'optionalDependencies', name) && !intersects(newSpec, pkg.optionalDependencies[name])) + pkg.optionalDependencies[name] = newSpec + } else { + if (hasSubKey(pkg, 'peerDependencies', name)) + pkg.peerDependencies[name] = newSpec + + if (hasSubKey(pkg, 'optionalDependencies', name)) + pkg.optionalDependencies[name] = newSpec + } + } } // refresh the edges so they have the correct specs diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js b/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js index 77cd6511aea..9a0178c59c9 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js @@ -101,13 +101,14 @@ class AuditReport extends Map { async run () { this.report = await this[_getReport]() + this.log.silly('audit report', this.report) if (this.report) await this[_init]() return this } isVulnerable (node) { - const vuln = this.get(node.package.name) + const vuln = this.get(node.packageName) return !!(vuln && vuln.isVulnerable(node)) } @@ -144,7 +145,7 @@ class AuditReport extends Map { super.set(name, vuln) const p = [] - for (const node of this.tree.inventory.query('name', name)) { + for (const node of this.tree.inventory.query('packageName', name)) { if (shouldOmit(node, this[_omit])) continue @@ -167,7 +168,7 @@ class AuditReport extends Map { this[_checkTopNode](dep, vuln, spec) else { // calculate a metavuln, if necessary - p.push(this.calculator.calculate(dep.name, advisory).then(meta => { + p.push(this.calculator.calculate(dep.packageName, advisory).then(meta => { if (meta.testVersion(dep.version, spec)) advisories.add(meta) })) @@ -228,6 +229,9 @@ class AuditReport extends Map { if (!specObj.registry) return false + if (specObj.subSpec) + spec = specObj.subSpec.rawSpec + // We don't provide fixes for top nodes other than root, but we // still check to see if the node is fixable with a different version, // and if that is a semver major bump. @@ -289,6 +293,7 @@ class AuditReport extends Map { try { // first try the super fast bulk advisory listing const body = prepareBulkData(this.tree, this[_omit]) + this.log.silly('audit', 'bulk request', body) // no sense asking if we don't have anything to audit, // we know it'll be empty @@ -304,7 +309,8 @@ class AuditReport extends Map { }) return await res.json() - } catch (_) { + } catch (er) { + this.log.silly('audit', 'bulk request failed', String(er.body)) // that failed, try the quick audit endpoint const body = prepareData(this.tree, this.options) const res = await fetch('/-/npm/v1/security/audits/quick', { @@ -330,6 +336,7 @@ class AuditReport extends Map { // return true if we should ignore this one const shouldOmit = (node, omit) => !node.version ? true + : node.isRoot ? true : omit.size === 0 ? false : node.dev && omit.has('dev') || node.optional && omit.has('optional') || @@ -338,9 +345,9 @@ const shouldOmit = (node, omit) => const prepareBulkData = (tree, omit) => { const payload = {} - for (const name of tree.inventory.query('name')) { + for (const name of tree.inventory.query('packageName')) { const set = new Set() - for (const node of tree.inventory.query('name', name)) { + for (const node of tree.inventory.query('packageName', name)) { if (shouldOmit(node, omit)) continue diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js b/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js deleted file mode 100644 index 92911543e16..00000000000 --- a/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js +++ /dev/null @@ -1,43 +0,0 @@ -const types = [ - 'peerDependencies', - 'devDependencies', - 'optionalDependencies', - 'dependencies', -] - -const findType = (pkg, name) => { - for (const t of types) { - if (pkg[t] && typeof pkg[t] === 'object' && pkg[t][name] !== undefined) - return t - } - return 'dependencies' -} - -// given a dep name and spec, update it wherever it exists in -// the manifest, or add the spec to 'dependencies' if not found. -const updateDepSpec = (pkg, name, newSpec) => { - const type = findType(pkg, name) - pkg[type] = pkg[type] || {} - pkg[type][name] = newSpec - return pkg -} - -// sort alphabetically all types of deps for a given package -const orderDeps = (pkg) => { - for (const type of types) { - if (pkg && pkg[type]) { - pkg[type] = Object.keys(pkg[type]) - .sort((a, b) => a.localeCompare(b)) - .reduce((res, key) => { - res[key] = pkg[type][key] - return res - }, {}) - } - } - return pkg -} - -module.exports = { - orderDeps, - updateDepSpec, -} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js b/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js index cef0c4e2658..75782918852 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js @@ -4,7 +4,7 @@ // keys is the set of fields to be able to query. const _primaryKey = Symbol('_primaryKey') const _index = Symbol('_index') -const defaultKeys = ['name', 'license', 'funding', 'realpath'] +const defaultKeys = ['name', 'license', 'funding', 'realpath', 'packageName'] const { hasOwnProperty } = Object.prototype const debug = require('./debug.js') class Inventory extends Map { diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/node.js b/deps/npm/node_modules/@npmcli/arborist/lib/node.js index a54f76afcdf..370bfc9567d 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/node.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/node.js @@ -291,6 +291,10 @@ class Node { return this[_package].version || '' } + get packageName () { + return this[_package].name || null + } + get pkgid () { const { name = '', version = '' } = this.package // root package will prefer package name over folder name, @@ -350,10 +354,10 @@ class Node { } const why = { - name: this.isProjectRoot ? this.package.name : this.name, + name: this.isProjectRoot ? this.packageName : this.name, version: this.package.version, } - if (this.errors.length || !this.package.name || !this.package.version) { + if (this.errors.length || !this.packageName || !this.package.version) { why.errors = this.errors.length ? this.errors : [ new Error('invalid package: lacks name and/or version'), ] @@ -460,7 +464,7 @@ class Node { if (this.isProjectRoot) return false const { root } = this - const { type, to } = root.edgesOut.get(this.package.name) || {} + const { type, to } = root.edgesOut.get(this.packageName) || {} return type === 'workspace' && to && (to.target === this || to === this) } @@ -730,20 +734,14 @@ class Node { [_loadDeps] () { // Caveat! Order is relevant! - // packages in optionalDependencies and prod/peer/dev are - // optional. Packages in both deps and devDeps are required. + // Packages in optionalDependencies are optional. + // Packages in both deps and devDeps are required. // Note the subtle breaking change from v6: it is no longer possible // to have a different spec for a devDep than production dep. - this[_loadDepType](this.package.optionalDependencies, 'optional') // Linked targets that are disconnected from the tree are tops, // but don't have a 'path' field, only a 'realpath', because we // don't know their canonical location. We don't need their devDeps. - const { isTop, path, sourceReference } = this - const { isTop: srcTop, path: srcPath } = sourceReference || {} - if (isTop && path && (!sourceReference || srcTop && srcPath)) - this[_loadDepType](this.package.devDependencies, 'dev') - const pd = this.package.peerDependencies if (pd && typeof pd === 'object' && !this.legacyPeerDeps) { const pm = this.package.peerDependenciesMeta || {} @@ -760,19 +758,22 @@ class Node { } this[_loadDepType](this.package.dependencies, 'prod') + this[_loadDepType](this.package.optionalDependencies, 'optional') + + const { isTop, path, sourceReference } = this + const { isTop: srcTop, path: srcPath } = sourceReference || {} + if (isTop && path && (!sourceReference || srcTop && srcPath)) + this[_loadDepType](this.package.devDependencies, 'dev') } - [_loadDepType] (obj, type) { - const from = this + [_loadDepType] (deps, type) { const ad = this.package.acceptDependencies || {} - for (const [name, spec] of Object.entries(obj || {})) { - const accept = ad[name] - // if it's already set, then we keep the existing edge - // Prod deps should not be marked as dev, however. - // NB: the Edge ctor adds itself to from.edgesOut + // Because of the order in which _loadDeps runs, we always want to + // prioritize a new edge over an existing one + for (const [name, spec] of Object.entries(deps || {})) { const current = this.edgesOut.get(name) - if (!current || current.dev && type === 'prod') - new Edge({ from, name, spec, accept, type }) + if (!current || current.type !== 'workspace') + new Edge({ from: this, name, spec, accept: ad[name], type }) } } @@ -965,8 +966,8 @@ class Node { // if no resolved, check both package name and version // otherwise, conclude that they are different things - return this.package.name && node.package.name && - this.package.name === node.package.name && + return this.packageName && node.packageName && + this.packageName === node.packageName && this.version && node.version && this.version === node.version } diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/printable.js b/deps/npm/node_modules/@npmcli/arborist/lib/printable.js index 79f46a9e93c..e611f55a4bd 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/printable.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/printable.js @@ -7,8 +7,8 @@ const relpath = require('./relpath.js') class ArboristNode { constructor (tree, path) { this.name = tree.name - if (tree.package.name && tree.package.name !== this.name) - this.packageName = tree.package.name + if (tree.packageName && tree.packageName !== this.name) + this.packageName = tree.packageName if (tree.version) this.version = tree.version this.location = tree.location diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js index 342e78e9e3a..d9065ffa025 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js @@ -254,7 +254,7 @@ class Shrinkwrap { meta[key.replace(/^_/, '')] = val }) // we only include name if different from the node path name - const pname = node.package.name + const pname = node.packageName if (pname && pname !== node.name) meta.name = pname @@ -825,7 +825,7 @@ class Shrinkwrap { [_buildLegacyLockfile] (node, lock, path = []) { if (node === this.tree) { // the root node - lock.name = node.package.name || node.name + lock.name = node.packageName || node.name if (node.version) lock.version = node.version } @@ -870,9 +870,9 @@ class Shrinkwrap { lock.from = spec.raw } else if (!node.isRoot && node.package && - node.package.name && - node.package.name !== node.name) - lock.version = `npm:${node.package.name}@${node.version}` + node.packageName && + node.packageName !== node.name) + lock.version = `npm:${node.packageName}@${node.version}` else if (node.package && node.version) lock.version = node.version diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/update-root-package-json.js b/deps/npm/node_modules/@npmcli/arborist/lib/update-root-package-json.js index aba5614924e..4a88707b9c4 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/update-root-package-json.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/update-root-package-json.js @@ -6,8 +6,6 @@ const {resolve} = require('path') const parseJSON = require('json-parse-even-better-errors') -const { orderDeps } = require('./dep-spec.js') - const depTypes = new Set([ 'dependencies', 'optionalDependencies', @@ -15,6 +13,20 @@ const depTypes = new Set([ 'peerDependencies', ]) +// sort alphabetically all types of deps for a given package +const orderDeps = (pkg) => { + for (const type of depTypes) { + if (pkg && pkg[type]) { + pkg[type] = Object.keys(pkg[type]) + .sort((a, b) => a.localeCompare(b)) + .reduce((res, key) => { + res[key] = pkg[type][key] + return res + }, {}) + } + } + return pkg +} const parseJsonSafe = json => { try { return parseJSON(json) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js b/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js index 8f887a3fc96..2561bc80646 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js @@ -83,6 +83,9 @@ class Vuln { if (!specObj.registry) return true + if (specObj.subSpec) + spec = specObj.subSpec.rawSpec + for (const v of this.versions) { if (satisfies(v, spec) && !satisfies(v, this.range, semverOpt)) return false diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index e7ac932e08d..ebc84f6fc32 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.4.1", + "version": "2.4.2", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.7", diff --git a/deps/npm/node_modules/@npmcli/git/lib/clone.js b/deps/npm/node_modules/@npmcli/git/lib/clone.js index 1fea5acc846..6754fd76060 100644 --- a/deps/npm/node_modules/@npmcli/git/lib/clone.js +++ b/deps/npm/node_modules/@npmcli/git/lib/clone.js @@ -30,7 +30,7 @@ const pickManifest = require('npm-pick-manifest') const fs = require('fs') const mkdirp = require('mkdirp') -module.exports = (repo, ref = 'HEAD', target = null, /* istanbul ignore next */ opts = {}) => +module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => revs(repo, opts).then(revs => clone( repo, revs, diff --git a/deps/npm/node_modules/@npmcli/git/lib/spawn.js b/deps/npm/node_modules/@npmcli/git/lib/spawn.js index cee3a7baf40..337164a9a01 100644 --- a/deps/npm/node_modules/@npmcli/git/lib/spawn.js +++ b/deps/npm/node_modules/@npmcli/git/lib/spawn.js @@ -10,6 +10,11 @@ module.exports = (gitArgs, opts = {}) => { if (gitPath instanceof Error) { return Promise.reject(gitPath) } + // undocumented option, mostly only here for tests + const args = opts.allowReplace || gitArgs[0] === '--no-replace-objects' + ? gitArgs + : ['--no-replace-objects', ...gitArgs] + const log = opts.log || procLog let retry = opts.retry if (retry === null || retry === undefined) { @@ -22,11 +27,11 @@ module.exports = (gitArgs, opts = {}) => { } return promiseRetry((retry, number) => { if (number !== 1) { - log.silly('pacote', `Retrying git command: ${ - gitArgs.join(' ')} attempt # ${number}`) + log.silly('git', `Retrying git command: ${ + args.join(' ')} attempt # ${number}`) } - return spawn(gitPath, gitArgs, makeOpts(opts)) + return spawn(gitPath, args, makeOpts(opts)) .catch(er => { if (!shouldRetry(er.stderr, number)) { throw er diff --git a/deps/npm/node_modules/@npmcli/git/package.json b/deps/npm/node_modules/@npmcli/git/package.json index 9b368c31e26..0fe94686ece 100644 --- a/deps/npm/node_modules/@npmcli/git/package.json +++ b/deps/npm/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "2.0.8", + "version": "2.0.9", "main": "lib/index.js", "files": [ "lib/*.js" @@ -29,7 +29,7 @@ "devDependencies": { "slash": "^3.0.0", "standard": "^16.0.3", - "tap": "^14.11.0" + "tap": "^15.0.6" }, "dependencies": { "@npmcli/promise-spawn": "^1.3.2", diff --git a/deps/npm/node_modules/libnpmexec/CHANGELOG.md b/deps/npm/node_modules/libnpmexec/CHANGELOG.md index 9de3013f0ad..81a0e1a0327 100644 --- a/deps/npm/node_modules/libnpmexec/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmexec/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v1.1.0 + +- Add add walk up dir lookup logic to satisfy local bins, +similar to `@npmcli/run-script` + +## v1.0.1 + +- Fix `scriptShell` option name. + ## v1.0.0 - Initial implementation, moves the code that used to live in the **npm cli**, diff --git a/deps/npm/node_modules/libnpmexec/README.md b/deps/npm/node_modules/libnpmexec/README.md index a436c9a5a2b..fb7a7717600 100644 --- a/deps/npm/node_modules/libnpmexec/README.md +++ b/deps/npm/node_modules/libnpmexec/README.md @@ -31,7 +31,7 @@ await libexec({ - `call`: An alternative command to run when using `packages` option **String**, defaults to empty string. - `cache`: The path location to where the npm cache folder is placed **String** - `color`: Output should use color? **Boolean**, defaults to `false` - - `localBin`: Location to the `node_modules/.bin` folder of the local project **String**, defaults to empty string. + - `localBin`: Location to the `node_modules/.bin` folder of the local project to start scanning for bin files **String**, defaults to `./node_modules/.bin`. **libexec** will walk up the directory structure looking for `node_modules/.bin` folders in parent folders that might satisfy the current `arg` and will use that bin if found. - `locationMsg`: Overrides "at location" message when entering interactive mode **String** - `log`: Sets an optional logger **Object**, defaults to `proc-log` module usage. - `globalBin`: Location to the global space bin folder, same as: `$(npm bin -g)` **String**, defaults to empty string. diff --git a/deps/npm/node_modules/libnpmexec/lib/file-exists.js b/deps/npm/node_modules/libnpmexec/lib/file-exists.js new file mode 100644 index 00000000000..a115be14b00 --- /dev/null +++ b/deps/npm/node_modules/libnpmexec/lib/file-exists.js @@ -0,0 +1,29 @@ +const { resolve } = require('path') +const { promisify } = require('util') +const stat = promisify(require('fs').stat) +const walkUp = require('walk-up-path') + +const fileExists = (file) => stat(file) + .then((stat) => stat.isFile()) + .catch(() => false) + +const localFileExists = async (dir, binName, root = '/') => { + root = resolve(root).toLowerCase() + + for (const path of walkUp(resolve(dir))) { + const binDir = resolve(path, 'node_modules', '.bin') + + if (await fileExists(resolve(binDir, binName))) + return binDir + + if (path.toLowerCase() === root) + return false + } + + return false +} + +module.exports = { + fileExists, + localFileExists, +} diff --git a/deps/npm/node_modules/libnpmexec/lib/index.js b/deps/npm/node_modules/libnpmexec/lib/index.js index 906a0b5407c..0bab753f9fd 100644 --- a/deps/npm/node_modules/libnpmexec/lib/index.js +++ b/deps/npm/node_modules/libnpmexec/lib/index.js @@ -1,7 +1,6 @@ -const { delimiter, resolve } = require('path') +const { delimiter, dirname, resolve } = require('path') const { promisify } = require('util') const read = promisify(require('read')) -const stat = promisify(require('fs').stat) const Arborist = require('@npmcli/arborist') const ciDetect = require('@npmcli/ci-detect') @@ -12,15 +11,12 @@ const pacote = require('pacote') const readPackageJson = require('read-package-json-fast') const cacheInstallDir = require('./cache-install-dir.js') +const { fileExists, localFileExists } = require('./file-exists.js') const getBinFromManifest = require('./get-bin-from-manifest.js') const manifestMissing = require('./manifest-missing.js') const noTTY = require('./no-tty.js') const runScript = require('./run-script.js') -const fileExists = (file) => stat(file) - .then((stat) => stat.isFile()) - .catch(() => false) - /* istanbul ignore next */ const PATH = ( process.env.PATH || process.env.Path || process.env.path @@ -31,7 +27,7 @@ const exec = async (opts) => { args = [], call = '', color = false, - localBin = '', + localBin = resolve('./node_modules/.bin'), locationMsg = undefined, globalBin = '', output, @@ -72,8 +68,10 @@ const exec = async (opts) => { // the behavior of treating the single argument as a package name if (needPackageCommandSwap) { let binExists = false - if (await fileExists(`${localBin}/${args[0]}`)) { - pathArr.unshift(localBin) + const dir = dirname(dirname(localBin)) + const localBinPath = await localFileExists(dir, args[0]) + if (localBinPath) { + pathArr.unshift(localBinPath) binExists = true } else if (await fileExists(`${globalBin}/${args[0]}`)) { pathArr.unshift(globalBin) diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index 1b7d24103be..bc5c0483a7d 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "1.0.1", + "version": "1.1.0", "files": [ "lib" ], @@ -46,7 +46,7 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", - "tap": "^15.0.2" + "tap": "^15.0.6" }, "dependencies": { "@npmcli/arborist": "^2.3.0", @@ -58,6 +58,7 @@ "pacote": "^11.3.1", "proc-log": "^1.0.0", "read": "^1.0.7", - "read-package-json-fast": "^2.0.2" + "read-package-json-fast": "^2.0.2", + "walk-up-path": "^1.0.0" } } diff --git a/deps/npm/node_modules/npm-packlist/index.js b/deps/npm/node_modules/npm-packlist/index.js index 8f62983e6f6..12b51316c5e 100644 --- a/deps/npm/node_modules/npm-packlist/index.js +++ b/deps/npm/node_modules/npm-packlist/index.js @@ -26,8 +26,7 @@ const normalizePackageBin = require('npm-normalize-package-bin') // localized documentation and other use cases. Adding a `/` to // these rules, while tempting and arguably more "correct", is a // significant change that will break existing use cases. -const packageMustHaveFileNames = - 'readme|copying|license|licence|notice|changes|changelog|history' +const packageMustHaveFileNames = 'readme|copying|license|licence' const packageMustHaves = `@(${packageMustHaveFileNames}){,.*[^~$]}` const packageMustHavesRE = new RegExp(`^(${packageMustHaveFileNames})(\\..*[^~\$])?$`, 'i') diff --git a/deps/npm/node_modules/npm-packlist/package.json b/deps/npm/node_modules/npm-packlist/package.json index 1276b484136..e909559bdb2 100644 --- a/deps/npm/node_modules/npm-packlist/package.json +++ b/deps/npm/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "2.1.5", + "version": "2.2.0", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" @@ -15,12 +15,12 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ + "bin/index.js", "index.js" ], "devDependencies": { "mutate-fs": "^2.1.1", - "require-inject": "^1.4.4", - "tap": "^14.10.8" + "tap": "^15.0.6" }, "scripts": { "test": "tap", diff --git a/deps/npm/package.json b/deps/npm/package.json index 19326a9aa59..7360d8f9640 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "7.11.2", + "version": "7.12.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -42,7 +42,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@npmcli/arborist": "^2.4.1", + "@npmcli/arborist": "^2.4.2", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^2.2.0", "@npmcli/run-script": "^1.8.5", @@ -67,7 +67,7 @@ "leven": "^3.1.0", "libnpmaccess": "^4.0.2", "libnpmdiff": "^2.0.4", - "libnpmexec": "^1.0.1", + "libnpmexec": "^1.1.0", "libnpmfund": "^1.0.2", "libnpmhook": "^6.0.2", "libnpmorg": "^2.0.2", @@ -182,10 +182,10 @@ "devDependencies": { "@mdx-js/mdx": "^1.6.22", "cmark-gfm": "^0.8.5", - "eslint": "^7.23.0", + "eslint": "^7.25.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^4.3.1", + "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", "jsdom": "^16.5.2", "licensee": "^8.1.0", diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index d6761ea30c7..53aef86f79d 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -1132,7 +1132,8 @@ Show short usage output about the command specified. #### \`user-agent\` -* Default: "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" +* Default: "npm/{npm-version} node/{node-version} {platform} {arch} + workspaces/{workspaces} {ci}" * Type: String Sets the User-Agent request header. The following fields are replaced with @@ -1142,6 +1143,8 @@ their actual counterparts: * \`{node-version}\` - The Node.js version in use * \`{platform}\` - The value of \`process.platform\` * \`{arch}\` - The value of \`process.arch\` +* \`{workspaces}\` - Set to \`true\` if the \`workspaces\` or \`workspace\` options + are set. * \`{ci}\` - The value of the \`ci-name\` config, if set, prefixed with \`ci/\`, or an empty string if \`ci-name\` is empty. diff --git a/deps/npm/test/lib/cache.js b/deps/npm/test/lib/cache.js index bbebae8894b..bad0ede89e1 100644 --- a/deps/npm/test/lib/cache.js +++ b/deps/npm/test/lib/cache.js @@ -134,20 +134,21 @@ t.test('cache add pkg only', t => { }) }) -t.test('cache add pkg w/ spec modifier', t => { +t.test('cache add multiple pkgs', t => { t.teardown(() => { logOutput = [] tarballStreamSpec = '' tarballStreamOpts = {} }) - cache.exec(['add', 'mypkg', 'latest'], err => { + cache.exec(['add', 'mypkg', 'anotherpkg'], err => { t.error(err) t.strictSame(logOutput, [ - ['silly', 'cache add', 'args', ['mypkg', 'latest']], - ['silly', 'cache add', 'spec', 'mypkg@latest'], + ['silly', 'cache add', 'args', ['mypkg', 'anotherpkg']], + ['silly', 'cache add', 'spec', 'mypkg'], + ['silly', 'cache add', 'spec', 'anotherpkg'], ], 'logs correctly') - t.equal(tarballStreamSpec, 'mypkg@latest', 'passes the correct spec to pacote') + t.equal(tarballStreamSpec, 'anotherpkg', 'passes the correct spec to pacote') t.same(tarballStreamOpts, npm.flatOptions, 'passes the correct options to pacote') t.end() }) diff --git a/deps/npm/test/lib/exec.js b/deps/npm/test/lib/exec.js index 5ecc7327487..3d2da32a766 100644 --- a/deps/npm/test/lib/exec.js +++ b/deps/npm/test/lib/exec.js @@ -121,11 +121,15 @@ t.afterEach(() => { t.test('npx foo, bin already exists locally', t => { const path = t.testdir({ - foo: 'just some file', + node_modules: { + '.bin': { + foo: 'just some file', + }, + }, }) PROGRESS_IGNORED = true - npm.localBin = path + npm.localBin = resolve(path, 'node_modules', '.bin') exec.exec(['foo', 'one arg', 'two arg'], er => { t.error(er, 'npm exec') @@ -137,7 +141,7 @@ t.test('npx foo, bin already exists locally', t => { stdioString: true, event: 'npx', env: { - PATH: [path, ...PATH].join(delimiter), + PATH: [npm.localBin, ...PATH].join(delimiter), }, stdio: 'inherit', }]) @@ -147,11 +151,15 @@ t.test('npx foo, bin already exists locally', t => { t.test('npx foo, bin already exists globally', t => { const path = t.testdir({ - foo: 'just some file', + node_modules: { + '.bin': { + foo: 'just some file', + }, + }, }) PROGRESS_IGNORED = true - npm.globalBin = path + npm.globalBin = resolve(path, 'node_modules', '.bin') exec.exec(['foo', 'one arg', 'two arg'], er => { t.error(er, 'npm exec') @@ -163,7 +171,7 @@ t.test('npx foo, bin already exists globally', t => { stdioString: true, event: 'npx', env: { - PATH: [path, ...PATH].join(delimiter), + PATH: [npm.globalBin, ...PATH].join(delimiter), }, stdio: 'inherit', }]) diff --git a/deps/npm/test/lib/utils/config/definitions.js b/deps/npm/test/lib/utils/config/definitions.js index f735223655f..49e41528837 100644 --- a/deps/npm/test/lib/utils/config/definitions.js +++ b/deps/npm/test/lib/utils/config/definitions.js @@ -729,7 +729,7 @@ t.test('user-agent', t => { } const flat = {} const expectNoCI = `npm/1.2.3 node/9.8.7 ` + - `${process.platform} ${process.arch}` + `${process.platform} ${process.arch} workspaces/false` definitions['user-agent'].flatten('user-agent', obj, flat) t.equal(flat.userAgent, expectNoCI) t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set') @@ -742,6 +742,23 @@ t.test('user-agent', t => { t.equal(flat.userAgent, expectCI) t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set') t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated') + + delete obj['ci-name'] + obj.workspaces = true + obj['user-agent'] = definitions['user-agent'].default + const expectWorkspaces = expectNoCI.replace('workspaces/false', 'workspaces/true') + definitions['user-agent'].flatten('user-agent', obj, flat) + t.equal(flat.userAgent, expectWorkspaces) + t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set') + t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated') + + delete obj.workspaces + obj.workspace = ['foo'] + obj['user-agent'] = definitions['user-agent'].default + definitions['user-agent'].flatten('user-agent', obj, flat) + t.equal(flat.userAgent, expectWorkspaces) + t.equal(process.env.npm_config_user_agent, flat.userAgent, 'npm_user_config environment is set') + t.equal(obj['user-agent'], flat.userAgent, 'config user-agent template is translated') t.end() })