From d0e455044ef68b9b3bcf10776cab36e2e8edf06a Mon Sep 17 00:00:00 2001 From: per4uk Date: Wed, 10 Jan 2024 22:26:07 +0000 Subject: [PATCH 01/53] module: fix `--preserve-symlinks-main` Fixes resolving main module when the `argv[1]` was pointing to a symlink without its file extension. PR-URL: https://github.com/nodejs/node/pull/51312 Fixes: https://github.com/nodejs/node/issues/41000 Reviewed-By: Antoine du Hamel --- lib/internal/modules/cjs/loader.js | 6 +- .../test-esm-preserve-symlinks-main.js | 73 ++++++++++++------- 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 44abacb41a34306..e5b47d8874aeb77 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -469,15 +469,15 @@ function tryPackage(requestPath, exts, isMain, originalPath) { } /** - * Check if the file exists and is not a directory if using `--preserve-symlinks` and `isMain` is false, keep symlinks - * intact, otherwise resolve to the absolute realpath. + * Check if the file exists and is not a directory if using `--preserve-symlinks` and `isMain` is false or + * `--preserve-symlinks-main` and `isMain` is true , keep symlinks intact, otherwise resolve to the absolute realpath. * @param {string} requestPath The path to the file to load. * @param {boolean} isMain Whether the file is the main module. */ function tryFile(requestPath, isMain) { const rc = _stat(requestPath); if (rc !== 0) { return; } - if (getOptionValue('--preserve-symlinks') && !isMain) { + if (getOptionValue(isMain ? '--preserve-symlinks-main' : '--preserve-symlinks')) { return path.resolve(requestPath); } return toRealPath(requestPath); diff --git a/test/es-module/test-esm-preserve-symlinks-main.js b/test/es-module/test-esm-preserve-symlinks-main.js index 6f921f656fe22f5..5eb58ca8c1bbbdd 100644 --- a/test/es-module/test-esm-preserve-symlinks-main.js +++ b/test/es-module/test-esm-preserve-symlinks-main.js @@ -1,12 +1,19 @@ 'use strict'; -const common = require('../common'); -const { spawn } = require('child_process'); -const assert = require('assert'); -const path = require('path'); -const fs = require('fs'); - +const { spawnPromisified, skip } = require('../common'); const tmpdir = require('../common/tmpdir'); + +// Invoke the main file via a symlink. In this case --preserve-symlinks-main +// dictates that it'll resolve relative imports in the main file relative to +// the symlink, and not relative to the symlink target; the file structure set +// up below requires this to not crash when loading ./submodule_link.js + +const assert = require('node:assert'); +const fs = require('node:fs'); +const path = require('node:path'); +const { execPath } = require('node:process'); +const { describe, it } = require('node:test'); + tmpdir.refresh(); const tmpDir = tmpdir.path; @@ -14,7 +21,7 @@ fs.mkdirSync(path.join(tmpDir, 'nested')); fs.mkdirSync(path.join(tmpDir, 'nested2')); const entry = path.join(tmpDir, 'nested', 'entry.js'); -const entry_link_absolute_path = path.join(tmpDir, 'link.js'); +const entry_link_absolute_path = path.join(tmpDir, 'index.js'); const submodule = path.join(tmpDir, 'nested2', 'submodule.js'); const submodule_link_absolute_path = path.join(tmpDir, 'submodule_link.js'); @@ -31,27 +38,39 @@ try { fs.symlinkSync(submodule, submodule_link_absolute_path); } catch (err) { if (err.code !== 'EPERM') throw err; - common.skip('insufficient privileges for symlinks'); + skip('insufficient privileges for symlinks'); } -function doTest(flags, done) { - // Invoke the main file via a symlink. In this case --preserve-symlinks-main - // dictates that it'll resolve relative imports in the main file relative to - // the symlink, and not relative to the symlink target; the file structure set - // up above requires this to not crash when loading ./submodule_link.js - spawn(process.execPath, [ - '--preserve-symlinks', - '--preserve-symlinks-main', - entry_link_absolute_path, - ], { stdio: 'inherit' }) - .on('exit', (code) => { - assert.strictEqual(code, 0); - done(); - }); -} +describe('Invoke the main file via a symlink.', { concurrency: true }, () => { + it('should resolve relative imports in the main file', async () => { + const { code } = await spawnPromisified(execPath, [ + '--preserve-symlinks', + '--preserve-symlinks-main', + entry_link_absolute_path, + ]); + + assert.strictEqual(code, 0); + }); + + it('should resolve relative imports in the main file when file extension is omitted', async () => { + const entry_link_absolute_path_without_ext = path.join(tmpDir, 'index'); + + const { code } = await spawnPromisified(execPath, [ + '--preserve-symlinks', + '--preserve-symlinks-main', + entry_link_absolute_path_without_ext, + ]); + + assert.strictEqual(code, 0); + }); + + it('should resolve relative imports in the main file when filename(index.js) is omitted', async () => { + const { code } = await spawnPromisified(execPath, [ + '--preserve-symlinks', + '--preserve-symlinks-main', + tmpDir, + ]); -// First test the commonjs module loader -doTest([], () => { - // Now test the new loader - doTest([], () => {}); + assert.strictEqual(code, 0); + }); }); From d102d16e98a8845cba96157b6396bd448241e47c Mon Sep 17 00:00:00 2001 From: Kohei Ueno Date: Thu, 11 Jan 2024 13:41:26 +0900 Subject: [PATCH 02/53] tools: update inspector_protocol to 83b1154 PR-URL: https://github.com/nodejs/node/pull/51309 Reviewed-By: Stephen Belanger --- src/inspector/node_inspector.gypi | 1 - src/inspector/tracing_agent.cc | 46 +++--- tools/inspector_protocol/code_generator.py | 1 - .../inspector_protocol/inspector_protocol.gni | 1 - .../inspector_protocol.gypi | 1 - tools/inspector_protocol/lib/Array_h.template | 138 ------------------ .../inspector_protocol/lib/Forward_h.template | 21 ++- .../lib/ValueConversions_h.template | 66 +++++++++ .../inspector_protocol/lib/Values_h.template | 1 + 9 files changed, 110 insertions(+), 166 deletions(-) delete mode 100644 tools/inspector_protocol/lib/Array_h.template diff --git a/src/inspector/node_inspector.gypi b/src/inspector/node_inspector.gypi index ba24e6acfc0744d..a2dfdcb42db1966 100644 --- a/src/inspector/node_inspector.gypi +++ b/src/inspector/node_inspector.gypi @@ -39,7 +39,6 @@ ], 'node_protocol_files': [ '<(protocol_tool_path)/lib/Allocator_h.template', - '<(protocol_tool_path)/lib/Array_h.template', '<(protocol_tool_path)/lib/base_string_adapter_cc.template', '<(protocol_tool_path)/lib/base_string_adapter_h.template', '<(protocol_tool_path)/lib/DispatcherBase_cpp.template', diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index cdbdd63f8aff9f4..e7b6d3b3ea63bdc 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -147,8 +147,8 @@ DispatchResponse TracingAgent::start( std::set categories_set; protocol::Array* categories = traceConfig->getIncludedCategories(); - for (size_t i = 0; i < categories->length(); i++) - categories_set.insert(categories->get(i)); + for (size_t i = 0; i < categories->size(); i++) + categories_set.insert((*categories)[i]); if (categories_set.empty()) return DispatchResponse::Error("At least one category should be enabled"); @@ -172,29 +172,29 @@ DispatchResponse TracingAgent::stop() { DispatchResponse TracingAgent::getCategories( std::unique_ptr>* categories) { - *categories = Array::create(); + *categories = std::make_unique>(); protocol::Array* categories_list = categories->get(); // In alphabetical order - categories_list->addItem("node"); - categories_list->addItem("node.async_hooks"); - categories_list->addItem("node.bootstrap"); - categories_list->addItem("node.console"); - categories_list->addItem("node.dns.native"); - categories_list->addItem("node.environment"); - categories_list->addItem("node.fs.async"); - categories_list->addItem("node.fs.sync"); - categories_list->addItem("node.fs_dir.async"); - categories_list->addItem("node.fs_dir.sync"); - categories_list->addItem("node.http"); - categories_list->addItem("node.net.native"); - categories_list->addItem("node.perf"); - categories_list->addItem("node.perf.timerify"); - categories_list->addItem("node.perf.usertiming"); - categories_list->addItem("node.promises.rejections"); - categories_list->addItem("node.threadpoolwork.async"); - categories_list->addItem("node.threadpoolwork.sync"); - categories_list->addItem("node.vm.script"); - categories_list->addItem("v8"); + categories_list->emplace_back("node"); + categories_list->emplace_back("node.async_hooks"); + categories_list->emplace_back("node.bootstrap"); + categories_list->emplace_back("node.console"); + categories_list->emplace_back("node.dns.native"); + categories_list->emplace_back("node.environment"); + categories_list->emplace_back("node.fs.async"); + categories_list->emplace_back("node.fs.sync"); + categories_list->emplace_back("node.fs_dir.async"); + categories_list->emplace_back("node.fs_dir.sync"); + categories_list->emplace_back("node.http"); + categories_list->emplace_back("node.net.native"); + categories_list->emplace_back("node.perf"); + categories_list->emplace_back("node.perf.timerify"); + categories_list->emplace_back("node.perf.usertiming"); + categories_list->emplace_back("node.promises.rejections"); + categories_list->emplace_back("node.threadpoolwork.async"); + categories_list->emplace_back("node.threadpoolwork.sync"); + categories_list->emplace_back("node.vm.script"); + categories_list->emplace_back("v8"); return DispatchResponse::OK(); } diff --git a/tools/inspector_protocol/code_generator.py b/tools/inspector_protocol/code_generator.py index 0b8baea0ae710e4..a6e163c6fe911f5 100755 --- a/tools/inspector_protocol/code_generator.py +++ b/tools/inspector_protocol/code_generator.py @@ -638,7 +638,6 @@ def main(): "Object_h.template", "ValueConversions_h.template", "Maybe_h.template", - "Array_h.template", "DispatcherBase_h.template", "Parser_h.template", "encoding_h.template", diff --git a/tools/inspector_protocol/inspector_protocol.gni b/tools/inspector_protocol/inspector_protocol.gni index d612fb6aebb52ce..3e934526b82ae12 100644 --- a/tools/inspector_protocol/inspector_protocol.gni +++ b/tools/inspector_protocol/inspector_protocol.gni @@ -36,7 +36,6 @@ template("inspector_protocol_generate") { "$inspector_protocol_dir/lib/encoding_h.template", "$inspector_protocol_dir/lib/encoding_cpp.template", "$inspector_protocol_dir/lib/Allocator_h.template", - "$inspector_protocol_dir/lib/Array_h.template", "$inspector_protocol_dir/lib/DispatcherBase_cpp.template", "$inspector_protocol_dir/lib/DispatcherBase_h.template", "$inspector_protocol_dir/lib/ErrorSupport_cpp.template", diff --git a/tools/inspector_protocol/inspector_protocol.gypi b/tools/inspector_protocol/inspector_protocol.gypi index d614474e69c32e4..c11386dc05174e6 100644 --- a/tools/inspector_protocol/inspector_protocol.gypi +++ b/tools/inspector_protocol/inspector_protocol.gypi @@ -8,7 +8,6 @@ 'lib/encoding_h.template', 'lib/encoding_cpp.template', 'lib/Allocator_h.template', - 'lib/Array_h.template', 'lib/DispatcherBase_cpp.template', 'lib/DispatcherBase_h.template', 'lib/ErrorSupport_cpp.template', diff --git a/tools/inspector_protocol/lib/Array_h.template b/tools/inspector_protocol/lib/Array_h.template deleted file mode 100644 index c420a0f7e9650a7..000000000000000 --- a/tools/inspector_protocol/lib/Array_h.template +++ /dev/null @@ -1,138 +0,0 @@ -// This file is generated by Array_h.template. - -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef {{"_".join(config.protocol.namespace)}}_Array_h -#define {{"_".join(config.protocol.namespace)}}_Array_h - -//#include "ErrorSupport.h" -//#include "Forward.h" -//#include "ValueConversions.h" -//#include "Values.h" - -{% for namespace in config.protocol.namespace %} -namespace {{namespace}} { -{% endfor %} - -template -class Array { -public: - static std::unique_ptr> create() - { - return std::unique_ptr>(new Array()); - } - - static std::unique_ptr> fromValue(protocol::Value* value, ErrorSupport* errors) - { - protocol::ListValue* array = ListValue::cast(value); - if (!array) { - errors->addError("array expected"); - return nullptr; - } - std::unique_ptr> result(new Array()); - errors->push(); - for (size_t i = 0; i < array->size(); ++i) { - errors->setName(StringUtil::fromInteger(i)); - std::unique_ptr item = ValueConversions::fromValue(array->at(i), errors); - result->m_vector.push_back(std::move(item)); - } - errors->pop(); - if (errors->hasErrors()) - return nullptr; - return result; - } - - void addItem(std::unique_ptr value) - { - m_vector.push_back(std::move(value)); - } - - size_t length() - { - return m_vector.size(); - } - - T* get(size_t index) - { - return m_vector[index].get(); - } - - std::unique_ptr toValue() - { - std::unique_ptr result = ListValue::create(); - for (auto& item : m_vector) - result->pushValue(ValueConversions::toValue(item)); - return result; - } - -private: - std::vector> m_vector; -}; - -template -class ArrayBase { -public: - static std::unique_ptr> create() - { - return std::unique_ptr>(new Array()); - } - - static std::unique_ptr> fromValue(protocol::Value* value, ErrorSupport* errors) - { - protocol::ListValue* array = ListValue::cast(value); - if (!array) { - errors->addError("array expected"); - return nullptr; - } - errors->push(); - std::unique_ptr> result(new Array()); - for (size_t i = 0; i < array->size(); ++i) { - errors->setName(StringUtil::fromInteger(i)); - T item = ValueConversions::fromValue(array->at(i), errors); - result->m_vector.push_back(item); - } - errors->pop(); - if (errors->hasErrors()) - return nullptr; - return result; - } - - void addItem(const T& value) - { - m_vector.push_back(value); - } - - size_t length() - { - return m_vector.size(); - } - - T get(size_t index) - { - return m_vector[index]; - } - - std::unique_ptr toValue() - { - std::unique_ptr result = ListValue::create(); - for (auto& item : m_vector) - result->pushValue(ValueConversions::toValue(item)); - return result; - } - -private: - std::vector m_vector; -}; - -template<> class Array : public ArrayBase {}; -template<> class Array : public ArrayBase {}; -template<> class Array : public ArrayBase {}; -template<> class Array : public ArrayBase {}; - -{% for namespace in config.protocol.namespace %} -} // namespace {{namespace}} -{% endfor %} - -#endif // !defined({{"_".join(config.protocol.namespace)}}_Array_h) diff --git a/tools/inspector_protocol/lib/Forward_h.template b/tools/inspector_protocol/lib/Forward_h.template index 746ba20bba15f45..a6c4b12feca0138 100644 --- a/tools/inspector_protocol/lib/Forward_h.template +++ b/tools/inspector_protocol/lib/Forward_h.template @@ -22,7 +22,6 @@ namespace {{namespace}} { {% endfor %} -template class Array; class DictionaryValue; class DispatchResponse; class ErrorSupport; @@ -35,6 +34,26 @@ class StringValue; class UberDispatcher; class Value; +namespace detail { +template +struct ArrayTypedef { typedef std::vector> type; }; + +template <> +struct ArrayTypedef { typedef std::vector type; }; + +template <> +struct ArrayTypedef { typedef std::vector type; }; + +template <> +struct ArrayTypedef { typedef std::vector type; }; + +template <> +struct ArrayTypedef { typedef std::vector type; }; +} // namespace detail + +template +using Array = typename detail::ArrayTypedef::type; + {% for namespace in config.protocol.namespace %} } // namespace {{namespace}} {% endfor %} diff --git a/tools/inspector_protocol/lib/ValueConversions_h.template b/tools/inspector_protocol/lib/ValueConversions_h.template index 2ee5b724545a337..63baf689c6e11c4 100644 --- a/tools/inspector_protocol/lib/ValueConversions_h.template +++ b/tools/inspector_protocol/lib/ValueConversions_h.template @@ -128,6 +128,72 @@ struct ValueConversions { } }; +template +struct ValueConversions>> { + static std::unique_ptr>> fromValue(protocol::Value* value, ErrorSupport* errors) { + protocol::ListValue* array = ListValue::cast(value); + if (!array) { + errors->addError("array expected"); + return nullptr; + } + errors->push(); + std::unique_ptr>> result( + new std::vector>()); + result->reserve(array->size()); + for (size_t i = 0; i < array->size(); ++i) { + errors->setName(StringUtil::fromInteger(i)); + auto item = ValueConversions::fromValue(array->at(i), errors); + result->emplace_back(std::move(item)); + } + errors->pop(); + if (errors->hasErrors()) + return nullptr; + return result; + } + + static std::unique_ptr toValue(std::vector>* v) + { + std::unique_ptr result = ListValue::create(); + result->reserve(v->size()); + for (auto& item : *v) + result->pushValue(ValueConversions::toValue(item.get())); + return result; + } + +}; + +template +struct ValueConversions> { + static std::unique_ptr> fromValue(protocol::Value* value, ErrorSupport* errors) { + protocol::ListValue* array = ListValue::cast(value); + if (!array) { + errors->addError("array expected"); + return nullptr; + } + errors->push(); + std::unique_ptr> result(new std::vector()); + result->reserve(array->size()); + for (size_t i = 0; i < array->size(); ++i) { + errors->setName(StringUtil::fromInteger(i)); + auto item = ValueConversions::fromValue(array->at(i), errors); + result->emplace_back(std::move(item)); + } + errors->pop(); + if (errors->hasErrors()) + return nullptr; + return result; + } + + static std::unique_ptr toValue(std::vector* v) + { + std::unique_ptr result = ListValue::create(); + result->reserve(v->size()); + for (auto& item : *v) + result->pushValue(ValueConversions::toValue(item)); + return result; + } +}; + template<> struct ValueConversions { static std::unique_ptr fromValue(protocol::Value* value, ErrorSupport* errors) diff --git a/tools/inspector_protocol/lib/Values_h.template b/tools/inspector_protocol/lib/Values_h.template index 4a2e58f4cd6850c..4d6fde07d4df2c7 100644 --- a/tools/inspector_protocol/lib/Values_h.template +++ b/tools/inspector_protocol/lib/Values_h.template @@ -271,6 +271,7 @@ public: Value* at(size_t index); size_t size() const { return m_data.size(); } + void reserve(size_t capacity) { m_data.reserve(capacity); } private: ListValue(); From 273c89263889508620588e7270d5e29b0b49779e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 11 Jan 2024 12:31:14 +0000 Subject: [PATCH 03/53] test: fix flaky conditions for ppc64 SEA tests In test status files, `$system` will be the OS and not the arch (which would be `$arch`). Add missing single-executable-application test to the list of tests marked flaky on Linux ppc64le. PR-URL: https://github.com/nodejs/node/pull/51422 Refs: https://github.com/nodejs/node/pull/50828 Refs: https://github.com/nodejs/node/issues/50740 Reviewed-By: Rafael Gonzaga Reviewed-By: Michael Dawson Reviewed-By: Yagiz Nizipli Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca --- test/sequential/sequential.status | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status index c3f2cda226dcbec..c8c9428e7df3e62 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -47,8 +47,9 @@ test-watch-mode-inspect: SKIP # https://github.com/nodejs/node/issues/41286 test-performance-eventloopdelay: PASS, FLAKY -[$system==ppc || $system==ppc64] +[$system==linux && $arch==ppc64] # https://github.com/nodejs/node/issues/50740 +test-single-executable-application-disable-experimental-sea-warning: PASS, FLAKY test-single-executable-application-empty: PASS, FLAKY test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY test-single-executable-application-snapshot: PASS, FLAKY From af8ba373354137aef046b38d80cdccbcac8e95a7 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Thu, 11 Jan 2024 06:28:56 -0800 Subject: [PATCH 04/53] deps: upgrade npm to 10.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51431 Reviewed-By: Luke Karrys Reviewed-By: Michaël Zasso Reviewed-By: Marco Ippolito --- deps/npm/docs/README.md | 5 - .../docs/content/commands/npm-install-test.md | 10 + deps/npm/docs/content/commands/npm-install.md | 10 + deps/npm/docs/content/commands/npm-ls.md | 2 +- deps/npm/docs/content/commands/npm-publish.md | 2 +- deps/npm/docs/content/commands/npm-sbom.md | 2 +- .../docs/content/commands/npm-unpublish.md | 8 +- deps/npm/docs/content/commands/npm.md | 2 +- deps/npm/docs/content/commands/npx.md | 3 +- .../npm/docs/content/configuring-npm/npmrc.md | 8 +- .../content/configuring-npm/package-json.md | 36 +- deps/npm/docs/content/using-npm/config.md | 12 +- deps/npm/docs/lib/index.js | 189 ++ .../output/commands/npm-install-test.html | 9 +- .../npm/docs/output/commands/npm-install.html | 9 +- deps/npm/docs/output/commands/npm-ls.html | 2 +- .../npm/docs/output/commands/npm-publish.html | 2 +- deps/npm/docs/output/commands/npm-sbom.html | 2 +- .../docs/output/commands/npm-unpublish.html | 7 +- deps/npm/docs/output/commands/npm.html | 2 +- deps/npm/docs/output/commands/npx.html | 3 +- .../docs/output/configuring-npm/npmrc.html | 8 +- .../output/configuring-npm/package-json.html | 35 +- deps/npm/docs/output/using-npm/config.html | 11 +- deps/npm/lib/commands/install.js | 1 + deps/npm/lib/commands/unpublish.js | 109 +- deps/npm/lib/commands/view.js | 14 +- deps/npm/lib/npm.js | 14 +- deps/npm/lib/utils/display.js | 95 +- deps/npm/lib/utils/log-file.js | 2 + deps/npm/lib/utils/open-url-prompt.js | 5 +- deps/npm/lib/utils/reify-output.js | 2 +- deps/npm/lib/utils/sbom-spdx.js | 8 +- deps/npm/lib/utils/update-notifier.js | 1 + deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-audit.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-ci.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-diff.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-exec.1 | 2 +- deps/npm/man/man1/npm-explain.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-find-dupes.1 | 2 +- deps/npm/man/man1/npm-fund.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-hook.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-ci-test.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 12 +- deps/npm/man/man1/npm-install.1 | 12 +- deps/npm/man/man1/npm-link.1 | 2 +- deps/npm/man/man1/npm-login.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 4 +- deps/npm/man/man1/npm-org.1 | 2 +- deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 2 +- deps/npm/man/man1/npm-pkg.1 | 2 +- deps/npm/man/man1/npm-prefix.1 | 2 +- deps/npm/man/man1/npm-profile.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 4 +- deps/npm/man/man1/npm-query.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- deps/npm/man/man1/npm-sbom.1 | 4 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 2 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-token.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 6 +- deps/npm/man/man1/npm-unstar.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man1/npx.1 | 4 +- deps/npm/man/man5/folders.5 | 2 +- deps/npm/man/man5/install.5 | 2 +- deps/npm/man/man5/npm-global.5 | 2 +- deps/npm/man/man5/npm-json.5 | 45 +- deps/npm/man/man5/npm-shrinkwrap-json.5 | 2 +- deps/npm/man/man5/npmrc.5 | 10 +- deps/npm/man/man5/package-json.5 | 45 +- deps/npm/man/man5/package-lock-json.5 | 2 +- deps/npm/man/man7/config.7 | 14 +- deps/npm/man/man7/dependency-selectors.7 | 2 +- deps/npm/man/man7/developers.7 | 2 +- deps/npm/man/man7/logging.7 | 2 +- deps/npm/man/man7/orgs.7 | 2 +- deps/npm/man/man7/package-spec.7 | 2 +- deps/npm/man/man7/registry.7 | 2 +- deps/npm/man/man7/removal.7 | 2 +- deps/npm/man/man7/scope.7 | 2 +- deps/npm/man/man7/scripts.7 | 2 +- deps/npm/man/man7/workspaces.7 | 2 +- .../arborist/lib/arborist/load-actual.js | 2 +- .../@npmcli/arborist/lib/arborist/reify.js | 4 +- .../@npmcli/arborist/lib/shrinkwrap.js | 468 ++-- .../@npmcli/arborist/lib/tree-check.js | 2 +- .../@npmcli/arborist/lib/yarn-lock.js | 8 +- .../@npmcli/arborist/package.json | 12 +- .../config/lib/definitions/definitions.js | 12 +- .../node_modules/@npmcli/config/package.json | 11 +- .../npm/node_modules/@npmcli/git/lib/spawn.js | 2 +- .../npm/node_modules/@npmcli/git/package.json | 16 +- .../@npmcli/promise-spawn/lib/index.js | 14 +- .../@npmcli/promise-spawn/package.json | 14 +- .../@npmcli/run-script/lib/signal-manager.js | 11 +- .../@npmcli/run-script/package.json | 8 +- .../npm/node_modules/abort-controller/LICENSE | 21 - .../node_modules/abort-controller/browser.js | 13 - .../node_modules/abort-controller/browser.mjs | 11 - .../abort-controller/dist/abort-controller.js | 127 - .../dist/abort-controller.mjs | 118 - .../dist/abort-controller.umd.js | 5 - .../abort-controller/package.json | 97 - .../node_modules/abort-controller/polyfill.js | 21 - .../abort-controller/polyfill.mjs | 19 - .../are-we-there-yet/lib/tracker-stream.js | 28 +- .../are-we-there-yet/package.json | 12 +- deps/npm/node_modules/base64-js/LICENSE | 21 - .../node_modules/base64-js/base64js.min.js | 1 - deps/npm/node_modules/base64-js/index.js | 150 -- deps/npm/node_modules/base64-js/package.json | 47 - deps/npm/node_modules/buffer/AUTHORS.md | 73 - deps/npm/node_modules/buffer/LICENSE | 21 - deps/npm/node_modules/buffer/index.js | 2106 ----------------- deps/npm/node_modules/buffer/package.json | 93 - .../node_modules/cacache/lib/content/read.js | 17 +- .../node_modules/cacache/lib/content/write.js | 1 + deps/npm/node_modules/cacache/package.json | 18 +- deps/npm/node_modules/delegates/History.md | 22 - deps/npm/node_modules/delegates/License | 20 - deps/npm/node_modules/delegates/Makefile | 8 - deps/npm/node_modules/delegates/index.js | 121 - deps/npm/node_modules/delegates/package.json | 13 - deps/npm/node_modules/delegates/test/index.js | 94 - .../node_modules/event-target-shim/LICENSE | 21 - .../dist/event-target-shim.js | 871 ------- .../dist/event-target-shim.mjs | 862 ------- .../dist/event-target-shim.umd.js | 6 - .../event-target-shim/package.json | 82 - deps/npm/node_modules/events/.airtap.yml | 15 - deps/npm/node_modules/events/History.md | 118 - deps/npm/node_modules/events/LICENSE | 22 - deps/npm/node_modules/events/events.js | 497 ---- deps/npm/node_modules/events/package.json | 37 - deps/npm/node_modules/events/security.md | 10 - .../events/tests/add-listeners.js | 111 - .../events/tests/check-listener-leaks.js | 101 - deps/npm/node_modules/events/tests/common.js | 104 - deps/npm/node_modules/events/tests/errors.js | 13 - .../node_modules/events/tests/events-list.js | 28 - .../node_modules/events/tests/events-once.js | 234 -- deps/npm/node_modules/events/tests/index.js | 64 - .../events/tests/legacy-compat.js | 16 - .../events/tests/listener-count.js | 37 - .../events/tests/listeners-side-effects.js | 56 - .../node_modules/events/tests/listeners.js | 168 -- .../events/tests/max-listeners.js | 47 - .../node_modules/events/tests/method-names.js | 35 - .../events/tests/modify-in-emit.js | 90 - .../npm/node_modules/events/tests/num-args.js | 60 - deps/npm/node_modules/events/tests/once.js | 83 - deps/npm/node_modules/events/tests/prepend.js | 31 - .../events/tests/remove-all-listeners.js | 133 -- .../events/tests/remove-listeners.js | 212 -- .../tests/set-max-listeners-side-effects.js | 31 - .../events/tests/special-event-names.js | 45 - .../npm/node_modules/events/tests/subclass.js | 66 - deps/npm/node_modules/events/tests/symbols.js | 25 - deps/npm/node_modules/ieee754/LICENSE | 11 - deps/npm/node_modules/ieee754/index.js | 85 - deps/npm/node_modules/ieee754/package.json | 52 - .../npm/node_modules/ignore-walk/lib/index.js | 34 +- .../npm/node_modules/ignore-walk/package.json | 6 +- .../lib/index.js | 172 +- .../package.json | 11 +- .../node_modules/libnpmaccess/package.json | 12 +- deps/npm/node_modules/libnpmdiff/package.json | 12 +- deps/npm/node_modules/libnpmexec/package.json | 12 +- deps/npm/node_modules/libnpmfund/package.json | 11 +- deps/npm/node_modules/libnpmhook/package.json | 12 +- deps/npm/node_modules/libnpmorg/package.json | 12 +- deps/npm/node_modules/libnpmpack/package.json | 12 +- .../node_modules/libnpmpublish/package.json | 12 +- .../node_modules/libnpmsearch/package.json | 12 +- deps/npm/node_modules/libnpmteam/package.json | 12 +- .../node_modules/libnpmversion/package.json | 12 +- .../lru-cache/dist/commonjs/index.js | 31 + .../node_modules/lru-cache/dist/esm/index.js | 31 + deps/npm/node_modules/lru-cache/package.json | 12 +- .../npm/node_modules/minipass-collect/LICENSE | 2 +- .../node_modules/minipass-collect/index.js | 2 +- .../node_modules/minipass/LICENSE | 15 - .../node_modules/minipass/index.js | 649 ----- .../node_modules/minipass/package.json | 56 - .../minipass-collect/package.json | 13 +- .../node_modules/npm-packlist/lib/index.js | 49 +- .../node_modules/npm-packlist/package.json | 10 +- deps/npm/node_modules/pacote/lib/registry.js | 32 +- deps/npm/node_modules/pacote/package.json | 14 +- .../postcss-selector-parser/package.json | 4 +- deps/npm/node_modules/process/LICENSE | 22 - deps/npm/node_modules/process/browser.js | 184 -- deps/npm/node_modules/process/index.js | 2 - deps/npm/node_modules/process/package.json | 27 - deps/npm/node_modules/process/test.js | 199 -- deps/npm/node_modules/readable-stream/LICENSE | 47 - .../readable-stream/lib/_stream_duplex.js | 4 - .../lib/_stream_passthrough.js | 4 - .../readable-stream/lib/_stream_readable.js | 4 - .../readable-stream/lib/_stream_transform.js | 4 - .../readable-stream/lib/_stream_writable.js | 4 - .../lib/internal/streams/add-abort-signal.js | 49 - .../lib/internal/streams/buffer_list.js | 157 -- .../lib/internal/streams/compose.js | 194 -- .../lib/internal/streams/destroy.js | 290 --- .../lib/internal/streams/duplex.js | 143 -- .../lib/internal/streams/duplexify.js | 379 --- .../lib/internal/streams/end-of-stream.js | 281 --- .../lib/internal/streams/from.js | 98 - .../lib/internal/streams/lazy_transform.js | 51 - .../lib/internal/streams/legacy.js | 89 - .../lib/internal/streams/operators.js | 457 ---- .../lib/internal/streams/passthrough.js | 39 - .../lib/internal/streams/pipeline.js | 465 ---- .../lib/internal/streams/readable.js | 1247 ---------- .../lib/internal/streams/state.js | 27 - .../lib/internal/streams/transform.js | 180 -- .../lib/internal/streams/utils.js | 321 --- .../lib/internal/streams/writable.js | 817 ------- .../lib/internal/validators.js | 510 ---- .../readable-stream/lib/ours/browser.js | 35 - .../readable-stream/lib/ours/errors.js | 341 --- .../readable-stream/lib/ours/index.js | 65 - .../readable-stream/lib/ours/primordials.js | 101 - .../readable-stream/lib/ours/util.js | 128 - .../readable-stream/lib/stream.js | 136 -- .../readable-stream/lib/stream/promises.js | 43 - .../node_modules/readable-stream/package.json | 86 - deps/npm/node_modules/safe-buffer/LICENSE | 21 - deps/npm/node_modules/safe-buffer/index.js | 65 - .../npm/node_modules/safe-buffer/package.json | 51 - deps/npm/node_modules/string_decoder/LICENSE | 48 - .../string_decoder/lib/string_decoder.js | 296 --- .../node_modules/string_decoder/package.json | 34 - deps/npm/package.json | 26 +- .../test/lib/commands/config.js.test.cjs | 2 + .../test/lib/commands/pack.js.test.cjs | 28 +- .../test/lib/commands/publish.js.test.cjs | 48 +- .../test/lib/commands/sbom.js.test.cjs | 216 +- .../test/lib/commands/view.js.test.cjs | 176 +- .../tap-snapshots/test/lib/docs.js.test.cjs | 21 +- .../lib/utils/open-url-prompt.js.test.cjs | 8 + .../test/lib/utils/sbom-spdx.js.test.cjs | 30 +- .../test/lib/utils/tar.js.test.cjs | 12 +- deps/npm/test/fixtures/clean-snapshot.js | 16 +- deps/npm/test/lib/commands/pack.js | 3 + deps/npm/test/lib/commands/publish.js | 8 +- deps/npm/test/lib/commands/unpublish.js | 120 +- deps/npm/test/lib/npm.js | 13 +- deps/npm/test/lib/utils/display.js | 81 +- deps/npm/test/lib/utils/exit-handler.js | 2 +- deps/npm/test/lib/utils/open-url-prompt.js | 13 +- deps/npm/test/lib/utils/tar.js | 8 +- 290 files changed, 1856 insertions(+), 17295 deletions(-) delete mode 100644 deps/npm/docs/README.md create mode 100644 deps/npm/docs/lib/index.js delete mode 100644 deps/npm/node_modules/abort-controller/LICENSE delete mode 100644 deps/npm/node_modules/abort-controller/browser.js delete mode 100644 deps/npm/node_modules/abort-controller/browser.mjs delete mode 100644 deps/npm/node_modules/abort-controller/dist/abort-controller.js delete mode 100644 deps/npm/node_modules/abort-controller/dist/abort-controller.mjs delete mode 100644 deps/npm/node_modules/abort-controller/dist/abort-controller.umd.js delete mode 100644 deps/npm/node_modules/abort-controller/package.json delete mode 100644 deps/npm/node_modules/abort-controller/polyfill.js delete mode 100644 deps/npm/node_modules/abort-controller/polyfill.mjs delete mode 100644 deps/npm/node_modules/base64-js/LICENSE delete mode 100644 deps/npm/node_modules/base64-js/base64js.min.js delete mode 100644 deps/npm/node_modules/base64-js/index.js delete mode 100644 deps/npm/node_modules/base64-js/package.json delete mode 100644 deps/npm/node_modules/buffer/AUTHORS.md delete mode 100644 deps/npm/node_modules/buffer/LICENSE delete mode 100644 deps/npm/node_modules/buffer/index.js delete mode 100644 deps/npm/node_modules/buffer/package.json delete mode 100644 deps/npm/node_modules/delegates/History.md delete mode 100644 deps/npm/node_modules/delegates/License delete mode 100644 deps/npm/node_modules/delegates/Makefile delete mode 100644 deps/npm/node_modules/delegates/index.js delete mode 100644 deps/npm/node_modules/delegates/package.json delete mode 100644 deps/npm/node_modules/delegates/test/index.js delete mode 100644 deps/npm/node_modules/event-target-shim/LICENSE delete mode 100644 deps/npm/node_modules/event-target-shim/dist/event-target-shim.js delete mode 100644 deps/npm/node_modules/event-target-shim/dist/event-target-shim.mjs delete mode 100644 deps/npm/node_modules/event-target-shim/dist/event-target-shim.umd.js delete mode 100644 deps/npm/node_modules/event-target-shim/package.json delete mode 100644 deps/npm/node_modules/events/.airtap.yml delete mode 100644 deps/npm/node_modules/events/History.md delete mode 100644 deps/npm/node_modules/events/LICENSE delete mode 100644 deps/npm/node_modules/events/events.js delete mode 100644 deps/npm/node_modules/events/package.json delete mode 100644 deps/npm/node_modules/events/security.md delete mode 100644 deps/npm/node_modules/events/tests/add-listeners.js delete mode 100644 deps/npm/node_modules/events/tests/check-listener-leaks.js delete mode 100644 deps/npm/node_modules/events/tests/common.js delete mode 100644 deps/npm/node_modules/events/tests/errors.js delete mode 100644 deps/npm/node_modules/events/tests/events-list.js delete mode 100644 deps/npm/node_modules/events/tests/events-once.js delete mode 100644 deps/npm/node_modules/events/tests/index.js delete mode 100644 deps/npm/node_modules/events/tests/legacy-compat.js delete mode 100644 deps/npm/node_modules/events/tests/listener-count.js delete mode 100644 deps/npm/node_modules/events/tests/listeners-side-effects.js delete mode 100644 deps/npm/node_modules/events/tests/listeners.js delete mode 100644 deps/npm/node_modules/events/tests/max-listeners.js delete mode 100644 deps/npm/node_modules/events/tests/method-names.js delete mode 100644 deps/npm/node_modules/events/tests/modify-in-emit.js delete mode 100644 deps/npm/node_modules/events/tests/num-args.js delete mode 100644 deps/npm/node_modules/events/tests/once.js delete mode 100644 deps/npm/node_modules/events/tests/prepend.js delete mode 100644 deps/npm/node_modules/events/tests/remove-all-listeners.js delete mode 100644 deps/npm/node_modules/events/tests/remove-listeners.js delete mode 100644 deps/npm/node_modules/events/tests/set-max-listeners-side-effects.js delete mode 100644 deps/npm/node_modules/events/tests/special-event-names.js delete mode 100644 deps/npm/node_modules/events/tests/subclass.js delete mode 100644 deps/npm/node_modules/events/tests/symbols.js delete mode 100644 deps/npm/node_modules/ieee754/LICENSE delete mode 100644 deps/npm/node_modules/ieee754/index.js delete mode 100644 deps/npm/node_modules/ieee754/package.json delete mode 100644 deps/npm/node_modules/minipass-collect/node_modules/minipass/LICENSE delete mode 100644 deps/npm/node_modules/minipass-collect/node_modules/minipass/index.js delete mode 100644 deps/npm/node_modules/minipass-collect/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/process/LICENSE delete mode 100644 deps/npm/node_modules/process/browser.js delete mode 100644 deps/npm/node_modules/process/index.js delete mode 100644 deps/npm/node_modules/process/package.json delete mode 100644 deps/npm/node_modules/process/test.js delete mode 100644 deps/npm/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/compose.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/duplex.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/duplexify.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/from.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/lazy_transform.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/legacy.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/operators.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/passthrough.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/readable.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/state.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/transform.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/utils.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/writable.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/validators.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/ours/browser.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/ours/errors.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/ours/index.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/ours/primordials.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/ours/util.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/stream.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/stream/promises.js delete mode 100644 deps/npm/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/safe-buffer/LICENSE delete mode 100644 deps/npm/node_modules/safe-buffer/index.js delete mode 100644 deps/npm/node_modules/safe-buffer/package.json delete mode 100644 deps/npm/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/string_decoder/package.json diff --git a/deps/npm/docs/README.md b/deps/npm/docs/README.md deleted file mode 100644 index 5fc7ccf6cd60ace..000000000000000 --- a/deps/npm/docs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# 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-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index 3b94ea27763f8fb..b73614de2d4f42c 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -290,6 +290,16 @@ field of package.json, which comes from `process.platform`. +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + #### `workspace` * Default: diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index 738ca3372c8e9fe..36496954270b305 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -680,6 +680,16 @@ field of package.json, which comes from `process.platform`. +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + #### `workspace` * Default: diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 4ad025dbb5b08e3..a21d14e577df619 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@10.2.4 /path/to/npm +npm@10.3.0 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 0e18cddf8b36d43..a9c368e218543f4 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -22,7 +22,7 @@ scope-configured registry (see A `package` is interpreted the same way as other commands (like -`npm install` and can be: +`npm install`) and can be: * a) a folder containing a program described by a [`package.json`](/configuring-npm/package-json) file diff --git a/deps/npm/docs/content/commands/npm-sbom.md b/deps/npm/docs/content/commands/npm-sbom.md index ee0d60c6fde790a..6e8033b96aedc79 100644 --- a/deps/npm/docs/content/commands/npm-sbom.md +++ b/deps/npm/docs/content/commands/npm-sbom.md @@ -266,7 +266,7 @@ SBOM format to use when generating SBOMs. * Type: "library", "application", or "framework" The type of package described by the generated SBOM. For SPDX, this is the -value for the `primaryPackagePurpose` fieled. For CycloneDX, this is the +value for the `primaryPackagePurpose` field. For CycloneDX, this is the value for the `type` field. diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index 8ab976e96cb6c7c..2421e1023253634 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -27,8 +27,12 @@ removing the tarball. The npm registry will return an error if you are not [logged in](/commands/npm-adduser). -If you do not specify a version or if you remove all of a package's -versions then the registry will remove the root package entry entirely. +If you do not specify a package name at all, the name and version to be +unpublished will be pulled from the project in the current directory. + +If you specify a package name but do not specify a version or if you +remove all of a package's versions then the registry will remove the +root package entry entirely. Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index 1528614f69a69a4..d92e83e5ccdd195 100644 --- a/deps/npm/docs/content/commands/npm.md +++ b/deps/npm/docs/content/commands/npm.md @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. ### Version -10.2.4 +10.3.0 ### Description diff --git a/deps/npm/docs/content/commands/npx.md b/deps/npm/docs/content/commands/npx.md index 5ce300e724b103b..e596baa5da47938 100644 --- a/deps/npm/docs/content/commands/npx.md +++ b/deps/npm/docs/content/commands/npx.md @@ -150,7 +150,8 @@ This resulted in some shifts in its functionality: always present in the executed process `PATH`. - The `--npm` option is removed. `npx` will always use the `npm` it ships with. -- The `--node-arg` and `-n` options are removed. +- The `--node-arg` and `-n` options have been removed. Use [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) instead: e.g., + `NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true` - The `--always-spawn` option is redundant, and thus removed. - The `--shell` option is replaced with `--script-shell`, but maintained in the `npx` executable for backwards compatibility. diff --git a/deps/npm/docs/content/configuring-npm/npmrc.md b/deps/npm/docs/content/configuring-npm/npmrc.md index 8cd532abc1c2db4..0aa99fc271013bb 100644 --- a/deps/npm/docs/content/configuring-npm/npmrc.md +++ b/deps/npm/docs/content/configuring-npm/npmrc.md @@ -19,10 +19,10 @@ For a list of available configuration options, see The four relevant files are: -* per-project config file (/path/to/my/project/.npmrc) -* per-user config file (~/.npmrc) -* global config file ($PREFIX/etc/npmrc) -* npm builtin config file (/path/to/npm/npmrc) +* per-project config file (`/path/to/my/project/.npmrc`) +* per-user config file (`~/.npmrc`) +* global config file (`$PREFIX/etc/npmrc`) +* npm builtin config file (`/path/to/npm/npmrc`) All npm config files are an ini-formatted list of `key = value` parameters. Environment variables can be replaced using `${VARIABLE_NAME}`. For diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 630ad453196a0ad..2ef888fe1a4d647 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -291,25 +291,39 @@ Certain files are always included, regardless of settings: `README` & `LICENSE` can have any case and extension. -Conversely, some files are always ignored: +Some files are always ignored by default: +* `*.orig` +* `.*.swp` +* `.DS_Store` +* `._*` * `.git` -* `CVS` -* `.svn` * `.hg` * `.lock-wscript` +* `.npmrc` +* `.svn` * `.wafpickle-N` -* `.*.swp` -* `.DS_Store` -* `._*` +* `CVS` +* `config.gypi` +* `node_modules` * `npm-debug.log` +* `package-lock.json` (use + [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) + if you wish it to be published) +* `pnpm-lock.yaml` +* `yarn.lock` + +Most of these ignored files can be included specifically if included in +the `files` globs. Exceptions to this are: + +* `.git` * `.npmrc` * `node_modules` -* `config.gypi` -* `*.orig` -* `package-lock.json` (use - [`npm-shrinkwrap.json`](/configuring-npm/npm-shrinkwrap-json) if you wish - it to be published) +* `package-lock.json` +* `pnpm-lock.yaml` +* `yarn.lock` + +These can not be included. ### main diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 80969ee23e5355f..93c820ab3b45ad3 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -855,6 +855,16 @@ Use of `legacy-peer-deps` is not recommended, as it will not enforce the +#### `libc` + +* Default: null +* Type: null or String + +Override libc of native modules to install. Acceptable values are same as +`libc` field of package.json + + + #### `link` * Default: false @@ -1373,7 +1383,7 @@ SBOM format to use when generating SBOMs. * Type: "library", "application", or "framework" The type of package described by the generated SBOM. For SPDX, this is the -value for the `primaryPackagePurpose` fieled. For CycloneDX, this is the +value for the `primaryPackagePurpose` field. For CycloneDX, this is the value for the `type` field. diff --git a/deps/npm/docs/lib/index.js b/deps/npm/docs/lib/index.js new file mode 100644 index 000000000000000..5d4ae7af3457bbb --- /dev/null +++ b/deps/npm/docs/lib/index.js @@ -0,0 +1,189 @@ +const localeCompare = require('@isaacs/string-locale-compare')('en') +const { join, basename, resolve } = require('path') +const transformHTML = require('./transform-html.js') +const { version } = require('../../lib/npm.js') +const { aliases } = require('../../lib/utils/cmd-list') +const { shorthands, definitions } = require('@npmcli/config/lib/definitions') + +const DOC_EXT = '.md' + +const TAGS = { + CONFIG: '', + USAGE: '', + SHORTHANDS: '', +} + +const assertPlaceholder = (src, path, placeholder) => { + if (!src.includes(placeholder)) { + throw new Error( + `Cannot replace ${placeholder} in ${path} due to missing placeholder` + ) + } + return placeholder +} + +const getCommandByDoc = (docFile, docExt) => { + // Grab the command name from the *.md filename + // NOTE: We cannot use the name property command file because in the case of + // `npx` the file being used is `lib/commands/exec.js` + const name = basename(docFile, docExt).replace('npm-', '') + + if (name === 'npm') { + return { + name, + params: null, + usage: 'npm', + } + } + + // special case for `npx`: + // `npx` is not technically a command in and of itself, + // so it just needs the usage of npm exex + const srcName = name === 'npx' ? 'exec' : name + const { params, usage = [''], workspaces } = require(`../../lib/commands/${srcName}`) + const usagePrefix = name === 'npx' ? 'npx' : `npm ${name}` + if (params) { + for (const param of params) { + if (definitions[param].exclusive) { + for (const e of definitions[param].exclusive) { + if (!params.includes(e)) { + params.splice(params.indexOf(param) + 1, 0, e) + } + } + } + } + } + + return { + name, + workspaces, + params: name === 'npx' ? null : params, + usage: usage.map(u => `${usagePrefix} ${u}`.trim()).join('\n'), + } +} + +const replaceVersion = (src) => src.replace(/@VERSION@/g, version) + +const replaceUsage = (src, { path }) => { + const replacer = assertPlaceholder(src, path, TAGS.USAGE) + const { usage, name, workspaces } = getCommandByDoc(path, DOC_EXT) + + const synopsis = ['```bash', usage] + + const cmdAliases = Object.keys(aliases).reduce((p, c) => { + if (aliases[c] === name) { + p.push(c) + } + return p + }, []) + + if (cmdAliases.length === 1) { + synopsis.push('', `alias: ${cmdAliases[0]}`) + } else if (cmdAliases.length > 1) { + synopsis.push('', `aliases: ${cmdAliases.join(', ')}`) + } + + synopsis.push('```') + + if (!workspaces) { + synopsis.push('', 'Note: This command is unaware of workspaces.') + } + + return src.replace(replacer, synopsis.join('\n')) +} + +const replaceParams = (src, { path }) => { + const { params } = getCommandByDoc(path, DOC_EXT) + const replacer = params && assertPlaceholder(src, path, TAGS.CONFIG) + + if (!params) { + return src + } + + const paramsConfig = params.map((n) => definitions[n].describe()) + + return src.replace(replacer, paramsConfig.join('\n\n')) +} + +const replaceConfig = (src, { path }) => { + const replacer = assertPlaceholder(src, path, TAGS.CONFIG) + + // sort not-deprecated ones to the top + /* istanbul ignore next - typically already sorted in the definitions file, + * but this is here so that our help doc will stay consistent if we decide + * to move them around. */ + const sort = ([keya, { deprecated: depa }], [keyb, { deprecated: depb }]) => { + return depa && !depb ? 1 + : !depa && depb ? -1 + : localeCompare(keya, keyb) + } + + const allConfig = Object.entries(definitions).sort(sort) + .map(([_, def]) => def.describe()) + .join('\n\n') + + return src.replace(replacer, allConfig) +} + +const replaceShorthands = (src, { path }) => { + const replacer = assertPlaceholder(src, path, TAGS.SHORTHANDS) + + const sh = Object.entries(shorthands) + .sort(([shorta, expansiona], [shortb, expansionb]) => + // sort by what they're short FOR + localeCompare(expansiona.join(' '), expansionb.join(' ')) || localeCompare(shorta, shortb) + ) + .map(([short, expansion]) => { + // XXX: this is incorrect. we have multicharacter flags like `-iwr` that + // can only be set with a single dash + const dash = short.length === 1 ? '-' : '--' + return `* \`${dash}${short}\`: \`${expansion.join(' ')}\`` + }) + + return src.replace(replacer, sh.join('\n')) +} + +const replaceHelpLinks = (src) => { + // replaces markdown links with equivalent-ish npm help commands + return src.replace( + /\[`?([\w\s-]+)`?\]\(\/(?:commands|configuring-npm|using-npm)\/(?:[\w\s-]+)\)/g, + (_, p1) => { + const term = p1.replace(/npm\s/g, '').replace(/\s+/g, ' ').trim() + const help = `npm help ${term.includes(' ') ? `"${term}"` : term}` + return help + } + ) +} + +const transformMan = (src, { data, unified, remarkParse, remarkMan }) => unified() + .use(remarkParse) + .use(remarkMan) + .processSync(`# ${data.title}(${data.section}) - ${data.description}\n\n${src}`) + .toString() + +const manPath = (name, { data }) => join(`man${data.section}`, `${name}.${data.section}`) + +const transformMd = (src, { frontmatter }) => ['---', frontmatter, '---', '', src].join('\n') + +module.exports = { + DOC_EXT, + TAGS, + paths: { + content: resolve(__dirname, 'content'), + nav: resolve(__dirname, 'content', 'nav.yml'), + template: resolve(__dirname, 'template.html'), + man: resolve(__dirname, '..', '..', 'man'), + html: resolve(__dirname, '..', 'output'), + md: resolve(__dirname, '..', 'content'), + }, + usage: replaceUsage, + params: replaceParams, + config: replaceConfig, + shorthands: replaceShorthands, + version: replaceVersion, + helpLinks: replaceHelpLinks, + man: transformMan, + manPath: manPath, + md: transformMd, + html: transformHTML, +} diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index dd78090d2a5db30..b6b16aba6a5ca06 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -142,7 +142,7 @@

