diff --git a/.github/label-pr-config.yml b/.github/label-pr-config.yml index 93aeaab0257369..a8d22980f6db18 100644 --- a/.github/label-pr-config.yml +++ b/.github/label-pr-config.yml @@ -85,7 +85,7 @@ subSystemLabels: /^deps\/nghttp2\//: http2 /^deps\/ngtcp2\//: quic, dont-land-on-v14.x, dont-land-on-v12.x /^deps\/nghttp3\//: quic, dont-land-on-v14.x, dont-land-on-v12.x - /^deps\/([^/]+)/: $1 + /^deps\/([^/]+)/: dependencies, $1 ## JS subsystems # Oddities first diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index a9ae1372e42bd9..981c2bd6f03405 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -1,4 +1,4 @@ -name: Tools update +name: Tools and deps update on: schedule: # Run once a week at 00:05 AM UTC on Sunday. @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - tools-update: + tools-deps-update: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest strategy: @@ -15,6 +15,8 @@ jobs: matrix: include: - id: eslint + subsystem: tools + label: tools run: | cd tools NEW_VERSION=$(npm view eslint dist-tags.latest) @@ -24,10 +26,14 @@ jobs: ./update-eslint.sh fi - id: corepack + subsystem: deps + label: dependencies run: | make corepack-update echo "NEW_VERSION=$(node deps/corepack/dist/corepack.js --version)" >> $GITHUB_ENV - id: lint-md-dependencies + subsystem: tools + label: tools run: | cd tools/lint-md npm ci @@ -44,6 +50,8 @@ jobs: make lint-md-rollup fi - id: doc + subsystem: tools + label: tools run: | cd tools/doc npm ci @@ -57,6 +65,16 @@ jobs: npm install --ignore-scripts $NEW_VERSION npm install --ignore-scripts fi + - id: undici + subsystem: deps + label: dependencies + run: | + NEW_VERSION=$(npm view undici dist-tags.latest) + CURRENT_VERSION=$(node -p "require('./deps/undici/src/package.json').version") + if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + ./tools/update-undici.sh + fi steps: - uses: actions/checkout@v2 with: @@ -69,6 +87,6 @@ jobs: author: Node.js GitHub Bot body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}. branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action. - commit-message: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' - labels: tools - title: 'tools: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' + commit-message: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' + labels: ${{ matrix.label }} + title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' diff --git a/AUTHORS b/AUTHORS index 8355af1348d15b..f213b402b5d222 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3434,5 +3434,15 @@ Austin Kelleher apeltop Livia Medeiros <74449973+LiviaMedeiros@users.noreply.github.com> Nikolaos Papaspyrou +Matt Probert <1196252+mattpr@users.noreply.github.com> +Roch Devost +Kohei Ueno +bradh352 +Mikael Finstad +Damjan Cvetko +Randall Leeds +Khoo Hao Yit <40757009+KhooHaoYit@users.noreply.github.com> +Aroyan <43630681+aroyan@users.noreply.github.com> +theanarkh <2923878201@qq.com> # Generated by tools/update-authors.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e916ec09c964a3..9134a7085104cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,8 @@ release. -17.7.2
+17.8.0
+17.7.2
17.7.1
17.7.0
17.6.0
diff --git a/README.md b/README.md index dd2616986f0ad9..e305d58c4ee2eb 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,4 @@ - - -

- - Node.js - -

