From 62d9a7f5db64ed880d6aaca60d0c4f9de5716190 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 1 Mar 2022 16:27:29 -0500 Subject: [PATCH 01/70] src: fix unchecked return warning from coverity Fix unchecked return warning from coverity in src/env.cc. Added check in same manner as other places where uv_async_init is called. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/42176 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Anna Henningsen --- src/env.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/env.cc b/src/env.cc index e3e06598a575..8631ac39a928 100644 --- a/src/env.cc +++ b/src/env.cc @@ -545,21 +545,21 @@ void Environment::InitializeLibuv() { CHECK_EQ(0, uv_timer_init(event_loop(), timer_handle())); uv_unref(reinterpret_cast(timer_handle())); - uv_check_init(event_loop(), immediate_check_handle()); + CHECK_EQ(0, uv_check_init(event_loop(), immediate_check_handle())); uv_unref(reinterpret_cast(immediate_check_handle())); - uv_idle_init(event_loop(), immediate_idle_handle()); + CHECK_EQ(0, uv_idle_init(event_loop(), immediate_idle_handle())); - uv_check_start(immediate_check_handle(), CheckImmediate); + CHECK_EQ(0, uv_check_start(immediate_check_handle(), CheckImmediate)); // Inform V8's CPU profiler when we're idle. The profiler is sampling-based // but not all samples are created equal; mark the wall clock time spent in // epoll_wait() and friends so profiling tools can filter it out. The samples // still end up in v8.log but with state=IDLE rather than state=EXTERNAL. - uv_prepare_init(event_loop(), &idle_prepare_handle_); - uv_check_init(event_loop(), &idle_check_handle_); + CHECK_EQ(0, uv_prepare_init(event_loop(), &idle_prepare_handle_)); + CHECK_EQ(0, uv_check_init(event_loop(), &idle_check_handle_)); - uv_async_init( + CHECK_EQ(0, uv_async_init( event_loop(), &task_queues_async_, [](uv_async_t* async) { @@ -568,7 +568,7 @@ void Environment::InitializeLibuv() { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); env->RunAndClearNativeImmediates(); - }); + })); uv_unref(reinterpret_cast(&idle_prepare_handle_)); uv_unref(reinterpret_cast(&idle_check_handle_)); uv_unref(reinterpret_cast(&task_queues_async_)); From 19851f8d2d524ea3c220c3872176af3ed5f263b2 Mon Sep 17 00:00:00 2001 From: Matt Probert <1196252+mattpr@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:08:40 +0100 Subject: [PATCH 02/70] doc: readline `'line'` event emits final line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated docs to reflect current behaviour of readline: final line of input will be emitted via `'line'` event when input stream `'end'` event is emitted even when the input is not newline terminated. Refs: https://github.com/nodejs/node-v0.x-archive/issues/7238 PR-URL: https://github.com/nodejs/node/pull/42214 Reviewed-By: Antoine du Hamel Reviewed-By: Tobias Nießen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca --- doc/api/readline.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/readline.md b/doc/api/readline.md index 9054877d7f3a..69cfb2a6aee3 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -111,6 +111,9 @@ The `'line'` event is emitted whenever the `input` stream receives an end-of-line input (`\n`, `\r`, or `\r\n`). This usually occurs when the user presses Enter or Return. +The `'line'` event is also emitted if new data has been read from a stream and +that stream ends without a final end-of-line marker. + The listener function is called with a string containing the single line of received input. From a4632a3dc2936192d5d96adcf0abcdcf917da362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 7 Mar 2022 22:28:42 +0100 Subject: [PATCH 03/70] crypto: add CHECKs to remaining BIO_s_mem allocs PR-URL: https://github.com/nodejs/node/pull/42155 Reviewed-By: Darshan Sen --- src/crypto/crypto_keys.cc | 2 ++ src/crypto/crypto_x509.cc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc index 08b951906983..441f5736ec8a 100644 --- a/src/crypto/crypto_keys.cc +++ b/src/crypto/crypto_keys.cc @@ -1424,6 +1424,7 @@ WebCryptoKeyExportStatus PKEY_SPKI_Export( ManagedEVPPKey m_pkey = key_data->GetAsymmetricKey(); Mutex::ScopedLock lock(*m_pkey.mutex()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); if (!i2d_PUBKEY_bio(bio.get(), m_pkey.get())) return WebCryptoKeyExportStatus::FAILED; @@ -1439,6 +1440,7 @@ WebCryptoKeyExportStatus PKEY_PKCS8_Export( Mutex::ScopedLock lock(*m_pkey.mutex()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); PKCS8Pointer p8inf(EVP_PKEY2PKCS8(m_pkey.get())); if (!i2d_PKCS8_PRIV_KEY_INFO_bio(bio.get(), p8inf.get())) return WebCryptoKeyExportStatus::FAILED; diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc index 7c299620dfee..398b1a857954 100644 --- a/src/crypto/crypto_x509.cc +++ b/src/crypto/crypto_x509.cc @@ -196,6 +196,7 @@ void X509Certificate::Subject(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetSubject(env, bio, cert->get()).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -206,6 +207,7 @@ void X509Certificate::Issuer(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetIssuerString(env, bio, cert->get()).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -216,6 +218,7 @@ void X509Certificate::SubjectAltName(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetSubjectAltNameString(env, bio, cert->get()).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -226,6 +229,7 @@ void X509Certificate::InfoAccess(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetInfoAccessString(env, bio, cert->get()).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -236,6 +240,7 @@ void X509Certificate::ValidFrom(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetValidFrom(env, cert->get(), bio).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -246,6 +251,7 @@ void X509Certificate::ValidTo(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); Local ret; if (GetValidTo(env, cert->get(), bio).ToLocal(&ret)) args.GetReturnValue().Set(ret); @@ -325,6 +331,7 @@ void X509Certificate::Pem(const FunctionCallbackInfo& args) { X509Certificate* cert; ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); if (PEM_write_bio_X509(bio.get(), cert->get())) args.GetReturnValue().Set(ToV8Value(env, bio)); } From e95426fd3aef35313dacd72a80533fae327a6dc9 Mon Sep 17 00:00:00 2001 From: mscdex Date: Mon, 7 Mar 2022 17:26:09 -0500 Subject: [PATCH 04/70] tools: fix web streams API links PR-URL: https://github.com/nodejs/node/pull/42153 Reviewed-By: Mestery Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- tools/doc/type-parser.mjs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/doc/type-parser.mjs b/tools/doc/type-parser.mjs index e17bf077d70f..3bdbffdbe053 100644 --- a/tools/doc/type-parser.mjs +++ b/tools/doc/type-parser.mjs @@ -241,35 +241,35 @@ const customTypesMap = { 'zlib options': 'zlib.html#class-options', 'ReadableStream': - 'webstreams.md#class-readablestream', + 'webstreams.html#class-readablestream', 'ReadableStreamDefaultReader': - 'webstreams.md#class-readablestreamdefaultreader', + 'webstreams.html#class-readablestreamdefaultreader', 'ReadableStreamBYOBReader': - 'webstreams.md#class-readablestreambyobreader', + 'webstreams.html#class-readablestreambyobreader', 'ReadableStreamDefaultController': - 'webstreams.md#class-readablestreamdefaultcontroller', + 'webstreams.html#class-readablestreamdefaultcontroller', 'ReadableByteStreamController': - 'webstreams.md#class-readablebytestreamcontroller', + 'webstreams.html#class-readablebytestreamcontroller', 'ReadableStreamBYOBRequest': - 'webstreams.md#class-readablestreambyobrequest', + 'webstreams.html#class-readablestreambyobrequest', 'WritableStream': - 'webstreams.md#class-writablestream', + 'webstreams.html#class-writablestream', 'WritableStreamDefaultWriter': - 'webstreams.md#class-writablestreamdefaultwriter', + 'webstreams.html#class-writablestreamdefaultwriter', 'WritableStreamDefaultController': - 'webstreams.md#class-writablestreamdefaultcontroller', + 'webstreams.html#class-writablestreamdefaultcontroller', 'TransformStream': - 'webstreams.md#class-transformstream', + 'webstreams.html#class-transformstream', 'TransformStreamDefaultController': - 'webstreams.md#class-transformstreamdefaultcontroller', + 'webstreams.html#class-transformstreamdefaultcontroller', 'ByteLengthQueuingStrategy': - 'webstreams.md#class-bytelengthqueuingstrategy', + 'webstreams.html#class-bytelengthqueuingstrategy', 'CountQueuingStrategy': - 'webstreams.md#class-countqueuingstrategy', + 'webstreams.html#class-countqueuingstrategy', 'TextEncoderStream': - 'webstreams.md#class-textencoderstream', + 'webstreams.html#class-textencoderstream', 'TextDecoderStream': - 'webstreams.md#class-textdecoderstream', + 'webstreams.html#class-textdecoderstream', 'FormData': 'https://developer.mozilla.org/en-US/docs/Web/API/FormData', 'Headers': 'https://developer.mozilla.org/en-US/docs/Web/API/Headers', From 7fc4b9f08d85b463ede2721ef6ba4ce780b0c6ab Mon Sep 17 00:00:00 2001 From: Mestery Date: Mon, 7 Mar 2022 23:34:36 +0100 Subject: [PATCH 05/70] meta: add dependencies label to label-pr-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42129 Reviewed-By: Michaël Zasso Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- .github/label-pr-config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/label-pr-config.yml b/.github/label-pr-config.yml index 93aeaab02573..a8d22980f6db 100644 --- a/.github/label-pr-config.yml +++ b/.github/label-pr-config.yml @@ -85,7 +85,7 @@ subSystemLabels: /^deps\/nghttp2\//: http2 /^deps\/ngtcp2\//: quic, dont-land-on-v14.x, dont-land-on-v12.x /^deps\/nghttp3\//: quic, dont-land-on-v14.x, dont-land-on-v12.x - /^deps\/([^/]+)/: $1 + /^deps\/([^/]+)/: dependencies, $1 ## JS subsystems # Oddities first From 1d0468f749733b02fe953f37d7be418a00992226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 7 Mar 2022 23:42:22 +0100 Subject: [PATCH 06/70] crypto: fix fingerprint string size calculation The function generating fingerprint strings never accesses more than EVP_MAX_MD_SIZE * 3 characters, including the terminating '\0'. PR-URL: https://github.com/nodejs/node/pull/42175 Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- src/crypto/crypto_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index 372a3f147b07..a5aa39c23c17 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -417,7 +417,7 @@ MaybeLocal GetLastIssuedCert( void AddFingerprintDigest( const unsigned char* md, unsigned int md_size, - char fingerprint[3 * EVP_MAX_MD_SIZE + 1]) { + char fingerprint[3 * EVP_MAX_MD_SIZE]) { unsigned int i; const char hex[] = "0123456789ABCDEF"; @@ -567,7 +567,7 @@ MaybeLocal GetFingerprintDigest( X509* cert) { unsigned char md[EVP_MAX_MD_SIZE]; unsigned int md_size; - char fingerprint[EVP_MAX_MD_SIZE * 3 + 1]; + char fingerprint[EVP_MAX_MD_SIZE * 3]; if (X509_digest(cert, method, md, &md_size)) { AddFingerprintDigest(md, md_size, fingerprint); From f27bcec2ea023585fd2dd33f06527756fab4bc80 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 7 Mar 2022 23:25:41 +0000 Subject: [PATCH 07/70] build: use ccache in make-v8.sh on ppc64le and s390x If `ccache` is available, use it during V8 builds on ppc64le and s390x. Only create the `gcc` and `g++` shims if necessary. PR-URL: https://github.com/nodejs/node/pull/42204 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- tools/make-v8.sh | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/tools/make-v8.sh b/tools/make-v8.sh index 978b9f00860a..62cabc70a6ea 100755 --- a/tools/make-v8.sh +++ b/tools/make-v8.sh @@ -9,7 +9,7 @@ cd deps/v8 || exit find . -type d -name .git -print0 | xargs -0 rm -rf ../../tools/v8/fetch_deps.py . -ARCH="`arch`" +ARCH=$(arch) if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then TARGET_ARCH=$ARCH if [ "$ARCH" = "ppc64le" ]; then @@ -18,22 +18,34 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then # set paths manually for now to use locally installed gn export BUILD_TOOLS=/home/iojs/build-tools export LD_LIBRARY_PATH="$BUILD_TOOLS:$LD_LIBRARY_PATH" - # Avoid linking to ccache symbolic links as ccache decides which - # binary to run based on the name of the link (we always name them gcc/g++). - # shellcheck disable=SC2154 - CC_PATH=`command -v "$CC" gcc | grep -v ccache | head -n 1` - # shellcheck disable=SC2154 - CXX_PATH=`command -v "$CXX" g++ | grep -v ccache | head -n 1` rm -f "$BUILD_TOOLS/g++" rm -f "$BUILD_TOOLS/gcc" - ln -s "$CXX_PATH" "$BUILD_TOOLS/g++" - ln -s "$CC_PATH" "$BUILD_TOOLS/gcc" + # V8's build config looks for binaries called `gcc` and `g++` if not using + # clang. Ensure that `gcc` and `g++` point to the compilers we want to + # invoke, creating symbolic links placed at the front of PATH, if needed. + # Avoid linking to ccache symbolic links as ccache decides which binary + # to run based on the name of the link (i.e. `gcc`/`g++` in our case). + # shellcheck disable=SC2154 + if [ "$CC" != "" ] && [ "$CC" != "gcc" ]; then + CC_PATH=$(command -v "$CC" gcc | grep -v ccache | head -n 1) + ln -s "$CC_PATH" "$BUILD_TOOLS/gcc" + fi + # shellcheck disable=SC2154 + if [ "$CXX" != "" ] && [ "$CXX" != "g++" ]; then + CXX_PATH=$(command -v "$CXX" g++ | grep -v ccache | head -n 1) + ln -s "$CXX_PATH" "$BUILD_TOOLS/g++" + fi export PATH="$BUILD_TOOLS:$PATH" + # Propagate ccache to gn. + case "$CXX" in + *ccache*) CC_WRAPPER="cc_wrapper=\"ccache\"" ;; + *) ;; + esac g++ --version gcc --version export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config - gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true" + gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER" ninja -v -C "out.gn/$BUILD_ARCH_TYPE" d8 cctest inspector-test else DEPOT_TOOLS_DIR="$(cd _depot_tools && pwd)" From b89f4d5c170619f533b859c63ebe7bcddbe51c31 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Mar 2022 21:00:06 -0800 Subject: [PATCH 08/70] url: trim leading and trailing C0 control chars Emulate the WHATWHG URL parse behavior of trimming leading and trailing C0 control characters. This moves url.parse() slightly closer to WHATWHG URL behavior. The current behavior is possibly insecure for some uses. (The url.parse() API is marked as Legacy and the documentation specifically says it has known bugs and insecure behaviors. Still this change makes a lot of sense.) This issue was reported by P0cas. https://github.com/P0cas PR-URL: https://github.com/nodejs/node/pull/42196 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Matteo Collina Reviewed-By: Mestery Reviewed-By: Anto Aravinth Reviewed-By: Anna Henningsen --- lib/url.js | 7 +------ test/parallel/test-url-parse-format.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/url.js b/lib/url.js index 745c7c9930de..8280ddf056c9 100644 --- a/lib/url.js +++ b/lib/url.js @@ -117,7 +117,6 @@ const { CHAR_TAB, CHAR_CARRIAGE_RETURN, CHAR_LINE_FEED, - CHAR_FORM_FEED, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE, CHAR_HASH, @@ -196,11 +195,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { const code = url.charCodeAt(i); // Find first and last non-whitespace characters for trimming - const isWs = code === CHAR_SPACE || - code === CHAR_TAB || - code === CHAR_CARRIAGE_RETURN || - code === CHAR_LINE_FEED || - code === CHAR_FORM_FEED || + const isWs = code < 33 || code === CHAR_NO_BREAK_SPACE || code === CHAR_ZERO_WIDTH_NOBREAK_SPACE; if (start === -1) { diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js index e1cf80a2778a..99a6ace23a2f 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -977,6 +977,21 @@ const parseTests = { path: '/everybody', href: '//fhqwhgads@example.com/everybody#to-the-limit' }, + + '\bhttp://example.com/\b': { + protocol: 'http:', + slashes: true, + auth: null, + host: 'example.com', + port: null, + hostname: 'example.com', + hash: null, + search: null, + query: null, + pathname: '/', + path: '/', + href: 'http://example.com/' + } }; for (const u in parseTests) { From 3492a0eb1ea3f8c4610a6ea8fbd8580620e0e152 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Tue, 8 Mar 2022 22:06:11 +0530 Subject: [PATCH 09/70] string_decoder: fix crash when calling __proto__.write() This makes the function throw an exception from JS instead of crashing. Fixes: https://github.com/nodejs/node/issues/41949 Signed-off-by: Darshan Sen PR-URL: https://github.com/nodejs/node/pull/42062 Reviewed-By: James M Snell Reviewed-By: Mestery --- lib/string_decoder.js | 4 ++++ test/parallel/test-string-decoder.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 7447bb3f4699..9eae594aaa27 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -43,6 +43,7 @@ const { const internalUtil = require('internal/util'); const { ERR_INVALID_ARG_TYPE, + ERR_INVALID_THIS, ERR_UNKNOWN_ENCODING } = require('internal/errors').codes; const isEncoding = Buffer[internalUtil.kIsEncodingSymbol]; @@ -101,6 +102,9 @@ StringDecoder.prototype.write = function write(buf) { throw new ERR_INVALID_ARG_TYPE('buf', ['Buffer', 'TypedArray', 'DataView'], buf); + if (!this[kNativeDecoder]) { + throw new ERR_INVALID_THIS('StringDecoder'); + } return decode(this[kNativeDecoder], buf); }; diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index be876f46e5af..02f0a3a718bd 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -210,6 +210,13 @@ if (common.enoughTestMem) { ); } +assert.throws( + () => new StringDecoder('utf8').__proto__.write(Buffer.from('abc')), // eslint-disable-line no-proto + { + code: 'ERR_INVALID_THIS', + } +); + // Test verifies that StringDecoder will correctly decode the given input // buffer with the given encoding to the expected output. It will attempt all // possible ways to write() the input buffer, see writeSequences(). The From f3c6c00963cafe2456ec155d433cb2b24a24699a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 8 Mar 2022 18:33:27 +0100 Subject: [PATCH 10/70] doc: remove refs to old OpenSSL list-* commands The last release line that did not support the new openssl list command was OpenSSL 1.1.0, which reached its end-of-life status years ago. PR-URL: https://github.com/nodejs/node/pull/42235 Reviewed-By: Rich Trott Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Mestery Reviewed-By: James M Snell --- doc/api/crypto.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 5c9f277594dd..2f2e747e18a0 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -2952,8 +2952,7 @@ option is not required but can be used to set the length of the authentication tag that will be returned by `getAuthTag()` and defaults to 16 bytes. The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list -cipher-algorithms` -(`openssl list-cipher-algorithms` for older versions of OpenSSL) will +recent OpenSSL releases, `openssl list -cipher-algorithms` will display the available cipher algorithms. The `password` is used to derive the cipher key and initialization vector (IV). @@ -3023,8 +3022,7 @@ option is not required but can be used to set the length of the authentication tag that will be returned by `getAuthTag()` and defaults to 16 bytes. The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list -cipher-algorithms` -(`openssl list-cipher-algorithms` for older versions of OpenSSL) will +recent OpenSSL releases, `openssl list -cipher-algorithms` will display the available cipher algorithms. The `key` is the raw key used by the `algorithm` and `iv` is an @@ -3124,8 +3122,7 @@ option is not required but can be used to restrict accepted authentication tags to those with the specified length. The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On -recent OpenSSL releases, `openssl list -cipher-algorithms` -(`openssl list-cipher-algorithms` for older versions of OpenSSL) will +recent OpenSSL releases, `openssl list -cipher-algorithms` will display the available cipher algorithms. The `key` is the raw key used by the `algorithm` and `iv` is an @@ -3241,8 +3238,7 @@ can be used to specify the desired output length in bytes. The `algorithm` is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. -On recent releases of OpenSSL, `openssl list -digest-algorithms` -(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will +On recent releases of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. Example: generating the sha256 sum of a file @@ -3325,8 +3321,7 @@ Optional `options` argument controls stream behavior. The `algorithm` is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. -On recent releases of OpenSSL, `openssl list -digest-algorithms` -(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will +On recent releases of OpenSSL, `openssl list -digest-algorithms` will display the available digest algorithms. The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is From 70c07583080d3b64b8937e05e005fb7710ec1305 Mon Sep 17 00:00:00 2001 From: npm team Date: Thu, 3 Mar 2022 21:38:08 +0000 Subject: [PATCH 11/70] deps: upgrade npm to 8.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42205 Reviewed-By: Rich Trott Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Mestery Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Darshan Sen --- deps/npm/docs/output/commands/npm-ls.html | 2 +- deps/npm/docs/output/commands/npm.html | 2 +- deps/npm/lib/arborist-cmd.js | 2 + deps/npm/lib/base-command.js | 4 + deps/npm/lib/commands/access.js | 2 + deps/npm/lib/commands/adduser.js | 2 + deps/npm/lib/commands/bin.js | 1 + deps/npm/lib/commands/birthday.js | 2 + deps/npm/lib/commands/bugs.js | 1 + deps/npm/lib/commands/cache.js | 2 + deps/npm/lib/commands/completion.js | 1 + deps/npm/lib/commands/config.js | 2 + deps/npm/lib/commands/deprecate.js | 2 + deps/npm/lib/commands/diff.js | 2 + deps/npm/lib/commands/dist-tag.js | 2 + deps/npm/lib/commands/docs.js | 1 + deps/npm/lib/commands/doctor.js | 1 + deps/npm/lib/commands/edit.js | 1 + deps/npm/lib/commands/exec.js | 2 + deps/npm/lib/commands/explain.js | 2 + deps/npm/lib/commands/explore.js | 1 + deps/npm/lib/commands/get.js | 1 + deps/npm/lib/commands/help-search.js | 1 + deps/npm/lib/commands/help.js | 1 + deps/npm/lib/commands/hook.js | 2 + deps/npm/lib/commands/init.js | 2 + deps/npm/lib/commands/logout.js | 2 + deps/npm/lib/commands/ls.js | 11 +- deps/npm/lib/commands/org.js | 1 + deps/npm/lib/commands/owner.js | 2 + deps/npm/lib/commands/pack.js | 1 + deps/npm/lib/commands/ping.js | 1 + deps/npm/lib/commands/pkg.js | 2 + deps/npm/lib/commands/prefix.js | 1 + deps/npm/lib/commands/profile.js | 2 + deps/npm/lib/commands/publish.js | 7 +- deps/npm/lib/commands/repo.js | 1 + deps/npm/lib/commands/restart.js | 2 + deps/npm/lib/commands/root.js | 1 + deps/npm/lib/commands/run-script.js | 1 + deps/npm/lib/commands/search.js | 1 + deps/npm/lib/commands/set-script.js | 1 + deps/npm/lib/commands/set.js | 1 + deps/npm/lib/commands/shrinkwrap.js | 1 + deps/npm/lib/commands/star.js | 2 + deps/npm/lib/commands/stars.js | 1 + deps/npm/lib/commands/start.js | 2 + deps/npm/lib/commands/stop.js | 2 + deps/npm/lib/commands/team.js | 2 + deps/npm/lib/commands/test.js | 2 + deps/npm/lib/commands/token.js | 1 + deps/npm/lib/commands/uninstall.js | 1 + deps/npm/lib/commands/unpublish.js | 1 + deps/npm/lib/commands/version.js | 2 + deps/npm/lib/commands/view.js | 2 + deps/npm/lib/commands/whoami.js | 1 + deps/npm/lib/npm.js | 7 +- 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-bin.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 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.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 | 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-search.1 | 2 +- deps/npm/man/man1/npm-set-script.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 | 2 +- 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 | 2 +- deps/npm/man/man5/folders.5 | 2 +- deps/npm/man/man5/install.5 | 2 +- deps/npm/man/man5/npm-shrinkwrap-json.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package-json.5 | 2 +- deps/npm/man/man5/package-lock-json.5 | 2 +- deps/npm/man/man7/config.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/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 +- .../node_modules/@gar/promisify/LICENSE.md | 9 + .../node_modules/@gar/promisify/package.json | 2 +- .../@npmcli/arborist/package.json | 8 +- .../node_modules/@npmcli/config/lib/index.js | 5 +- .../node_modules/@npmcli/config/package.json | 8 +- .../git/node_modules/lru-cache/bundle/main.js | 1 + .../node_modules/lru-cache/bundle/main.mjs | 1 + .../git/node_modules/lru-cache/index.js | 38 +- .../git/node_modules/lru-cache/package.json | 26 +- .../@npmcli/map-workspaces/lib/index.js | 1 + .../node_modules/brace-expansion}/LICENSE | 12 +- .../node_modules/brace-expansion/index.js | 202 ++++ .../node_modules/brace-expansion/package.json | 46 + .../node_modules/minimatch/LICENSE | 15 + .../node_modules/minimatch/lib/path.js | 4 + .../node_modules/minimatch/minimatch.js | 901 ++++++++++++++++++ .../node_modules/minimatch/package.json | 32 + .../@npmcli/map-workspaces/package.json | 22 +- .../@npmcli/run-script/package.json | 10 +- .../node_modules/agentkeepalive/History.md | 6 + .../node_modules/agentkeepalive/index.d.ts | 10 +- .../node_modules/agentkeepalive/package.json | 2 +- deps/npm/node_modules/gauge/package.json | 12 +- .../npm/node_modules/is-typedarray/LICENSE.md | 18 - deps/npm/node_modules/is-typedarray/index.js | 41 - .../node_modules/is-typedarray/package.json | 30 - deps/npm/node_modules/is-typedarray/test.js | 34 - .../node_modules/libnpmaccess/package.json | 8 +- deps/npm/node_modules/libnpmdiff/package.json | 11 +- deps/npm/node_modules/libnpmexec/package.json | 11 +- deps/npm/node_modules/libnpmfund/package.json | 11 +- deps/npm/node_modules/libnpmhook/package.json | 11 +- deps/npm/node_modules/libnpmorg/package.json | 8 +- deps/npm/node_modules/libnpmpack/package.json | 8 +- .../node_modules/libnpmpublish/package.json | 8 +- .../node_modules/libnpmsearch/package.json | 8 +- deps/npm/node_modules/libnpmteam/package.json | 8 +- .../node_modules/libnpmversion/package.json | 8 +- .../node_modules/lru-cache/bundle/main.js | 1 + .../node_modules/lru-cache/bundle/main.mjs | 1 + .../node_modules/lru-cache/index.js | 38 +- .../node_modules/lru-cache/package.json | 26 +- .../make-fetch-happen/package.json | 14 +- deps/npm/node_modules/minimatch/minimatch.js | 162 ++-- deps/npm/node_modules/minimatch/package.json | 9 +- deps/npm/node_modules/minipass-fetch/index.js | 1 - .../node_modules/minipass-fetch/lib/blob.js | 8 +- .../node_modules/minipass-fetch/lib/body.js | 106 ++- .../minipass-fetch/lib/fetch-error.js | 3 +- .../minipass-fetch/lib/headers.js | 59 +- .../node_modules/minipass-fetch/lib/index.js | 225 +++-- .../minipass-fetch/lib/request.js | 74 +- .../minipass-fetch/lib/response.js | 5 +- .../node_modules/minipass-fetch/package.json | 36 +- deps/npm/node_modules/node-gyp/CHANGELOG.md | 33 + deps/npm/node_modules/node-gyp/README.md | 16 +- deps/npm/node_modules/node-gyp/SECURITY.md | 2 + .../node-gyp/docs/Common-issues.md | 13 - .../docs/Force-npm-to-use-global-node-gyp.md | 47 + deps/npm/node_modules/node-gyp/docs/README.md | 11 + .../docs/Updating-npm-bundled-node-gyp.md | 67 +- .../docs/binding.gyp-files-in-the-wild.md | 3 +- .../node_modules/node-gyp/lib/configure.js | 2 + .../node-gyp/lib/create-config-gypi.js | 3 +- .../npm/node_modules/node-gyp/lib/node-gyp.js | 4 + .../@tootallnate/once/dist/index.d.ts | 14 - .../@tootallnate/once/dist/index.js | 39 - .../@tootallnate/once/dist/index.js.map | 1 - .../@tootallnate/once/package.json | 45 - .../http-proxy-agent/dist/agent.d.ts | 32 - .../http-proxy-agent/dist/agent.js | 145 --- .../http-proxy-agent/dist/agent.js.map | 1 - .../http-proxy-agent/dist/index.d.ts | 21 - .../http-proxy-agent/dist/index.js | 14 - .../http-proxy-agent/dist/index.js.map | 1 - .../http-proxy-agent/package.json | 57 -- .../node_modules/make-fetch-happen/LICENSE | 16 - .../make-fetch-happen/lib/agent.js | 194 ---- .../make-fetch-happen/lib/cache/entry.js | 460 --------- .../make-fetch-happen/lib/cache/errors.js | 10 - .../make-fetch-happen/lib/cache/index.js | 45 - .../make-fetch-happen/lib/cache/key.js | 17 - .../make-fetch-happen/lib/cache/policy.js | 161 ---- .../make-fetch-happen/lib/fetch.js | 100 -- .../make-fetch-happen/lib/index.js | 40 - .../make-fetch-happen/lib/options.js | 44 - .../make-fetch-happen/lib/remote.js | 102 -- .../make-fetch-happen/package.json | 76 -- deps/npm/node_modules/node-gyp/package.json | 6 +- .../node-gyp/test/test-options.js | 11 + .../npm-registry-fetch/package.json | 10 +- deps/npm/node_modules/signal-exit/index.js | 6 +- .../npm/node_modules/signal-exit/package.json | 2 +- .../socks/build/client/socksclient.js | 17 +- .../socks/build/client/socksclient.js.map | 2 +- deps/npm/node_modules/socks/package.json | 20 +- .../typedarray-to-buffer/index.js | 18 - .../typedarray-to-buffer/package.json | 62 -- .../write-file-atomic/lib/index.js | 12 +- .../write-file-atomic/package.json | 13 +- deps/npm/package.json | 18 +- .../test/lib/commands/ls.js.test.cjs | 20 +- deps/npm/test/lib/commands/ls.js | 11 + deps/npm/test/lib/commands/publish.js | 4 + deps/npm/test/lib/load-all-commands.js | 1 + deps/npm/test/lib/npm.js | 104 +- 243 files changed, 2363 insertions(+), 2447 deletions(-) create mode 100644 deps/npm/node_modules/@gar/promisify/LICENSE.md create mode 100644 deps/npm/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.js create mode 100644 deps/npm/node_modules/@npmcli/git/node_modules/lru-cache/bundle/main.mjs rename deps/npm/node_modules/{typedarray-to-buffer => @npmcli/map-workspaces/node_modules/brace-expansion}/LICENSE (85%) create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/index.js create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/package.json create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/minimatch/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/minimatch/lib/path.js create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/minimatch/minimatch.js create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/node_modules/minimatch/package.json delete mode 100644 deps/npm/node_modules/is-typedarray/LICENSE.md delete mode 100644 deps/npm/node_modules/is-typedarray/index.js delete mode 100644 deps/npm/node_modules/is-typedarray/package.json delete mode 100644 deps/npm/node_modules/is-typedarray/test.js create mode 100644 deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.js create mode 100644 deps/npm/node_modules/make-fetch-happen/node_modules/lru-cache/bundle/main.mjs delete mode 100644 deps/npm/node_modules/minipass-fetch/index.js create mode 100644 deps/npm/node_modules/node-gyp/SECURITY.md delete mode 100644 deps/npm/node_modules/node-gyp/docs/Common-issues.md create mode 100644 deps/npm/node_modules/node-gyp/docs/Force-npm-to-use-global-node-gyp.md create mode 100644 deps/npm/node_modules/node-gyp/docs/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.d.ts delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/dist/index.js.map delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/@tootallnate/once/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.d.ts delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/agent.js.map delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.d.ts delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/dist/index.js.map delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/http-proxy-agent/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/agent.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/entry.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/errors.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/key.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/cache/policy.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/fetch.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/options.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/lib/remote.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/make-fetch-happen/package.json delete mode 100644 deps/npm/node_modules/typedarray-to-buffer/index.js delete mode 100644 deps/npm/node_modules/typedarray-to-buffer/package.json diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 2f28ede781f5..3269bcc579a8 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -166,7 +166,7 @@

Description

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

-
npm@8.5.2 /path/to/npm
+
npm@8.5.3 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 7059fa5d37a3..89bdc4f6d0b2 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@

Table of contents

Version

-

8.5.2

+

8.5.3

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/lib/arborist-cmd.js b/deps/npm/lib/arborist-cmd.js index 931ead8143df..6518e91e0ad9 100644 --- a/deps/npm/lib/arborist-cmd.js +++ b/deps/npm/lib/arborist-cmd.js @@ -14,6 +14,8 @@ class ArboristCmd extends BaseCommand { 'include-workspace-root', ] + static ignoreImplicitWorkspace = false + async execWorkspaces (args, filters) { await this.setWorkspaces(filters) return this.exec(args) diff --git a/deps/npm/lib/base-command.js b/deps/npm/lib/base-command.js index f67f99f36367..b6e3d6d23186 100644 --- a/deps/npm/lib/base-command.js +++ b/deps/npm/lib/base-command.js @@ -20,6 +20,10 @@ class BaseCommand { return this.constructor.description } + get ignoreImplicitWorkspace () { + return this.constructor.ignoreImplicitWorkspace + } + get usage () { let usage = `npm ${this.constructor.name}\n\n` if (this.constructor.description) { diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js index 206d6de9c22c..bc8ce48bacda 100644 --- a/deps/npm/lib/commands/access.js +++ b/deps/npm/lib/commands/access.js @@ -27,6 +27,8 @@ class Access extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = true + static usage = [ 'public []', 'restricted []', diff --git a/deps/npm/lib/commands/adduser.js b/deps/npm/lib/commands/adduser.js index cbeaaaf0f28b..755abea8eb9e 100644 --- a/deps/npm/lib/commands/adduser.js +++ b/deps/npm/lib/commands/adduser.js @@ -16,6 +16,8 @@ class AddUser extends BaseCommand { 'scope', ] + static ignoreImplicitWorkspace = true + async exec (args) { const { scope } = this.npm.flatOptions const registry = this.getRegistry(this.npm.flatOptions) diff --git a/deps/npm/lib/commands/bin.js b/deps/npm/lib/commands/bin.js index bb700d45a8f1..77028f06dd49 100644 --- a/deps/npm/lib/commands/bin.js +++ b/deps/npm/lib/commands/bin.js @@ -5,6 +5,7 @@ class Bin extends BaseCommand { static description = 'Display npm bin folder' static name = 'bin' static params = ['global'] + static ignoreImplicitWorkspace = true async exec (args) { const b = this.npm.bin diff --git a/deps/npm/lib/commands/birthday.js b/deps/npm/lib/commands/birthday.js index 27fe2c50cab0..e889b39f2537 100644 --- a/deps/npm/lib/commands/birthday.js +++ b/deps/npm/lib/commands/birthday.js @@ -2,6 +2,8 @@ const BaseCommand = require('../base-command.js') class Birthday extends BaseCommand { static name = 'birthday' + static ignoreImplicitWorkspace = true + async exec () { this.npm.config.set('yes', true) return this.npm.exec('exec', ['@npmcli/npm-birthday']) diff --git a/deps/npm/lib/commands/bugs.js b/deps/npm/lib/commands/bugs.js index 5dfd1eb91895..f6218f033f3d 100644 --- a/deps/npm/lib/commands/bugs.js +++ b/deps/npm/lib/commands/bugs.js @@ -9,6 +9,7 @@ class Bugs extends BaseCommand { static name = 'bugs' static usage = ['[]'] static params = ['browser', 'registry'] + static ignoreImplicitWorkspace = true async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js index ecb34cb8916c..b8f84abc1d94 100644 --- a/deps/npm/lib/commands/cache.js +++ b/deps/npm/lib/commands/cache.js @@ -81,6 +81,8 @@ class Cache extends BaseCommand { 'verify', ] + static ignoreImplicitWorkspace = true + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length === 2) { diff --git a/deps/npm/lib/commands/completion.js b/deps/npm/lib/commands/completion.js index 4ded2de385af..0317753a15aa 100644 --- a/deps/npm/lib/commands/completion.js +++ b/deps/npm/lib/commands/completion.js @@ -47,6 +47,7 @@ const BaseCommand = require('../base-command.js') class Completion extends BaseCommand { static description = 'Tab Completion for npm' static name = 'completion' + static ignoreImplicitWorkspace = false // completion for the completion command async completion (opts) { diff --git a/deps/npm/lib/commands/config.js b/deps/npm/lib/commands/config.js index 96524e00817f..690a69a3233e 100644 --- a/deps/npm/lib/commands/config.js +++ b/deps/npm/lib/commands/config.js @@ -61,6 +61,8 @@ class Config extends BaseCommand { 'long', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv[1] !== 'config') { diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js index 839e974caf09..88eb320c32a5 100644 --- a/deps/npm/lib/commands/deprecate.js +++ b/deps/npm/lib/commands/deprecate.js @@ -15,6 +15,8 @@ class Deprecate extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = false + async completion (opts) { if (opts.conf.argv.remain.length > 1) { return [] diff --git a/deps/npm/lib/commands/diff.js b/deps/npm/lib/commands/diff.js index d737a58dc43d..ff942cc44e94 100644 --- a/deps/npm/lib/commands/diff.js +++ b/deps/npm/lib/commands/diff.js @@ -32,6 +32,8 @@ class Diff extends BaseCommand { 'include-workspace-root', ] + static ignoreImplicitWorkspace = false + async exec (args) { const specs = this.npm.config.get('diff').filter(d => d) if (specs.length > 2) { diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js index bb36f3f72bfb..3b82c5194cca 100644 --- a/deps/npm/lib/commands/dist-tag.js +++ b/deps/npm/lib/commands/dist-tag.js @@ -16,6 +16,8 @@ class DistTag extends BaseCommand { 'ls []', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length === 2) { diff --git a/deps/npm/lib/commands/docs.js b/deps/npm/lib/commands/docs.js index 19cd73564226..631615acc56b 100644 --- a/deps/npm/lib/commands/docs.js +++ b/deps/npm/lib/commands/docs.js @@ -15,6 +15,7 @@ class Docs extends BaseCommand { ] static usage = ['[ [ ...]]'] + static ignoreImplicitWorkspace = false async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/doctor.js b/deps/npm/lib/commands/doctor.js index 508faa57aa5e..9af4c4cd6ffb 100644 --- a/deps/npm/lib/commands/doctor.js +++ b/deps/npm/lib/commands/doctor.js @@ -41,6 +41,7 @@ class Doctor extends BaseCommand { static description = 'Check your npm environment' static name = 'doctor' static params = ['registry'] + static ignoreImplicitWorkspace = false async exec (args) { log.info('Running checkup') diff --git a/deps/npm/lib/commands/edit.js b/deps/npm/lib/commands/edit.js index 5f069c4f132e..ce74ff79b2b7 100644 --- a/deps/npm/lib/commands/edit.js +++ b/deps/npm/lib/commands/edit.js @@ -13,6 +13,7 @@ class Edit extends BaseCommand { static name = 'edit' static usage = ['[/...]'] static params = ['editor'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/exec.js b/deps/npm/lib/commands/exec.js index 52fb1f8eb722..6b402c856ab1 100644 --- a/deps/npm/lib/commands/exec.js +++ b/deps/npm/lib/commands/exec.js @@ -45,6 +45,8 @@ class Exec extends BaseCommand { '--package=foo -c \' [args...]\'', ] + static ignoreImplicitWorkspace = false + async exec (_args, { locationMsg, path, runPath } = {}) { if (!path) { path = this.npm.localPrefix diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js index fd62b87fc869..ca6ee7540bc9 100644 --- a/deps/npm/lib/commands/explain.js +++ b/deps/npm/lib/commands/explain.js @@ -16,6 +16,8 @@ class Explain extends ArboristWorkspaceCmd { 'workspace', ] + static ignoreImplicitWorkspace = false + // TODO /* istanbul ignore next */ async completion (opts) { diff --git a/deps/npm/lib/commands/explore.js b/deps/npm/lib/commands/explore.js index 90e6af69fe57..5b97673b90ea 100644 --- a/deps/npm/lib/commands/explore.js +++ b/deps/npm/lib/commands/explore.js @@ -13,6 +13,7 @@ class Explore extends BaseCommand { static name = 'explore' static usage = [' [ -- ]'] static params = ['shell'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/get.js b/deps/npm/lib/commands/get.js index 7583ade23d60..5e92e85a6638 100644 --- a/deps/npm/lib/commands/get.js +++ b/deps/npm/lib/commands/get.js @@ -4,6 +4,7 @@ class Get extends BaseCommand { static description = 'Get a value from the npm configuration' static name = 'get' static usage = ['[ ...] (See `npm config`)'] + static ignoreImplicitWorkspace = false // TODO /* istanbul ignore next */ diff --git a/deps/npm/lib/commands/help-search.js b/deps/npm/lib/commands/help-search.js index 6025a6dabd74..9422b83561cc 100644 --- a/deps/npm/lib/commands/help-search.js +++ b/deps/npm/lib/commands/help-search.js @@ -11,6 +11,7 @@ class HelpSearch extends BaseCommand { static name = 'help-search' static usage = [''] static params = ['long'] + static ignoreImplicitWorkspace = true async exec (args) { if (!args.length) { diff --git a/deps/npm/lib/commands/help.js b/deps/npm/lib/commands/help.js index f94178dd5d1d..40f5ad9b3009 100644 --- a/deps/npm/lib/commands/help.js +++ b/deps/npm/lib/commands/help.js @@ -17,6 +17,7 @@ class Help extends BaseCommand { static name = 'help' static usage = [' []'] static params = ['viewer'] + static ignoreImplicitWorkspace = true async completion (opts) { if (opts.conf.argv.remain.length > 2) { diff --git a/deps/npm/lib/commands/hook.js b/deps/npm/lib/commands/hook.js index 2ff6ac01ce52..a4619802d842 100644 --- a/deps/npm/lib/commands/hook.js +++ b/deps/npm/lib/commands/hook.js @@ -19,6 +19,8 @@ class Hook extends BaseCommand { 'update ', ] + static ignoreImplicitWorkspace = true + async exec (args) { return otplease({ ...this.npm.flatOptions, diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js index 367533f8259f..2a6b6aaddc7e 100644 --- a/deps/npm/lib/commands/init.js +++ b/deps/npm/lib/commands/init.js @@ -22,6 +22,8 @@ class Init extends BaseCommand { '[<@scope>/] (same as `npx [<@scope>/]create-`)', ] + static ignoreImplicitWorkspace = false + async exec (args) { // npm exec style if (args.length) { diff --git a/deps/npm/lib/commands/logout.js b/deps/npm/lib/commands/logout.js index aea5e93652b0..7c2a7f0b2f83 100644 --- a/deps/npm/lib/commands/logout.js +++ b/deps/npm/lib/commands/logout.js @@ -11,6 +11,8 @@ class Logout extends BaseCommand { 'scope', ] + static ignoreImplicitWorkspace = true + async exec (args) { const registry = this.npm.config.get('registry') const scope = this.npm.config.get('scope') diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index 8c338c064758..e56c90dae16e 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -95,10 +95,15 @@ class LS extends ArboristWorkspaceCmd { return true } + if (this.npm.flatOptions.includeWorkspaceRoot + && !edge.to.isWorkspace) { + return true + } + if (edge.from.isProjectRoot) { - return edge.to && - edge.to.isWorkspace && - wsNodes.includes(edge.to.target) + return (edge.to + && edge.to.isWorkspace + && wsNodes.includes(edge.to.target)) } return true diff --git a/deps/npm/lib/commands/org.js b/deps/npm/lib/commands/org.js index f3d344ca33e3..e2202a9e9cf3 100644 --- a/deps/npm/lib/commands/org.js +++ b/deps/npm/lib/commands/org.js @@ -13,6 +13,7 @@ class Org extends BaseCommand { ] static params = ['registry', 'otp', 'json', 'parseable'] + static ignoreImplicitWorkspace = true async completion (opts) { const argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js index effaaa6a53d3..93e0a45ad1e2 100644 --- a/deps/npm/lib/commands/owner.js +++ b/deps/npm/lib/commands/owner.js @@ -20,6 +20,8 @@ class Owner extends BaseCommand { 'ls [<@scope>/]', ] + static ignoreImplicitWorkspace = false + async completion (opts) { const argv = opts.conf.argv.remain if (argv.length > 3) { diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js index 74c29699a05c..41fef5cb45a4 100644 --- a/deps/npm/lib/commands/pack.js +++ b/deps/npm/lib/commands/pack.js @@ -18,6 +18,7 @@ class Pack extends BaseCommand { ] static usage = ['[[<@scope>/]...]'] + static ignoreImplicitWorkspace = false async exec (args) { if (args.length === 0) { diff --git a/deps/npm/lib/commands/ping.js b/deps/npm/lib/commands/ping.js index 5a651c4a6ab0..22039214689a 100644 --- a/deps/npm/lib/commands/ping.js +++ b/deps/npm/lib/commands/ping.js @@ -6,6 +6,7 @@ class Ping extends BaseCommand { static description = 'Ping npm registry' static params = ['registry'] static name = 'ping' + static ignoreImplicitWorkspace = true async exec (args) { log.notice('PING', this.npm.config.get('registry')) diff --git a/deps/npm/lib/commands/pkg.js b/deps/npm/lib/commands/pkg.js index 6ca892293ceb..3a8e01f65bc9 100644 --- a/deps/npm/lib/commands/pkg.js +++ b/deps/npm/lib/commands/pkg.js @@ -20,6 +20,8 @@ class Pkg extends BaseCommand { 'workspaces', ] + static ignoreImplicitWorkspace = false + async exec (args, { prefix } = {}) { if (!prefix) { this.prefix = this.npm.localPrefix diff --git a/deps/npm/lib/commands/prefix.js b/deps/npm/lib/commands/prefix.js index 264b819fc769..dd0e34c3d3bd 100644 --- a/deps/npm/lib/commands/prefix.js +++ b/deps/npm/lib/commands/prefix.js @@ -5,6 +5,7 @@ class Prefix extends BaseCommand { static name = 'prefix' static params = ['global'] static usage = ['[-g]'] + static ignoreImplicitWorkspace = true async exec (args) { return this.npm.output(this.npm.prefix) diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js index 6b4d1407f791..a82d31fd443a 100644 --- a/deps/npm/lib/commands/profile.js +++ b/deps/npm/lib/commands/profile.js @@ -54,6 +54,8 @@ class Profile extends BaseCommand { 'otp', ] + static ignoreImplicitWorkspace = true + async completion (opts) { var argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js index d1f0ee743cfc..1f26370e89a5 100644 --- a/deps/npm/lib/commands/publish.js +++ b/deps/npm/lib/commands/publish.js @@ -39,6 +39,7 @@ class Publish extends BaseCommand { ] static usage = ['[]'] + static ignoreImplicitWorkspace = false async exec (args) { if (args.length === 0) { @@ -195,7 +196,11 @@ class Publish extends BaseCommand { if (spec.type === 'directory') { return readJson(`${spec.fetchSpec}/package.json`) } - return pacote.manifest(spec, { ...opts, fullMetadata: true }) + return pacote.manifest(spec, { + ...opts, + fullMetadata: true, + fullReadJson: true, + }) } } module.exports = Publish diff --git a/deps/npm/lib/commands/repo.js b/deps/npm/lib/commands/repo.js index 8ac4178f261e..b8dccc209ff8 100644 --- a/deps/npm/lib/commands/repo.js +++ b/deps/npm/lib/commands/repo.js @@ -10,6 +10,7 @@ class Repo extends BaseCommand { static name = 'repo' static params = ['browser', 'workspace', 'workspaces', 'include-workspace-root'] static usage = ['[ [ ...]]'] + static ignoreImplicitWorkspace = false async exec (args) { if (!args || !args.length) { diff --git a/deps/npm/lib/commands/restart.js b/deps/npm/lib/commands/restart.js index a12368644a13..575928b2202c 100644 --- a/deps/npm/lib/commands/restart.js +++ b/deps/npm/lib/commands/restart.js @@ -8,5 +8,7 @@ class Restart extends LifecycleCmd { 'ignore-scripts', 'script-shell', ] + + static ignoreImplicitWorkspace = false } module.exports = Restart diff --git a/deps/npm/lib/commands/root.js b/deps/npm/lib/commands/root.js index 7749c602456b..b814034def5a 100644 --- a/deps/npm/lib/commands/root.js +++ b/deps/npm/lib/commands/root.js @@ -3,6 +3,7 @@ class Root extends BaseCommand { static description = 'Display npm root' static name = 'root' static params = ['global'] + static ignoreImplicitWorkspace = true async exec () { this.npm.output(this.npm.dir) diff --git a/deps/npm/lib/commands/run-script.js b/deps/npm/lib/commands/run-script.js index edba95821b44..74757e984aee 100644 --- a/deps/npm/lib/commands/run-script.js +++ b/deps/npm/lib/commands/run-script.js @@ -40,6 +40,7 @@ class RunScript extends BaseCommand { static name = 'run-script' static usage = [' [-- ]'] + static ignoreImplicitWorkspace = false async completion (opts) { const argv = opts.conf.argv.remain diff --git a/deps/npm/lib/commands/search.js b/deps/npm/lib/commands/search.js index bdeeffe81698..a06ba4031443 100644 --- a/deps/npm/lib/commands/search.js +++ b/deps/npm/lib/commands/search.js @@ -44,6 +44,7 @@ class Search extends BaseCommand { ] static usage = ['[search terms ...]'] + static ignoreImplicitWorkspace = true async exec (args) { const opts = { diff --git a/deps/npm/lib/commands/set-script.js b/deps/npm/lib/commands/set-script.js index 7c73ff01b939..a6b7c3a50cda 100644 --- a/deps/npm/lib/commands/set-script.js +++ b/deps/npm/lib/commands/set-script.js @@ -9,6 +9,7 @@ class SetScript extends BaseCommand { static params = ['workspace', 'workspaces', 'include-workspace-root'] static name = 'set-script' static usage = ['[