npm-install-test

Table of contents

- +

Synopsis

@@ -350,6 +350,13 @@

os

Override OS of native modules to install. Acceptable values are same as os field of package.json, which comes from process.platform.

+

libc

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

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

workspace

Override OS of native modules to install. Acceptable values are same as os field of package.json, which comes from process.platform.

+

libc

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

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

workspace

  • Default:
  • diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 642c883f3502812..ae62824a2d7e594 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -160,7 +160,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@10.2.4 /path/to/npm
    +
    npm@10.3.0 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     
    diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html index 24e715e4dbec9da..b5b18b4ddca6107 100644 --- a/deps/npm/docs/output/commands/npm-publish.html +++ b/deps/npm/docs/output/commands/npm-publish.html @@ -156,7 +156,7 @@

    Description

    scope-configured registry (see package.json).

    A package is interpreted the same way as other commands (like -npm install and can be:

    +npm install) and can be:

    • a) a folder containing a program described by a package.json file
    • diff --git a/deps/npm/docs/output/commands/npm-sbom.html b/deps/npm/docs/output/commands/npm-sbom.html index 56b146680100d10..01302780a2ab776 100644 --- a/deps/npm/docs/output/commands/npm-sbom.html +++ b/deps/npm/docs/output/commands/npm-sbom.html @@ -379,7 +379,7 @@

      sbom-type

    • Type: "library", "application", or "framework"

    The type of package described by the generated SBOM. For SPDX, this is the -value for the primaryPackagePurpose fieled. For CycloneDX, this is the +value for the primaryPackagePurpose field. For CycloneDX, this is the value for the type field.

    workspace

      diff --git a/deps/npm/docs/output/commands/npm-unpublish.html b/deps/npm/docs/output/commands/npm-unpublish.html index 0c4776309b5640f..cf952c56f4cfdf4 100644 --- a/deps/npm/docs/output/commands/npm-unpublish.html +++ b/deps/npm/docs/output/commands/npm-unpublish.html @@ -159,8 +159,11 @@

      Description

      removing the tarball.

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

      -

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

      +

      If you do not specify a package name at all, the name and version to be +unpublished will be pulled from the project in the current directory.

      +

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

      Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, you must use a new version number. If you unpublish the entire package, diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 7a530efa07bb17e..094e2ef256b9379 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -150,7 +150,7 @@

      Table of contents

    Note: This command is unaware of workspaces.

    Version

    -

    10.2.4

    +

    10.3.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/commands/npx.html b/deps/npm/docs/output/commands/npx.html index 54d59ca7cdb329e..d2bebc34c0c484b 100644 --- a/deps/npm/docs/output/commands/npx.html +++ b/deps/npm/docs/output/commands/npx.html @@ -252,7 +252,8 @@

    Compatibility with Older npx Vers always present in the executed process PATH.
  • The --npm option is removed. npx will always use the npm it ships with.
  • -
  • The --node-arg and -n options are removed.
  • +
  • The --node-arg and -n options have been removed. Use NODE_OPTIONS instead: e.g., +NODE_OPTIONS="--trace-warnings --trace-exit" npx foo --random=true
  • The --always-spawn option is redundant, and thus removed.
  • The --shell option is replaced with --script-shell, but maintained in the npx executable for backwards compatibility.
  • diff --git a/deps/npm/docs/output/configuring-npm/npmrc.html b/deps/npm/docs/output/configuring-npm/npmrc.html index 0e27de6ccb7d9d4..c33c803690c56e5 100644 --- a/deps/npm/docs/output/configuring-npm/npmrc.html +++ b/deps/npm/docs/output/configuring-npm/npmrc.html @@ -155,10 +155,10 @@

    Table of contents

    Files

    The four relevant files are:

      -
    • per-project config file (/path/to/my/project/.npmrc)
    • -
    • per-user config file (~/.npmrc)
    • -
    • global config file ($PREFIX/etc/npmrc)
    • -
    • npm builtin config file (/path/to/npm/npmrc)
    • +
    • per-project config file (/path/to/my/project/.npmrc)
    • +
    • per-user config file (~/.npmrc)
    • +
    • global config file ($PREFIX/etc/npmrc)
    • +
    • npm builtin config file (/path/to/npm/npmrc)

    All npm config files are an ini-formatted list of key = value parameters. Environment variables can be replaced using ${VARIABLE_NAME}. For diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 712708ef4063915..dd602671238b991 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -364,26 +364,39 @@

    files

  • The file(s) in the "bin" field

