From a4969d5c3793f386e4675d8076c3137eee0d9b57 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Wed, 23 Feb 2022 19:04:44 -0500 Subject: [PATCH 01/81] doc: add release key for Bryan English MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds Bryan English and his public key to the README for releases. PR-URL: https://github.com/nodejs/node/pull/42102 Reviewed-By: Colin Ihrig Reviewed-By: Beth Griggs Reviewed-By: Rich Trott Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Mestery Reviewed-By: Michael Dawson Reviewed-By: Danielle Adams --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2efe61ea6fcbf0..e823d92325e497 100644 --- a/README.md +++ b/README.md @@ -667,6 +667,8 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): * **Beth Griggs** <> `4ED778F539E3634C779C87C6D7062848A1AB005C` +* **Bryan English** <> + `141F07595B7B3FFE74309A937405533BE57C7D57` * **Colin Ihrig** <> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` * **Danielle Adams** <> @@ -693,6 +695,7 @@ to sign releases): ```bash gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C +gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 gpg --keyserver hkps://keys.openpgp.org --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 gpg --keyserver hkps://keys.openpgp.org --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 From f7ea75fd0ab11ebc2a07cfe12efb476e3f63775b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 21 Feb 2022 12:32:49 +0100 Subject: [PATCH 02/81] lib: add legacy built-in functions to primordials PR-URL: https://github.com/nodejs/node/pull/42049 Reviewed-By: Darshan Sen Reviewed-By: Mestery --- lib/.eslintrc.yaml | 3 +++ lib/internal/freeze_intrinsics.js | 3 +++ lib/internal/per_context/primordials.js | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 83d6855a1cc0a0..af60e4139a4195 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -138,6 +138,8 @@ rules: - name: decodeURIComponent - name: encodeURI - name: encodeURIComponent + - name: escape + - name: eval - name: Error ignore: - prepareStackTrace @@ -181,6 +183,7 @@ rules: - name: Uint32Array - name: Uint8Array - name: Uint8ClampedArray + - name: unescape - name: URIError - name: WeakMap into: Safe diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 82720f0ef95aba..0dcfea1ef2ec28 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -121,7 +121,9 @@ const { decodeURIComponent, encodeURI, encodeURIComponent, + escape, globalThis, + unescape, } = primordials; const { @@ -232,6 +234,7 @@ module.exports = function() { // 19 The Global Object // 19.2 Function Properties of the Global Object + // eslint-disable-next-line node-core/prefer-primordials eval, // eslint-disable-next-line node-core/prefer-primordials isFinite, diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 2c0df17fbe1170..7d9368e678cc96 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -154,6 +154,15 @@ function copyPrototype(src, dest, prefix) { primordials[fn.name] = fn; }); +// Create copies of legacy functions +[ + escape, + eval, + unescape, +].forEach((fn) => { + primordials[fn.name] = fn; +}); + // Create copies of the namespace objects [ 'JSON', From e3347dbaa85fe081adc4beca35bb4da8d83af379 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 21 Feb 2022 10:43:53 -0800 Subject: [PATCH 03/81] meta: remove collaborator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42073 Reviewed-By: Michael Dawson Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso Reviewed-By: Mary Marchini Reviewed-By: Mestery Reviewed-By: Antoine du Hamel Reviewed-By: Derek Lewis --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e823d92325e497..781bceff27f87d 100644 --- a/README.md +++ b/README.md @@ -312,8 +312,6 @@ For information about the governance of the Node.js project, see **Daniel Bevenius** <> (he/him) * [danielleadams](https://github.com/danielleadams) - **Danielle Adams** <> (she/her) -* [DerekNonGeneric](https://github.com/DerekNonGeneric) - - **Derek Lewis** <> (he/him) * [devnexen](https://github.com/devnexen) - **David Carlier** <> * [devsnek](https://github.com/devsnek) - From 99301469ed4b8a4632d651ca3be45c1b135bea84 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 21 Feb 2022 12:30:06 -0800 Subject: [PATCH 04/81] test: increase Fibonacci argument to 40 Fixes: https://github.com/nodejs/node/issues/34031 PR-URL: https://github.com/nodejs/node/pull/42055 Reviewed-By: Luigi Pinca Reviewed-By: Akhil Marsonya Reviewed-By: Darshan Sen Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- test/fixtures/workload/fibonacci.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/fixtures/workload/fibonacci.js b/test/fixtures/workload/fibonacci.js index 0326914d048203..90ef3e99fb39a3 100644 --- a/test/fixtures/workload/fibonacci.js +++ b/test/fixtures/workload/fibonacci.js @@ -4,12 +4,5 @@ function fib(n) { return fib(n - 1) + fib(n - 2); } -// This is based on emperial values - in the CI, on Windows the program -// tend to finish too fast then we won't be able to see the profiled script -// in the samples, so we need to bump the values a bit. On slower platforms -// like the Pis it could take more time to complete, we need to use a -// smaller value so the test would not time out. -const FIB = process.platform === 'win32' ? 40 : 30; - -const n = parseInt(process.env.FIB) || FIB; +const n = parseInt(process.env.FIB, 10) || 40; process.stdout.write(`${fib(n)}\n`); From 3789d668f75c0a60c85208750a823e5c70184cb3 Mon Sep 17 00:00:00 2001 From: legendecas Date: Thu, 17 Feb 2022 00:24:37 +0800 Subject: [PATCH 05/81] doc: add missing api entries on performance PR-URL: https://github.com/nodejs/node/pull/42018 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Mohammed Keyvanzadeh --- doc/api/perf_hooks.md | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index fd7c2bbcd68729..18c8ddba02f9e2 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -55,6 +55,17 @@ added: v8.5.0 If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. If `name` is provided, removes only the named mark. +### `performance.clearMeasures([name])` + + + +* `name` {string} + +If `name` is not provided, removes all `PerformanceMeasure` objects from the +Performance Timeline. If `name` is provided, removes only the named mark. + ### `performance.eventLoopUtilization([utilization1[, utilization2]])` + +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order with +respect to `performanceEntry.startTime`. If you are only interested in +performance entries of certain types or that have certain names, see +`performance.getEntriesByType()` and `performance.getEntriesByName()`. + +### `performance.getEntriesByName(name[, type])` + + + +* `name` {string} +* `type` {string} +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order +with respect to `performanceEntry.startTime` whose `performanceEntry.name` is +equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to +`type`. + +### `performance.getEntriesByType(type)` + + + +* `type` {string} +* Returns: {PerformanceEntry\[]} + +Returns a list of `PerformanceEntry` objects in chronological order +with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` +is equal to `type`. + ### `performance.mark([name[, options]])` * {Object} From 8431fb90dcf1d37243b9635da80a3e470f851792 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Wed, 23 Feb 2022 23:06:00 +0200 Subject: [PATCH 19/81] stream: port more test262 tests Add some test262 tests for `every`, add some `length` checks. Turns out properties need to be writable after all according to the test262 tests. PR-URL: https://github.com/nodejs/node/pull/41974 Reviewed-By: James M Snell Reviewed-By: Robert Nagy Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel --- lib/internal/streams/operators.js | 4 +- lib/stream.js | 5 +- ...-stream-iterator-helpers-test262-tests.mjs | 59 ++++++++++++++++++- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index c48a058303bb9a..3d792e3b495dc1 100644 --- a/lib/internal/streams/operators.js +++ b/lib/internal/streams/operators.js @@ -186,7 +186,7 @@ function asIndexedPairs(options = undefined) { }.call(this); } -async function some(fn, options) { +async function some(fn, options = undefined) { // eslint-disable-next-line no-unused-vars for await (const unused of filter.call(this, fn, options)) { return true; @@ -194,7 +194,7 @@ async function some(fn, options) { return false; } -async function every(fn, options) { +async function every(fn, options = undefined) { if (typeof fn !== 'function') { throw new ERR_INVALID_ARG_TYPE( 'fn', ['Function', 'AsyncFunction'], fn); diff --git a/lib/stream.js b/lib/stream.js index e077ef257abda1..55f903f295fecf 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -75,6 +75,9 @@ for (const key of ObjectKeys(streamReturningOperators)) { for (const key of ObjectKeys(promiseReturningOperators)) { const op = promiseReturningOperators[key]; function fn(...args) { + if (new.target) { + throw ERR_ILLEGAL_CONSTRUCTOR(); + } return ReflectApply(op, this, args); } ObjectDefineProperty(fn, 'name', { value: op.name }); @@ -83,7 +86,7 @@ for (const key of ObjectKeys(promiseReturningOperators)) { value: fn, enumerable: false, configurable: true, - writable: false, + writable: true, }); } Stream.Writable = require('internal/streams/writable'); diff --git a/test/parallel/test-stream-iterator-helpers-test262-tests.mjs b/test/parallel/test-stream-iterator-helpers-test262-tests.mjs index ea05717f4197f3..ab54abdd793928 100644 --- a/test/parallel/test-stream-iterator-helpers-test262-tests.mjs +++ b/test/parallel/test-stream-iterator-helpers-test262-tests.mjs @@ -1,4 +1,4 @@ -import '../common/index.mjs'; +import { mustCall } from '../common/index.mjs'; import { Readable } from 'stream'; import assert from 'assert'; @@ -68,7 +68,7 @@ import assert from 'assert'; ); assert.strictEqual(descriptor.enumerable, false); assert.strictEqual(descriptor.configurable, true); - // assert.strictEqual(descriptor.writable, false); + // assert.strictEqual(descriptor.writable, true); } { // drop/length @@ -79,7 +79,7 @@ import assert from 'assert'; ); assert.strictEqual(descriptor.enumerable, false); assert.strictEqual(descriptor.configurable, true); - // assert.strictEqual(descriptor.writable, false); + // assert.strictEqual(descriptor.writable, true); // drop/limit-equals-total const iterator = Readable.from([1, 2]).drop(2); const result = await iterator[Symbol.asyncIterator]().next(); @@ -111,5 +111,58 @@ import assert from 'assert'; // drop/proto const proto = Object.getPrototypeOf(Readable.prototype.drop); assert.strictEqual(proto, Function.prototype); +} +{ + // every/abrupt-iterator-close + const stream = Readable.from([1, 2, 3]); + const e = new Error(); + await assert.rejects(stream.every(mustCall(() => { + throw e; + }, 1)), e); +} +{ + // every/callable-fn + await assert.rejects(Readable.from([1, 2]).every({}), TypeError); +} +{ + // every/callable + Readable.prototype.every.call(Readable.from([]), () => {}); + // eslint-disable-next-line array-callback-return + Readable.from([]).every(() => {}); + assert.throws(() => { + const r = Readable.from([]); + new r.every(() => {}); + }, TypeError); +} +{ + // every/false + const iterator = Readable.from([1, 2, 3]); + const result = await iterator.every((v) => v === 1); + assert.strictEqual(result, false); +} +{ + // every/every + const iterator = Readable.from([1, 2, 3]); + const result = await iterator.every((v) => true); + assert.strictEqual(result, true); +} + +{ + // every/is-function + assert.strictEqual(typeof Readable.prototype.every, 'function'); +} +{ + // every/length + assert.strictEqual(Readable.prototype.every.length, 1); + // every/name + assert.strictEqual(Readable.prototype.every.name, 'every'); + // every/propdesc + const descriptor = Object.getOwnPropertyDescriptor( + Readable.prototype, + 'every' + ); + assert.strictEqual(descriptor.enumerable, false); + assert.strictEqual(descriptor.configurable, true); + assert.strictEqual(descriptor.writable, true); } From 96510b3411dbb03c5f69f17683c76a5cc6013b1d Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sat, 12 Feb 2022 20:46:37 +0200 Subject: [PATCH 20/81] module: prefer async/await in https imports PR-URL: https://github.com/nodejs/node/pull/41950 Fixes: https://github.com/nodejs/node/issues/41950 Reviewed-By: Guy Bedford Reviewed-By: James M Snell --- lib/internal/modules/esm/fetch_module.js | 172 +++++++++-------------- test/es-module/test-http-imports.mjs | 11 ++ 2 files changed, 79 insertions(+), 104 deletions(-) diff --git a/lib/internal/modules/esm/fetch_module.js b/lib/internal/modules/esm/fetch_module.js index 2cbc6ea72d0934..f6c2fc8827aa73 100644 --- a/lib/internal/modules/esm/fetch_module.js +++ b/lib/internal/modules/esm/fetch_module.js @@ -1,26 +1,24 @@ 'use strict'; const { - ArrayPrototypePush, - Promise, + ObjectPrototypeHasOwnProperty, PromisePrototypeThen, - PromiseResolve, SafeMap, StringPrototypeEndsWith, StringPrototypeSlice, StringPrototypeStartsWith, } = primordials; const { - Buffer: { - concat: BufferConcat - } + Buffer: { concat: BufferConcat }, } = require('buffer'); const { ERR_NETWORK_IMPORT_DISALLOWED, ERR_NETWORK_IMPORT_BAD_RESPONSE, + ERR_MODULE_NOT_FOUND, } = require('internal/errors').codes; const { URL } = require('internal/url'); const net = require('net'); - +const { once } = require('events'); +const { compose } = require('stream'); /** * @typedef CacheEntry * @property {Promise | string} resolvedHREF @@ -32,6 +30,9 @@ const net = require('net'); * Only for GET requests, other requests would need new Map * HTTP cache semantics keep diff caches * + * It caches either the promise or the cache entry since import.meta.url needs + * the value synchronously for the response location after all redirects. + * * Maps HREF to pending cache entry * @type {Map | CacheEntry>} */ @@ -47,11 +48,11 @@ let HTTPSAgent; function HTTPSGet(url, opts) { const https = require('https'); // [1] HTTPSAgent ??= new https.Agent({ // [2] - keepAlive: true + keepAlive: true, }); return https.get(url, { agent: HTTPSAgent, - ...opts + ...opts, }); } @@ -59,11 +60,11 @@ let HTTPAgent; function HTTPGet(url, opts) { const http = require('http'); // [1] HTTPAgent ??= new http.Agent({ // [2] - keepAlive: true + keepAlive: true, }); return http.get(url, { agent: HTTPAgent, - ...opts + ...opts, }); } @@ -98,59 +99,47 @@ function fetchWithRedirects(parsed) { return existing; } const handler = parsed.protocol === 'http:' ? HTTPGet : HTTPSGet; - const result = new Promise((fulfill, reject) => { + const result = (async () => { const req = handler(parsed, { - headers: { - Accept: '*/*' - } - }) - .on('error', reject) - .on('response', (res) => { - function dispose() { - req.destroy(); - res.destroy(); - } - if (res.statusCode >= 300 && res.statusCode <= 303) { - if (res.headers.location) { - dispose(); - try { - const location = new URL(res.headers.location, parsed); - if (location.protocol !== 'http:' && - location.protocol !== 'https:') { - reject(new ERR_NETWORK_IMPORT_DISALLOWED( - res.headers.location, - parsed.href, - 'cannot redirect to non-network location')); - return; - } - return PromisePrototypeThen( - PromiseResolve(fetchWithRedirects(location)), - (entry) => { - cacheForGET.set(parsed.href, entry); - fulfill(entry); - }); - } catch (e) { - dispose(); - reject(e); - } + headers: { Accept: '*/*' }, + }); + // Note that `once` is used here to handle `error` and that it hits the + // `finally` on network error/timeout. + const { 0: res } = await once(req, 'response'); + try { + const isRedirect = res.statusCode >= 300 && res.statusCode <= 303; + const hasLocation = ObjectPrototypeHasOwnProperty(res.headers, 'location'); + if (isRedirect && hasLocation) { + const location = new URL(res.headers.location, parsed); + if (location.protocol !== 'http:' && location.protocol !== 'https:') { + throw new ERR_NETWORK_IMPORT_DISALLOWED( + res.headers.location, + parsed.href, + 'cannot redirect to non-network location' + ); } + const entry = await fetchWithRedirects(location); + cacheForGET.set(parsed.href, entry); + return entry; + } + if (res.statusCode === 404) { + const err = new ERR_MODULE_NOT_FOUND(parsed.href, null); + err.message = `Cannot find module '${parsed.href}', HTTP 404`; + throw err; } if (res.statusCode > 303 || res.statusCode < 200) { - dispose(); - reject( - new ERR_NETWORK_IMPORT_BAD_RESPONSE( - parsed.href, - 'HTTP response returned status code of ' + res.statusCode)); - return; + throw new ERR_NETWORK_IMPORT_DISALLOWED( + res.headers.location, + parsed.href, + 'cannot redirect to non-network location'); } const { headers } = res; const contentType = headers['content-type']; if (!contentType) { - dispose(); - reject(new ERR_NETWORK_IMPORT_BAD_RESPONSE( + throw new ERR_NETWORK_IMPORT_BAD_RESPONSE( parsed.href, - 'the \'Content-Type\' header is required')); - return; + "the 'Content-Type' header is required" + ); } /** * @type {CacheEntry} @@ -158,58 +147,31 @@ function fetchWithRedirects(parsed) { const entry = { resolvedHREF: parsed.href, headers: { - 'content-type': res.headers['content-type'] + 'content-type': res.headers['content-type'], }, - body: new Promise((f, r) => { - const buffers = []; - let size = 0; + body: (async () => { let bodyStream = res; - let onError; if (res.headers['content-encoding'] === 'br') { - bodyStream = createBrotliDecompress(); - onError = function onError(error) { - bodyStream.close(); - dispose(); - reject(error); - r(error); - }; - res.on('error', onError); - res.pipe(bodyStream); - } else if (res.headers['content-encoding'] === 'gzip' || - res.headers['content-encoding'] === 'deflate') { - bodyStream = createUnzip(); - onError = function onError(error) { - bodyStream.close(); - dispose(); - reject(error); - r(error); - }; - res.on('error', onError); - res.pipe(bodyStream); - } else { - onError = function onError(error) { - dispose(); - reject(error); - r(error); - }; + bodyStream = compose(res, createBrotliDecompress()); + } else if ( + res.headers['content-encoding'] === 'gzip' || + res.headers['content-encoding'] === 'deflate' + ) { + bodyStream = compose(res, createUnzip()); } - bodyStream.on('error', onError); - bodyStream.on('data', (d) => { - ArrayPrototypePush(buffers, d); - size += d.length; - }); - bodyStream.on('end', () => { - const body = entry.body = /** @type {Buffer} */( - BufferConcat(buffers, size) - ); - f(body); - }); - }), + const buffers = await bodyStream.toArray(); + const body = BufferConcat(buffers); + entry.body = body; + return body; + })(), }; cacheForGET.set(parsed.href, entry); - fulfill(entry); - }); - }); + await entry.body; + return entry; + } finally { + req.destroy(); + } + })(); cacheForGET.set(parsed.href, result); return result; } @@ -226,8 +188,10 @@ allowList.addRange('127.0.0.1', '127.255.255.255'); */ async function isLocalAddress(hostname) { try { - if (StringPrototypeStartsWith(hostname, '[') && - StringPrototypeEndsWith(hostname, ']')) { + if ( + StringPrototypeStartsWith(hostname, '[') && + StringPrototypeEndsWith(hostname, ']') + ) { hostname = StringPrototypeSlice(hostname, 1, -1); } const addr = await dnsLookup(hostname, { verbatim: true }); @@ -275,5 +239,5 @@ function fetchModule(parsed, { parentURL }) { } module.exports = { - fetchModule: fetchModule + fetchModule: fetchModule, }; diff --git a/test/es-module/test-http-imports.mjs b/test/es-module/test-http-imports.mjs index a9a5204ffb7947..c09ee4c54bc2d3 100644 --- a/test/es-module/test-http-imports.mjs +++ b/test/es-module/test-http-imports.mjs @@ -64,6 +64,11 @@ for (const { protocol, createServer } of [ const server = createServer(function(_req, res) { const url = new URL(_req.url, host); const redirect = url.searchParams.get('redirect'); + if (url.pathname === '/not-found') { + res.writeHead(404); + res.end(); + return; + } if (redirect) { const { status, location } = JSON.parse(redirect); res.writeHead(status, { @@ -165,6 +170,12 @@ for (const { protocol, createServer } of [ import(unsupportedMIME.href), { code: 'ERR_UNKNOWN_MODULE_FORMAT' } ); + const notFound = new URL(url.href); + notFound.pathname = '/not-found'; + await assert.rejects( + import(notFound.href), + { code: 'ERR_MODULE_NOT_FOUND' }, + ); server.close(); } From 86248f1178e3237e98da39ab2d632b0d6faefb9b Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 24 Feb 2022 00:32:30 +0100 Subject: [PATCH 21/81] src: allow preventing InitializeInspector in env PR-URL: https://github.com/nodejs/node/pull/35025 Reviewed-By: David Carlier Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Rich Trott Reviewed-By: James M Snell --- src/api/environment.cc | 14 +++++++------ src/env-inl.h | 4 ++++ src/env.h | 1 + src/inspector_agent.cc | 47 ++++++++++++++++++++++++++++++++++++++++++ src/node.h | 7 ++++++- 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index 1ec1e8bc8c1896..e3e90dbad98cb6 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -344,12 +344,14 @@ Environment* CreateEnvironment( Environment* env = new Environment( isolate_data, context, args, exec_args, nullptr, flags, thread_id); #if HAVE_INSPECTOR - if (inspector_parent_handle) { - env->InitializeInspector( - std::move(static_cast( - inspector_parent_handle.get())->impl)); - } else { - env->InitializeInspector({}); + if (env->should_create_inspector()) { + if (inspector_parent_handle) { + env->InitializeInspector( + std::move(static_cast( + inspector_parent_handle.get())->impl)); + } else { + env->InitializeInspector({}); + } } #endif diff --git a/src/env-inl.h b/src/env-inl.h index e679780900abc9..4a34393cad7e07 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -869,6 +869,10 @@ inline bool Environment::owns_inspector() const { return flags_ & EnvironmentFlags::kOwnsInspector; } +inline bool Environment::should_create_inspector() const { + return (flags_ & EnvironmentFlags::kNoCreateInspector) == 0; +} + inline bool Environment::tracks_unmanaged_fds() const { return flags_ & EnvironmentFlags::kTrackUnmanagedFds; } diff --git a/src/env.h b/src/env.h index 7aa5822abf11f1..cda7a52fa1ffc6 100644 --- a/src/env.h +++ b/src/env.h @@ -1210,6 +1210,7 @@ class Environment : public MemoryRetainer { inline bool is_main_thread() const; inline bool no_native_addons() const; inline bool should_not_register_esm_loader() const; + inline bool should_create_inspector() const; inline bool owns_process_state() const; inline bool owns_inspector() const; inline bool tracks_unmanaged_fds() const; diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index fd9f514b9b6a7b..5fc533741d7c8d 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -368,6 +368,16 @@ bool IsFilePath(const std::string& path) { } #endif // __POSIX__ +void ThrowUninitializedInspectorError(Environment* env) { + HandleScope scope(env->isolate()); + + const char* msg = "This Environment was initialized without a V8::Inspector"; + Local exception = + v8::String::NewFromUtf8(env->isolate(), msg).ToLocalChecked(); + + env->isolate()->ThrowException(exception); +} + } // namespace class NodeInspectorClient : public V8InspectorClient { @@ -728,6 +738,11 @@ bool Agent::StartIoThread() { if (io_ != nullptr) return true; + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return false; + } + CHECK_NOT_NULL(client_); io_ = InspectorIo::Start(client_->getThreadHandle(), @@ -748,7 +763,13 @@ void Agent::Stop() { std::unique_ptr Agent::Connect( std::unique_ptr delegate, bool prevent_shutdown) { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return std::unique_ptr{}; + } + CHECK_NOT_NULL(client_); + int session_id = client_->connectFrontend(std::move(delegate), prevent_shutdown); return std::unique_ptr( @@ -758,6 +779,11 @@ std::unique_ptr Agent::Connect( std::unique_ptr Agent::ConnectToMainThread( std::unique_ptr delegate, bool prevent_shutdown) { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return std::unique_ptr{}; + } + CHECK_NOT_NULL(parent_handle_); CHECK_NOT_NULL(client_); auto thread_safe_delegate = @@ -767,6 +793,11 @@ std::unique_ptr Agent::ConnectToMainThread( } void Agent::WaitForDisconnect() { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return; + } + CHECK_NOT_NULL(client_); bool is_worker = parent_handle_ != nullptr; parent_handle_.reset(); @@ -912,6 +943,12 @@ void Agent::SetParentHandle( std::unique_ptr Agent::GetParentHandle( uint64_t thread_id, const std::string& url) { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return std::unique_ptr{}; + } + + CHECK_NOT_NULL(client_); if (!parent_handle_) { return client_->getWorkerManager()->NewParentHandle(thread_id, url); } else { @@ -920,11 +957,21 @@ std::unique_ptr Agent::GetParentHandle( } void Agent::WaitForConnect() { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return; + } + CHECK_NOT_NULL(client_); client_->waitForFrontend(); } std::shared_ptr Agent::GetWorkerManager() { + if (!parent_env_->should_create_inspector() && !client_) { + ThrowUninitializedInspectorError(parent_env_); + return std::unique_ptr{}; + } + CHECK_NOT_NULL(client_); return client_->getWorkerManager(); } diff --git a/src/node.h b/src/node.h index 8d9e9935258c35..a1f5202ce8622c 100644 --- a/src/node.h +++ b/src/node.h @@ -439,7 +439,12 @@ enum Flags : uint64_t { // $HOME/.node_modules and $NODE_PATH. This is used by standalone apps that // do not expect to have their behaviors changed because of globally // installed modules. - kNoGlobalSearchPaths = 1 << 7 + kNoGlobalSearchPaths = 1 << 7, + // Controls whether or not the Environment should call V8Inspector::create(). + // This control is needed by embedders who may not want to initialize the V8 + // inspector in situations where one has already been created, + // e.g. Blink's in Chromium. + kNoCreateInspector = 1 << 9 }; } // namespace EnvironmentFlags From 8b94ea6e1cbd1a7273bc63e829034e7c6149d74f Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Thu, 24 Feb 2022 12:00:42 +0100 Subject: [PATCH 22/81] doc,tools: improve navigability of API docs PR-URL: https://github.com/nodejs/node/pull/41404 Reviewed-By: Rich Trott Reviewed-By: Antoine du Hamel --- doc/api_assets/style.css | 130 +++++++++++++++++++++++++++++---- doc/template.html | 32 +++++--- test/doctool/test-make-doc.mjs | 3 +- tools/doc/html.mjs | 80 ++++++++++++++++---- 4 files changed, 205 insertions(+), 40 deletions(-) diff --git a/doc/api_assets/style.css b/doc/api_assets/style.css index 9ae45a09c84ca8..fa12c02ce7dfbb 100644 --- a/doc/api_assets/style.css +++ b/doc/api_assets/style.css @@ -162,7 +162,7 @@ em code { margin-bottom: 1rem; } -#gtoc ul { +#gtoc > ul { list-style: none; margin-left: 0; line-height: 1.5rem; @@ -172,42 +172,73 @@ em code { color: var(--color-critical); } -li.version-picker { +li.picker-header { position: relative; } -li.version-picker:hover > a { +li.picker-header .collapsed-arrow, li.picker-header .expanded-arrow { + width: 1.5ch; + height: 1.5em; +} + +li.picker-header .collapsed-arrow { + display: inline-block; +} + +li.picker-header .expanded-arrow { + display: none; +} + +li.picker-header:hover .collapsed-arrow { + display: none; +} + +li.picker-header:hover .expanded-arrow { + display: inline-block; +} + +li.picker-header:hover > a { border-radius: 2px 2px 0 0; } -li.version-picker:hover > ol { +li.picker-header:hover > .picker { display: block; z-index: 1; } -li.version-picker a span { +li.picker-header a span { font-size: .7rem; } -ol.version-picker { +.picker { background-color: var(--color-fill-app); border: 1px solid var(--color-brand-secondary); border-radius: 0 0 2px 2px; display: none; list-style: none; position: absolute; - right: 0; + left: 0; top: 100%; - width: 100%; + width: max-content; + min-width: min(300px, 75vw); + max-width: 75vw; + max-height: min(600px, 60vh); + overflow-y: auto; } -#gtoc ol.version-picker li { +.picker > ul, .picker > ol { + list-style: none; + margin-left: 0; + line-height: 1.5rem; +} + +.picker li { display: block; border-right: 0; margin-right: 0; } -ol.version-picker li a { +.picker li a { border-radius: 0; display: block; margin: 0; @@ -215,17 +246,32 @@ ol.version-picker li a { padding-left: 1rem; } -ol.version-picker li:last-child a { +.picker li a.active, +.picker li a.active:hover, +.picker li a.active:focus { + font-weight: 700; +} + +.picker li:last-child a { border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; } +.gtoc-picker-header { + display: none; +} + .line { width: calc(100% - 1rem); display: block; padding-bottom: 1px; } +.picker .line { + margin: 0; + width: 100%; +} + .api_stability { color: var(--white) !important; margin: 0 0 1rem; @@ -506,6 +552,41 @@ hr { margin-top: .666rem; } +.toc ul { + margin: 0 +} + +.toc li a::before { + content: "■"; + color: var(--color-text-primary); + padding-right: 1em; + font-size: 0.9em; +} + +.toc li a:hover::before { + color: var(--white); +} + +.toc ul ul a { + padding-left: 1rem; +} + +.toc ul ul ul a { + padding-left: 2rem; +} + +.toc ul ul ul ul a { + padding-left: 3rem; +} + +.toc ul ul ul ul ul a { + padding-left: 4rem; +} + +.toc ul ul ul ul ul ul a { + padding-left: 5rem; +} + #toc .stability_0::after { background-color: var(--red2); color: var(--white); @@ -718,10 +799,25 @@ kbd { } } +.header { + position: sticky; + top: -1px; + z-index: 1; + padding-top: 1rem; + background-color: var(--color-fill-app); +} + +@media not screen, (max-height: 1000px) { + .header { + position: relative; + top: 0; + } +} + .header-container { display: flex; align-items: center; - margin: 1.5rem 0 1rem; + margin-bottom: 1rem; justify-content: space-between; } @@ -735,7 +831,7 @@ kbd { outline: var(--brand3) dotted 2px; } -@media only screen and (min-width: 577px) { +@media only screen and (min-width: 601px) { #gtoc > ul > li { display: inline; border-right: 1px currentColor solid; @@ -748,6 +844,10 @@ kbd { margin-right: 0; padding-right: 0; } + + #gtoc > ul > li.gtoc-picker-header { + display: none; + } } @media only screen and (max-width: 1024px) { @@ -764,6 +864,10 @@ kbd { #column2 { display: none; } + + #gtoc > ul > li.gtoc-picker-header { + display: inline; + } } .icon { diff --git a/doc/template.html b/doc/template.html index c8c78dce59b64a..89dd2fbeac9e01 100644 --- a/doc/template.html +++ b/doc/template.html @@ -22,7 +22,7 @@
-
+