+# Node.js Node.js is an open-source, cross-platform, JavaScript runtime environment. @@ -19,7 +9,7 @@ The Node.js project uses an [open governance model](./GOVERNANCE.md). The **This project has a [Code of Conduct][].** -# Table of contents +## Table of contents * [Support](#support) * [Release types](#release-types) @@ -428,6 +418,8 @@ For information about the governance of the Node.js project, see **Santiago Gimeno** <> * [shisama](https://github.com/shisama) - **Masashi Hirano** <> (he/him) +* [ShogunPanda](https://github.com/ShogunPanda) - + **Paolo Insogna** <> (he/him) * [srl295](https://github.com/srl295) - **Steven R Loomis** <> * [starkwang](https://github.com/starkwang) - diff --git a/common.gypi b/common.gypi index 702eea8395f4db..fed781736bfa4c 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.15', + 'v8_embedder_string': '-node.16', ##### V8 defaults for Node.js ##### diff --git a/deps/cares/src/lib/ares_expand_name.c b/deps/cares/src/lib/ares_expand_name.c index fcd88a2a42eb42..6c7a35a715bf47 100644 --- a/deps/cares/src/lib/ares_expand_name.c +++ b/deps/cares/src/lib/ares_expand_name.c @@ -64,6 +64,8 @@ static int ares__isprint(int ch) * - underscores which are used in SRV records. * - Forward slashes such as are used for classless in-addr.arpa * delegation (CNAMEs) + * - Asterisks may be used for wildcard domains in CNAMEs as seen in the + * real world. * While RFC 2181 section 11 does state not to do validation, * that applies to servers, not clients. Vulnerabilities have been * reported when this validation is not performed. Security is more @@ -71,7 +73,7 @@ static int ares__isprint(int ch) * anyhow). */ static int is_hostnamech(int ch) { - /* [A-Za-z0-9-._/] + /* [A-Za-z0-9-*._/] * Don't use isalnum() as it is locale-specific */ if (ch >= 'A' && ch <= 'Z') @@ -80,7 +82,7 @@ static int is_hostnamech(int ch) return 1; if (ch >= '0' && ch <= '9') return 1; - if (ch == '-' || ch == '.' || ch == '_' || ch == '/') + if (ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '*') return 1; return 0; diff --git a/deps/npm/docs/content/commands/npm-audit.md b/deps/npm/docs/content/commands/npm-audit.md index 323d38f64c14f9..24b700ff5abd85 100644 --- a/deps/npm/docs/content/commands/npm-audit.md +++ b/deps/npm/docs/content/commands/npm-audit.md @@ -246,6 +246,7 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow conflicting peerDependencies to be installed in the root project. * Implicitly set `--yes` during `npm init`. * Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! @@ -306,6 +307,36 @@ variable will be set to `'production'` for all lifecycle scripts. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` +will still run their intended script if `ignore-scripts` is set, but they +will *not* run any pre- or post-scripts. + + + + #### `workspace` * Default: diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 4490fea9a0bb74..97d1aa5523dd72 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -94,6 +94,21 @@ submitted. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + #### `ignore-scripts` * Default: false diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index d9c03aef41504b..71109cd360511d 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -199,6 +199,7 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow conflicting peerDependencies to be installed in the root project. * Implicitly set `--yes` during `npm init`. * Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index 5ad67604541d1e..0d9470acf58b3d 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -43,6 +43,21 @@ submitted. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + #### `ignore-scripts` * Default: false diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index ed39c6705a4848..5ac31cbf08e25c 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -112,6 +112,27 @@ will be preferred. +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production', otherwise empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + + #### `strict-peer-deps` * Default: false @@ -151,23 +172,17 @@ This configuration does not affect `npm ci`. -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. +#### `foreground-scripts` -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. +* Default: false +* Type: Boolean -If a package type appears in both the `--include` and `--omit` lists, then -it will be included. +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. -If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment -variable will be set to `'production'` for all lifecycle scripts. +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index 6f12e5f5389973..2ffd3e3e9fff14 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -22,7 +22,7 @@ npm install npm install npm install / -aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add +aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall, add ``` @@ -502,6 +502,27 @@ will be preferred. +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production', otherwise empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + + #### `strict-peer-deps` * Default: false @@ -541,23 +562,17 @@ This configuration does not affect `npm ci`. -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. +#### `foreground-scripts` -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. +* Default: false +* Type: Boolean -If a package type appears in both the `--include` and `--omit` lists, then -it will be included. +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. -If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment -variable will be set to `'production'` for all lifecycle scripts. +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index 8f6cbecf958fd9..576e1335efbba9 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -14,6 +14,8 @@ description: Manages your package.json npm pkg set = [= ...] npm pkg get [ [ ...]] npm pkg delete [ ...] +npm pkg set [[].= ...] +npm pkg set [[].= ...] ``` @@ -197,6 +199,7 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow conflicting peerDependencies to be installed in the root project. * Implicitly set `--yes` during `npm init`. * Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 49420e5b9d99cb..a10a353801b7cd 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -99,6 +99,36 @@ Not supported by all npm commands. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + +#### `ignore-scripts` + +* Default: false +* Type: Boolean + +If true, npm does not run scripts specified in package.json files. + +Note that commands explicitly intended to run a particular script, such as +`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script` +will still run their intended script if `ignore-scripts` is set, but they +will *not* run any pre- or post-scripts. + + + + #### `workspace` * Default: diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index ecb4a7ce34c62a..d63e00b79d3867 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -70,6 +70,21 @@ systems. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + #### `ignore-scripts` * Default: false diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index 13589a03ee69fa..a4c481ea5af7f7 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -6,21 +6,22 @@ description: Remove a package from the registry ### Synopsis -To learn more about how the npm registry treats unpublish, see our unpublish policies - -#### Unpublishing a single version of a package + + + ```bash -npm unpublish [<@scope>/]@ +npm unpublish [<@scope>/][@] ``` -#### Unpublishing an entire package + + + + -```bash -npm unpublish [<@scope>/] --force -``` +To learn more about how the npm registry treats unpublish, see our unpublish policies ### Warning @@ -87,6 +88,7 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow conflicting peerDependencies to be installed in the root project. * Implicitly set `--yes` during `npm init`. * Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! diff --git a/deps/npm/docs/content/commands/npm-update.md b/deps/npm/docs/content/commands/npm-update.md index e1b48a8ed43208..aff46b1e5b5576 100644 --- a/deps/npm/docs/content/commands/npm-update.md +++ b/deps/npm/docs/content/commands/npm-update.md @@ -169,6 +169,22 @@ be _downgraded_. +#### `save` + +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + + + + #### `global` * Default: false @@ -214,6 +230,27 @@ will be preferred. +#### `omit` + +* Default: 'dev' if the `NODE_ENV` environment variable is set to + 'production', otherwise empty. +* Type: "dev", "optional", or "peer" (can be set multiple times) + +Dependency types to omit from the installation tree on disk. + +Note that these dependencies _are_ still resolved and added to the +`package-lock.json` or `npm-shrinkwrap.json` file. They are just not +physically installed on disk. + +If a package type appears in both the `--include` and `--omit` lists, then +it will be included. + +If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment +variable will be set to `'production'` for all lifecycle scripts. + + + + #### `strict-peer-deps` * Default: false @@ -253,39 +290,17 @@ This configuration does not affect `npm ci`. -#### `save` +#### `foreground-scripts` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: false * Type: Boolean -Save installed packages to a `package.json` file as dependencies. +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - -#### `omit` - -* Default: 'dev' if the `NODE_ENV` environment variable is set to - 'production', otherwise empty. -* Type: "dev", "optional", or "peer" (can be set multiple times) - -Dependency types to omit from the installation tree on disk. - -Note that these dependencies _are_ still resolved and added to the -`package-lock.json` or `npm-shrinkwrap.json` file. They are just not -physically installed on disk. - -If a package type appears in both the `--include` and `--omit` lists, then -it will be included. - -If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment -variable will be set to `'production'` for all lifecycle scripts. +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. diff --git a/deps/npm/docs/content/commands/npm-version.md b/deps/npm/docs/content/commands/npm-version.md index b53dd64aeae850..86e2ce90e9bea7 100644 --- a/deps/npm/docs/content/commands/npm-version.md +++ b/deps/npm/docs/content/commands/npm-version.md @@ -52,7 +52,8 @@ Run git commit hooks when using the `npm version` command. * Default: true * Type: Boolean -Tag the commit when using the `npm version` command. +Tag the commit when using the `npm version` command. Setting this to false +results in no commit being made at all. diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 530df0971c8ebe..0c2047ad9abe08 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -323,7 +323,7 @@ This should be a module relative to the root of your package folder. For most modules, it makes the most sense to have a main script and often not much else. -If `main` is not set it defaults to `index.js` in the packages root folder. +If `main` is not set it defaults to `index.js` in the package's root folder. ### browser @@ -690,6 +690,10 @@ This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing packages to the public registry. +*note*: Packages linked by local path will not have their own +dependencies installed when `npm install` is ran in this case. You must +run `npm install` from inside the local path itself. + ### devDependencies If someone is planning on downloading and using your module in their diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 9fbb614564df88..df259715f08f2e 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -616,6 +616,7 @@ mistakes, unnecessary performance degradation, and malicious input. * Allow conflicting peerDependencies to be installed in the root project. * Implicitly set `--yes` during `npm init`. * Allow clobbering existing values in `npm pkg` +* Allow unpublishing of entire packages (not just a single version). If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! @@ -677,7 +678,8 @@ but is not in the `PATH`, then set this to the full path to the git binary. * Default: true * Type: Boolean -Tag the commit when using the `npm version` command. +Tag the commit when using the `npm version` command. Setting this to false +results in no commit being made at all. diff --git a/deps/npm/docs/output/commands/npm-audit.html b/deps/npm/docs/output/commands/npm-audit.html index 11006e2f09089d..33c2a803c2a876 100644 --- a/deps/npm/docs/output/commands/npm-audit.html +++ b/deps/npm/docs/output/commands/npm-audit.html @@ -142,7 +142,7 @@

npm-audit

Table of contents

- +

Synopsis

@@ -319,6 +319,7 @@

