diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 8c13541fd37d14..52e3ac97c68297 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -12,7 +12,6 @@ on: - '!.github/workflows/build-tarball.yml' push: branches: - - master - main - v[0-9]+.x-staging - v[0-9]+.x diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 5ab5f98739f579..c85c9976dfd380 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -9,7 +9,6 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: - - master - main - canary - v[0-9]+.x-staging diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 77bad80cc269d5..5e8115a9245ded 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -11,7 +11,8 @@ on: - .github/** - '!.github/workflows/coverage-linux.yml' push: - branches: [master, main] + branches: + - main paths-ignore: - '**.md' - benchmark/** diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 29e7ac689a2043..287872d79f3dee 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -12,7 +12,8 @@ on: - .github/** - '!.github/workflows/coverage-windows.yml' push: - branches: [master, main] + branches: + - main paths-ignore: - '**.md' - benchmark/** diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 1151c42967807a..474a8dd7eac45e 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: - - master - main - v[0-9]+.x-staging - v[0-9]+.x diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 0fa577025211e9..c9873d188a8e14 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: - - master - main - v[0-9]+.x-staging - v[0-9]+.x @@ -50,7 +49,7 @@ jobs: - name: Lint C/C++ files run: make lint-cpp format-cpp: - if: ${{ github.event.pull_request.draft == false && github.base_ref == 'master' }} + if: ${{ github.event.pull_request && github.event.pull_request.draft == false && github.base_ref == github.event.repository.default_branch }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml index 4f43a7d715013c..32876584edb3c3 100644 --- a/.github/workflows/notify-force-push.yml +++ b/.github/workflows/notify-force-push.yml @@ -1,7 +1,6 @@ on: push: branches: - - master - main name: Notify on Force Push diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 87cf9edf672d47..b345eded201755 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -12,7 +12,6 @@ on: - '!.github/workflows/test-asan.yml' push: branches: - - master - main - canary - v[0-9]+.x-staging diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 8325845963ecf9..75f508bfe01258 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -10,7 +10,6 @@ on: paths: [test/internet/**] push: branches: - - master - main - canary - v[0-9]+.x-staging diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 7d6f4303e9256e..b2fa9e0a0cbbb6 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -9,7 +9,6 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: - - master - main - canary - v[0-9]+.x-staging diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 0c76a44bae9695..f342dbfa0f130e 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -12,7 +12,6 @@ on: - '!.github/workflows/test-macos.yml' push: branches: - - master - main - canary - v[0-9]+.x-staging diff --git a/.gitignore b/.gitignore index bc986b3c4c0659..6e58d14c32a1bc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ !.github !.gitignore !.gitkeep +!.gitpod.yml !.mailmap !.nycrc !.yamllint.yaml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000000..73e52c3aa2d51a --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,9 @@ +# Ref: https://github.com/gitpod-io/gitpod/issues/6283#issuecomment-1001043454 +tasks: + - init: ./configure && timeout 50m make -j16 || true + +# Ref: https://www.gitpod.io/docs/prebuilds#github-specific-configuration +github: + prebuilds: + # add a "Review in Gitpod" button as a comment to pull requests (defaults to true) + addComment: false diff --git a/.mailmap b/.mailmap index 3143501352576a..6248917e68515d 100644 --- a/.mailmap +++ b/.mailmap @@ -380,6 +380,7 @@ Noah Rose Ledesma npm team npm team npm team +npm team Oliver Chang Oluwaseun Omoyajowo OneNail @@ -450,6 +451,7 @@ Saúl Ibarra Corretgé Scott Blomquist Segu Riluvan Sergey Kryzhanovsky +Sergey Petushkov Sergey Zelenov Shannen Saez Shaopeng Zhang @@ -489,6 +491,7 @@ Tarun Batra Taylor Woll Ted Young Teppei Sato +theanarkh <2923878201@qq.com> Theotime Poisseau Thomas Hunter II Thomas Lee diff --git a/AUTHORS b/AUTHORS index f20f9bc3313a08..029eb68e36640f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3441,7 +3441,7 @@ Damjan Cvetko Randall Leeds Khoo Hao Yit <40757009+KhooHaoYit@users.noreply.github.com> Aroyan <43630681+aroyan@users.noreply.github.com> -theanarkh <2923878201@qq.com> +theanarkh Vladimir Morozov Anupama Codippily <47591753+AnupamaCodippily@users.noreply.github.com> Greg Poole @@ -3464,5 +3464,22 @@ rikapo Meek Simbule <55823259+meekdenzo@users.noreply.github.com> Michael Ficarra hiroki osame +Eugene Chapko +Sergey Petushkov +Caleb Everett +JialuZhang-intel +Moshe Atlow +rubikscraft +James Scott-Brown +supriyo-biswas +Giacomo Gregoletto +italo jose +Kazuma Ohashi +Douglas Wilson <67512+dougwilson@users.noreply.github.com> +0xSanyam <108138884+0xSanyam@users.noreply.github.com> +Alena Khineika +Basit <1305718+mabaasit@users.noreply.github.com> +Kid <44045911+kidonng@users.noreply.github.com> +Jeremy Rose # Generated by tools/update-authors.mjs diff --git a/BUILDING.md b/BUILDING.md index f7b3efd099d1a6..c16f6ffde07d3f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -567,9 +567,9 @@ to run it again before invoking `make -j4`. * [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5) * The "Desktop development with C++" workload from - [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or + [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or the "C++ build tools" workload from the - [Build Tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019), + [Build Tools](https://aka.ms/vs/16/release/vs_buildtools.exe), with the default optional components * Basic Unix tools required for some tests, [Git for Windows](https://git-scm.com/download/win) includes Git Bash diff --git a/CHANGELOG.md b/CHANGELOG.md index bddf1fe09526fb..9227ff1cb0149d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,8 @@ release. -18.5.0
+18.6.0
+18.5.0
18.4.0
18.3.0
18.2.0
diff --git a/Makefile b/Makefile index 9f7ab7129d0647..e0d756fea3ac35 100644 --- a/Makefile +++ b/Makefile @@ -1096,7 +1096,7 @@ endif $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npm unlink $(MACOSOUTDIR)/dist/node/usr/local/bin/npx - $(NODE) tools/license2rtf.js < LICENSE > \ + $(NODE) tools/license2rtf.mjs < LICENSE > \ $(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources pkgbuild --version $(FULLVERSION) \ @@ -1429,8 +1429,8 @@ CLANG_FORMAT_START ?= HEAD # $ make format-cpp # To format HEAD~1...HEAD (latest commit): # $ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp -# To format diff between master and current branch head (master...HEAD): -# $ CLANG_FORMAT_START=master make format-cpp +# To format diff between main and current branch head (main...HEAD): +# $ CLANG_FORMAT_START=main make format-cpp format-cpp: ## Format C++ diff from $CLANG_FORMAT_START to current changes ifneq ("","$(wildcard tools/clang-format/node_modules/)") $(info Formatting C++ diff from $(CLANG_FORMAT_START)..) @@ -1440,7 +1440,7 @@ ifneq ("","$(wildcard tools/clang-format/node_modules/)") $(CLANG_FORMAT_START) -- \ $(LINT_CPP_FILES) else - $(info clang-format is not installed.) + $(info Required tooling for C++ code formatting is not installed.) $(info To install (requires internet access) run: $$ make format-cpp-build) endif diff --git a/README.md b/README.md index 3b0de86cf489ae..a82d6cc1d33aa9 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,8 @@ For information about the governance of the Node.js project, see **Danielle Adams** <> (she/her) * [fhinkel](https://github.com/fhinkel) - **Franziska Hinkelmann** <> (she/her) +* [GeoffreyBooth](https://github.com/geoffreybooth) - + **Geoffrey Booth** <> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** <> (he/him) * [jasnell](https://github.com/jasnell) - @@ -180,8 +182,6 @@ For information about the governance of the Node.js project, see **Matteo Collina** <> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <> (he/him) -* [MylesBorins](https://github.com/MylesBorins) - - **Myles Borins** <> (he/him) * [RaisinTen](https://github.com/RaisinTen) - **Darshan Sen** <> (he/him) * [richardlau](https://github.com/richardlau) - @@ -229,6 +229,8 @@ For information about the governance of the Node.js project, see **Mary Marchini** <> (she/her) * [mscdex](https://github.com/mscdex) - **Brian White** <> +* [MylesBorins](https://github.com/MylesBorins) - + **Myles Borins** <> (he/him) * [nebrius](https://github.com/nebrius) - **Bryan Hughes** <> * [ofrobots](https://github.com/ofrobots) - @@ -646,6 +648,8 @@ maintaining the Node.js project. * [Ayase-252](https://github.com/Ayase-252) - **Qingyu Deng** <> +* [daeyeon](https://github.com/daeyeon) - + **Daeyeon Jeong** <> (he/him) * [F3n67u](https://github.com/F3n67u) - **Feng Yu** <> (he/him) * [himadriganguly](https://github.com/himadriganguly) - diff --git a/benchmark/common.js b/benchmark/common.js index 88cb8a560f40e1..6ed230ffde4231 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -289,7 +289,15 @@ function formatResult(data) { function sendResult(data) { if (process.send) { // If forked, report by process send - process.send(data); + process.send(data, () => { + if (Object.hasOwn(process.env, 'NODE_RUN_BENCHMARK_FN')) { + // If, for any reason, the process is unable to self close within + // a second after completing, forcefully close it. + setTimeout(() => { + process.exit(0); + }, 5000).unref(); + } + }); } else { // Otherwise report by stdout process.stdout.write(formatResult(data)); diff --git a/benchmark/es/eval.js b/benchmark/es/eval.js new file mode 100644 index 00000000000000..b4c6ee2e0a64c7 --- /dev/null +++ b/benchmark/es/eval.js @@ -0,0 +1,46 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + method: ['without-sourcemap', 'sourcemap'], + n: [1e6], +}); + +const sourceWithoutSourceMap = ` +'use strict'; +(function() { + let a = 1; + for (let i = 0; i < 1000; i++) { + a++; + } + return a; +})(); +`; +const sourceWithSourceMap = ` +${sourceWithoutSourceMap} +//# sourceMappingURL=https://ci.nodejs.org/405 +`; + +function evalN(n, source) { + bench.start(); + for (let i = 0; i < n; i++) { + eval(source); + } + bench.end(n); +} + +function main({ n, method }) { + switch (method) { + case 'without-sourcemap': + process.setSourceMapsEnabled(false); + evalN(n, sourceWithoutSourceMap); + break; + case 'sourcemap': + process.setSourceMapsEnabled(true); + evalN(n, sourceWithSourceMap); + break; + default: + throw new Error(`Unexpected method "${method}"`); + } +} diff --git a/benchmark/tls/secure-pair.js b/benchmark/tls/secure-pair.js index 76658fc3c42ad7..08be1f7e46f8ba 100644 --- a/benchmark/tls/secure-pair.js +++ b/benchmark/tls/secure-pair.js @@ -25,6 +25,7 @@ function main({ dur, size, securing }) { isServer: true, requestCert: true, rejectUnauthorized: true, + maxVersion: 'TLSv1.2', }; const server = net.createServer(onRedirectConnection); @@ -38,6 +39,7 @@ function main({ dur, size, securing }) { cert: options.cert, isServer: false, rejectUnauthorized: false, + maxVersion: options.maxVersion, }; const network = securing === 'clear' ? net : tls; const conn = network.connect(clientOptions, () => { diff --git a/benchmark/tls/throughput-c2s.js b/benchmark/tls/throughput-c2s.js index f3a96abcbc0174..023b42cbeda685 100644 --- a/benchmark/tls/throughput-c2s.js +++ b/benchmark/tls/throughput-c2s.js @@ -33,7 +33,8 @@ function main({ dur, type, size }) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', + maxVersion: 'TLSv1.2', }; const server = tls.createServer(options, onConnection); diff --git a/benchmark/tls/throughput-s2c.js b/benchmark/tls/throughput-s2c.js index a505a719d30884..d3018cf851db75 100644 --- a/benchmark/tls/throughput-s2c.js +++ b/benchmark/tls/throughput-s2c.js @@ -40,7 +40,8 @@ function main({ dur, type, sendchunklen, recvbuflen, recvbufgenfn }) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', + maxVersion: 'TLSv1.2', }; let socketOpts; diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index 3fc2ecb614978b..db50306485aec3 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -21,7 +21,8 @@ function main(conf) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', + maxVersion: 'TLSv1.2', }; const server = tls.createServer(options, onConnection); diff --git a/deps/corepack/CHANGELOG.md b/deps/corepack/CHANGELOG.md index 1867c788f32932..5ff077fedddb57 100644 --- a/deps/corepack/CHANGELOG.md +++ b/deps/corepack/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [0.12.0](https://github.com/nodejs/corepack/compare/v0.11.2...v0.12.0) (2022-07-09) + + +### Features + +* add support for hash checking ([#133](https://github.com/nodejs/corepack/issues/133)) ([6a480a7](https://github.com/nodejs/corepack/commit/6a480a72c2e9fc6725f2ab6dfaf4c52e4d3d2ade)) +* add support for tags and ranges in `prepare` command ([#136](https://github.com/nodejs/corepack/issues/136)) ([29da06c](https://github.com/nodejs/corepack/commit/29da06c515e917829e5ffbedb34284a6597e9d56)) +* update package manager versions ([#129](https://github.com/nodejs/corepack/issues/129)) ([2470f58](https://github.com/nodejs/corepack/commit/2470f58b74491a1301221df643c55be5adf1d349)) +* update package manager versions ([#139](https://github.com/nodejs/corepack/issues/139)) ([cd0dcad](https://github.com/nodejs/corepack/commit/cd0dcade85621199048d7ca30dfc3efce11e1f37)) + + +### Bug Fixes + +* streamline the cache exploration ([#135](https://github.com/nodejs/corepack/issues/135)) ([185da44](https://github.com/nodejs/corepack/commit/185da44078fd1ca34aec2e4e6f8a52ecffcf3c11)) + ## [0.11.2](https://github.com/nodejs/corepack/compare/v0.11.1...v0.11.2) (2022-06-13) ### Bug Fixes diff --git a/deps/corepack/dist/corepack.js b/deps/corepack/dist/corepack.js index 3290a0ff392bb4..541cbeefa7203e 100755 --- a/deps/corepack/dist/corepack.js +++ b/deps/corepack/dist/corepack.js @@ -15068,7 +15068,7 @@ class Engine { if (typeof definition === `undefined`) throw new clipanion__WEBPACK_IMPORTED_MODULE_8__.UsageError(`This package manager (${descriptor.name}) isn't supported by this corepack build`); let finalDescriptor = descriptor; - if (descriptor.range.match(/^[a-z-]+$/)) { + if (/^[a-z-]+$/.test(descriptor.range)) { if (!allowTags) throw new clipanion__WEBPACK_IMPORTED_MODULE_8__.UsageError(`Packages managers can't be referended via tags in this context`); // We only resolve tags from the latest registry entry @@ -15087,6 +15087,10 @@ class Engine { const cachedVersion = await _corepackUtils__WEBPACK_IMPORTED_MODULE_4__.findInstalledVersion(_folderUtils__WEBPACK_IMPORTED_MODULE_5__.getInstallFolder(), finalDescriptor); if (cachedVersion !== null && useCache) return { name: finalDescriptor.name, reference: cachedVersion }; + // If the user asked for a specific version, no need to request the list of + // available versions from the registry. + if (semver__WEBPACK_IMPORTED_MODULE_2___default().valid(finalDescriptor.range)) + return { name: finalDescriptor.name, reference: finalDescriptor.range }; const candidateRangeDefinitions = Object.keys(definition.ranges).filter(range => { return _semverUtils__WEBPACK_IMPORTED_MODULE_6__.satisfiesWithPrereleases(finalDescriptor.range, range); }); @@ -15474,9 +15478,9 @@ class PrepareCommand extends clipanion__WEBPACK_IMPORTED_MODULE_3__.Command { } for (const request of specs) { const spec = typeof request === `string` - ? _specUtils__WEBPACK_IMPORTED_MODULE_2__.parseSpec(request, `CLI arguments`) + ? _specUtils__WEBPACK_IMPORTED_MODULE_2__.parseSpec(request, `CLI arguments`, { enforceExactVersion: false }) : request; - const resolved = await this.context.engine.resolveDescriptor(spec); + const resolved = await this.context.engine.resolveDescriptor(spec, { allowTags: true }); if (resolved === null) throw new clipanion__WEBPACK_IMPORTED_MODULE_3__.UsageError(`Failed to successfully resolve '${spec.range}' to a valid ${spec.name} release`); if (!this.json) { @@ -15530,6 +15534,9 @@ PrepareCommand.usage = clipanion__WEBPACK_IMPORTED_MODULE_3__.Command.Usage({ ], [ `Prepare a specific Yarn version`, `$0 prepare yarn@2.2.2`, + ], [ + `Prepare the latest available pnpm version`, + `$0 prepare pnpm@latest --activate`, ], [ `Generate an archive for a specific Yarn version`, `$0 prepare yarn@2.2.2 -o`, @@ -15557,17 +15564,30 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "installVersion": () => (/* binding */ installVersion), /* harmony export */ "runVersion": () => (/* binding */ runVersion) /* harmony export */ }); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ "fs"); -/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ "path"); -/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! semver */ "../../../.yarn/berry/cache/semver-npm-7.3.7-3bfe704194-9.zip/node_modules/semver/index.js"); -/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _debugUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./debugUtils */ "./sources/debugUtils.ts"); -/* harmony import */ var _folderUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./folderUtils */ "./sources/folderUtils.ts"); -/* harmony import */ var _fsUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./fsUtils */ "./sources/fsUtils.ts"); -/* harmony import */ var _httpUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./httpUtils */ "./sources/httpUtils.ts"); -/* harmony import */ var _nodeUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./nodeUtils */ "./sources/nodeUtils.ts"); +/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto */ "crypto"); +/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! events */ "events"); +/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! fs */ "fs"); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! path */ "path"); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! semver */ "../../../.yarn/berry/cache/semver-npm-7.3.7-3bfe704194-9.zip/node_modules/semver/index.js"); +/* harmony import */ var semver__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(semver__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _debugUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./debugUtils */ "./sources/debugUtils.ts"); +/* harmony import */ var _folderUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./folderUtils */ "./sources/folderUtils.ts"); +/* harmony import */ var _fsUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./fsUtils */ "./sources/fsUtils.ts"); +/* harmony import */ var _httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./httpUtils */ "./sources/httpUtils.ts"); +/* harmony import */ var _nodeUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./nodeUtils */ "./sources/nodeUtils.ts"); +var __asyncValues = (undefined && undefined.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; + + @@ -15579,11 +15599,11 @@ __webpack_require__.r(__webpack_exports__); async function fetchAvailableTags(spec) { switch (spec.type) { case `npm`: { - const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_6__.fetchAsJson(`https://registry.npmjs.org/${spec.package}`, { headers: { [`Accept`]: `application/vnd.npm.install-v1+json` } }); + const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_8__.fetchAsJson(`https://registry.npmjs.org/${spec.package}`, { headers: { [`Accept`]: `application/vnd.npm.install-v1+json` } }); return data[`dist-tags`]; } case `url`: { - const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_6__.fetchAsJson(spec.url); + const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_8__.fetchAsJson(spec.url); return data[spec.fields.tags]; } default: { @@ -15594,11 +15614,11 @@ async function fetchAvailableTags(spec) { async function fetchAvailableVersions(spec) { switch (spec.type) { case `npm`: { - const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_6__.fetchAsJson(`https://registry.npmjs.org/${spec.package}`, { headers: { [`Accept`]: `application/vnd.npm.install-v1+json` } }); + const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_8__.fetchAsJson(`https://registry.npmjs.org/${spec.package}`, { headers: { [`Accept`]: `application/vnd.npm.install-v1+json` } }); return Object.keys(data.versions); } case `url`: { - const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_6__.fetchAsJson(spec.url); + const data = await _httpUtils__WEBPACK_IMPORTED_MODULE_8__.fetchAsJson(spec.url); const field = data[spec.fields.versions]; return Array.isArray(field) ? field : Object.keys(field); } @@ -15608,76 +15628,97 @@ async function fetchAvailableVersions(spec) { } } async function findInstalledVersion(installTarget, descriptor) { - const installFolder = path__WEBPACK_IMPORTED_MODULE_1___default().join(installTarget, descriptor.name); - let folderContent; + var e_1, _a; + const installFolder = path__WEBPACK_IMPORTED_MODULE_3___default().join(installTarget, descriptor.name); + let cacheDirectory; try { - folderContent = await fs__WEBPACK_IMPORTED_MODULE_0___default().promises.readdir(installFolder); + cacheDirectory = await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.opendir(installFolder); } catch (error) { if (error.code === `ENOENT`) { - folderContent = []; + return null; } else { throw error; } } - const candidateVersions = []; - for (const entry of folderContent) { - // Some dot-folders tend to pop inside directories, especially on OSX - if (entry.startsWith(`.`)) - continue; - candidateVersions.push(entry); + const range = new (semver__WEBPACK_IMPORTED_MODULE_4___default().Range)(descriptor.range); + let bestMatch = null; + let maxSV = undefined; + try { + for (var cacheDirectory_1 = __asyncValues(cacheDirectory), cacheDirectory_1_1; cacheDirectory_1_1 = await cacheDirectory_1.next(), !cacheDirectory_1_1.done;) { + const { name } = cacheDirectory_1_1.value; + // Some dot-folders tend to pop inside directories, especially on OSX + if (name.startsWith(`.`)) + continue; + // If the dirname correspond to an in-range version and is not lower than + // the previous best match (or if there is not yet a previous best match), + // it's our new best match. + if (range.test(name) && (maxSV === null || maxSV === void 0 ? void 0 : maxSV.compare(name)) !== 1) { + bestMatch = name; + maxSV = new (semver__WEBPACK_IMPORTED_MODULE_4___default().SemVer)(bestMatch); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (cacheDirectory_1_1 && !cacheDirectory_1_1.done && (_a = cacheDirectory_1.return)) await _a.call(cacheDirectory_1); + } + finally { if (e_1) throw e_1.error; } } - const bestMatch = semver__WEBPACK_IMPORTED_MODULE_2___default().maxSatisfying(candidateVersions, descriptor.range); - if (bestMatch === null) - return null; return bestMatch; } async function installVersion(installTarget, locator, { spec }) { const { default: tar } = await Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! tar */ "../../../.yarn/berry/cache/tar-npm-6.1.11-e6ac3cba9c-9.zip/node_modules/tar/index.js", 19)); - const installFolder = path__WEBPACK_IMPORTED_MODULE_1___default().join(installTarget, locator.name, locator.reference); - if (fs__WEBPACK_IMPORTED_MODULE_0___default().existsSync(installFolder)) { - _debugUtils__WEBPACK_IMPORTED_MODULE_3__.log(`Reusing ${locator.name}@${locator.reference}`); + const { version, build } = semver__WEBPACK_IMPORTED_MODULE_4___default().parse(locator.reference); + const installFolder = path__WEBPACK_IMPORTED_MODULE_3___default().join(installTarget, locator.name, version); + if (fs__WEBPACK_IMPORTED_MODULE_2___default().existsSync(installFolder)) { + _debugUtils__WEBPACK_IMPORTED_MODULE_5__.log(`Reusing ${locator.name}@${locator.reference}`); return installFolder; } - const url = spec.url.replace(`{}`, locator.reference); + const url = spec.url.replace(`{}`, version); // Creating a temporary folder inside the install folder means that we // are sure it'll be in the same drive as the destination, so we can // just move it there atomically once we are done - const tmpFolder = _folderUtils__WEBPACK_IMPORTED_MODULE_4__.getTemporaryFolder(installTarget); - _debugUtils__WEBPACK_IMPORTED_MODULE_3__.log(`Installing ${locator.name}@${locator.reference} from ${url} to ${tmpFolder}`); - const stream = await _httpUtils__WEBPACK_IMPORTED_MODULE_6__.fetchUrlStream(url); + const tmpFolder = _folderUtils__WEBPACK_IMPORTED_MODULE_6__.getTemporaryFolder(installTarget); + _debugUtils__WEBPACK_IMPORTED_MODULE_5__.log(`Installing ${locator.name}@${version} from ${url} to ${tmpFolder}`); + const stream = await _httpUtils__WEBPACK_IMPORTED_MODULE_8__.fetchUrlStream(url); const parsedUrl = new URL(url); - const ext = path__WEBPACK_IMPORTED_MODULE_1___default().posix.extname(parsedUrl.pathname); + const ext = path__WEBPACK_IMPORTED_MODULE_3___default().posix.extname(parsedUrl.pathname); let outputFile = null; let sendTo; if (ext === `.tgz`) { sendTo = tar.x({ strip: 1, cwd: tmpFolder }); } else if (ext === `.js`) { - outputFile = path__WEBPACK_IMPORTED_MODULE_1___default().join(tmpFolder, path__WEBPACK_IMPORTED_MODULE_1___default().posix.basename(parsedUrl.pathname)); - sendTo = fs__WEBPACK_IMPORTED_MODULE_0___default().createWriteStream(outputFile); + outputFile = path__WEBPACK_IMPORTED_MODULE_3___default().join(tmpFolder, path__WEBPACK_IMPORTED_MODULE_3___default().posix.basename(parsedUrl.pathname)); + sendTo = fs__WEBPACK_IMPORTED_MODULE_2___default().createWriteStream(outputFile); } stream.pipe(sendTo); - await new Promise(resolve => { - sendTo.on(`finish`, resolve); - }); - await fs__WEBPACK_IMPORTED_MODULE_0___default().promises.mkdir(path__WEBPACK_IMPORTED_MODULE_1___default().dirname(installFolder), { recursive: true }); + const hash = build[0] + ? stream.pipe((0,crypto__WEBPACK_IMPORTED_MODULE_0__.createHash)(build[0])) + : null; + await (0,events__WEBPACK_IMPORTED_MODULE_1__.once)(sendTo, `finish`); + const actualHash = hash === null || hash === void 0 ? void 0 : hash.digest(`hex`); + if (actualHash !== build[1]) + throw new Error(`Mismatch hashes. Expected ${build[1]}, got ${actualHash}`); + await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.mkdir(path__WEBPACK_IMPORTED_MODULE_3___default().dirname(installFolder), { recursive: true }); try { - await fs__WEBPACK_IMPORTED_MODULE_0___default().promises.rename(tmpFolder, installFolder); + await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.rename(tmpFolder, installFolder); } catch (err) { if (err.code === `ENOTEMPTY` || // On Windows the error code is EPERM so we check if it is a directory - (err.code === `EPERM` && (await fs__WEBPACK_IMPORTED_MODULE_0___default().promises.stat(installFolder)).isDirectory())) { - _debugUtils__WEBPACK_IMPORTED_MODULE_3__.log(`Another instance of corepack installed ${locator.name}@${locator.reference}`); - await _fsUtils__WEBPACK_IMPORTED_MODULE_5__.rimraf(tmpFolder); + (err.code === `EPERM` && (await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.stat(installFolder)).isDirectory())) { + _debugUtils__WEBPACK_IMPORTED_MODULE_5__.log(`Another instance of corepack installed ${locator.name}@${locator.reference}`); + await _fsUtils__WEBPACK_IMPORTED_MODULE_7__.rimraf(tmpFolder); } else { throw err; } } - _debugUtils__WEBPACK_IMPORTED_MODULE_3__.log(`Install finished`); + _debugUtils__WEBPACK_IMPORTED_MODULE_5__.log(`Install finished`); return installFolder; } /** @@ -15688,36 +15729,36 @@ async function runVersion(installSpec, binName, args) { if (Array.isArray(installSpec.spec.bin)) { if (installSpec.spec.bin.some(bin => bin === binName)) { const parsedUrl = new URL(installSpec.spec.url); - const ext = path__WEBPACK_IMPORTED_MODULE_1___default().posix.extname(parsedUrl.pathname); + const ext = path__WEBPACK_IMPORTED_MODULE_3___default().posix.extname(parsedUrl.pathname); if (ext === `.js`) { - binPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(installSpec.location, path__WEBPACK_IMPORTED_MODULE_1___default().posix.basename(parsedUrl.pathname)); + binPath = path__WEBPACK_IMPORTED_MODULE_3___default().join(installSpec.location, path__WEBPACK_IMPORTED_MODULE_3___default().posix.basename(parsedUrl.pathname)); } } } else { for (const [name, dest] of Object.entries(installSpec.spec.bin)) { if (name === binName) { - binPath = path__WEBPACK_IMPORTED_MODULE_1___default().join(installSpec.location, dest); + binPath = path__WEBPACK_IMPORTED_MODULE_3___default().join(installSpec.location, dest); break; } } } if (!binPath) throw new Error(`Assertion failed: Unable to locate path for bin '${binName}'`); - _nodeUtils__WEBPACK_IMPORTED_MODULE_7__.registerV8CompileCache(); + _nodeUtils__WEBPACK_IMPORTED_MODULE_9__.registerV8CompileCache(); // We load the binary into the current process, // while making it think it was spawned. // Non-exhaustive list of requirements: // - Yarn uses process.argv[1] to determine its own path: https://github.com/yarnpkg/berry/blob/0da258120fc266b06f42aed67e4227e81a2a900f/packages/yarnpkg-cli/sources/main.ts#L80 // - pnpm uses `require.main == null` to determine its own version: https://github.com/pnpm/pnpm/blob/e2866dee92991e979b2b0e960ddf5a74f6845d90/packages/cli-meta/src/index.ts#L14 - process.env.COREPACK_ROOT = path__WEBPACK_IMPORTED_MODULE_1___default().dirname(eval(`__dirname`)); + process.env.COREPACK_ROOT = path__WEBPACK_IMPORTED_MODULE_3___default().dirname(eval(`__dirname`)); process.argv = [ process.execPath, binPath, ...args, ]; process.execArgv = []; - return _nodeUtils__WEBPACK_IMPORTED_MODULE_7__.loadMainModule(binPath); + return _nodeUtils__WEBPACK_IMPORTED_MODULE_9__.loadMainModule(binPath); } @@ -16181,12 +16222,12 @@ __webpack_require__.r(__webpack_exports__); const nodeModulesRegExp = /[\\/]node_modules[\\/](@[^\\/]*[\\/])?([^@\\/][^\\/]*)$/; -function parseSpec(raw, source) { +function parseSpec(raw, source, { enforceExactVersion = true } = {}) { if (typeof raw !== `string`) throw new clipanion__WEBPACK_IMPORTED_MODULE_4__.UsageError(`Invalid package manager specification in ${source}; expected a string`); const match = raw.match(/^(?!_)(.+)@(.+)$/); - if (match === null || !semver__WEBPACK_IMPORTED_MODULE_2___default().valid(match[2])) - throw new clipanion__WEBPACK_IMPORTED_MODULE_4__.UsageError(`Invalid package manager specification in ${source}; expected a semver version`); + if (match === null || (enforceExactVersion && !semver__WEBPACK_IMPORTED_MODULE_2___default().valid(match[2]))) + throw new clipanion__WEBPACK_IMPORTED_MODULE_4__.UsageError(`Invalid package manager specification in ${source}; expected a semver version${enforceExactVersion ? `` : `, range, or tag`}`); if (!(0,_types__WEBPACK_IMPORTED_MODULE_3__.isSupportedPackageManager)(match[1])) throw new clipanion__WEBPACK_IMPORTED_MODULE_4__.UsageError(`Unsupported package manager specification (${match})`); return { @@ -16795,7 +16836,7 @@ const supportsColor = { /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.12.1","transparent":{"commands":[["npm","init"],["npx"]]},"ranges":{"*":{"url":"https://registry.npmjs.org/npm/-/npm-{}.tgz","bin":{"npm":"./bin/npm-cli.js","npx":"./bin/npx-cli.js"},"registry":{"type":"npm","package":"npm"}}}},"pnpm":{"default":"7.2.1","transparent":{"commands":[["pnpm","init"],["pnpx"],["pnpm","dlx"]]},"ranges":{"<6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.js","pnpx":"./bin/pnpx.js"},"registry":{"type":"npm","package":"pnpm"}},">=6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.cjs","pnpx":"./bin/pnpx.cjs"},"registry":{"type":"npm","package":"pnpm"}}}},"yarn":{"default":"1.22.19","transparent":{"default":"3.2.1","commands":[["yarn","dlx"]]},"ranges":{"<2.0.0":{"url":"https://registry.yarnpkg.com/yarn/-/yarn-{}.tgz","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"registry":{"type":"npm","package":"yarn"}},">=2.0.0":{"name":"yarn","url":"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js","bin":["yarn","yarnpkg"],"registry":{"type":"url","url":"https://repo.yarnpkg.com/tags","fields":{"tags":"latest","versions":"tags"}}}}}}}'); +module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.13.2+sha1.d79c851c1d9cc6c11efe708379fd5339580f8fec","transparent":{"commands":[["npm","init"],["npx"]]},"ranges":{"*":{"url":"https://registry.npmjs.org/npm/-/npm-{}.tgz","bin":{"npm":"./bin/npm-cli.js","npx":"./bin/npx-cli.js"},"registry":{"type":"npm","package":"npm"}}}},"pnpm":{"default":"7.5.0+sha1.d9fda828c036a7284bb8aa04c545691029dc75ae","transparent":{"commands":[["pnpm","init"],["pnpx"],["pnpm","dlx"]]},"ranges":{"<6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.js","pnpx":"./bin/pnpx.js"},"registry":{"type":"npm","package":"pnpm"}},">=6.0.0":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.cjs","pnpx":"./bin/pnpx.cjs"},"registry":{"type":"npm","package":"pnpm"}}}},"yarn":{"default":"1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447","transparent":{"default":"3.2.1+sha1.712f0d3e236f0705a55d2b7c9be47a717d68dbef","commands":[["yarn","dlx"]]},"ranges":{"<2.0.0":{"url":"https://registry.yarnpkg.com/yarn/-/yarn-{}.tgz","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"registry":{"type":"npm","package":"yarn"}},">=2.0.0":{"name":"yarn","url":"https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js","bin":["yarn","yarnpkg"],"registry":{"type":"url","url":"https://repo.yarnpkg.com/tags","fields":{"tags":"latest","versions":"tags"}}}}}}}'); /***/ }), @@ -16806,7 +16847,7 @@ module.exports = JSON.parse('{"definitions":{"npm":{"default":"8.12.1","transpar /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"corepack","version":"0.11.2","homepage":"https://github.com/nodejs/corepack#readme","bugs":{"url":"https://github.com/nodejs/corepack/issues"},"repository":{"type":"git","url":"https://github.com/nodejs/corepack.git"},"license":"MIT","packageManager":"yarn@4.0.0-rc.6","devDependencies":{"@babel/core":"^7.14.3","@babel/plugin-transform-modules-commonjs":"^7.14.0","@babel/preset-typescript":"^7.13.0","@types/debug":"^4.1.5","@types/jest":"^27.0.0","@types/node":"^17.0.10","@types/semver":"^7.1.0","@types/tar":"^6.0.0","@types/which":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","@yarnpkg/eslint-config":"^1.0.0-rc.5","@yarnpkg/fslib":"^2.1.0","@zkochan/cmd-shim":"^5.0.0","babel-plugin-dynamic-import-node":"^2.3.3","clipanion":"^3.0.1","debug":"^4.1.1","eslint":"^8.0.0","eslint-plugin-arca":"^0.15.0","jest":"^28.0.0","nock":"^13.0.4","proxy-agent":"^5.0.0","semver":"^7.1.3","supports-color":"^9.0.0","tar":"^6.0.1","terser-webpack-plugin":"^5.1.2","ts-loader":"^9.0.0","ts-node":"^10.0.0","typescript":"^4.3.2","v8-compile-cache":"^2.3.0","webpack":"^5.38.1","webpack-cli":"^4.0.0","which":"^2.0.2"},"scripts":{"build":"rm -rf dist shims && webpack && ts-node ./mkshims.ts","corepack":"ts-node ./sources/_entryPoint.ts","lint":"yarn eslint","prepack":"yarn build","postpack":"rm -rf dist shims","typecheck":"tsc --noEmit","test":"yarn jest"},"files":["dist","shims","LICENSE.md"],"publishConfig":{"bin":{"corepack":"./dist/corepack.js","pnpm":"./dist/pnpm.js","pnpx":"./dist/pnpx.js","yarn":"./dist/yarn.js","yarnpkg":"./dist/yarnpkg.js"},"executableFiles":["./dist/npm.js","./dist/npx.js","./dist/pnpm.js","./dist/pnpx.js","./dist/yarn.js","./dist/yarnpkg.js","./dist/corepack.js","./shims/npm","./shims/npm.ps1","./shims/npx","./shims/npx.ps1","./shims/pnpm","./shims/pnpm.ps1","./shims/pnpx","./shims/pnpx.ps1","./shims/yarn","./shims/yarn.ps1","./shims/yarnpkg","./shims/yarnpkg.ps1"]},"resolutions":{"vm2":"patch:vm2@npm:3.9.9#.yarn/patches/vm2-npm-3.9.9-03fd1f4dc5.patch"}}'); +module.exports = JSON.parse('{"name":"corepack","version":"0.12.0","homepage":"https://github.com/nodejs/corepack#readme","bugs":{"url":"https://github.com/nodejs/corepack/issues"},"repository":{"type":"git","url":"https://github.com/nodejs/corepack.git"},"license":"MIT","packageManager":"yarn@4.0.0-rc.6","devDependencies":{"@babel/core":"^7.14.3","@babel/plugin-transform-modules-commonjs":"^7.14.0","@babel/preset-typescript":"^7.13.0","@types/debug":"^4.1.5","@types/jest":"^27.0.0","@types/node":"^17.0.10","@types/semver":"^7.1.0","@types/tar":"^6.0.0","@types/which":"^2.0.0","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","@yarnpkg/eslint-config":"^1.0.0-rc.5","@yarnpkg/fslib":"^2.1.0","@zkochan/cmd-shim":"^5.0.0","babel-plugin-dynamic-import-node":"^2.3.3","clipanion":"^3.0.1","debug":"^4.1.1","eslint":"^8.0.0","eslint-plugin-arca":"^0.15.0","jest":"^28.0.0","nock":"^13.0.4","proxy-agent":"^5.0.0","semver":"^7.1.3","supports-color":"^9.0.0","tar":"^6.0.1","terser-webpack-plugin":"^5.1.2","ts-loader":"^9.0.0","ts-node":"^10.0.0","typescript":"^4.3.2","v8-compile-cache":"^2.3.0","webpack":"^5.38.1","webpack-cli":"^4.0.0","which":"^2.0.2"},"scripts":{"build":"rm -rf dist shims && webpack && ts-node ./mkshims.ts","corepack":"ts-node ./sources/_entryPoint.ts","lint":"yarn eslint","prepack":"yarn build","postpack":"rm -rf dist shims","typecheck":"tsc --noEmit","test":"yarn jest"},"files":["dist","shims","LICENSE.md"],"publishConfig":{"bin":{"corepack":"./dist/corepack.js","pnpm":"./dist/pnpm.js","pnpx":"./dist/pnpx.js","yarn":"./dist/yarn.js","yarnpkg":"./dist/yarnpkg.js"},"executableFiles":["./dist/npm.js","./dist/npx.js","./dist/pnpm.js","./dist/pnpx.js","./dist/yarn.js","./dist/yarnpkg.js","./dist/corepack.js","./shims/npm","./shims/npm.ps1","./shims/npx","./shims/npx.ps1","./shims/pnpm","./shims/pnpm.ps1","./shims/pnpx","./shims/pnpx.ps1","./shims/yarn","./shims/yarn.ps1","./shims/yarnpkg","./shims/yarnpkg.ps1"]},"resolutions":{"vm2":"patch:vm2@npm:3.9.9#.yarn/patches/vm2-npm-3.9.9-03fd1f4dc5.patch"}}'); /***/ }) diff --git a/deps/corepack/package.json b/deps/corepack/package.json index f5e5c12ba933a9..b0591ef89e9cf6 100644 --- a/deps/corepack/package.json +++ b/deps/corepack/package.json @@ -1,6 +1,6 @@ { "name": "corepack", - "version": "0.11.2", + "version": "0.12.0", "homepage": "https://github.com/nodejs/corepack#readme", "bugs": { "url": "https://github.com/nodejs/corepack/issues" diff --git a/deps/npm/docs/content/commands/npm-cache.md b/deps/npm/docs/content/commands/npm-cache.md index 091e26e8a71828..b5eddd46c05a7d 100644 --- a/deps/npm/docs/content/commands/npm-cache.md +++ b/deps/npm/docs/content/commands/npm-cache.md @@ -11,11 +11,7 @@ description: Manipulates packages cache ```bash -npm cache add -npm cache add -npm cache add -npm cache add -npm cache add @ +npm cache add npm cache clean [] npm cache ls [@] npm cache verify @@ -101,6 +97,7 @@ cache`](/commands/npm-cache) ### See Also +* [package spec](/using-npm/package-spec) * [npm folders](/configuring-npm/folders) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 3374bf1e25136b..9b8238d05a3b91 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -133,7 +133,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index 4345120d3744b3..20f65140fc735f 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -11,7 +11,7 @@ description: Deprecate a version of a package ```bash -npm deprecate [@] +npm deprecate ``` @@ -45,8 +45,8 @@ In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. You must be the package owner to deprecate something. See the `owner` and `adduser` help topics. -To un-deprecate a package, specify an empty string (`""`) for the `message` -argument. Note that you must use double quotes with no space between them to +To un-deprecate a package, specify an empty string (`""`) for the `message` +argument. Note that you must use double quotes with no space between them to format an empty string. ### Configuration @@ -82,6 +82,7 @@ password, npm will prompt on the command line for one. ### See Also +* [package spec](/using-npm/package-spec) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) * [npm owner](/commands/npm-owner) diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index b9caf1fbe7fa9c..123e67dbf3b235 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -11,9 +11,9 @@ description: Modify package distribution tags ```bash -npm dist-tag add @ [] -npm dist-tag rm -npm dist-tag ls [] +npm dist-tag add [] +npm dist-tag rm +npm dist-tag ls [] alias: dist-tags ``` @@ -27,11 +27,11 @@ alias: dist-tags Add, remove, and enumerate distribution tags on a package: -* add: Tags the specified version of the package with the specified tag, or - the `--tag` config if not specified. If you have two-factor - authentication on auth-and-writes then you’ll need to include a one-time - password on the command line with `--otp `, or at the - OTP prompt. +* add: Tags the specified version of the package with the specified tag, + or the `--tag` config if not specified. If you have two-factor + authentication on auth-and-writes then you’ll need to include a + one-time password on the command line with + `--otp `, or at the OTP prompt. * rm: Clear a tag that is no longer in use from the package. If you have two-factor authentication on auth-and-writes then you’ll need to include @@ -168,6 +168,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm publish](/commands/npm-publish) * [npm install](/commands/npm-install) * [npm dedupe](/commands/npm-dedupe) diff --git a/deps/npm/docs/content/commands/npm-explain.md b/deps/npm/docs/content/commands/npm-explain.md index 765221056585d9..5ba2fe8206ba16 100644 --- a/deps/npm/docs/content/commands/npm-explain.md +++ b/deps/npm/docs/content/commands/npm-explain.md @@ -11,7 +11,7 @@ description: Explain installed packages ```bash -npm explain +npm explain alias: why ``` @@ -26,9 +26,10 @@ alias: why This command will print the chain of dependencies causing a given package to be installed in the current project. -Positional arguments can be either folders within `node_modules`, or -`name@version-range` specifiers, which will select the dependency -relationships to explain. +If one or more package specs are provided, then only packages matching +one of the specifiers will have their relationships explained. + +The package spec can also refer to a folder within `./node_modules` For example, running `npm explain glob` within npm's source tree will show: @@ -110,6 +111,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) * [npm folders](/configuring-npm/folders) diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 5b96e91ab8ccb9..8db0ce910de967 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -11,7 +11,7 @@ description: Retrieve funding information ```bash -npm fund [[<@scope>/]] +npm fund [] ``` @@ -23,22 +23,22 @@ npm fund [[<@scope>/]] This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all -dependencies that are looking for funding in a tree structure, listing the -type of funding and the url to visit. If a package name is provided then it -tries to open its funding url using the `--browser` config param; if there -are multiple funding sources for the package, the user will be instructed -to pass the `--which` option to disambiguate. +dependencies that are looking for funding in a tree structure, listing +the type of funding and the url to visit. If a package name is provided +then it tries to open its funding url using the `--browser` config +param; if there are multiple funding sources for the package, the user +will be instructed to pass the `--which` option to disambiguate. The list will avoid duplicated entries and will stack all packages that -share the same url as a single entry. Thus, the list does not have the same -shape of the output from `npm ls`. +share the same url as a single entry. Thus, the list does not have the +same shape of the output from `npm ls`. #### Example ### Workspaces support -It's possible to filter the results to only include a single workspace and its -dependencies using the `workspace` config option. +It's possible to filter the results to only include a single workspace +and its dependencies using the `workspace` config option. #### Example: @@ -58,8 +58,8 @@ test-workspaces-fund@1.0.0 `-- bar@2.0.0 ``` -And here is an example of the expected result when filtering only by -a specific workspace `a` in the same project: +And here is an example of the expected result when filtering only by a +specific workspace `a` in the same project: ```bash $ npm fund -w a @@ -156,6 +156,7 @@ If there are multiple funding sources, which 1-indexed source URL to open. ## See Also +* [package spec](/using-npm/package-spec) * [npm install](/commands/npm-install) * [npm docs](/commands/npm-docs) * [npm ls](/commands/npm-ls) diff --git a/deps/npm/docs/content/commands/npm-init.md b/deps/npm/docs/content/commands/npm-init.md index 35343cceb4aa13..cd0be4643e0ead 100644 --- a/deps/npm/docs/content/commands/npm-init.md +++ b/deps/npm/docs/content/commands/npm-init.md @@ -11,9 +11,8 @@ description: Create a package.json file ```bash -npm init [--force|-f|--yes|-y|--scope] +npm init (same as `npx ) npm init <@scope> (same as `npx <@scope>/create`) -npm init [<@scope>/] (same as `npx [<@scope>/]create-`) aliases: create, innit ``` @@ -204,6 +203,39 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + @@ -284,6 +316,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [init-package-json module](http://npm.im/init-package-json) * [package.json](/configuring-npm/package-json) * [npm version](/commands/npm-version) 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 0d9470acf58b3d..74ed4667e81bfe 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -79,7 +79,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index 3dd860ea5c6f68..d27686e731ce16 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -11,16 +11,7 @@ description: Install package(s) and run tests ```bash -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: it ``` diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index d6668a2c2bd0fb..7e5544f85e3dda 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -11,16 +11,7 @@ description: Install a package ```bash -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 [ ...] aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall ``` diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 975c807c38b348..8c1b422493bd57 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -11,8 +11,7 @@ description: Symlink a package folder ```bash -npm link (in package dir) -npm link [<@scope>/][@] +npm link [] alias: ln ``` @@ -29,11 +28,11 @@ test iteratively without having to continually rebuild. Package linking is a two-step process. -First, `npm link` in a package folder will create a symlink in the global -folder `{prefix}/lib/node_modules/` that links to the package -where the `npm link` command was executed. It will also link any bins in -the package to `{prefix}/bin/{name}`. Note that `npm link` uses the global -prefix (see `npm prefix -g` for its value). +First, `npm link` in a package folder with no arguments will create a +symlink in the global folder `{prefix}/lib/node_modules/` that +links to the package where the `npm link` command was executed. It will +also link any bins in the package to `{prefix}/bin/{name}`. Note that +`npm link` uses the global prefix (see `npm prefix -g` for its value). Next, in some other location, `npm link package-name` will create a symbolic link from globally-installed `package-name` to `node_modules/` of @@ -399,6 +398,7 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm developers](/using-npm/developers) * [package.json](/configuring-npm/package-json) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index ded8c0c0d26ef1..a97c5168e6e0b4 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -11,7 +11,7 @@ description: List installed packages ```bash -npm ls [[<@scope>/] ...] +npm ls alias: list ``` @@ -301,6 +301,7 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm explain](/commands/npm-explain) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md index 6fa026550e7477..c4e07a0cd36f02 100644 --- a/deps/npm/docs/content/commands/npm-outdated.md +++ b/deps/npm/docs/content/commands/npm-outdated.md @@ -11,7 +11,7 @@ description: Check for outdated packages ```bash -npm outdated [[<@scope>/] ...] +npm outdated [ ...] ``` @@ -192,6 +192,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm update](/commands/npm-update) * [npm dist-tag](/commands/npm-dist-tag) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 72dfe6a22d01b0..ebc29ef6939392 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -11,9 +11,9 @@ description: Manage package owners ```bash -npm owner add [<@scope>/] -npm owner rm [<@scope>/] -npm owner ls [<@scope>/] +npm owner add +npm owner rm +npm owner ls alias: author ``` @@ -123,6 +123,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm profile](/commands/npm-profile) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-pack.md b/deps/npm/docs/content/commands/npm-pack.md index fa6c005e9d2287..7921042eae8fe0 100644 --- a/deps/npm/docs/content/commands/npm-pack.md +++ b/deps/npm/docs/content/commands/npm-pack.md @@ -11,7 +11,7 @@ description: Create a tarball from a package ```bash -npm pack [[<@scope>/]...] +npm pack ``` @@ -144,6 +144,7 @@ If no arguments are supplied, then npm packs the current package folder. ### See Also +* [package spec](/using-npm/package-spec) * [npm-packlist package](http://npm.im/npm-packlist) * [npm cache](/commands/npm-cache) * [npm publish](/commands/npm-publish) diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 2995f6bc81551e..536d04988e6849 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -11,7 +11,7 @@ description: Publish a package ```bash -npm publish [] +npm publish ``` @@ -23,42 +23,26 @@ npm publish [] Publishes a package to the registry so that it can be installed by name. -By default npm will publish to the public registry. This can be overridden -by specifying a different default registry or using a -[`scope`](/using-npm/scope) in the name (see +By default npm will publish to the public registry. This can be +overridden by specifying a different default registry or using a +[`scope`](/using-npm/scope) in the name, combined with a +scope-configured registry (see [`package.json`](/configuring-npm/package-json)). -* ``: A folder containing a package.json file -* ``: A url or file path to a gzipped tar archive containing a - single folder with a package.json file inside. +A `package` is interpreted the same way as other commands (like +`npm install` and can be: -* `[--tag ]`: Registers the published package with the given tag, such - that `npm install @` will install this version. By default, - `npm publish` updates and `npm install` installs the `latest` tag. See - [`npm-dist-tag`](npm-dist-tag) for details about tags. - -* `[--access ]`: Tells the registry whether this package - should be published as public or restricted. Only applies to scoped - packages, which default to `restricted`. If you don't have a paid - account, you must publish with `--access public` to publish scoped - packages. - -* `[--otp ]`: If you have two-factor authentication enabled in - `auth-and-writes` mode then you can provide a code from your - authenticator with this. If you don't include this and you're running - from a TTY then you'll be prompted. - -* `[--dry-run]`: As of `npm@6`, does everything publish would do except - actually publishing to the registry. Reports the details of what would - have been published. - -* `[--workspaces]`: Enables workspace context while publishing. All - workspace packages will be published. - -* `[--workspace]`: Enables workspaces context and limits results to only - those specified by this config item. Only the packages in the - workspaces given will be published. +* a) a folder containing a program described by a + [`package.json`](/configuring-npm/package-json) file +* b) a gzipped tarball containing (a) +* c) a url that resolves to (b) +* d) a `@` that is published on the registry (see + [`registry`](/using-npm/registry)) with (c) +* e) a `@` (see [`npm dist-tag`](/commands/npm-dist-tag)) that + points to (d) +* f) a `` that has a "latest" tag satisfying (e) +* g) a `` that resolves to (a) The publish will fail if the package name and version combination already exists in the specified registry. @@ -247,6 +231,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm-packlist package](http://npm.im/npm-packlist) * [npm registry](/using-npm/registry) * [npm scope](/using-npm/scope) diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 52c368c8c513b9..6a396421213d3d 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -11,7 +11,7 @@ description: Rebuild a package ```bash -npm rebuild [[<@scope>/][@] ...] +npm rebuild [] ...] alias: rb ``` @@ -29,9 +29,8 @@ C++ addons with the new binary. It is also useful when installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins. -If one or more package names (and optionally version ranges) are provided, -then only packages with a name and version matching one of the specifiers -will be rebuilt. +If one or more package specs are provided, then only packages with a +name and version matching one of the specifiers will be rebuilt. ### Configuration @@ -178,4 +177,5 @@ symlink. This option has no effect on workspaces. ### See Also +* [package spec](/using-npm/package-spec) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-restart.md b/deps/npm/docs/content/commands/npm-restart.md index f01cd014e74357..048bebb1659bd3 100644 --- a/deps/npm/docs/content/commands/npm-restart.md +++ b/deps/npm/docs/content/commands/npm-restart.md @@ -69,7 +69,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 73c4b1c7a748a7..f606ec6bf59e5e 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -240,13 +240,28 @@ will *not* run any pre- or post-scripts. +#### `foreground-scripts` + +* Default: false +* Type: Boolean + +Run all build scripts (ie, `preinstall`, `install`, and `postinstall`) +scripts for installed packages in the foreground process, sharing standard +input, output, and error with the main npm process. + +Note that this will generally make installs run slower, and be much noisier, +but can be useful for debugging. + + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-star.md b/deps/npm/docs/content/commands/npm-star.md index 00ef17a816b4ae..3e81c6a55bbb05 100644 --- a/deps/npm/docs/content/commands/npm-star.md +++ b/deps/npm/docs/content/commands/npm-star.md @@ -11,7 +11,7 @@ description: Mark your favorite packages ```bash -npm star [...] +npm star [...] ``` @@ -87,6 +87,7 @@ password, npm will prompt on the command line for one. ### See Also +* [package spec](/using-npm/package-spec) * [npm unstar](/commands/npm-unstar) * [npm stars](/commands/npm-stars) * [npm view](/commands/npm-view) diff --git a/deps/npm/docs/content/commands/npm-start.md b/deps/npm/docs/content/commands/npm-start.md index 8dd874b3c7d291..148f92606d83fb 100644 --- a/deps/npm/docs/content/commands/npm-start.md +++ b/deps/npm/docs/content/commands/npm-start.md @@ -80,7 +80,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-stop.md b/deps/npm/docs/content/commands/npm-stop.md index 9a3a55cf3f20e6..a3084e8432ba77 100644 --- a/deps/npm/docs/content/commands/npm-stop.md +++ b/deps/npm/docs/content/commands/npm-stop.md @@ -73,7 +73,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-test.md b/deps/npm/docs/content/commands/npm-test.md index 8a343ab299b34c..72bb899d0b9165 100644 --- a/deps/npm/docs/content/commands/npm-test.md +++ b/deps/npm/docs/content/commands/npm-test.md @@ -70,7 +70,7 @@ will *not* run any pre- or post-scripts. * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/commands/npm-unpublish.md b/deps/npm/docs/content/commands/npm-unpublish.md index a4c481ea5af7f7..9ad99e72a5a8e0 100644 --- a/deps/npm/docs/content/commands/npm-unpublish.md +++ b/deps/npm/docs/content/commands/npm-unpublish.md @@ -11,7 +11,7 @@ description: Remove a package from the registry ```bash -npm unpublish [<@scope>/][@] +npm unpublish [] ``` @@ -146,6 +146,7 @@ This value is not exported to the environment for child processes. ### See Also +* [package spec](/using-npm/package-spec) * [npm deprecate](/commands/npm-deprecate) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) diff --git a/deps/npm/docs/content/commands/npm-unstar.md b/deps/npm/docs/content/commands/npm-unstar.md index 76202190da8c35..636e1b6ac0a947 100644 --- a/deps/npm/docs/content/commands/npm-unstar.md +++ b/deps/npm/docs/content/commands/npm-unstar.md @@ -11,7 +11,7 @@ description: Remove an item from your favorite packages ```bash -npm unstar [...] +npm unstar [...] ``` diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index 0ef17d8adfb39b..d9d1daac0cda7d 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -11,7 +11,7 @@ description: View registry info ```bash -npm view [<@scope>/][@] [[.subfield]...] +npm view [] [[.subfield]...] aliases: info, show, v ``` @@ -203,6 +203,7 @@ the field name. ### See Also +* [package spec](/using-npm/package-spec) * [npm search](/commands/npm-search) * [npm registry](/using-npm/registry) * [npm config](/commands/npm-config) diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 8b188cfb0b9380..64081350af271f 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -222,7 +222,7 @@ npm also sets a top-level "maintainers" field with your npm user info. ### funding -You can specify an object containing an URL that provides up-to-date +You can specify an object containing a URL that provides up-to-date information about ways to help fund development of your package, or a string URL, or an array of these: diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 6ef854eb6e0ff4..3fb431402669f5 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -1518,7 +1518,7 @@ npm init --scope=@foo --yes * Type: null or String The shell to use for scripts run with the `npm exec`, `npm run` and `npm -init ` commands. +init ` commands. diff --git a/deps/npm/docs/content/using-npm/package-spec.md b/deps/npm/docs/content/using-npm/package-spec.md new file mode 100644 index 00000000000000..0d3741018f036f --- /dev/null +++ b/deps/npm/docs/content/using-npm/package-spec.md @@ -0,0 +1,106 @@ +--- +title: package-spec +section: 7 +description: Package name specifier +--- + + +### Description + +Commands like `npm install` and the dependency sections in the +`package.json` use a package name specifier. This can be many different +things that all refer to a "package". Examples include a package name, +git url, tarball, or local directory. These will generally be referred +to as `` in the help output for the npm commands that use +this package name specifier. + +### Package name + +* `[<@scope>/]` +* `[<@scope>/]@` +* `[<@scope>/]@` +* `[<@scope>/]@` + +Refers to a package by name, with or without a scope, and optionally +tag, version, or version range. This is typically used in combination +with the [registry](/using-npm/config#registry) config to refer to a +package in a registry. + +Examples: +* `npm` +* `@npmcli/arborist` +* `@npmcli/arborist@latest` +* `npm@6.13.1` +* `npm@^4.0.0` + +### Aliases + +* `@npm:` + +Primarily used by commands like `npm install` and in the dependency +sections in the `package.json`, this refers to a package by an alias. +The `` is the name of the package as it is reified in the +`node_modules` folder, and the `` refers to a package name as +found in the configured registry. + +See `Package name` above for more info on referring to a package by +name, and [registry](/using-npm/config#registry) for configuring which +registry is used when referring to a package by name. + +Examples: +* `semver:@npm:@npmcli/semver-with-patch` +* `semver:@npm:semver@7.2.2` +* `semver:@npm:semver@legacy` + +### Folders + +* `` + +This refers to a package on the local filesystem. Specifically this is +a folder with a `package.json` file in it. This *should* always be +prefixed with a `/` or `./` (or your OS equivalent) to reduce confusion. +npm currently will parse a string with more than one `/` in it as a +folder, but this is legacy behavior that may be removed in a future +version. + +Examples: + +* `./my-package` +* `/opt/npm/my-package` + +### Tarballs + +* `` +* `` + +Examples: + +* `./my-package.tgz` +* `https://registry.npmjs.org/semver/-/semver-1.0.0.tgz` + +Refers to a package in a tarball format, either on the local filesystem +or remotely via url. This is the format that packages exist in when +uploaded to a registry. + +### git urls + +* `` +* `/` + +Refers to a package in a git repo. This can be a full git url, git +shorthand, or a username/package on GitHub. You can specify a +git tag, branch, or other git ref by appending `#ref`. + +Examples: + +* `https://github.com/npm/cli.git` +* `git@github.com:npm/cli.git` +* `git+ssh://git@github.com/npm/cli#v6.0.0` +* `github:npm/cli#HEAD` +* `npm/cli#c12ea07` + +### See also + +[npm-package-arg](https://npm.im/npm-package-arg) +[scope](/using-npm/scope) +[config](/using-npm/config) diff --git a/deps/npm/docs/output/commands/npm-cache.html b/deps/npm/docs/output/commands/npm-cache.html index c5d6869b343be2..ad29cc73819d58 100644 --- a/deps/npm/docs/output/commands/npm-cache.html +++ b/deps/npm/docs/output/commands/npm-cache.html @@ -149,11 +149,7 @@

Table of contents

-
npm cache add <tarball file>
-npm cache add <folder>
-npm cache add <tarball url>
-npm cache add <git url>
-npm cache add <name>@<version>
+
npm cache add <package-spec>
 npm cache clean [<key>]
 npm cache ls [<name>@<version>]
 npm cache verify
@@ -224,6 +220,7 @@ 

cache

See Also

    +
  • package spec
  • npm folders
  • npm config
  • npmrc
  • diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index 4f9a194ae57e54..abc8ce6deb0e31 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -245,7 +245,7 @@

    script-shell

  • Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  • Type: null or String
-

The shell to use for scripts run with the npm exec, npm run and npm init <pkg> commands.

+

The shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands.

diff --git a/deps/npm/docs/output/commands/npm-deprecate.html b/deps/npm/docs/output/commands/npm-deprecate.html index 52a9ef82c30e24..5b1d3489ca6157 100644 --- a/deps/npm/docs/output/commands/npm-deprecate.html +++ b/deps/npm/docs/output/commands/npm-deprecate.html @@ -149,7 +149,7 @@

Table of contents

-
npm deprecate <pkg>[@<version>] <message>
+
npm deprecate <package-spec> <message>
 
@@ -198,6 +198,7 @@

otp

See Also