diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4170038a0ac0fc..6d69bbf54be1d6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -107,10 +107,8 @@ /benchmark/misc/startup.js @nodejs/startup /src/node.cc @nodejs/startup -/src/node_code_cache_stub.cc @nodejs/startup /src/node_native_module* @nodejs/startup /lib/internal/bootstrap/* @nodejs/startup -/tools/code_cache/* @nodejs/startup /tools/snapshot/* @nodejs/startup # V8 diff --git a/.github/label-pr-config.yml b/.github/label-pr-config.yml index a8d22980f6db18..5f83de231262a5 100644 --- a/.github/label-pr-config.yml +++ b/.github/label-pr-config.yml @@ -67,7 +67,7 @@ subSystemLabels: /^tools\/make-v8/: tools, v8 engine, needs-ci /^tools\/v8_gypfiles/: tools, v8 engine, needs-ci /^tools\/(code_cache|snapshot)/: needs-ci - /^tools\/build-addons.js/: needs-ci + /^tools\/build-addons.mjs/: needs-ci # all other tool changes should be marked as such /^tools\//: tools /^\.eslint|\.remark|\.editorconfig/: tools diff --git a/.github/workflows/authors.yml b/.github/workflows/authors.yml index ffd169df9b6ef5..01504ed227b419 100644 --- a/.github/workflows/authors.yml +++ b/.github/workflows/authors.yml @@ -15,7 +15,7 @@ jobs: with: fetch-depth: '0' # This is required to actually get all the authors persist-credentials: false - - run: tools/update-authors.js # Run the AUTHORS tool + - run: tools/update-authors.mjs # Run the AUTHORS tool - uses: gr2m/create-or-update-pull-request-action@v1 # Create a PR or update the Action's existing PR env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} @@ -24,7 +24,7 @@ jobs: body: > Here are some new additions to the AUTHORS file. This is an automatically generated PR by the - `authors.yml` GitHub Action, which runs `tools/update-authors.js`. + `authors.yml` GitHub Action, which runs `tools/update-authors.mjs`. branch: actions/authors-update # Custom branch *just* for this Action. commit-message: 'meta: update AUTHORS' labels: meta diff --git a/.mailmap b/.mailmap index 226c06fabb4db8..3143501352576a 100644 --- a/.mailmap +++ b/.mailmap @@ -89,6 +89,8 @@ Charles Charles Rudolph Chen Gang Chen Gang <13298548+MoonBall@users.noreply.github.com> +Chengzhong Wu +Chengzhong Wu Chew Choon Keat Chris Andrews Chris Johnson @@ -357,6 +359,8 @@ Mitar Milutinovic Mithun Sasidharan Mohammed Keyvanzadeh Mohammed Keyvanzadeh <62040526+VoltrexMaster@users.noreply.github.com> +Morgan Roderick +Morgan Roderick <20321+mroderick@users.noreply.github.com> MURAKAMI Masahiko Myles Borins Myles Borins @@ -374,6 +378,7 @@ Nitzan Uziely Nitzan Uziely Noah Rose Ledesma npm team +npm team npm team Oliver Chang Oluwaseun Omoyajowo @@ -381,6 +386,7 @@ OneNail Onne Gorter Oscar Martinez Paolo Insogna +Paolo Insogna Paul Graham Paul Querna Pedro Lima diff --git a/AUTHORS b/AUTHORS index 185e540e26a6ee..1fb28b09d3bb64 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2315,7 +2315,7 @@ Yongsheng Zhang Neeraj Laad Scott Van Gilder Yaniv Friedensohn -Lucas Woo +Chengzhong Wu Troels Liebe Bentsen pranshuchittora lakamsani @@ -3260,7 +3260,6 @@ Siddharth Cactysman David Brownman Michael Rommel -Chengzhong Wu Andres Jayden Seric divlo @@ -3460,5 +3459,6 @@ Sergey Nazaryev William Marlow Keyhan Vakil <60900335+airtable-keyhanvakil@users.noreply.github.com> Feng Yu +pupilTong -# Generated by tools/update-authors.js +# Generated by tools/update-authors.mjs diff --git a/BUILDING.md b/BUILDING.md index 16c15c77e1c58f..1e36403f53e454 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -99,25 +99,25 @@ Node.js does not support a platform version if a vendor has expired support for it. In other words, Node.js does not support running on End-of-Life (EoL) platforms. This is true regardless of entries in the table below. -| Operating System | Architectures | Versions | Support Type | Notes | -| ---------------- | ---------------- | --------------------------------- | ------------------------------------------- | ------------------------------------ | -| GNU/Linux | x64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | -| GNU/Linux | x64 | kernel >= 3.10, musl >= 1.1.19 | Experimental | e.g. Alpine 3.8 | -| GNU/Linux | x86 | kernel >= 3.10, glibc >= 2.17 | Experimental | Downgraded as of Node.js 10 | -| GNU/Linux | arm64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | -| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10 | -| GNU/Linux | armv6 | kernel >= 4.14, glibc >= 2.24 | Experimental | Downgraded as of Node.js 12 | -| GNU/Linux | ppc64le >=power8 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. Ubuntu 20.04, RHEL 8 | -| GNU/Linux | s390x | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 | -| Windows | x64 | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] | -| Windows | x86 | >= Windows 10/Server 2016 | Experimental | [^4] | -| Windows | x64, x86 | Windows 8.1/Server 2012 | Experimental | | -| Windows | arm64 | >= Windows 10 | Tier 2 (compiling) / Experimental (running) | | -| macOS | x64 | >= 10.15 | Tier 1 | For notes about compilation see [^5] | -| macOS | arm64 | >= 11 | Tier 1 | | -| SmartOS | x64 | >= 18 | Tier 2 | | -| AIX | ppc64be >=power8 | >= 7.2 TL04 | Tier 2 | | -| FreeBSD | x64 | >= 12.2 | Experimental | | +| Operating System | Architectures | Versions | Support Type | Notes | +| ---------------- | ---------------- | --------------------------------- | ----------------------------------------------- | ------------------------------------ | +| GNU/Linux | x64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | +| GNU/Linux | x64 | kernel >= 3.10, musl >= 1.1.19 | Experimental | e.g. Alpine 3.8 | +| GNU/Linux | x86 | kernel >= 3.10, glibc >= 2.17 | Experimental | Downgraded as of Node.js 10 | +| GNU/Linux | arm64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | +| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10 | +| GNU/Linux | armv6 | kernel >= 4.14, glibc >= 2.24 | Experimental | Downgraded as of Node.js 12 | +| GNU/Linux | ppc64le >=power8 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. Ubuntu 20.04, RHEL 8 | +| GNU/Linux | s390x | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 | +| Windows | x64, x86 (WoW64) | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] | +| Windows | x86 (native) | >= Windows 10/Server 2016 | Tier 1 (running) / Experimental (compiling)[^4] | | +| Windows | x64, x86 | Windows 8.1/Server 2012 | Experimental | | +| Windows | arm64 | >= Windows 10 | Tier 2 (compiling) / Experimental (running) | | +| macOS | x64 | >= 10.15 | Tier 1 | For notes about compilation see [^5] | +| macOS | arm64 | >= 11 | Tier 1 | | +| SmartOS | x64 | >= 18 | Tier 2 | | +| AIX | ppc64be >=power8 | >= 7.2 TL04 | Tier 2 | | +| FreeBSD | x64 | >= 12.2 | Experimental | | [^1]: Older kernel versions may work. However official Node.js release binaries are [built on RHEL 8 systems](#official-binary-platforms-and-toolchains) @@ -137,9 +137,10 @@ platforms. This is true regardless of entries in the table below. Windows binary (`node.exe`) in WSL will not work without workarounds such as stdio redirection. -[^4]: Compiling Node.js for x86 Windows is currently impossible due to - issues with version 10.1 of the V8 engine. Support will come back to its - previous status as soon as possible. +[^4]: Running Node.js on x86 Windows should work and binaries + are provided. However, tests in our infrastructure only run on WoW64. + Furthermore, compiling on x86 Windows is Experimental and + may not be possible. [^5]: Our macOS x64 Binaries are compiled with 10.15 as a target. Xcode11 is required to compile. @@ -538,7 +539,7 @@ When modifying only the JS layer in `lib`, it is possible to externally load it without modifying the executable: ```console -$ ./configure --node-builtin-modules-path $(pwd) +$ ./configure --node-builtin-modules-path "$(pwd)" ``` The resulting binary won't include any JS files and will try to load them from diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f9e24f60a6e29..810da903166883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,8 @@ release. -18.2.0
+18.3.0
+18.2.0
18.1.0
18.0.0
diff --git a/Makefile b/Makefile index 4aace77c7c8c63..9f7ab7129d0647 100644 --- a/Makefile +++ b/Makefile @@ -366,13 +366,13 @@ ADDONS_BINDING_SOURCES := \ $(filter-out test/addons/??_*/*.h, $(wildcard test/addons/*/*.h)) ADDONS_PREREQS := config.gypi \ - deps/npm/node_modules/node-gyp/package.json tools/build-addons.js \ + deps/npm/node_modules/node-gyp/package.json tools/build-addons.mjs \ deps/uv/include/*.h deps/v8/include/*.h \ src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h define run_build_addons env npm_config_loglevel=$(LOGLEVEL) npm_config_nodedir="$$PWD" \ - npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons" \ + npm_config_python="$(PYTHON)" $(NODE) "$$PWD/tools/build-addons.mjs" \ "$$PWD/deps/npm/node_modules/node-gyp/bin/node-gyp.js" \ $1 touch $2 @@ -679,7 +679,7 @@ ifneq ("","$(wildcard deps/v8/tools/run-tests.py)") # Related CI job: node-test-commit-v8-linux test-v8: v8 ## Runs the V8 test suite on deps/v8. export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) $(V8_TEST_OPTIONS) \ + $(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) $(V8_TEST_OPTIONS) \ mjsunit cctest debugger inspector message preparser \ $(TAP_V8) $(info Testing hash seed) @@ -687,13 +687,13 @@ test-v8: v8 ## Runs the V8 test suite on deps/v8. test-v8-intl: v8 export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ + $(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ intl \ $(TAP_V8_INTL) test-v8-benchmarks: v8 export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ + $(PYTHON) deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ benchmarks \ $(TAP_V8_BENCHMARKS) diff --git a/README.md b/README.md index 9582855fcf9355..f01bf3b675075e 100644 --- a/README.md +++ b/README.md @@ -683,6 +683,8 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` +* **RafaelGSS** <> + `890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4` * **Richard Lau** <> `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C` * **Rod Vagg** <> @@ -706,6 +708,7 @@ gpg --keyserver hkps://keys.openpgp.org --recv-keys 71DCFD284A79C3B38668286BC97E gpg --keyserver hkps://keys.openpgp.org --recv-keys 61FC681DFB92A079F1685E77973F295594EC4689 gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 gpg --keyserver hkps://keys.openpgp.org --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 +gpg --keyserver hkps://keys.openpgp.org --recv-keys 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 gpg --keyserver hkps://keys.openpgp.org --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C gpg --keyserver hkps://keys.openpgp.org --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D gpg --keyserver hkps://keys.openpgp.org --recv-keys A48C2BEE680E841632CD4E44F07496B3EB3C1762 diff --git a/SECURITY.md b/SECURITY.md index b22301a1f1d556..57943ce969e20b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,7 @@ Report security bugs in Node.js via [HackerOne](https://hackerone.com/nodejs). -Your report will be acknowledged within 5 days, and you’ll receive a more +Your report will be acknowledged within 5 days, and you'll receive a more detailed response to your report within 10 days indicating the next steps in handling your submission. @@ -49,7 +49,7 @@ Here is the security disclosure policy for Node.js * This process can take some time, especially when coordination is required with maintainers of other projects. Every effort will be made to handle the - bug in as timely a manner as possible; however, it’s important that we follow + bug in as timely a manner as possible; however, it's important that we follow the release process above to ensure that the disclosure is handled in a consistent manner. diff --git a/benchmark/error/error.js b/benchmark/error/error.js new file mode 100644 index 00000000000000..c856f3e07f6bea --- /dev/null +++ b/benchmark/error/error.js @@ -0,0 +1,14 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + n: [1e7], +}); + +function main({ n }) { + bench.start(); + for (let i = 0; i < n; ++i) + new Error('test'); + bench.end(n); +} diff --git a/benchmark/error/node-error.js b/benchmark/error/node-error.js new file mode 100644 index 00000000000000..f672522b2d0a65 --- /dev/null +++ b/benchmark/error/node-error.js @@ -0,0 +1,21 @@ +'use strict'; + +const common = require('../common'); + +const bench = common.createBenchmark(main, { + n: [1e7], +}, { + flags: ['--expose-internals'] +}); + +function main({ n }) { + const { + codes: { + ERR_INVALID_STATE, + } + } = require('internal/errors'); + bench.start(); + for (let i = 0; i < n; ++i) + new ERR_INVALID_STATE.TypeError('test'); + bench.end(n); +} diff --git a/common.gypi b/common.gypi index f2493726ef18f1..ecb5dd907f2b75 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.13', + 'v8_embedder_string': '-node.8', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index 17ff53ef645493..187c381660b369 100755 --- a/configure.py +++ b/configure.py @@ -1249,7 +1249,7 @@ def configure_node(o): o['variables']['node_use_node_snapshot'] = b( not cross_compiling and not options.shared) - if options.without_node_code_cache or options.node_builtin_modules_path: + if options.without_node_code_cache or options.without_node_snapshot or options.node_builtin_modules_path: o['variables']['node_use_node_code_cache'] = 'false' else: # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. diff --git a/deps/npm/README.md b/deps/npm/README.md index fdc80bc796a268..7e4a5f38a7607f 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -37,6 +37,7 @@ If you're looking to manage multiple versions of **`node`** &/or **`npm`**, cons * [**`nodenv`**](https://github.com/nodenv/nodenv) * [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs) * [**`nvm-windows`**](https://github.com/coreybutler/nvm-windows) +* [**`fnm`**](https://github.com/Schniz/fnm) ### Usage @@ -49,7 +50,7 @@ npm * [**Documentation**](https://docs.npmjs.com/) - Official docs & how-tos for all things **npm** * Note: you can also search docs locally with `npm help-search ` * [**Bug Tracker**](https://github.com/npm/cli/issues) - Search or submit bugs against the CLI -* [**Roadmap**](https://github.com/npm/roadmap) - Track & follow along with our public roadmap +* [**Roadmap**](https://github.com/orgs/github/projects/4247/views/1?filterQuery=npm) - Track & follow along with our public roadmap * [**Feedback**](https://github.com/npm/feedback) - Contribute ideas & discussion around the npm registry, website & CLI * [**RFCs**](https://github.com/npm/rfcs) - Contribute ideas & specifications for the API/design of the npm CLI * [**Service Status**](https://status.npmjs.org/) - Monitor the current status & see incident reports for the website & registry diff --git a/deps/npm/docs/content/commands/npm-bin.md b/deps/npm/docs/content/commands/npm-bin.md index 94b72cfd5c81ce..b344ea2fc94159 100644 --- a/deps/npm/docs/content/commands/npm-bin.md +++ b/deps/npm/docs/content/commands/npm-bin.md @@ -34,6 +34,8 @@ Print the folder where npm will install executables. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-bugs.md b/deps/npm/docs/content/commands/npm-bugs.md index aeddeb848e81b8..6b45f1f18ac660 100644 --- a/deps/npm/docs/content/commands/npm-bugs.md +++ b/deps/npm/docs/content/commands/npm-bugs.md @@ -11,7 +11,7 @@ description: Report bugs for a package in a web browser ```bash -npm bugs [] +npm bugs [ [ ...]] alias: issues ``` @@ -58,6 +58,68 @@ The base URL of the npm registry. +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + + + + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + + + + ### See Also diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 2bb542a725b5dc..3374bf1e25136b 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -1,7 +1,7 @@ --- title: npm-ci section: 1 -description: Install a project with a clean slate +description: Clean install a project --- ### Synopsis @@ -28,12 +28,7 @@ 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. -`npm ci` will be significantly faster when: - -- There is a `package-lock.json` or `npm-shrinkwrap.json` file. -- The `node_modules` folder is missing or empty. - -In short, the main differences between using `npm install` and `npm ci` are: +The main differences between using `npm install` and `npm ci` are: * The project **must** have an existing `package-lock.json` or `npm-shrinkwrap.json`. diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index a66a198ce42d17..809e42a1be1cdb 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -124,6 +124,8 @@ Not supported by all npm commands. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See @@ -156,6 +158,15 @@ The command to run for `npm edit` and `npm config edit`. When passed to `npm config` this refers to which config file to use. +When set to "global" mode, packages are installed into the `prefix` folder +instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + diff --git a/deps/npm/docs/content/commands/npm-diff.md b/deps/npm/docs/content/commands/npm-diff.md index 7dcc8af7c3b4c7..7183e4a2b752e3 100644 --- a/deps/npm/docs/content/commands/npm-diff.md +++ b/deps/npm/docs/content/commands/npm-diff.md @@ -248,6 +248,8 @@ Treat all files as text in `npm diff`. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index 3dd860ea5c6f68..18e374869d5a60 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -70,6 +70,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index d6668a2c2bd0fb..318df5780e8dba 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -460,6 +460,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 975c807c38b348..34c67aa3def81d 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -153,6 +153,8 @@ rather than using npm's default semver range operator. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index ded8c0c0d26ef1..5ad4593bfa2f6a 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -137,6 +137,8 @@ Output parseable results from commands that write to standard output. For * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md index 6fa026550e7477..1bf2de039c3159 100644 --- a/deps/npm/docs/content/commands/npm-outdated.md +++ b/deps/npm/docs/content/commands/npm-outdated.md @@ -150,6 +150,8 @@ Output parseable results from commands that write to standard output. For * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-prefix.md b/deps/npm/docs/content/commands/npm-prefix.md index 39328bcc88a143..6f08e43fa8c0c4 100644 --- a/deps/npm/docs/content/commands/npm-prefix.md +++ b/deps/npm/docs/content/commands/npm-prefix.md @@ -51,6 +51,8 @@ npm prefix -g * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 52c368c8c513b9..fa5b0cfa97d7c1 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -42,6 +42,8 @@ will be rebuilt. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index 404c724ff02906..fc540a9382b235 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -46,6 +46,16 @@ Set to `true` to use default system URL opener. +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + + #### `workspace` * Default: diff --git a/deps/npm/docs/content/commands/npm-root.md b/deps/npm/docs/content/commands/npm-root.md index 40b58e4b33d0b2..80545235fc9693 100644 --- a/deps/npm/docs/content/commands/npm-root.md +++ b/deps/npm/docs/content/commands/npm-root.md @@ -41,6 +41,8 @@ echo "Global packages installed in: ${global_node_modules}" * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/commands/npm-set-script.md b/deps/npm/docs/content/commands/npm-set-script.md index 0fc267f760c81f..8695b43f14423e 100644 --- a/deps/npm/docs/content/commands/npm-set-script.md +++ b/deps/npm/docs/content/commands/npm-set-script.md @@ -7,6 +7,8 @@ description: Set tasks in the scripts section of package.json ### Synopsis An npm command that lets you create a task in the `scripts` section of the `package.json`. +Deprecated. + diff --git a/deps/npm/docs/content/commands/npm-star.md b/deps/npm/docs/content/commands/npm-star.md index bbec7ac5f9263f..00ef17a816b4ae 100644 --- a/deps/npm/docs/content/commands/npm-star.md +++ b/deps/npm/docs/content/commands/npm-star.md @@ -69,6 +69,20 @@ false, it uses ascii characters instead of unicode glyphs. +#### `otp` + +* Default: null +* Type: null or String + +This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with `npm access`. + +If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one. + + + + ### See Also diff --git a/deps/npm/docs/content/commands/npm-update.md b/deps/npm/docs/content/commands/npm-update.md index 421d04ca3dc583..55aad182fcafe8 100644 --- a/deps/npm/docs/content/commands/npm-update.md +++ b/deps/npm/docs/content/commands/npm-update.md @@ -188,6 +188,8 @@ Will also prevent writing to `package-lock.json` if set to `false`. * Default: false * Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 4dc2829825d60d..12b508582af1c3 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -68,6 +68,7 @@ The following shorthands are parsed on the command-line: * `--desc`: `--description` * `-f`: `--force` * `-g`: `--global` +* `--iwr`: `--include-workspace-root` * `-L`: `--location` * `-d`: `--loglevel info` * `-s`: `--loglevel silent` @@ -686,23 +687,6 @@ results in no commit being made at all. -#### `global` - -* Default: false -* Type: Boolean - -Operates in "global" mode, so that packages are installed into the `prefix` -folder instead of the current working directory. See -[folders](/configuring-npm/folders) for more on the differences in behavior. - -* packages are installed into the `{prefix}/lib/node_modules` folder, instead - of the current working directory. -* bin files are linked to `{prefix}/bin` -* man pages are linked to `{prefix}/share/man` - - - - #### `global-style` * Default: false @@ -1000,6 +984,15 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12. When passed to `npm config` this refers to which config file to use. +When set to "global" mode, packages are installed into the `prefix` folder +instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + @@ -1177,6 +1170,19 @@ variable will be set to `'production'` for all lifecycle scripts. +#### `omit-lockfile-registry-resolved` + +* Default: false +* Type: Boolean + +This option causes npm to create lock files without a `resolved` key for +registry dependencies. Subsequent installs will need to resolve tarball +endpoints with the configured registry, likely resulting in a longer install +time. + + + + #### `otp` * Default: null @@ -1927,6 +1933,25 @@ Alias for `--include=dev`. +#### `global` + +* Default: false +* Type: Boolean +* DEPRECATED: `--global`, `--local` are deprecated. Use `--location=global` + instead. + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + + #### `init.author.email` * Default: "" diff --git a/deps/npm/docs/output/commands/npm-bin.html b/deps/npm/docs/output/commands/npm-bin.html index 5961ea7e50fb74..7b957b6014dc44 100644 --- a/deps/npm/docs/output/commands/npm-bin.html +++ b/deps/npm/docs/output/commands/npm-bin.html @@ -165,6 +165,8 @@

global

  • Default: false
  • Type: Boolean
  • +
  • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-bugs.html b/deps/npm/docs/output/commands/npm-bugs.html index 3b5bed07593a65..28fdc0c643885a 100644 --- a/deps/npm/docs/output/commands/npm-bugs.html +++ b/deps/npm/docs/output/commands/npm-bugs.html @@ -142,14 +142,14 @@

npm-bugs

Table of contents

- +

Synopsis

-
npm bugs [<pkgname>]
+
npm bugs [<pkgname> [<pkgname> ...]]
 
 alias: issues
 
@@ -184,6 +184,57 @@

registry

The base URL of the npm registry.

+

workspace

+
    +
  • Default:
  • +
  • Type: String (can be set multiple times)
  • +
+

Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option.

+

Valid values for the workspace config are either:

+
    +
  • Workspace names
  • +
  • Path to a workspace directory
  • +
  • Path to a parent workspace directory (will result in selecting all +workspaces within that folder)
  • +
+

When set for the npm init command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project.

+

This value is not exported to the environment for child processes.

+ + +

workspaces

+
    +
  • Default: null
  • +
  • Type: null or Boolean
  • +
+

Set to true to run the command in the context of all configured +workspaces.

+

Explicitly setting this to false will cause commands like install to +ignore workspaces altogether. When not set explicitly:

+
    +
  • Commands that operate on the node_modules tree (install, update, etc.) +will link workspaces into the node_modules folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +unless one or more workspaces are specified in the workspace config.
  • +
+

This value is not exported to the environment for child processes.

+ + +

include-workspace-root

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

Include the workspace root when workspaces are enabled for a command.

+

When false, specifying individual workspaces via the workspace config, or +all workspaces via the workspaces flag, will cause npm to operate only on +the specified workspaces, and not on the root project.

+

This value is not exported to the environment for child processes.

+ +

See Also

    diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index 713f7b0c81e4f7..4f9a194ae57e54 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -137,7 +137,7 @@

    npm-ci

    -Install a project with a clean slate +Clean install a project
    @@ -161,12 +161,7 @@

    Description

    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.

    -

    npm ci will be significantly faster when:

    -
      -
    • There is a package-lock.json or npm-shrinkwrap.json file.
    • -
    • The node_modules folder is missing or empty.
    • -
    -

    In short, the main differences between using npm install and npm ci are:

    +

    The main differences between using npm install and npm ci are:

    • The project must have an existing package-lock.json or npm-shrinkwrap.json.
    • diff --git a/deps/npm/docs/output/commands/npm-config.html b/deps/npm/docs/output/commands/npm-config.html index f8b279756dfe16..e267531fc0462f 100644 --- a/deps/npm/docs/output/commands/npm-config.html +++ b/deps/npm/docs/output/commands/npm-config.html @@ -223,6 +223,8 @@

      global

      • Default: false
      • Type: Boolean
      • +
      • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

      Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See @@ -251,6 +253,15 @@

      location

    • Type: "global", "user", or "project"

    When passed to npm config this refers to which config file to use.

    +

    When set to "global" mode, packages are installed into the prefix folder +instead of the current working directory. See +folders for more on the differences in behavior.

    +
      +
    • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
    • +
    • bin files are linked to {prefix}/bin
    • +
    • man pages are linked to {prefix}/share/man
    • +

    long

    diff --git a/deps/npm/docs/output/commands/npm-diff.html b/deps/npm/docs/output/commands/npm-diff.html index 13ed989c461801..7ee9d76d227f8b 100644 --- a/deps/npm/docs/output/commands/npm-diff.html +++ b/deps/npm/docs/output/commands/npm-diff.html @@ -334,6 +334,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index 6306ceb5938558..fce049dc2c09e5 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -196,6 +196,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 509702b5bd4ead..ca6ca1ee260f33 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -522,6 +522,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-link.html b/deps/npm/docs/output/commands/npm-link.html index f7d5f66a9e2bd2..cb43c0478d7015 100644 --- a/deps/npm/docs/output/commands/npm-link.html +++ b/deps/npm/docs/output/commands/npm-link.html @@ -251,6 +251,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 4b44cbfbc3d570..10caff53c3a090 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.9.0 /path/to/npm
    +
    npm@8.11.0 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     
    @@ -246,6 +246,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-outdated.html b/deps/npm/docs/output/commands/npm-outdated.html index 0bdb9f9a66a14a..15030d60080819 100644 --- a/deps/npm/docs/output/commands/npm-outdated.html +++ b/deps/npm/docs/output/commands/npm-outdated.html @@ -268,6 +268,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-prefix.html b/deps/npm/docs/output/commands/npm-prefix.html index 2f302144269200..df6960ef97bbcd 100644 --- a/deps/npm/docs/output/commands/npm-prefix.html +++ b/deps/npm/docs/output/commands/npm-prefix.html @@ -176,6 +176,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index f4524f1a4f0baa..84837a3be5d394 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -173,6 +173,8 @@

    global

    • Default: false
    • Type: Boolean
    • +
    • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

    Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-repo.html b/deps/npm/docs/output/commands/npm-repo.html index bd2ea8644bab05..24197ef0ea193c 100644 --- a/deps/npm/docs/output/commands/npm-repo.html +++ b/deps/npm/docs/output/commands/npm-repo.html @@ -142,7 +142,7 @@

    npm-repo

    Table of contents

    - +

    Synopsis

    @@ -174,6 +174,14 @@

    browser

    Set to true to use default system URL opener.

    +

    registry

    + +

    The base URL of the npm registry.

    + +

    workspace

    • Default:
    • diff --git a/deps/npm/docs/output/commands/npm-root.html b/deps/npm/docs/output/commands/npm-root.html index e0595fd8e76256..c9cc1d4b67843b 100644 --- a/deps/npm/docs/output/commands/npm-root.html +++ b/deps/npm/docs/output/commands/npm-root.html @@ -170,6 +170,8 @@

      global

      • Default: false
      • Type: Boolean
      • +
      • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

      Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm-set-script.html b/deps/npm/docs/output/commands/npm-set-script.html index 51b29d87fa43e8..d9bc6b60771e9d 100644 --- a/deps/npm/docs/output/commands/npm-set-script.html +++ b/deps/npm/docs/output/commands/npm-set-script.html @@ -147,6 +147,7 @@

      Table of contents

      Synopsis

      An npm command that lets you create a task in the scripts section of the package.json.

      +

      Deprecated.

      diff --git a/deps/npm/docs/output/commands/npm-star.html b/deps/npm/docs/output/commands/npm-star.html index 42143bed974a3c..bc1f7ae76992dd 100644 --- a/deps/npm/docs/output/commands/npm-star.html +++ b/deps/npm/docs/output/commands/npm-star.html @@ -142,7 +142,7 @@

      npm-star

      Table of contents

      - +

      Synopsis

      @@ -188,6 +188,17 @@

      unicode

      false, it uses ascii characters instead of unicode glyphs.

      +

      otp

      +
        +
      • Default: null
      • +
      • Type: null or String
      • +
      +

      This is a one-time password from a two-factor authenticator. It's needed +when publishing or changing package permissions with npm access.

      +

      If not set, and a registry response fails with a challenge for a one-time +password, npm will prompt on the command line for one.

      + +

      See Also

        diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html index d88ea8578bacef..d0cb6d5f75501b 100644 --- a/deps/npm/docs/output/commands/npm-update.html +++ b/deps/npm/docs/output/commands/npm-update.html @@ -275,6 +275,8 @@

        global

        • Default: false
        • Type: Boolean
        • +
        • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.

        Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 947e5a7ee179ad..99c109c4e25cfa 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.9.0

        +

        8.11.0

        Description

        npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index e1edc365007055..ef033b8693e4fd 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -142,7 +142,7 @@

        config

        Table of contents

        -
        +

        Description

        @@ -196,6 +196,7 @@

        Shorthands and Other CLI Niceties

        --desc: --description
      • -f: --force
      • -g: --global
      • +
      • --iwr: --include-workspace-root
      • -L: --location
      • -d: --loglevel info
      • -s: --loglevel silent
      • @@ -695,22 +696,6 @@

        git-tag-version

        results in no commit being made at all.

        -

        global

        -
          -
        • Default: false
        • -
        • Type: Boolean
        • -
        -

        Operates in "global" mode, so that packages are installed into the prefix -folder instead of the current working directory. See -folders for more on the differences in behavior.

        -
          -
        • packages are installed into the {prefix}/lib/node_modules folder, instead -of the current working directory.
        • -
        • bin files are linked to {prefix}/bin
        • -
        • man pages are linked to {prefix}/share/man
        • -
        - -

        global-style

        • Default: false
        • @@ -950,6 +935,15 @@

          location

        • Type: "global", "user", or "project"

        When passed to npm config this refers to which config file to use.

        +

        When set to "global" mode, packages are installed into the prefix folder +instead of the current working directory. See +folders for more on the differences in behavior.

        +
          +
        • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
        • +
        • bin files are linked to {prefix}/bin
        • +
        • man pages are linked to {prefix}/share/man
        • +

        lockfile-version

        @@ -1089,6 +1083,17 @@

        omit

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

        +

        omit-lockfile-registry-resolved

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

        This option causes npm to create lock files without a resolved key for +registry dependencies. Subsequent installs will need to resolve tarball +endpoints with the configured registry, likely resulting in a longer install +time.

        + +

        otp

        • Default: null
        • @@ -1689,6 +1694,24 @@

          dev

          Alias for --include=dev.

          +

          global

          +
            +
          • Default: false
          • +
          • Type: Boolean
          • +
          • DEPRECATED: --global, --local are deprecated. Use --location=global +instead.
          • +
          +

          Operates in "global" mode, so that packages are installed into the prefix +folder instead of the current working directory. See +folders for more on the differences in behavior.

          +
            +
          • packages are installed into the {prefix}/lib/node_modules folder, instead +of the current working directory.
          • +
          • bin files are linked to {prefix}/bin
          • +
          • man pages are linked to {prefix}/share/man
          • +
          + +

          init.author.email

          • Default: ""
          • diff --git a/deps/npm/lib/commands/bin.js b/deps/npm/lib/commands/bin.js index 4200d5b8ca556a..9ba3cb4003241b 100644 --- a/deps/npm/lib/commands/bin.js +++ b/deps/npm/lib/commands/bin.js @@ -15,7 +15,7 @@ class Bin extends BaseCommand { async exec (args) { const b = this.npm.bin this.npm.output(b) - if (this.npm.config.get('global') && !path.split(delimiter).includes(b)) { + if (this.npm.global && !path.split(delimiter).includes(b)) { log.error('bin', '(not in PATH env variable)') } } diff --git a/deps/npm/lib/commands/birthday.js b/deps/npm/lib/commands/birthday.js index c7b5b31c54a62a..cdd6db62869059 100644 --- a/deps/npm/lib/commands/birthday.js +++ b/deps/npm/lib/commands/birthday.js @@ -1,13 +1,15 @@ const BaseCommand = require('../base-command.js') +const log = require('../utils/log-shim') class Birthday extends BaseCommand { static name = 'birthday' - static description = 'Birthday' + static description = 'Birthday, deprecated' static ignoreImplicitWorkspace = true static isShellout = true async exec () { this.npm.config.set('yes', true) + log.warn('birthday', 'birthday is deprecated and will be removed in a future release') 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 f6218f033f3d3d..17cbd96649b871 100644 --- a/deps/npm/lib/commands/bugs.js +++ b/deps/npm/lib/commands/bugs.js @@ -1,33 +1,10 @@ -const pacote = require('pacote') -const log = require('../utils/log-shim') -const openUrl = require('../utils/open-url.js') -const hostedFromMani = require('../utils/hosted-git-info-from-manifest.js') -const BaseCommand = require('../base-command.js') +const PackageUrlCmd = require('../package-url-cmd.js') -class Bugs extends BaseCommand { +class Bugs extends PackageUrlCmd { static description = 'Report bugs for a package in a web browser' static name = 'bugs' - static usage = ['[]'] - static params = ['browser', 'registry'] - static ignoreImplicitWorkspace = true - async exec (args) { - if (!args || !args.length) { - args = ['.'] - } - - await Promise.all(args.map(pkg => this.getBugs(pkg))) - } - - async getBugs (pkg) { - const opts = { ...this.npm.flatOptions, fullMetadata: true } - const mani = await pacote.manifest(pkg, opts) - const url = this.getBugsUrl(mani) - log.silly('bugs', 'url', url) - await openUrl(this.npm, url, `${mani.name} bug list available at the following URL`) - } - - getBugsUrl (mani) { + getUrl (spec, mani) { if (mani.bugs) { if (typeof mani.bugs === 'string') { return mani.bugs @@ -43,7 +20,7 @@ class Bugs extends BaseCommand { } // try to get it from the repo, if possible - const info = hostedFromMani(mani) + const info = this.hostedFromMani(mani) if (info) { return info.bugs() } diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js index 634c8dbb428096..862f346adb4369 100644 --- a/deps/npm/lib/commands/cache.js +++ b/deps/npm/lib/commands/cache.js @@ -10,11 +10,7 @@ const jsonParse = require('json-parse-even-better-errors') const localeCompare = require('@isaacs/string-locale-compare')('en') const log = require('../utils/log-shim') -const searchCachePackage = async (path, spec, cacheKeys) => { - const parsed = npa(spec) - if (parsed.rawSpec !== '' && parsed.type === 'tag') { - throw new Error(`Cannot list cache keys for a tagged package.`) - } +const searchCachePackage = async (path, parsed, cacheKeys) => { /* eslint-disable-next-line max-len */ const searchMFH = new RegExp(`^make-fetch-happen:request-cache:.*(? { if (!packument.versions || typeof packument.versions !== 'object') { continue } + // assuming this is a packument for (const ver of Object.keys(packument.versions)) { if (semver.satisfies(ver, parsed.rawSpec)) { @@ -148,6 +145,7 @@ class Cache extends BaseCommand { } this.npm.output(`Deleted: ${key}`) await cacache.rm.entry(cachePath, key) + // XXX this could leave other entries without content! await cacache.rm.content(cachePath, entry.integrity) } } @@ -204,7 +202,11 @@ class Cache extends BaseCommand { // get results for each package spec specified const results = new Set() for (const spec of specs) { - const keySet = await searchCachePackage(cachePath, spec, cacheKeys) + const parsed = npa(spec) + if (parsed.rawSpec !== '' && parsed.type === 'tag') { + throw this.usageError('Cannot list cache keys for a tagged package.') + } + const keySet = await searchCachePackage(cachePath, parsed, cacheKeys) for (const key of keySet) { results.add(key) } diff --git a/deps/npm/lib/commands/ci.js b/deps/npm/lib/commands/ci.js index eb1e02bcdc7241..2a6125d564e912 100644 --- a/deps/npm/lib/commands/ci.js +++ b/deps/npm/lib/commands/ci.js @@ -8,19 +8,10 @@ const readdir = util.promisify(fs.readdir) const log = require('../utils/log-shim.js') const validateLockfile = require('../utils/validate-lockfile.js') -const removeNodeModules = async where => { - const rimrafOpts = { glob: false } - process.emit('time', 'npm-ci:rm') - const path = `${where}/node_modules` - // get the list of entries so we can skip the glob for performance - const entries = await readdir(path, null).catch(er => []) - await Promise.all(entries.map(f => rimraf(`${path}/${f}`, rimrafOpts))) - process.emit('timeEnd', 'npm-ci:rm') -} const ArboristWorkspaceCmd = require('../arborist-cmd.js') class CI extends ArboristWorkspaceCmd { - static description = 'Install a project with a clean slate' + static description = 'Clean install a project' static name = 'ci' static params = [ 'audit', @@ -30,10 +21,10 @@ class CI extends ArboristWorkspaceCmd { ] async exec () { - if (this.npm.config.get('global')) { - const err = new Error('`npm ci` does not work for global packages') - err.code = 'ECIGLOBAL' - throw err + if (this.npm.global) { + throw Object.assign(new Error('`npm ci` does not work for global packages'), { + code: 'ECIGLOBAL', + }) } const where = this.npm.prefix @@ -46,17 +37,14 @@ class CI extends ArboristWorkspaceCmd { } const arb = new Arborist(opts) - await Promise.all([ - arb.loadVirtual().catch(er => { - log.verbose('loadVirtual', er.stack) - const msg = - 'The `npm ci` command can only install with an existing package-lock.json or\n' + - 'npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\n' + - 'later to generate a package-lock.json file, then try again.' - throw new Error(msg) - }), - removeNodeModules(where), - ]) + await arb.loadVirtual().catch(er => { + log.verbose('loadVirtual', er.stack) + const msg = + 'The `npm ci` command can only install with an existing package-lock.json or\n' + + 'npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\n' + + 'later to generate a package-lock.json file, then try again.' + throw this.usageError(msg) + }) // retrieves inventory of packages from loaded virtual tree (lock file) const virtualInventory = new Map(arb.virtualTree.inventory) @@ -70,15 +58,24 @@ class CI extends ArboristWorkspaceCmd { // throws a validation error in case of mismatches const errors = validateLockfile(virtualInventory, arb.idealTree.inventory) if (errors.length) { - throw new Error( + throw this.usageError( '`npm ci` can only install packages when your package.json and ' + 'package-lock.json or npm-shrinkwrap.json are in sync. Please ' + 'update your lock file with `npm install` ' + 'before continuing.\n\n' + - errors.join('\n') + '\n' + errors.join('\n') ) } + // Only remove node_modules after we've successfully loaded the virtual + // tree and validated the lockfile + await this.npm.time('npm-ci:rm', async () => { + const path = `${where}/node_modules` + // get the list of entries so we can skip the glob for performance + const entries = await readdir(path, null).catch(er => []) + return Promise.all(entries.map(f => rimraf(`${path}/${f}`, { glob: false }))) + }) + await arb.reify(opts) const ignoreScripts = this.npm.config.get('ignore-scripts') diff --git a/deps/npm/lib/commands/completion.js b/deps/npm/lib/commands/completion.js index 5b7e0d355c63c8..c24fb050dcb34d 100644 --- a/deps/npm/lib/commands/completion.js +++ b/deps/npm/lib/commands/completion.js @@ -29,18 +29,26 @@ // as an array. // +const fs = require('@npmcli/fs') +const nopt = require('nopt') + const { definitions, shorthands } = require('../utils/config/index.js') const { aliases, cmdList, plumbing } = require('../utils/cmd-list.js') const aliasNames = Object.keys(aliases) const fullList = cmdList.concat(aliasNames).filter(c => !plumbing.includes(c)) -const nopt = require('nopt') const configNames = Object.keys(definitions) const shorthandNames = Object.keys(shorthands) const allConfs = configNames.concat(shorthandNames) const { isWindowsShell } = require('../utils/is-windows.js') -const fileExists = require('../utils/file-exists.js') +const fileExists = async (file) => { + try { + const stat = await fs.stat(file) + return stat.isFile() + } catch { + return false + } +} -const { promisify } = require('util') const BaseCommand = require('../base-command.js') class Completion extends BaseCommand { @@ -189,12 +197,10 @@ class Completion extends BaseCommand { } const dumpScript = async () => { - const fs = require('fs') - const readFile = promisify(fs.readFile) const { resolve } = require('path') const p = resolve(__dirname, '..', 'utils', 'completion.sh') - const d = (await readFile(p, 'utf8')).replace(/^#!.*?\n/, '') + const d = (await fs.readFile(p, 'utf8')).replace(/^#!.*?\n/, '') await new Promise((res, rej) => { let done = false process.stdout.on('error', er => { diff --git a/deps/npm/lib/commands/config.js b/deps/npm/lib/commands/config.js index 0432abac391f38..96dd4abcaf4af8 100644 --- a/deps/npm/lib/commands/config.js +++ b/deps/npm/lib/commands/config.js @@ -276,7 +276,7 @@ ${defData} msg.push('') } - if (!this.npm.config.get('global')) { + if (!this.npm.global) { const pkgPath = resolve(this.npm.prefix, 'package.json') const pkg = await rpj(pkgPath).catch(() => ({})) diff --git a/deps/npm/lib/commands/dedupe.js b/deps/npm/lib/commands/dedupe.js index 96d1ac2ae9a743..2cc44b2a9fb2fd 100644 --- a/deps/npm/lib/commands/dedupe.js +++ b/deps/npm/lib/commands/dedupe.js @@ -22,7 +22,7 @@ class Dedupe extends ArboristWorkspaceCmd { ] async exec (args) { - if (this.npm.config.get('global')) { + if (this.npm.global) { const er = new Error('`npm dedupe` does not work in global mode.') er.code = 'EDEDUPEGLOBAL' throw er diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js index 11ee78265e62a3..b8a64bd98a0394 100644 --- a/deps/npm/lib/commands/diff.js +++ b/deps/npm/lib/commands/diff.js @@ -50,7 +50,7 @@ class Diff extends BaseCommand { // node_modules is sometimes under ./lib, and in global mode we're only ever // walking through node_modules (because we will have been given a package // name already) - if (this.npm.config.get('global')) { + if (this.npm.global) { this.top = resolve(this.npm.globalDir, '..') } else { this.top = this.prefix diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js index 42cad80df0073f..a207e422cb53c1 100644 --- a/deps/npm/lib/commands/dist-tag.js +++ b/deps/npm/lib/commands/dist-tag.js @@ -148,7 +148,7 @@ class DistTag extends BaseCommand { async list (spec, opts) { if (!spec) { - if (this.npm.config.get('global')) { + if (this.npm.global) { throw this.usageError() } const { name } = await readPackage(path.resolve(this.npm.prefix, 'package.json')) diff --git a/deps/npm/lib/commands/docs.js b/deps/npm/lib/commands/docs.js index 631615acc56b3d..5d20215b56a07f 100644 --- a/deps/npm/lib/commands/docs.js +++ b/deps/npm/lib/commands/docs.js @@ -1,54 +1,19 @@ -const pacote = require('pacote') -const openUrl = require('../utils/open-url.js') -const hostedFromMani = require('../utils/hosted-git-info-from-manifest.js') -const log = require('../utils/log-shim') -const BaseCommand = require('../base-command.js') -class Docs extends BaseCommand { +const PackageUrlCmd = require('../package-url-cmd.js') +class Docs extends PackageUrlCmd { static description = 'Open documentation for a package in a web browser' static name = 'docs' - static params = [ - 'browser', - 'registry', - 'workspace', - 'workspaces', - 'include-workspace-root', - ] - static usage = ['[ [ ...]]'] - static ignoreImplicitWorkspace = false - - async exec (args) { - if (!args || !args.length) { - args = ['.'] - } - - await Promise.all(args.map(pkg => this.getDocs(pkg))) - } - - async execWorkspaces (args, filters) { - await this.setWorkspaces(filters) - return this.exec(this.workspacePaths) - } - - async getDocs (pkg) { - const opts = { ...this.npm.flatOptions, fullMetadata: true } - const mani = await pacote.manifest(pkg, opts) - const url = this.getDocsUrl(mani) - log.silly('docs', 'url', url) - await openUrl(this.npm, url, `${mani.name} docs available at the following URL`) - } - - getDocsUrl (mani) { + getUrl (spec, mani) { if (mani.homepage) { return mani.homepage } - const info = hostedFromMani(mani) + const info = this.hostedFromMani(mani) if (info) { return info.docs() } - return 'https://www.npmjs.com/package/' + mani.name + return `https://www.npmjs.com/package/${mani.name}` } } module.exports = Docs diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js index 787a5193f01558..09ca81653b0eb3 100644 --- a/deps/npm/lib/commands/fund.js +++ b/deps/npm/lib/commands/fund.js @@ -45,7 +45,7 @@ class Fund extends ArboristWorkspaceCmd { throw err } - if (this.npm.config.get('global')) { + if (this.npm.global) { const err = new Error('`npm fund` does not support global packages') err.code = 'EFUNDGLOBAL' throw err diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js index d1f6d1481dddc5..4cda36448317fe 100644 --- a/deps/npm/lib/commands/install.js +++ b/deps/npm/lib/commands/install.js @@ -106,7 +106,7 @@ class Install extends ArboristWorkspaceCmd { // the /path/to/node_modules/.. const globalTop = resolve(this.npm.globalDir, '..') const ignoreScripts = this.npm.config.get('ignore-scripts') - const isGlobalInstall = this.npm.config.get('global') + const isGlobalInstall = this.npm.global const where = isGlobalInstall ? globalTop : this.npm.prefix const forced = this.npm.config.get('force') const scriptShell = this.npm.config.get('script-shell') || undefined diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js index d656791469a643..80a60d36e324e9 100644 --- a/deps/npm/lib/commands/link.js +++ b/deps/npm/lib/commands/link.js @@ -43,7 +43,7 @@ class Link extends ArboristWorkspaceCmd { } async exec (args) { - if (this.npm.config.get('global')) { + if (this.npm.global) { throw Object.assign( new Error( 'link should never be --global.\n' + diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index 06268fe7e0ac0d..cfd9cb5a5051ca 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -52,7 +52,7 @@ class LS extends ArboristWorkspaceCmd { const all = this.npm.config.get('all') const color = this.npm.color const depth = this.npm.config.get('depth') - const global = this.npm.config.get('global') + const global = this.npm.global const json = this.npm.config.get('json') const link = this.npm.config.get('link') const long = this.npm.config.get('long') diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index 0953c17ca10d2a..081e75a2c61d36 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -27,7 +27,7 @@ class Outdated extends ArboristWorkspaceCmd { async exec (args) { const global = path.resolve(this.npm.globalDir, '..') - const where = this.npm.config.get('global') + const where = this.npm.global ? global : this.npm.prefix @@ -140,7 +140,7 @@ class Outdated extends ArboristWorkspaceCmd { getEdgesOut (node) { // TODO: normalize usage of edges and avoid looping through nodes here - if (this.npm.config.get('global')) { + if (this.npm.global) { for (const child of node.children.values()) { this.trackEdge(child) } @@ -166,7 +166,7 @@ class Outdated extends ArboristWorkspaceCmd { } getWorkspacesEdges (node) { - if (this.npm.config.get('global')) { + if (this.npm.global) { return } diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index 9338b22a5e8574..4797e9c7ec84b4 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -50,7 +50,7 @@ class Owner extends BaseCommand { // reaches registry in order to autocomplete rm if (argv[2] === 'rm') { - if (this.npm.config.get('global')) { + if (this.npm.global) { return [] } const { name } = await readJson(resolve(this.npm.prefix, 'package.json')) @@ -126,7 +126,7 @@ class Owner extends BaseCommand { async getPkg (prefix, pkg) { if (!pkg) { - if (this.npm.config.get('global')) { + if (this.npm.global) { throw this.usageError() } const { name } = await readJson(resolve(prefix, 'package.json')) diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js index 41fef5cb45a47c..8190ceecaf94bc 100644 --- a/deps/npm/lib/commands/pack.js +++ b/deps/npm/lib/commands/pack.js @@ -44,7 +44,11 @@ class Pack extends BaseCommand { // noise generated during packing const tarballs = [] for (const { arg, manifest } of manifests) { - const tarballData = await libpack(arg, this.npm.flatOptions) + const tarballData = await libpack(arg, { + ...this.npm.flatOptions, + prefix: this.npm.localPrefix, + workspaces: this.workspacePaths, + }) const pkgContents = await getContents(manifest, tarballData) tarballs.push(pkgContents) } diff --git a/deps/npm/lib/commands/pkg.js b/deps/npm/lib/commands/pkg.js index 3a8e01f65bc921..5fac9bfb54683b 100644 --- a/deps/npm/lib/commands/pkg.js +++ b/deps/npm/lib/commands/pkg.js @@ -29,7 +29,7 @@ class Pkg extends BaseCommand { this.prefix = prefix } - if (this.npm.config.get('global')) { + if (this.npm.global) { throw Object.assign( new Error(`There's no package.json file to manage on global mode`), { code: 'EPKGGLOBAL' } diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index cbf0ccf4d65810..da6437fa9c58fc 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -80,7 +80,12 @@ class Publish extends BaseCommand { } // we pass dryRun: true to libnpmpack so it doesn't write the file to disk - const tarballData = await pack(spec, { ...opts, dryRun: true }) + const tarballData = await pack(spec, { + ...opts, + dryRun: true, + prefix: this.npm.localPrefix, + workspaces: this.workspacePaths, + }) const pkgContents = await getContents(manifest, tarballData) // The purpose of re-reading the manifest is in case it changed, diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js index 0e8a1510bde2b3..3e6046d8df22b0 100644 --- a/deps/npm/lib/commands/rebuild.js +++ b/deps/npm/lib/commands/rebuild.js @@ -26,7 +26,7 @@ class Rebuild extends ArboristWorkspaceCmd { async exec (args) { const globalTop = resolve(this.npm.globalDir, '..') - const where = this.npm.config.get('global') ? globalTop : this.npm.prefix + const where = this.npm.global ? globalTop : this.npm.prefix const arb = new Arborist({ ...this.npm.flatOptions, path: where, diff --git a/deps/npm/lib/commands/repo.js b/deps/npm/lib/commands/repo.js index b8dccc209ff87a..b89b74c0bf1baa 100644 --- a/deps/npm/lib/commands/repo.js +++ b/deps/npm/lib/commands/repo.js @@ -1,40 +1,11 @@ -const pacote = require('pacote') const { URL } = require('url') -const log = require('../utils/log-shim') -const hostedFromMani = require('../utils/hosted-git-info-from-manifest.js') -const openUrl = require('../utils/open-url.js') -const BaseCommand = require('../base-command.js') -class Repo extends BaseCommand { +const PackageUrlCmd = require('../package-url-cmd.js') +class Repo extends PackageUrlCmd { static description = 'Open package repository page in the browser' static name = 'repo' - static params = ['browser', 'workspace', 'workspaces', 'include-workspace-root'] - static usage = ['[ [ ...]]'] - static ignoreImplicitWorkspace = false - - async exec (args) { - if (!args || !args.length) { - args = ['.'] - } - - await Promise.all(args.map(pkg => this.get(pkg))) - } - - async execWorkspaces (args, filters) { - await this.setWorkspaces(filters) - return this.exec(this.workspacePaths) - } - - async get (pkg) { - // XXX It is very odd that `where` is how pacote knows to look anywhere - // other than the cwd. - const opts = { - ...this.npm.flatOptions, - where: this.npm.localPrefix, - fullMetadata: true, - } - const mani = await pacote.manifest(pkg, opts) + getUrl (spec, mani) { const r = mani.repository const rurl = !r ? null : typeof r === 'string' ? r @@ -43,22 +14,20 @@ class Repo extends BaseCommand { if (!rurl) { throw Object.assign(new Error('no repository'), { - pkgid: pkg, + pkgid: spec, }) } - const info = hostedFromMani(mani) + const info = this.hostedFromMani(mani) const url = info ? info.browse(mani.repository.directory) : unknownHostedUrl(rurl) if (!url) { throw Object.assign(new Error('no repository: could not get url'), { - pkgid: pkg, + pkgid: spec, }) } - - log.silly('docs', 'url', url) - await openUrl(this.npm, url, `${mani.name} repo available at the following URL`) + return url } } module.exports = Repo diff --git a/deps/npm/lib/commands/search.js b/deps/npm/lib/commands/search.js index a06ba4031443b4..8751e9e7d22fd0 100644 --- a/deps/npm/lib/commands/search.js +++ b/deps/npm/lib/commands/search.js @@ -3,26 +3,33 @@ const Pipeline = require('minipass-pipeline') const libSearch = require('libnpmsearch') const log = require('../utils/log-shim.js') -const formatPackageStream = require('../search/format-package-stream.js') -const packageFilter = require('../search/package-filter.js') +const formatSearchStream = require('../utils/format-search-stream.js') + +function filter (data, include, exclude) { + const words = [data.name] + .concat(data.maintainers.map(m => `=${m.username}`)) + .concat(data.keywords || []) + .map(f => f && f.trim && f.trim()) + .filter(f => f) + .join(' ') + .toLowerCase() + + if (exclude.find(e => match(words, e))) { + return false + } -function prepareIncludes (args) { - return args - .map(s => s.toLowerCase()) - .filter(s => s) + return true } -function prepareExcludes (searchexclude) { - var exclude - if (typeof searchexclude === 'string') { - exclude = searchexclude.split(/\s+/) - } else { - exclude = [] +function match (words, pattern) { + if (pattern.startsWith('/')) { + if (pattern.endsWith('/')) { + pattern = pattern.slice(0, -1) + } + pattern = new RegExp(pattern.slice(1)) + return words.match(pattern) } - - return exclude - .map(s => s.toLowerCase()) - .filter(s => s) + return words.indexOf(pattern) !== -1 } const BaseCommand = require('../base-command.js') @@ -50,8 +57,8 @@ class Search extends BaseCommand { const opts = { ...this.npm.flatOptions, ...this.npm.flatOptions.search, - include: prepareIncludes(args), - exclude: prepareExcludes(this.npm.flatOptions.search.exclude), + include: args.map(s => s.toLowerCase()).filter(s => s), + exclude: this.npm.flatOptions.search.exclude.split(/\s+/), } if (opts.include.length === 0) { @@ -63,7 +70,7 @@ class Search extends BaseCommand { class FilterStream extends Minipass { write (pkg) { - if (packageFilter(pkg, opts.include, opts.exclude)) { + if (filter(pkg, opts.include, opts.exclude)) { super.write(pkg) } } @@ -73,7 +80,7 @@ class Search extends BaseCommand { // Grab a configured output stream that will spit out packages in the // desired format. - const outputStream = formatPackageStream({ + const outputStream = formatSearchStream({ args, // --searchinclude options are not highlighted ...opts, }) diff --git a/deps/npm/lib/commands/set-script.js b/deps/npm/lib/commands/set-script.js index a6b7c3a50cdafe..a085f72a314284 100644 --- a/deps/npm/lib/commands/set-script.js +++ b/deps/npm/lib/commands/set-script.js @@ -5,7 +5,7 @@ const log = require('../utils/log-shim') const BaseCommand = require('../base-command.js') class SetScript extends BaseCommand { - static description = 'Set tasks in the scripts section of package.json' + static description = 'Set tasks in the scripts section of package.json, deprecated' static params = ['workspace', 'workspaces', 'include-workspace-root'] static name = 'set-script' static usage = ['[