diff --git a/.eslintrc.js b/.eslintrc.js index b676485c5909ab..b96b2b5690a2c0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,7 +68,7 @@ module.exports = { files: ['**/*.md/*.cjs', '**/*.md/*.js'], parserOptions: { sourceType: 'script', - ecmaFeatures: { impliedStrict: true } + ecmaFeatures: { impliedStrict: true }, }, rules: { strict: 'off' }, }, @@ -103,11 +103,11 @@ module.exports = { }, { name: 'Buffer', - message: 'Import Buffer instead of using the global' + message: 'Import Buffer instead of using the global', }, { name: 'process', - message: 'Import process instead of using the global' + message: 'Import process instead of using the global', }, ] }, }, @@ -134,13 +134,7 @@ module.exports = { ignorePattern: '.*', }, }], - 'comma-dangle': ['error', { - arrays: 'always-multiline', - exports: 'only-multiline', - functions: 'only-multiline', - imports: 'only-multiline', - objects: 'only-multiline', - }], + 'comma-dangle': ['error', 'always-multiline'], 'comma-spacing': 'error', 'comma-style': 'error', 'computed-property-spacing': 'error', @@ -239,6 +233,12 @@ module.exports = { selector: "CallExpression[callee.name='isNaN']", message: 'Use Number.isNaN() instead of the global isNaN() function.', }, + { + // TODO(@panva): move this to no-restricted-properties + // when https://github.com/eslint/eslint/issues/16412 is fixed + selector: "Identifier[name='webcrypto']", + message: 'Use `globalThis.crypto`.', + }, ], 'no-return-await': 'error', 'no-self-compare': 'error', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index acacee156126af..9df30710255974 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -71,16 +71,18 @@ /src/node_http2* @nodejs/http2 @nodejs/net /src/node_mem* @nodejs/http2 -# modules - -/doc/api/modules.md @nodejs/modules -/doc/api/esm.md @nodejs/modules -/doc/api/module.md @nodejs/modules -/doc/api/packages.md @nodejs/modules -/lib/module.js @nodejs/modules -/lib/internal/modules/* @nodejs/modules -/lib/internal/bootstrap/loaders.js @nodejs/modules -/src/module_wrap* @nodejs/modules @nodejs/vm +# modules, including loaders + +/doc/api/esm.md @nodejs/modules @nodejs/loaders +/doc/api/module.md @nodejs/modules @nodejs/loaders +/doc/api/modules.md @nodejs/modules @nodejs/loaders +/doc/api/packages.md @nodejs/modules @nodejs/loaders +/lib/internal/bootstrap/loaders.js @nodejs/modules @nodejs/loaders +/lib/internal/modules/* @nodejs/modules @nodejs/loaders +/lib/internal/process/esm_loader.js @nodejs/modules @nodejs/loaders +/lib/internal/process/execution.js @nodejs/modules @nodejs/loaders +/lib/module.js @nodejs/modules @nodejs/loaders +/src/module_wrap* @nodejs/modules @nodejs/loaders @nodejs/vm # Node-API @@ -96,6 +98,7 @@ /tools/gyp/**/* @nodejs/gyp # WASI + /deps/uvwasi/ @nodejs/wasi /doc/api/wasi.md @nodejs/wasi /lib/wasi.js @nodejs/wasi @@ -113,6 +116,7 @@ /tools/snapshot/* @nodejs/startup # V8 + /deps/v8/* @nodejs/v8-update /tools/v8_gypfiles/* @nodejs/v8-update @@ -120,3 +124,12 @@ /.github/workflows/* @nodejs/actions /tools/actions/* @nodejs/actions + +# Test runner + +/test/message/test_runner_* @nodejs/test_runner +/test/parallel/test-runner-* @nodejs/test_runner +/doc/api/test.md @nodejs/test_runner +/lib/test.js @nodejs/test_runner +/lib/internal/main/test_runner.js @nodejs/test_runner +/lib/internal/test_runner/* @nodejs/test_runner diff --git a/.github/workflows/authors.yml b/.github/workflows/authors.yml index ee5e814ce7671a..5d5c736fabb00a 100644 --- a/.github/workflows/authors.yml +++ b/.github/workflows/authors.yml @@ -30,6 +30,9 @@ jobs: 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.mjs`. + Check the output of + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + for possible duplicates. branch: actions/authors-update # Custom branch *just* for this Action. commit-message: 'meta: update AUTHORS' labels: meta diff --git a/.github/workflows/close-stale-feature-requests.yml b/.github/workflows/close-stale-feature-requests.yml index 834c4c84c28db2..f8eef7ce35d84e 100644 --- a/.github/workflows/close-stale-feature-requests.yml +++ b/.github/workflows/close-stale-feature-requests.yml @@ -39,7 +39,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/stale@v4 + - uses: actions/stale@v7 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 180 diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 509d79056f97e3..6eadfae6dd2481 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -20,7 +20,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/stale@v4 + - uses: actions/stale@v7 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-close: 30 diff --git a/.github/workflows/label-flaky-test-issue.yml b/.github/workflows/label-flaky-test-issue.yml index 0f49458fd10560..82e2a10ab2b25c 100644 --- a/.github/workflows/label-flaky-test-issue.yml +++ b/.github/workflows/label-flaky-test-issue.yml @@ -4,6 +4,9 @@ on: issues: types: [opened, labeled] +permissions: + contents: read + jobs: label: if: github.event.label.name == 'flaky-test' diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 83457850302540..e5e6f18269bfb6 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -125,6 +125,16 @@ jobs: echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV ./tools/dep_updaters/update-libuv.sh "$NEW_VERSION" fi + - id: simdutf + subsystem: deps + label: dependencies + run: | + NEW_VERSION=$(gh api repos/simdutf/simdutf/releases/latest -q '.tag_name|ltrimstr("v")') + CURRENT_VERSION=$(grep "#define SIMDUTF_VERSION" ./deps/simdutf/simdutf.h | sed -n "s/^.*VERSION \(.*\)/\1/p") + if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + ./tools/dep_updaters/update-simdutf.sh "$NEW_VERSION" + fi steps: - uses: actions/checkout@v3 with: diff --git a/.mailmap b/.mailmap index ead5bd8b4b189e..4b6e07d2bc8f7c 100644 --- a/.mailmap +++ b/.mailmap @@ -487,6 +487,7 @@ Sreepurna Jasti Stanislav Opichal Stefan Budeanu Stefan Bühler +Stefan Stojanovic Stephen Belanger Stephen Belanger Steve Mao diff --git a/AUTHORS b/AUTHORS index ddffe955d5e1ff..fd44ef80e33dda 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3517,7 +3517,7 @@ Brian Evans <53117772+mrbrianevans@users.noreply.github.com> falsandtru 东灯 <43312495+Lampese@users.noreply.github.com> Fabian Meyer <3982806+meyfa@users.noreply.github.com> -StefanStojanovic +Stefan Stojanovic Claudio Wunder Shrujal Shah Taha-Chaudhry <46199675+Taha-Chaudhry@users.noreply.github.com> @@ -3581,5 +3581,14 @@ chlorine Shi Lei Deokjin Kim Marco Ippolito +Alex Hunt +Debadree Chatterjee +Gabriela Gutierrez +emirgoren <61096652+emirgoren@users.noreply.github.com> +Pulkit Gupta +Fabien Michel <104162117+welfoz@users.noreply.github.com> +A. Wilcox +Daniel Lemire +Eric Mutta # Generated by tools/update-authors.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 781224bae30acf..9ef2fe7945c79f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,8 @@ release. -19.2.0
+19.3.0
+19.2.0
19.1.0
19.0.1
19.0.0
@@ -58,7 +59,8 @@ release. 18.0.0
-16.18.1
+16.19.0
+16.18.1
16.18.0
16.17.1
16.17.0
@@ -92,7 +94,8 @@ release. 16.0.0
-14.21.1
+14.21.2
+14.21.1
14.21.0
14.20.1
14.20.0
diff --git a/LICENSE b/LICENSE index cbcc28ce972135..f8fa687202dcb9 100644 --- a/LICENSE +++ b/LICENSE @@ -769,6 +769,246 @@ The externally maintained libraries used by Node.js are: SOFTWARE. """ +- postject, located at test/fixtures/postject-copy, is licensed as follows: + """ + Postject is licensed for use as follows: + + """ + MIT License + + Copyright (c) 2022 Postman, Inc + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + + The Postject license applies to all parts of Postject that are not externally + maintained libraries. + + The externally maintained libraries used by Postject are: + + - LIEF, located at vendor/LIEF, is licensed as follows: + """ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 - 2022 R. Thomas + Copyright 2017 - 2022 Quarkslab + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + """ + """ + - OpenSSL, located at deps/openssl, is licensed as follows: """ Apache License @@ -1076,6 +1316,28 @@ The externally maintained libraries used by Node.js are: jloup@gzip.org madler@alumni.caltech.edu """ +- simdutf, located at deps/simdutf, is licensed as follows: + """ + Copyright 2021 The simdutf authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + """ + - npm, located at deps/npm, is licensed as follows: """ The npm application diff --git a/Makefile b/Makefile index 05fdc1509844ad..ab696b45b645ec 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,7 @@ with-code-cache test-code-cache: out/Makefile: config.gypi common.gypi node.gyp \ deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \ + deps/simdutf/simdutf.gyp \ tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make diff --git a/README.md b/README.md index 5830ab24c8aecb..01fea35069a42e 100644 --- a/README.md +++ b/README.md @@ -708,8 +708,6 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): `141F07595B7B3FFE74309A937405533BE57C7D57` * **Danielle Adams** <> `74F12602B6F1C4E913FAA37AD3A89613643B6201` -* **Juan José Arboleda** <> - `61FC681DFB92A079F1685E77973F295594EC4689` * **Michaël Zasso** <> `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <> @@ -728,7 +726,6 @@ to sign releases): gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 -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 @@ -761,6 +758,8 @@ verify a downloaded file. `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` * **Jeremiah Senkpiel** <> `FD3A5288F042B6850C66B31F09FE44734EB7990E` +* **Juan José Arboleda** <> + `61FC681DFB92A079F1685E77973F295594EC4689` * **Julien Gilli** <> `114F43EE0176B71C7BC219DD50A3051F888C628D` * **Rod Vagg** <> diff --git a/android-configure b/android-configure index 8bab2e0b90c000..2731e48d708a4a 100755 --- a/android-configure +++ b/android-configure @@ -4,6 +4,7 @@ # Note that the mix of single and double quotes is intentional, # as is the fact that the ] goes on a new line. _=[ 'exec' '/bin/sh' '-c' ''' +command -v python3.11 >/dev/null && exec python3.11 "$0" "$@" command -v python3.10 >/dev/null && exec python3.10 "$0" "$@" command -v python3.9 >/dev/null && exec python3.9 "$0" "$@" command -v python3.8 >/dev/null && exec python3.8 "$0" "$@" @@ -22,7 +23,7 @@ except ImportError: from distutils.spawn import find_executable as which print('Node.js android configure: Found Python {}.{}.{}...'.format(*sys.version_info)) -acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6)) +acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6)) if sys.version_info[:2] in acceptable_pythons: import android_configure else: diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index aa014eec4e3627..821b2381d3e215 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -5,4 +5,11 @@ env: es6: true rules: + comma-dangle: [error, { + arrays: always-multiline, + exports: only-multiline, + functions: only-multiline, + imports: only-multiline, + objects: only-multiline, + }] prefer-arrow-callback: error diff --git a/benchmark/common.js b/benchmark/common.js index 6ed230ffde4231..918eaa5e0adbb4 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -38,7 +38,7 @@ class Benchmark { this.config = this.queue[0]; process.nextTick(() => { - if (Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) { + if (process.env.NODE_RUN_BENCHMARK_FN !== undefined) { fn(this.config); } else { // _run will use fork() to create a new process for each configuration @@ -91,7 +91,7 @@ class Benchmark { process.exit(1); } const [, key, value] = match; - if (Object.hasOwn(configs, key)) { + if (configs[key] !== undefined) { if (!cliOptions[key]) cliOptions[key] = []; cliOptions[key].push( @@ -290,10 +290,10 @@ function sendResult(data) { if (process.send) { // If forked, report by process send process.send(data, () => { - if (Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) { + if (process.env.NODE_RUN_BENCHMARK_FN !== undefined) { // If, for any reason, the process is unable to self close within // a second after completing, forcefully close it. - setTimeout(() => { + require('timers').setTimeout(() => { process.exit(0); }, 5000).unref(); } diff --git a/benchmark/crypto/webcrypto-digest.js b/benchmark/crypto/webcrypto-digest.js index 4acd82878dacf2..7bfb486c69ea54 100644 --- a/benchmark/crypto/webcrypto-digest.js +++ b/benchmark/crypto/webcrypto-digest.js @@ -1,11 +1,8 @@ 'use strict'; const common = require('../common.js'); -const { - createHash, - webcrypto, -} = require('crypto'); -const { subtle } = webcrypto; +const { createHash } = require('crypto'); +const { subtle } = globalThis.crypto; const bench = common.createBenchmark(main, { sync: ['createHash', 'subtle'], @@ -48,7 +45,7 @@ function measureSubtle(n, data, method) { } function main({ n, sync, data, method }) { - data = webcrypto.getRandomValues(Buffer.alloc(data)); + data = globalThis.crypto.getRandomValues(Buffer.alloc(data)); switch (sync) { case 'createHash': return measureLegacy(n, data, method); case 'subtle': return measureSubtle(n, data, method); diff --git a/benchmark/fixtures/require-cachable.js b/benchmark/fixtures/require-cachable.js deleted file mode 100644 index 105652a51855eb..00000000000000 --- a/benchmark/fixtures/require-cachable.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -const { internalBinding } = require('internal/test/binding'); -const { - builtinCategories: { canBeRequired } -} = internalBinding('builtins'); - -for (const key of canBeRequired) { - require(`node:${key}`); -} diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup.js index dea5a31753f8fe..c2cf7f2de658be 100644 --- a/benchmark/misc/startup.js +++ b/benchmark/misc/startup.js @@ -1,80 +1,69 @@ 'use strict'; const common = require('../common.js'); -const { spawn } = require('child_process'); +const { spawnSync } = require('child_process'); const path = require('path'); let Worker; // Lazy loaded in main const bench = common.createBenchmark(main, { - dur: [1], script: [ 'benchmark/fixtures/require-builtins', - 'benchmark/fixtures/require-cachable', 'test/fixtures/semicolon', ], - mode: ['process', 'worker'] -}, { - flags: ['--expose-internals'] + mode: ['process', 'worker'], + count: [30], }); -function spawnProcess(script) { +function spawnProcess(script, bench, state) { const cmd = process.execPath || process.argv[0]; - const argv = ['--expose-internals', script]; - return spawn(cmd, argv); -} + while (state.finished < state.count) { + const child = spawnSync(cmd, [script]); + if (child.status !== 0) { + console.log('---- STDOUT ----'); + console.log(child.stdout.toString()); + console.log('---- STDERR ----'); + console.log(child.stderr.toString()); + throw new Error(`Child process stopped with exit code ${child.status}`); + } + state.finished++; + if (state.finished === 0) { + // Finished warmup. + bench.start(); + } -function spawnWorker(script) { - return new Worker(script, { stderr: true, stdout: true }); + if (state.finished === state.count) { + bench.end(state.count); + } + } } -function start(state, script, bench, getNode) { - const node = getNode(script); - let stdout = ''; - let stderr = ''; - - node.stdout.on('data', (data) => { - stdout += data; - }); - - node.stderr.on('data', (data) => { - stderr += data; - }); - - node.on('exit', (code) => { +function spawnWorker(script, bench, state) { + const child = new Worker(script); + child.on('exit', (code) => { if (code !== 0) { - console.error('------ stdout ------'); - console.error(stdout); - console.error('------ stderr ------'); - console.error(stderr); - throw new Error(`Error during node startup, exit code ${code}`); + throw new Error(`Worker stopped with exit code ${code}`); } - state.throughput++; - - if (state.go) { - start(state, script, bench, getNode); + state.finished++; + if (state.finished === 0) { + // Finished warmup. + bench.start(); + } + if (state.finished < state.count) { + spawnProcess(script, bench, state); } else { - bench.end(state.throughput); + bench.end(state.count); } }); } -function main({ dur, script, mode }) { - const state = { - go: true, - throughput: 0 - }; - - setTimeout(() => { - state.go = false; - }, dur * 1000); - +function main({ count, script, mode }) { script = path.resolve(__dirname, '../../', `${script}.js`); + const warmup = 3; + const state = { count, finished: -warmup }; if (mode === 'worker') { Worker = require('worker_threads').Worker; - bench.start(); - start(state, script, bench, spawnWorker); + spawnWorker(script, bench, state); } else { - bench.start(); - start(state, script, bench, spawnProcess); + spawnProcess(script, bench, state); } } diff --git a/benchmark/util/text-decoder.js b/benchmark/util/text-decoder.js index 3d1ccc34bb8995..a6695028603f8a 100644 --- a/benchmark/util/text-decoder.js +++ b/benchmark/util/text-decoder.js @@ -5,13 +5,14 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { encoding: ['utf-8', 'latin1', 'iso-8859-3'], ignoreBOM: [0, 1], + fatal: [0, 1], len: [256, 1024 * 16, 1024 * 512], n: [1e2], type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'] }); -function main({ encoding, len, n, ignoreBOM, type }) { - const decoder = new TextDecoder(encoding, { ignoreBOM }); +function main({ encoding, len, n, ignoreBOM, type, fatal }) { + const decoder = new TextDecoder(encoding, { ignoreBOM, fatal }); let buf; switch (type) { @@ -31,7 +32,11 @@ function main({ encoding, len, n, ignoreBOM, type }) { bench.start(); for (let i = 0; i < n; i++) { - decoder.decode(buf); + try { + decoder.decode(buf); + } catch { + // eslint-disable no-empty + } } bench.end(n); } diff --git a/benchmark/util/text-encoder.js b/benchmark/util/text-encoder.js index ca3cb827779be3..707f76df11dc89 100644 --- a/benchmark/util/text-encoder.js +++ b/benchmark/util/text-encoder.js @@ -2,17 +2,30 @@ const common = require('../common.js'); -const BASE = 'string\ud801'; - const bench = common.createBenchmark(main, { - len: [256, 1024, 1024 * 32], + len: [16, 32, 256, 1024, 1024 * 32], n: [1e4], + type: ['one-byte-string', 'two-byte-string', 'ascii'], op: ['encode', 'encodeInto'] }); -function main({ n, op, len }) { +function main({ n, op, len, type }) { const encoder = new TextEncoder(); - const input = BASE.repeat(len); + let base = ''; + + switch (type) { + case 'ascii': + base = 'a'; + break; + case 'one-byte-string': + base = '\xff'; + break; + case 'two-byte-string': + base = 'ğ'; + break; + } + + const input = base.repeat(len); const subarray = new Uint8Array(len); bench.start(); diff --git a/benchmark/webstreams/creation.js b/benchmark/webstreams/creation.js new file mode 100644 index 00000000000000..085faba8b89864 --- /dev/null +++ b/benchmark/webstreams/creation.js @@ -0,0 +1,49 @@ +'use strict'; +const common = require('../common.js'); +const { + ReadableStream, + TransformStream, + WritableStream, +} = require('node:stream/web'); +const assert = require('assert'); + +const bench = common.createBenchmark(main, { + n: [50e3], + kind: ['ReadableStream', 'TransformStream', 'WritableStream'] +}); + +let rs, ws, ts; + +function main({ n, kind }) { + switch (kind) { + case 'ReadableStream': + bench.start(); + for (let i = 0; i < n; ++i) + rs = new ReadableStream(); + bench.end(n); + + // Avoid V8 deadcode (elimination) + assert.ok(rs); + break; + case 'WritableStream': + bench.start(); + for (let i = 0; i < n; ++i) + ws = new WritableStream(); + bench.end(n); + + // Avoid V8 deadcode (elimination) + assert.ok(ws); + break; + case 'TransformStream': + bench.start(); + for (let i = 0; i < n; ++i) + ts = new TransformStream(); + bench.end(n); + + // Avoid V8 deadcode (elimination) + assert.ok(ts); + break; + default: + throw new Error('Invalid kind'); + } +} diff --git a/benchmark/webstreams/pipe-to.js b/benchmark/webstreams/pipe-to.js new file mode 100644 index 00000000000000..a41b31b5e127ec --- /dev/null +++ b/benchmark/webstreams/pipe-to.js @@ -0,0 +1,36 @@ +'use strict'; +const common = require('../common.js'); +const { + ReadableStream, + WritableStream, +} = require('node:stream/web'); + +const bench = common.createBenchmark(main, { + n: [5e6], + highWaterMarkR: [512, 1024, 2048, 4096], + highWaterMarkW: [512, 1024, 2048, 4096], +}); + + +async function main({ n, highWaterMarkR, highWaterMarkW }) { + const b = Buffer.alloc(1024); + let i = 0; + const rs = new ReadableStream({ + highWaterMark: highWaterMarkR, + pull: function(controller) { + if (i++ === n) { + controller.enqueue(b); + } else { + controller.close(); + } + } + }); + const ws = new WritableStream({ + highWaterMark: highWaterMarkW, + write(chunk, controller) {}, + close() { bench.end(n); }, + }); + + bench.start(); + rs.pipeTo(ws); +} diff --git a/benchmark/webstreams/readable-async-iterator.js b/benchmark/webstreams/readable-async-iterator.js new file mode 100644 index 00000000000000..0d7e4737e3a15a --- /dev/null +++ b/benchmark/webstreams/readable-async-iterator.js @@ -0,0 +1,31 @@ +'use strict'; +const common = require('../common.js'); +const { + ReadableStream, +} = require('node:stream/web'); + +const bench = common.createBenchmark(main, { + n: [1e5], +}); + + +async function main({ n }) { + const rs = new ReadableStream({ + pull: function(controller) { + controller.enqueue(1); + } + }); + + let x = 0; + + bench.start(); + for await (const chunk of rs) { + x += chunk; + if (x > n) { + break; + } + } + // Use x to ensure V8 does not optimize away the loop as a noop. + console.assert(x); + bench.end(n); +} diff --git a/common.gypi b/common.gypi index 5bc3d8666abc85..5cdbee775864c8 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.6', + 'v8_embedder_string': '-node.8', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index a6dae354d4233f..c1d8815fc024ee 100755 --- a/configure.py +++ b/configure.py @@ -484,6 +484,12 @@ default=None, help='[Experimental] Enable V8 pointer compression (limits max heap to 4GB and breaks ABI compatibility)') +parser.add_argument('--disable-shared-readonly-heap', + action='store_true', + dest='disable_shared_ro_heap', + default=None, + help='Disable the shared read-only heap feature in V8') + parser.add_argument('--v8-options', action='store', dest='v8_options', @@ -805,6 +811,12 @@ help='Enable V8 short builtin calls support. This feature is enabled '+ 'on x86_64 platform by default.') +parser.add_argument('--v8-enable-snapshot-compression', + action='store_true', + dest='v8_enable_snapshot_compression', + default=None, + help='Enable the built-in snapshot compression in V8.') + parser.add_argument('--node-builtin-modules-path', action='store', dest='node_builtin_modules_path', @@ -1465,7 +1477,7 @@ def configure_v8(o): o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1 o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0 - o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1 + o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression or options.disable_shared_ro_heap else 1 o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) @@ -1482,6 +1494,8 @@ def configure_v8(o): o['variables']['v8_enable_hugepage'] = 1 if options.v8_enable_hugepage else 0 if options.v8_enable_short_builtin_calls or o['variables']['target_arch'] == 'x64': o['variables']['v8_enable_short_builtin_calls'] = 1 + if options.v8_enable_snapshot_compression: + o['variables']['v8_enable_snapshot_compression'] = 1 if options.v8_enable_object_print and options.v8_disable_object_print: raise Exception( 'Only one of the --v8-enable-object-print or --v8-disable-object-print options ' diff --git a/deps/icu-small/source/data/in/icudt72l.dat.bz2 b/deps/icu-small/source/data/in/icudt72l.dat.bz2 index 473242007ac5e6..1fc12b4e8cd277 100644 Binary files a/deps/icu-small/source/data/in/icudt72l.dat.bz2 and b/deps/icu-small/source/data/in/icudt72l.dat.bz2 differ diff --git a/deps/npm/README.md b/deps/npm/README.md index 7e4a5f38a7607f..b88882fadfee09 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -9,9 +9,9 @@ One of the following versions of [Node.js](https://nodejs.org/en/download/) must be installed to run **`npm`**: -* `12.x.x` >= `12.13.0` -* `14.x.x` >= `14.15.0` -* `16.0.0` or higher +* `14.x.x` >= `14.17.0` +* `16.x.x` >= `16.13.0` +* `18.0.0` or higher ### Installation diff --git a/deps/npm/bin/npx-cli.js b/deps/npm/bin/npx-cli.js index cb05e1cb706c6e..75090aed41f1fb 100755 --- a/deps/npm/bin/npx-cli.js +++ b/deps/npm/bin/npx-cli.js @@ -98,6 +98,7 @@ for (i = 3; i < process.argv.length; i++) { } if (removed.has(key)) { + // eslint-disable-next-line no-console console.error(`npx: the --${key} argument has been removed.`) sawRemovedFlags = true process.argv.splice(i, 1) @@ -122,6 +123,7 @@ for (i = 3; i < process.argv.length; i++) { } if (sawRemovedFlags) { + // eslint-disable-next-line no-console console.error('See `npm help exec` for more information') } diff --git a/deps/npm/docs/README.md b/deps/npm/docs/README.md new file mode 100644 index 00000000000000..5fc7ccf6cd60ac --- /dev/null +++ b/deps/npm/docs/README.md @@ -0,0 +1,5 @@ +# docs + +[![CI - docs](https://github.com/npm/cli/actions/workflows/ci-docs.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-docs.yml) + +Scripts to build the npm docs. diff --git a/deps/npm/docs/content/commands/npm-access.md b/deps/npm/docs/content/commands/npm-access.md index e707eb6f5e212d..f2078e1c9c38dd 100644 --- a/deps/npm/docs/content/commands/npm-access.md +++ b/deps/npm/docs/content/commands/npm-access.md @@ -7,15 +7,13 @@ description: Set access level on published packages ### Synopsis ```bash -npm access public [] -npm access restricted [] +npm access list packages [|| [] +npm access list collaborators [ []] +npm access get status [] +npm access set status=public|private [] +npm access set mfa=none|publish|automation [] npm access grant [] npm access revoke [] -npm access 2fa-required [] -npm access 2fa-not-required [] -npm access ls-packages [||] -npm access ls-collaborators [ []] -npm access edit [] ``` ### Description @@ -79,12 +77,17 @@ Management of teams and team memberships is done with the `npm team` command. ### Configuration -#### `registry` +#### `json` -* Default: "https://registry.npmjs.org/" -* Type: URL +* Default: false +* Type: Boolean -The base URL of the npm registry. +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. #### `otp` @@ -97,6 +100,13 @@ 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. +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + ### See Also * [`libnpmaccess`](https://npm.im/libnpmaccess) diff --git a/deps/npm/docs/content/commands/npm-adduser.md b/deps/npm/docs/content/commands/npm-adduser.md index 2d040c6a4a5792..f0cd57be25a2b6 100644 --- a/deps/npm/docs/content/commands/npm-adduser.md +++ b/deps/npm/docs/content/commands/npm-adduser.md @@ -9,29 +9,19 @@ description: Add a registry user account ```bash npm adduser -aliases: login, add-user +alias: add-user ``` Note: This command is unaware of workspaces. ### Description -Create or verify a user named `` in the specified registry, and -save the credentials to the `.npmrc` file. If no registry is specified, -the default registry will be used (see [`config`](/using-npm/config)). +Create a new user in the specified registry, and save the credentials to +the `.npmrc` file. If no registry is specified, the default registry +will be used (see [`registry`](/using-npm/registry)). -The username, password, and email are read in from prompts. - -To reset your password, go to - -To change your email address, go to - -You may use this command multiple times with the same user account to -authorize on a new machine. When authenticating on a new machine, -the username, password and email address must all match with -your existing record. - -`npm login` is an alias to `adduser` and behaves exactly the same way. +When using `legacy` for your `auth-type`, the username, password, and +email are read in from prompts. ### Configuration @@ -74,11 +64,8 @@ npm init --scope=@foo --yes #### `auth-type` -* Default: "legacy" -* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" - -NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version. +* Default: "web" +* Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/deps/npm/docs/content/commands/npm-audit.md b/deps/npm/docs/content/commands/npm-audit.md index ab6395502328ea..25c733243660e9 100644 --- a/deps/npm/docs/content/commands/npm-audit.md +++ b/deps/npm/docs/content/commands/npm-audit.md @@ -100,9 +100,9 @@ the path `/-/npm/v1/security/advisories/bulk`. Any packages in the tree that do not have a `version` field in their package.json file will be ignored. If any `--omit` options are specified -(either via the `--omit` config, or one of the shorthands such as -`--production`, `--only=dev`, and so on), then packages will be omitted -from the submitted payload as appropriate. +(either via the [`--omit` config](/using-npm/config#omit), or one of the +shorthands such as `--production`, `--only=dev`, and so on), then packages will +be omitted from the submitted payload as appropriate. If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the `Quick Audit` endpoint. @@ -179,7 +179,7 @@ vulnerabilities are found _or_ if the remediation is able to successfully fix all vulnerabilities. If vulnerabilities were found the exit code will depend on the -`audit-level` configuration setting. +[`audit-level` config](/using-npm/config#audit-level). ### Examples @@ -408,12 +408,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-bin.md b/deps/npm/docs/content/commands/npm-bin.md deleted file mode 100644 index 16a28a8e1c3ace..00000000000000 --- a/deps/npm/docs/content/commands/npm-bin.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: npm-bin -section: 1 -description: Display npm bin folder ---- - -### Synopsis - -```bash -npm bin -``` - -Note: This command is unaware of workspaces. - -### Description - -Print the folder where npm will install executables. - -### Configuration - -#### `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` - -### See Also - -* [npm prefix](/commands/npm-prefix) -* [npm root](/commands/npm-root) -* [npm folders](/configuring-npm/folders) -* [npm config](/commands/npm-config) -* [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-bugs.md b/deps/npm/docs/content/commands/npm-bugs.md index 153355fc694f7e..1f135fc6c933a9 100644 --- a/deps/npm/docs/content/commands/npm-bugs.md +++ b/deps/npm/docs/content/commands/npm-bugs.md @@ -16,8 +16,9 @@ alias: issues This command tries to guess at the likely location of a package's bug tracker URL or the `mailto` URL of the support email, and then tries to -open it using the `--browser` config param. If no package name is provided, it -will search for a `package.json` in the current folder and use the `name` property. +open it using the [`--browser` config](/using-npm/config#browser) param. If no +package name is provided, it will search for a `package.json` in the current +folder and use the `name` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index a6ef86dd22501f..a9d76179e81162 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -75,8 +75,7 @@ verify`. * Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` * Type: Path -The location of npm's cache directory. See [`npm -cache`](/commands/npm-cache) +The location of npm's cache directory. ### See Also diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 474e27cdd0d967..4a5caf7d0c691f 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -106,27 +106,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -298,12 +310,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index 311183b9170101..fe87abac903e8a 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -12,6 +12,7 @@ npm config get [ [ ...]] npm config delete [ ...] npm config list [--json] npm config edit +npm config fix alias: c ``` @@ -26,7 +27,7 @@ variables, `npmrc` files, and in some cases, the `package.json` file. See [npmrc](/configuring-npm/npmrc) for more information about the npmrc files. -See [config(7)](/using-npm/config) for a more thorough explanation of the +See [config](/using-npm/config) for a more thorough explanation of the mechanisms involved, and a full list of config options available. The `npm config` command can be used to update and edit the contents @@ -91,6 +92,16 @@ npm config edit Opens the config file in an editor. Use the `--global` flag to edit the global config. +#### fix + +```bash +npm config fix +``` + +Attempts to repair invalid configuration items. Usually this means +attaching authentication config (i.e. `_auth`, `_authToken`) to the +configured `registry`. + ### Configuration #### `json` @@ -121,8 +132,8 @@ folder instead of the current working directory. See #### `editor` -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems * Type: String The command to run for `npm edit` and `npm config edit`. diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index f7fff73dc1786e..80353bad5d0d7a 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -77,27 +77,39 @@ values in `package.json` you can run: `npm update --save` instead. ### Configuration -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -257,12 +269,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index d22831d2ce823e..e4a7fba665db38 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -19,8 +19,8 @@ alias: dist-tags Add, remove, and enumerate distribution tags on a package: * add: Tags the specified version of the package with the specified tag, - or the `--tag` config if not specified. If you have two-factor - authentication on auth-and-writes then you’ll need to include a + or the [`--tag` config](/using-npm/config#tag) if not specified. If you have + two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with `--otp `, or at the OTP prompt. diff --git a/deps/npm/docs/content/commands/npm-docs.md b/deps/npm/docs/content/commands/npm-docs.md index e4c88dc19d337c..027a101d121e6b 100644 --- a/deps/npm/docs/content/commands/npm-docs.md +++ b/deps/npm/docs/content/commands/npm-docs.md @@ -15,10 +15,10 @@ alias: home ### Description This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the `--browser` config -param. You can pass multiple package names at once. If no package name is -provided, it will search for a `package.json` in the current folder and use -the `name` property. +documentation URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. You can pass multiple +package names at once. If no package name is provided, it will search for a +`package.json` in the current folder and use the `name` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-doctor.md b/deps/npm/docs/content/commands/npm-doctor.md index 34d925bce91019..bd399ce494a6c4 100644 --- a/deps/npm/docs/content/commands/npm-doctor.md +++ b/deps/npm/docs/content/commands/npm-doctor.md @@ -7,7 +7,7 @@ description: Check your npm environment ### Synopsis ```bash -npm doctor +npm doctor [ping] [registry] [versions] [environment] [permissions] [cache] ``` Note: This command is unaware of workspaces. @@ -33,8 +33,10 @@ Also, in addition to this, there are also very many issue reports due to using old versions of npm. Since npm is constantly improving, running `npm@latest` is better than an old version. -`npm doctor` verifies the following items in your environment, and if there -are any recommended changes, it will display them. +`npm doctor` verifies the following items in your environment, and if +there are any recommended changes, it will display them. By default npm +runs all of these checks. You can limit what checks are ran by +specifying them as extra arguments. #### `npm ping` diff --git a/deps/npm/docs/content/commands/npm-edit.md b/deps/npm/docs/content/commands/npm-edit.md index 9f6750ff175415..04a4d15b5afcd9 100644 --- a/deps/npm/docs/content/commands/npm-edit.md +++ b/deps/npm/docs/content/commands/npm-edit.md @@ -29,8 +29,8 @@ changes to your locally installed copy. #### `editor` -* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on - Windows, or 'vim' on Unix systems +* Default: The EDITOR or VISUAL environment variables, or + '%SYSTEMROOT%\notepad.exe' on Windows, or 'vi' on Unix systems * Type: String The command to run for `npm edit` and `npm config edit`. diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index b968671ed84670..af19ec5f077838 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -33,10 +33,11 @@ specified multiple times, to execute the supplied command in an environment where all specified packages are available. If any requested packages are not present in the local project -dependencies, then they are installed to a folder in the npm cache, which -is added to the `PATH` environment variable in the executed process. A -prompt is printed (which can be suppressed by providing either `--yes` or -`--no`). +dependencies, then a prompt is printed, which can be suppressed by +providing either `--yes` or `--no`. When standard input is not a TTY or a +CI environment is detected, `--yes` is assumed. The requested packages are +installed to a folder in the npm cache, which is added to the `PATH` +environment variable in the executed process. Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will @@ -211,7 +212,8 @@ $ npx -c 'eslint && say "hooray, lint passed"' ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. If no positional argument or `--call` option is provided, it will open an @@ -242,9 +244,9 @@ Assuming the workspace configuration is properly set up at the root level ``` You can execute an arbitrary command from a package in the context of each of -the configured workspaces when using the `workspaces` configuration options, -in this example we're using **eslint** to lint any js file found within each -workspace folder: +the configured workspaces when using the +[`workspaces` config options](/using-npm/config#workspace), in this example +we're using **eslint** to lint any js file found within each workspace folder: ``` npm exec --ws -- eslint ./*.js diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index 723f04cfb11887..a3ef44eb5b7fb1 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -17,27 +17,39 @@ duplications, without actually changing the package tree. ### Configuration -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -184,12 +196,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 25a6735ec75473..0db66f49ad65b1 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -16,9 +16,10 @@ This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided -then it tries to open its funding url using the `--browser` config -param; if there are multiple funding sources for the package, the user -will be instructed to pass the `--which` option to disambiguate. +then it tries to open its funding url using the +[`--browser` config](/using-npm/config#browser) param; if there are multiple +funding sources for the package, the user will be instructed to pass the +`--which` option to disambiguate. The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the @@ -29,7 +30,8 @@ same shape of the output from `npm ls`. ### Workspaces support It's possible to filter the results to only include a single workspace -and its dependencies using the `workspace` config option. +and its dependencies using the +[`workspace` config](/using-npm/config#workspace) option. #### Example: 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 c6c7f2196da2e5..9fd7c267b102f5 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -52,27 +52,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -244,12 +256,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index aa1ff35bc45892..5642472630b530 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -53,27 +53,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -245,12 +257,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index dc935de70aaf0f..3604aab4b940f2 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -118,7 +118,7 @@ into a tarball (b). * `npm install [<@scope>/]`: Do a `@` install, where `` is the "tag" config. (See - [`config`](/using-npm/config). The config's default value is `latest`.) + [`config`](/using-npm/config#tag). The config's default value is `latest`.) In most cases, this will install the version of the modules tagged as `latest` on the npm registry. @@ -443,27 +443,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `omit` @@ -635,12 +647,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### Algorithm diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 07917bc833003b..09459cc0ca8a50 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -144,27 +144,39 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` -#### `global-style` +#### `install-strategy` + +* Default: "hoisted" +* Type: "hoisted", "nested", or "shallow" + +Sets the strategy for installing packages in node_modules. hoisted +(default): Install non-duplicated in top-level, and duplicated as necessary +within directory structure. nested: (formerly --legacy-bundling) install in +place, no hoisting. shallow (formerly --global-style) only install direct +deps at top-level. linked: (coming soon) install in node_modules/.store, +link in place, unhoisted. + +#### `legacy-bundling` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=nested` -Causes npm to install the package into your local `node_modules` folder with -the same layout it uses with the global `node_modules` folder. Only your -direct dependencies will show in `node_modules` and everything they depend -on will be flattened in their `node_modules` folders. This obviously will -eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` -will be preferred. +Instead of hoisting package installs in `node_modules`, install packages in +the same manner that they are depended on. This may cause very deep +directory structures and duplicate package installs as there is no +de-duplicating. Sets `--install-strategy=nested`. -#### `legacy-bundling` +#### `global-style` * Default: false * Type: Boolean +* DEPRECATED: This option has been deprecated in favor of + `--install-strategy=shallow` -Causes npm to install the package such that versions of npm prior to 1.4, -such as the one included with node 0.8, can install the package. This -eliminates all automatic deduping. If used with `global-style` this option -will be preferred. +Only install direct dependencies in the top level `node_modules`, but hoist +on deeper dependendencies. Sets `--install-strategy=shallow`. #### `strict-peer-deps` @@ -324,12 +336,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-login.md b/deps/npm/docs/content/commands/npm-login.md new file mode 100644 index 00000000000000..4feb7150400268 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-login.md @@ -0,0 +1,87 @@ +--- +title: npm-login +section: 1 +description: Login to a registry user account +--- + +### Synopsis + +```bash +npm login +``` + +Note: This command is unaware of workspaces. + +### Description + +Verify a user in the specified registry, and save the credentials to the +`.npmrc` file. If no registry is specified, the default registry will be +used (see [`config`](/using-npm/config)). + +When using `legacy` for your `auth-type`, the username and password, are +read in from prompts. + +To reset your password, go to + +To change your email address, go to + +You may use this command multiple times with the same user account to +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record. + +### Configuration + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) +* [npm profile](/commands/npm-profile) diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 43d4eb7d6791cb..2ae99e7e7c16e3 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show: ```bash -npm@8.19.3 /path/to/npm +npm@9.2.0 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` @@ -236,12 +236,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index 519104457df79e..484aabfca5431c 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -144,7 +144,8 @@ Returned values are always in **json** format. ### Workspaces support You can set/get/delete items across your configured workspaces by using the -`workspace` or `workspaces` config options. +[`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) config options. For example, setting a `funding` value across all configured workspaces of a project: diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 95946d9dc969ca..0cd540f5c2d429 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -157,12 +157,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 4963cf158a660d..09756aedf02724 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -103,19 +103,19 @@ tarball that will be compared with the local files by default. #### `access` -* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Default: 'public' for new packages, existing packages it will not change the + current level * Type: null, "restricted", or "public" -When publishing scoped packages, the access level defaults to `restricted`. -If you want your scoped package to be publicly viewable (and installable) -set `--access=public`. The only valid values for `access` are `public` and -`restricted`. Unscoped packages _always_ have an access level of `public`. +If do not want your scoped package to be publicly viewable (and installable) +set `--access=restricted`. -Note: Using the `--access` flag on the `npm publish` command will only set -the package access level on the initial publish of the package. Any -subsequent `npm publish` commands using the `--access` flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use `npm access`. +Unscoped packages can not be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. #### `dry-run` diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 75f1efe1b69641..a6955ec80c7e7c 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -130,12 +130,12 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean -When set file: protocol dependencies that exist outside of the project root -will be packed and installed as regular dependencies instead of creating a -symlink. This option has no effect on workspaces. +When set file: protocol dependencies will be packed and installed as regular +dependencies instead of creating a symlink. This option has no effect on +workspaces. ### See Also diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index eb55780de907aa..10ddc139f8535a 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -13,9 +13,10 @@ npm repo [ [ ...]] ### Description This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the `--browser` config -param. If no package name is provided, it will search for a `package.json` -in the current folder and use the `repository` property. +repository URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. If no package name is +provided, it will search for a `package.json` in the current folder and use the +`repository` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 16a5c693f9ba25..26011e4f7959a6 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -59,7 +59,8 @@ The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the `/bin/sh` command, on Windows it is `cmd.exe`. The actual shell referred to by `/bin/sh` also depends on the system. -You can customize the shell with the `script-shell` configuration. +You can customize the shell with the +[`script-shell` config](/using-npm/config#script-shell). Scripts are run from the root of the package folder, regardless of what the current working directory is when `npm run` is called. If you want your @@ -76,7 +77,8 @@ forgotten. ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from a package's `"scripts"` object in the context of the specified workspaces. If no `"command"` is provided, it will list the available scripts for each of these configured workspaces. @@ -105,7 +107,8 @@ Assuming the workspace configuration is properly set up at the root level ``` And that each of the configured workspaces has a configured `test` script, -we can run tests in all of them using the `workspaces` config: +we can run tests in all of them using the +[`workspaces` config](/using-npm/config#workspaces): ``` npm test --workspaces diff --git a/deps/npm/docs/content/commands/npm-set-script.md b/deps/npm/docs/content/commands/npm-set-script.md deleted file mode 100644 index 9bbf09ea9076ad..00000000000000 --- a/deps/npm/docs/content/commands/npm-set-script.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: npm-set-script -section: 1 -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. - -```bash -npm set-script [