Node.js __VERSION__ documentation


diff --git a/test/doctool/test-make-doc.mjs b/test/doctool/test-make-doc.mjs index 06ec6e028bf4e8..54483c7d68932d 100644 --- a/test/doctool/test-make-doc.mjs +++ b/test/doctool/test-make-doc.mjs @@ -40,7 +40,8 @@ const links = toc.match(globalRe); assert.notStrictEqual(links, null); // Filter out duplicate links, leave just filenames, add expected JSON files. -const linkedHtmls = [...new Set(links)].map((link) => link.match(re)[1]); +const linkedHtmls = [...new Set(links)].map((link) => link.match(re)[1]) + .concat(['index.html']); const expectedJsons = linkedHtmls .map((name) => name.replace('.html', '.json')); const expectedDocs = linkedHtmls.concat(expectedJsons); diff --git a/tools/doc/html.mjs b/tools/doc/html.mjs index 8d356836eb5667..1c5ad61182bc79 100644 --- a/tools/doc/html.mjs +++ b/tools/doc/html.mjs @@ -98,8 +98,10 @@ export function toHTML({ input, content, filename, nodeVersion, versions }) { .replace(/__FILENAME__/g, filename) .replace('__SECTION__', content.section) .replace(/__VERSION__/g, nodeVersion) - .replace('__TOC__', content.toc) - .replace('__GTOC__', gtocHTML.replace( + .replace(/__TOC__/g, content.toc) + .replace(/__TOC_PICKER__/g, tocPicker(id, content)) + .replace(/__GTOC_PICKER__/g, gtocPicker(id)) + .replace(/__GTOC__/g, gtocHTML.replace( `class="nav-${id}"`, `class="nav-${id} active"`)) .replace('__EDIT_ON_GITHUB__', editOnGitHub(filename)) .replace('__CONTENT__', processContent(content)); @@ -442,17 +444,18 @@ export function buildToc({ filename, apilinks }) { }); if (toc !== '') { - file.toc = '
Table of contents' + - unified() - .use(markdown) - .use(gfm) - .use(remark2rehype, { allowDangerousHtml: true }) - .use(raw) - .use(htmlStringify) - .processSync(toc).toString() + - '
'; + const inner = unified() + .use(markdown) + .use(gfm) + .use(remark2rehype, { allowDangerousHtml: true }) + .use(raw) + .use(htmlStringify) + .processSync(toc).toString(); + + file.toc = `
Table of contents${inner}
`; + file.tocPicker = `
${inner}
`; } else { - file.toc = ''; + file.toc = file.tocPicker = ''; } }; } @@ -508,9 +511,12 @@ function altDocs(filename, docCreated, versions) { const list = versions.filter(isDocInVersion).map(wrapInListItem).join('\n'); return list ? ` -
  • - View another version -
      ${list}
    +
  • + + + Other versions + +
      ${list}
  • ` : ''; } @@ -518,3 +524,47 @@ function altDocs(filename, docCreated, versions) { function editOnGitHub(filename) { return `
  • Edit on GitHub
  • `; } + +function gtocPicker(id) { + if (id === 'index') { + return ''; + } + + // Highlight the current module and add a link to the index + const gtoc = gtocHTML.replace( + `class="nav-${id}"`, `class="nav-${id} active"` + ).replace('', ` +
  • + Index +
  • + + `); + + return ` +
  • + + + Index + + +
    ${gtoc}
    +
  • + `; +} + +function tocPicker(id, content) { + if (id === 'index') { + return ''; + } + + return ` +
  • + + + Table of contents + + +
    ${content.tocPicker}
    +
  • + `; +} From f107f8bf404fa854441799500a01d1ed65553ff3 Mon Sep 17 00:00:00 2001 From: Austin Kelleher Date: Thu, 24 Feb 2022 13:04:50 -0500 Subject: [PATCH 23/81] node-api: fix typo in `node_api.cc` PR-URL: https://github.com/nodejs/node/pull/42110 Reviewed-By: Anna Henningsen Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau Reviewed-By: Mestery Reviewed-By: Colin Ihrig --- src/node_api.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_api.cc b/src/node_api.cc index b1b85073508672..82e228bb954d5a 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -36,7 +36,7 @@ v8::Maybe node_napi_env__::mark_arraybuffer_as_untransferable( void node_napi_env__::CallFinalizer(napi_finalize cb, void* data, void* hint) { // we need to keep the env live until the finalizer has been run // EnvRefHolder provides an exception safe wrapper to Ref and then - // Unref once the lamba is freed + // Unref once the lambda is freed EnvRefHolder liveEnv(static_cast(this)); node_env()->SetImmediate( [=, liveEnv = std::move(liveEnv)](node::Environment* node_env) { From d0f68a398e9041f24d77ed4525c2675b48ee3c95 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 18 Feb 2022 12:43:27 +0100 Subject: [PATCH 24/81] test: deflake test-common-expect-warning The subprocess might exit before the data is flushed. Run the assertion after the `'end'` event is emitted. PR-URL: https://github.com/nodejs/node/pull/42046 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Darshan Sen --- test/parallel/test-common-expect-warning.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-common-expect-warning.js b/test/parallel/test-common-expect-warning.js index be3e385b11e0f4..dff32037fbb5b1 100644 --- a/test/parallel/test-common-expect-warning.js +++ b/test/parallel/test-common-expect-warning.js @@ -36,9 +36,11 @@ if (process.argv[2] !== 'child') { child.stderr.on('data', (data) => { stderr += data; }); + child.stderr.on('end', common.mustCall(() => { + assert.match(stderr, /Unexpected extra warning received/); + })); child.on('exit', common.mustCall((status) => { assert.notStrictEqual(status, 0); - assert.match(stderr, /Unexpected extra warning received/); })); } } else { From a32ec983c66b7083faccda488260d1edde0e5979 Mon Sep 17 00:00:00 2001 From: Balakrishna Avulapati Date: Fri, 25 Feb 2022 08:50:41 +0530 Subject: [PATCH 25/81] doc: make building with ninja more discoverable Building with ninja would speed up the build We have the documenation about building with ninja, but not easily discoverable. And present this early to the contributors. PR-URL: https://github.com/nodejs/node/pull/41840 Reviewed-By: Rich Trott Reviewed-By: Darshan Sen Reviewed-By: Mestery Reviewed-By: Filip Skokan Reviewed-By: Michael Dawson --- BUILDING.md | 4 ++++ doc/contributing/pull-requests.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 424b2a7adc9984..32cc5fc260d561 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -273,6 +273,10 @@ $ ./configure $ make -j4 ``` +We can speed up the builds by using [Ninja](https://ninja-build.org/). For more +information, see +[Building Node.js with Ninja](doc/contributing/building-node-with-ninja.md). + The `-j4` option will cause `make` to run 4 simultaneous compilation jobs which may reduce build time. For more information, see the [GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html). diff --git a/doc/contributing/pull-requests.md b/doc/contributing/pull-requests.md index 00868c4bfc91d9..bc0d072484897f 100644 --- a/doc/contributing/pull-requests.md +++ b/doc/contributing/pull-requests.md @@ -244,6 +244,10 @@ test suite. To run the tests (including code linting) on Unix / macOS: ./configure && make -j4 test ``` +We can speed up the builds by using [Ninja](https://ninja-build.org/). For more +information, see +[Building Node.js with Ninja](building-node-with-ninja.md). + And on Windows: ```text From 53338fe65cd6f992462091bd0ace22a7ec019f42 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 25 Feb 2022 14:31:20 +0100 Subject: [PATCH 26/81] stream: allow returning null from pipeline tail PR-URL: https://github.com/nodejs/node/pull/42078 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum --- lib/internal/streams/pipeline.js | 4 +++- test/parallel/test-stream-pipeline.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 623973ff316453..5fb11f1632fdca 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -265,7 +265,9 @@ function pipelineImpl(streams, callback, opts) { then.call(ret, (val) => { value = val; - pt.write(val); + if (val != null) { + pt.write(val); + } if (end) { pt.end(); } diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index 81f350df0d68fd..bd676d9fe7e701 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -1511,3 +1511,18 @@ const tsp = require('timers/promises'); assert.strictEqual(s.destroyed, true); })); } + +{ + const s = new PassThrough({ objectMode: true }); + pipeline(async function*() { + await Promise.resolve(); + yield 'hello'; + yield 'world'; + yield 'world'; + }, s, async function(source) { + return null; + }, common.mustCall((err, val) => { + assert.strictEqual(err, undefined); + assert.strictEqual(val, null); + })); +} From 769e2a486f82aea8cf84d097fdeb3c8ec799dc3d Mon Sep 17 00:00:00 2001 From: Lu Yahan Date: Mon, 21 Feb 2022 11:25:31 +0800 Subject: [PATCH 27/81] deps: V8: cherry-pick b66334313c8b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [riscv64] use callee save register in regexp Bug: v8:12502 Change-Id: I8d1b599fc945e276b70901953368768594470204 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3343861 Reviewed-by: ji qiu Commit-Queue: ji qiu Cr-Commit-Position: refs/heads/main@{#78421} Refs: https://github.com/v8/v8/commit/b66334313c8bd73b253d0779f59f3e8656967043 PR-URL: https://github.com/nodejs/node/pull/42067 Refs: https://github.com/v8/v8/commit/77d515484864984f721d6726610f314982ac44d2 Reviewed-By: Michaël Zasso Reviewed-By: Jiawen Geng Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Mary Marchini Reviewed-By: Juan José Arboleda Reviewed-By: James M Snell Reviewed-By: Stewart X Addison --- common.gypi | 2 +- .../v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.cc | 6 +++--- deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common.gypi b/common.gypi index 2027a4e1050430..cd519730daf068 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.13', + 'v8_embedder_string': '-node.14', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.cc b/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.cc index bb15bc24edda75..0e696012272ed8 100644 --- a/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.cc +++ b/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.cc @@ -23,10 +23,10 @@ namespace internal { * This assembler uses the following register assignment convention * - s3 : kScratchReg. Temporarily stores the index of capture start after a matching pass * for a global regexp. - * - a5 : Pointer to current Code object including heap object tag. - * - a6 : Current position in input, as negative offset from end of string. + * - s4 : Pointer to current Code object including heap object tag. + * - s1 : Current position in input, as negative offset from end of string. * Please notice that this is the byte offset, not the character offset! - * - a7 : Currently loaded character. Must be loaded using + * - s2 : Currently loaded character. Must be loaded using * LoadCurrentCharacter before using any of the dispatch methods. * - t0 : Points to tip of backtrack stack * - t1 : Unused. diff --git a/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.h b/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.h index 211f17b314b516..8de0b07b4ac57b 100644 --- a/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.h +++ b/deps/v8/src/regexp/riscv64/regexp-macro-assembler-riscv64.h @@ -147,10 +147,10 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerRISCV // Register holding the current input position as negative offset from // the end of the string. - static constexpr Register current_input_offset() { return a6; } + static constexpr Register current_input_offset() { return s1; } // The register containing the current character after LoadCurrentCharacter. - static constexpr Register current_character() { return a7; } + static constexpr Register current_character() { return s2; } // Register holding address of the end of the input string. static constexpr Register end_of_input_address() { return t2; } @@ -164,7 +164,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerRISCV static constexpr Register backtrack_stackpointer() { return t0; } // Register holding pointer to the current code object. - static constexpr Register code_pointer() { return a5; } + static constexpr Register code_pointer() { return s4; } // Byte size of chars in the string to match (decided by the Mode argument). inline int char_size() const { return static_cast(mode_); } From 1359f60338c6d012d9796e46e9f98e49f3110e3f Mon Sep 17 00:00:00 2001 From: Lu Yahan Date: Mon, 21 Feb 2022 11:25:32 +0800 Subject: [PATCH 28/81] deps: V8: cherry-pick 77d515484864 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [riscv64] Move explicit specialization into .cc file Building with Gcc-10 causes error "explicit specialization in non-namespace scope". This change fixes it. Bug: v8:12649 Change-Id: I36b2b042b336c2dfd32ba5541fdbbdb8dc8b4fd7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3473997 Reviewed-by: ji qiu Commit-Queue: ji qiu Cr-Commit-Position: refs/heads/main@{#79185} Refs: https://github.com/v8/v8/commit/77d515484864984f721d6726610f314982ac44d2 PR-URL: https://github.com/nodejs/node/pull/42067 Refs: https://github.com/v8/v8/commit/b66334313c8bd73b253d0779f59f3e8656967043 Reviewed-By: Michaël Zasso Reviewed-By: Jiawen Geng Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Mary Marchini Reviewed-By: Juan José Arboleda Reviewed-By: James M Snell Reviewed-By: Stewart X Addison --- common.gypi | 2 +- .../execution/riscv64/simulator-riscv64.cc | 203 ++++++++++++++++++ .../src/execution/riscv64/simulator-riscv64.h | 133 ------------ 3 files changed, 204 insertions(+), 134 deletions(-) diff --git a/common.gypi b/common.gypi index cd519730daf068..702eea8395f4db 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.14', + 'v8_embedder_string': '-node.15', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/execution/riscv64/simulator-riscv64.cc b/deps/v8/src/execution/riscv64/simulator-riscv64.cc index 4d289c4d20d028..a212ed24e00ab0 100644 --- a/deps/v8/src/execution/riscv64/simulator-riscv64.cc +++ b/deps/v8/src/execution/riscv64/simulator-riscv64.cc @@ -86,6 +86,209 @@ // PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED // HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE // MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +static inline bool is_aligned(const unsigned val, const unsigned pos) { + return pos ? (val & (pos - 1)) == 0 : true; +} + +static inline bool is_overlapped(const int astart, int asize, const int bstart, + int bsize) { + asize = asize == 0 ? 1 : asize; + bsize = bsize == 0 ? 1 : bsize; + + const int aend = astart + asize; + const int bend = bstart + bsize; + + return std::max(aend, bend) - std::min(astart, bstart) < asize + bsize; +} +static inline bool is_overlapped_widen(const int astart, int asize, + const int bstart, int bsize) { + asize = asize == 0 ? 1 : asize; + bsize = bsize == 0 ? 1 : bsize; + + const int aend = astart + asize; + const int bend = bstart + bsize; + + if (astart < bstart && is_overlapped(astart, asize, bstart, bsize) && + !is_overlapped(astart, asize, bstart + bsize, bsize)) { + return false; + } else { + return std::max(aend, bend) - std::min(astart, bstart) < asize + bsize; + } +} + +#ifdef DEBUG +#define require_align(val, pos) \ + if (!is_aligned(val, pos)) { \ + std::cout << val << " " << pos << std::endl; \ + } \ + CHECK_EQ(is_aligned(val, pos), true) +#else +#define require_align(val, pos) CHECK_EQ(is_aligned(val, pos), true) +#endif + +// RVV +// The following code about RVV was based from: +// https://github.com/riscv/riscv-isa-sim +// Copyright (c) 2010-2017, The Regents of the University of California +// (Regents). All Rights Reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. Neither the name of the Regents nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. + +// IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, +// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, +// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF +// REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED +// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED +// HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE +// MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +template +struct type_usew_t; +template <> +struct type_usew_t<8> { + using type = uint8_t; +}; + +template <> +struct type_usew_t<16> { + using type = uint16_t; +}; + +template <> +struct type_usew_t<32> { + using type = uint32_t; +}; + +template <> +struct type_usew_t<64> { + using type = uint64_t; +}; + +template <> +struct type_usew_t<128> { + using type = __uint128_t; +}; +template +struct type_sew_t; + +template <> +struct type_sew_t<8> { + using type = int8_t; +}; + +template <> +struct type_sew_t<16> { + using type = int16_t; +}; + +template <> +struct type_sew_t<32> { + using type = int32_t; +}; + +template <> +struct type_sew_t<64> { + using type = int64_t; +}; + +template <> +struct type_sew_t<128> { + using type = __int128_t; +}; + +#define VV_PARAMS(x) \ + type_sew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_sew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VV_UPARAMS(x) \ + type_usew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_usew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ + type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VX_PARAMS(x) \ + type_sew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_sew_t::type rs1 = (type_sew_t::type)(get_register(rs1_reg())); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VX_UPARAMS(x) \ + type_usew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_usew_t::type rs1 = (type_usew_t::type)(get_register(rs1_reg())); \ + type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VI_PARAMS(x) \ + type_sew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_sew_t::type simm5 = (type_sew_t::type)(instr_.RvvSimm5()); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VI_UPARAMS(x) \ + type_usew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_usew_t::type uimm5 = (type_usew_t::type)(instr_.RvvUimm5()); \ + type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VN_PARAMS(x) \ + constexpr int half_x = x >> 1; \ + type_sew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_sew_t::type uimm5 = (type_sew_t::type)(instr_.RvvUimm5()); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VN_UPARAMS(x) \ + constexpr int half_x = x >> 1; \ + type_usew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_usew_t::type uimm5 = (type_usew_t::type)(instr_.RvvUimm5()); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VXI_PARAMS(x) \ + type_sew_t::type& vd = \ + Rvvelt::type>(rvv_vd_reg(), i, true); \ + type_sew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ + type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); \ + type_sew_t::type rs1 = (type_sew_t::type)(get_register(rs1_reg())); \ + type_sew_t::type simm5 = (type_sew_t::type)(instr_.RvvSimm5()); + +#define VI_XI_SLIDEDOWN_PARAMS(x, off) \ + auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ + auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i + off); + +#define VI_XI_SLIDEUP_PARAMS(x, offset) \ + auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ + auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i - offset); + +/* Vector Integer Extension */ +#define VI_VIE_PARAMS(x, scale) \ + if ((x / scale) < 8) UNREACHABLE(); \ + auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ + auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define VI_VIE_UPARAMS(x, scale) \ + if ((x / scale) < 8) UNREACHABLE(); \ + auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ + auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i); + +#define require_noover(astart, asize, bstart, bsize) \ + CHECK_EQ(!is_overlapped(astart, asize, bstart, bsize), true) +#define require_noover_widen(astart, asize, bstart, bsize) \ + CHECK_EQ(!is_overlapped_widen(astart, asize, bstart, bsize), true) + #define RVV_VI_GENERAL_LOOP_BASE \ for (uint64_t i = rvv_vstart(); i < rvv_vl(); i++) { #define RVV_VI_LOOP_END \ diff --git a/deps/v8/src/execution/riscv64/simulator-riscv64.h b/deps/v8/src/execution/riscv64/simulator-riscv64.h index fce6cdca0adc30..b0ed702bb59f05 100644 --- a/deps/v8/src/execution/riscv64/simulator-riscv64.h +++ b/deps/v8/src/execution/riscv64/simulator-riscv64.h @@ -645,139 +645,6 @@ class Simulator : public SimulatorBase { } } - // RVV - // The following code about RVV was based from: - // https://github.com/riscv/riscv-isa-sim - // Copyright (c) 2010-2017, The Regents of the University of California - // (Regents). All Rights Reserved. - - // Redistribution and use in source and binary forms, with or without - // modification, are permitted provided that the following conditions are met: - // 1. Redistributions of source code must retain the above copyright - // notice, this list of conditions and the following disclaimer. - // 2. Redistributions in binary form must reproduce the above copyright - // notice, this list of conditions and the following disclaimer in the - // documentation and/or other materials provided with the distribution. - // 3. Neither the name of the Regents nor the - // names of its contributors may be used to endorse or promote products - // derived from this software without specific prior written permission. - - // IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, - // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, - // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF - // REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - // REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED - // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - // PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED - // HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE - // MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - template - struct type_usew_t; - template <> - struct type_usew_t<8> { - using type = uint8_t; - }; - - template <> - struct type_usew_t<16> { - using type = uint16_t; - }; - - template <> - struct type_usew_t<32> { - using type = uint32_t; - }; - - template <> - struct type_usew_t<64> { - using type = uint64_t; - }; - - template <> - struct type_usew_t<128> { - using type = __uint128_t; - }; - template - struct type_sew_t; - - template <> - struct type_sew_t<8> { - using type = int8_t; - }; - - template <> - struct type_sew_t<16> { - using type = int16_t; - }; - - template <> - struct type_sew_t<32> { - using type = int32_t; - }; - - template <> - struct type_sew_t<64> { - using type = int64_t; - }; - - template <> - struct type_sew_t<128> { - using type = __int128_t; - }; - -#define VV_PARAMS(x) \ - type_sew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_sew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ - type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VV_UPARAMS(x) \ - type_usew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_usew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ - type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VX_PARAMS(x) \ - type_sew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_sew_t::type rs1 = (type_sew_t::type)(get_register(rs1_reg())); \ - type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VX_UPARAMS(x) \ - type_usew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_usew_t::type rs1 = (type_usew_t::type)(get_register(rs1_reg())); \ - type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VI_PARAMS(x) \ - type_sew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_sew_t::type simm5 = (type_sew_t::type)(instr_.RvvSimm5()); \ - type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VI_UPARAMS(x) \ - type_usew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_usew_t::type uimm5 = (type_usew_t::type)(instr_.RvvUimm5()); \ - type_usew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); - -#define VXI_PARAMS(x) \ - type_sew_t::type& vd = \ - Rvvelt::type>(rvv_vd_reg(), i, true); \ - type_sew_t::type vs1 = Rvvelt::type>(rvv_vs1_reg(), i); \ - type_sew_t::type vs2 = Rvvelt::type>(rvv_vs2_reg(), i); \ - type_sew_t::type rs1 = (type_sew_t::type)(get_register(rs1_reg())); \ - type_sew_t::type simm5 = (type_sew_t::type)(instr_.RvvSimm5()); - -#define VI_XI_SLIDEDOWN_PARAMS(x, off) \ - auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ - auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i + off); - -#define VI_XI_SLIDEUP_PARAMS(x, offset) \ - auto& vd = Rvvelt::type>(rvv_vd_reg(), i, true); \ - auto vs2 = Rvvelt::type>(rvv_vs2_reg(), i - offset); - inline void rvv_trace_vd() { if (::v8::internal::FLAG_trace_sim) { __int128_t value = Vregister_[rvv_vd_reg()]; From ec4c0de6d11cdbec528052067e0e2ec9a07cb7c8 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 22 Feb 2022 17:59:43 -0500 Subject: [PATCH 29/81] build: last test of the stale feature action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set the days so that we process ~ 40 issues so that we can see what kind of feedback we get on saying we are going to close stale feature requests - set the label to stale instead of stalled so that there is no race with the action that closes stalled issues - fix the links to the feature management doc Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/42085 Reviewed-By: Mestery Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau --- .github/workflows/close-stale-feature-requests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/close-stale-feature-requests.yml b/.github/workflows/close-stale-feature-requests.yml index db737a8f86231e..bb0efd38ae48f6 100644 --- a/.github/workflows/close-stale-feature-requests.yml +++ b/.github/workflows/close-stale-feature-requests.yml @@ -15,7 +15,7 @@ env: For more information on how the project manages feature requests, please consult the - [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/guides/feature-request-management.md). + [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md). WARN_MESSAGE: > There has been no activity on this feature request for @@ -25,7 +25,7 @@ env: For more information on how the project manages feature requests, please consult the - [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/guides/feature-request-management.md). + [feature request management document](https://github.com/nodejs/node/blob/HEAD/doc/contributing/feature-request-management.md). # yamllint enable jobs: @@ -36,9 +36,9 @@ jobs: - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 1226 + days-before-stale: 906 days-before-close: 30 - stale-issue-label: stalled + stale-issue-label: stale close-issue-message: ${{ env.CLOSE_MESSAGE }} stale-issue-message: ${{ env.WARN_MESSAGE }} only-labels: feature request From 2e1231b831bbcabd5e49639cfd2846cc53035e07 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 25 Feb 2022 16:20:51 -0500 Subject: [PATCH 30/81] errors: do not access .stack in debug Refs: #41541 PR-URL: https://github.com/nodejs/node/pull/42096 Refs: https://github.com/nodejs/node/issues/41541 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Ruben Bridgewater Reviewed-By: Mestery --- lib/internal/source_map/prepare_stack_trace.js | 2 +- lib/internal/source_map/source_map_cache.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/source_map/prepare_stack_trace.js b/lib/internal/source_map/prepare_stack_trace.js index 9492de2283322f..0635ee675418f5 100644 --- a/lib/internal/source_map/prepare_stack_trace.js +++ b/lib/internal/source_map/prepare_stack_trace.js @@ -106,7 +106,7 @@ const prepareStackTrace = (globalThis, error, trace) => { } } } catch (err) { - debug(err.stack); + debug(err); } return `${str}${t}`; }), ''); diff --git a/lib/internal/source_map/source_map_cache.js b/lib/internal/source_map/source_map_cache.js index c0de6aeb51868f..e3721d024d9fb1 100644 --- a/lib/internal/source_map/source_map_cache.js +++ b/lib/internal/source_map/source_map_cache.js @@ -79,7 +79,7 @@ function maybeCacheSourceMap(filename, content, cjsModuleInstance) { } catch (err) { // This is most likely an [eval]-wrapper, which is currently not // supported. - debug(err.stack); + debug(err); return; } const match = StringPrototypeMatch( @@ -119,7 +119,7 @@ function dataFromUrl(sourceURL, sourceMappingURL) { return null; } } catch (err) { - debug(err.stack); + debug(err); // If no scheme is present, we assume we are dealing with a file path. const mapURL = new URL(sourceMappingURL, sourceURL).href; return sourceMapFromFile(mapURL); @@ -144,7 +144,7 @@ function sourceMapFromFile(mapURL) { const data = JSONParse(content); return sourcesToAbsolute(mapURL, data); } catch (err) { - debug(err.stack); + debug(err); return null; } } @@ -163,7 +163,7 @@ function sourceMapFromDataUrl(sourceURL, url) { const parsedData = JSONParse(decodedData); return sourcesToAbsolute(sourceURL, parsedData); } catch (err) { - debug(err.stack); + debug(err); return null; } } else { From 3fc3f521d63740ccbd80551f418e2f9dd83d1a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Fri, 25 Feb 2022 23:36:05 +0100 Subject: [PATCH 31/81] build: add corepack to the auto-updated dependencies PR-URL: https://github.com/nodejs/node/pull/42090 Reviewed-By: Antoine du Hamel Reviewed-By: Mestery --- .github/workflows/tools.yml | 4 ++++ Makefile | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 7865a4166f81eb..a9ae1372e42bd9 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -23,6 +23,10 @@ jobs: echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV ./update-eslint.sh fi + - id: corepack + run: | + make corepack-update + echo "NEW_VERSION=$(node deps/corepack/dist/corepack.js --version)" >> $GITHUB_ENV - id: lint-md-dependencies run: | cd tools/lint-md diff --git a/Makefile b/Makefile index 8b1b1f16014cd9..4aace77c7c8c63 100644 --- a/Makefile +++ b/Makefile @@ -1119,13 +1119,15 @@ pkg: $(PKG) .PHONY: corepack-update corepack-update: - rm -rf /tmp/node-corepack-clone - git clone 'https://github.com/nodejs/corepack.git' /tmp/node-corepack-clone - cd /tmp/node-corepack-clone && yarn pack - rm -rf deps/corepack && mkdir -p deps/corepack - cd deps/corepack && tar xf /tmp/node-corepack-clone/package.tgz --strip-components=1 + mkdir -p /tmp/node-corepack + curl -qLo /tmp/node-corepack/package.tgz "$$(npm view corepack dist.tarball)" + + rm -rf deps/corepack && mkdir deps/corepack + cd deps/corepack && tar xf /tmp/node-corepack/package.tgz --strip-components=1 chmod +x deps/corepack/shims/* + node deps/corepack/dist/corepack.js --version + .PHONY: pkg-upload # Note: this is strictly for release builds on release machines only. pkg-upload: pkg From ccacf99e5c6bde3c0463d488b26efbdac899f791 Mon Sep 17 00:00:00 2001 From: npm team Date: Thu, 24 Feb 2022 21:41:49 +0000 Subject: [PATCH 32/81] deps: upgrade npm to 8.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42122 Reviewed-By: Colin Ihrig Reviewed-By: Mestery Reviewed-By: Danielle Adams Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen --- deps/npm/docs/content/commands/npm-access.md | 12 +- deps/npm/docs/content/commands/npm-adduser.md | 11 +- deps/npm/docs/content/commands/npm-audit.md | 14 +- deps/npm/docs/content/commands/npm-bin.md | 11 +- deps/npm/docs/content/commands/npm-bugs.md | 13 +- deps/npm/docs/content/commands/npm-cache.md | 24 +- deps/npm/docs/content/commands/npm-ci.md | 11 + .../docs/content/commands/npm-completion.md | 11 +- deps/npm/docs/content/commands/npm-config.md | 11 +- deps/npm/docs/content/commands/npm-dedupe.md | 30 +- .../docs/content/commands/npm-deprecate.md | 11 +- deps/npm/docs/content/commands/npm-diff.md | 13 +- .../npm/docs/content/commands/npm-dist-tag.md | 11 +- deps/npm/docs/content/commands/npm-docs.md | 11 +- deps/npm/docs/content/commands/npm-doctor.md | 9 + deps/npm/docs/content/commands/npm-edit.md | 11 +- deps/npm/docs/content/commands/npm-exec.md | 21 +- deps/npm/docs/content/commands/npm-explain.md | 9 + deps/npm/docs/content/commands/npm-explore.md | 9 + .../docs/content/commands/npm-find-dupes.md | 11 + deps/npm/docs/content/commands/npm-fund.md | 12 +- .../docs/content/commands/npm-help-search.md | 9 + deps/npm/docs/content/commands/npm-help.md | 11 + deps/npm/docs/content/commands/npm-hook.md | 13 +- deps/npm/docs/content/commands/npm-init.md | 27 +- .../content/commands/npm-install-ci-test.md | 11 +- .../docs/content/commands/npm-install-test.md | 37 +- deps/npm/docs/content/commands/npm-install.md | 38 +- deps/npm/docs/content/commands/npm-link.md | 22 +- deps/npm/docs/content/commands/npm-logout.md | 11 +- deps/npm/docs/content/commands/npm-ls.md | 11 +- deps/npm/docs/content/commands/npm-org.md | 17 +- .../npm/docs/content/commands/npm-outdated.md | 9 + deps/npm/docs/content/commands/npm-owner.md | 11 +- deps/npm/docs/content/commands/npm-pack.md | 11 +- deps/npm/docs/content/commands/npm-ping.md | 11 +- deps/npm/docs/content/commands/npm-pkg.md | 15 +- deps/npm/docs/content/commands/npm-prefix.md | 9 + deps/npm/docs/content/commands/npm-profile.md | 16 +- deps/npm/docs/content/commands/npm-prune.md | 11 +- deps/npm/docs/content/commands/npm-publish.md | 14 +- deps/npm/docs/content/commands/npm-rebuild.md | 9 + deps/npm/docs/content/commands/npm-repo.md | 9 + deps/npm/docs/content/commands/npm-restart.md | 9 + deps/npm/docs/content/commands/npm-root.md | 11 +- .../docs/content/commands/npm-run-script.md | 13 +- deps/npm/docs/content/commands/npm-search.md | 11 +- .../docs/content/commands/npm-set-script.md | 9 + .../docs/content/commands/npm-shrinkwrap.md | 9 + deps/npm/docs/content/commands/npm-star.md | 9 + deps/npm/docs/content/commands/npm-stars.md | 10 + deps/npm/docs/content/commands/npm-start.md | 9 + deps/npm/docs/content/commands/npm-stop.md | 9 + deps/npm/docs/content/commands/npm-team.md | 19 +- deps/npm/docs/content/commands/npm-test.md | 11 +- deps/npm/docs/content/commands/npm-token.md | 16 +- .../docs/content/commands/npm-uninstall.md | 22 +- deps/npm/docs/content/commands/npm-unstar.md | 9 + deps/npm/docs/content/commands/npm-update.md | 31 +- deps/npm/docs/content/commands/npm-version.md | 15 +- deps/npm/docs/content/commands/npm-view.md | 13 +- deps/npm/docs/content/commands/npm-whoami.md | 11 +- deps/npm/docs/content/commands/npm.md | 5 +- deps/npm/docs/content/commands/npx.md | 24 +- deps/npm/docs/content/using-npm/scripts.md | 5 + deps/npm/docs/output/commands/npm-access.html | 9 +- .../npm/docs/output/commands/npm-adduser.html | 8 +- deps/npm/docs/output/commands/npm-audit.html | 11 +- deps/npm/docs/output/commands/npm-bin.html | 8 +- deps/npm/docs/output/commands/npm-bugs.html | 10 +- deps/npm/docs/output/commands/npm-cache.html | 21 +- deps/npm/docs/output/commands/npm-ci.html | 8 + .../docs/output/commands/npm-completion.html | 8 +- deps/npm/docs/output/commands/npm-config.html | 8 +- deps/npm/docs/output/commands/npm-dedupe.html | 24 +- .../docs/output/commands/npm-deprecate.html | 8 +- deps/npm/docs/output/commands/npm-diff.html | 10 +- .../docs/output/commands/npm-dist-tag.html | 8 +- deps/npm/docs/output/commands/npm-docs.html | 8 +- deps/npm/docs/output/commands/npm-doctor.html | 6 + deps/npm/docs/output/commands/npm-edit.html | 8 +- deps/npm/docs/output/commands/npm-exec.html | 20 +- .../npm/docs/output/commands/npm-explain.html | 6 + .../npm/docs/output/commands/npm-explore.html | 6 + .../docs/output/commands/npm-find-dupes.html | 7 + deps/npm/docs/output/commands/npm-fund.html | 9 +- .../docs/output/commands/npm-help-search.html | 6 + deps/npm/docs/output/commands/npm-help.html | 8 + deps/npm/docs/output/commands/npm-hook.html | 12 +- deps/npm/docs/output/commands/npm-init.html | 24 +- .../output/commands/npm-install-ci-test.html | 8 +- .../output/commands/npm-install-test.html | 32 +- .../npm/docs/output/commands/npm-install.html | 33 +- deps/npm/docs/output/commands/npm-link.html | 17 +- deps/npm/docs/output/commands/npm-logout.html | 8 +- deps/npm/docs/output/commands/npm-ls.html | 10 +- deps/npm/docs/output/commands/npm-org.html | 14 +- .../docs/output/commands/npm-outdated.html | 6 + deps/npm/docs/output/commands/npm-owner.html | 8 +- deps/npm/docs/output/commands/npm-pack.html | 8 +- deps/npm/docs/output/commands/npm-ping.html | 8 +- deps/npm/docs/output/commands/npm-pkg.html | 12 +- deps/npm/docs/output/commands/npm-prefix.html | 6 + .../npm/docs/output/commands/npm-profile.html | 13 +- deps/npm/docs/output/commands/npm-prune.html | 8 +- .../npm/docs/output/commands/npm-publish.html | 11 +- .../npm/docs/output/commands/npm-rebuild.html | 6 + deps/npm/docs/output/commands/npm-repo.html | 6 + .../npm/docs/output/commands/npm-restart.html | 6 + deps/npm/docs/output/commands/npm-root.html | 8 +- .../docs/output/commands/npm-run-script.html | 10 +- deps/npm/docs/output/commands/npm-search.html | 8 +- .../docs/output/commands/npm-set-script.html | 6 + .../docs/output/commands/npm-shrinkwrap.html | 6 + deps/npm/docs/output/commands/npm-star.html | 6 + deps/npm/docs/output/commands/npm-stars.html | 6 + deps/npm/docs/output/commands/npm-start.html | 6 + deps/npm/docs/output/commands/npm-stop.html | 6 + deps/npm/docs/output/commands/npm-team.html | 16 +- deps/npm/docs/output/commands/npm-test.html | 8 +- deps/npm/docs/output/commands/npm-token.html | 12 +- .../docs/output/commands/npm-uninstall.html | 18 +- deps/npm/docs/output/commands/npm-unstar.html | 6 + deps/npm/docs/output/commands/npm-update.html | 25 +- .../npm/docs/output/commands/npm-version.html | 12 +- deps/npm/docs/output/commands/npm-view.html | 10 +- deps/npm/docs/output/commands/npm-whoami.html | 8 +- deps/npm/docs/output/commands/npm.html | 6 +- deps/npm/docs/output/commands/npx.html | 23 +- deps/npm/docs/output/using-npm/scripts.html | 5 + deps/npm/lib/commands/access.js | 2 - deps/npm/lib/commands/adduser.js | 1 - deps/npm/lib/commands/ci.js | 3 +- deps/npm/lib/commands/dedupe.js | 2 - deps/npm/lib/commands/deprecate.js | 3 - deps/npm/lib/commands/diff.js | 2 - deps/npm/lib/commands/dist-tag.js | 1 - deps/npm/lib/commands/doctor.js | 3 +- deps/npm/lib/commands/exec.js | 2 - deps/npm/lib/commands/fund.js | 2 - deps/npm/lib/commands/hook.js | 10 +- deps/npm/lib/commands/init.js | 1 - deps/npm/lib/commands/install.js | 3 +- deps/npm/lib/commands/link.js | 6 - deps/npm/lib/commands/logout.js | 1 - deps/npm/lib/commands/org.js | 8 +- deps/npm/lib/commands/owner.js | 2 - deps/npm/lib/commands/ping.js | 2 +- deps/npm/lib/commands/profile.js | 8 +- deps/npm/lib/commands/prune.js | 2 - deps/npm/lib/commands/publish.js | 6 +- deps/npm/lib/commands/run-script.js | 6 +- deps/npm/lib/commands/star.js | 4 +- deps/npm/lib/commands/team.js | 15 +- deps/npm/lib/commands/token.js | 2 +- deps/npm/lib/commands/uninstall.js | 2 - deps/npm/lib/commands/unpublish.js | 7 +- deps/npm/lib/commands/update.js | 1 - deps/npm/lib/commands/whoami.js | 3 +- deps/npm/lib/npm.js | 6 +- deps/npm/lib/utils/config/definitions.js | 3 + deps/npm/lib/utils/display.js | 4 +- deps/npm/lib/utils/exit-handler.js | 6 +- deps/npm/lib/utils/reify-output.js | 6 +- deps/npm/lib/utils/update-notifier.js | 3 +- deps/npm/man/man1/npm-access.1 | 14 - deps/npm/man/man1/npm-adduser.1 | 13 +- deps/npm/man/man1/npm-audit.1 | 37 +- deps/npm/man/man1/npm-bin.1 | 10 +- deps/npm/man/man1/npm-bugs.1 | 15 +- deps/npm/man/man1/npm-cache.1 | 23 +- deps/npm/man/man1/npm-ci.1 | 16 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 22 - deps/npm/man/man1/npm-dedupe.1 | 63 +- deps/npm/man/man1/npm-deprecate.1 | 13 +- deps/npm/man/man1/npm-diff.1 | 47 -- deps/npm/man/man1/npm-dist-tag.1 | 16 +- deps/npm/man/man1/npm-docs.1 | 22 +- deps/npm/man/man1/npm-doctor.1 | 8 - deps/npm/man/man1/npm-edit.1 | 10 +- deps/npm/man/man1/npm-exec.1 | 34 +- deps/npm/man/man1/npm-explain.1 | 11 - deps/npm/man/man1/npm-explore.1 | 8 - deps/npm/man/man1/npm-find-dupes.1 | 43 +- deps/npm/man/man1/npm-fund.1 | 23 +- deps/npm/man/man1/npm-help-search.1 | 8 - deps/npm/man/man1/npm-help.1 | 10 +- deps/npm/man/man1/npm-hook.1 | 15 +- deps/npm/man/man1/npm-init.1 | 42 +- deps/npm/man/man1/npm-install-ci-test.1 | 16 +- deps/npm/man/man1/npm-install-test.1 | 81 +-- deps/npm/man/man1/npm-install.1 | 82 +-- deps/npm/man/man1/npm-link.1 | 66 +- deps/npm/man/man1/npm-logout.1 | 13 +- deps/npm/man/man1/npm-ls.1 | 48 +- deps/npm/man/man1/npm-org.1 | 25 +- deps/npm/man/man1/npm-outdated.1 | 23 - deps/npm/man/man1/npm-owner.1 | 13 +- deps/npm/man/man1/npm-pack.1 | 25 +- deps/npm/man/man1/npm-ping.1 | 10 +- deps/npm/man/man1/npm-pkg.1 | 22 +- deps/npm/man/man1/npm-prefix.1 | 8 - deps/npm/man/man1/npm-profile.1 | 24 +- deps/npm/man/man1/npm-prune.1 | 25 +- deps/npm/man/man1/npm-publish.1 | 31 +- deps/npm/man/man1/npm-rebuild.1 | 23 - deps/npm/man/man1/npm-repo.1 | 17 - deps/npm/man/man1/npm-restart.1 | 11 - deps/npm/man/man1/npm-root.1 | 10 +- deps/npm/man/man1/npm-run-script.1 | 27 +- deps/npm/man/man1/npm-search.1 | 40 +- deps/npm/man/man1/npm-set-script.1 | 14 - deps/npm/man/man1/npm-star.1 | 11 - deps/npm/man/man1/npm-stars.1 | 8 - deps/npm/man/man1/npm-start.1 | 11 - deps/npm/man/man1/npm-stop.1 | 11 - deps/npm/man/man1/npm-team.1 | 27 +- deps/npm/man/man1/npm-test.1 | 13 +- deps/npm/man/man1/npm-token.1 | 23 +- deps/npm/man/man1/npm-uninstall.1 | 30 +- deps/npm/man/man1/npm-unpublish.1 | 17 - deps/npm/man/man1/npm-unstar.1 | 14 - deps/npm/man/man1/npm-update.1 | 67 +- deps/npm/man/man1/npm-version.1 | 38 +- deps/npm/man/man1/npm-view.1 | 21 +- deps/npm/man/man1/npm-whoami.1 | 10 +- deps/npm/man/man1/npm.1 | 8 +- deps/npm/man/man1/npx.1 | 17 +- deps/npm/man/man7/config.7 | 446 -------------- deps/npm/man/man7/scripts.7 | 6 + .../node_modules/@npmcli/arborist/README.md | 10 + .../@npmcli/arborist/bin/actual.js | 36 +- .../@npmcli/arborist/bin/audit.js | 49 +- .../@npmcli/arborist/bin/funding.js | 66 +- .../@npmcli/arborist/bin/ideal.js | 29 +- .../@npmcli/arborist/bin/index.js | 155 +++-- .../@npmcli/arborist/bin/lib/logging.js | 88 ++- .../@npmcli/arborist/bin/lib/options.js | 170 +++-- .../@npmcli/arborist/bin/lib/print-tree.js | 5 +- .../@npmcli/arborist/bin/lib/timers.js | 32 +- .../@npmcli/arborist/bin/license.js | 78 ++- .../@npmcli/arborist/bin/prune.js | 43 +- .../@npmcli/arborist/bin/reify.js | 43 +- .../@npmcli/arborist/bin/shrinkwrap.js | 15 +- .../@npmcli/arborist/bin/virtual.js | 26 +- .../@npmcli/arborist/lib/add-rm-pkg-deps.js | 23 +- .../arborist/lib/arborist/build-ideal-tree.js | 25 +- .../@npmcli/arborist/lib/arborist/index.js | 4 +- .../@npmcli/arborist/lib/arborist/rebuild.js | 7 +- .../@npmcli/arborist/lib/arborist/reify.js | 21 +- .../@npmcli/arborist/lib/audit-report.js | 13 +- .../arborist/lib/get-workspace-nodes.js | 5 +- .../@npmcli/arborist/lib/shrinkwrap.js | 12 +- .../@npmcli/arborist/lib/tracker.js | 23 +- .../@npmcli/arborist/package.json | 18 +- .../@npmcli/config/lib/env-replace.js | 2 +- .../node_modules/@npmcli/config/lib/index.js | 15 +- .../@npmcli/config/lib/proc-log.js | 4 - .../node_modules/@npmcli/config/package.json | 11 +- .../npm/node_modules/@npmcli/git/lib/clone.js | 24 +- .../node_modules/@npmcli/git/lib/errors.js | 2 +- .../npm/node_modules/@npmcli/git/lib/index.js | 2 +- .../@npmcli/git/lib/lines-to-revs.js | 14 +- .../@npmcli/git/lib/make-error.js | 4 +- deps/npm/node_modules/@npmcli/git/lib/opts.js | 4 +- .../node_modules/@npmcli/git/lib/proc-log.js | 21 - deps/npm/node_modules/@npmcli/git/lib/revs.js | 2 +- .../npm/node_modules/@npmcli/git/lib/spawn.js | 9 +- .../git/node_modules/lru-cache/LICENSE | 15 + .../git/node_modules/lru-cache/index.js | 581 ++++++++++++++++++ .../git/node_modules/lru-cache/package.json | 34 + .../npm/node_modules/@npmcli/git/package.json | 29 +- .../metavuln-calculator/lib/advisory.js | 94 ++- .../@npmcli/metavuln-calculator/lib/hash.js | 4 +- .../@npmcli/metavuln-calculator/lib/index.js | 14 +- .../@npmcli/metavuln-calculator/package.json | 28 +- .../@npmcli/run-script/lib/make-spawn-args.js | 2 +- .../@npmcli/run-script/lib/package-envs.js | 7 +- .../@npmcli/run-script/lib/run-script-pkg.js | 26 +- .../@npmcli/run-script/lib/run-script.js | 4 +- .../@npmcli/run-script/lib/set-path.js | 5 +- .../@npmcli/run-script/lib/signal-manager.js | 7 +- .../run-script/lib/validate-options.js | 24 +- .../@npmcli/run-script/package.json | 36 +- deps/npm/node_modules/ansi-regex/index.js | 4 - deps/npm/node_modules/ansi-regex/license | 21 - deps/npm/node_modules/ansi-regex/package.json | 64 -- deps/npm/node_modules/ansi-regex/readme.md | 39 -- .../is-fullwidth-code-point/index.js | 50 -- .../is-fullwidth-code-point/package.json | 42 -- .../node_modules/string-width/index.js | 47 -- .../node_modules/string-width/package.json | 56 -- .../node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/readme.md | 78 --- .../is-fullwidth-code-point/index.d.ts | 17 - .../is-fullwidth-code-point/index.js | 50 -- .../is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 42 -- .../is-fullwidth-code-point/readme.md | 39 -- .../node_modules/string-width/index.d.ts | 29 - .../node_modules/string-width/index.js | 47 -- .../node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 56 -- .../node_modules/string-width/readme.md | 50 -- .../node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/readme.md | 46 -- deps/npm/node_modules/columnify/Readme.md | 49 +- deps/npm/node_modules/columnify/columnify.js | 22 +- .../node_modules/ansi-regex/index.d.ts | 0 .../node_modules/ansi-regex/index.js | 2 +- .../node_modules/ansi-regex}/license | 0 .../node_modules/ansi-regex/package.json | 2 +- .../node_modules/strip-ansi/index.d.ts | 0 .../node_modules/strip-ansi/index.js | 0 .../node_modules/strip-ansi}/license | 0 .../node_modules/strip-ansi/package.json | 4 +- deps/npm/node_modules/columnify/package.json | 12 +- .../is-fullwidth-code-point/index.d.ts | 17 - .../is-fullwidth-code-point/index.js | 50 -- .../is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 42 -- .../node_modules/string-width/index.d.ts | 29 - .../gauge/node_modules/string-width/index.js | 47 -- .../gauge/node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 56 -- .../lib/init-package-json.js | 2 +- .../init-package-json/package.json | 21 +- .../is-fullwidth-code-point/index.d.ts | 0 .../is-fullwidth-code-point/index.js | 46 +- .../is-fullwidth-code-point/license | 20 +- .../is-fullwidth-code-point/package.json | 83 ++- .../is-fullwidth-code-point/readme.md | 12 +- .../node_modules/libnpmaccess/package.json | 6 +- deps/npm/node_modules/libnpmdiff/package.json | 6 +- deps/npm/node_modules/libnpmexec/README.md | 1 - deps/npm/node_modules/libnpmexec/lib/index.js | 9 +- .../node_modules/libnpmexec/lib/run-script.js | 11 +- deps/npm/node_modules/libnpmexec/package.json | 13 +- deps/npm/node_modules/libnpmfund/package.json | 4 +- deps/npm/node_modules/libnpmhook/package.json | 4 +- deps/npm/node_modules/libnpmorg/package.json | 4 +- deps/npm/node_modules/libnpmpack/lib/index.js | 2 +- deps/npm/node_modules/libnpmpack/package.json | 8 +- .../node_modules/libnpmpublish/lib/publish.js | 2 +- .../node_modules/libnpmpublish/package.json | 8 +- .../node_modules/libnpmsearch/package.json | 4 +- deps/npm/node_modules/libnpmteam/package.json | 4 +- deps/npm/node_modules/libnpmversion/README.md | 1 + .../libnpmversion/lib/enforce-clean.js | 3 +- .../node_modules/libnpmversion/lib/index.js | 5 +- .../node_modules/libnpmversion/lib/version.js | 9 +- .../node_modules/libnpmversion/package.json | 7 +- .../npm-package-arg/{ => lib}/npa.js | 98 +-- .../node_modules/npm-package-arg/package.json | 33 +- .../npm-pick-manifest/{ => lib}/index.js | 14 +- .../npm-pick-manifest/package.json | 35 +- .../npm/node_modules/npm-profile/lib/index.js | 19 +- .../npm/node_modules/npm-profile/package.json | 16 +- .../npm-registry-fetch/lib/check-response.js | 13 +- .../npm-registry-fetch/lib/default-opts.js | 1 - .../npm-registry-fetch/package.json | 8 +- deps/npm/node_modules/pacote/README.md | 9 +- deps/npm/node_modules/pacote/lib/bin.js | 30 +- deps/npm/node_modules/pacote/lib/dir.js | 17 +- deps/npm/node_modules/pacote/lib/fetcher.js | 101 +-- deps/npm/node_modules/pacote/lib/file.js | 41 +- deps/npm/node_modules/pacote/lib/git.js | 94 +-- deps/npm/node_modules/pacote/lib/registry.js | 39 +- deps/npm/node_modules/pacote/lib/remote.js | 8 +- .../node_modules/pacote/lib/util/cache-dir.js | 2 +- .../pacote/lib/util/is-package-bin.js | 7 +- deps/npm/node_modules/pacote/lib/util/npm.js | 1 - .../node_modules/pacote/lib/util/proc-log.js | 21 - .../pacote/lib/util/tar-create-options.js | 5 +- .../pacote/lib/util/trailing-slashes.js | 10 + deps/npm/node_modules/pacote/package.json | 47 +- deps/npm/node_modules/proc-log/index.js | 22 - .../lib/proc-log.js => proc-log/lib/index.js} | 4 +- deps/npm/node_modules/proc-log/package.json | 30 +- .../node_modules => }/string-width/index.d.ts | 0 deps/npm/node_modules/string-width/index.js | 21 +- .../node_modules/ansi-regex/index.d.ts | 37 ++ .../node_modules/ansi-regex/index.js | 8 +- .../node_modules/ansi-regex/package.json | 104 ++-- .../node_modules/ansi-regex/readme.md | 38 +- .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 2 +- .../node_modules/strip-ansi/package.json | 102 +-- .../node_modules/strip-ansi/readme.md | 17 +- .../node_modules/string-width/package.json | 21 +- deps/npm/node_modules/string-width/readme.md | 22 +- deps/npm/node_modules/strip-ansi/index.js | 6 - deps/npm/node_modules/strip-ansi/license | 21 - deps/npm/node_modules/strip-ansi/package.json | 57 -- deps/npm/node_modules/strip-ansi/readme.md | 33 - deps/npm/package.json | 46 +- .../test/lib/utils/exit-handler.js.test.cjs | 8 +- deps/npm/test/fixtures/mock-npm.js | 53 +- deps/npm/test/fixtures/sandbox.js | 45 +- deps/npm/test/lib/commands/access.js | 5 +- deps/npm/test/lib/commands/adduser.js | 7 - deps/npm/test/lib/commands/deprecate.js | 7 - deps/npm/test/lib/commands/diff.js | 3 +- deps/npm/test/lib/commands/dist-tag.js | 10 - deps/npm/test/lib/commands/doctor.js | 12 +- deps/npm/test/lib/commands/hook.js | 47 +- deps/npm/test/lib/commands/logout.js | 9 +- deps/npm/test/lib/commands/org.js | 41 +- deps/npm/test/lib/commands/owner.js | 26 +- deps/npm/test/lib/commands/ping.js | 9 +- deps/npm/test/lib/commands/publish.js | 60 +- deps/npm/test/lib/commands/run-script.js | 28 +- deps/npm/test/lib/commands/star.js | 6 +- deps/npm/test/lib/commands/team.js | 21 +- deps/npm/test/lib/commands/unpublish.js | 7 +- deps/npm/test/lib/commands/update.js | 10 +- deps/npm/test/lib/utils/config/definitions.js | 9 + deps/npm/test/lib/utils/exit-handler.js | 6 +- deps/npm/test/lib/utils/reify-output.js | 11 +- deps/npm/test/lib/utils/update-notifier.js | 3 +- 421 files changed, 3967 insertions(+), 4906 deletions(-) delete mode 100644 deps/npm/node_modules/@npmcli/config/lib/proc-log.js delete mode 100644 deps/npm/node_modules/@npmcli/git/lib/proc-log.js create mode 100644 deps/npm/node_modules/@npmcli/git/node_modules/lru-cache/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/git/node_modules/lru-cache/index.js create mode 100644 deps/npm/node_modules/@npmcli/git/node_modules/lru-cache/package.json delete mode 100644 deps/npm/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/ansi-regex/license delete mode 100644 deps/npm/node_modules/ansi-regex/package.json delete mode 100644 deps/npm/node_modules/ansi-regex/readme.md delete mode 100644 deps/npm/node_modules/cli-columns/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/cli-columns/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/cli-columns/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/cli-columns/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/license delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/readme.md delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/index.d.ts delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/license delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/readme.md delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/license delete mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/ansi-regex/index.d.ts (100%) rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/ansi-regex/index.js (62%) rename deps/npm/node_modules/{cli-columns/node_modules/is-fullwidth-code-point => columnify/node_modules/ansi-regex}/license (100%) rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/ansi-regex/package.json (97%) rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/strip-ansi/index.d.ts (100%) rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/strip-ansi/index.js (100%) rename deps/npm/node_modules/{cli-columns/node_modules/string-width => columnify/node_modules/strip-ansi}/license (100%) rename deps/npm/node_modules/{cli-table3 => columnify}/node_modules/strip-ansi/package.json (94%) delete mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/gauge/node_modules/string-width/index.d.ts delete mode 100644 deps/npm/node_modules/gauge/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/gauge/node_modules/string-width/license delete mode 100644 deps/npm/node_modules/gauge/node_modules/string-width/package.json rename deps/npm/node_modules/{cli-columns/node_modules => }/is-fullwidth-code-point/index.d.ts (100%) rename deps/npm/node_modules/npm-package-arg/{ => lib}/npa.js (86%) rename deps/npm/node_modules/npm-pick-manifest/{ => lib}/index.js (96%) delete mode 100644 deps/npm/node_modules/pacote/lib/util/proc-log.js create mode 100644 deps/npm/node_modules/pacote/lib/util/trailing-slashes.js delete mode 100644 deps/npm/node_modules/proc-log/index.js rename deps/npm/node_modules/{libnpmversion/lib/proc-log.js => proc-log/lib/index.js} (92%) rename deps/npm/node_modules/{cli-columns/node_modules => }/string-width/index.d.ts (100%) create mode 100644 deps/npm/node_modules/string-width/node_modules/ansi-regex/index.d.ts create mode 100644 deps/npm/node_modules/string-width/node_modules/strip-ansi/index.d.ts delete mode 100644 deps/npm/node_modules/strip-ansi/index.js delete mode 100644 deps/npm/node_modules/strip-ansi/license delete mode 100644 deps/npm/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/strip-ansi/readme.md diff --git a/deps/npm/docs/content/commands/npm-access.md b/deps/npm/docs/content/commands/npm-access.md index 1f661c911f47dc..162e94f1fec029 100644 --- a/deps/npm/docs/content/commands/npm-access.md +++ b/deps/npm/docs/content/commands/npm-access.md @@ -6,21 +6,27 @@ description: Set access level on published packages ### Synopsis + + + + ```bash npm access public [] npm access restricted [] - npm access grant [] npm access revoke [] - npm access 2fa-required [] npm access 2fa-not-required [] - npm access ls-packages [||] npm access ls-collaborators [ []] npm access edit [] ``` + + + + + ### Description Used to set access controls on private packages. diff --git a/deps/npm/docs/content/commands/npm-adduser.md b/deps/npm/docs/content/commands/npm-adduser.md index 21a31ca940e524..06eeb379c4dd88 100644 --- a/deps/npm/docs/content/commands/npm-adduser.md +++ b/deps/npm/docs/content/commands/npm-adduser.md @@ -6,12 +6,21 @@ description: Add a registry user account ### Synopsis + + + + ```bash -npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] +npm adduser aliases: login, add-user ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-audit.md b/deps/npm/docs/content/commands/npm-audit.md index 58c614d793db29..323d38f64c14f9 100644 --- a/deps/npm/docs/content/commands/npm-audit.md +++ b/deps/npm/docs/content/commands/npm-audit.md @@ -6,13 +6,19 @@ description: Run a security audit ### Synopsis -```bash -npm audit [--json] [--production] [--audit-level=(low|moderate|high|critical)] -npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)] + + + -common options: [--production] [--only=(dev|prod)] +```bash +npm audit [fix] ``` + + + + + ### Description The audit command submits a description of the dependencies configured in diff --git a/deps/npm/docs/content/commands/npm-bin.md b/deps/npm/docs/content/commands/npm-bin.md index 2d7c1d5b8149ee..94b72cfd5c81ce 100644 --- a/deps/npm/docs/content/commands/npm-bin.md +++ b/deps/npm/docs/content/commands/npm-bin.md @@ -6,10 +6,19 @@ description: Display npm bin folder ### Synopsis + + + + ```bash -npm bin [-g|--global] +npm bin ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-bugs.md b/deps/npm/docs/content/commands/npm-bugs.md index f92241a14b95c0..aeddeb848e81b8 100644 --- a/deps/npm/docs/content/commands/npm-bugs.md +++ b/deps/npm/docs/content/commands/npm-bugs.md @@ -6,12 +6,21 @@ description: Report bugs for a package in a web browser ### Synopsis + + + + ```bash -npm bugs [ [ ...]] +npm bugs [] -aliases: issues +alias: issues ``` + + + + + ### Description This command tries to guess at the likely location of a package's bug diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index 6497a3988c9387..091e26e8a71828 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -6,18 +6,26 @@ description: Manipulates packages cache ### Synopsis -```bash -npm cache add ... -npm cache add ... -npm cache add ... -npm cache add @... - -npm cache clean -aliases: npm cache clear, npm cache rm + + + +```bash +npm cache add +npm cache add +npm cache add +npm cache add +npm cache add @ +npm cache clean [] +npm cache ls [@] npm cache verify ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 1ce50c66d5fafa..4490fea9a0bb74 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -6,10 +6,21 @@ description: Install a project with a clean slate ### Synopsis + + + + ```bash npm ci + +aliases: clean-install, ic, install-clean, isntall-clean ``` + + + + + ### Description This command is similar to [`npm install`](/commands/npm-install), except diff --git a/deps/npm/docs/content/commands/npm-completion.md b/deps/npm/docs/content/commands/npm-completion.md index 9dbd960913f270..d73a98f2e50f78 100644 --- a/deps/npm/docs/content/commands/npm-completion.md +++ b/deps/npm/docs/content/commands/npm-completion.md @@ -6,10 +6,19 @@ description: Tab Completion for npm ### Synopsis + + + + ```bash -source <(npm completion) +npm completion ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index 2d77f045cbc472..a66a198ce42d17 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -6,18 +6,25 @@ description: Manage the npm configuration files ### Synopsis + + + + ```bash npm config set = [= ...] npm config get [ [ ...]] npm config delete [ ...] npm config list [--json] npm config edit -npm set = [= ...] -npm get [ [ ...]] alias: c ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index 53d2e64272a67b..b5a64831c0bbaa 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -6,13 +6,21 @@ description: Reduce duplication in the package tree ### Synopsis + + + + ```bash npm dedupe -npm ddp -aliases: ddp +alias: ddp ``` + + + + + ### Description Searches the local package tree and attempts to simplify the overall @@ -145,6 +153,24 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + + + + +#### `save` + +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 438a54ec6e4f36..4345120d3744b3 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -6,10 +6,19 @@ description: Deprecate a version of a package ### Synopsis + + + + ```bash -npm deprecate [@] +npm deprecate [@] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-diff.md b/deps/npm/docs/content/commands/npm-diff.md index 8d05df779f3ca5..c4c9eafdb3524d 100644 --- a/deps/npm/docs/content/commands/npm-diff.md +++ b/deps/npm/docs/content/commands/npm-diff.md @@ -6,14 +6,19 @@ description: The registry diff command ### Synopsis + + + + ```bash npm diff [...] -npm diff --diff= [...] -npm diff --diff= [--diff=] [...] -npm diff --diff= [--diff=] [...] -npm diff [--diff-ignore-all-space] [--diff-name-only] [...] ``` + + + + + ### Description Similar to its `git diff` counterpart, this command will print diff patches diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index a4e0243aac87b3..a0f306cd4970d5 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -6,14 +6,23 @@ description: Modify package distribution tags ### Synopsis + + + + ```bash npm dist-tag add @ [] npm dist-tag rm npm dist-tag ls [] -aliases: dist-tags +alias: dist-tags ``` + + + + + ### Description Add, remove, and enumerate distribution tags on a package: diff --git a/deps/npm/docs/content/commands/npm-docs.md b/deps/npm/docs/content/commands/npm-docs.md index 970d17aa829c6e..8d5a278286a88b 100644 --- a/deps/npm/docs/content/commands/npm-docs.md +++ b/deps/npm/docs/content/commands/npm-docs.md @@ -6,12 +6,21 @@ description: Open documentation for a package in a web browser ### Synopsis + + + + ```bash npm docs [ [ ...]] -aliases: home +alias: home ``` + + + + + ### Description This command tries to guess at the likely location of a package's diff --git a/deps/npm/docs/content/commands/npm-doctor.md b/deps/npm/docs/content/commands/npm-doctor.md index 0cce60c7b7b157..7fb63bab16e835 100644 --- a/deps/npm/docs/content/commands/npm-doctor.md +++ b/deps/npm/docs/content/commands/npm-doctor.md @@ -6,10 +6,19 @@ description: Check your npm environment ### Synopsis + + + + ```bash npm doctor ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-edit.md b/deps/npm/docs/content/commands/npm-edit.md index 5ae7f2481ae456..39fc49592c571c 100644 --- a/deps/npm/docs/content/commands/npm-edit.md +++ b/deps/npm/docs/content/commands/npm-edit.md @@ -6,10 +6,19 @@ description: Edit an installed package ### Synopsis + + + + ```bash -npm edit +npm edit [/...] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index d154f5780b9c9c..3645e336b9da97 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -6,26 +6,23 @@ description: Run a command from a local or remote npm package ### Synopsis + + + + ```bash npm exec -- [@] [args...] npm exec --package=[@] -- [args...] npm exec -c ' [args...]' npm exec --package=foo -c ' [args...]' -npm exec [--ws] [-w [@] [args...] -npx -p [@] [args...] -npx -c ' [args...]' -npx -p [@] -c ' [args...]' -Run without --call or positional args to open interactive subshell +alias: x +``` -alias: npm x, npx + + -common options: ---package= (may be specified multiple times) --p is a shorthand for --package only when using npx executable --c --call= (may not be mixed with positional arguments) -``` + ### Description diff --git a/deps/npm/docs/content/commands/npm-explain.md b/deps/npm/docs/content/commands/npm-explain.md index 5f05cac0f906b0..765221056585d9 100644 --- a/deps/npm/docs/content/commands/npm-explain.md +++ b/deps/npm/docs/content/commands/npm-explain.md @@ -6,12 +6,21 @@ description: Explain installed packages ### Synopsis + + + + ```bash npm explain alias: why ``` + + + + + ### Description This command will print the chain of dependencies causing a given package diff --git a/deps/npm/docs/content/commands/npm-explore.md b/deps/npm/docs/content/commands/npm-explore.md index 3979da9573db00..90753c7e09199f 100644 --- a/deps/npm/docs/content/commands/npm-explore.md +++ b/deps/npm/docs/content/commands/npm-explore.md @@ -6,10 +6,19 @@ description: Browse an installed package ### Synopsis + + + + ```bash npm explore [ -- ] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index f7dc84f9c5306d..f7366fa6375d1e 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -6,10 +6,19 @@ description: Find duplication in the package tree ### Synopsis + + + + ```bash npm find-dupes ``` + + + + + ### Description Runs `npm dedupe` in `--dry-run` mode, making npm only output the @@ -82,6 +91,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 606b0a188c5549..5b96e91ab8ccb9 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -6,11 +6,19 @@ description: Retrieve funding information ### Synopsis + + + + ```bash -npm fund [] -npm fund [-w ] +npm fund [[<@scope>/]] ``` + + + + + ### Description This command retrieves information on how to fund the dependencies of a diff --git a/deps/npm/docs/content/commands/npm-help-search.md b/deps/npm/docs/content/commands/npm-help-search.md index 78553a14ecb01d..152f9f6bec16f1 100644 --- a/deps/npm/docs/content/commands/npm-help-search.md +++ b/deps/npm/docs/content/commands/npm-help-search.md @@ -6,10 +6,19 @@ description: Search npm help documentation ### Synopsis + + + + ```bash npm help-search ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-help.md b/deps/npm/docs/content/commands/npm-help.md index a8002eef17156c..83c595db696b9c 100644 --- a/deps/npm/docs/content/commands/npm-help.md +++ b/deps/npm/docs/content/commands/npm-help.md @@ -6,10 +6,21 @@ description: Get help on npm ### Synopsis + + + + ```bash npm help [] + +alias: hlep ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-hook.md b/deps/npm/docs/content/commands/npm-hook.md index c91bce3075e7b2..4a9805d02f9d43 100644 --- a/deps/npm/docs/content/commands/npm-hook.md +++ b/deps/npm/docs/content/commands/npm-hook.md @@ -6,13 +6,22 @@ description: Manage registry hooks ### Synopsis + + + + ```bash +npm hook add [--type=] npm hook ls [pkg] -npm hook add -npm hook update [secret] npm hook rm +npm hook update ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index a608061a96d8dc..d9c03aef41504b 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -6,13 +6,23 @@ description: Create a package.json file ### Synopsis + + + + ```bash -npm init [--yes|-y|--scope] -npm init <@scope> (same as `npm exec <@scope>/create`) -npm init [<@scope>/] (same as `npm exec [<@scope>/]create-`) -npm init [-w ] [args...] +npm init [--force|-f|--yes|-y|--scope] +npm init <@scope> (same as `npx <@scope>/create`) +npm init [<@scope>/] (same as `npx [<@scope>/]create-`) + +aliases: create, innit ``` + + + + + ### Description `npm init ` can be used to set up a new or existing npm @@ -38,6 +48,15 @@ strictly additive, so it will keep any fields and values that were already set. You can also use `-y`/`--yes` to skip the questionnaire altogether. If you pass `--scope`, it will create a scoped package. +*Note:* if a user already has the `create-` package +globally installed, that will be what `npm init` uses. If you want npm +to use the latest version, or another specific version you must specify +it: + +* `npm init foo@latest` # fetches and runs the latest `create-foo` from + the registry +* `npm init foo@1.2.3` # runs `create-foo@1.2.3` specifically + #### Forwarding additional options Any additional options will be passed directly to the command, so `npm init diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index 5c37ed8f56128b..5ad67604541d1e 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -6,12 +6,21 @@ description: Install a project with a clean slate and run tests ### Synopsis + + + + ```bash npm install-ci-test -alias: npm cit +alias: cit ``` + + + + + ### Description This command runs `npm ci` followed immediately by `npm test`. diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index c464e5bd0b8c64..ed39c6705a4848 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -6,20 +6,30 @@ description: Install package(s) and run tests ### Synopsis + + + + ```bash -npm install-test (with no args, in package dir) -npm install-test [<@scope>/] -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ +npm install-test [<@scope>/] +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test @npm: +npm install-test npm install-test npm install-test -npm install-test +npm install-test +npm install-test / -alias: npm it -common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run] +alias: it ``` + + + + + ### Description This command runs an `npm install` followed immediately by an `npm test`. It @@ -32,13 +42,16 @@ takes exactly the same arguments as `npm install`. #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -133,6 +146,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index f83ff511991b70..6f12e5f5389973 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -6,23 +6,30 @@ description: Install a package ### Synopsis + + + + ```bash -npm install (with no args, in package dir) -npm install [<@scope>/] -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install [<@scope>/]@ +npm install [<@scope>/] +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install [<@scope>/]@ npm install @npm: -npm install :/ -npm install +npm install npm install npm install -npm install +npm install +npm install / -aliases: npm i, npm add -common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run] +aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add ``` + + + + + ### Description This command installs a package and any packages that it depends on. If the @@ -425,13 +432,16 @@ These are some of the most common options related to installation. #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -526,6 +536,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index d4ef41ae964628..892b55496c9b6f 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -6,13 +6,22 @@ description: Symlink a package folder ### Synopsis + + + + ```bash npm link (in package dir) npm link [<@scope>/][@] -alias: npm ln +alias: ln ``` + + + + + ### Description This is handy for installing your own stuff, so that you can work on it and @@ -116,13 +125,16 @@ workspace(s). #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -217,6 +229,8 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. +This configuration does not affect `npm ci`. + diff --git a/deps/npm/docs/content/commands/npm-logout.md b/deps/npm/docs/content/commands/npm-logout.md index cb7c8496fb4791..f0dd5cb856eaee 100644 --- a/deps/npm/docs/content/commands/npm-logout.md +++ b/deps/npm/docs/content/commands/npm-logout.md @@ -6,10 +6,19 @@ description: Log out of the registry ### Synopsis + + + + ```bash -npm logout [--registry=] [--scope=<@scope>] +npm logout ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 3b33f0a3605e08..0f06e131f414b2 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -6,12 +6,21 @@ description: List installed packages ### Synopsis + + + + ```bash npm ls [[<@scope>/] ...] -aliases: list, la, ll +alias: list ``` + + + + + ### Description This command will print to stdout all the versions of packages that are diff --git a/deps/npm/docs/content/commands/npm-org.md b/deps/npm/docs/content/commands/npm-org.md index 2f08f611529925..975581c860df64 100644 --- a/deps/npm/docs/content/commands/npm-org.md +++ b/deps/npm/docs/content/commands/npm-org.md @@ -6,12 +6,23 @@ description: Manage orgs ### Synopsis + + + + ```bash -npm org set [developer | admin | owner] -npm org rm -npm org ls [] +npm org set orgname username [developer | admin | owner] +npm org rm orgname username +npm org ls orgname [] + +alias: ogr ``` + + + + + Note: This command is unaware of workspaces. ### Example diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md index 1b58a6afda64bb..6fa026550e7477 100644 --- a/deps/npm/docs/content/commands/npm-outdated.md +++ b/deps/npm/docs/content/commands/npm-outdated.md @@ -6,10 +6,19 @@ description: Check for outdated packages ### Synopsis + + + + ```bash npm outdated [[<@scope>/] ...] ``` + + + + + ### Description This command will check the registry to see if any (or, specific) installed diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 74e7f84af6c804..0779984e19a9db 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -6,14 +6,23 @@ description: Manage package owners ### Synopsis + + + + ```bash npm owner add [<@scope>/] npm owner rm [<@scope>/] npm owner ls [<@scope>/] -aliases: author +alias: author ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-pack.md b/deps/npm/docs/content/commands/npm-pack.md index 53945986837b94..c834f643ac0bb1 100644 --- a/deps/npm/docs/content/commands/npm-pack.md +++ b/deps/npm/docs/content/commands/npm-pack.md @@ -6,10 +6,19 @@ description: Create a tarball from a package ### Synopsis + + + + ```bash -npm pack [[<@scope>/]...] [--dry-run] [--json] +npm pack [[<@scope>/]...] ``` + + + + + ### Configuration diff --git a/deps/npm/docs/content/commands/npm-ping.md b/deps/npm/docs/content/commands/npm-ping.md index c59a56e611e54f..161d7292f8c977 100644 --- a/deps/npm/docs/content/commands/npm-ping.md +++ b/deps/npm/docs/content/commands/npm-ping.md @@ -6,10 +6,19 @@ description: Ping npm registry ### Synopsis + + + + ```bash -npm ping [--registry ] +npm ping ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index beee9c1c4e78a9..8f6cbecf958fd9 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -6,12 +6,21 @@ description: Manages your package.json ### Synopsis + + + + ```bash -npm pkg get [ [. ...]] -npm pkg set = [.= ...] -npm pkg delete [. ...] +npm pkg set = [= ...] +npm pkg get [ [ ...]] +npm pkg delete [ ...] ``` + + + + + ### Description A command that automates the management of `package.json` files. diff --git a/deps/npm/docs/content/commands/npm-prefix.md b/deps/npm/docs/content/commands/npm-prefix.md index 276a9e9e699100..39328bcc88a143 100644 --- a/deps/npm/docs/content/commands/npm-prefix.md +++ b/deps/npm/docs/content/commands/npm-prefix.md @@ -6,10 +6,19 @@ description: Display prefix ### Synopsis + + + + ```bash npm prefix [-g] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-profile.md b/deps/npm/docs/content/commands/npm-profile.md index cecc48518dbdb7..af1f9d8aa10633 100644 --- a/deps/npm/docs/content/commands/npm-profile.md +++ b/deps/npm/docs/content/commands/npm-profile.md @@ -6,14 +6,22 @@ description: Change settings on your registry profile ### Synopsis + + + + ```bash -npm profile get [--json|--parseable] [] -npm profile set [--json|--parseable] -npm profile set password -npm profile enable-2fa [auth-and-writes|auth-only] +npm profile enable-2fa [auth-only|auth-and-writes] npm profile disable-2fa +npm profile get [] +npm profile set ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 658ab2610e0ed9..49420e5b9d99cb 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -6,10 +6,19 @@ description: Remove extraneous packages ### Synopsis + + + + ```bash -npm prune [[<@scope>/]...] [--production] [--dry-run] [--json] +npm prune [[<@scope>/]...] ``` + + + + + ### Description This command removes "extraneous" packages. If a package name is provided, diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 6958b1066de7fd..ce6e1c1012c8e2 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -6,13 +6,19 @@ description: Publish a package ### Synopsis -```bash -npm publish [|] [--tag ] [--access ] [--otp otpcode] [--dry-run] + + + -Publishes '.' if no argument supplied -Sets tag 'latest' if no --tag specified +```bash +npm publish [] ``` + + + + + ### Description Publishes a package to the registry so that it can be installed by name. diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 75e71c60e6810a..ecb4a7ce34c62a 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -6,12 +6,21 @@ description: Rebuild a package ### Synopsis + + + + ```bash npm rebuild [[<@scope>/][@] ...] alias: rb ``` + + + + + ### Description This command runs the `npm build` command on the matched folders. This is diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index cd47fde47127ee..e14f07012a2484 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -6,10 +6,19 @@ description: Open package repository page in the browser ### Synopsis + + + + ```bash npm repo [ [ ...]] ``` + + + + + ### Description This command tries to guess at the likely location of a package's diff --git a/deps/npm/docs/content/commands/npm-restart.md b/deps/npm/docs/content/commands/npm-restart.md index 80f8ab77ef0183..f01cd014e74357 100644 --- a/deps/npm/docs/content/commands/npm-restart.md +++ b/deps/npm/docs/content/commands/npm-restart.md @@ -6,10 +6,19 @@ description: Restart a package ### Synopsis + + + + ```bash npm restart [-- ] ``` + + + + + ### Description This restarts a project. It is equivalent to running `npm run-script diff --git a/deps/npm/docs/content/commands/npm-root.md b/deps/npm/docs/content/commands/npm-root.md index 98d1108d33f758..40b58e4b33d0b2 100644 --- a/deps/npm/docs/content/commands/npm-root.md +++ b/deps/npm/docs/content/commands/npm-root.md @@ -6,10 +6,19 @@ description: Display npm root ### Synopsis + + + + ```bash -npm root [-g] +npm root ``` + + + + + ### Description Print the effective `node_modules` folder to standard out. diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 6dd602d03e00ad..79b7c9a25780e6 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -6,14 +6,21 @@ description: Run arbitrary package scripts ### Synopsis + + + + ```bash -npm run-script [--if-present] [--silent] [-- ] -npm run-script [--workspace=] -npm run-script [--workspaces] +npm run-script [-- ] aliases: run, rum, urn ``` + + + + + ### Description This runs an arbitrary command from a package's `"scripts"` object. If no diff --git a/deps/npm/docs/content/commands/npm-search.md b/deps/npm/docs/content/commands/npm-search.md index 252822e7198443..db6a12bafabf13 100644 --- a/deps/npm/docs/content/commands/npm-search.md +++ b/deps/npm/docs/content/commands/npm-search.md @@ -6,12 +6,21 @@ description: Search for packages ### Synopsis + + + + ```bash -npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...] +npm search [search terms ...] aliases: s, se, find ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/deps/npm/docs/content/commands/npm-set-script.md b/deps/npm/docs/content/commands/npm-set-script.md index 869ceede045ae3..2d8e87db852196 100644 --- a/deps/npm/docs/content/commands/npm-set-script.md +++ b/deps/npm/docs/content/commands/npm-set-script.md @@ -7,10 +7,19 @@ description: Set tasks in the scripts section of package.json ### Synopsis An npm command that lets you create a task in the `scripts` section of the `package.json`. + + + + ```bash npm set-script [