force

  • Allow conflicting peerDependencies to be installed in the root project.
  • Implicitly set --yes during npm init.
  • Allow clobbering existing values in npm pkg
  • +
  • Allow unpublishing of entire packages (not just a single version).
  • If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

    @@ -366,6 +367,30 @@

    omit

    variable will be set to 'production' for all lifecycle scripts.

    +

    foreground-scripts

    +
      +
    • Default: false
    • +
    • Type: Boolean
    • +
    +

    Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

    +

    Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

    + + +

    ignore-scripts

    +
      +
    • Default: false
    • +
    • Type: Boolean
    • +
    +

    If true, npm does not run scripts specified in package.json files.

    +

    Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run-script +will still run their intended script if ignore-scripts is set, but they +will not run any pre- or post-scripts.

    + +

    workspace

    • Default:
    • diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index fdde58b1adba3d..bbacda33a5174e 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -142,7 +142,7 @@

      npm-ci

      Table of contents

      - +

      Synopsis

      @@ -214,6 +214,18 @@

      audit

      submitted.

      +

      foreground-scripts

      +
        +
      • Default: false
      • +
      • Type: Boolean
      • +
      +

      Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

      +

      Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

      + +

      ignore-scripts

      • Default: false
      • diff --git a/deps/npm/docs/output/commands/npm-init.html b/deps/npm/docs/output/commands/npm-init.html index 00874a95c080a4..c8dece27945345 100644 --- a/deps/npm/docs/output/commands/npm-init.html +++ b/deps/npm/docs/output/commands/npm-init.html @@ -294,6 +294,7 @@

        force

      • Allow conflicting peerDependencies to be installed in the root project.
      • Implicitly set --yes during npm init.
      • Allow clobbering existing values in npm pkg
      • +
      • Allow unpublishing of entire packages (not just a single version).

      If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

      diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index f8b2bcfeeed7e9..b414f090278283 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -142,7 +142,7 @@

      npm-install-ci-test

      Table of contents

      - +

      Synopsis

      @@ -173,6 +173,18 @@

      audit

      submitted.

      +

      foreground-scripts

      +
        +
      • Default: false
      • +
      • Type: Boolean
      • +
      +

      Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

      +

      Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

      + +

      ignore-scripts

      • Default: false
      • diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index 9db250961fe56c..116cc24a81238d 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -142,7 +142,7 @@

        npm-install-test

        Table of contents

        - +

        Synopsis

        @@ -233,6 +233,22 @@

        legacy-bundling

        will be preferred.

        +

        omit

        +
          +
        • Default: 'dev' if the NODE_ENV environment variable is set to +'production', otherwise empty.
        • +
        • Type: "dev", "optional", or "peer" (can be set multiple times)
        • +
        +

        Dependency types to omit from the installation tree on disk.

        +

        Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

        +

        If a package type appears in both the --include and --omit lists, then +it will be included.

        +

        If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

        + +

        strict-peer-deps

        • Default: false
        • @@ -264,20 +280,16 @@

          package-lock

          This configuration does not affect npm ci.

          -

          omit

          +

          foreground-scripts

            -
          • Default: 'dev' if the NODE_ENV environment variable is set to -'production', otherwise empty.
          • -
          • Type: "dev", "optional", or "peer" (can be set multiple times)
          • +
          • Default: false
          • +
          • Type: Boolean
          -

          Dependency types to omit from the installation tree on disk.

          -

          Note that these dependencies are still resolved and added to the -package-lock.json or npm-shrinkwrap.json file. They are just not -physically installed on disk.

          -

          If a package type appears in both the --include and --omit lists, then -it will be included.

          -

          If the resulting omit list includes 'dev', then the NODE_ENV environment -variable will be set to 'production' for all lifecycle scripts.

          +

          Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

          +

          Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

          ignore-scripts

          diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 678e4cce344963..755dee22402fdd 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -142,7 +142,7 @@

          npm-install

          Table of contents

          - +

          Synopsis

          @@ -160,7 +160,7 @@

          Table of contents

          npm install <git:// url> npm install <github username>/<github project> -aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add +aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall, add @@ -559,6 +559,22 @@

          legacy-bundling

          will be preferred.

          +

          omit

          +
            +
          • Default: 'dev' if the NODE_ENV environment variable is set to +'production', otherwise empty.
          • +
          • Type: "dev", "optional", or "peer" (can be set multiple times)
          • +
          +

          Dependency types to omit from the installation tree on disk.

          +

          Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

          +

          If a package type appears in both the --include and --omit lists, then +it will be included.

          +

          If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

          + +

          strict-peer-deps

          • Default: false
          • @@ -590,20 +606,16 @@

            package-lock

            This configuration does not affect npm ci.

            -

            omit

            +

            foreground-scripts

              -
            • Default: 'dev' if the NODE_ENV environment variable is set to -'production', otherwise empty.
            • -
            • Type: "dev", "optional", or "peer" (can be set multiple times)
            • +
            • Default: false
            • +
            • Type: Boolean
            -

            Dependency types to omit from the installation tree on disk.

            -

            Note that these dependencies are still resolved and added to the -package-lock.json or npm-shrinkwrap.json file. They are just not -physically installed on disk.

            -

            If a package type appears in both the --include and --omit lists, then -it will be included.

            -

            If the resulting omit list includes 'dev', then the NODE_ENV environment -variable will be set to 'production' for all lifecycle scripts.

            +

            Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

            +

            Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

            ignore-scripts

            diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 2f28ede781f550..19bf6080bf1a86 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -166,7 +166,7 @@

            Description

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

            -
            npm@8.5.2 /path/to/npm
            +
            npm@8.5.5 /path/to/npm
             └─┬ init-package-json@0.0.4
               └── promzard@0.1.5
             
            diff --git a/deps/npm/docs/output/commands/npm-pkg.html b/deps/npm/docs/output/commands/npm-pkg.html index 4c34d4556eacef..221afc4e594b2b 100644 --- a/deps/npm/docs/output/commands/npm-pkg.html +++ b/deps/npm/docs/output/commands/npm-pkg.html @@ -152,6 +152,8 @@

            Table of contents

            npm pkg set <key>=<value> [<key>=<value> ...]
             npm pkg get [<key> [<key> ...]]
             npm pkg delete <key> [<key> ...]
            +npm pkg set [<array>[<index>].<key>=<value> ...]
            +npm pkg set [<array>[].<key>=<value> ...]
             
            @@ -284,6 +286,7 @@

            force

          • Allow conflicting peerDependencies to be installed in the root project.
          • Implicitly set --yes during npm init.
          • Allow clobbering existing values in npm pkg
          • +
          • Allow unpublishing of entire packages (not just a single version).

          If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

          diff --git a/deps/npm/docs/output/commands/npm-prune.html b/deps/npm/docs/output/commands/npm-prune.html index 942b4f94f8bdfa..08df537cf8c443 100644 --- a/deps/npm/docs/output/commands/npm-prune.html +++ b/deps/npm/docs/output/commands/npm-prune.html @@ -142,7 +142,7 @@

          npm-prune

          Table of contents

          - +

          Synopsis

          @@ -216,6 +216,30 @@

          json

          Not supported by all npm commands.

          +

          foreground-scripts

          +
            +
          • Default: false
          • +
          • Type: Boolean
          • +
          +

          Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

          +

          Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

          + + +

          ignore-scripts

          +
            +
          • Default: false
          • +
          • Type: Boolean
          • +
          +

          If true, npm does not run scripts specified in package.json files.

          +

          Note that commands explicitly intended to run a particular script, such as +npm start, npm stop, npm restart, npm test, and npm run-script +will still run their intended script if ignore-scripts is set, but they +will not run any pre- or post-scripts.

          + +

          workspace

          • Default:
          • diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index 9e55f371c63bee..139d1591ed3efc 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -142,7 +142,7 @@

            npm-rebuild

            Table of contents

            - +

            Synopsis

            @@ -197,6 +197,18 @@ systems.

            +

            foreground-scripts

            +
              +
            • Default: false
            • +
            • Type: Boolean
            • +
            +

            Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

            +

            Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

            + +

            ignore-scripts

            • Default: false
            • diff --git a/deps/npm/docs/output/commands/npm-unpublish.html b/deps/npm/docs/output/commands/npm-unpublish.html index 857a08d7216324..21fafc89ebaacf 100644 --- a/deps/npm/docs/output/commands/npm-unpublish.html +++ b/deps/npm/docs/output/commands/npm-unpublish.html @@ -142,17 +142,19 @@

              npm-unpublish

              Table of contents

              - +

              Synopsis

              -

              To learn more about how the npm registry treats unpublish, see our unpublish policies

              -

              Unpublishing a single version of a package

              -
              npm unpublish [<@scope>/]<pkg>@<version>
              -
              -

              Unpublishing an entire package

              -
              npm unpublish [<@scope>/]<pkg> --force
              +
              +
              +
              +
              npm unpublish [<@scope>/]<pkg>[@<version>]
               
              + + + +

              To learn more about how the npm registry treats unpublish, see our unpublish policies

              Warning

              Consider using the deprecate command instead, if your intent is to encourage users to upgrade, or if you no longer @@ -207,6 +209,7 @@

              force

            • Allow conflicting peerDependencies to be installed in the root project.
            • Implicitly set --yes during npm init.
            • Allow clobbering existing values in npm pkg
            • +
            • Allow unpublishing of entire packages (not just a single version).

            If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

            diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html index 7a8df45f12c8fe..62e81a62dd2c20 100644 --- a/deps/npm/docs/output/commands/npm-update.html +++ b/deps/npm/docs/output/commands/npm-update.html @@ -142,7 +142,7 @@

            npm-update

            Table of contents

            - +

            Synopsis

            @@ -260,6 +260,18 @@

            Configuration

            +

            save

            +
              +
            • Default: true unless when using npm update or npm dedupe where it +defaults to false
            • +
            • Type: Boolean
            • +
            +

            Save installed packages to a package.json file as dependencies.

            +

            When used with the npm rm command, removes the dependency from +package.json.

            +

            Will also prevent writing to package-lock.json if set to false.

            + +

            global

            • Default: false
            • @@ -300,6 +312,22 @@

              legacy-bundling

              will be preferred.

              +

              omit

              +
                +
              • Default: 'dev' if the NODE_ENV environment variable is set to +'production', otherwise empty.
              • +
              • Type: "dev", "optional", or "peer" (can be set multiple times)
              • +
              +

              Dependency types to omit from the installation tree on disk.

              +

              Note that these dependencies are still resolved and added to the +package-lock.json or npm-shrinkwrap.json file. They are just not +physically installed on disk.

              +

              If a package type appears in both the --include and --omit lists, then +it will be included.

              +

              If the resulting omit list includes 'dev', then the NODE_ENV environment +variable will be set to 'production' for all lifecycle scripts.

              + +

              strict-peer-deps

              • Default: false
              • @@ -331,32 +359,16 @@

                package-lock

                This configuration does not affect npm ci.

                -

                save

                +

                foreground-scripts

                  -
                • Default: true unless when using npm update or npm dedupe where it -defaults to false
                • +
                • Default: false
                • Type: Boolean
                -

                Save installed packages to a package.json file as dependencies.

                -

                When used with the npm rm command, removes the dependency from -package.json.

                -

                Will also prevent writing to package-lock.json if set to false.

                - - -

                omit

                -
                  -
                • Default: 'dev' if the NODE_ENV environment variable is set to -'production', otherwise empty.
                • -
                • Type: "dev", "optional", or "peer" (can be set multiple times)
                • -
                -

                Dependency types to omit from the installation tree on disk.

                -

                Note that these dependencies are still resolved and added to the -package-lock.json or npm-shrinkwrap.json file. They are just not -physically installed on disk.

                -

                If a package type appears in both the --include and --omit lists, then -it will be included.

                -

                If the resulting omit list includes 'dev', then the NODE_ENV environment -variable will be set to 'production' for all lifecycle scripts.

                +

                Run all build scripts (ie, preinstall, install, and postinstall) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process.

                +

                Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging.

                ignore-scripts

                diff --git a/deps/npm/docs/output/commands/npm-version.html b/deps/npm/docs/output/commands/npm-version.html index 34eeb4dc7d1862..a4e8ff6dbdc0b4 100644 --- a/deps/npm/docs/output/commands/npm-version.html +++ b/deps/npm/docs/output/commands/npm-version.html @@ -182,7 +182,8 @@

                git-tag-version

              • Default: true
              • Type: Boolean
              -

              Tag the commit when using the npm version command.

              +

              Tag the commit when using the npm version command. Setting this to false +results in no commit being made at all.

              json

              diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 7059fa5d37a387..8690cdc621a88f 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@

              Table of contents

              Version

              -

              8.5.2

              +

              8.5.5

              Description

              npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 9aed0d3070d90e..b318eee5795193 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -391,7 +391,7 @@

              main

              This should be a module relative to the root of your package folder.

              For most modules, it makes the most sense to have a main script and often not much else.

              -

              If main is not set it defaults to index.js in the packages root folder.

              +

              If main is not set it defaults to index.js in the package's root folder.

              browser

              If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might @@ -663,6 +663,9 @@

              Local Paths

              This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing packages to the public registry.

              +

              note: Packages linked by local path will not have their own +dependencies installed when npm install is ran in this case. You must +run npm install from inside the local path itself.

              devDependencies

              If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index ef5a0f92634dc0..66f848bf6fdcde 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -639,6 +639,7 @@

              force

            • Allow conflicting peerDependencies to be installed in the root project.
            • Implicitly set --yes during npm init.
            • Allow clobbering existing values in npm pkg
            • +
            • Allow unpublishing of entire packages (not just a single version).

            If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option!

            @@ -688,7 +689,8 @@

            git-tag-version

          • Default: true
          • Type: Boolean
          -

          Tag the commit when using the npm version command.

          +

          Tag the commit when using the npm version command. Setting this to false +results in no commit being made at all.

          global

          diff --git a/deps/npm/lib/arborist-cmd.js b/deps/npm/lib/arborist-cmd.js index 931ead8143dff9..6518e91e0ad9d7 100644 --- a/deps/npm/lib/arborist-cmd.js +++ b/deps/npm/lib/arborist-cmd.js @@ -14,6 +14,8 @@ class ArboristCmd extends BaseCommand { 'include-workspace-root', ] + static ignoreImplicitWorkspace = false + async execWorkspaces (args, filters) { await this.setWorkspaces(filters) return this.exec(args) diff --git a/deps/npm/lib/base-command.js b/deps/npm/lib/base-command.js index f67f99f36367c1..b6e3d6d2318606 100644 --- a/deps/npm/lib/base-command.js +++ b/deps/npm/lib/base-command.js @@ -20,6 +20,10 @@ class BaseCommand { return this.constructor.description } + get ignoreImplicitWorkspace () { + return this.constructor.ignoreImplicitWorkspace + } + get usage () { let usage = `npm ${this.constructor.name}\n\n` if (this.constructor.description) { diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js index 206d6de9c22c43..bc8ce48bacdad5 100644 --- a/deps/npm/lib/commands/access.js +++ b/deps/npm/lib/commands/access.js @@ -27,6 +27,8 @@ class Access extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = true + static usage = [ 'public []', 'restricted []', diff --git a/deps/npm/lib/commands/adduser.js b/deps/npm/lib/commands/adduser.js index cbeaaaf0f28bed..755abea8eb9ebe 100644 --- a/deps/npm/lib/commands/adduser.js +++ b/deps/npm/lib/commands/adduser.js @@ -16,6 +16,8 @@ class AddUser extends BaseCommand { 'scope', ] + static ignoreImplicitWorkspace = true + async exec (args) { const { scope } = this.npm.flatOptions const registry = this.getRegistry(this.npm.flatOptions) diff --git a/deps/npm/lib/commands/audit.js b/deps/npm/lib/commands/audit.js index fad43fe902df9f..08d011d8318751 100644 --- a/deps/npm/lib/commands/audit.js +++ b/deps/npm/lib/commands/audit.js @@ -14,6 +14,8 @@ class Audit extends ArboristWorkspaceCmd { 'json', 'package-lock-only', 'omit', + 'foreground-scripts', + 'ignore-scripts', ...super.params, ] diff --git a/deps/npm/lib/commands/bin.js b/deps/npm/lib/commands/bin.js index bb700d45a8f1b4..77028f06dd49a8 100644 --- a/deps/npm/lib/commands/bin.js +++ b/deps/npm/lib/commands/bin.js @@ -5,6 +5,7 @@ class Bin extends BaseCommand { static description = 'Display npm bin folder' static name = 'bin' static params = ['global'] + static ignoreImplicitWorkspace = true async exec (args) { const b = this.npm.bin diff --git a/deps/npm/lib/commands/birthday.js b/deps/npm/lib/commands/birthday.js index 27fe2c50cab021..e889b39f253779 100644 --- a/deps/npm/lib/commands/birthday.js +++ b/deps/npm/lib/commands/birthday.js @@ -2,6 +2,8 @@ const BaseCommand = require('../base-command.js') class Birthday extends BaseCommand { static name = 'birthday' + static ignoreImplicitWorkspace = true + async exec () { this.npm.config.set('yes', true) return this.npm.exec('exec', ['@npmcli/npm-birthday']) diff --git a/deps/npm/lib/commands/bugs.js b/deps/npm/lib/commands/bugs.js index 5dfd1eb9189594..f6218f033f3d3d 100644 --- a/deps/npm/lib/commands/bugs.js +++ b/deps/npm/lib/commands/bugs.js @@ -9,6 +9,7 @@ class Bugs extends BaseCommand { static name = 'bugs' static usage = ['[]'] static params = ['browser', 'registry'] + static ignoreImplicitWorkspace = true async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js index ecb34cb8916c43..b8f84abc1d9412 100644 --- a/deps/npm/lib/commands/cache.js +++ b/deps/npm/lib/commands/cache.js @@ -81,6 +81,8 @@ class Cache extends BaseCommand { 'verify', ] + static ignoreImplicitWorkspace = true + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length === 2) { diff --git a/deps/npm/lib/commands/ci.js b/deps/npm/lib/commands/ci.js index e054bee51679c7..eb1e02bcdc7241 100644 --- a/deps/npm/lib/commands/ci.js +++ b/deps/npm/lib/commands/ci.js @@ -24,6 +24,7 @@ class CI extends ArboristWorkspaceCmd { static name = 'ci' static params = [ 'audit', + 'foreground-scripts', 'ignore-scripts', 'script-shell', ] diff --git a/deps/npm/lib/commands/completion.js b/deps/npm/lib/commands/completion.js index 4ded2de385afba..0317753a15aaff 100644 --- a/deps/npm/lib/commands/completion.js +++ b/deps/npm/lib/commands/completion.js @@ -47,6 +47,7 @@ const BaseCommand = require('../base-command.js') class Completion extends BaseCommand { static description = 'Tab Completion for npm' static name = 'completion' + static ignoreImplicitWorkspace = false // completion for the completion command async completion (opts) { diff --git a/deps/npm/lib/commands/config.js b/deps/npm/lib/commands/config.js index 96524e00817f5d..690a69a3233e4f 100644 --- a/deps/npm/lib/commands/config.js +++ b/deps/npm/lib/commands/config.js @@ -61,6 +61,8 @@ class Config extends BaseCommand { 'long', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv[1] !== 'config') { diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js index 839e974caf09b7..88eb320c32a523 100644 --- a/deps/npm/lib/commands/deprecate.js +++ b/deps/npm/lib/commands/deprecate.js @@ -15,6 +15,8 @@ class Deprecate extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = false + async completion (opts) { if (opts.conf.argv.remain.length > 1) { return [] diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js index d737a58dc43d8d..ff942cc44e9460 100644 --- a/deps/npm/lib/commands/diff.js +++ b/deps/npm/lib/commands/diff.js @@ -32,6 +32,8 @@ class Diff extends BaseCommand { 'include-workspace-root', ] + static ignoreImplicitWorkspace = false + async exec (args) { const specs = this.npm.config.get('diff').filter(d => d) if (specs.length > 2) { diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js index bb36f3f72bfb2d..3b82c5194cca82 100644 --- a/deps/npm/lib/commands/dist-tag.js +++ b/deps/npm/lib/commands/dist-tag.js @@ -16,6 +16,8 @@ class DistTag extends BaseCommand { 'ls []', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length === 2) { diff --git a/deps/npm/lib/commands/docs.js b/deps/npm/lib/commands/docs.js index 19cd7356422625..631615acc56b3d 100644 --- a/deps/npm/lib/commands/docs.js +++ b/deps/npm/lib/commands/docs.js @@ -15,6 +15,7 @@ class Docs extends BaseCommand { ] static usage = ['[ [ ...]]'] + static ignoreImplicitWorkspace = false async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/doctor.js b/deps/npm/lib/commands/doctor.js index 508faa57aa5e93..630150c0886fed 100644 --- a/deps/npm/lib/commands/doctor.js +++ b/deps/npm/lib/commands/doctor.js @@ -10,7 +10,6 @@ const semver = require('semver') const { promisify } = require('util') const log = require('../utils/log-shim.js') const ansiTrim = require('../utils/ansi-trim.js') -const isWindows = require('../utils/is-windows.js') const ping = require('../utils/ping.js') const { registry: { default: defaultRegistry }, @@ -41,6 +40,7 @@ class Doctor extends BaseCommand { static description = 'Check your npm environment' static name = 'doctor' static params = ['registry'] + static ignoreImplicitWorkspace = false async exec (args) { log.info('Running checkup') @@ -54,32 +54,36 @@ class Doctor extends BaseCommand { ['node -v', 'getLatestNodejsVersion', []], ['npm config get registry', 'checkNpmRegistry', []], ['which git', 'getGitPath', []], - ...(isWindows + ...(process.platform === 'win32' ? [] : [ - ['Perms check on cached files', 'checkFilesPermission', [this.npm.cache, true, R_OK]], [ + 'Perms check on cached files', + 'checkFilesPermission', + [this.npm.cache, true, R_OK], + ], [ 'Perms check on local node_modules', 'checkFilesPermission', - [this.npm.localDir, true], - ], - [ + [this.npm.localDir, true, R_OK | W_OK, true], + ], [ 'Perms check on global node_modules', 'checkFilesPermission', - [this.npm.globalDir, false], - ], - [ + [this.npm.globalDir, false, R_OK], + ], [ 'Perms check on local bin folder', 'checkFilesPermission', - [this.npm.localBin, false, R_OK | W_OK | X_OK], - ], - [ + [this.npm.localBin, false, R_OK | W_OK | X_OK, true], + ], [ 'Perms check on global bin folder', 'checkFilesPermission', [this.npm.globalBin, false, X_OK], ], ]), - ['Verify cache contents', 'verifyCachedFiles', [this.npm.flatOptions.cache]], + [ + 'Verify cache contents', + 'verifyCachedFiles', + [this.npm.flatOptions.cache], + ], // TODO: // - ensure arborist.loadActual() runs without errors and no invalid edges // - ensure package-lock.json matches loadActual() @@ -128,6 +132,7 @@ class Doctor extends BaseCommand { if (!this.npm.silent) { this.npm.output(table(outTable, tableOpts)) if (!allOk) { + // TODO is this really needed? console.error('') } } @@ -140,7 +145,7 @@ class Doctor extends BaseCommand { const tracker = log.newItem('checkPing', 1) tracker.info('checkPing', 'Pinging registry') try { - await ping(this.npm.flatOptions) + await ping({ ...this.npm.flatOptions, retry: false }) return '' } catch (er) { if (/^E\d{3}$/.test(er.code || '')) { @@ -200,11 +205,7 @@ class Doctor extends BaseCommand { } } - async checkFilesPermission (root, shouldOwn, mask = null) { - if (mask === null) { - mask = shouldOwn ? R_OK | W_OK : R_OK - } - + async checkFilesPermission (root, shouldOwn, mask, missingOk) { let ok = true const tracker = log.newItem(root, 1) @@ -216,8 +217,11 @@ class Doctor extends BaseCommand { for (const f of files) { tracker.silly('checkFilesPermission', f.substr(root.length + 1)) const st = await lstat(f).catch(er => { - ok = false - tracker.warn('checkFilesPermission', 'error getting info for ' + f) + // if it can't be missing, or if it can and the error wasn't that it was missing + if (!missingOk || er.code !== 'ENOENT') { + ok = false + tracker.warn('checkFilesPermission', 'error getting info for ' + f) + } }) tracker.completeWork(1) diff --git a/deps/npm/lib/commands/edit.js b/deps/npm/lib/commands/edit.js index 5f069c4f132e58..ce74ff79b2b7ea 100644 --- a/deps/npm/lib/commands/edit.js +++ b/deps/npm/lib/commands/edit.js @@ -13,6 +13,7 @@ class Edit extends BaseCommand { static name = 'edit' static usage = ['[/...]'] static params = ['editor'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/exec.js b/deps/npm/lib/commands/exec.js index 52fb1f8eb72298..6b402c856ab1e9 100644 --- a/deps/npm/lib/commands/exec.js +++ b/deps/npm/lib/commands/exec.js @@ -45,6 +45,8 @@ class Exec extends BaseCommand { '--package=foo -c \' [args...]\'', ] + static ignoreImplicitWorkspace = false + async exec (_args, { locationMsg, path, runPath } = {}) { if (!path) { path = this.npm.localPrefix diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js index fd62b87fc869d5..ca6ee7540bc916 100644 --- a/deps/npm/lib/commands/explain.js +++ b/deps/npm/lib/commands/explain.js @@ -16,6 +16,8 @@ class Explain extends ArboristWorkspaceCmd { 'workspace', ] + static ignoreImplicitWorkspace = false + // TODO /* istanbul ignore next */ async completion (opts) { diff --git a/deps/npm/lib/commands/explore.js b/deps/npm/lib/commands/explore.js index 90e6af69fe57ca..5b97673b90eaa9 100644 --- a/deps/npm/lib/commands/explore.js +++ b/deps/npm/lib/commands/explore.js @@ -13,6 +13,7 @@ class Explore extends BaseCommand { static name = 'explore' static usage = [' [ -- ]'] static params = ['shell'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/get.js b/deps/npm/lib/commands/get.js index 7583ade23d600a..5e92e85a66382f 100644 --- a/deps/npm/lib/commands/get.js +++ b/deps/npm/lib/commands/get.js @@ -4,6 +4,7 @@ class Get extends BaseCommand { static description = 'Get a value from the npm configuration' static name = 'get' static usage = ['[ ...] (See `npm config`)'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/help-search.js b/deps/npm/lib/commands/help-search.js index 6025a6dabd74b5..9422b83561cc89 100644 --- a/deps/npm/lib/commands/help-search.js +++ b/deps/npm/lib/commands/help-search.js @@ -11,6 +11,7 @@ class HelpSearch extends BaseCommand { static name = 'help-search' static usage = [''] static params = ['long'] + static ignoreImplicitWorkspace = true async exec (args) { if (!args.length) { diff --git a/deps/npm/lib/commands/help.js b/deps/npm/lib/commands/help.js index f94178dd5d1d6c..40f5ad9b300926 100644 --- a/deps/npm/lib/commands/help.js +++ b/deps/npm/lib/commands/help.js @@ -17,6 +17,7 @@ class Help extends BaseCommand { static name = 'help' static usage = [' []'] static params = ['viewer'] + static ignoreImplicitWorkspace = true async completion (opts) { if (opts.conf.argv.remain.length > 2) { diff --git a/deps/npm/lib/commands/hook.js b/deps/npm/lib/commands/hook.js index 2ff6ac01ce5272..a4619802d84298 100644 --- a/deps/npm/lib/commands/hook.js +++ b/deps/npm/lib/commands/hook.js @@ -19,6 +19,8 @@ class Hook extends BaseCommand { 'update ', ] + static ignoreImplicitWorkspace = true + async exec (args) { return otplease({ ...this.npm.flatOptions, diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js index 367533f8259f51..2a6b6aaddc7e65 100644 --- a/deps/npm/lib/commands/init.js +++ b/deps/npm/lib/commands/init.js @@ -22,6 +22,8 @@ class Init extends BaseCommand { '[<@scope>/] (same as `npx [<@scope>/]create-`)', ] + static ignoreImplicitWorkspace = false + async exec (args) { // npm exec style if (args.length) { diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js index 61526abb7879b1..ebba02a1bd47d0 100644 --- a/deps/npm/lib/commands/install.js +++ b/deps/npm/lib/commands/install.js @@ -14,15 +14,18 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js') class Install extends ArboristWorkspaceCmd { static description = 'Install a package' static name = 'install' + + // These are in the order they will show up in when running "-h" static params = [ 'save', 'save-exact', 'global', 'global-style', 'legacy-bundling', + 'omit', 'strict-peer-deps', 'package-lock', - 'omit', + 'foreground-scripts', 'ignore-scripts', 'audit', 'bin-links', diff --git a/deps/npm/lib/commands/logout.js b/deps/npm/lib/commands/logout.js index aea5e93652b0e8..7c2a7f0b2f830d 100644 --- a/deps/npm/lib/commands/logout.js +++ b/deps/npm/lib/commands/logout.js @@ -11,6 +11,8 @@ class Logout extends BaseCommand { 'scope', ] + static ignoreImplicitWorkspace = true + async exec (args) { const registry = this.npm.config.get('registry') const scope = this.npm.config.get('scope') diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index 8c338c0647586d..e56c90dae16eaf 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -95,10 +95,15 @@ class LS extends ArboristWorkspaceCmd { return true } + if (this.npm.flatOptions.includeWorkspaceRoot + && !edge.to.isWorkspace) { + return true + } + if (edge.from.isProjectRoot) { - return edge.to && - edge.to.isWorkspace && - wsNodes.includes(edge.to.target) + return (edge.to + && edge.to.isWorkspace + && wsNodes.includes(edge.to.target)) } return true diff --git a/deps/npm/lib/commands/org.js b/deps/npm/lib/commands/org.js index f3d344ca33e3d8..e2202a9e9cf3b4 100644 --- a/deps/npm/lib/commands/org.js +++ b/deps/npm/lib/commands/org.js @@ -13,6 +13,7 @@ class Org extends BaseCommand { ] static params = ['registry', 'otp', 'json', 'parseable'] + static ignoreImplicitWorkspace = true async completion (opts) { const argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index effaaa6a53d3a8..e74efac1baf6a2 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -20,6 +20,8 @@ class Owner extends BaseCommand { 'ls [<@scope>/]', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length > 3) { @@ -57,60 +59,39 @@ class Owner extends BaseCommand { } async exec ([action, ...args]) { - const opts = { - ...this.npm.flatOptions, - } switch (action) { case 'ls': case 'list': - return this.ls(args[0], opts) + return this.ls(args[0]) case 'add': - return this.add(args[0], args[1], opts) + return this.changeOwners(args[0], args[1], 'add') case 'rm': case 'remove': - return this.rm(args[0], args[1], opts) + return this.changeOwners(args[0], args[1], 'rm') default: throw this.usageError() } } - async ls (pkg, opts) { - if (!pkg) { - if (this.npm.config.get('global')) { - throw this.usageError() - } - - const pkgName = await readLocalPkgName(this.npm.prefix) - if (!pkgName) { - throw this.usageError() - } - - pkg = pkgName - } - + async ls (pkg) { + pkg = await this.getPkg(pkg) const spec = npa(pkg) try { - const packumentOpts = { ...opts, fullMetadata: true } + const packumentOpts = { ...this.npm.flatOptions, fullMetadata: true, preferOnline: true } const { maintainers } = await pacote.packument(spec, packumentOpts) if (!maintainers || !maintainers.length) { this.npm.output('no admin found') } else { - this.npm.output(maintainers.map(o => `${o.name} <${o.email}>`).join('\n')) + this.npm.output(maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) } - - return maintainers } catch (err) { log.error('owner ls', "Couldn't get owner data", pkg) throw err } } - async add (user, pkg, opts) { - if (!user) { - throw this.usageError() - } - + async getPkg (pkg) { if (!pkg) { if (this.npm.config.get('global')) { throw this.usageError() @@ -120,44 +101,25 @@ class Owner extends BaseCommand { throw this.usageError() } - pkg = pkgName + return pkgName } - log.verbose('owner add', '%s to %s', user, pkg) - - const spec = npa(pkg) - return this.putOwners(spec, user, opts, - (newOwner, owners) => this.validateAddOwner(newOwner, owners)) + return pkg } - async rm (user, pkg, opts) { + async changeOwners (user, pkg, addOrRm) { if (!user) { throw this.usageError() } - if (!pkg) { - if (this.npm.config.get('global')) { - throw this.usageError() - } - const pkgName = await readLocalPkgName(this.npm.prefix) - if (!pkgName) { - throw this.usageError() - } - - pkg = pkgName - } - log.verbose('owner rm', '%s from %s', user, pkg) + pkg = await this.getPkg(pkg) + log.verbose(`owner ${addOrRm}`, '%s to %s', user, pkg) const spec = npa(pkg) - return this.putOwners(spec, user, opts, - (rmOwner, owners) => this.validateRmOwner(rmOwner, owners)) - } - - async putOwners (spec, user, opts, validation) { const uri = `/-/user/org.couchdb.user:${encodeURIComponent(user)}` - let u = '' + let u try { - u = await npmFetch.json(uri, opts) + u = await npmFetch.json(uri, this.npm.flatOptions) } catch (err) { log.error('owner mutate', `Error getting user data for ${user}`) throw err @@ -175,36 +137,64 @@ class Owner extends BaseCommand { // normalize user data u = { name: u.name, email: u.email } - const data = await pacote.packument(spec, { ...opts, fullMetadata: true }) + const data = await pacote.packument(spec, { + ...this.npm.flatOptions, + fullMetadata: true, + preferOnline: true, + }) - // save the number of maintainers before validation for comparison - const before = data.maintainers ? data.maintainers.length : 0 + const owners = data.maintainers || [] + let maintainers + if (addOrRm === 'add') { + const existing = owners.find(o => o.name === u.name) + if (existing) { + log.info( + 'owner add', + `Already a package owner: ${existing.name} <${existing.email}>` + ) + return + } + maintainers = [ + ...owners, + u, + ] + } else { + maintainers = owners.filter(o => o.name !== u.name) - const m = validation(u, data.maintainers) - if (!m) { - return - } // invalid owners + if (maintainers.length === owners.length) { + log.info('owner rm', 'Not a package owner: ' + u.name) + return false + } - const body = { - _id: data._id, - _rev: data._rev, - maintainers: m, + if (!maintainers.length) { + throw Object.assign( + new Error( + 'Cannot remove all owners of a package. Add someone else first.' + ), + { code: 'EOWNERRM' } + ) + } } + const dataPath = `/${spec.escapedName}/-rev/${encodeURIComponent(data._rev)}` - const res = await otplease(opts, opts => { + const res = await otplease(this.npm.flatOptions, opts => { return npmFetch.json(dataPath, { ...opts, method: 'PUT', - body, + body: { + _id: data._id, + _rev: data._rev, + maintainers, + }, spec, }) }) if (!res.error) { - if (m.length < before) { - this.npm.output(`- ${user} (${spec.name})`) - } else { + if (addOrRm === 'add') { this.npm.output(`+ ${user} (${spec.name})`) + } else { + this.npm.output(`- ${user} (${spec.name})`) } } else { throw Object.assign( @@ -214,47 +204,6 @@ class Owner extends BaseCommand { } return res } - - validateAddOwner (newOwner, owners) { - owners = owners || [] - for (const o of owners) { - if (o.name === newOwner.name) { - log.info( - 'owner add', - 'Already a package owner: ' + o.name + ' <' + o.email + '>' - ) - return false - } - } - return [ - ...owners, - newOwner, - ] - } - - validateRmOwner (rmOwner, owners) { - let found = false - const m = owners.filter(function (o) { - var match = (o.name === rmOwner.name) - found = found || match - return !match - }) - - if (!found) { - log.info('owner rm', 'Not a package owner: ' + rmOwner.name) - return false - } - - if (!m.length) { - throw Object.assign( - new Error( - 'Cannot remove all owners of a package. Add someone else first.' - ), - { code: 'EOWNERRM' } - ) - } - - return m - } } + module.exports = Owner diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js index 74c29699a05c90..41fef5cb45a47c 100644 --- a/deps/npm/lib/commands/pack.js +++ b/deps/npm/lib/commands/pack.js @@ -18,6 +18,7 @@ class Pack extends BaseCommand { ] static usage = ['[[<@scope>/]...]'] + static ignoreImplicitWorkspace = false async exec (args) { if (args.length === 0) { diff --git a/deps/npm/lib/commands/ping.js b/deps/npm/lib/commands/ping.js index 5a651c4a6ab096..22039214689a96 100644 --- a/deps/npm/lib/commands/ping.js +++ b/deps/npm/lib/commands/ping.js @@ -6,6 +6,7 @@ class Ping extends BaseCommand { static description = 'Ping npm registry' static params = ['registry'] static name = 'ping' + static ignoreImplicitWorkspace = true async exec (args) { log.notice('PING', this.npm.config.get('registry')) diff --git a/deps/npm/lib/commands/pkg.js b/deps/npm/lib/commands/pkg.js index 6ca892293cebec..3a8e01f65bc921 100644 --- a/deps/npm/lib/commands/pkg.js +++ b/deps/npm/lib/commands/pkg.js @@ -20,6 +20,8 @@ class Pkg extends BaseCommand { 'workspaces', ] + static ignoreImplicitWorkspace = false + async exec (args, { prefix } = {}) { if (!prefix) { this.prefix = this.npm.localPrefix diff --git a/deps/npm/lib/commands/prefix.js b/deps/npm/lib/commands/prefix.js index 264b819fc7692a..dd0e34c3d3bd95 100644 --- a/deps/npm/lib/commands/prefix.js +++ b/deps/npm/lib/commands/prefix.js @@ -5,6 +5,7 @@ class Prefix extends BaseCommand { static name = 'prefix' static params = ['global'] static usage = ['[-g]'] + static ignoreImplicitWorkspace = true async exec (args) { return this.npm.output(this.npm.prefix) diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js index 6b4d1407f7919a..a82d31fd443a9e 100644 --- a/deps/npm/lib/commands/profile.js +++ b/deps/npm/lib/commands/profile.js @@ -54,6 +54,8 @@ class Profile extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = true + async completion (opts) { var argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/prune.js b/deps/npm/lib/commands/prune.js index 16c8b6d4329ac1..ee2c30553f1c5a 100644 --- a/deps/npm/lib/commands/prune.js +++ b/deps/npm/lib/commands/prune.js @@ -6,7 +6,15 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js') class Prune extends ArboristWorkspaceCmd { static description = 'Remove extraneous packages' static name = 'prune' - static params = ['omit', 'dry-run', 'json', ...super.params] + static params = [ + 'omit', + 'dry-run', + 'json', + 'foreground-scripts', + 'ignore-scripts', + ...super.params, + ] + static usage = ['[[<@scope>/]...]'] async exec () { diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index d1f0ee743cfcc3..1f26370e89a567 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -39,6 +39,7 @@ class Publish extends BaseCommand { ] static usage = ['[]'] + static ignoreImplicitWorkspace = false async exec (args) { if (args.length === 0) { @@ -195,7 +196,11 @@ class Publish extends BaseCommand { if (spec.type === 'directory') { return readJson(`${spec.fetchSpec}/package.json`) } - return pacote.manifest(spec, { ...opts, fullMetadata: true }) + return pacote.manifest(spec, { + ...opts, + fullMetadata: true, + fullReadJson: true, + }) } } module.exports = Publish diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js index 471d60b740df11..0e8a1510bde2b3 100644 --- a/deps/npm/lib/commands/rebuild.js +++ b/deps/npm/lib/commands/rebuild.js @@ -11,6 +11,7 @@ class Rebuild extends ArboristWorkspaceCmd { static params = [ 'global', 'bin-links', + 'foreground-scripts', 'ignore-scripts', ...super.params, ] diff --git a/deps/npm/lib/commands/repo.js b/deps/npm/lib/commands/repo.js index 8ac4178f261ee1..b8dccc209ff87a 100644 --- a/deps/npm/lib/commands/repo.js +++ b/deps/npm/lib/commands/repo.js @@ -10,6 +10,7 @@ class Repo extends BaseCommand { static name = 'repo' static params = ['browser', 'workspace', 'workspaces', 'include-workspace-root'] static usage = ['[ [ ...]]'] + static ignoreImplicitWorkspace = false async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/restart.js b/deps/npm/lib/commands/restart.js index a12368644a13b3..575928b2202cc8 100644 --- a/deps/npm/lib/commands/restart.js +++ b/deps/npm/lib/commands/restart.js @@ -8,5 +8,7 @@ class Restart extends LifecycleCmd { 'ignore-scripts', 'script-shell', ] + + static ignoreImplicitWorkspace = false } module.exports = Restart diff --git a/deps/npm/lib/commands/root.js b/deps/npm/lib/commands/root.js index 7749c602456b77..b814034def5ab6 100644 --- a/deps/npm/lib/commands/root.js +++ b/deps/npm/lib/commands/root.js @@ -3,6 +3,7 @@ class Root extends BaseCommand { static description = 'Display npm root' static name = 'root' static params = ['global'] + static ignoreImplicitWorkspace = true async exec () { this.npm.output(this.npm.dir) diff --git a/deps/npm/lib/commands/run-script.js b/deps/npm/lib/commands/run-script.js index edba95821b44c2..74757e984aeedd 100644 --- a/deps/npm/lib/commands/run-script.js +++ b/deps/npm/lib/commands/run-script.js @@ -40,6 +40,7 @@ class RunScript extends BaseCommand { static name = 'run-script' static usage = [' [-- ]'] + static ignoreImplicitWorkspace = false async completion (opts) { const argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/search.js b/deps/npm/lib/commands/search.js index bdeeffe816980f..a06ba4031443b4 100644 --- a/deps/npm/lib/commands/search.js +++ b/deps/npm/lib/commands/search.js @@ -44,6 +44,7 @@ class Search extends BaseCommand { ] static usage = ['[search terms ...]'] + static ignoreImplicitWorkspace = true async exec (args) { const opts = { diff --git a/deps/npm/lib/commands/set-script.js b/deps/npm/lib/commands/set-script.js index 7c73ff01b9396e..a6b7c3a50cdafe 100644 --- a/deps/npm/lib/commands/set-script.js +++ b/deps/npm/lib/commands/set-script.js @@ -9,6 +9,7 @@ class SetScript extends BaseCommand { static params = ['workspace', 'workspaces', 'include-workspace-root'] static name = 'set-script' static usage = ['[