README & LICENSE can have any case and extension.

-

Conversely, some files are always ignored:

+

Some files are always ignored by default:

    +
  • *.orig
  • +
  • .*.swp
  • +
  • .DS_Store
  • +
  • ._*
  • .git
  • -
  • CVS
  • -
  • .svn
  • .hg
  • .lock-wscript
  • +
  • .npmrc
  • +
  • .svn
  • .wafpickle-N
  • -
  • .*.swp
  • -
  • .DS_Store
  • -
  • ._*
  • +
  • CVS
  • +
  • config.gypi
  • +
  • node_modules
  • npm-debug.log
  • +
  • package-lock.json (use +npm-shrinkwrap.json +if you wish it to be published)
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
  • +
+

Most of these ignored files can be included specifically if included in +the files globs. Exceptions to this are:

+
    +
  • .git
  • .npmrc
  • node_modules
  • -
  • config.gypi
  • -
  • *.orig
  • -
  • package-lock.json (use -npm-shrinkwrap.json if you wish -it to be published)
  • +
  • package-lock.json
  • +
  • pnpm-lock.yaml
  • +
  • yarn.lock
+

These can not be included.

main

The main field is a module ID that is the primary entry point to your program. That is, if your package is named foo, and a user installs it, diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index c80d3342fc9049a..3015e5d066b4732 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

@@ -764,6 +764,13 @@

legacy-peer-deps

peerDependencies could be unpacked in a correct place.

Use of legacy-peer-deps is not recommended, as it will not enforce the peerDependencies contract that meta-dependencies may rely on.

+

libc

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

Override libc of native modules to install. Acceptable values are same as +libc field of package.json

  • Default: false
  • @@ -1129,7 +1136,7 @@

    sbom-type

  • Type: "library", "application", or "framework"

The type of package described by the generated SBOM. For SPDX, this is the -value for the primaryPackagePurpose fieled. For CycloneDX, this is the +value for the primaryPackagePurpose field. For CycloneDX, this is the value for the type field.

scope