From 82f69d90d58da8cc2a53570bfe2a1a9cc2574f0d Mon Sep 17 00:00:00 2001 From: Eric Mutta Date: Thu, 5 Jan 2023 02:08:40 +0300 Subject: [PATCH 001/868] docs: fix typo in registry.md This: > ...is has the... Should be: > ...it has the... --- docs/lib/content/using-npm/registry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lib/content/using-npm/registry.md b/docs/lib/content/using-npm/registry.md index 8d5ac94160b33..035ede5b32a3a 100644 --- a/docs/lib/content/using-npm/registry.md +++ b/docs/lib/content/using-npm/registry.md @@ -35,7 +35,7 @@ Authentication configuration such as auth tokens and certificates are configured specifically scoped to an individual registry. See [Auth Related Configuration](/configuring-npm/npmrc#auth-related-configuration) -When the default registry is used in a package-lock or shrinkwrap is has the +When the default registry is used in a package-lock or shrinkwrap it has the special meaning of "the currently configured registry". If you create a lock file while using the default registry you can switch to another registry and npm will install packages from the new registry, but if you create a lock From fa27acaa72002c5cc80f59401dbd0ba817cda404 Mon Sep 17 00:00:00 2001 From: Eric Mutta Date: Tue, 3 Jan 2023 04:14:46 +0300 Subject: [PATCH 002/868] docs: fix typo in removal.md --- docs/lib/content/using-npm/removal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/lib/content/using-npm/removal.md b/docs/lib/content/using-npm/removal.md index c5e13b6741b6d..25dbb80baa7a9 100644 --- a/docs/lib/content/using-npm/removal.md +++ b/docs/lib/content/using-npm/removal.md @@ -28,8 +28,8 @@ continue reading. Note that this is only necessary for globally-installed packages. Local installs are completely contained within a project's `node_modules` -folder. Delete that folder, and everything is gone less a package's -install script is particularly ill-behaved). +folder. Delete that folder, and everything is gone unless a package's +install script is particularly ill-behaved. This assumes that you installed node and npm in the default place. If you configured node with a different `--prefix`, or installed npm with a From fe9debd7925c8e6d05d53f49f516fec8aede8890 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Mon, 9 Jan 2023 13:16:22 -0700 Subject: [PATCH 003/868] docs: fix typos in definitions.js (#6038) * Fix typo in definitions.js * Fix another typo in definitions.js * Fix yet another typo in definitions.js * update snapshots Co-authored-by: Eric Mutta --- lib/utils/config/definitions.js | 6 +++--- tap-snapshots/test/lib/docs.js.test.cjs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index dd3d9946af819..eabb2ba09e599 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -163,7 +163,7 @@ define('access', { `, type: [null, 'restricted', 'public'], description: ` - If do not want your scoped package to be publicly viewable (and + If you do not want your scoped package to be publicly viewable (and installable) set \`--access=restricted\`. Unscoped packages can not be set to \`restricted\`. @@ -848,7 +848,7 @@ define('global-style', { type: Boolean, description: ` Only install direct dependencies in the top level \`node_modules\`, - but hoist on deeper dependendencies. + but hoist on deeper dependencies. Sets \`--install-strategy=shallow\`. `, deprecated: ` @@ -2021,7 +2021,7 @@ define('strict-peer-deps', { even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \`peerDependencies\` object. - When such and override is performed, a warning is printed, explaining the + When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \`--strict-peer-deps\` is set, then this warning is treated as a failure. `, diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 08d908688fdd7..71eae7c1ec28e 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -604,8 +604,8 @@ safer to use a registry-provided authentication bearer token stored in the current level * Type: null, "restricted", or "public" -If do not want your scoped package to be publicly viewable (and installable) -set \`--access=restricted\`. +If you do not want your scoped package to be publicly viewable (and +installable) set \`--access=restricted\`. Unscoped packages can not be set to \`restricted\`. @@ -1702,7 +1702,7 @@ be resolved using the nearest non-peer dependency specification, even if doing so will result in some packages receiving a peer dependency outside the range set in their package's \`peerDependencies\` object. -When such and override is performed, a warning is printed, explaining the +When such an override is performed, a warning is printed, explaining the conflict and the packages involved. If \`--strict-peer-deps\` is set, then this warning is treated as a failure. @@ -1983,7 +1983,7 @@ Alias for \`--include=dev\`. \`--install-strategy=shallow\` Only install direct dependencies in the top level \`node_modules\`, but hoist -on deeper dependendencies. Sets \`--install-strategy=shallow\`. +on deeper dependencies. Sets \`--install-strategy=shallow\`. #### \`init.author.email\` From 2383deb9723593365cf748238f3b2388e7aaf6f5 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Tue, 10 Jan 2023 15:09:17 -0700 Subject: [PATCH 004/868] fix: clean urls from arborist, owner, and ping commands (#6037) --- lib/commands/owner.js | 2 +- lib/commands/ping.js | 6 ++++-- workspaces/arborist/lib/arborist/build-ideal-tree.js | 4 +++- workspaces/arborist/lib/place-dep.js | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/commands/owner.js b/lib/commands/owner.js index 40f16332b2922..3a997db800db7 100644 --- a/lib/commands/owner.js +++ b/lib/commands/owner.js @@ -120,7 +120,7 @@ class Owner extends BaseCommand { this.npm.output(maintainers.map(m => `${m.name} <${m.email}>`).join('\n')) } } catch (err) { - log.error('owner ls', "Couldn't get owner data", pkg) + log.error('owner ls', "Couldn't get owner data", npmFetch.cleanUrl(pkg)) throw err } } diff --git a/lib/commands/ping.js b/lib/commands/ping.js index 5a651c4a6ab09..c79e6a96cee40 100644 --- a/lib/commands/ping.js +++ b/lib/commands/ping.js @@ -1,3 +1,4 @@ +const { cleanUrl } = require('npm-registry-fetch') const log = require('../utils/log-shim') const pingUtil = require('../utils/ping.js') const BaseCommand = require('../base-command.js') @@ -8,14 +9,15 @@ class Ping extends BaseCommand { static name = 'ping' async exec (args) { - log.notice('PING', this.npm.config.get('registry')) + const cleanRegistry = cleanUrl(this.npm.config.get('registry')) + log.notice('PING', cleanRegistry) const start = Date.now() const details = await pingUtil({ ...this.npm.flatOptions }) const time = Date.now() - start log.notice('PONG', `${time}ms`) if (this.npm.config.get('json')) { this.npm.output(JSON.stringify({ - registry: this.npm.config.get('registry'), + registry: cleanRegistry, time, details, }, null, 2)) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 89584e5814784..a9c4b4bc0bb6d 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -12,6 +12,7 @@ const { readdirScoped } = require('@npmcli/fs') const { lstat, readlink } = require('fs/promises') const { depth } = require('treeverse') const log = require('proc-log') +const { cleanUrl } = require('npm-registry-fetch') const { OK, @@ -1210,7 +1211,8 @@ This is a one-time fix-up, please be patient... if (this[_manifests].has(spec.raw)) { return this[_manifests].get(spec.raw) } else { - log.silly('fetch manifest', spec.raw) + const cleanRawSpec = cleanUrl(spec.rawSpec) + log.silly('fetch manifest', spec.raw.replace(spec.rawSpec, cleanRawSpec)) const p = pacote.manifest(spec, options) .then(mani => { this[_manifests].set(spec.raw, mani) diff --git a/workspaces/arborist/lib/place-dep.js b/workspaces/arborist/lib/place-dep.js index 16a0095fa0963..e757d0c38a6d7 100644 --- a/workspaces/arborist/lib/place-dep.js +++ b/workspaces/arborist/lib/place-dep.js @@ -9,6 +9,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en') const log = require('proc-log') +const { cleanUrl } = require('npm-registry-fetch') const deepestNestingTarget = require('./deepest-nesting-target.js') const CanPlaceDep = require('./can-place-dep.js') const { @@ -187,7 +188,7 @@ class PlaceDep { `${this.dep.name}@${this.dep.version}`, this.canPlace.description, `for: ${this.edge.from.package._id || this.edge.from.location}`, - `want: ${this.edge.spec || '*'}` + `want: ${cleanUrl(this.edge.spec || '*')}` ) const placementType = this.canPlace.canPlace === CONFLICT From 35c94e048543b9d350747449929ff0b8e5e5899a Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 13 Dec 2022 09:09:24 -0800 Subject: [PATCH 005/868] chore: remove coverage map --- workspaces/arborist/map.js | 1 - workspaces/arborist/package.json | 1 - 2 files changed, 2 deletions(-) delete mode 100644 workspaces/arborist/map.js diff --git a/workspaces/arborist/map.js b/workspaces/arborist/map.js deleted file mode 100644 index a08c787621ddc..0000000000000 --- a/workspaces/arborist/map.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = test => test.replace(/^test/, 'lib') diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 5b923f357347a..93193af6b748f 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -81,7 +81,6 @@ "tap": { "color": true, "after": "test/fixtures/cleanup.js", - "coverage-map": "map.js", "test-env": [ "NODE_OPTIONS=--no-warnings", "LC_ALL=sk" From 2ba1171f867bfacedbab056d165d50e58b0cb7ed Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 13 Dec 2022 09:35:10 -0800 Subject: [PATCH 006/868] fix: streamline workspace loading code --- .../arborist/lib/arborist/load-virtual.js | 4 ++-- .../arborist/lib/arborist/load-workspaces.js | 22 ++++--------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/workspaces/arborist/lib/arborist/load-virtual.js b/workspaces/arborist/lib/arborist/load-virtual.js index 947659f177eef..b2a6ec2315a4f 100644 --- a/workspaces/arborist/lib/arborist/load-virtual.js +++ b/workspaces/arborist/lib/arborist/load-virtual.js @@ -1,5 +1,6 @@ // mixin providing the loadVirtual method const localeCompare = require('@isaacs/string-locale-compare')('en') +const mapWorkspaces = require('@npmcli/map-workspaces') const { resolve } = require('path') @@ -21,7 +22,6 @@ const loadRoot = Symbol('loadRoot') const loadNode = Symbol('loadVirtualNode') const loadLink = Symbol('loadVirtualLink') const loadWorkspaces = Symbol.for('loadWorkspaces') -const loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual') const flagsSuspect = Symbol.for('flagsSuspect') const reCalcDepFlags = Symbol('reCalcDepFlags') const checkRootEdges = Symbol('checkRootEdges') @@ -157,7 +157,7 @@ module.exports = cls => class VirtualLoader extends cls { } const lockWS = [] - const workspaces = this[loadWorkspacesVirtual]({ + const workspaces = mapWorkspaces.virtual({ cwd: this.path, lockfile: s.data, }) diff --git a/workspaces/arborist/lib/arborist/load-workspaces.js b/workspaces/arborist/lib/arborist/load-workspaces.js index 0a7965ae30ca1..effa5a0cda24f 100644 --- a/workspaces/arborist/lib/arborist/load-workspaces.js +++ b/workspaces/arborist/lib/arborist/load-workspaces.js @@ -1,33 +1,19 @@ const mapWorkspaces = require('@npmcli/map-workspaces') -const _appendWorkspaces = Symbol('appendWorkspaces') // shared ref used by other mixins/Arborist const _loadWorkspaces = Symbol.for('loadWorkspaces') -const _loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual') module.exports = cls => class MapWorkspaces extends cls { - [_appendWorkspaces] (node, workspaces) { - if (node && workspaces.size) { - node.workspaces = workspaces - } - - return node - } - async [_loadWorkspaces] (node) { - if (node.workspaces) { - return node - } - const workspaces = await mapWorkspaces({ cwd: node.path, pkg: node.package, }) - return this[_appendWorkspaces](node, workspaces) - } + if (node && workspaces.size) { + node.workspaces = workspaces + } - [_loadWorkspacesVirtual] (opts) { - return mapWorkspaces.virtual(opts) + return node } } From b584af0237eecd5c32cdab98b8a067798eb25eea Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 4 Jan 2023 10:54:14 -0800 Subject: [PATCH 007/868] fix: remove unneeded param default --- workspaces/arborist/lib/override-resolves.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/arborist/lib/override-resolves.js b/workspaces/arborist/lib/override-resolves.js index 794b2c335dc62..c061cbce18678 100644 --- a/workspaces/arborist/lib/override-resolves.js +++ b/workspaces/arborist/lib/override-resolves.js @@ -1,4 +1,4 @@ -function overrideResolves (resolved, opts = {}) { +function overrideResolves (resolved, opts) { const { omitLockfileRegistryResolved = false } = opts if (omitLockfileRegistryResolved) { From ca8ff007d7abba1f3ae6646668ee840afa1191b6 Mon Sep 17 00:00:00 2001 From: Eric Mutta Date: Thu, 12 Jan 2023 03:35:12 +0300 Subject: [PATCH 008/868] docs: update outdated file path to definitions.js Looks like npm's default config options were relocated from `lib/utils/config-defs.js` to the current `lib/utils/config/definitions.js` as [can be seen here](https://github.com/npm/cli/blob/latest/lib/utils/config/definitions.js) --- docs/lib/content/commands/npm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lib/content/commands/npm.md b/docs/lib/content/commands/npm.md index d47a34e74eaf2..00397ba28a037 100644 --- a/docs/lib/content/commands/npm.md +++ b/docs/lib/content/commands/npm.md @@ -130,7 +130,7 @@ npm is extremely configurable. It reads its configuration options from in the cli, env, or user config, then that file is parsed instead. * Defaults: npm's default configuration options are defined in - lib/utils/config-defs.js. These must not be changed. + `lib/utils/config/definitions.js`. These must not be changed. See [`config`](/using-npm/config) for much much more information. From cf175fb2a7faffa6664874a9e8bea52dbbb1b0e2 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 11 Jan 2023 20:15:17 -0800 Subject: [PATCH 009/868] fix: default auth-type to legacy if otp is configured (#6044) --- lib/utils/config/definitions.js | 9 ++++++++- tap-snapshots/test/lib/docs.js.test.cjs | 3 ++- test/lib/utils/config/definitions.js | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index eabb2ba09e599..9ddbafd46f7bc 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -238,6 +238,7 @@ define('auth-type', { type: ['legacy', 'web'], description: ` What authentication strategy to use with \`login\`. + Note that if an \`otp\` config is given, this value will always be set to \`legacy\`. `, flatten, }) @@ -1465,7 +1466,13 @@ define('otp', { If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. `, - flatten, + flatten (key, obj, flatOptions) { + flatten(key, obj, flatOptions) + if (obj.otp) { + obj['auth-type'] = 'legacy' + flatten('auth-type', obj, flatOptions) + } + }, }) define('package', { diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 71eae7c1ec28e..492c82afc40b2 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -654,7 +654,8 @@ exit code. * Default: "web" * Type: "legacy" or "web" -What authentication strategy to use with \`login\`. +What authentication strategy to use with \`login\`. Note that if an \`otp\` +config is given, this value will always be set to \`legacy\`. #### \`before\` diff --git a/test/lib/utils/config/definitions.js b/test/lib/utils/config/definitions.js index 0cae6a6da6bd3..288166039bf6f 100644 --- a/test/lib/utils/config/definitions.js +++ b/test/lib/utils/config/definitions.js @@ -931,3 +931,12 @@ t.test('remap global-style', t => { t.strictSame(flat, { installStrategy: 'shallow' }) t.end() }) + +t.test('otp changes auth-type', t => { + const obj = { 'auth-type': 'web', otp: 123456 } + const flat = {} + mockDefs().otp.flatten('otp', obj, flat) + t.strictSame(flat, { authType: 'legacy', otp: 123456 }) + t.strictSame(obj, { 'auth-type': 'legacy', otp: 123456 }) + t.end() +}) From f0038e5b7492a899da26fafd5f781291961ef427 Mon Sep 17 00:00:00 2001 From: Peally <102741826+Peallyz@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:05:20 +0100 Subject: [PATCH 010/868] docs: missing backtick in synopsis of npm init (#5837) (#6048) --- lib/commands/init.js | 2 +- tap-snapshots/test/lib/docs.js.test.cjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/commands/init.js b/lib/commands/init.js index d1bde934374c9..16ece46589d7c 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -28,7 +28,7 @@ class Init extends BaseCommand { static name = 'init' static usage = [ - ' (same as `npx )', + ' (same as `npx `)', '<@scope> (same as `npx <@scope>/create`)', ] diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index 492c82afc40b2..ad37be5218e1a 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -3139,7 +3139,7 @@ exports[`test/lib/docs.js TAP usage init > must match snapshot 1`] = ` Create a package.json file Usage: -npm init (same as \`npx ) +npm init (same as \`npx \`) npm init <@scope> (same as \`npx <@scope>/create\`) Options: @@ -3152,7 +3152,7 @@ aliases: create, innit Run "npm help init" for more info \`\`\`bash -npm init (same as \`npx ) +npm init (same as \`npx \`) npm init <@scope> (same as \`npx <@scope>/create\`) aliases: create, innit From 29f994279f339ee99fab02c594a37077cb98272c Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 12 Jan 2023 11:55:06 -0800 Subject: [PATCH 011/868] chore: add node release integration workflows (#6049) --- .github/workflows/node-integration.yml | 456 ++++++++++++++++++++++ .github/workflows/release-integration.yml | 45 +++ 2 files changed, 501 insertions(+) create mode 100644 .github/workflows/node-integration.yml create mode 100644 .github/workflows/release-integration.yml diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml new file mode 100644 index 0000000000000..c90a5e681dc37 --- /dev/null +++ b/.github/workflows/node-integration.yml @@ -0,0 +1,456 @@ +name: nodejs integration + +on: + workflow_call: + inputs: + nodeVersion: + description: 'nodejs version' + required: true + type: string + default: nightly + npmVersion: + description: 'npm version' + required: true + type: string + default: git + + workflow_dispatch: + inputs: + nodeVersion: + description: 'nodejs version' + required: true + type: string + default: nightly + npmVersion: + description: 'npm version' + required: true + type: string + default: git + +# used by setup-ccache-action's post hook to cleanup old caches +permissions: + actions: write + +jobs: + build-nodejs: + name: build nodejs@${{ inputs.nodeVersion }} npm@${{ inputs.npmVersion }} + runs-on: ubuntu-latest + outputs: + nodeVersion: ${{ steps.build-nodejs.outputs.nodeVersion }} + steps: + - name: setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + override_cache_key: nodejs-${{ inputs.nodeVersion }} + - name: build nodejs + id: build-nodejs + run: | + echo "::group::setup" + set -eo pipefail + npmDir="${RUNNER_TEMP}/npm" + sourceDir="${RUNNER_TEMP}/src" + targetDir="${RUNNER_TEMP}/build" + npmFile="${RUNNER_TEMP}/npm.tgz" + sourceFile="${RUNNER_TEMP}/source.tgz" + targetFile="${RUNNER_TEMP}/build.tgz" + echo "::endgroup::" + + echo "::group::finding nodejs version matching ${{ inputs.nodeVersion }}" + if [[ "${{ inputs.nodeVersion }}" == "nightly" ]]; then + nodeVersion=$(curl -sSL https://nodejs.org/download/nightly/index.json | jq -r .[0].version) + nodeUrl="https://nodejs.org/download/nightly/${nodeVersion}/node-${nodeVersion}.tar.gz" + else + nodeVersion=$(curl -sSL https://nodejs.org/download/release/index.json | jq -r 'map(select(.version | test("^v${{ inputs.nodeVersion }}"))) | .[0].version') + if [[ -z "$nodeVersion" ]]; then + echo "::error ::unable to find released nodejs version matching: ${{ inputs.nodeVersion }}" + exit 1 + fi + nodeUrl="https://nodejs.org/download/release/${nodeVersion}/node-${nodeVersion}.tar.gz" + fi + echo "nodeVersion=${nodeVersion}" >> $GITHUB_OUTPUT + echo "::endgroup::" + + echo "::group::extracting source from $nodeUrl" + mkdir -p "$sourceDir" + curl -sSL "$nodeUrl" | tar xz -C "$sourceDir" --strip=1 + echo "::endgroup::" + + echo "::group::cloning npm" + mkdir -p "$npmDir" + git clone https://github.com/npm/cli.git "$npmDir" + npmVersion=$(cat "${npmDir}/package.json" | jq -r '"\(.version)-git"') + echo "::endgroup::" + + if [[ "${{ inputs.npmVersion }}" != "git" ]]; then + echo "::group::checking out npm@${{ inputs.npmVersion }}" + pushd "$npmDir" >/dev/null + npmVersion=$(curl -sSL https://registry.npmjs.org/npm |\ + jq -r '.time | to_entries | map(select(.key | test("^${{ inputs.npmVersion }}"))) | sort_by(.value | split(".") | "\(.[0])Z" | fromdate) | .[-1].key') + npmGitHead=$(git show-ref --tags "v${npmVersion}" | cut -d' ' -f1) + git reset --hard "$npmGitHead" + popd >/dev/null + echo "::endgroup::" + fi + + echo "::group::packing npm release $npmVersion" + pushd "$npmDir" >/dev/null + node . run resetdeps + npmtarball="$(node . pack --loglevel=silent --json | jq -r .[0].filename)" + tar czf "$npmFile" -C "$npmDir" . + popd >/dev/null + echo "npm=$npmFile" >> $GITHUB_OUTPUT + echo "::endgroup::" + + echo "::group::updating nodejs bundled npm" + rm -rf "${sourceDir}/deps/npm" + mkdir -p "${sourceDir}/deps/npm" + tar xfz "${npmDir}/${npmtarball}" -C "${sourceDir}/deps/npm" --strip=1 + echo "::endgroup::" + + echo "::group::packing nodejs source" + tar cfz "$sourceFile" -C "$sourceDir" . + echo "source=$sourceFile" >> $GITHUB_OUTPUT + echo "::endgroup::" + + echo "::group::building nodejs" + mkdir -p "$targetDir" + pushd "$sourceDir" >/dev/null + ./configure --prefix="$targetDir" + make -j4 install + popd >/dev/null + echo "::endgroup::" + + echo "::group::packing nodejs build" + tar cfz "$targetFile" -C "$targetDir" . + echo "build=$targetFile" >> $GITHUB_OUTPUT + echo "::endgroup::" + - name: upload artifacts + uses: actions/upload-artifact@v3 + with: + name: nodejs-${{ steps.build-nodejs.outputs.nodeVersion }} + path: | + ${{ steps.build-nodejs.outputs.source }} + ${{ steps.build-nodejs.outputs.build }} + ${{ steps.build-nodejs.outputs.npm }} + + test-nodejs: + name: test nodejs + runs-on: ubuntu-latest + needs: + - build-nodejs + steps: + - name: setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + override_cache_key: nodejs-${{ inputs.nodeVersion }} + - name: download artifacts + uses: actions/download-artifact@v3 + with: + name: nodejs-${{ needs.build-nodejs.outputs.nodeVersion }} + - name: test nodejs + run: | + set -e + tar xf source.tgz + ./configure + make -j4 test-only + + test-npm: + name: test npm + runs-on: ubuntu-latest + needs: + - build-nodejs + steps: + - name: download artifacts + uses: actions/download-artifact@v3 + with: + name: nodejs-${{ needs.build-nodejs.outputs.nodeVersion }} + path: ${{ runner.temp }} + - name: install nodejs ${{ needs.build-nodejs.outputs.nodeVersion }} + id: install + run: | + set -e + mkdir -p "${RUNNER_TEMP}/node" + tar xf "${RUNNER_TEMP}/build.tgz" -C "${RUNNER_TEMP}/node" + + mkdir -p "${RUNNER_TEMP}/npm" + tar xf "${RUNNER_TEMP}/npm.tgz" -C "${RUNNER_TEMP}/npm" + + echo "${RUNNER_TEMP}/node/bin" >> $GITHUB_PATH + echo "cache=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: setup npm cache + uses: actions/cache@v3 + with: + path: ${{ steps.install.outputs.cache }} + key: npm-tests + - run: node --version + - run: npm --version + - name: test npm + run: | + echo "::group::setup" + set -e + cd "${RUNNER_TEMP}/npm" + echo "::endgroup::" + + echo "::group::npm run resetdeps" + node . run resetdeps + echo "::endgroup::" + + echo "::group::npm link" + node . link + echo "::endgroup::" + + STEPEXIT=0 + FINALEXIT=0 + + set +e + echo "::group::npm test" + node . test --ignore-scripts + STEPEXIT=$? + if [[ $STEPEXIT -ne 0 ]]; then + echo "::warning ::npm test failed, exit: $STEPEXIT" + FINALEXIT=STEPEXIT + fi + echo "::endgroup::" + + for workspace in $(npm query .workspace | jq -r .[].name); do + echo "::group::npm test -w $workspace" + node . test -w $workspace --if-present --ignore-scripts + STEPEXIT=$? + if [[ $STEPEXIT -ne 0 ]]; then + echo "::warning ::npm test -w $workspace failed, exit: $STEPEXIT" + FINALEXIT=STEPEXIT + fi + echo "::endgroup::" + done + + exit $FINALEXIT + + generate-matrix: + name: generate matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.generate-matrix.outputs.matrix }} + steps: + - name: install dependencies + run: | + npm install --no-save --no-audit --no-fund citgm npm-package-arg + - name: generate matrix + id: generate-matrix + uses: actions/github-script@v6 + with: + script: | + const { execSync } = require('child_process') + const npa = require('npm-package-arg') + + const lookup = require('./node_modules/citgm/lib/lookup.json') + + const matchesKeyword = (value) => { + const keywords = ['ubuntu', 'debian', 'linux', 'x86', '>=11', '>=12', '>=16', '>=17'] + if (value === true || + (typeof value === 'string' && keywords.includes(value)) || + (Array.isArray(value) && keywords.some((keyword) => value.includes(keyword) || value.includes(true)))) { + return true + } + + return false + } + + // this is a manually updated list of packages that we know currently fail + const knownFailures = [ + 'body-parser', // json parsing error difference + 'clinic', // unknown, lots of failures + 'ember-cli', // timeout in nodejs ci, one failing test for us that timed out + 'express', // body-parser is what actually fails, it's used in a test + 'https-proxy-agent', // looks ssl related + 'node-gyp', // one test consistently times out + 'resolve', // compares results to require.resolve and fails, also missing inspector/promises + 'serialport', // esbuild barfs on node 20.0.0-pre + 'undici', // test failure in node >=19, unable to root cause + 'uuid', // tests that crypto.getRandomValues throws but it doesn't + 'weak', // doesn't seem to build in node >12 + ] + + // this is a manually updated list of packages that are flaky + const supplementalFlaky = [ + 'pino', // flaky test test/transport/core.test.js:401 + 'tough-cookie', // race condition test/node_util_fallback_test.js:87 + ] + + const matrix = [] + for (const package in lookup) { + const meta = lookup[package] + + // we omit npm from the matrix because its tests are run as their own job + if (matchesKeyword(meta.skip) || meta.yarn === true || package === 'npm') { + continue + } + + const install_flags = ['--no-audit', '--no-fund'] + if (meta.install) { + install_flags.push(meta.install.slice(1)) + } + const context = JSON.parse(execSync(`npm show ${package} --json`)) + const test = meta.scripts ? meta.scripts.map((script) => `npm run ${script}`) : ['npm test'] + + const repo = npa(meta.repo || context.repository.url).hosted + const details = {} + if (meta.useGitClone) { + details.repo = repo.https() + } else { + if (meta.ignoreGitHead) { + details.url = repo.tarball() + } else { + details.url = repo.tarball({ committish: context.gitHead }) + } + } + + const env = { ...meta.envVar } + matrix.push({ + package, + version: context.version, + env, + install_flags: install_flags.join(' '), + commands: [...test], + flaky: matchesKeyword(meta.flaky) || supplementalFlaky.includes(package), + knownFailure: knownFailures.includes(package), + ...details, + }) + } + core.setOutput('matrix', matrix) + + citgm: + name: citgm - ${{ matrix.package }}@${{ matrix.version }} ${{ matrix.flaky && '(flaky)' || '' }} ${{ matrix.knownFailure && '(known failure)' || '' }} + runs-on: ubuntu-latest + needs: + - build-nodejs + - generate-matrix + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + steps: + - name: download artifacts + uses: actions/download-artifact@v3 + with: + name: nodejs-${{ needs.build-nodejs.outputs.nodeVersion }} + path: ${{ runner.temp }} + - name: install nodejs ${{ needs.build-nodejs.outputs.nodeVersion }} + id: install + run: | + set -e + mkdir -p "${RUNNER_TEMP}/node" + tar xf "${RUNNER_TEMP}/build.tgz" -C "${RUNNER_TEMP}/node" + echo "nodedir=${RUNNER_TEMP}/node" >> $GITHUB_OUTPUT + + echo "${RUNNER_TEMP}/node/bin" >> $GITHUB_PATH + echo "cache=$(npm config get cache)" >> $GITHUB_OUTPUT + - name: setup npm cache + uses: actions/cache@v3 + with: + path: ${{ steps.install.outputs.cache }} + key: npm-${{ matrix.package }} + - run: node --version + - run: npm --version + - name: download source + id: download + run: | + set -eo pipefail + TARGET_DIR="${RUNNER_TEMP}/${{ matrix.package }}" + mkdir -p "$TARGET_DIR" + echo "target=$TARGET_DIR" >> $GITHUB_OUTPUT + + if [[ -n "${{ matrix.repo }}" ]]; then + export GIT_TERMINAL_PROMPT=0 + export GIT_SSH_COMMAND="ssh -oBatchMode=yes" + git clone --recurse-submodules "${{ matrix.repo }}" "$TARGET_DIR" + elif [[ -n "${{ matrix.url }}" ]]; then + curl -sSL "${{ matrix.url }}" | tar xz -C "$TARGET_DIR" --strip=1 + fi + + if [[ -f "${TARGET_DIR}/package-lock.json" ]]; then + lockfileVersion=$(cat "${TARGET_DIR}/package-lock.json" | jq .lockfileVersion) + echo "lockfileVersion=$lockfileVersion" >> $GITHUB_OUTPUT + fi + - name: npm install ${{ matrix.install_flags }} + id: npm-install + working-directory: ${{ steps.download.outputs.target }} + run: | + set +e + npm install --nodedir="${{steps.install.outputs.nodedir }}" ${{ matrix.install_flags }} + exitcode=$? + if [[ $exitcode -ne 0 && "${{ matrix.knownFailure }}" == "true" ]]; then + echo "::warning ::npm install failed, exit $exitcode" + echo "failed=true" >> $GITHUB_OUTPUT + exit 0 + fi + exit $exitcode + - name: verify lockfileVersion unchanged + working-directory: ${{ steps.download.outputs.target }} + if: ${{ steps.download.outputs.lockfileVersion && steps.npm-install.outputs.failed != 'true' }} + run: | + if [[ -f "package-lock.json" ]]; then + newLockfileVersion=$(cat "package-lock.json" | jq .lockfileVersion) + if [[ "$newLockfileVersion" -ne "${{ steps.download.outputs.lockfileVersion }}" ]]; then + logMessage="lockfileVersion changed from ${{ steps.download.outputs.lockfileVersion }} to $newLockfileVersion" + if [[ "${{ steps.download.outputs.lockfileVersion }}" -eq 1 ]]; then + echo "::warning ::$logMessage" + else + echo "::error ::$logMessage" + exit 1 + fi + fi + fi + - name: npm ls + working-directory: ${{ steps.download.outputs.target }} + if: ${{ steps.npm-install.outputs.failed != 'true' }} + run: | + npm ls + - name: ${{ join(matrix.commands, ' && ') }} + env: ${{ matrix.env }} + working-directory: ${{ steps.download.outputs.target }} + if: ${{ steps.npm-install.outputs.failed != 'true' }} + run: | + set +e + FINALEXIT=0 + STEPEXIT=0 + + export npm_config_nodedir="${{ steps.install.outputs.nodedir }}" + + # inlining some patches to make tests run + if [[ "${{ matrix.package }}" == "undici" ]]; then + sed -i.bak 's/--experimental-wasm-simd //' package.json + rm -f package.json.bak + sed -i.bak 's/--experimental-wasm-simd//' .taprc + rm -f .taprc.bak + fi + + commandCount=$(echo '${{ toJSON(matrix.commands) }}' | jq -r 'length') + if [[ $commandCount -eq 1 ]]; then + COMMAND=$(echo '${{ toJSON(matrix.commands) }}' | jq -r '.[0]') + $COMMAND + STEPEXIT=$? + if [[ $STEPEXIT -ne 0 ]]; then + if [[ "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" ]]; then + echo "::warning ::$COMMAND failed, exit $STEPEXIT" + exit 0 + fi + fi + exit $STEPEXIT + fi + + for row in $(echo '${{ toJSON(matrix.commands) }}' | jq -r '.[] | @base64'); do + COMMAND=$(echo "$row" | base64 --decode) + echo "::group::$COMMAND" + $COMMAND + STEPEXIT=$? + if [[ $STEPEXIT -ne 0 ]]; then + if [[ "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" ]]; then + echo "::warning ::$COMMAND failed, exit: $STEPEXIT" + else + FINALEXIT=$STEPEXIT + echo "::error ::$COMMAND failed, exit: $STEPEXIT" + fi + fi + echo "::endgroup::" + done + exit $FINALEXIT diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml new file mode 100644 index 0000000000000..07c68a50a2dc4 --- /dev/null +++ b/.github/workflows/release-integration.yml @@ -0,0 +1,45 @@ +name: release integration + +on: + release: + types: + - published + workflow_dispatch: + inputs: + npmVersion: + description: npm version to test + type: string + required: true + +jobs: + npm-version: + env: + npmVersion: ${{ inputs.npmVersion || github.ref_name }} + name: determine npm version + if: ${{ inputs.npmVersion || startsWith(github.ref_name, 'v') }} + runs-on: ubuntu-latest + outputs: + npmVersion: ${{ steps.version.outputs.npmVersion }} + steps: + - name: clean npm version + id: version + run: | + npmVersion="${{ env.npmVersion }}" + npmVersion="${npmVersion/#v}" + echo "npmVersion=${npmVersion}" >> $GITHUB_OUTPUT + node-integration: + name: nodejs@${{ matrix.nodeVersion }} integration + strategy: + fail-fast: false + matrix: + nodeVersion: + - 18 + - 19 + - nightly + needs: + - npm-version + uses: ./.github/workflows/node-integration.yml + with: + nodeVersion: ${{ matrix.nodeVersion }} + npmVersion: ${{ needs.npm-version.outputs.npmVersion }} + From 4d275927e069606c8047b678ad09aafbe18b1673 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:07:29 +0000 Subject: [PATCH 012/868] chore: release 9.3.0 --- .release-please-manifest.json | 14 ++++++------ AUTHORS | 2 ++ CHANGELOG.md | 36 ++++++++++++++++++++++++++++++ package-lock.json | 36 +++++++++++++++--------------- package.json | 14 ++++++------ workspaces/arborist/CHANGELOG.md | 9 ++++++++ workspaces/arborist/package.json | 2 +- workspaces/config/CHANGELOG.md | 6 +++++ workspaces/config/package.json | 2 +- workspaces/libnpmdiff/CHANGELOG.md | 6 +++++ workspaces/libnpmdiff/package.json | 4 ++-- workspaces/libnpmexec/CHANGELOG.md | 6 +++++ workspaces/libnpmexec/package.json | 4 ++-- workspaces/libnpmfund/CHANGELOG.md | 6 +++++ workspaces/libnpmfund/package.json | 4 ++-- workspaces/libnpmpack/CHANGELOG.md | 6 +++++ workspaces/libnpmpack/package.json | 4 ++-- 17 files changed, 119 insertions(+), 42 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 354b45e27c90f..9db0f53f7bbf7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,16 +1,16 @@ { - ".": "9.2.0", - "workspaces/arborist": "6.1.5", + ".": "9.3.0", + "workspaces/arborist": "6.1.6", "workspaces/libnpmaccess": "7.0.1", - "workspaces/libnpmdiff": "5.0.6", - "workspaces/libnpmexec": "5.0.6", - "workspaces/libnpmfund": "4.0.6", + "workspaces/libnpmdiff": "5.0.7", + "workspaces/libnpmexec": "5.0.7", + "workspaces/libnpmfund": "4.0.7", "workspaces/libnpmhook": "9.0.1", "workspaces/libnpmorg": "5.0.1", - "workspaces/libnpmpack": "5.0.6", + "workspaces/libnpmpack": "5.0.7", "workspaces/libnpmpublish": "7.0.6", "workspaces/libnpmsearch": "6.0.1", "workspaces/libnpmteam": "5.0.1", "workspaces/libnpmversion": "4.0.1", - "workspaces/config": "6.1.0" + "workspaces/config": "6.1.1" } diff --git a/AUTHORS b/AUTHORS index af0d5ed1a0c62..50cc15da5266b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -867,3 +867,5 @@ Andrew Dawes sosoba Aron HenryNguyen5 <6404866+HenryNguyen5@users.noreply.github.com> +Eric Mutta +Peally <102741826+Peallyz@users.noreply.github.com> diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb6c046e49d2..79bf4c5c839d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## [9.3.0](https://github.com/npm/cli/compare/v9.2.0...v9.3.0) (2023-01-12) + +### Features + +* [`753b98e`](https://github.com/npm/cli/commit/753b98ef49e0410642cbfb1adbe06e7417e22d82) [#5261](https://github.com/npm/cli/pull/5261) rootless workspace init provides suggestion (@fritzy) + +### Bug Fixes + +* [`cf175fb`](https://github.com/npm/cli/commit/cf175fb2a7faffa6664874a9e8bea52dbbb1b0e2) [#6044](https://github.com/npm/cli/pull/6044) default auth-type to legacy if otp is configured (#6044) (@wraithgar) +* [`2383deb`](https://github.com/npm/cli/commit/2383deb9723593365cf748238f3b2388e7aaf6f5) [#6037](https://github.com/npm/cli/pull/6037) clean urls from arborist, owner, and ping commands (#6037) (@lukekarrys) +* [`69f5ff8`](https://github.com/npm/cli/commit/69f5ff863fccf91935b1f62b514fd2621b761903) view: convert command to use output instead of console (@lukekarrys) +* [`dc52222`](https://github.com/npm/cli/commit/dc52222123245d3faf2afa444d0223deb25e35b6) init: write package.json workspaces paths with / separators (@lukekarrys) +* [`31af1aa`](https://github.com/npm/cli/commit/31af1aaa9f6427bd61d752d54801d873c6242af8) refactor `help` to use `@npmcli/promise-spawn` (@lukekarrys) +* [`669ef94`](https://github.com/npm/cli/commit/669ef9476cac4679322bec69e7a55ff5992cf827) fund: correctly parse and use `which` config (@lukekarrys) +* [`72e6d6f`](https://github.com/npm/cli/commit/72e6d6f638db03dbe3c965be79ce05cb6fda12fc) generate workspace support for docs pages (@lukekarrys) +* [`450e50f`](https://github.com/npm/cli/commit/450e50fa555bfef869735b0195fe0a451e94eb3d) evaluate configs in command class (@lukekarrys) +* [`28ec922`](https://github.com/npm/cli/commit/28ec922e18c7178e840fd28cbbf78f56f0a7a653) [#5946](https://github.com/npm/cli/pull/5946) replace rimraf with fs.rm (@lukekarrys) + +### Documentation + +* [`f0038e5`](https://github.com/npm/cli/commit/f0038e5b7492a899da26fafd5f781291961ef427) [#6048](https://github.com/npm/cli/pull/6048) missing backtick in synopsis of npm init (#5837) (#6048) (@Peallyz) +* [`ca8ff00`](https://github.com/npm/cli/commit/ca8ff007d7abba1f3ae6646668ee840afa1191b6) [#6045](https://github.com/npm/cli/pull/6045) update outdated file path to definitions.js (@ericmutta) +* [`fe9debd`](https://github.com/npm/cli/commit/fe9debd7925c8e6d05d53f49f516fec8aede8890) [#6038](https://github.com/npm/cli/pull/6038) fix typos in definitions.js (#6038) (@lukekarrys, @ericmutta) +* [`fa27aca`](https://github.com/npm/cli/commit/fa27acaa72002c5cc80f59401dbd0ba817cda404) [#6018](https://github.com/npm/cli/pull/6018) fix typo in removal.md (@ericmutta) +* [`82f69d9`](https://github.com/npm/cli/commit/82f69d90d58da8cc2a53570bfe2a1a9cc2574f0d) [#6026](https://github.com/npm/cli/pull/6026) fix typo in registry.md (@ericmutta) + +### Dependencies + +* [`ec09474`](https://github.com/npm/cli/commit/ec09474b371b0706d0d55a4968cf6ae545423568) [#5945](https://github.com/npm/cli/pull/5945) `minipass-fetch@3.0.1` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6` +* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.1): `@npmcli/config@6.1.1` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.7): `libnpmdiff@5.0.7` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.7): `libnpmexec@5.0.7` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.7): `libnpmfund@4.0.7` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.7): `libnpmpack@5.0.7` + ## [9.2.0](https://github.com/npm/cli/compare/v9.1.3...v9.2.0) (2022-12-07) ### Features diff --git a/package-lock.json b/package-lock.json index a3ca873e9c8f9..84de274b55b45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "9.2.0", + "version": "9.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "9.2.0", + "version": "9.3.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -85,8 +85,8 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.1.5", - "@npmcli/config": "^6.1.0", + "@npmcli/arborist": "^6.1.6", + "@npmcli/config": "^6.1.1", "@npmcli/map-workspaces": "^3.0.0", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", @@ -108,12 +108,12 @@ "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.6", - "libnpmexec": "^5.0.6", - "libnpmfund": "^4.0.6", + "libnpmdiff": "^5.0.7", + "libnpmexec": "^5.0.7", + "libnpmfund": "^4.0.7", "libnpmhook": "^9.0.1", "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.6", + "libnpmpack": "^5.0.7", "libnpmpublish": "^7.0.6", "libnpmsearch": "^6.0.1", "libnpmteam": "^5.0.1", @@ -14303,7 +14303,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "6.1.5", + "version": "6.1.6", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -14359,7 +14359,7 @@ }, "workspaces/config": { "name": "@npmcli/config", - "version": "6.1.0", + "version": "6.1.1", "license": "ISC", "dependencies": { "@npmcli/map-workspaces": "^3.0.0", @@ -14398,10 +14398,10 @@ } }, "workspaces/libnpmdiff": { - "version": "5.0.6", + "version": "5.0.7", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", @@ -14421,10 +14421,10 @@ } }, "workspaces/libnpmexec": { - "version": "5.0.6", + "version": "5.0.7", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", @@ -14453,10 +14453,10 @@ } }, "workspaces/libnpmfund": { - "version": "4.0.6", + "version": "4.0.7", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.5" + "@npmcli/arborist": "^6.1.6" }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", @@ -14503,10 +14503,10 @@ } }, "workspaces/libnpmpack": { - "version": "5.0.6", + "version": "5.0.7", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7" diff --git a/package.json b/package.json index ea6b3febbf6fa..73c41bc2b4fd2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "9.2.0", + "version": "9.3.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -53,8 +53,8 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.1.5", - "@npmcli/config": "^6.1.0", + "@npmcli/arborist": "^6.1.6", + "@npmcli/config": "^6.1.1", "@npmcli/map-workspaces": "^3.0.0", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", @@ -76,12 +76,12 @@ "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.6", - "libnpmexec": "^5.0.6", - "libnpmfund": "^4.0.6", + "libnpmdiff": "^5.0.7", + "libnpmexec": "^5.0.7", + "libnpmfund": "^4.0.7", "libnpmhook": "^9.0.1", "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.6", + "libnpmpack": "^5.0.7", "libnpmpublish": "^7.0.6", "libnpmsearch": "^6.0.1", "libnpmteam": "^5.0.1", diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index 8fcc8a35886ef..c50f0536c7e22 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [6.1.6](https://github.com/npm/cli/compare/arborist-v6.1.5...arborist-v6.1.6) (2023-01-12) + +### Bug Fixes + +* [`b584af0`](https://github.com/npm/cli/commit/b584af0237eecd5c32cdab98b8a067798eb25eea) [#6022](https://github.com/npm/cli/pull/6022) remove unneeded param default (@wraithgar) +* [`2ba1171`](https://github.com/npm/cli/commit/2ba1171f867bfacedbab056d165d50e58b0cb7ed) streamline workspace loading code (@wraithgar) +* [`2383deb`](https://github.com/npm/cli/commit/2383deb9723593365cf748238f3b2388e7aaf6f5) [#6037](https://github.com/npm/cli/pull/6037) clean urls from arborist, owner, and ping commands (#6037) (@lukekarrys) +* [`c52cf6b`](https://github.com/npm/cli/commit/c52cf6bc547268833cde2715fe4f6299240049f8) [#5960](https://github.com/npm/cli/pull/5960) properly handle directory, file, git and alias specs in overrides (@nlf) + ## [6.1.5](https://github.com/npm/cli/compare/arborist-v6.1.4...arborist-v6.1.5) (2022-12-07) ### Bug Fixes diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 93193af6b748f..a7e8132123fba 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "6.1.5", + "version": "6.1.6", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/workspaces/config/CHANGELOG.md b/workspaces/config/CHANGELOG.md index 9584f80dc3ef3..1e67c20c3fe68 100644 --- a/workspaces/config/CHANGELOG.md +++ b/workspaces/config/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [6.1.1](https://github.com/npm/cli/compare/config-v6.1.0...config-v6.1.1) (2023-01-12) + +### Bug Fixes + +* [`450e50f`](https://github.com/npm/cli/commit/450e50fa555bfef869735b0195fe0a451e94eb3d) evaluate configs in command class (@lukekarrys) + ## [6.1.0](https://github.com/npm/cli/compare/config-v6.0.1...config-v6.1.0) (2022-11-02) ### Features diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 3d70a1565e741..50d860c1c941e 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "6.1.0", + "version": "6.1.1", "files": [ "bin/", "lib/" diff --git a/workspaces/libnpmdiff/CHANGELOG.md b/workspaces/libnpmdiff/CHANGELOG.md index e99b3f9d04874..a62d9902f0725 100644 --- a/workspaces/libnpmdiff/CHANGELOG.md +++ b/workspaces/libnpmdiff/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.7](https://github.com/npm/cli/compare/libnpmdiff-v5.0.6...libnpmdiff-v5.0.7) (2023-01-12) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6` + ## [5.0.6](https://github.com/npm/cli/compare/libnpmdiff-v5.0.5...libnpmdiff-v5.0.6) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index d761b0c21003f..9e7e3bdb41fc5 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "5.0.6", + "version": "5.0.7", "description": "The registry diff", "repository": { "type": "git", @@ -47,7 +47,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index c0721ca0ed52f..1ed94f90aa619 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.7](https://github.com/npm/cli/compare/libnpmexec-v5.0.6...libnpmexec-v5.0.7) (2023-01-12) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6` + ## [5.0.6](https://github.com/npm/cli/compare/libnpmexec-v5.0.5...libnpmexec-v5.0.6) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index f1cefd29b66fd..c0092d4c8767b 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "5.0.6", + "version": "5.0.7", "files": [ "bin/", "lib/" @@ -61,7 +61,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", diff --git a/workspaces/libnpmfund/CHANGELOG.md b/workspaces/libnpmfund/CHANGELOG.md index 45819684e08b7..1aadd5ca21dd4 100644 --- a/workspaces/libnpmfund/CHANGELOG.md +++ b/workspaces/libnpmfund/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.0.7](https://github.com/npm/cli/compare/libnpmfund-v4.0.6...libnpmfund-v4.0.7) (2023-01-12) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6` + ## [4.0.6](https://github.com/npm/cli/compare/libnpmfund-v4.0.5...libnpmfund-v4.0.6) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index b92af92f5514e..c0de224fba7ef 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "4.0.6", + "version": "4.0.7", "main": "lib/index.js", "files": [ "bin/", @@ -46,7 +46,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.5" + "@npmcli/arborist": "^6.1.6" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" diff --git a/workspaces/libnpmpack/CHANGELOG.md b/workspaces/libnpmpack/CHANGELOG.md index 79baeaaf53de7..345576b266cc6 100644 --- a/workspaces/libnpmpack/CHANGELOG.md +++ b/workspaces/libnpmpack/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.7](https://github.com/npm/cli/compare/libnpmpack-v5.0.6...libnpmpack-v5.0.7) (2023-01-12) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.1.6): `@npmcli/arborist@6.1.6` + ## [5.0.6](https://github.com/npm/cli/compare/libnpmpack-v5.0.5...libnpmpack-v5.0.6) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 3fd1f38fceb9e..035edaa9808d5 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "5.0.6", + "version": "5.0.7", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/arborist": "^6.1.5", + "@npmcli/arborist": "^6.1.6", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7" From 1c3612cc2fe9974166b5aab92477b289a768c1e7 Mon Sep 17 00:00:00 2001 From: James Shaw Date: Fri, 13 Jan 2023 21:50:17 +0000 Subject: [PATCH 013/868] fix: use recursive rm in ci command (#6054) * fix: use recursive rm in ci command * fix: add test for repeat uses of ci command Co-authored-by: Burke Livingston --- lib/commands/ci.js | 2 +- test/lib/commands/ci.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/commands/ci.js b/lib/commands/ci.js index a2c61044eb96e..4dd7898dc6182 100644 --- a/lib/commands/ci.js +++ b/lib/commands/ci.js @@ -67,7 +67,7 @@ class CI extends ArboristWorkspaceCmd { const path = `${where}/node_modules` // get the list of entries so we can skip the glob for performance const entries = await fs.readdir(path, null).catch(er => []) - return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true }))) + return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true, recursive: true }))) }) await arb.reify(opts) diff --git a/test/lib/commands/ci.js b/test/lib/commands/ci.js index bd3fd9be9a6a0..000ddc0eb8270 100644 --- a/test/lib/commands/ci.js +++ b/test/lib/commands/ci.js @@ -79,6 +79,30 @@ t.test('reifies, audits, removes node_modules', async t => { t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') }) +t.test('reifies, audits, removes node_modules on repeat run', async t => { + const { npm, joinedOutput, registry } = await loadMockNpm(t, { + prefixDir: { + abbrev: abbrev, + 'package.json': JSON.stringify(packageJson), + 'package-lock.json': JSON.stringify(packageLock), + node_modules: { test: 'test file that will be removed' }, + }, + }) + const manifest = registry.manifest({ name: 'abbrev' }) + await registry.tarball({ + manifest: manifest.versions['1.0.0'], + tarball: path.join(npm.prefix, 'abbrev'), + }) + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) + await npm.exec('ci', []) + await npm.exec('ci', []) + t.match(joinedOutput(), 'added 1 package, and audited 2 packages in') + const nmTest = path.join(npm.prefix, 'node_modules', 'test') + t.equal(fs.existsSync(nmTest), false, 'existing node_modules is removed') + const nmAbbrev = path.join(npm.prefix, 'node_modules', 'abbrev') + t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') +}) + t.test('--no-audit and --ignore-scripts', async t => { const { npm, joinedOutput, registry } = await loadMockNpm(t, { config: { From 8be672b21f7d434c898bb4e97dc3fca6e54b29a1 Mon Sep 17 00:00:00 2001 From: Gar Date: Fri, 13 Jan 2023 13:51:27 -0800 Subject: [PATCH 014/868] fix: don't try to deprecate nonexistant versions (#6050) If you pass npm a version that doesn't exist, it still tries to PUT the packument but with no changes. This is unneccessary and currently results in a 422 error from the npm registry --- lib/commands/deprecate.js | 24 +++++++++++++----------- test/lib/commands/deprecate.js | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/commands/deprecate.js b/lib/commands/deprecate.js index 1e1b8994c55a3..844d5f60a02ab 100644 --- a/lib/commands/deprecate.js +++ b/lib/commands/deprecate.js @@ -52,19 +52,21 @@ class Deprecate extends BaseCommand { query: { write: true }, }) - Object.keys(packument.versions) + const versions = Object.keys(packument.versions) .filter(v => semver.satisfies(v, spec, { includePrerelease: true })) - .forEach(v => { - packument.versions[v].deprecated = msg - }) - return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { - ...opts, - spec: p, - method: 'PUT', - body: packument, - ignoreBody: true, - })) + if (versions.length) { + for (const v of versions) { + packument.versions[v].deprecated = msg + } + return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { + ...opts, + spec: p, + method: 'PUT', + body: packument, + ignoreBody: true, + })) + } } } diff --git a/test/lib/commands/deprecate.js b/test/lib/commands/deprecate.js index 22ddfe182de6e..48513c7303a01 100644 --- a/test/lib/commands/deprecate.js +++ b/test/lib/commands/deprecate.js @@ -153,3 +153,19 @@ t.test('deprecates all versions when no range is specified', async t => { await npm.exec('deprecate', ['foo', message]) t.match(joinedOutput(), '') }) + +t.test('does nothing if version does not actually exist', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { config: { ...auth } }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: token, + }) + const manifest = registry.manifest({ + name: 'foo', + versions, + }) + await registry.package({ manifest, query: { write: true } }) + await npm.exec('deprecate', ['foo@1.0.99', 'this should be ignored']) + t.match(joinedOutput(), '') +}) From b74f834b558a7567ad274fc59b64b3a37a0ef9bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 21:53:05 +0000 Subject: [PATCH 015/868] chore: release 9.3.1 --- .release-please-manifest.json | 2 +- AUTHORS | 1 + CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9db0f53f7bbf7..bad8e81acafc8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "9.3.0", + ".": "9.3.1", "workspaces/arborist": "6.1.6", "workspaces/libnpmaccess": "7.0.1", "workspaces/libnpmdiff": "5.0.7", diff --git a/AUTHORS b/AUTHORS index 50cc15da5266b..bc798941f7467 100644 --- a/AUTHORS +++ b/AUTHORS @@ -869,3 +869,4 @@ Aron HenryNguyen5 <6404866+HenryNguyen5@users.noreply.github.com> Eric Mutta Peally <102741826+Peallyz@users.noreply.github.com> +James Shaw diff --git a/CHANGELOG.md b/CHANGELOG.md index 79bf4c5c839d7..2fb318b0dd00f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [9.3.1](https://github.com/npm/cli/compare/v9.3.0...v9.3.1) (2023-01-13) + +### Bug Fixes + +* [`8be672b`](https://github.com/npm/cli/commit/8be672b21f7d434c898bb4e97dc3fca6e54b29a1) [#6050](https://github.com/npm/cli/pull/6050) don't try to deprecate nonexistant versions (#6050) (@wraithgar) +* [`1c3612c`](https://github.com/npm/cli/commit/1c3612cc2fe9974166b5aab92477b289a768c1e7) [#6054](https://github.com/npm/cli/pull/6054) use recursive rm in ci command (#6054) (@jamesshaw1987, @burkel24) + ## [9.3.0](https://github.com/npm/cli/compare/v9.2.0...v9.3.0) (2023-01-12) ### Features diff --git a/package-lock.json b/package-lock.json index 84de274b55b45..56335fd7ba18d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "9.3.0", + "version": "9.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "9.3.0", + "version": "9.3.1", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", diff --git a/package.json b/package.json index 73c41bc2b4fd2..423024ae21c86 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "9.3.0", + "version": "9.3.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ From 53bbc144a971218429ebb40deaf17a470d5c667b Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 23 Jan 2023 12:41:34 -0800 Subject: [PATCH 016/868] chore(release): call release-integration workflow from release --- .github/workflows/node-integration.yml | 14 +++++---- .github/workflows/release-integration.yml | 29 +++++-------------- .../template-oss/_job-release-integration.yml | 3 ++ 3 files changed, 19 insertions(+), 27 deletions(-) create mode 100644 scripts/template-oss/_job-release-integration.yml diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml index c90a5e681dc37..48aac038bd30d 100644 --- a/.github/workflows/node-integration.yml +++ b/.github/workflows/node-integration.yml @@ -82,12 +82,16 @@ jobs: echo "::endgroup::" if [[ "${{ inputs.npmVersion }}" != "git" ]]; then - echo "::group::checking out npm@${{ inputs.npmVersion }}" + npmVersion="${{ inputs.npmVersion }}" + npmVersion="${npmVersion#v}" + echo "::group::checking out npm@${npmVersion}" pushd "$npmDir" >/dev/null - npmVersion=$(curl -sSL https://registry.npmjs.org/npm |\ - jq -r '.time | to_entries | map(select(.key | test("^${{ inputs.npmVersion }}"))) | sort_by(.value | split(".") | "\(.[0])Z" | fromdate) | .[-1].key') - npmGitHead=$(git show-ref --tags "v${npmVersion}" | cut -d' ' -f1) - git reset --hard "$npmGitHead" + taggedSha=$(git show-ref --tags "v${npmVersion}" | cut -d' ' -f1) + git reset --hard "$taggedSha" + publishedSha=$(curl -sSL https://registry.npmjs.org/npm | jq -r --arg ver "$npmVersion" '.versions[$ver].gitHead') + if [[ "$taggedSha" != "$publishedSha" ]]; then + echo "::warning ::git tag ($taggedSha) differs from published tag ($publishedSha)" + fi popd >/dev/null echo "::endgroup::" fi diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml index 07c68a50a2dc4..331f0682367ea 100644 --- a/.github/workflows/release-integration.yml +++ b/.github/workflows/release-integration.yml @@ -1,9 +1,12 @@ name: release integration on: - release: - types: - - published + workflow_call: + inputs: + npmVersion: + description: npm version to test + type: string + required: true workflow_dispatch: inputs: npmVersion: @@ -12,21 +15,6 @@ on: required: true jobs: - npm-version: - env: - npmVersion: ${{ inputs.npmVersion || github.ref_name }} - name: determine npm version - if: ${{ inputs.npmVersion || startsWith(github.ref_name, 'v') }} - runs-on: ubuntu-latest - outputs: - npmVersion: ${{ steps.version.outputs.npmVersion }} - steps: - - name: clean npm version - id: version - run: | - npmVersion="${{ env.npmVersion }}" - npmVersion="${npmVersion/#v}" - echo "npmVersion=${npmVersion}" >> $GITHUB_OUTPUT node-integration: name: nodejs@${{ matrix.nodeVersion }} integration strategy: @@ -36,10 +24,7 @@ jobs: - 18 - 19 - nightly - needs: - - npm-version uses: ./.github/workflows/node-integration.yml with: nodeVersion: ${{ matrix.nodeVersion }} - npmVersion: ${{ needs.npm-version.outputs.npmVersion }} - + npmVersion: ${{ inputs.npmVersion }} diff --git a/scripts/template-oss/_job-release-integration.yml b/scripts/template-oss/_job-release-integration.yml new file mode 100644 index 0000000000000..e72ee3c9895fa --- /dev/null +++ b/scripts/template-oss/_job-release-integration.yml @@ -0,0 +1,3 @@ +uses: ./.github/workflows/release-integration.yml +with: + npmVersion: $\{{ fromJSON(needs.release.outputs.release).version }} From eefd119583a29e9f090451b03258136a44e2ad5e Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 24 Jan 2023 13:19:29 -0800 Subject: [PATCH 017/868] chore: bump @npmcli/template-oss from 4.11.0 to 4.11.1 --- .github/workflows/release.yml | 114 ++++++++++++++++++++------ docs/package.json | 4 +- mock-registry/package.json | 4 +- package-lock.json | 40 ++++----- package.json | 4 +- smoke-tests/package.json | 4 +- workspaces/arborist/package.json | 4 +- workspaces/config/package.json | 4 +- workspaces/libnpmaccess/package.json | 4 +- workspaces/libnpmdiff/package.json | 4 +- workspaces/libnpmexec/package.json | 4 +- workspaces/libnpmfund/package.json | 4 +- workspaces/libnpmhook/package.json | 4 +- workspaces/libnpmorg/package.json | 4 +- workspaces/libnpmpack/package.json | 4 +- workspaces/libnpmpublish/package.json | 4 +- workspaces/libnpmsearch/package.json | 4 +- workspaces/libnpmteam/package.json | 4 +- workspaces/libnpmversion/package.json | 4 +- 19 files changed, 143 insertions(+), 79 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36cb489fc469b..487156d995ebc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,8 @@ jobs: release: outputs: pr: ${{ steps.release.outputs.pr }} + release: ${{ steps.release.outputs.release }} releases: ${{ steps.release.outputs.releases }} - release-flags: ${{ steps.release.outputs.release-flags }} branch: ${{ steps.release.outputs.pr-branch }} pr-number: ${{ steps.release.outputs.pr-number }} comment-id: ${{ steps.pr-comment.outputs.result }} @@ -60,26 +60,25 @@ jobs: REF_NAME: ${{ github.ref_name }} with: script: | - const { REF_NAME, PR_NUMBER } = process.env - const repo = { owner: context.repo.owner, repo: context.repo.repo } - const issue = { ...repo, issue_number: PR_NUMBER } + const { REF_NAME, PR_NUMBER: issue_number } = process.env + const { runId, repo: { owner, repo } } = context - const { data: workflow } = await github.rest.actions.getWorkflowRun({ ...repo, run_id: context.runId }) + const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId }) let body = '## Release Manager\n\n' - const comments = await github.paginate(github.rest.issues.listComments, issue) - let commentId = comments?.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id + const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) + let commentId = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n` body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`latest\`. ` body += `To force CI to update this PR, run this command:\n\n` - body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME}\n\`\`\`` + body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo}\n\`\`\`` if (commentId) { - await github.rest.issues.updateComment({ ...repo, comment_id: commentId, body }) + await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body }) } else { - const { data: comment } = await github.rest.issues.createComment({ ...issue, body }) + const { data: comment } = await github.rest.issues.createComment({ owner, repo, issue_number, body }) commentId = comment?.id } @@ -270,21 +269,86 @@ jobs: run: shell: bash steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Git User - run: | - git config --global user.email "npm-cli+bot@github.com" - git config --global user.name "npm CLI robot" - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: npm - - name: Reset Deps - run: node . run resetdeps - - name: Run Post Release Actions + - name: Create Release PR Comment + uses: actions/github-script@v6 env: RELEASES: ${{ needs.release.outputs.releases }} + with: + script: | + const releases = JSON.parse(process.env.RELEASES) + const { runId, repo: { owner, repo } } = context + const issue_number = releases[0].prNumber + + let body = '## Release Workflow\n\n' + for (const { pkgName, version, url } of releases) { + body += `- \`${pkgName}@${version}\` ${url}\n` + } + + const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) + const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at')) + + for (const comment of releaseComments) { + await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id }) + } + + const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}` + await github.rest.issues.createComment({ + owner, + repo, + issue_number, + body: `${body}- Workflow run: :arrows_counterclockwise: ${runUrl}`, + }) + + release-integration: + needs: release + name: Release Integration + if: needs.release.outputs.release + uses: ./.github/workflows/release-integration.yml + with: + npmVersion: ${{ fromJSON(needs.release.outputs.release).version }} + + post-release-integration: + needs: [ release, release-integration ] + name: Post Release Integration - Release + if: github.repository_owner == 'npm' && needs.release.outputs.release && always() + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Get Needs Result + id: needs-result run: | - node . run rp-release --ignore-scripts --if-present ${{ join(fromJSON(needs.release.outputs.release-flags), ' ') }} + result="" + if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then + result="x" + elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then + result="heavy_multiplication_x" + else + result="white_check_mark" + fi + echo "::set-output name=result::$result" + - name: Update Release PR Comment + uses: actions/github-script@v6 + env: + PR_NUMBER: ${{ fromJSON(needs.release.outputs.release).prNumber }} + RESULT: ${{ steps.needs-result.outputs.result }} + with: + script: | + const { PR_NUMBER: issue_number, RESULT } = process.env + const { repo: { owner, repo } } = context + + const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) + const updateComment = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith('## Release Workflow\n\n')) + + if (updateComment) { + console.log('Found comment to update:', JSON.stringify(updateComment, null, 2)) + await github.rest.issues.updateComment({ + owner, + repo, + comment_id: updateComment.id, + body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`), + }) + } else { + console.log('No matching comments found:', JSON.stringify(comments, null, 2)) + } diff --git a/docs/package.json b/docs/package.json index 704ff75bd24eb..2d92e2b37ecf5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "front-matter": "^4.0.2", "ignore-walk": "^6.0.0", "jsdom": "^20.0.3", @@ -56,7 +56,7 @@ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "ciVersions": "latest", "engines": "^14.17.0 || ^16.13.0 || >=18.0.0", - "version": "4.11.0", + "version": "4.11.1", "content": "../scripts/template-oss/index.js", "workspaceRepo": { "add": { diff --git a/mock-registry/package.json b/mock-registry/package.json index 65bd08118717b..36d05d370a5d1 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -34,7 +34,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0" + "version": "4.11.1" }, "tap": { "no-coverage": true, @@ -46,7 +46,7 @@ "devDependencies": { "@npmcli/arborist": "^6.1.1", "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7", diff --git a/package-lock.json b/package-lock.json index 56335fd7ba18d..5d5922175a3e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -163,7 +163,7 @@ "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "licensee": "^10.0.0", "nock": "^13.2.4", "npm-packlist": "^7.0.4", @@ -184,7 +184,7 @@ "devDependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "front-matter": "^4.0.2", "ignore-walk": "^6.0.0", "jsdom": "^20.0.3", @@ -209,7 +209,7 @@ "devDependencies": { "@npmcli/arborist": "^6.1.1", "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7", @@ -2258,9 +2258,9 @@ "link": true }, "node_modules/@npmcli/template-oss": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.0.tgz", - "integrity": "sha512-nvZqRxT9AFf56Fj07v1yG9AQVOTNn82ysMVI67IzpktunKFHmZ5Tp8P/al5pPik/nYQ4AieEyh7XC2dMro4moA==", + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.1.tgz", + "integrity": "sha512-Rs0sYcHhbcLA9mfQz/ojdNjKIMqyPG9kA/Ie2W4OxuBeVR/rhDf7yL4iqTK4Rum9dRVz9jWXex5PDNyDyiQnHw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -14290,7 +14290,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -14345,7 +14345,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^3.0.0", @@ -14372,7 +14372,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "engines": { @@ -14389,7 +14389,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14413,7 +14413,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "engines": { @@ -14440,7 +14440,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "bin-links": "^4.0.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -14460,7 +14460,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "engines": { @@ -14476,7 +14476,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14493,7 +14493,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "minipass": "^4.0.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -14513,7 +14513,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.0.7", "spawk": "^1.7.1", "tap": "^16.3.2" @@ -14535,7 +14535,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -14552,7 +14552,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14569,7 +14569,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14589,7 +14589,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "require-inject": "^1.4.4", "tap": "^16.3.2" }, diff --git a/package.json b/package.json index 423024ae21c86..f617d9b169378 100644 --- a/package.json +++ b/package.json @@ -196,7 +196,7 @@ "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "licensee": "^10.0.0", "nock": "^13.2.4", "npm-packlist": "^7.0.4", @@ -250,7 +250,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "./scripts/template-oss/root.js" }, "license": "Artistic-2.0", diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 474ad2c8c7516..cff5f190a01f1 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -21,7 +21,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -32,7 +32,7 @@ "license": "ISC", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index a7e8132123fba..45583708fc490 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^3.0.0", @@ -100,7 +100,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 50d860c1c941e..11835648ea061 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "dependencies": { @@ -50,6 +50,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0" + "version": "4.11.1" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 1e27f79597c02..c16c640c5eb63 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -41,7 +41,7 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 9e7e3bdb41fc5..bf53804d5e35f 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "dependencies": { @@ -59,7 +59,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index c0092d4c8767b..ab8344271cda8 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "bin-links": "^4.0.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -76,7 +76,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index c0de224fba7ef..26ae8834138e3 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "tap": "^16.3.2" }, "dependencies": { @@ -53,7 +53,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index b157f97e685b4..e1e55e0234985 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 529a7ff9d2c97..b8dacb4a646a1 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -28,7 +28,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "minipass": "^4.0.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -49,7 +49,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 035edaa9808d5..b52c60afe634f 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.0.7", "spawk": "^1.7.1", "tap": "^16.3.2" @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index c293d566d1dc2..6c64950744314 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -50,7 +50,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index e0d67afbbf66d..4dcac9839e61e 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -45,7 +45,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index b3444c77b8dcf..38b08c83d7bcf 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -39,7 +39,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index ff3855ae6c1a3..c839a95fb9c13 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.11.1", "require-inject": "^1.4.4", "tap": "^16.3.2" }, @@ -48,7 +48,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0", + "version": "4.11.1", "content": "../../scripts/template-oss/index.js" } } From 6af152b6a9fadca08000b1c64bfbda2a288081d5 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 25 Jan 2023 09:04:48 -0800 Subject: [PATCH 018/868] chore(release): drop actions permission from node-integration workflow --- .github/workflows/node-integration.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml index 48aac038bd30d..b6ed78ba04aad 100644 --- a/.github/workflows/node-integration.yml +++ b/.github/workflows/node-integration.yml @@ -27,10 +27,6 @@ on: type: string default: git -# used by setup-ccache-action's post hook to cleanup old caches -permissions: - actions: write - jobs: build-nodejs: name: build nodejs@${{ inputs.nodeVersion }} npm@${{ inputs.npmVersion }} From 8d6d8519fbbcebdca8834e19cb34ac71f045a010 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 25 Jan 2023 12:47:29 -0800 Subject: [PATCH 019/868] feat: added --install-strategy=linked (#6078) Co-authored-by: Vincent Bailly Implements the RFC https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md Packages are installed in node_modules/.store flat, and linked into the node_modules tree in depth, rather than hoisted. --- DEPENDENCIES.md | 1 + lib/utils/config/definitions.js | 4 +- node_modules/.gitignore | 2 +- .../node_modules => }/buffer/AUTHORS.md | 0 .../node_modules => }/buffer/LICENSE | 0 .../node_modules => }/buffer/index.d.ts | 0 .../node_modules => }/buffer/index.js | 0 .../node_modules => }/buffer/package.json | 0 package-lock.json | 113 +- .../tap-snapshots/test/index.js.test.cjs | 6 +- tap-snapshots/test/lib/docs.js.test.cjs | 42 +- .../arborist/lib/arborist/build-ideal-tree.js | 1 + workspaces/arborist/lib/arborist/index.js | 1 + .../arborist/lib/arborist/isolated-reifier.js | 453 +++++ workspaces/arborist/lib/arborist/rebuild.js | 11 +- workspaces/arborist/lib/arborist/reify.js | 98 +- workspaces/arborist/lib/link.js | 4 +- workspaces/arborist/lib/node.js | 2 + workspaces/arborist/package.json | 2 + .../tap-snapshots/test/link.js.test.cjs | 6 + .../tap-snapshots/test/node.js.test.cjs | 290 +++ workspaces/arborist/test/arborist/reify.js | 58 + .../arborist/test/fixtures/isolated-nock.js | 203 +++ workspaces/arborist/test/isolated-mode.js | 1574 +++++++++++++++++ 24 files changed, 2783 insertions(+), 88 deletions(-) rename node_modules/{are-we-there-yet/node_modules => }/buffer/AUTHORS.md (100%) rename node_modules/{are-we-there-yet/node_modules => }/buffer/LICENSE (100%) rename node_modules/{are-we-there-yet/node_modules => }/buffer/index.d.ts (100%) rename node_modules/{are-we-there-yet/node_modules => }/buffer/index.js (100%) rename node_modules/{are-we-there-yet/node_modules => }/buffer/package.json (100%) create mode 100644 workspaces/arborist/lib/arborist/isolated-reifier.js create mode 100644 workspaces/arborist/test/fixtures/isolated-nock.js create mode 100644 workspaces/arborist/test/isolated-mode.js diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 69b72b640df87..4ea6d6f5e6239 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -618,6 +618,7 @@ graph LR; npmcli-arborist-->semver; npmcli-arborist-->ssri; npmcli-arborist-->tap; + npmcli-arborist-->tar-stream; npmcli-arborist-->tcompare; npmcli-arborist-->treeverse; npmcli-arborist-->walk-up-path; diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 9ddbafd46f7bc..578e0daa67737 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1090,14 +1090,14 @@ define('install-links', { define('install-strategy', { default: 'hoisted', - type: ['hoisted', 'nested', 'shallow'], + type: ['hoisted', 'nested', 'shallow', 'linked'], description: ` Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct deps at top-level. - linked: (coming soon) install in node_modules/.store, link in place, + linked: (experimental) install in node_modules/.store, link in place, unhoisted. `, flatten, diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 9861a76e6a417..1a8e77b91f589 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -43,13 +43,13 @@ !/are-we-there-yet !/are-we-there-yet/node_modules/ /are-we-there-yet/node_modules/* -!/are-we-there-yet/node_modules/buffer !/are-we-there-yet/node_modules/readable-stream !/balanced-match !/base64-js !/bin-links !/binary-extensions !/brace-expansion +!/buffer !/builtins !/cacache !/chalk diff --git a/node_modules/are-we-there-yet/node_modules/buffer/AUTHORS.md b/node_modules/buffer/AUTHORS.md similarity index 100% rename from node_modules/are-we-there-yet/node_modules/buffer/AUTHORS.md rename to node_modules/buffer/AUTHORS.md diff --git a/node_modules/are-we-there-yet/node_modules/buffer/LICENSE b/node_modules/buffer/LICENSE similarity index 100% rename from node_modules/are-we-there-yet/node_modules/buffer/LICENSE rename to node_modules/buffer/LICENSE diff --git a/node_modules/are-we-there-yet/node_modules/buffer/index.d.ts b/node_modules/buffer/index.d.ts similarity index 100% rename from node_modules/are-we-there-yet/node_modules/buffer/index.d.ts rename to node_modules/buffer/index.d.ts diff --git a/node_modules/are-we-there-yet/node_modules/buffer/index.js b/node_modules/buffer/index.js similarity index 100% rename from node_modules/are-we-there-yet/node_modules/buffer/index.js rename to node_modules/buffer/index.js diff --git a/node_modules/are-we-there-yet/node_modules/buffer/package.json b/node_modules/buffer/package.json similarity index 100% rename from node_modules/are-we-there-yet/node_modules/buffer/package.json rename to node_modules/buffer/package.json diff --git a/package-lock.json b/package-lock.json index 5d5922175a3e3..de1bfaf2b6f57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2776,29 +2776,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/are-we-there-yet/node_modules/buffer": { - "version": "6.0.3", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/are-we-there-yet/node_modules/readable-stream": { "version": "4.2.0", "inBundle": true, @@ -2921,6 +2898,12 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, + "node_modules/b4a": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.1.tgz", + "integrity": "sha512-AsKjNhz72yxteo/0EtQEiwkMUgk/tGmycXlbG4g3Ard2/ULtNLUykGOkeK0egmN27h0xMAhb76jYccW+XTBExA==", + "dev": true + }, "node_modules/bail": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", @@ -3000,6 +2983,32 @@ "node": ">=10" } }, + "node_modules/bl": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.0.tgz", + "integrity": "sha512-Ik9BVIMdcWzSOCpzDv2XpQ4rJ4oZBuk3ck6MgiOv0EopdgtohN2uSCrrLlkH1Jf0KnpZZMBA3D0bUMbCdj/jgA==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.3.0.tgz", + "integrity": "sha512-MuEnA0lbSi7JS8XM+WNJlWZkHAAdm7gETHdFK//Q/mChGyj2akEFtdLZh32jSdkWGbRwCW9pn6g3LWDdDeZnBQ==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -3054,6 +3063,30 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "inBundle": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4964,6 +4997,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.1.0.tgz", + "integrity": "sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==", + "dev": true + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -9845,6 +9884,12 @@ ], "peer": true }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "dev": true + }, "node_modules/quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -10930,6 +10975,16 @@ "escodegen": "^1.8.1" } }, + "node_modules/streamx": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.13.2.tgz", + "integrity": "sha512-+TWqixPhGDXEG9L/XczSbhfkmwAtGs3BJX5QNU6cvno+pOLKeszByWcnaTu6dg8efsTYqR8ZZuXWHhZfgrxMvA==", + "dev": true, + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "inBundle": true, @@ -13193,6 +13248,17 @@ "node": ">=10" } }, + "node_modules/tar-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.0.0.tgz", + "integrity": "sha512-O6OfUKBbQOqAhh6owTWmA730J/yZCYcpmZ1DBj2YX51ZQrt7d7NgzrR+CnO9wP6nt/viWZW2XeXLavX3/ZEbEg==", + "dev": true, + "dependencies": { + "b4a": "^1.6.1", + "bl": "^6.0.0", + "streamx": "^2.12.5" + } + }, "node_modules/tcompare": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-5.0.7.tgz", @@ -14351,6 +14417,7 @@ "minify-registry-metadata": "^3.0.0", "nock": "^13.2.0", "tap": "^16.3.2", + "tar-stream": "^3.0.0", "tcompare": "^5.0.6" }, "engines": { diff --git a/smoke-tests/tap-snapshots/test/index.js.test.cjs b/smoke-tests/tap-snapshots/test/index.js.test.cjs index de87748529e5f..662c831160eb2 100644 --- a/smoke-tests/tap-snapshots/test/index.js.test.cjs +++ b/smoke-tests/tap-snapshots/test/index.js.test.cjs @@ -55,9 +55,9 @@ npm ERR! npm ci npm ERR! npm ERR! Options: npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -npm ERR! [-E|--save-exact] [-g|--global] [--install-strategy ] -npm ERR! [--legacy-bundling] [--global-style] -npm ERR! [--omit [--omit ...]] +npm ERR! [-E|--save-exact] [-g|--global] +npm ERR! [--install-strategy ] [--legacy-bundling] +npm ERR! [--global-style] [--omit [--omit ...]] npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] npm ERR! [-w|--workspace [-w|--workspace ...]] diff --git a/tap-snapshots/test/lib/docs.js.test.cjs b/tap-snapshots/test/lib/docs.js.test.cjs index ad37be5218e1a..c882b320524c3 100644 --- a/tap-snapshots/test/lib/docs.js.test.cjs +++ b/tap-snapshots/test/lib/docs.js.test.cjs @@ -1163,13 +1163,13 @@ workspaces. #### \`install-strategy\` * Default: "hoisted" -* Type: "hoisted", "nested", or "shallow" +* Type: "hoisted", "nested", "shallow", or "linked" Sets the strategy for installing packages in node_modules. hoisted (default): Install non-duplicated in top-level, and duplicated as necessary within directory structure. nested: (formerly --legacy-bundling) install in place, no hoisting. shallow (formerly --global-style) only install direct -deps at top-level. linked: (coming soon) install in node_modules/.store, +deps at top-level. linked: (experimental) install in node_modules/.store, link in place, unhoisted. #### \`json\` @@ -2621,9 +2621,9 @@ npm ci Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-E|--save-exact] [-g|--global] [--install-strategy ] -[--legacy-bundling] [--global-style] -[--omit [--omit ...]] +[-E|--save-exact] [-g|--global] +[--install-strategy ] [--legacy-bundling] +[--global-style] [--omit [--omit ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] @@ -2723,7 +2723,7 @@ Usage: npm dedupe Options: -[--install-strategy ] [--legacy-bundling] +[--install-strategy ] [--legacy-bundling] [--global-style] [--strict-peer-deps] [--no-package-lock] [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] @@ -2994,7 +2994,7 @@ Usage: npm find-dupes Options: -[--install-strategy ] [--legacy-bundling] +[--install-strategy ] [--legacy-bundling] [--global-style] [--strict-peer-deps] [--no-package-lock] [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] @@ -3175,9 +3175,9 @@ npm install [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-E|--save-exact] [-g|--global] [--install-strategy ] -[--legacy-bundling] [--global-style] -[--omit [--omit ...]] +[-E|--save-exact] [-g|--global] +[--install-strategy ] [--legacy-bundling] +[--global-style] [--omit [--omit ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] @@ -3222,9 +3222,9 @@ npm install-ci-test Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-E|--save-exact] [-g|--global] [--install-strategy ] -[--legacy-bundling] [--global-style] -[--omit [--omit ...]] +[-E|--save-exact] [-g|--global] +[--install-strategy ] [--legacy-bundling] +[--global-style] [--omit [--omit ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] @@ -3269,9 +3269,9 @@ npm install-test [ ...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-E|--save-exact] [-g|--global] [--install-strategy ] -[--legacy-bundling] [--global-style] -[--omit [--omit ...]] +[-E|--save-exact] [-g|--global] +[--install-strategy ] [--legacy-bundling] +[--global-style] [--omit [--omit ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] @@ -3316,8 +3316,9 @@ npm link [] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-E|--save-exact] [-g|--global] [--install-strategy ] -[--legacy-bundling] [--global-style] [--strict-peer-deps] [--no-package-lock] +[-E|--save-exact] [-g|--global] +[--install-strategy ] [--legacy-bundling] +[--global-style] [--strict-peer-deps] [--no-package-lock] [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] @@ -4221,8 +4222,9 @@ npm update [...] Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] -[-g|--global] [--install-strategy ] [--legacy-bundling] -[--global-style] [--omit [--omit ...]] +[-g|--global] [--install-strategy ] +[--legacy-bundling] [--global-style] +[--omit [--omit ...]] [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index a9c4b4bc0bb6d..2ea66ac336414 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -1232,6 +1232,7 @@ This is a one-time fix-up, please be patient... const isWorkspace = this.idealTree.workspaces && this.idealTree.workspaces.has(spec.name) // spec is a directory, link it unless installLinks is set or it's a workspace + // TODO post arborist refactor, will need to check for installStrategy=linked if (spec.type === 'directory' && (isWorkspace || !installLinks)) { return this[_linkFromSpec](name, spec, parent, edge) } diff --git a/workspaces/arborist/lib/arborist/index.js b/workspaces/arborist/lib/arborist/index.js index 091e0b46574cc..afcc3ec27150b 100644 --- a/workspaces/arborist/lib/arborist/index.js +++ b/workspaces/arborist/lib/arborist/index.js @@ -42,6 +42,7 @@ const mixins = [ require('./load-virtual.js'), require('./rebuild.js'), require('./reify.js'), + require('./isolated-reifier.js'), ] const _workspacesEnabled = Symbol.for('workspacesEnabled') diff --git a/workspaces/arborist/lib/arborist/isolated-reifier.js b/workspaces/arborist/lib/arborist/isolated-reifier.js new file mode 100644 index 0000000000000..f4f1bb8e44362 --- /dev/null +++ b/workspaces/arborist/lib/arborist/isolated-reifier.js @@ -0,0 +1,453 @@ +const _makeIdealGraph = Symbol('makeIdealGraph') +const _createIsolatedTree = Symbol.for('createIsolatedTree') +const _createBundledTree = Symbol('createBundledTree') +const fs = require('fs') +const pacote = require('pacote') +const { join } = require('path') +const { depth } = require('treeverse') +const crypto = require('crypto') + +// cache complicated function results +const memoize = (fn) => { + const memo = new Map() + return async function (arg) { + const key = arg + if (memo.has(key)) { + return memo.get(key) + } + const result = {} + memo.set(key, result) + await fn(result, arg) + return result + } +} + +module.exports = cls => class IsolatedReifier extends cls { + /** + * Create an ideal graph. + * + * An implementation of npm RFC-0042 + * https://github.com/npm/rfcs/blob/main/accepted/0042-isolated-mode.md + * + * This entire file should be considered technical debt that will be resolved + * with an Arborist refactor or rewrite. Embedded logic in Nodes and Links, + * and the incremental state of building trees and reifying contains too many + * assumptions to do a linked mode properly. + * + * Instead, this approach takes a tree built from build-ideal-tree, and + * returns a new tree-like structure without the embedded logic of Node and + * Link classes. + * + * Since the RFC requires leaving the package-lock in place, this approach + * temporarily replaces the tree state for a couple of steps of reifying. + * + **/ + async [_makeIdealGraph] (options) { + /* Make sure that the ideal tree is build as the rest of + * the algorithm depends on it. + */ + const bitOpt = { + ...options, + complete: false, + } + await this.buildIdealTree(bitOpt) + const idealTree = this.idealTree + + this.rootNode = {} + const root = this.rootNode + this.counter = 0 + + // memoize to cache generating proxy Nodes + this.externalProxyMemo = memoize(this.externalProxy.bind(this)) + this.workspaceProxyMemo = memoize(this.workspaceProxy.bind(this)) + + root.external = [] + root.isProjectRoot = true + root.localLocation = idealTree.location + root.localPath = idealTree.path + root.workspaces = await Promise.all( + Array.from(idealTree.fsChildren.values(), this.workspaceProxyMemo)) + const processed = new Set() + const queue = [idealTree, ...idealTree.fsChildren] + while (queue.length !== 0) { + const next = queue.pop() + if (processed.has(next.location)) { + continue + } + processed.add(next.location) + next.edgesOut.forEach(e => { + if (!e.to || (next.package.bundleDependencies || next.package.bundledDependencies || []).includes(e.to.name)) { + return + } + queue.push(e.to) + }) + if (!next.isProjectRoot && !next.isWorkspace) { + root.external.push(await this.externalProxyMemo(next)) + } + } + + await this.assignCommonProperties(idealTree, root) + + this.idealGraph = root + } + + async workspaceProxy (result, node) { + result.localLocation = node.location + result.localPath = node.path + result.isWorkspace = true + result.resolved = node.resolved + await this.assignCommonProperties(node, result) + } + + async externalProxy (result, node) { + await this.assignCommonProperties(node, result) + if (node.hasShrinkwrap) { + const dir = join( + node.root.path, + 'node_modules', + '.store', + `${node.name}@${node.version}` + ) + fs.mkdirSync(dir, { recursive: true }) + // TODO this approach feels wrong + // and shouldn't be necessary for shrinkwraps + await pacote.extract(node.resolved, dir, { + ...this.options, + resolved: node.resolved, + integrity: node.integrity, + }) + const Arborist = this.constructor + const arb = new Arborist({ ...this.options, path: dir }) + await arb[_makeIdealGraph]({ dev: false }) + this.rootNode.external.push(...arb.idealGraph.external) + arb.idealGraph.external.forEach(e => { + e.root = this.rootNode + e.id = `${node.id}=>${e.id}` + }) + result.localDependencies = [] + result.externalDependencies = arb.idealGraph.externalDependencies + result.externalOptionalDependencies = arb.idealGraph.externalOptionalDependencies + result.dependencies = [ + ...result.externalDependencies, + ...result.localDependencies, + ...result.externalOptionalDependencies, + ] + } + result.optional = node.optional + result.resolved = node.resolved + result.version = node.version + } + + async assignCommonProperties (node, result) { + function validEdgesOut (node) { + return [...node.edgesOut.values()].filter(e => e.to && e.to.target && !(node.package.bundledDepenedencies || node.package.bundleDependencies || []).includes(e.to.name)) + } + const edges = validEdgesOut(node) + const optionalDeps = edges.filter(e => e.optional).map(e => e.to.target) + const nonOptionalDeps = edges.filter(e => !e.optional).map(e => e.to.target) + + result.localDependencies = await Promise.all(nonOptionalDeps.filter(n => n.isWorkspace).map(this.workspaceProxyMemo)) + result.externalDependencies = await Promise.all(nonOptionalDeps.filter(n => !n.isWorkspace).map(this.externalProxyMemo)) + result.externalOptionalDependencies = await Promise.all(optionalDeps.map(this.externalProxyMemo)) + result.dependencies = [ + ...result.externalDependencies, + ...result.localDependencies, + ...result.externalOptionalDependencies, + ] + result.root = this.rootNode + result.id = this.counter++ + result.name = node.name + result.package = { ...node.package } + result.package.bundleDependencies = undefined + result.hasInstallScript = node.hasInstallScript + } + + async [_createBundledTree] () { + // TODO: make sure that idealTree object exists + const idealTree = this.idealTree + // TODO: test workspaces having bundled deps + const queue = [] + + for (const [, edge] of idealTree.edgesOut) { + if (edge.to && (idealTree.package.bundleDependencies || idealTree.package.bundledDependencies || []).includes(edge.to.name)) { + queue.push({ from: idealTree, to: edge.to }) + } + } + for (const child of idealTree.fsChildren) { + for (const [, edge] of child.edgesOut) { + if (edge.to && (child.package.bundleDependencies || child.package.bundledDependencies || []).includes(edge.to.name)) { + queue.push({ from: child, to: edge.to }) + } + } + } + + const processed = new Set() + const nodes = new Map() + const edges = [] + while (queue.length !== 0) { + const nextEdge = queue.pop() + const key = `${nextEdge.from.location}=>${nextEdge.to.location}` + // should be impossible, unless bundled is duped + /* istanbul ignore next */ + if (processed.has(key)) { + continue + } + processed.add(key) + const from = nextEdge.from + if (!from.isRoot && !from.isWorkspace) { + nodes.set(from.location, { location: from.location, resolved: from.resolved, name: from.name, optional: from.optional, pkg: { ...from.package, bundleDependencies: undefined } }) + } + const to = nextEdge.to + nodes.set(to.location, { location: to.location, resolved: to.resolved, name: to.name, optional: to.optional, pkg: { ...to.package, bundleDependencies: undefined } }) + edges.push({ from: from.isRoot ? 'root' : from.location, to: to.location }) + + to.edgesOut.forEach(e => { + // an edge out should always have a to + /* istanbul ignore else */ + if (e.to) { + queue.push({ from: e.from, to: e.to }) + } + }) + } + return { edges, nodes } + } + + async [_createIsolatedTree] (idealTree) { + await this[_makeIdealGraph](this.options) + + const proxiedIdealTree = this.idealGraph + + const bundledTree = await this[_createBundledTree]() + + const treeHash = (startNode) => { + // generate short hash based on the dependency tree + // starting at this node + const deps = [] + const branch = [] + depth({ + tree: startNode, + getChildren: node => node.dependencies, + filter: node => node, + visit: node => { + branch.push(`${node.name}@${node.version}`) + deps.push(`${branch.join('->')}::${node.resolved}`) + }, + leave: () => { + branch.pop() + }, + }) + deps.sort() + return crypto.createHash('shake256', { outputLength: 16 }) + .update(deps.join(',')) + .digest('base64') + // Node v14 doesn't support base64url + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/=+$/m, '') + } + + const getKey = (idealTreeNode) => { + return `${idealTreeNode.name}@${idealTreeNode.version}-${treeHash(idealTreeNode)}` + } + + const root = { + fsChildren: [], + integrity: null, + inventory: new Map(), + isLink: false, + isRoot: true, + binPaths: [], + edgesIn: new Set(), + edgesOut: new Map(), + hasShrinkwrap: false, + parent: null, + // TODO: we should probably not reference this.idealTree + resolved: this.idealTree.resolved, + isTop: true, + path: proxiedIdealTree.root.localPath, + realpath: proxiedIdealTree.root.localPath, + package: proxiedIdealTree.root.package, + meta: { loadedFromDisk: false }, + global: false, + isProjectRoot: true, + children: [], + } + // root.inventory.set('', t) + // root.meta = this.idealTree.meta + // TODO We should mock better the inventory object because it is used by audit-report.js ... maybe + root.inventory.query = () => { + return [] + } + const processed = new Set() + proxiedIdealTree.workspaces.forEach(c => { + const workspace = { + edgesIn: new Set(), + edgesOut: new Map(), + children: [], + hasInstallScript: c.hasInstallScript, + binPaths: [], + package: c.package, + location: c.localLocation, + path: c.localPath, + realpath: c.localPath, + resolved: c.resolved, + } + root.fsChildren.push(workspace) + root.inventory.set(workspace.location, workspace) + }) + const generateChild = (node, location, pkg, inStore) => { + const newChild = { + global: false, + globalTop: false, + isProjectRoot: false, + isTop: false, + location, + name: node.name, + optional: node.optional, + top: { path: proxiedIdealTree.root.localPath }, + children: [], + edgesIn: new Set(), + edgesOut: new Map(), + binPaths: [], + fsChildren: [], + /* istanbul ignore next -- emulate Node */ + getBundler () { + return null + }, + hasShrinkwrap: false, + inDepBundle: false, + integrity: null, + isLink: false, + isRoot: false, + isInStore: inStore, + path: join(proxiedIdealTree.root.localPath, location), + realpath: join(proxiedIdealTree.root.localPath, location), + resolved: node.resolved, + version: pkg.version, + package: pkg, + } + newChild.target = newChild + root.children.push(newChild) + root.inventory.set(newChild.location, newChild) + } + proxiedIdealTree.external.forEach(c => { + const key = getKey(c) + if (processed.has(key)) { + return + } + processed.add(key) + const location = join('node_modules', '.store', key, 'node_modules', c.name) + generateChild(c, location, c.package, true) + }) + bundledTree.nodes.forEach(node => { + generateChild(node, node.location, node.pkg, false) + }) + bundledTree.edges.forEach(e => { + const from = e.from === 'root' ? root : root.inventory.get(e.from) + const to = root.inventory.get(e.to) + // Maybe optional should be propagated from the original edge + const edge = { optional: false, from, to } + from.edgesOut.set(to.name, edge) + to.edgesIn.add(edge) + }) + const memo = new Set() + + function processEdges (node, externalEdge) { + externalEdge = !!externalEdge + const key = getKey(node) + if (memo.has(key)) { + return + } + memo.add(key) + + let from, nmFolder + if (externalEdge) { + const fromLocation = join('node_modules', '.store', key, 'node_modules', node.name) + from = root.children.find(c => c.location === fromLocation) + nmFolder = join('node_modules', '.store', key, 'node_modules') + } else { + from = node.isProjectRoot ? root : root.fsChildren.find(c => c.location === node.localLocation) + nmFolder = join(node.localLocation, 'node_modules') + } + + const processDeps = (dep, optional, external) => { + optional = !!optional + external = !!external + + const location = join(nmFolder, dep.name) + const binNames = dep.package.bin && Object.keys(dep.package.bin) || [] + const toKey = getKey(dep) + + let target + if (external) { + const toLocation = join('node_modules', '.store', toKey, 'node_modules', dep.name) + target = root.children.find(c => c.location === toLocation) + } else { + target = root.fsChildren.find(c => c.location === dep.localLocation) + } + // TODO: we should no-op is an edge has already been created with the same fromKey and toKey + + binNames.forEach(bn => { + target.binPaths.push(join(from.realpath, 'node_modules', '.bin', bn)) + }) + + const link = { + global: false, + globalTop: false, + isProjectRoot: false, + edgesIn: new Set(), + edgesOut: new Map(), + binPaths: [], + isTop: false, + optional, + location: location, + path: join(dep.root.localPath, nmFolder, dep.name), + realpath: target.path, + name: toKey, + resolved: dep.resolved, + top: { path: dep.root.localPath }, + children: [], + fsChildren: [], + isLink: true, + isStoreLink: true, + isRoot: false, + package: { _id: 'abc', bundleDependencies: undefined, deprecated: undefined, bin: target.package.bin, scripts: dep.package.scripts }, + target, + } + const newEdge1 = { optional, from, to: link } + from.edgesOut.set(dep.name, newEdge1) + link.edgesIn.add(newEdge1) + const newEdge2 = { optional: false, from: link, to: target } + link.edgesOut.set(dep.name, newEdge2) + target.edgesIn.add(newEdge2) + root.children.push(link) + } + + for (const dep of node.localDependencies) { + processEdges(dep, false) + // nonOptional, local + processDeps(dep, false, false) + } + for (const dep of node.externalDependencies) { + processEdges(dep, true) + // nonOptional, external + processDeps(dep, false, true) + } + for (const dep of node.externalOptionalDependencies) { + processEdges(dep, true) + // optional, external + processDeps(dep, true, true) + } + } + + processEdges(proxiedIdealTree, false) + for (const node of proxiedIdealTree.workspaces) { + processEdges(node, false) + } + root.children.forEach(c => c.parent = root) + root.children.forEach(c => c.root = root) + root.root = root + root.target = root + return root + } +} diff --git a/workspaces/arborist/lib/arborist/rebuild.js b/workspaces/arborist/lib/arborist/rebuild.js index 6a675320d864b..e8df69e328ce8 100644 --- a/workspaces/arborist/lib/arborist/rebuild.js +++ b/workspaces/arborist/lib/arborist/rebuild.js @@ -89,6 +89,7 @@ module.exports = cls => class Builder extends cls { const { depNodes, linkNodes, + storeNodes, } = this[_retrieveNodesByType](nodes) // build regular deps @@ -99,6 +100,10 @@ module.exports = cls => class Builder extends cls { this[_resetQueues]() await this[_build](linkNodes, { type: 'links' }) } + if (storeNodes.size) { + this[_resetQueues]() + await this[_build](storeNodes, { type: 'storelinks' }) + } process.emit('timeEnd', 'build') } @@ -130,9 +135,12 @@ module.exports = cls => class Builder extends cls { [_retrieveNodesByType] (nodes) { const depNodes = new Set() const linkNodes = new Set() + const storeNodes = new Set() for (const node of nodes) { - if (node.isLink) { + if (node.isStoreLink) { + storeNodes.add(node) + } else if (node.isLink) { linkNodes.add(node) } else { depNodes.add(node) @@ -154,6 +162,7 @@ module.exports = cls => class Builder extends cls { return { depNodes, linkNodes, + storeNodes, } } diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index e5ccec5c71d96..3c8059d281d13 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -1,5 +1,4 @@ // mixin implementing the reify method - const onExit = require('../signal-handling.js') const pacote = require('pacote') const AuditReport = require('../audit-report.js') @@ -10,8 +9,9 @@ const debug = require('../debug.js') const walkUp = require('walk-up-path') const log = require('proc-log') const hgi = require('hosted-git-info') +const rpj = require('read-package-json-fast') -const { dirname, resolve, relative } = require('path') +const { dirname, resolve, relative, join } = require('path') const { depth: dfwalk } = require('treeverse') const { lstat, @@ -106,6 +106,8 @@ const _resolvedAdd = Symbol.for('resolvedAdd') const _usePackageLock = Symbol.for('usePackageLock') const _formatPackageLock = Symbol.for('formatPackageLock') +const _createIsolatedTree = Symbol.for('createIsolatedTree') + module.exports = cls => class Reifier extends cls { constructor (options) { super(options) @@ -138,6 +140,8 @@ module.exports = cls => class Reifier extends cls { // public method async reify (options = {}) { + const linked = (options.installStrategy || this.options.installStrategy) === 'linked' + if (this[_packageLockOnly] && this[_global]) { const er = new Error('cannot generate lockfile for global packages') er.code = 'ESHRINKWRAPGLOBAL' @@ -154,8 +158,22 @@ module.exports = cls => class Reifier extends cls { process.emit('time', 'reify') await this[_validatePath]() await this[_loadTrees](options) + + const oldTree = this.idealTree + if (linked) { + // swap out the tree with the isolated tree + // this is currently technical debt which will be resolved in a refactor + // of Node/Link trees + log.warn('reify', 'The "linked" install strategy is EXPERIMENTAL and may contain bugs.') + this.idealTree = await this[_createIsolatedTree](this.idealTree) + } await this[_diffTrees]() await this[_reifyPackages]() + if (linked) { + // swap back in the idealTree + // so that the lockfile is preserved + this.idealTree = oldTree + } await this[_saveIdealTree](options) await this[_copyIdealToActual]() // This is a very bad pattern and I can't wait to stop doing it @@ -634,44 +652,40 @@ module.exports = cls => class Reifier extends cls { } async [_extractOrLink] (node) { - // in normal cases, node.resolved should *always* be set by now. - // however, it is possible when a lockfile is damaged, or very old, - // or in some other race condition bugs in npm v6, that a previously - // bundled dependency will have just a version, but no resolved value, - // and no 'bundled: true' setting. - // Do the best with what we have, or else remove it from the tree - // entirely, since we can't possibly reify it. - let res = null - if (node.resolved) { - const registryResolved = this[_registryResolved](node.resolved) - if (registryResolved) { - res = `${node.name}@${registryResolved}` - } - } else if (node.packageName && node.version) { - res = `${node.packageName}@${node.version}` - } - - // no idea what this thing is. remove it from the tree. - if (!res) { - const warning = 'invalid or damaged lockfile detected\n' + - 'please re-try this operation once it completes\n' + - 'so that the damage can be corrected, or perform\n' + - 'a fresh install with no lockfile if the problem persists.' - log.warn('reify', warning) - log.verbose('reify', 'unrecognized node in tree', node.path) - node.parent = null - node.fsParent = null - this[_addNodeToTrashList](node) - return - } - const nm = resolve(node.parent.path, 'node_modules') await this[_validateNodeModules](nm) - if (node.isLink) { - await rm(node.path, { recursive: true, force: true }) - await this[_symlink](node) - } else { + if (!node.isLink) { + // in normal cases, node.resolved should *always* be set by now. + // however, it is possible when a lockfile is damaged, or very old, + // or in some other race condition bugs in npm v6, that a previously + // bundled dependency will have just a version, but no resolved value, + // and no 'bundled: true' setting. + // Do the best with what we have, or else remove it from the tree + // entirely, since we can't possibly reify it. + let res = null + if (node.resolved) { + const registryResolved = this[_registryResolved](node.resolved) + if (registryResolved) { + res = `${node.name}@${registryResolved}` + } + } else if (node.package.name && node.version) { + res = `${node.package.name}@${node.version}` + } + + // no idea what this thing is. remove it from the tree. + if (!res) { + const warning = 'invalid or damaged lockfile detected\n' + + 'please re-try this operation once it completes\n' + + 'so that the damage can be corrected, or perform\n' + + 'a fresh install with no lockfile if the problem persists.' + log.warn('reify', warning) + log.verbose('reify', 'unrecognized node in tree', node.path) + node.parent = null + node.fsParent = null + this[_addNodeToTrashList](node) + return + } await debug(async () => { const st = await lstat(node.path).catch(e => null) if (st && !st.isDirectory()) { @@ -688,7 +702,17 @@ module.exports = cls => class Reifier extends cls { resolved: node.resolved, integrity: node.integrity, }) + // store nodes don't use Node class so node.package doesn't get updated + if (node.isInStore) { + const pkg = await rpj(join(node.path, 'package.json')) + node.package.scripts = pkg.scripts + } + return } + + // node.isLink + await rm(node.path, { recursive: true, force: true }) + await this[_symlink](node) } async [_symlink] (node) { diff --git a/workspaces/arborist/lib/link.js b/workspaces/arborist/lib/link.js index ebdbc94285f1c..197f96c5c2ddb 100644 --- a/workspaces/arborist/lib/link.js +++ b/workspaces/arborist/lib/link.js @@ -8,7 +8,7 @@ const _delistFromMeta = Symbol.for('_delistFromMeta') const _refreshLocation = Symbol.for('_refreshLocation') class Link extends Node { constructor (options) { - const { root, realpath, target, parent, fsParent } = options + const { root, realpath, target, parent, fsParent, isStoreLink } = options if (!realpath && !(target && target.path)) { throw new TypeError('must provide realpath for Link node') @@ -23,6 +23,8 @@ class Link extends Node { : null), }) + this.isStoreLink = isStoreLink || false + if (target) { this.target = target } else if (this.realpath === this.root.path) { diff --git a/workspaces/arborist/lib/node.js b/workspaces/arborist/lib/node.js index b90a2acf8f8ae..b21a3d8e3de0a 100644 --- a/workspaces/arborist/lib/node.js +++ b/workspaces/arborist/lib/node.js @@ -91,6 +91,7 @@ class Node { installLinks = false, legacyPeerDeps = false, linksIn, + isInStore = false, hasShrinkwrap, overrides, loadOverrides = false, @@ -113,6 +114,7 @@ class Node { this[_workspaces] = null this.errors = error ? [error] : [] + this.isInStore = isInStore // this will usually be null, except when modeling a // package's dependencies in a virtual root. diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 45583708fc490..645507ef6bdf9 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -45,10 +45,12 @@ "minify-registry-metadata": "^3.0.0", "nock": "^13.2.0", "tap": "^16.3.2", + "tar-stream": "^3.0.0", "tcompare": "^5.0.6" }, "scripts": { "test": "tap", + "test-only": "tap --only", "posttest": "node ../.. run lint", "snap": "tap", "postsnap": "npm run lintfix", diff --git a/workspaces/arborist/tap-snapshots/test/link.js.test.cjs b/workspaces/arborist/tap-snapshots/test/link.js.test.cjs index adffc182b23b0..7c921fbbd72bc 100644 --- a/workspaces/arborist/tap-snapshots/test/link.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/link.js.test.cjs @@ -19,6 +19,8 @@ Link { "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "../../../../../some/other/path", @@ -62,6 +64,7 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { <*ref_1>, @@ -78,6 +81,8 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "tops": Set {}, }, }, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "../../../../../some/other/path", @@ -103,6 +108,7 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { <*ref_1>, diff --git a/workspaces/arborist/tap-snapshots/test/node.js.test.cjs b/workspaces/arborist/tap-snapshots/test/node.js.test.cjs index bc571fc9ae443..93f1f46628252 100644 --- a/workspaces/arborist/tap-snapshots/test/node.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/node.js.test.cjs @@ -22,6 +22,7 @@ exports[`test/node.js TAP basic instantiation > just a lone root node 1`] = ` "inventory": Inventory { "" => <*ref_1>, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -209,6 +210,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/foo", @@ -234,6 +237,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/unknown", @@ -276,6 +281,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -295,6 +301,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/foo", @@ -333,6 +341,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -348,6 +357,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/unknown", @@ -395,6 +406,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/foo", @@ -421,6 +434,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -440,6 +454,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/foo", @@ -477,6 +493,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/unknown", @@ -503,6 +521,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -518,6 +537,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/unknown", @@ -543,6 +564,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -569,6 +591,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -588,6 +611,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/foo", @@ -626,6 +651,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -641,6 +667,8 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/unknown", @@ -689,6 +717,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -725,6 +755,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -776,6 +807,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -794,6 +826,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -832,6 +865,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -863,6 +897,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -894,6 +929,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -925,6 +961,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -952,6 +989,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -987,6 +1025,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -1002,6 +1041,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -1079,6 +1120,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -1115,6 +1158,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -1166,6 +1210,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -1184,6 +1229,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -1215,6 +1261,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -1253,6 +1300,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -1284,6 +1332,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -1315,6 +1364,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -1346,6 +1396,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -1373,6 +1424,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -1408,6 +1460,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -1423,6 +1476,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -1462,6 +1517,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -1498,6 +1555,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -1524,6 +1582,8 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -1537,6 +1597,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -1567,6 +1628,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -1614,6 +1676,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -1665,6 +1728,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -1683,6 +1747,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -1721,6 +1786,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -1752,6 +1818,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -1783,6 +1850,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -1814,6 +1882,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -1841,6 +1910,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -1917,6 +1987,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -1968,6 +2039,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -1986,6 +2058,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -2017,6 +2090,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2055,6 +2129,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -2093,6 +2168,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -2124,6 +2200,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -2155,6 +2232,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -2186,6 +2264,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -2213,6 +2292,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -2227,6 +2307,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -2257,6 +2338,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2316,6 +2398,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2334,6 +2417,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -2372,6 +2456,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -2403,6 +2488,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -2434,6 +2520,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -2465,6 +2552,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -2492,6 +2580,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -2533,6 +2622,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta", @@ -2621,6 +2711,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2639,6 +2730,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -2670,6 +2762,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2708,6 +2801,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -2739,6 +2833,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -2770,6 +2865,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -2801,6 +2897,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -2828,6 +2925,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -2869,6 +2967,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta", @@ -2883,6 +2982,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -2913,6 +3013,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2972,6 +3073,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -2990,6 +3092,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -3025,6 +3128,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -3056,6 +3160,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -3087,6 +3192,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -3118,6 +3224,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -3145,6 +3252,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -3173,6 +3281,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3212,6 +3322,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -3227,6 +3338,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3326,6 +3439,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -3344,6 +3458,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -3375,6 +3490,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -3410,6 +3526,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -3441,6 +3558,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -3472,6 +3590,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -3503,6 +3622,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -3530,6 +3650,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -3556,6 +3677,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3583,6 +3706,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3622,6 +3747,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -3637,6 +3763,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3662,6 +3790,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -3692,6 +3821,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -3751,6 +3881,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -3769,6 +3900,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -3804,6 +3936,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -3835,6 +3968,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -3866,6 +4000,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -3897,6 +4032,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -3924,6 +4060,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -3952,6 +4089,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -3991,6 +4130,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -4006,6 +4146,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -4105,6 +4247,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -4123,6 +4266,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -4154,6 +4298,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -4189,6 +4334,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -4220,6 +4366,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -4251,6 +4398,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -4282,6 +4430,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -4309,6 +4458,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -4335,6 +4485,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -4362,6 +4514,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -4401,6 +4555,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -4416,6 +4571,8 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -4441,6 +4598,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -4471,6 +4629,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -4508,6 +4667,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -4544,6 +4705,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -4595,6 +4757,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -4613,6 +4776,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -4651,6 +4815,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -4682,6 +4847,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -4713,6 +4879,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -4744,6 +4911,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -4771,6 +4939,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -4806,6 +4975,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -4821,6 +4991,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -4898,6 +5070,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -4934,6 +5108,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -4985,6 +5160,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5003,6 +5179,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -5034,6 +5211,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5072,6 +5250,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -5103,6 +5282,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -5134,6 +5314,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -5165,6 +5346,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -5192,6 +5374,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -5227,6 +5410,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -5242,6 +5426,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -5281,6 +5467,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -5317,6 +5505,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -5343,6 +5532,8 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta/node_modules/metameta", @@ -5356,6 +5547,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -5386,6 +5578,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5433,6 +5626,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -5484,6 +5678,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5502,6 +5697,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -5540,6 +5736,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -5571,6 +5768,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -5602,6 +5800,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -5633,6 +5832,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -5660,6 +5860,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -5736,6 +5937,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -5787,6 +5989,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5805,6 +6008,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -5836,6 +6040,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -5874,6 +6079,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/node_modules/meta", @@ -5912,6 +6118,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -5943,6 +6150,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -5974,6 +6182,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -6005,6 +6214,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -6032,6 +6242,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -6046,6 +6257,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -6076,6 +6288,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6135,6 +6348,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6153,6 +6367,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -6191,6 +6406,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -6222,6 +6438,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -6253,6 +6470,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -6284,6 +6502,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -6311,6 +6530,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -6352,6 +6572,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta", @@ -6440,6 +6661,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6458,6 +6680,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -6489,6 +6712,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6527,6 +6751,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -6558,6 +6783,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -6589,6 +6815,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -6620,6 +6847,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -6647,6 +6875,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -6688,6 +6917,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": "meta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta", @@ -6702,6 +6932,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -6732,6 +6963,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6791,6 +7023,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -6809,6 +7042,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -6844,6 +7078,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -6875,6 +7110,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -6906,6 +7142,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -6937,6 +7174,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -6964,6 +7202,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -6992,6 +7231,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7031,6 +7272,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -7046,6 +7288,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7145,6 +7389,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -7163,6 +7408,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -7194,6 +7440,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -7229,6 +7476,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -7260,6 +7508,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -7291,6 +7540,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -7322,6 +7572,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -7349,6 +7600,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -7375,6 +7627,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7402,6 +7656,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7441,6 +7697,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -7456,6 +7713,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7481,6 +7740,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -7511,6 +7771,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -7570,6 +7831,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -7588,6 +7850,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -7623,6 +7886,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -7654,6 +7918,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -7685,6 +7950,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -7716,6 +7982,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -7743,6 +8010,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -7771,6 +8039,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7810,6 +8080,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -7825,6 +8096,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -7924,6 +8197,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -7942,6 +8216,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "prod", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod", @@ -7973,6 +8248,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", @@ -8008,6 +8284,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "bundled", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/bundled", @@ -8039,6 +8316,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "dev", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/dev", @@ -8070,6 +8348,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "opt", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/optional", @@ -8101,6 +8380,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "peer", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/peer", @@ -8128,6 +8408,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "extraneous", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/extraneous", @@ -8154,6 +8435,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -8181,6 +8464,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -8220,6 +8505,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "newMeta", "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set { Link { @@ -8235,6 +8521,8 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": "metameta", "inventory": Inventory {}, + "isInStore": false, + "isStoreLink": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/meta/node_modules/metameta", @@ -8260,6 +8548,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, }, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "", @@ -8290,6 +8579,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "installLinks": false, "integrity": null, "inventory": Inventory {}, + "isInStore": false, "legacyPeerDeps": false, "linksIn": Set {}, "location": "node_modules/prod/foo", diff --git a/workspaces/arborist/test/arborist/reify.js b/workspaces/arborist/test/arborist/reify.js index 7c250a34d236b..026054e756577 100644 --- a/workspaces/arborist/test/arborist/reify.js +++ b/workspaces/arborist/test/arborist/reify.js @@ -3151,3 +3151,61 @@ t.only('should preserve exact ranges, missing actual tree', async (t) => { await arb.reify() }) }) + +t.test('install stategy linked', async (t) => { + const Arborist = require('../../lib/index.js') + const abbrev = resolve(__dirname, + '../fixtures/registry-mocks/content/abbrev/-/abbrev-1.1.1.tgz') + const abbrevTGZ = fs.readFileSync(abbrev) + + const abbrevPackument = JSON.stringify({ + _id: 'abbrev', + _rev: 'lkjadflkjasdf', + name: 'abbrev', + 'dist-tags': { latest: '1.1.1' }, + versions: { + '1.1.1': { + name: 'abbrev', + version: '1.1.1', + dist: { + tarball: 'https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz', + }, + }, + }, + }) + + t.test('should install package linked', async (t) => { + const testdir = t.testdir({ + project: { + 'package.json': JSON.stringify({ + name: 'myproject', + version: '1.0.0', + dependencies: { + abbrev: '1.1.1', + }, + }), + }, + }) + + tnock(t, 'https://registry.npmjs.org') + .get('/abbrev') + .reply(200, abbrevPackument) + + tnock(t, 'https://registry.npmjs.org') + .get('/abbrev/-/abbrev-1.1.1.tgz') + .reply(200, abbrevTGZ) + + const path = resolve(testdir, 'project') + const arb = new Arborist({ + path, + registry: 'https://registry.npmjs.org', + cache: resolve(testdir, 'cache'), + installStrategy: 'linked', + }) + await arb.reify({ installStrategy: 'linked' }) + const abbrev = fs.lstatSync(resolve(path, 'node_modules', 'abbrev')) + const store = fs.lstatSync(resolve(path, 'node_modules', '.store')) + t.ok(store.isDirectory(), 'abbrev got installed') + t.ok(abbrev.isSymbolicLink(), 'abbrev got installed') + }) +}) diff --git a/workspaces/arborist/test/fixtures/isolated-nock.js b/workspaces/arborist/test/fixtures/isolated-nock.js new file mode 100644 index 0000000000000..5086d3931923c --- /dev/null +++ b/workspaces/arborist/test/fixtures/isolated-nock.js @@ -0,0 +1,203 @@ +const nock = require('nock') +const tar = require('tar-stream') +const Stream = require('stream') +const fs = require('fs') +const path = require('path') +const os = require('os') + +/* Utility to extract a buffer out of a stream */ +class StreamToBuffer extends Stream.Writable { + constructor (opts) { + super(opts) + this._bufferArray = [] + } + + _write (chunk, encoding, callback) { + this._bufferArray.push(chunk) + callback() + } + + _final (callback) { + this.buffer = Buffer.concat(this._bufferArray) + callback() + } +} + +/** + * packPackageToStream + * Uses 'tar-stream' to create the tar stream without touching the file system. + */ +function packPackageToStream (manifest, reg) { + const { + name, + version, + } = manifest + const { shrinkwrap, bundledDeps, ...rest } = manifest + + const pack = tar.pack() + const manifestString = JSON.stringify({ + ...rest, + }) + const index = `console.log('Hello from ${name}@${version}!')` + const unscopedName = name.replace(/^@[^/]*\//, '') + pack.entry({ name: unscopedName, type: 'directory' }) + pack.entry({ name: `${unscopedName}/package.json` }, manifestString) + pack.entry({ name: `${unscopedName}/index.js` }, index) + pack.entry({ name: `${unscopedName}/bin.js` }, '#!/usr/bin/env node\nconsole.log("bin")') + if (shrinkwrap) { + pack.entry({ name: `${unscopedName}/npm-shrinkwrap.json` }, shrinkwrap.replace(/##REG##/g, reg)) + } + if (bundledDeps) { + pack.entry({ name: `${unscopedName}/node_modules`, type: 'directory' }) + bundledDeps.forEach(d => { + pack.entry({ name: `${unscopedName}/node_modules/${d.name}`, type: 'directory' }) + pack.entry({ name: `${unscopedName}/node_modules/${d.name}/package.json` }, JSON.stringify(d)) + pack.entry({ name: `${unscopedName}/node_modules/${d.name}/index.js` }, `console.log('Hello from ${d.name}@${d.version}!')` + ) + }) + } + + pack.finalize() + return pack +} + +/** + * Pack a package for publish. + * Returns a buffer containing a tarball of the package. + */ +async function packPackage (manifest, reg) { + const packStream = packPackageToStream(manifest, reg) + + const tarBuffer = packStream.pipe(new StreamToBuffer()) + + return new Promise((resolve, reject) => { + tarBuffer.on('close', () => { + resolve(tarBuffer.buffer) + }) + tarBuffer.on('error', reject) + }) +} + +/** + * Publish the given package to the given registry. + */ +async function publishPackage (registry, manifest, packuments) { + const { + name, + version, + } = manifest + const { shrinkwrap, bundledDeps, ...rest } = manifest + + if (packuments.has(name)) { + packuments.get(name).versions[version] = { + bin: './bin.js', + ...rest, + dist: { + tarball: `${registry}/${name.replace(/\//g, '-')}/${version}.tar`, + }, + } + } else { + packuments.set(name, { + name, + 'dist-tags': { + latest: version, + }, + versions: { + [version]: { + ...rest, + bin: './bin.js', + dist: { + tarball: `${registry}/${name.replace(/\//g, '-')}/${version}.tar`, + }, + }, + }, + }) + } + + const tarball = await packPackage(manifest, registry) + + nock(registry) + .persist() + .get(`/${name.replace(/\//g, '-')}/${version}.tar`) + .reply(200, tarball) +} + +/** + * Given an object decribing a dependency graph, this funcion will materialize + * this dependency graph on disk and in a registry. + * + * The input has the following shape: + * { + * registry: [ package1, package2,... ], + * root: { name: , version: , dependencies: } + * } + * package# represent a registry package and is of the following shape: + * { name: , version: , dependencies?: } + * + * The return value is of the form { dir, registry } where: + * - dir is the location on disk of the root package + * - registry is the url of the registry which has the necessary packages + * + * Only simple graphs are currenly supported, the following features will come in further iterations: + * - lockfile + * - shinkwrap + * - bundled dependencies + * + * The API of this function is not stable and is likely to evolve as we add more features. + */ +async function getRepo (graph) { + // Generate a new random registry every time to prevent interference between tests + const registry = `https://${Math.random().toString(36).substring(2)}.test` + + const packuments = new Map() + // Publish all the registery packages + await Promise.all(graph.registry.map(o => + publishPackage(registry, o, packuments))) + + packuments.forEach((packument, name) => { + nock(registry) + .persist() + .get(`/${name.replace(/\//g, '%2f')}`) + .reply(200, packument) + }) + + // Generate the root of the graph on disk + const root = graph.root + const workspaces = graph.workspaces || [] + const repo = { + 'package.json': JSON.stringify({ + workspaces: workspaces.length !== 0 ? ['packages/*'] : undefined, + ...root, + }), + packages: {}, + } + workspaces.forEach(wp => { + repo.packages[wp.name] = { + 'package.json': JSON.stringify(wp), + 'bin.js': '#!/usr/bin/env node\nconsole.log("bin")', + 'index.js': `console.log('Hello from workspace ${wp.name}')`, + } + }) + const dir = testdir(repo) + return { dir, registry } +} + +function testdir (structure) { + const dir = fs.mkdtempSync(`${fs.realpathSync(os.tmpdir())}/test-`) + createDir(dir, structure) + return dir +} + +function createDir (dir, structure) { + Object.entries(structure).forEach(([key, value]) => { + if (typeof value === 'object') { + const newDir = path.join(dir, key) + fs.mkdirSync(newDir) + createDir(newDir, value) + } else { + fs.writeFileSync(path.join(dir, key), value) + } + }) +} + +exports.getRepo = getRepo diff --git a/workspaces/arborist/test/isolated-mode.js b/workspaces/arborist/test/isolated-mode.js new file mode 100644 index 0000000000000..eaecd9453754a --- /dev/null +++ b/workspaces/arborist/test/isolated-mode.js @@ -0,0 +1,1574 @@ +const tap = require('tap') +const fs = require('fs') +const path = require('path') +const os = require('os') + +const oldMap = Map + +class newMap extends oldMap { + get (prop) { + const newThis = this.__target || this + return oldMap.prototype.get.bind(newThis)(prop) + } +} +Map = newMap + +const getTempDir = () => fs.realpathSync(os.tmpdir()) + +const Arborist = require('../lib/arborist') +const { getRepo } = require('./fixtures/isolated-nock') + +/** + * The testing framework here is work in progress, in particular it does not have nice ergonomics. + * The syntactic suggar for this framework will be introduced over time as we add more features. + * + * The framework has two parts: + * - Mocking: The tool generates a test repo based on a declarative list of packages. + * - Asserting: Some generic rules are defined which assert a particular contract of a resolved dependency graph. + * For each test we declaratively define the expected resolved dependency graph and apply all the rules to it. + * This validates that arborist produced the expected dependency graph and respect all the contracts set by the rules. + * + * The automatic assertions aims to make new tests easy. + * A rule needs to be written only once and can be asserted against many graphs cheaply. + * The only part that needs to be produced by hand is the conversion from the list of packages to a resolved dependency graph. + * Automating this part would mean reimplementing the full resolution algorithm for the tests, this would be error prone. + * Manually defining declaratively the input and the output of arborist is what gives us confidence that the tests do what + * we want. + * + **/ + +const rule1 = { + description: 'Any package (except root package and workspace) should be able to require itself.', + apply: (t, dir, resolvedGraph, alreadyAsserted) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + allPackages.filter(p => p.chain.length !== 0).forEach(p => { + const resolveChain = [...p.chain, p.name] + const key = p.initialDir + ' => ' + resolveChain.join(' => ') + if (alreadyAsserted.has(key)) { + return + } + alreadyAsserted.add(key) + t.ok(setupRequire(path.join(dir, p.initialDir))(...resolveChain), + `Rule 1: Package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}" should have access to itself using its own name.`) + }) + }, +} + +const rule2 = { + description: 'Packages can require their resolved dependencies.', + apply: (t, dir, resolvedGraph, alreadyAsserted) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + allPackages.forEach(p => { + (p.dependencies || []).filter(d => !isLoopToken(d)).map(d => d.name).forEach(n => { + const resolveChain = [...p.chain, n] + const key = p.initialDir + ' => ' + resolveChain.join(' => ') + if (alreadyAsserted.has(key)) { + return + } + alreadyAsserted.add(key) + t.ok(path.join(dir, p.initialDir), + `Rule 2: ${p.chain.length === 0 && p.initialDir === '.' ? 'The root' : `Package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}"`} should have access to "${n}" because it has it as a resolved dependency.`) + }) + }) + // testing circular deps + allPackages.forEach(p => { + (p.dependencies || []).filter(d => isLoopToken(d)).forEach(token => { + const back = parseLoopToken(token) + const n = p.chain.slice(-1 - back)[0] // getting the name of the circular dep by going back in the chain + const resolveChain = [...p.chain, n] + const key = p.initialDir + ' => ' + resolveChain.join(' => ') + if (alreadyAsserted.has(key)) { + return + } + alreadyAsserted.add(key) + t.ok(setupRequire(path.join(dir, p.initialDir))(...resolveChain), + `Rule 2: ${p.chain.length === 0 && p.initialDir === '.' ? 'The root' : `Package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}"`} should have access to "${n}" because it has it as a resolved dependency.`) + }) + }) + }, +} + +const rule3 = { + description: 'Any package can require a package installed at the root.', + apply: (t, dir, resolvedGraph, alreadyAsserted) => { + const graph = parseGraph(resolvedGraph) + const rootDependencies = graph.root.dependencies.map(o => o.name) + const allPackages = getAllPackages(withRequireChain(graph)) + allPackages.forEach(p => { + rootDependencies.forEach(d => { + const resolveChain = [...p.chain, d] + const key = p.initialDir + ' => ' + resolveChain.join(' => ') + if (alreadyAsserted.has(key)) { + return + } + alreadyAsserted.add(key) + t.ok(setupRequire(path.join(dir, p.initialDir))(...resolveChain), + `Rule 3: ${p.chain.length === 0 && p.initialDir === '.' ? 'The root' : `Package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}"`} should have access to "${d}" because it is a root dependency.`) + }) + }) + }, +} + +const rule4 = { + description: 'Packages cannot require packages that are not in their dependencies, not root dependencies or not themselves.', + apply: (t, dir, resolvedGraph, alreadyAsserted) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + const allPackageNames = allPackages.filter(p => p.chain.length !== 0 || p.initialDir !== '.').map(o => o.name) + const rootDependencyNames = graph.root.dependencies.map(o => o.name) + allPackages.forEach(p => { + const resolvedDependencyNames = (p.dependencies || []) + .filter(d => !isLoopToken(d)) + .map(d => d.name) + .concat((p.dependencies || []) + .filter(d => isLoopToken(d)) + .map(t => { + const back = parseLoopToken(t) + return p.chain.slice(-1 - back)[0] // getting the name of the circular dep by going back in the chain + })) + allPackageNames.filter(n => !rootDependencyNames.includes(n)) + .filter(n => !resolvedDependencyNames.includes(n)) + .filter(n => n !== p.name) + .forEach(n => { + const resolveChain = [...p.chain, n] + const key = p.initialDir + ' => ' + resolveChain.join(' => ') + if (alreadyAsserted.has(key)) { + return + } + alreadyAsserted.add(key) + t.notOk(setupRequire(path.join(dir, p.initialDir))(...resolveChain), + `Rule 4: ${p.chain.length === 0 && p.initialDir === '.' ? 'The root' : `Package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}"`} should not have access to "${n}" because it not a root dependency, not in its resolved dependencies and not itself.`) + }) + }) + }, +} + +const rule5 = { + description: 'Peer dependencies should be resolved to same instance as parents', + apply: (t, dir, resolvedGraph) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + allPackages.filter(p => p.peer) + .forEach(p => { + const chain = p.chain + const parentChain = chain.slice(0, -2).concat([p.name]) + t.same(setupRequire(path.join(dir, p.initialDir))(...parentChain), setupRequire(path.join(dir, p.initialDir))(...chain), + `Rule 5: Package "${[p.initialDir.replace('packages/', ''), ...chain.slice(0, -1)].join(' => ')}" should get the same instance of "${p.name}" as its parent`) + }) + }, +} + +const rule6 = { + description: 'Packages with the same name, same version, and same peer deps are installed at the same place on disk', + apply: (t, dir, resolvedGraph) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + const byNameAndVersion = new Map() + allPackages.forEach(p => { + const peerDeps = p.dependencies.filter(d => d.peer).map(d => `${d.name}@${d.version}`).sort().join(' - ') + const key = `${p.name}@${p.version} - ${peerDeps}` + if (!byNameAndVersion.has(key)) { + byNameAndVersion.set(key, []) + } + byNameAndVersion.get(key).push(setupRequire(path.join(dir, p.initialDir))(...p.chain)) + }) + byNameAndVersion.forEach((value, key) => { + if (value.length === 1) { + return + } + const same = value.every(l => l === value[0]) + t.ok(same, `Rule 6: Even though it is referenced multiple times, package "${key}" should be installed only once`) + }) + }, +} + +const rule7 = { + description: 'The version of the resolved dependencies is the one we expect', + apply: (t, dir, resolvedGraph) => { + const graph = parseGraph(resolvedGraph) + const allPackages = getAllPackages(withRequireChain(graph)) + allPackages.forEach(p => { + const ppath = setupRequire(path.join(dir, p.initialDir))(...p.chain) + p.dependencies.filter(d => !isLoopToken(d)).forEach(d => { + const dname = d.name + const dversion = JSON.parse(fs.readFileSync(`${resolvePackage(dname, ppath)}/package.json`).toString()).version + + t.ok(dversion === d.version, `Rule 7: The version of ${dname} (${dversion}) provided to ${p.chain.length === 0 && p.initialDir === '.' ? 'the root' : `package "${[p.initialDir.replace('packages/', ''), ...p.chain].join(' => ')}"`} should be "${d.version}"`) + }) + p.dependencies.filter(d => isLoopToken(d)).forEach(token => { + const back = parseLoopToken(token) + const name = p.chain.slice(-1 - back)[0] // getting the name of the circular dep by going back in the chain + const loopStartChain = p.chain.slice(0, -back) + const loopEndChain = [...p.chain, name] + t.same(setupRequire(path.join(dir, p.initialDir))(...loopStartChain), + setupRequire(path.join(dir, p.initialDir))(...loopEndChain), + `The two ends of this dependency loop should resolve to the same location: "${[p.initialDir.replace('packages/', ''), ...loopEndChain].join(' => ')}"`) + }) + }) + }, +} + +tap.test('most simple happy scenario', async t => { + /* + * + * Dependency graph: + * + * foo -> which -> isexe + * + */ + + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('simple peer dependencies scenarios', async t => { + /* + * Dependencies: + * + * foo -> tsutils + * tsutils -> typescript (peer dep) + * typescript -> baz + * foo -> typescript + * typescript -> baz + * + */ + + const graph = { + registry: [ + { name: 'tsutils', version: '1.0.0', dependencies: {}, peerDependencies: { typescript: '*' } }, + { name: 'typescript', version: '1.0.0', dependencies: { baz: '*' } }, + { name: 'baz', version: '2.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { tsutils: '1.0.0', typescript: '1.0.0' }, + }, + } + + const resolved = { + 'foo@1.2.3 (root)': { + 'tsutils@1.0.0': { + 'typescript@1.0.0 (peer)': { + 'baz@2.0.0': {}, + }, + }, + 'typescript@1.0.0': { + 'baz@2.0.0': {}, + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('Lock file is same in hoisted and in isolated mode', async t => { + const graph = { + registry: [ + { name: 'which', version: '2.0.2' }, + ], + root: { name: 'foo', version: '1.2.3', dependencies: { which: '2.0.2' } }, + } + + const { dir: hoistedModeDir, registry } = await getRepo(graph) + const { dir: isolatedModeDir } = await getRepo(graph) + + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arboristHoisted = new Arborist({ path: hoistedModeDir, registry, packumentCache: new Map(), cache }) + const arboristIsolated = new Arborist({ path: isolatedModeDir, registry, packumentCache: new Map(), cache }) + + await Promise.all([ + arboristHoisted.reify({ strategy: 'hoisted' }), + arboristIsolated.reify({ installStrategy: 'linked' }), + ]) + + const [hoistedModeLockFile, isolatedModeLockFile] = await Promise.all([ + fs.promises.readFile(path.join(hoistedModeDir, 'package-lock.json'), { encoding: 'utf8' }), + fs.promises.readFile(path.join(isolatedModeDir, 'package-lock.json'), { encoding: 'utf8' }), + ]) + + t.same(hoistedModeLockFile, isolatedModeLockFile, 'hoited mode and isolated mode produce the same lockfile') +}) + +tap.test('Basic workspaces setup', async t => { + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'which', version: '2.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'dog', version: '1.2.3', dependencies: { bar: '*' }, + }, + workspaces: [ + { name: 'bar', version: '1.0.0', dependencies: { which: '2.0.0' } }, + { name: 'baz', version: '1.0.0', dependencies: { which: '2.0.0', bar: '*' } }, + { name: 'cat', version: '1.0.0', dependencies: { which: '1.0.0' } }, + { name: 'fish', version: '1.0.0', dependencies: { which: '1.0.0', cat: '*' } }, + { name: 'catfish', version: '1.0.0' }, + ], + } + + const resolved = { + 'dog@1.2.3 (root)': { + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'baz@1.0.0 (workspace)': { + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'cat@1.0.0 (workspace)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'fish@1.0.0 (workspace)': { + 'cat@1.0.0 (workspace)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'catfish@1.0.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('resolved versions are the same on isolated and in hoisted mode', async t => { + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'which', version: '2.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'dog', version: '1.2.3', dependencies: { bar: '*' }, + }, + workspaces: [ + { name: 'bar', version: '1.0.0', dependencies: { which: '2.0.0' } }, + { name: 'baz', version: '1.0.0', dependencies: { which: '2.0.0', bar: '*' } }, + { name: 'cat', version: '1.0.0', dependencies: { which: '1.0.0' } }, + { name: 'fish', version: '1.0.0', dependencies: { which: '1.0.0', cat: '*' } }, + { name: 'catfish', version: '1.0.0' }, + ], + } + + const resolved = { + 'dog@1.2.3 (root)': { + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + }, + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'baz@1.0.0 (workspace)': { + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'cat@1.0.0 (workspace)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'fish@1.0.0 (workspace)': { + 'cat@1.0.0 (workspace)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + 'catfish@1.0.0': {}, + } + + let { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + let cache = fs.mkdtempSync(`${getTempDir()}/test-`) + let arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + rule7.apply(t, dir, resolved, new Set()) + + const mock = await getRepo(graph) + dir = mock.dir + registry = mock.registry + + // Note that we override this cache to prevent interference from other tests + cache = fs.mkdtempSync(`${getTempDir()}/test-`) + arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ strategy: 'hoisted' }) + + // checking that the resolved graph is the same in hoisting and in isolated mode + rule7.apply(t, dir, resolved, new Set()) +}) + +tap.test('peer dependency chain', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'bar', version: '1.0.0', dependencies: { baz: '^1.0.0' }, peerDependencies: { boat: '*' } }, + { name: 'baz', version: '1.0.0', peerDependencies: { boat: '*' } }, + { name: 'boat', version: '3.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { bar: '1.0.0', boat: '^3.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'bar@1.0.0': { + 'baz@1.0.0': { + 'boat@3.0.0 (peer)': {}, + }, + 'boat@3.0.0 (peer)': {}, + }, + 'boat@3.0.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('failing optional deps are not installed', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', os: ['npmOS'] }, + ], + root: { + name: 'foo', version: '1.2.3', optionalDependencies: { which: '1.0.0' }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + t.notOk(setupRequire(dir)('which'), 'Failing optional deps should not be installed') + + t.notOk(fs.existsSync(path.join(dir, 'node_modules', '.bin', 'which'))) +}) + +tap.test('Optional deps are installed when possible', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', optionalDependencies: { which: '1.0.0' }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + t.ok(setupRequire(dir)('which'), 'Optional deps should be installed when possible') + + // TODO: make sure that existsSync is not deprecated + t.ok(fs.existsSync(path.join(dir, 'node_modules', '.bin', 'which'))) +}) + +tap.test('shrinkwrap', async t => { + const shrinkwrap = JSON.stringify({ + name: 'which', + version: '1.0.0', + lockfileVersion: 2, + requires: true, + packages: { + '': { + name: 'which', + version: '1.0.0', + dependencies: { + isexe: '^1.0.0', + }, + }, + 'node_modules/isexe': { + version: '1.0.0', + resolved: '##REG##/isexe/1.0.0.tar', + }, + }, + dependencies: { + isexe: { + version: '1.0.0', + resolved: '##REG##/isexe/1.0.0.tar', + }, + }, + }) + + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' }, shrinkwrap, _hasShrinkwrap: true }, + { name: 'isexe', version: '1.1.0' }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0', isexe: '^1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + 'isexe@1.1.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('shrinkwrap install dev deps (like hoisting does)', async t => { + const shrinkwrap = JSON.stringify({ + name: 'which', + version: '1.0.0', + lockfileVersion: 2, + requires: true, + packages: { + '': { + name: 'which', + version: '1.0.0', + devDependencies: { + isexe: '^1.0.0', + }, + }, + 'node_modules/isexe': { + version: '1.0.0', + dev: true, + resolved: '##REG##/isexe/1.0.0.tar', + }, + }, + dependencies: { + isexe: { + version: '1.0.0', + dev: true, + resolved: '##REG##/isexe/1.0.0.tar', + }, + }, + }) + + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', devDependencies: { isexe: '^1.0.0' }, shrinkwrap, _hasShrinkwrap: true }, + { name: 'isexe', version: '1.1.0' }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0', isexe: '^1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + 'isexe@1.1.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('shrinkwrap with peer dependencies', async t => { + const shrinkwrap = JSON.stringify({ + name: 'which', + version: '1.0.0', + lockfileVersion: 2, + requires: true, + packages: { + '': { + name: 'which', + version: '1.0.0', + dependencies: { + isexe: '^1.0.0', + }, + devDependencies: { + bar: '1.0.0', + }, + peerDependencies: { + bar: '*', + }, + }, + 'node_modules/bar': { + version: '1.0.0', + resolved: '##REG##/bar/1.0.0.tar', + dev: true, + bin: { + bar: 'bin.js', + }, + }, + 'node_modules/isexe': { + version: '1.0.0', + resolved: '##REG##/isexe/1.0.0.tar', + bin: { + isexe: 'bin.js', + }, + }, + }, + dependencies: { + bar: { + version: '1.0.0', + resolved: '##REG##/bar/1.0.0.tar', + dev: true, + }, + isexe: { + version: '1.0.0', + resolved: '##REG##/isexe/1.0.0.tar', + }, + }, + }) + // expected output + const resolved = { + 'foo@1.0.0 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + 'bar@1.0.0': {}, + }, + 'isexe@1.1.0': {}, + 'bar@1.1.0': {}, + }, + } + + // Input of arborist + const graph = { + registry: [ + { + name: 'which', + version: '1.0.0', + dependencies: { isexe: '^1.0.0' }, + peerDependencies: { bar: '*' }, + devDependencies: { bar: '1.0.0' }, + shrinkwrap, + _hasShrinkwrap: true, + }, + { name: 'isexe', version: '1.1.0' }, + { name: 'isexe', version: '1.0.0' }, + { name: 'bar', version: '1.1.0' }, + { name: 'bar', version: '1.0.0' }, + ], + root: { + name: 'foo', + version: '1.0.0', + dependencies: { isexe: '^1.0.0', bar: '^1.0.0', which: '1.0.0' }, + }, + } + + const { dir, registry } = await getRepo(graph) + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + // TODO: greate the resolved object + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('bundled dependencies of external packages', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', + version: '1.0.0', + dependencies: { isexe: '^1.0.0' }, + bundleDependencies: ['isexe'], + bundledDeps: [{ name: 'isexe', version: '1.0.0' }], + }, + { name: 'isexe', version: '1.1.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('bundled dependencies of internal packages', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' }, + }, + { name: 'isexe', version: '1.1.0' }, + ], + root: { + name: 'foo', + version: '1.2.3', + dependencies: { which: '1.0.0', isexe: '^1.0.0' }, + bundleDependencies: ['isexe'], + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.1.0': {}, + }, + 'isexe@1.1.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + // I think that duplicated versions are okay in the case of bundled deps + // rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) + + const isexePath = path.join(dir, 'node_modules', 'isexe') + t.equals(isexePath, fs.realpathSync(isexePath)) +}) + +tap.test('nested bundled dependencies of internal packages', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' }, + }, + { name: 'isexe', version: '1.1.0', dependencies: { bar: '*' } }, + { name: 'bar', version: '3.0.0' }, + ], + root: { + name: 'foo', + version: '1.2.3', + dependencies: { which: '1.0.0', isexe: '^1.0.0' }, + bundleDependencies: ['isexe'], + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.1.0': { + 'bar@3.0.0': {}, + }, + }, + 'isexe@1.1.0': {}, + 'bar@3.0.0': {}, // The bundled bar is hoisted + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + // I think that duplicated versions are okay in the case of bundled deps + // rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) + + const isexePath = path.join(dir, 'node_modules', 'isexe') + t.equals(isexePath, fs.realpathSync(isexePath)) +}) + +tap.test('nested bundled dependencies of workspaces', async t => { + const graph = { + registry: [ + { name: 'which', version: '2.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'dog', version: '1.2.3', + }, + workspaces: [ + { name: 'bar', version: '1.0.0', dependencies: { which: '2.0.0' }, bundleDependencies: ['which'] }, + ], + } + + const resolved = { + 'dog@1.2.3 (root)': { + 'bar@1.0.0 (workspace)': {}, + 'which@2.0.0': {}, + 'isexe@1.0.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + // I think that duplicated versions are okay in the case of bundled deps + // rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) + + const isexePath = path.join(dir, 'node_modules', 'isexe') + t.equals(isexePath, fs.realpathSync(isexePath)) + const whichPath = path.join(dir, 'node_modules', 'which') + t.equals(whichPath, fs.realpathSync(whichPath)) +}) + +tap.test('nested bundled dependencies of workspaces with conflicting isolated dep', async t => { + const graph = { + registry: [ + { name: 'which', version: '3.0.0', dependencies: { isexe: '^2.0.0' } }, + { name: 'isexe', version: '2.0.0' }, + { name: 'which', version: '2.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + ], + root: { + name: 'dog', version: '1.2.3', dependencies: { which: '3.0.0' }, + }, + workspaces: [ + { name: 'bar', version: '1.0.0', dependencies: { which: '2.0.0' }, bundleDependencies: ['which'] }, + ], + } + + // the isexe that is bundled is hoisted + // the 'which' that is bundled is not hoisted due to a conflaict + const resolved = { + 'dog@1.2.3 (root)': { + 'bar@1.0.0 (workspace)': { + 'which@2.0.0': { + 'isexe@1.0.0': {}, + }, + 'isexe@1.0.0': {}, + }, + 'which@3.0.0': { + 'isexe@2.0.0': {}, + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + // I think that duplicated versions are okay in the case of bundled deps + // rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) + + const isexePath = path.join(dir, 'packages', 'bar', 'node_modules', 'isexe') + t.equals(isexePath, fs.realpathSync(isexePath)) + const whichPath = path.join(dir, 'packages', 'bar', 'node_modules', 'which') + t.equals(whichPath, fs.realpathSync(whichPath)) +}) + +tap.test('adding a dependency', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + { name: 'bar', version: '2.2.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': {}, + }, + 'bar@2.2.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + // Add a new dependency + const cache2 = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist2 = new Arborist({ path: dir, registry, packumentCache: new Map(), cache: cache2, add: ['bar@^2.0.0'] }) + await arborist2.reify({ installStrategy: 'linked' }) + + // Note that the 'resolved' dependency graph contains 'bar' + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('removing a dependency', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0' }, + { name: 'bar', version: '2.2.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0', bar: '^2.0.0' }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + // checking that bar is installed + t.ok(setupRequire(dir)('bar'), 'bar should be installed initially') + + // Add a new dependency + const cache2 = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist2 = new Arborist({ path: dir, registry, packumentCache: new Map(), cache: cache2 }) + await arborist2.buildIdealTree({ rm: ['bar'] }) + await arborist2.reify({ installStrategy: 'linked' }) + + t.notOk(setupRequire(dir)('bar'), 'bar should not be installed anymore') +}) + +tap.test('circular dependencies', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { isexe: '^1.0.0' } }, + { name: 'isexe', version: '1.0.0', dependencies: { which: '1.0.0' } }, + { name: 'bar', version: '1.2.6' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0', bar: '1.2.6' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + 'isexe@1.0.0': '(back 1)', + }, + 'bar@1.2.6': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('circular peer dependencies', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'cat', version: '1.0.0', peerDependencies: { bar: '*' } }, + { name: 'bar', version: '1.0.0', peerDependencies: { cat: '*' } }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { cat: '1.0.0', bar: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'cat@1.0.0': { + 'bar@1.0.0': '(back 1)', + }, + 'bar@1.0.0': { + 'cat@1.0.0': '(back 1)', + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('peer dependency on parent', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'cat', version: '1.0.0', dependencies: { bar: '*' } }, + { name: 'bar', version: '1.0.0', peerDependencies: { cat: '*' } }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { cat: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'cat@1.0.0': { + 'bar@1.0.0': '(back 1)', + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('scoped package', async t => { + /* + * + * Dependency graph: + * + * foo -> which -> isexe + * + */ + + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', dependencies: { '@foo/isexe': '^1.0.0' } }, + { name: '@foo/isexe', version: '1.0.0' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'foo@1.2.3 (root)': { + 'which@1.0.0': { + '@foo/isexe@1.0.0': {}, + }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('failing optional peer deps are not installed', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', os: ['npmOS'] }, + { name: 'bar', version: '1.0.0', peerDependencies: { which: '*' }, peerDependenciesMeta: { which: { optional: true } } }, + ], + root: { + name: 'foo', version: '1.2.3', optionalDependencies: { which: '1.0.0', bar: '*' }, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + t.notOk(setupRequire(dir)('bar', 'which'), 'Failing optional peer deps should not be installed') +}) + +// Virtual packages are 2 packages that have the same version but are +// duplicated on disk to solve peer-dependency conflict. +tap.test('virtual packages', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'foo', version: '1.0.0' }, + { name: 'foo', version: '2.0.0', peerDependencies: { cat: '*' } }, + { name: 'cat', version: '1.0.0' }, + { name: 'cat', version: '2.0.0' }, + { name: 'bar', version: '1.0.0', dependencies: { foo: '2.0.0', cat: '2.0.0' } }, + { name: 'baz', version: '1.0.0', dependencies: { foo: '2.0.0', cat: '1.0.0' } }, + ], + root: { + name: 'toor', version: '1.2.3', dependencies: { foo: '1.0.0', bar: '*', baz: '*', cat: '1.0.0' }, + }, + } + + // expected output + const resolved = { + 'toor@1.2.3 (root)': { + 'foo@1.0.0': {}, + 'bar@1.0.0': { + 'foo@2.0.0': { + 'cat@2.0.0 (peer)': {}, + }, + 'cat@2.0.0': {}, + }, + 'baz@1.0.0': { + 'foo@2.0.0': { + 'cat@1.0.0 (peer)': {}, + }, + 'cat@1.0.0': {}, + }, + 'cat@1.0.0': {}, + }, + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const asserted = new Set() + rule1.apply(t, dir, resolved, asserted) + rule2.apply(t, dir, resolved, asserted) + rule3.apply(t, dir, resolved, asserted) + rule4.apply(t, dir, resolved, asserted) + rule5.apply(t, dir, resolved, asserted) + rule6.apply(t, dir, resolved, asserted) + rule7.apply(t, dir, resolved, asserted) +}) + +tap.test('postinstall scripts are run', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', scripts: { postinstall: `node -e "fs.openSync('postInstallRanWhich', 'w')"` } }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + workspaces: [ + { name: 'bar', version: '1.0.0', scripts: { postinstall: `node -e "fs.openSync('postInstallRanBar', 'w')"` } }, + ], + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + const postInstallRanWhich = pathExists(`${setupRequire(dir)('which')}/postInstallRanWhich`) + t.ok(postInstallRanWhich) + + const postInstallRanBar = pathExists(`${setupRequire(dir)('bar')}/postInstallRanBar`) + t.ok(postInstallRanBar) +}) + +tap.test('bins are installed', async t => { + // Input of arborist + const graph = { + registry: [ + { name: 'which', version: '1.0.0', bin: './bin.js' }, + ], + root: { + name: 'foo', version: '1.2.3', dependencies: { which: '1.0.0' }, + }, + workspaces: [ + { name: 'bar', version: '1.0.0', dependencies: { which: '1.0.0' }, bin: './bin.js' }, + ], + } + + const { dir, registry } = await getRepo(graph) + + // Note that we override this cache to prevent interference from other tests + const cache = fs.mkdtempSync(`${getTempDir()}/test-`) + const arborist = new Arborist({ path: dir, registry, packumentCache: new Map(), cache }) + await arborist.reify({ installStrategy: 'linked' }) + + // TODO: make the test not assume folder structure + // TODO should the bin also be in the store? + // const binFromWhichToWhich = pathExists(fs.realpathSync(`${setupRequire(dir)('which')}/../.bin/which`)) + // t.ok(binFromWhichToWhich) + + const binFromRootToWhich = pathExists(`${dir}/node_modules/.bin/which`) + t.ok(binFromRootToWhich) + + const binFromRootToBar = pathExists(`${dir}/node_modules/.bin/bar`) + t.ok(binFromRootToBar) + + const binFromBarToWhich = pathExists(`${setupRequire(dir)('bar')}/node_modules/.bin/which`) + t.ok(binFromBarToWhich) +}) + +function setupRequire (cwd) { + return function requireChain (...chain) { + return chain.reduce((path, name) => { + if (path === undefined) { + return undefined + } + return resolvePackage(name, path) + }, cwd) + } +} + +function pathExists (path) { + try { + fs.statSync(path) + return true + } catch (_) { + return false + } +} + +/** + * We reimplement a lightweight version of require.resolve because the + * one that is implemented in nodejs memoizes the resolution which + * asserts interfering with each others + **/ +function resolvePackage (name, from) { + try { + const loc = `${from}/node_modules/${name}` + fs.statSync(loc) + return fs.realpathSync(loc) + } catch (_) { + const next = path.dirname(from) + if (next === from) { + return undefined + } else { + return resolvePackage(name, next) + } + } +} + +function getAllPackages (resolvedGraph) { + return [...getAllPackagesRecursive(resolvedGraph.root), + ...(resolvedGraph.workspaces?.map(w => getAllPackagesRecursive(w)) || []).reduce((a, n) => ([...a, ...n]), [])] +} + +function getAllPackagesRecursive (resolvedGraph) { + return [ + resolvedGraph, + ...(resolvedGraph.dependencies + ?.filter(d => !isLoopToken(d)) + .map(d => getAllPackagesRecursive(d)) || []) + .reduce((a, n) => ([...a, ...n]), []), + ] +} + +function withRequireChain (resolvedGraph) { + return { + root: { + ...resolvedGraph.root, + chain: [], + initialDir: '.', + dependencies: resolvedGraph.root.dependencies?.map(d => + withRequireChainRecursive(d, [], '.')), + }, + workspaces: resolvedGraph.workspaces?.map(w => { + const initialDir = `packages/${w.name}` + return { + ...w, + chain: [], + initialDir, + dependencies: w.dependencies?.map(d => withRequireChainRecursive(d, [], initialDir)), + } + }), + } +} + +function withRequireChainRecursive (resolvedGraph, chain, initialDir) { + if (isLoopToken(resolvedGraph)) { + return resolvedGraph + } + + const newChain = [...chain, resolvedGraph.name] + return { + ...resolvedGraph, + chain: newChain, + initialDir, + dependencies: resolvedGraph.dependencies?.map(d => + withRequireChainRecursive(d, newChain, initialDir)), + } +} + +function parseGraph (graph) { + const root = Object.entries(graph).find(([key]) => key.includes('(root)')) + const result = { root: parseGraphRecursive(...root), workspaces: [] } + + Object.entries(graph).filter(([key]) => key.includes('(workspace)')) + .forEach(([key, value]) => { + result.workspaces.push(parseGraphRecursive(key, value)) + }) + return result +} + +function isLoopToken (obj) { + return typeof obj === 'string' && /^\(back \d+\)$/.test(obj) +} + +function parseLoopToken (t) { + return parseInt(/\d+/.exec(t)[0]) +} + +function parseGraphRecursive (key, deps) { + if (isLoopToken(key)) { + return key + } + const name = /^(.[^@]*)@/.exec(key)[1] + const version = /^.[^@]*@([^ ]*)/.exec(key)[1] + const workspace = / \(workspace\)/.test(key) + const peer = / \(peer\)/.test(key) + const normalizedDeps = typeof deps === 'string' ? { [deps]: {} } : deps + const dependencies = Object.entries(normalizedDeps).map(([key, value]) => parseGraphRecursive(key, value)) + return { name, version, workspace, peer, dependencies } +} + +/* + * TO TEST: + * -------------------------------------- + * - rollbacks + * - scoped installs + * - overrides? + * - changing repo from isolated to hoisted and from hoisted to isolated + */ From ad8decaf4bca6459d829afa6e8febcaf5dd25230 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:49:34 +0000 Subject: [PATCH 020/868] chore: release 9.4.0 --- .release-please-manifest.json | 12 +++++------ CHANGELOG.md | 14 +++++++++++++ package-lock.json | 32 +++++++++++++++--------------- package.json | 12 +++++------ workspaces/arborist/CHANGELOG.md | 6 ++++++ workspaces/arborist/package.json | 2 +- workspaces/libnpmdiff/CHANGELOG.md | 6 ++++++ workspaces/libnpmdiff/package.json | 4 ++-- workspaces/libnpmexec/CHANGELOG.md | 6 ++++++ workspaces/libnpmexec/package.json | 4 ++-- workspaces/libnpmfund/CHANGELOG.md | 6 ++++++ workspaces/libnpmfund/package.json | 4 ++-- workspaces/libnpmpack/CHANGELOG.md | 6 ++++++ workspaces/libnpmpack/package.json | 4 ++-- 14 files changed, 81 insertions(+), 37 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bad8e81acafc8..a8f1cdcf352d9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,13 +1,13 @@ { - ".": "9.3.1", - "workspaces/arborist": "6.1.6", + ".": "9.4.0", + "workspaces/arborist": "6.2.0", "workspaces/libnpmaccess": "7.0.1", - "workspaces/libnpmdiff": "5.0.7", - "workspaces/libnpmexec": "5.0.7", - "workspaces/libnpmfund": "4.0.7", + "workspaces/libnpmdiff": "5.0.8", + "workspaces/libnpmexec": "5.0.8", + "workspaces/libnpmfund": "4.0.8", "workspaces/libnpmhook": "9.0.1", "workspaces/libnpmorg": "5.0.1", - "workspaces/libnpmpack": "5.0.7", + "workspaces/libnpmpack": "5.0.8", "workspaces/libnpmpublish": "7.0.6", "workspaces/libnpmsearch": "6.0.1", "workspaces/libnpmteam": "5.0.1", diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb318b0dd00f..a0f3bf26391bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [9.4.0](https://github.com/npm/cli/compare/v9.3.1...v9.4.0) (2023-01-25) + +### Features + +* [`8d6d851`](https://github.com/npm/cli/commit/8d6d8519fbbcebdca8834e19cb34ac71f045a010) [#6078](https://github.com/npm/cli/pull/6078) added --install-strategy=linked (#6078) (@fritzy) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.8): `libnpmdiff@5.0.8` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.8): `libnpmexec@5.0.8` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.8): `libnpmfund@4.0.8` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.8): `libnpmpack@5.0.8` + ## [9.3.1](https://github.com/npm/cli/compare/v9.3.0...v9.3.1) (2023-01-13) ### Bug Fixes diff --git a/package-lock.json b/package-lock.json index de1bfaf2b6f57..237a3af98d7ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "9.3.1", + "version": "9.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "9.3.1", + "version": "9.4.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -85,7 +85,7 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/config": "^6.1.1", "@npmcli/map-workspaces": "^3.0.0", "@npmcli/package-json": "^3.0.0", @@ -108,12 +108,12 @@ "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.7", - "libnpmexec": "^5.0.7", - "libnpmfund": "^4.0.7", + "libnpmdiff": "^5.0.8", + "libnpmexec": "^5.0.8", + "libnpmfund": "^4.0.8", "libnpmhook": "^9.0.1", "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.7", + "libnpmpack": "^5.0.8", "libnpmpublish": "^7.0.6", "libnpmsearch": "^6.0.1", "libnpmteam": "^5.0.1", @@ -14369,7 +14369,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "6.1.6", + "version": "6.2.0", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -14465,10 +14465,10 @@ } }, "workspaces/libnpmdiff": { - "version": "5.0.7", + "version": "5.0.8", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", @@ -14488,10 +14488,10 @@ } }, "workspaces/libnpmexec": { - "version": "5.0.7", + "version": "5.0.8", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", @@ -14520,10 +14520,10 @@ } }, "workspaces/libnpmfund": { - "version": "4.0.7", + "version": "4.0.8", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.6" + "@npmcli/arborist": "^6.2.0" }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", @@ -14570,10 +14570,10 @@ } }, "workspaces/libnpmpack": { - "version": "5.0.7", + "version": "5.0.8", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7" diff --git a/package.json b/package.json index f617d9b169378..7a29b5d8a9341 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "9.3.1", + "version": "9.4.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -53,7 +53,7 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/config": "^6.1.1", "@npmcli/map-workspaces": "^3.0.0", "@npmcli/package-json": "^3.0.0", @@ -76,12 +76,12 @@ "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.7", - "libnpmexec": "^5.0.7", - "libnpmfund": "^4.0.7", + "libnpmdiff": "^5.0.8", + "libnpmexec": "^5.0.8", + "libnpmfund": "^4.0.8", "libnpmhook": "^9.0.1", "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.7", + "libnpmpack": "^5.0.8", "libnpmpublish": "^7.0.6", "libnpmsearch": "^6.0.1", "libnpmteam": "^5.0.1", diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index c50f0536c7e22..87937e6dd1670 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [6.2.0](https://github.com/npm/cli/compare/arborist-v6.1.6...arborist-v6.2.0) (2023-01-25) + +### Features + +* [`8d6d851`](https://github.com/npm/cli/commit/8d6d8519fbbcebdca8834e19cb34ac71f045a010) [#6078](https://github.com/npm/cli/pull/6078) added --install-strategy=linked (#6078) (@fritzy) + ## [6.1.6](https://github.com/npm/cli/compare/arborist-v6.1.5...arborist-v6.1.6) (2023-01-12) ### Bug Fixes diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 645507ef6bdf9..735dd41a2ef50 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "6.1.6", + "version": "6.2.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/workspaces/libnpmdiff/CHANGELOG.md b/workspaces/libnpmdiff/CHANGELOG.md index a62d9902f0725..47b8f94334261 100644 --- a/workspaces/libnpmdiff/CHANGELOG.md +++ b/workspaces/libnpmdiff/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.8](https://github.com/npm/cli/compare/libnpmdiff-v5.0.7...libnpmdiff-v5.0.8) (2023-01-25) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0` + ## [5.0.7](https://github.com/npm/cli/compare/libnpmdiff-v5.0.6...libnpmdiff-v5.0.7) (2023-01-12) ### Dependencies diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index bf53804d5e35f..a1c261ba9dd30 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "5.0.7", + "version": "5.0.8", "description": "The registry diff", "repository": { "type": "git", @@ -47,7 +47,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index 1ed94f90aa619..bf6ff70afd410 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.8](https://github.com/npm/cli/compare/libnpmexec-v5.0.7...libnpmexec-v5.0.8) (2023-01-25) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0` + ## [5.0.7](https://github.com/npm/cli/compare/libnpmexec-v5.0.6...libnpmexec-v5.0.7) (2023-01-12) ### Dependencies diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index ab8344271cda8..d91219b1beb44 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "5.0.7", + "version": "5.0.8", "files": [ "bin/", "lib/" @@ -61,7 +61,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", diff --git a/workspaces/libnpmfund/CHANGELOG.md b/workspaces/libnpmfund/CHANGELOG.md index 1aadd5ca21dd4..b32009bc518f1 100644 --- a/workspaces/libnpmfund/CHANGELOG.md +++ b/workspaces/libnpmfund/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.0.8](https://github.com/npm/cli/compare/libnpmfund-v4.0.7...libnpmfund-v4.0.8) (2023-01-25) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0` + ## [4.0.7](https://github.com/npm/cli/compare/libnpmfund-v4.0.6...libnpmfund-v4.0.7) (2023-01-12) ### Dependencies diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 26ae8834138e3..f239951ef3a89 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "4.0.7", + "version": "4.0.8", "main": "lib/index.js", "files": [ "bin/", @@ -46,7 +46,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.1.6" + "@npmcli/arborist": "^6.2.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" diff --git a/workspaces/libnpmpack/CHANGELOG.md b/workspaces/libnpmpack/CHANGELOG.md index 345576b266cc6..995e9962b5d32 100644 --- a/workspaces/libnpmpack/CHANGELOG.md +++ b/workspaces/libnpmpack/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.8](https://github.com/npm/cli/compare/libnpmpack-v5.0.7...libnpmpack-v5.0.8) (2023-01-25) + +### Dependencies + +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.0): `@npmcli/arborist@6.2.0` + ## [5.0.7](https://github.com/npm/cli/compare/libnpmpack-v5.0.6...libnpmpack-v5.0.7) (2023-01-12) ### Dependencies diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index b52c60afe634f..99b9259d8319d 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "5.0.7", + "version": "5.0.8", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/arborist": "^6.1.6", + "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7" From 64b06ed21fc165e413b3e6f1ae5a236350e5bfaf Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 1 Feb 2023 06:56:19 -0800 Subject: [PATCH 021/868] deps: http-cache-semantics@4.1.1 --- node_modules/http-cache-semantics/index.js | 7 ++++--- node_modules/http-cache-semantics/package.json | 10 ++-------- package-lock.json | 7 ++++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/node_modules/http-cache-semantics/index.js b/node_modules/http-cache-semantics/index.js index 4f6c2f30498b4..31fba4860024c 100644 --- a/node_modules/http-cache-semantics/index.js +++ b/node_modules/http-cache-semantics/index.js @@ -7,6 +7,7 @@ const statusCodeCacheableByDefault = new Set([ 206, 300, 301, + 308, 404, 405, 410, @@ -79,10 +80,10 @@ function parseCacheControl(header) { // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale - const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing + const parts = header.trim().split(/,/); for (const part of parts) { - const [k, v] = part.split(/\s*=\s*/, 2); - cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting + const [k, v] = part.split(/=/, 2); + cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, ''); } return cc; diff --git a/node_modules/http-cache-semantics/package.json b/node_modules/http-cache-semantics/package.json index 897798d8ccc79..defbb045a6383 100644 --- a/node_modules/http-cache-semantics/package.json +++ b/node_modules/http-cache-semantics/package.json @@ -1,6 +1,6 @@ { "name": "http-cache-semantics", - "version": "4.1.0", + "version": "4.1.1", "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", "repository": "https://github.com/kornelski/http-cache-semantics.git", "main": "index.js", @@ -13,12 +13,6 @@ "author": "Kornel Lesiński (https://kornel.ski/)", "license": "BSD-2-Clause", "devDependencies": { - "eslint": "^5.13.0", - "eslint-plugin-prettier": "^3.0.1", - "husky": "^0.14.3", - "lint-staged": "^8.1.3", - "mocha": "^5.1.0", - "prettier": "^1.14.3", - "prettier-eslint-cli": "^4.7.1" + "mocha": "^10.0" } } diff --git a/package-lock.json b/package-lock.json index 237a3af98d7ca..e75716a4f9aed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5783,9 +5783,10 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "inBundle": true, - "license": "BSD-2-Clause" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "inBundle": true }, "node_modules/http-proxy": { "version": "1.18.1", From 5ec35b7283b2d37f1431239f33ba420bb4347f0b Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 26 Jan 2023 11:55:41 -0800 Subject: [PATCH 022/868] chore: clean snapshot before code change --- .../test/arborist/reify.js.test.cjs | 151 ------------------ 1 file changed, 151 deletions(-) diff --git a/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs index 4c5a3bc9400ba..bfd9fa882147e 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs @@ -32352,157 +32352,6 @@ ArboristNode { } ` -exports[`test/arborist/reify.js TAP rollbacks fail retiring node, but then rimraf fixes it > expect resolving Promise 1`] = ` -ArboristNode { - "children": Map { - "@isaacs/testing-bundledeps-parent" => ArboristNode { - "children": Map { - "@isaacs/testing-bundledeps" => ArboristNode { - "bundleDependencies": Array [ - "@isaacs/testing-bundledeps-a", - ], - "children": Map { - "@isaacs/testing-bundledeps-a" => ArboristNode { - "bundled": true, - "bundler": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "edgesIn": Set { - EdgeIn { - "from": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "name": "@isaacs/testing-bundledeps-a", - "spec": "*", - "type": "prod", - }, - }, - "edgesOut": Map { - "@isaacs/testing-bundledeps-b" => EdgeOut { - "name": "@isaacs/testing-bundledeps-b", - "spec": "*", - "to": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-b", - "type": "prod", - }, - }, - "location": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-a", - "name": "@isaacs/testing-bundledeps-a", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it/node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-a", - "resolved": "https://registry.npmjs.org/@isaacs/testing-bundledeps-a/-/testing-bundledeps-a-1.0.0.tgz", - "version": "1.0.0", - }, - "@isaacs/testing-bundledeps-b" => ArboristNode { - "bundled": true, - "bundler": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "edgesIn": Set { - EdgeIn { - "from": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-a", - "name": "@isaacs/testing-bundledeps-b", - "spec": "*", - "type": "prod", - }, - EdgeIn { - "from": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-c", - "name": "@isaacs/testing-bundledeps-b", - "spec": "*", - "type": "prod", - }, - }, - "location": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-b", - "name": "@isaacs/testing-bundledeps-b", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it/node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-b", - "resolved": "https://registry.npmjs.org/@isaacs/testing-bundledeps-b/-/testing-bundledeps-b-1.0.0.tgz", - "version": "1.0.0", - }, - "@isaacs/testing-bundledeps-c" => ArboristNode { - "edgesIn": Set { - EdgeIn { - "from": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "name": "@isaacs/testing-bundledeps-c", - "spec": "*", - "type": "prod", - }, - }, - "edgesOut": Map { - "@isaacs/testing-bundledeps-b" => EdgeOut { - "name": "@isaacs/testing-bundledeps-b", - "spec": "*", - "to": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-b", - "type": "prod", - }, - }, - "location": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-c", - "name": "@isaacs/testing-bundledeps-c", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it/node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-c", - "resolved": "https://registry.npmjs.org/@isaacs/testing-bundledeps-c/-/testing-bundledeps-c-2.0.0.tgz", - "version": "2.0.0", - }, - }, - "edgesIn": Set { - EdgeIn { - "from": "node_modules/@isaacs/testing-bundledeps-parent", - "name": "@isaacs/testing-bundledeps", - "spec": "^1.0.0", - "type": "prod", - }, - }, - "edgesOut": Map { - "@isaacs/testing-bundledeps-a" => EdgeOut { - "name": "@isaacs/testing-bundledeps-a", - "spec": "*", - "to": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-a", - "type": "prod", - }, - "@isaacs/testing-bundledeps-c" => EdgeOut { - "name": "@isaacs/testing-bundledeps-c", - "spec": "*", - "to": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps/node_modules/@isaacs/testing-bundledeps-c", - "type": "prod", - }, - }, - "location": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "name": "@isaacs/testing-bundledeps", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it/node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "resolved": "https://registry.npmjs.org/@isaacs/testing-bundledeps/-/testing-bundledeps-1.0.0.tgz", - "version": "1.0.0", - }, - }, - "edgesIn": Set { - EdgeIn { - "from": "", - "name": "@isaacs/testing-bundledeps-parent", - "spec": "*", - "type": "prod", - }, - }, - "edgesOut": Map { - "@isaacs/testing-bundledeps" => EdgeOut { - "name": "@isaacs/testing-bundledeps", - "spec": "^1.0.0", - "to": "node_modules/@isaacs/testing-bundledeps-parent/node_modules/@isaacs/testing-bundledeps", - "type": "prod", - }, - }, - "location": "node_modules/@isaacs/testing-bundledeps-parent", - "name": "@isaacs/testing-bundledeps-parent", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it/node_modules/@isaacs/testing-bundledeps-parent", - "resolved": "https://registry.npmjs.org/@isaacs/testing-bundledeps-parent/-/testing-bundledeps-parent-2.0.0.tgz", - "version": "2.0.0", - }, - }, - "edgesOut": Map { - "@isaacs/testing-bundledeps-parent" => EdgeOut { - "name": "@isaacs/testing-bundledeps-parent", - "spec": "*", - "to": "node_modules/@isaacs/testing-bundledeps-parent", - "type": "prod", - }, - }, - "isProjectRoot": true, - "location": "", - "name": "tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it", - "packageName": "testing-bundledeps-3", - "path": "{CWD}/test/arborist/tap-testdir-reify-rollbacks-fail-retiring-node-but-then-rimraf-fixes-it", - "version": "1.0.0", -} -` - exports[`test/arborist/reify.js TAP running lifecycle scripts of unchanged link nodes on reify > result 1`] = ` ArboristNode { "children": Map { From 72a7a5915e9d333d104d88bf73d7a555f9400e24 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 26 Jan 2023 12:25:18 -0800 Subject: [PATCH 023/868] fix: only save package-lock when truly finished When we update the trees, the edges are refreshed to correct their specs. If we have written the package-lock before this point, it will be incorrect. No new tests are needed as existing tests were snapshotted w/ the broken behavior, and are fixed now showing this bugfix in action. --- workspaces/arborist/lib/arborist/reify.js | 86 ++++++++----------- .../test/arborist/reify.js.test.cjs | 6 +- 2 files changed, 40 insertions(+), 52 deletions(-) diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index 3c8059d281d13..87993cca876d6 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -82,7 +82,6 @@ const _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes') const _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree') const _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged') const _saveIdealTree = Symbol.for('saveIdealTree') -const _saveLockFile = Symbol('saveLockFile') const _copyIdealToActual = Symbol('copyIdealToActual') const _addOmitsToTrashList = Symbol('addOmitsToTrashList') const _packageLockOnly = Symbol('packageLockOnly') @@ -1404,64 +1403,53 @@ module.exports = cls => class Reifier extends cls { } } - // preserve indentation, if possible - const { - [Symbol.for('indent')]: indent, - } = this.idealTree.package - const format = indent === undefined ? ' ' : indent - - const saveOpt = { - format: (this[_formatPackageLock] && format) ? format - : this[_formatPackageLock], - } - - const promises = [this[_saveLockFile](saveOpt)] - - const updatePackageJson = async (tree) => { - const pkgJson = await PackageJson.load(tree.path) - .catch(() => new PackageJson(tree.path)) - const { - dependencies = {}, - devDependencies = {}, - optionalDependencies = {}, - peerDependencies = {}, - // bundleDependencies is not required by PackageJson like the other fields here - // PackageJson also doesn't omit an empty array for this field so defaulting this - // to an empty array would add that field to every package.json file. - bundleDependencies, - } = tree.package - - pkgJson.update({ - dependencies, - devDependencies, - optionalDependencies, - peerDependencies, - bundleDependencies, - }) - await pkgJson.save() - } - if (save) { for (const tree of updatedTrees) { // refresh the edges so they have the correct specs tree.package = tree.package - promises.push(updatePackageJson(tree)) + const pkgJson = await PackageJson.load(tree.path) + .catch(() => new PackageJson(tree.path)) + const { + dependencies = {}, + devDependencies = {}, + optionalDependencies = {}, + peerDependencies = {}, + // bundleDependencies is not required by PackageJson like the other + // fields here PackageJson also doesn't omit an empty array for this + // field so defaulting this to an empty array would add that field to + // every package.json file. + bundleDependencies, + } = tree.package + + pkgJson.update({ + dependencies, + devDependencies, + optionalDependencies, + peerDependencies, + bundleDependencies, + }) + await pkgJson.save() } } - await Promise.all(promises) - process.emit('timeEnd', 'reify:save') - return true - } + // before now edge specs could be changing, affecting the `requires` field + // in the package lock, so we hold off saving to the very last action + if (this[_usePackageLock]) { + // preserve indentation, if possible + let format = this.idealTree.package[Symbol.for('indent')] + if (format === undefined) { + format = ' ' + } - async [_saveLockFile] (saveOpt) { - if (!this[_usePackageLock]) { - return + // TODO this ignores options.save + await this.idealTree.meta.save({ + format: (this[_formatPackageLock] && format) ? format + : this[_formatPackageLock], + }) } - const { meta } = this.idealTree - - return meta.save(saveOpt) + process.emit('timeEnd', 'reify:save') + return true } async [_copyIdealToActual] () { diff --git a/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs index bfd9fa882147e..2a92b735c3d08 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs @@ -32675,7 +32675,7 @@ exports[`test/arborist/reify.js TAP save package.json on update should update na "a": { "version": "file:a", "requires": { - "abbrev": "^1.0.4", + "abbrev": "^1.1.1", "once": "^1.3.2" } }, @@ -32687,7 +32687,7 @@ exports[`test/arborist/reify.js TAP save package.json on update should update na "b": { "version": "file:b", "requires": { - "abbrev": "^1.0.4" + "abbrev": "^1.1.1" } }, "once": { @@ -32766,7 +32766,7 @@ exports[`test/arborist/reify.js TAP save package.json on update should update si "version": "file:a", "requires": { "abbrev": "^1.0.4", - "once": "^1.3.2" + "once": "^1.4.0" } }, "abbrev": { From 9235cfc1963e25d35ef872682c90a6faaf375061 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 26 Jan 2023 11:46:56 -0800 Subject: [PATCH 024/868] chore: cleanup and add a couple more known failures --- .github/workflows/node-integration.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml index b6ed78ba04aad..cc951d52f828d 100644 --- a/.github/workflows/node-integration.yml +++ b/.github/workflows/node-integration.yml @@ -264,12 +264,30 @@ jobs: 'https-proxy-agent', // looks ssl related 'node-gyp', // one test consistently times out 'resolve', // compares results to require.resolve and fails, also missing inspector/promises - 'serialport', // esbuild barfs on node 20.0.0-pre - 'undici', // test failure in node >=19, unable to root cause 'uuid', // tests that crypto.getRandomValues throws but it doesn't 'weak', // doesn't seem to build in node >12 + 'mkdirp', // failing actions in own repo ] + if [[ "${{ startsWith(inputs.nodeVersion, '18.') }}" == "true" ]]; then + // build fails in node 18 only + knownFailures.push('multer') + fi + + if [[ "${{ startsWith(inputs.nodeVersion, '19.') }}" == "true" ]]; then + // test failure in node >=19, unable to root cause + knownFailures.push('undici') + fi + + if [[ "${{ inputs.nodeVersion }}" == "nightly" ]]; then + // test failure in node >=19, unable to root cause + knownFailures.push('undici') + // fails in node 20, looks like a streams issue + knownFailures.push('fastify') + // esbuild barfs on node 20.0.0-pre + knownFailures.push('serialport') + fi + // this is a manually updated list of packages that are flaky const supplementalFlaky = [ 'pino', // flaky test test/transport/core.test.js:401 From 35269337896e1fd042b680fc82600d6ebe30f3e3 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 26 Jan 2023 11:47:31 -0800 Subject: [PATCH 025/868] chore: remove lockfile warning when original is v1 --- .github/workflows/node-integration.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml index cc951d52f828d..a94470999abfd 100644 --- a/.github/workflows/node-integration.yml +++ b/.github/workflows/node-integration.yml @@ -409,11 +409,8 @@ jobs: if [[ -f "package-lock.json" ]]; then newLockfileVersion=$(cat "package-lock.json" | jq .lockfileVersion) if [[ "$newLockfileVersion" -ne "${{ steps.download.outputs.lockfileVersion }}" ]]; then - logMessage="lockfileVersion changed from ${{ steps.download.outputs.lockfileVersion }} to $newLockfileVersion" - if [[ "${{ steps.download.outputs.lockfileVersion }}" -eq 1 ]]; then - echo "::warning ::$logMessage" - else - echo "::error ::$logMessage" + if [[ "${{ steps.download.outputs.lockfileVersion }}" -ne 1 ]]; then + echo "::error ::lockfileVersion changed from ${{ steps.download.outputs.lockfileVersion }} to $newLockfileVersion" exit 1 fi fi From ff35ed9cffb71e935dba56c45d7f0dc771b5d290 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 26 Jan 2023 11:47:56 -0800 Subject: [PATCH 026/868] chore: add installFlags input to provide more flags to npm install --- .github/workflows/node-integration.yml | 13 +++++++++++++ .github/workflows/release-integration.yml | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/node-integration.yml b/.github/workflows/node-integration.yml index a94470999abfd..4191a1b46c54d 100644 --- a/.github/workflows/node-integration.yml +++ b/.github/workflows/node-integration.yml @@ -13,6 +13,11 @@ on: required: true type: string default: git + installFlags: + description: 'extra flags to pass to npm install' + required: false + type: string + default: '' workflow_dispatch: inputs: @@ -26,6 +31,11 @@ on: required: true type: string default: git + installFlags: + description: 'extra flags to pass to npm install' + required: false + type: string + default: '' jobs: build-nodejs: @@ -307,6 +317,9 @@ jobs: if (meta.install) { install_flags.push(meta.install.slice(1)) } + if [[ "${{ inputs.installFlags }}" != "" ]]; then + install_flags.push("${{ inputs.installFlags }}") + fi const context = JSON.parse(execSync(`npm show ${package} --json`)) const test = meta.scripts ? meta.scripts.map((script) => `npm run ${script}`) : ['npm test'] diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml index 331f0682367ea..23b39ecd2dcb9 100644 --- a/.github/workflows/release-integration.yml +++ b/.github/workflows/release-integration.yml @@ -7,12 +7,22 @@ on: description: npm version to test type: string required: true + installFlags: + description: 'extra flags to pass to npm install' + required: false + type: string + default: '' workflow_dispatch: inputs: npmVersion: description: npm version to test type: string required: true + installFlags: + description: 'extra flags to pass to npm install' + required: false + type: string + default: '' jobs: node-integration: @@ -28,3 +38,4 @@ jobs: with: nodeVersion: ${{ matrix.nodeVersion }} npmVersion: ${{ inputs.npmVersion }} + installFlags: ${{ inputs.installFlags }} From e5ecc7fbefd2401f06e4265462d2f897afba222b Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 26 Jan 2023 11:57:41 -0800 Subject: [PATCH 027/868] chore: remove unnecessary release-integration workflow --- .github/workflows/release-integration.yml | 41 ------------------- .github/workflows/release.yml | 10 ++++- .../template-oss/_job-release-integration.yml | 10 ++++- 3 files changed, 18 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/release-integration.yml diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml deleted file mode 100644 index 23b39ecd2dcb9..0000000000000 --- a/.github/workflows/release-integration.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: release integration - -on: - workflow_call: - inputs: - npmVersion: - description: npm version to test - type: string - required: true - installFlags: - description: 'extra flags to pass to npm install' - required: false - type: string - default: '' - workflow_dispatch: - inputs: - npmVersion: - description: npm version to test - type: string - required: true - installFlags: - description: 'extra flags to pass to npm install' - required: false - type: string - default: '' - -jobs: - node-integration: - name: nodejs@${{ matrix.nodeVersion }} integration - strategy: - fail-fast: false - matrix: - nodeVersion: - - 18 - - 19 - - nightly - uses: ./.github/workflows/node-integration.yml - with: - nodeVersion: ${{ matrix.nodeVersion }} - npmVersion: ${{ inputs.npmVersion }} - installFlags: ${{ inputs.installFlags }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 487156d995ebc..2f95160d99443 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -303,8 +303,16 @@ jobs: needs: release name: Release Integration if: needs.release.outputs.release - uses: ./.github/workflows/release-integration.yml + strategy: + fail-fast: false + matrix: + nodeVersion: + - 18 + - 19 + - nightly + uses: ./.github/workflows/node-integration.yml with: + nodeVersion: ${{ matrix.nodeVersion }} npmVersion: ${{ fromJSON(needs.release.outputs.release).version }} post-release-integration: diff --git a/scripts/template-oss/_job-release-integration.yml b/scripts/template-oss/_job-release-integration.yml index e72ee3c9895fa..3c10d74525bce 100644 --- a/scripts/template-oss/_job-release-integration.yml +++ b/scripts/template-oss/_job-release-integration.yml @@ -1,3 +1,11 @@ -uses: ./.github/workflows/release-integration.yml +strategy: + fail-fast: false + matrix: + nodeVersion: + - 18 + - 19 + - nightly +uses: ./.github/workflows/node-integration.yml with: + nodeVersion: $\{{ matrix.nodeVersion }} npmVersion: $\{{ fromJSON(needs.release.outputs.release).version }} From 328c3d8e7362eb08ae2aebabc47f8f3c2537a1d2 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 26 Jan 2023 11:08:54 -0800 Subject: [PATCH 028/868] fix: repair config items using raw values when possible closes #6085 --- workspaces/config/lib/index.js | 5 +++-- .../config/tap-snapshots/test/index.js.test.cjs | 12 ++++++++++++ workspaces/config/test/index.js | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/workspaces/config/lib/index.js b/workspaces/config/lib/index.js index 1ddf267839195..6520e5616ff41 100644 --- a/workspaces/config/lib/index.js +++ b/workspaces/config/lib/index.js @@ -482,8 +482,9 @@ class Config { if (problem.action === 'delete') { this.delete(problem.key, problem.where) } else if (problem.action === 'rename') { - const old = this.get(problem.from, problem.where) - this.set(problem.to, old, problem.where) + const raw = this.data.get(problem.where).raw?.[problem.from] + const calculated = this.get(problem.from, problem.where) + this.set(problem.to, raw || calculated, problem.where) this.delete(problem.from, problem.where) } } diff --git a/workspaces/config/tap-snapshots/test/index.js.test.cjs b/workspaces/config/tap-snapshots/test/index.js.test.cjs index 6680fd2377960..eccdbee3abced 100644 --- a/workspaces/config/tap-snapshots/test/index.js.test.cjs +++ b/workspaces/config/tap-snapshots/test/index.js.test.cjs @@ -25,6 +25,18 @@ exports[`test/index.js TAP credentials management def_auth > other registry 1`] Object {} ` +exports[`test/index.js TAP credentials management def_authEnv > default registry 1`] = ` +Object { + "auth": "\${PATH}", + "password": "", + "username": "<\\u0004�", +} +` + +exports[`test/index.js TAP credentials management def_authEnv > other registry 1`] = ` +Object {} +` + exports[`test/index.js TAP credentials management def_passNoUser > default registry 1`] = ` Object { "email": "i@izs.me", diff --git a/workspaces/config/test/index.js b/workspaces/config/test/index.js index d7d55c2366237..99c1c3647ef77 100644 --- a/workspaces/config/test/index.js +++ b/workspaces/config/test/index.js @@ -701,6 +701,9 @@ email = i@izs.me '.npmrc': `_auth = ${Buffer.from('hello:world').toString('base64')} always-auth = true`, }, + def_authEnv: { + '.npmrc': '_auth = ${PATH}', + }, none_authToken: { '.npmrc': '_authToken = 0bad1de4' }, none_lcAuthToken: { '.npmrc': '_authtoken = 0bad1de4' }, none_emptyConfig: { '.npmrc': '' }, From 1525a5e7fba4c996ac3bed5fdb75da275c537da8 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 24 Jan 2023 10:14:29 -0800 Subject: [PATCH 029/868] fix: unpublish with scoped registry Unpublish now works if you have a scoped registry config --- lib/commands/unpublish.js | 5 ++++- test/fixtures/mock-npm.js | 2 +- test/lib/commands/unpublish.js | 40 +++++++++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/lib/commands/unpublish.js b/lib/commands/unpublish.js index 9985e2e39f140..f1bcded192e5a 100644 --- a/lib/commands/unpublish.js +++ b/lib/commands/unpublish.js @@ -26,7 +26,10 @@ class Unpublish extends BaseCommand { async getKeysOfVersions (name, opts) { const pkgUri = npa(name).escapedName - const json = await npmFetch.json(`${pkgUri}?write=true`, opts) + const json = await npmFetch.json(`${pkgUri}?write=true`, { + ...opts, + spec: name, + }) return Object.keys(json.versions) } diff --git a/test/fixtures/mock-npm.js b/test/fixtures/mock-npm.js index 2cada1354878c..a2d35c2479d73 100644 --- a/test/fixtures/mock-npm.js +++ b/test/fixtures/mock-npm.js @@ -206,7 +206,7 @@ const setupMockNpm = async (t, { acc.env[`process.env."npm_config_${key}"`] = value } else { const values = [].concat(value) - acc.argv.push(...values.flatMap(v => [`--${key}`, v.toString()])) + acc.argv.push(...values.flatMap(v => `--${key}=${v.toString()}`)) } acc.config[key] = value return acc diff --git a/test/lib/commands/unpublish.js b/test/lib/commands/unpublish.js index cba7298475133..96c06bf3ffee6 100644 --- a/test/lib/commands/unpublish.js +++ b/test/lib/commands/unpublish.js @@ -27,7 +27,7 @@ t.test('no args --force success', async t => { }) const manifest = registry.manifest({ name: pkg }) await registry.package({ manifest, query: { write: true } }) - registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + registry.unpublish({ manifest }) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package@1.0.0') }) @@ -148,7 +148,7 @@ t.test('no version found in package.json', async t => { }) const manifest = registry.manifest({ name: pkg }) await registry.package({ manifest, query: { write: true } }) - registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + registry.unpublish({ manifest }) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package') @@ -168,7 +168,7 @@ t.test('unpublish --force no version set', async t => { }) const manifest = registry.manifest({ name: pkg }) await registry.package({ manifest, query: { write: true }, times: 2 }) - registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + registry.unpublish({ manifest }) await npm.exec('unpublish', ['test-package']) t.equal(joinedOutput(), '- test-package') @@ -361,7 +361,7 @@ t.test('publishConfig no spec', async t => { }) const manifest = registry.manifest({ name: pkg }) await registry.package({ manifest, query: { write: true } }) - registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + registry.unpublish({ manifest }) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package@1.0.0') }) @@ -391,11 +391,41 @@ t.test('publishConfig with spec', async t => { }) const manifest = registry.manifest({ name: pkg }) await registry.package({ manifest, query: { write: true }, times: 2 }) - registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + registry.unpublish({ manifest }) await npm.exec('unpublish', ['test-package']) t.equal(joinedOutput(), '- test-package') }) +t.test('scoped registry config', async t => { + const scopedPkg = `@npm/test-package` + const alternateRegistry = 'https://other.registry.npmjs.org' + const { npm } = await loadMockNpm(t, { + config: { + force: true, + '@npm:registry': alternateRegistry, + '//other.registry.npmjs.org/:_authToken': 'test-other-token', + }, + prefixDir: { + 'package.json': JSON.stringify({ + name: pkg, + version: '1.0.0', + publishConfig: { + registry: alternateRegistry, + }, + }, null, 2), + }, + }) + const registry = new MockRegistry({ + tap: t, + registry: alternateRegistry, + authorization: 'test-other-token', + }) + const manifest = registry.manifest({ name: scopedPkg }) + await registry.package({ manifest, query: { write: true } }) + registry.unpublish({ manifest }) + await npm.exec('unpublish', [scopedPkg]) +}) + t.test('completion', async t => { const { npm } = await loadMockNpm(t, { config: { From a39556f1cff4526dcbcb7b65cdd86a1ba092e13e Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 14:22:05 -0800 Subject: [PATCH 030/868] deps: @npmcli/template-oss@4.11.3 --- .github/workflows/pull-request.yml | 4 +- .github/workflows/release.yml | 9 ++++- docs/package.json | 4 +- mock-registry/package.json | 4 +- node_modules/.gitignore | 5 +++ package-lock.json | 57 ++++++++++++++++----------- package.json | 2 +- smoke-tests/package.json | 4 +- workspaces/arborist/package.json | 4 +- workspaces/config/package.json | 4 +- workspaces/libnpmaccess/package.json | 4 +- workspaces/libnpmdiff/package.json | 4 +- workspaces/libnpmexec/package.json | 4 +- workspaces/libnpmfund/package.json | 4 +- workspaces/libnpmhook/package.json | 4 +- workspaces/libnpmorg/package.json | 4 +- workspaces/libnpmpack/package.json | 4 +- workspaces/libnpmpublish/package.json | 4 +- workspaces/libnpmsearch/package.json | 4 +- workspaces/libnpmteam/package.json | 4 +- workspaces/libnpmversion/package.json | 4 +- 21 files changed, 81 insertions(+), 60 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3d008208833f3..c0c46fc557a80 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -38,8 +38,8 @@ jobs: id: commit continue-on-error: true run: | - npx --offline commitlint -V --from origin/${{ github.base_ref }} --to ${{ github.event.pull_request.head.sha }} + npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' run: | - echo ${{ github.event.pull_request.title }} | npx --offline commitlint -V + echo '${{ github.event.pull_request.title }}' | npx --offline commitlint -V diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f95160d99443..7f875ff435bce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -351,11 +351,18 @@ jobs: if (updateComment) { console.log('Found comment to update:', JSON.stringify(updateComment, null, 2)) + let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`) + if (RESULT === 'x') { + body += `\n\n:rotating_light:` + body += ` @npm/cli-team: The post-release workflow failed for this release.` + body += ` Manual steps may need to be taken after examining the workflow output` + body += ` from the above workflow run. :rotating_light:` + } await github.rest.issues.updateComment({ owner, repo, + body, comment_id: updateComment.id, - body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`), }) } else { console.log('No matching comments found:', JSON.stringify(comments, null, 2)) diff --git a/docs/package.json b/docs/package.json index 2d92e2b37ecf5..9bca1aa5cdab5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "front-matter": "^4.0.2", "ignore-walk": "^6.0.0", "jsdom": "^20.0.3", @@ -56,7 +56,7 @@ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "ciVersions": "latest", "engines": "^14.17.0 || ^16.13.0 || >=18.0.0", - "version": "4.11.1", + "version": "4.11.3", "content": "../scripts/template-oss/index.js", "workspaceRepo": { "add": { diff --git a/mock-registry/package.json b/mock-registry/package.json index 36d05d370a5d1..d381765da5c1c 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -34,7 +34,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1" + "version": "4.11.3" }, "tap": { "no-coverage": true, @@ -46,7 +46,7 @@ "devDependencies": { "@npmcli/arborist": "^6.1.1", "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7", diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 1a8e77b91f589..324d4d592a044 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -21,6 +21,11 @@ !/@npmcli/git !/@npmcli/installed-package-contents !/@npmcli/map-workspaces +!/@npmcli/map-workspaces/node_modules/ +/@npmcli/map-workspaces/node_modules/* +!/@npmcli/map-workspaces/node_modules/@npmcli/ +/@npmcli/map-workspaces/node_modules/@npmcli/* +!/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder !/@npmcli/metavuln-calculator !/@npmcli/name-from-folder !/@npmcli/node-gyp diff --git a/package-lock.json b/package-lock.json index e75716a4f9aed..0054bd46c99fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -163,7 +163,7 @@ "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "licensee": "^10.0.0", "nock": "^13.2.4", "npm-packlist": "^7.0.4", @@ -184,7 +184,7 @@ "devDependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "front-matter": "^4.0.2", "ignore-walk": "^6.0.0", "jsdom": "^20.0.3", @@ -209,7 +209,7 @@ "devDependencies": { "@npmcli/arborist": "^6.1.1", "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", "pacote": "^15.0.7", @@ -2163,11 +2163,12 @@ } }, "node_modules/@npmcli/map-workspaces": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.1.tgz", + "integrity": "sha512-QXwE2p5zRTP6X8Irgf/swYwwdQEalSA1GBm0IGE/86R5EJbUGgKMOP0kOjaJWJxaWPkSqyhM8N50SPxFHTfkNg==", "inBundle": true, - "license": "ISC", "dependencies": { - "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/name-from-folder": "^2.0.0", "glob": "^8.0.1", "minimatch": "^5.0.1", "read-package-json-fast": "^3.0.0" @@ -2176,6 +2177,15 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", + "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", + "inBundle": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/metavuln-calculator": { "version": "5.0.0", "license": "ISC", @@ -2195,7 +2205,6 @@ }, "node_modules/@npmcli/name-from-folder": { "version": "1.0.1", - "inBundle": true, "license": "ISC" }, "node_modules/@npmcli/node-gyp": { @@ -2258,9 +2267,9 @@ "link": true }, "node_modules/@npmcli/template-oss": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.1.tgz", - "integrity": "sha512-Rs0sYcHhbcLA9mfQz/ojdNjKIMqyPG9kA/Ie2W4OxuBeVR/rhDf7yL4iqTK4Rum9dRVz9jWXex5PDNyDyiQnHw==", + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.3.tgz", + "integrity": "sha512-AEpwlpIXsiPUnM9gFHQHtXkyq1atSHL+bINSANPrR9SAwXSGchprbXRxZunlciWvEkX+GS99tbE6k65dbj8MgQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -14357,7 +14366,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -14412,7 +14421,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^3.0.0", @@ -14440,7 +14449,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "engines": { @@ -14457,7 +14466,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14481,7 +14490,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "engines": { @@ -14508,7 +14517,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "bin-links": "^4.0.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -14528,7 +14537,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "engines": { @@ -14544,7 +14553,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14561,7 +14570,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "minipass": "^4.0.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -14581,7 +14590,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.0.7", "spawk": "^1.7.1", "tap": "^16.3.2" @@ -14603,7 +14612,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -14620,7 +14629,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14637,7 +14646,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -14657,7 +14666,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "require-inject": "^1.4.4", "tap": "^16.3.2" }, diff --git a/package.json b/package.json index 7a29b5d8a9341..bc9a4c4daafca 100644 --- a/package.json +++ b/package.json @@ -196,7 +196,7 @@ "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "licensee": "^10.0.0", "nock": "^13.2.4", "npm-packlist": "^7.0.4", diff --git a/smoke-tests/package.json b/smoke-tests/package.json index cff5f190a01f1..3505614b3b6da 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -21,7 +21,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -32,7 +32,7 @@ "license": "ISC", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 735dd41a2ef50..fe58adaf578d6 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^3.0.0", @@ -102,7 +102,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 11835648ea061..09e28f556da7b 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "dependencies": { @@ -50,6 +50,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1" + "version": "4.11.3" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index c16c640c5eb63..e9f728b22997c 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -41,7 +41,7 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index a1c261ba9dd30..5c8202998c326 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "dependencies": { @@ -59,7 +59,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index d91219b1beb44..c6ed4c7337d1b 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "bin-links": "^4.0.1", "just-extend": "^6.1.1", "just-safe-set": "^4.1.1", @@ -76,7 +76,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index f239951ef3a89..b70bca44e11ce 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "tap": "^16.3.2" }, "dependencies": { @@ -53,7 +53,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index e1e55e0234985..7559f52aedabe 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index b8dacb4a646a1..9a6fbddef77fe 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -28,7 +28,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "minipass": "^4.0.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -49,7 +49,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 99b9259d8319d..63c683dbd1726 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.0.7", "spawk": "^1.7.1", "tap": "^16.3.2" @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 6c64950744314..5af8683854b66 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -26,7 +26,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.3.2" @@ -50,7 +50,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 4dcac9839e61e..5d11b783e396c 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -45,7 +45,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 38b08c83d7bcf..3cd79e409fedc 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "nock": "^13.2.4", "tap": "^16.3.2" }, @@ -39,7 +39,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index c839a95fb9c13..f9159a25db8af 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.1", + "@npmcli/template-oss": "4.11.3", "require-inject": "^1.4.4", "tap": "^16.3.2" }, @@ -48,7 +48,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "../../scripts/template-oss/index.js" } } From 1d4be7a5457fd0081696e29f8382645873cf13d9 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 14:51:03 -0800 Subject: [PATCH 031/868] deps: @npmcli/map-workspaces@3.0.1 --- .../@npmcli/name-from-folder/LICENSE | 15 +++++++ .../@npmcli/name-from-folder/lib/index.js | 7 +++ .../@npmcli/name-from-folder/package.json | 43 +++++++++++++++++++ .../@npmcli/map-workspaces/package.json | 10 ++--- package-lock.json | 6 +-- package.json | 2 +- workspaces/arborist/package.json | 2 +- workspaces/config/package.json | 2 +- 8 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE create mode 100644 node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js create mode 100644 node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE new file mode 100644 index 0000000000000..d24a9fca761c8 --- /dev/null +++ b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js new file mode 100644 index 0000000000000..afb1dbb76297f --- /dev/null +++ b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js @@ -0,0 +1,7 @@ +const { basename, dirname } = require('path') + +const getName = (parent, base) => + parent.charAt(0) === '@' ? `${parent}/${base}` : base + +module.exports = dir => dir ? getName(basename(dirname(dir)), basename(dir)) + : false diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json new file mode 100644 index 0000000000000..f0aa5b16dba1a --- /dev/null +++ b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json @@ -0,0 +1,43 @@ +{ + "name": "@npmcli/name-from-folder", + "version": "2.0.0", + "files": [ + "bin/", + "lib/" + ], + "main": "lib/index.js", + "description": "Get the package name from a folder path", + "repository": { + "type": "git", + "url": "https://github.com/npm/name-from-folder.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.1", + "@npmcli/template-oss": "4.11.0", + "tap": "^16.3.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.11.0" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + } +} diff --git a/node_modules/@npmcli/map-workspaces/package.json b/node_modules/@npmcli/map-workspaces/package.json index c8113cb25eb32..b967d974d31bf 100644 --- a/node_modules/@npmcli/map-workspaces/package.json +++ b/node_modules/@npmcli/map-workspaces/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/map-workspaces", - "version": "3.0.0", + "version": "3.0.1", "main": "lib/index.js", "files": [ "bin/", @@ -42,18 +42,18 @@ ] }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "4.5.1", + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.11.0", "tap": "^16.0.1" }, "dependencies": { - "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/name-from-folder": "^2.0.0", "glob": "^8.0.1", "minimatch": "^5.0.1", "read-package-json-fast": "^3.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.5.1" + "version": "4.11.0" } } diff --git a/package-lock.json b/package-lock.json index 0054bd46c99fc..159c9effb5d34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,7 +87,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^6.2.0", "@npmcli/config": "^6.1.1", - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", @@ -14385,7 +14385,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/fs": "^3.1.0", "@npmcli/installed-package-contents": "^2.0.0", - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "@npmcli/metavuln-calculator": "^5.0.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^3.0.0", @@ -14439,7 +14439,7 @@ "version": "6.1.1", "license": "ISC", "dependencies": { - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "ini": "^3.0.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", diff --git a/package.json b/package.json index bc9a4c4daafca..7f296b0176f8d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^6.2.0", "@npmcli/config": "^6.1.1", - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index fe58adaf578d6..78425f2af5231 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -6,7 +6,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/fs": "^3.1.0", "@npmcli/installed-package-contents": "^2.0.0", - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "@npmcli/metavuln-calculator": "^5.0.0", "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^3.0.0", diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 09e28f556da7b..dec63b58c9888 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -37,7 +37,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/map-workspaces": "^3.0.0", + "@npmcli/map-workspaces": "^3.0.1", "ini": "^3.0.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", From 4b8046e680d5907d2df71d6d3775b66e0bea7ed2 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 14:58:28 -0800 Subject: [PATCH 032/868] deps: @npmcli/name-from-folder@2.0.0 --- node_modules/.gitignore | 5 --- .../@npmcli/name-from-folder/LICENSE | 15 ------- .../@npmcli/name-from-folder/package.json | 43 ------------------- .../@npmcli/name-from-folder/index.js | 7 --- .../name-from-folder/lib/index.js | 0 .../@npmcli/name-from-folder/package.json | 38 +++++++++++----- package-lock.json | 20 ++++----- package.json | 2 +- workspaces/arborist/package.json | 2 +- 9 files changed, 37 insertions(+), 95 deletions(-) delete mode 100644 node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE delete mode 100644 node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json delete mode 100644 node_modules/@npmcli/name-from-folder/index.js rename node_modules/@npmcli/{map-workspaces/node_modules/@npmcli => }/name-from-folder/lib/index.js (100%) diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 324d4d592a044..1a8e77b91f589 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -21,11 +21,6 @@ !/@npmcli/git !/@npmcli/installed-package-contents !/@npmcli/map-workspaces -!/@npmcli/map-workspaces/node_modules/ -/@npmcli/map-workspaces/node_modules/* -!/@npmcli/map-workspaces/node_modules/@npmcli/ -/@npmcli/map-workspaces/node_modules/@npmcli/* -!/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder !/@npmcli/metavuln-calculator !/@npmcli/name-from-folder !/@npmcli/node-gyp diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE deleted file mode 100644 index d24a9fca761c8..0000000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json b/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json deleted file mode 100644 index f0aa5b16dba1a..0000000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@npmcli/name-from-folder", - "version": "2.0.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "Get the package name from a folder path", - "repository": { - "type": "git", - "url": "https://github.com/npm/name-from-folder.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.11.0", - "tap": "^16.3.2" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.0" - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/@npmcli/name-from-folder/index.js b/node_modules/@npmcli/name-from-folder/index.js deleted file mode 100644 index afb1dbb76297f..0000000000000 --- a/node_modules/@npmcli/name-from-folder/index.js +++ /dev/null @@ -1,7 +0,0 @@ -const { basename, dirname } = require('path') - -const getName = (parent, base) => - parent.charAt(0) === '@' ? `${parent}/${base}` : base - -module.exports = dir => dir ? getName(basename(dirname(dir)), basename(dir)) - : false diff --git a/node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js b/node_modules/@npmcli/name-from-folder/lib/index.js similarity index 100% rename from node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder/lib/index.js rename to node_modules/@npmcli/name-from-folder/lib/index.js diff --git a/node_modules/@npmcli/name-from-folder/package.json b/node_modules/@npmcli/name-from-folder/package.json index 9569b4e66e90c..f0aa5b16dba1a 100644 --- a/node_modules/@npmcli/name-from-folder/package.json +++ b/node_modules/@npmcli/name-from-folder/package.json @@ -1,27 +1,43 @@ { "name": "@npmcli/name-from-folder", - "version": "1.0.1", + "version": "2.0.0", "files": [ - "index.js" + "bin/", + "lib/" ], + "main": "lib/index.js", "description": "Get the package name from a folder path", "repository": { "type": "git", - "url": "git+https://github.com/npm/name-from-folder" + "url": "https://github.com/npm/name-from-folder.git" }, - "author": "Isaac Z. Schlueter (https://izs.me)", + "author": "GitHub Inc.", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "tap": { - "check-coverage": true + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint" }, "devDependencies": { - "tap": "^14.10.7" + "@npmcli/eslint-config": "^4.0.1", + "@npmcli/template-oss": "4.11.0", + "tap": "^16.3.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.11.0" + }, + "tap": { + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] } } diff --git a/package-lock.json b/package-lock.json index 159c9effb5d34..658f5ce48685b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2177,15 +2177,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@npmcli/map-workspaces/node_modules/@npmcli/name-from-folder": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", - "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", - "inBundle": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/@npmcli/metavuln-calculator": { "version": "5.0.0", "license": "ISC", @@ -2204,8 +2195,13 @@ "link": true }, "node_modules/@npmcli/name-from-folder": { - "version": "1.0.1", - "license": "ISC" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", + "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", + "inBundle": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/@npmcli/node-gyp": { "version": "3.0.0", @@ -14387,7 +14383,7 @@ "@npmcli/installed-package-contents": "^2.0.0", "@npmcli/map-workspaces": "^3.0.1", "@npmcli/metavuln-calculator": "^5.0.0", - "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/name-from-folder": "^2.0.0", "@npmcli/node-gyp": "^3.0.0", "@npmcli/package-json": "^3.0.0", "@npmcli/query": "^3.0.0", diff --git a/package.json b/package.json index 7f296b0176f8d..f6d4193ba674b 100644 --- a/package.json +++ b/package.json @@ -250,7 +250,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.1", + "version": "4.11.3", "content": "./scripts/template-oss/root.js" }, "license": "Artistic-2.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 78425f2af5231..a10277a1d19f3 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -8,7 +8,7 @@ "@npmcli/installed-package-contents": "^2.0.0", "@npmcli/map-workspaces": "^3.0.1", "@npmcli/metavuln-calculator": "^5.0.0", - "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/name-from-folder": "^2.0.0", "@npmcli/node-gyp": "^3.0.0", "@npmcli/package-json": "^3.0.0", "@npmcli/query": "^3.0.0", From 24b2ec4e156f98ef80ed5ac8751d35a32ad1251a Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 15:18:19 -0800 Subject: [PATCH 033/868] deps: @npmcli/promise-spawn@6.0.2 --- node_modules/@npmcli/promise-spawn/lib/index.js | 2 +- node_modules/@npmcli/promise-spawn/package.json | 8 ++++---- package-lock.json | 9 +++++---- package.json | 2 +- smoke-tests/package.json | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/node_modules/@npmcli/promise-spawn/lib/index.js b/node_modules/@npmcli/promise-spawn/lib/index.js index 1d422045d558c..571ff6b9169c9 100644 --- a/node_modules/@npmcli/promise-spawn/lib/index.js +++ b/node_modules/@npmcli/promise-spawn/lib/index.js @@ -131,7 +131,7 @@ const open = (_args, opts = {}, extra = {}) => { let platform = process.platform // process.platform === 'linux' may actually indicate WSL, if that's the case // we want to treat things as win32 anyway so the host can open the argument - if (platform === 'linux' && os.release().includes('Microsoft')) { + if (platform === 'linux' && os.release().toLowerCase().includes('microsoft')) { platform = 'win32' } diff --git a/node_modules/@npmcli/promise-spawn/package.json b/node_modules/@npmcli/promise-spawn/package.json index c21e84fe83599..2080d9f5be9f0 100644 --- a/node_modules/@npmcli/promise-spawn/package.json +++ b/node_modules/@npmcli/promise-spawn/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/promise-spawn", - "version": "6.0.1", + "version": "6.0.2", "files": [ "bin/", "lib/" @@ -32,8 +32,8 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.8.0", - "minipass": "^3.1.1", + "@npmcli/template-oss": "4.11.0", + "minipass": "^4.0.0", "spawk": "^1.7.1", "tap": "^16.0.1" }, @@ -42,7 +42,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.8.0" + "version": "4.11.0" }, "dependencies": { "which": "^3.0.0" diff --git a/package-lock.json b/package-lock.json index 658f5ce48685b..9d56ac20b585a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,7 +162,7 @@ "@npmcli/fs": "^3.1.0", "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/promise-spawn": "^6.0.2", "@npmcli/template-oss": "4.11.3", "licensee": "^10.0.0", "nock": "^13.2.4", @@ -2223,9 +2223,10 @@ } }, "node_modules/@npmcli/promise-spawn": { - "version": "6.0.1", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "inBundle": true, - "license": "ISC", "dependencies": { "which": "^3.0.0" }, @@ -14361,7 +14362,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/promise-spawn": "^6.0.2", "@npmcli/template-oss": "4.11.3", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", diff --git a/package.json b/package.json index f6d4193ba674b..4d7717e38edd2 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "@npmcli/fs": "^3.1.0", "@npmcli/git": "^4.0.1", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/promise-spawn": "^6.0.2", "@npmcli/template-oss": "4.11.3", "licensee": "^10.0.0", "nock": "^13.2.4", diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 3505614b3b6da..37bf125f5be0c 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/promise-spawn": "^6.0.2", "@npmcli/template-oss": "4.11.3", "http-proxy": "^1.18.1", "just-extend": "^6.1.1", From 1820afe4b34909b8702da69032dde9d3ecdbb447 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 15:21:53 -0800 Subject: [PATCH 034/868] deps: cacache@17.0.4 --- node_modules/.gitignore | 3 + .../cacache/node_modules/fs-minipass/LICENSE | 15 + .../node_modules/fs-minipass/lib/index.js | 443 ++++++++++++++++++ .../node_modules/fs-minipass/package.json | 53 +++ node_modules/cacache/package.json | 8 +- package-lock.json | 24 +- package.json | 2 +- workspaces/arborist/package.json | 2 +- 8 files changed, 538 insertions(+), 12 deletions(-) create mode 100644 node_modules/cacache/node_modules/fs-minipass/LICENSE create mode 100644 node_modules/cacache/node_modules/fs-minipass/lib/index.js create mode 100644 node_modules/cacache/node_modules/fs-minipass/package.json diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 1a8e77b91f589..3de9a6f67f260 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -52,6 +52,9 @@ !/buffer !/builtins !/cacache +!/cacache/node_modules/ +/cacache/node_modules/* +!/cacache/node_modules/fs-minipass !/chalk !/chownr !/ci-info diff --git a/node_modules/cacache/node_modules/fs-minipass/LICENSE b/node_modules/cacache/node_modules/fs-minipass/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/cacache/node_modules/fs-minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/cacache/node_modules/fs-minipass/lib/index.js b/node_modules/cacache/node_modules/fs-minipass/lib/index.js new file mode 100644 index 0000000000000..f9d5082a4d642 --- /dev/null +++ b/node_modules/cacache/node_modules/fs-minipass/lib/index.js @@ -0,0 +1,443 @@ +'use strict' +const MiniPass = require('minipass') +const EE = require('events').EventEmitter +const fs = require('fs') + +const writev = fs.writev + +const _autoClose = Symbol('_autoClose') +const _close = Symbol('_close') +const _ended = Symbol('_ended') +const _fd = Symbol('_fd') +const _finished = Symbol('_finished') +const _flags = Symbol('_flags') +const _flush = Symbol('_flush') +const _handleChunk = Symbol('_handleChunk') +const _makeBuf = Symbol('_makeBuf') +const _mode = Symbol('_mode') +const _needDrain = Symbol('_needDrain') +const _onerror = Symbol('_onerror') +const _onopen = Symbol('_onopen') +const _onread = Symbol('_onread') +const _onwrite = Symbol('_onwrite') +const _open = Symbol('_open') +const _path = Symbol('_path') +const _pos = Symbol('_pos') +const _queue = Symbol('_queue') +const _read = Symbol('_read') +const _readSize = Symbol('_readSize') +const _reading = Symbol('_reading') +const _remain = Symbol('_remain') +const _size = Symbol('_size') +const _write = Symbol('_write') +const _writing = Symbol('_writing') +const _defaultFlag = Symbol('_defaultFlag') +const _errored = Symbol('_errored') + +class ReadStream extends MiniPass { + constructor (path, opt) { + opt = opt || {} + super(opt) + + this.readable = true + this.writable = false + + if (typeof path !== 'string') { + throw new TypeError('path must be a string') + } + + this[_errored] = false + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_path] = path + this[_readSize] = opt.readSize || 16 * 1024 * 1024 + this[_reading] = false + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity + this[_remain] = this[_size] + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + if (typeof this[_fd] === 'number') { + this[_read]() + } else { + this[_open]() + } + } + + get fd () { + return this[_fd] + } + + get path () { + return this[_path] + } + + write () { + throw new TypeError('this is a readable stream') + } + + end () { + throw new TypeError('this is a readable stream') + } + + [_open] () { + fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (er) { + this[_onerror](er) + } else { + this[_fd] = fd + this.emit('open', fd) + this[_read]() + } + } + + [_makeBuf] () { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])) + } + + [_read] () { + if (!this[_reading]) { + this[_reading] = true + const buf = this[_makeBuf]() + /* istanbul ignore if */ + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)) + } + fs.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => + this[_onread](er, br, b)) + } + } + + [_onread] (er, br, buf) { + this[_reading] = false + if (er) { + this[_onerror](er) + } else if (this[_handleChunk](br, buf)) { + this[_read]() + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } + + [_onerror] (er) { + this[_reading] = true + this[_close]() + this.emit('error', er) + } + + [_handleChunk] (br, buf) { + let ret = false + // no effect if infinite + this[_remain] -= br + if (br > 0) { + ret = super.write(br < buf.length ? buf.slice(0, br) : buf) + } + + if (br === 0 || this[_remain] <= 0) { + ret = false + this[_close]() + super.end() + } + + return ret + } + + emit (ev, data) { + switch (ev) { + case 'prefinish': + case 'finish': + break + + case 'drain': + if (typeof this[_fd] === 'number') { + this[_read]() + } + break + + case 'error': + if (this[_errored]) { + return + } + this[_errored] = true + return super.emit(ev, data) + + default: + return super.emit(ev, data) + } + } +} + +class ReadStreamSync extends ReadStream { + [_open] () { + let threw = true + try { + this[_onopen](null, fs.openSync(this[_path], 'r')) + threw = false + } finally { + if (threw) { + this[_close]() + } + } + } + + [_read] () { + let threw = true + try { + if (!this[_reading]) { + this[_reading] = true + do { + const buf = this[_makeBuf]() + /* istanbul ignore next */ + const br = buf.length === 0 ? 0 + : fs.readSync(this[_fd], buf, 0, buf.length, null) + if (!this[_handleChunk](br, buf)) { + break + } + } while (true) + this[_reading] = false + } + threw = false + } finally { + if (threw) { + this[_close]() + } + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } +} + +class WriteStream extends EE { + constructor (path, opt) { + opt = opt || {} + super(opt) + this.readable = false + this.writable = true + this[_errored] = false + this[_writing] = false + this[_ended] = false + this[_needDrain] = false + this[_queue] = [] + this[_path] = path + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode + this[_pos] = typeof opt.start === 'number' ? opt.start : null + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== null ? 'r+' : 'w' + this[_defaultFlag] = opt.flags === undefined + this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags + + if (this[_fd] === null) { + this[_open]() + } + } + + emit (ev, data) { + if (ev === 'error') { + if (this[_errored]) { + return + } + this[_errored] = true + } + return super.emit(ev, data) + } + + get fd () { + return this[_fd] + } + + get path () { + return this[_path] + } + + [_onerror] (er) { + this[_close]() + this[_writing] = true + this.emit('error', er) + } + + [_open] () { + fs.open(this[_path], this[_flags], this[_mode], + (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && er.code === 'ENOENT') { + this[_flags] = 'w' + this[_open]() + } else if (er) { + this[_onerror](er) + } else { + this[_fd] = fd + this.emit('open', fd) + if (!this[_writing]) { + this[_flush]() + } + } + } + + end (buf, enc) { + if (buf) { + this.write(buf, enc) + } + + this[_ended] = true + + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && !this[_queue].length && + typeof this[_fd] === 'number') { + this[_onwrite](null, 0) + } + return this + } + + write (buf, enc) { + if (typeof buf === 'string') { + buf = Buffer.from(buf, enc) + } + + if (this[_ended]) { + this.emit('error', new Error('write() after end()')) + return false + } + + if (this[_fd] === null || this[_writing] || this[_queue].length) { + this[_queue].push(buf) + this[_needDrain] = true + return false + } + + this[_writing] = true + this[_write](buf) + return true + } + + [_write] (buf) { + fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => + this[_onwrite](er, bw)) + } + + [_onwrite] (er, bw) { + if (er) { + this[_onerror](er) + } else { + if (this[_pos] !== null) { + this[_pos] += bw + } + if (this[_queue].length) { + this[_flush]() + } else { + this[_writing] = false + + if (this[_ended] && !this[_finished]) { + this[_finished] = true + this[_close]() + this.emit('finish') + } else if (this[_needDrain]) { + this[_needDrain] = false + this.emit('drain') + } + } + } + } + + [_flush] () { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0) + } + } else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()) + } else { + const iovec = this[_queue] + this[_queue] = [] + writev(this[_fd], iovec, this[_pos], + (er, bw) => this[_onwrite](er, bw)) + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } +} + +class WriteStreamSync extends WriteStream { + [_open] () { + let fd + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } catch (er) { + if (er.code === 'ENOENT') { + this[_flags] = 'w' + return this[_open]() + } else { + throw er + } + } + } else { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } + + this[_onopen](null, fd) + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } + + [_write] (buf) { + // throw the original, but try to close if it fails + let threw = true + try { + this[_onwrite](null, + fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) + threw = false + } finally { + if (threw) { + try { + this[_close]() + } catch { + // ok error + } + } + } + } +} + +exports.ReadStream = ReadStream +exports.ReadStreamSync = ReadStreamSync + +exports.WriteStream = WriteStream +exports.WriteStreamSync = WriteStreamSync diff --git a/node_modules/cacache/node_modules/fs-minipass/package.json b/node_modules/cacache/node_modules/fs-minipass/package.json new file mode 100644 index 0000000000000..cba0d0cbc2dd8 --- /dev/null +++ b/node_modules/cacache/node_modules/fs-minipass/package.json @@ -0,0 +1,53 @@ +{ + "name": "fs-minipass", + "version": "3.0.1", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" + }, + "keywords": [], + "author": "GitHub Inc.", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-minipass.git" + }, + "bugs": { + "url": "https://github.com/npm/fs-minipass/issues" + }, + "homepage": "https://github.com/npm/fs-minipass#readme", + "description": "fs read and write streams based on minipass", + "dependencies": { + "minipass": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.1", + "@npmcli/template-oss": "4.11.3", + "mutate-fs": "^2.1.1", + "tap": "^16.3.2" + }, + "files": [ + "bin/", + "lib/" + ], + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.11.3" + } +} diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 6ab0d2a9dd8a3..189a19bf31597 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "17.0.3", + "version": "17.0.4", "cache-version": { "content": "2", "index": "5" @@ -46,7 +46,7 @@ "license": "ISC", "dependencies": { "@npmcli/fs": "^3.1.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "glob": "^8.0.1", "lru-cache": "^7.7.1", "minipass": "^4.0.0", @@ -61,7 +61,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.10.0", + "@npmcli/template-oss": "4.11.0", "tap": "^16.0.0" }, "engines": { @@ -70,7 +70,7 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "4.10.0" + "version": "4.11.0" }, "author": "GitHub Inc.", "tap": { diff --git a/package-lock.json b/package-lock.json index 9d56ac20b585a..11d78d934de9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -92,7 +92,7 @@ "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.0.3", + "cacache": "^17.0.4", "chalk": "^4.1.2", "ci-info": "^3.7.0", "cli-columns": "^4.0.0", @@ -3108,13 +3108,13 @@ } }, "node_modules/cacache": { - "version": "17.0.3", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.3.tgz", - "integrity": "sha512-pwsIK/grdM0cHpfVaNFxMdzElBtLJGsVPE+JnxqXP1l40O01Z1mfDE8MbRTuwomGq/UwEtGisOylutOEVJxEqg==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.0.4.tgz", + "integrity": "sha512-Z/nL3gU+zTUjz5pCA5vVjYM8pmaw2kxM7JEiE0fv3w77Wj+sFbi70CrBruUWH0uNcEdvLDixFpgA2JM4F4DBjA==", "inBundle": true, "dependencies": { "@npmcli/fs": "^3.1.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "glob": "^8.0.1", "lru-cache": "^7.7.1", "minipass": "^4.0.0", @@ -3131,6 +3131,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/cacache/node_modules/fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", + "inBundle": true, + "dependencies": { + "minipass": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -14390,7 +14402,7 @@ "@npmcli/query": "^3.0.0", "@npmcli/run-script": "^6.0.0", "bin-links": "^4.0.1", - "cacache": "^17.0.3", + "cacache": "^17.0.4", "common-ancestor-path": "^1.0.1", "hosted-git-info": "^6.1.1", "json-parse-even-better-errors": "^3.0.0", diff --git a/package.json b/package.json index 4d7717e38edd2..1953dab2d1dbf 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@npmcli/run-script": "^6.0.0", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^17.0.3", + "cacache": "^17.0.4", "chalk": "^4.1.2", "ci-info": "^3.7.0", "cli-columns": "^4.0.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index a10277a1d19f3..72ba4af4262ef 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -14,7 +14,7 @@ "@npmcli/query": "^3.0.0", "@npmcli/run-script": "^6.0.0", "bin-links": "^4.0.1", - "cacache": "^17.0.3", + "cacache": "^17.0.4", "common-ancestor-path": "^1.0.1", "hosted-git-info": "^6.1.1", "json-parse-even-better-errors": "^3.0.0", From 6e4a64976dc9a359b97413cd725e93caa1f0fc28 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 15:30:13 -0800 Subject: [PATCH 035/868] deps: pacote@15.0.8 --- mock-registry/package.json | 2 +- node_modules/.gitignore | 3 + .../pacote/node_modules/fs-minipass/LICENSE | 15 + .../node_modules/fs-minipass/lib/index.js | 443 ++++++++++++++++++ .../node_modules/fs-minipass/package.json | 53 +++ node_modules/pacote/package.json | 8 +- package-lock.json | 32 +- package.json | 2 +- workspaces/arborist/package.json | 2 +- workspaces/libnpmdiff/package.json | 2 +- workspaces/libnpmexec/package.json | 2 +- workspaces/libnpmpack/package.json | 2 +- 12 files changed, 546 insertions(+), 20 deletions(-) create mode 100644 node_modules/pacote/node_modules/fs-minipass/LICENSE create mode 100644 node_modules/pacote/node_modules/fs-minipass/lib/index.js create mode 100644 node_modules/pacote/node_modules/fs-minipass/package.json diff --git a/mock-registry/package.json b/mock-registry/package.json index d381765da5c1c..9d5dce996185b 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -49,7 +49,7 @@ "@npmcli/template-oss": "4.11.3", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "tap": "^16.3.2" } } diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 3de9a6f67f260..76e9c118ffaa2 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -214,6 +214,9 @@ !/once !/p-map !/pacote +!/pacote/node_modules/ +/pacote/node_modules/* +!/pacote/node_modules/fs-minipass !/parse-conflict-json !/path-is-absolute !/postcss-selector-parser diff --git a/node_modules/pacote/node_modules/fs-minipass/LICENSE b/node_modules/pacote/node_modules/fs-minipass/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/pacote/node_modules/fs-minipass/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/pacote/node_modules/fs-minipass/lib/index.js b/node_modules/pacote/node_modules/fs-minipass/lib/index.js new file mode 100644 index 0000000000000..f9d5082a4d642 --- /dev/null +++ b/node_modules/pacote/node_modules/fs-minipass/lib/index.js @@ -0,0 +1,443 @@ +'use strict' +const MiniPass = require('minipass') +const EE = require('events').EventEmitter +const fs = require('fs') + +const writev = fs.writev + +const _autoClose = Symbol('_autoClose') +const _close = Symbol('_close') +const _ended = Symbol('_ended') +const _fd = Symbol('_fd') +const _finished = Symbol('_finished') +const _flags = Symbol('_flags') +const _flush = Symbol('_flush') +const _handleChunk = Symbol('_handleChunk') +const _makeBuf = Symbol('_makeBuf') +const _mode = Symbol('_mode') +const _needDrain = Symbol('_needDrain') +const _onerror = Symbol('_onerror') +const _onopen = Symbol('_onopen') +const _onread = Symbol('_onread') +const _onwrite = Symbol('_onwrite') +const _open = Symbol('_open') +const _path = Symbol('_path') +const _pos = Symbol('_pos') +const _queue = Symbol('_queue') +const _read = Symbol('_read') +const _readSize = Symbol('_readSize') +const _reading = Symbol('_reading') +const _remain = Symbol('_remain') +const _size = Symbol('_size') +const _write = Symbol('_write') +const _writing = Symbol('_writing') +const _defaultFlag = Symbol('_defaultFlag') +const _errored = Symbol('_errored') + +class ReadStream extends MiniPass { + constructor (path, opt) { + opt = opt || {} + super(opt) + + this.readable = true + this.writable = false + + if (typeof path !== 'string') { + throw new TypeError('path must be a string') + } + + this[_errored] = false + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_path] = path + this[_readSize] = opt.readSize || 16 * 1024 * 1024 + this[_reading] = false + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity + this[_remain] = this[_size] + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + if (typeof this[_fd] === 'number') { + this[_read]() + } else { + this[_open]() + } + } + + get fd () { + return this[_fd] + } + + get path () { + return this[_path] + } + + write () { + throw new TypeError('this is a readable stream') + } + + end () { + throw new TypeError('this is a readable stream') + } + + [_open] () { + fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (er) { + this[_onerror](er) + } else { + this[_fd] = fd + this.emit('open', fd) + this[_read]() + } + } + + [_makeBuf] () { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])) + } + + [_read] () { + if (!this[_reading]) { + this[_reading] = true + const buf = this[_makeBuf]() + /* istanbul ignore if */ + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)) + } + fs.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => + this[_onread](er, br, b)) + } + } + + [_onread] (er, br, buf) { + this[_reading] = false + if (er) { + this[_onerror](er) + } else if (this[_handleChunk](br, buf)) { + this[_read]() + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } + + [_onerror] (er) { + this[_reading] = true + this[_close]() + this.emit('error', er) + } + + [_handleChunk] (br, buf) { + let ret = false + // no effect if infinite + this[_remain] -= br + if (br > 0) { + ret = super.write(br < buf.length ? buf.slice(0, br) : buf) + } + + if (br === 0 || this[_remain] <= 0) { + ret = false + this[_close]() + super.end() + } + + return ret + } + + emit (ev, data) { + switch (ev) { + case 'prefinish': + case 'finish': + break + + case 'drain': + if (typeof this[_fd] === 'number') { + this[_read]() + } + break + + case 'error': + if (this[_errored]) { + return + } + this[_errored] = true + return super.emit(ev, data) + + default: + return super.emit(ev, data) + } + } +} + +class ReadStreamSync extends ReadStream { + [_open] () { + let threw = true + try { + this[_onopen](null, fs.openSync(this[_path], 'r')) + threw = false + } finally { + if (threw) { + this[_close]() + } + } + } + + [_read] () { + let threw = true + try { + if (!this[_reading]) { + this[_reading] = true + do { + const buf = this[_makeBuf]() + /* istanbul ignore next */ + const br = buf.length === 0 ? 0 + : fs.readSync(this[_fd], buf, 0, buf.length, null) + if (!this[_handleChunk](br, buf)) { + break + } + } while (true) + this[_reading] = false + } + threw = false + } finally { + if (threw) { + this[_close]() + } + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } +} + +class WriteStream extends EE { + constructor (path, opt) { + opt = opt || {} + super(opt) + this.readable = false + this.writable = true + this[_errored] = false + this[_writing] = false + this[_ended] = false + this[_needDrain] = false + this[_queue] = [] + this[_path] = path + this[_fd] = typeof opt.fd === 'number' ? opt.fd : null + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode + this[_pos] = typeof opt.start === 'number' ? opt.start : null + this[_autoClose] = typeof opt.autoClose === 'boolean' ? + opt.autoClose : true + + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== null ? 'r+' : 'w' + this[_defaultFlag] = opt.flags === undefined + this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags + + if (this[_fd] === null) { + this[_open]() + } + } + + emit (ev, data) { + if (ev === 'error') { + if (this[_errored]) { + return + } + this[_errored] = true + } + return super.emit(ev, data) + } + + get fd () { + return this[_fd] + } + + get path () { + return this[_path] + } + + [_onerror] (er) { + this[_close]() + this[_writing] = true + this.emit('error', er) + } + + [_open] () { + fs.open(this[_path], this[_flags], this[_mode], + (er, fd) => this[_onopen](er, fd)) + } + + [_onopen] (er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && er.code === 'ENOENT') { + this[_flags] = 'w' + this[_open]() + } else if (er) { + this[_onerror](er) + } else { + this[_fd] = fd + this.emit('open', fd) + if (!this[_writing]) { + this[_flush]() + } + } + } + + end (buf, enc) { + if (buf) { + this.write(buf, enc) + } + + this[_ended] = true + + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && !this[_queue].length && + typeof this[_fd] === 'number') { + this[_onwrite](null, 0) + } + return this + } + + write (buf, enc) { + if (typeof buf === 'string') { + buf = Buffer.from(buf, enc) + } + + if (this[_ended]) { + this.emit('error', new Error('write() after end()')) + return false + } + + if (this[_fd] === null || this[_writing] || this[_queue].length) { + this[_queue].push(buf) + this[_needDrain] = true + return false + } + + this[_writing] = true + this[_write](buf) + return true + } + + [_write] (buf) { + fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => + this[_onwrite](er, bw)) + } + + [_onwrite] (er, bw) { + if (er) { + this[_onerror](er) + } else { + if (this[_pos] !== null) { + this[_pos] += bw + } + if (this[_queue].length) { + this[_flush]() + } else { + this[_writing] = false + + if (this[_ended] && !this[_finished]) { + this[_finished] = true + this[_close]() + this.emit('finish') + } else if (this[_needDrain]) { + this[_needDrain] = false + this.emit('drain') + } + } + } + } + + [_flush] () { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0) + } + } else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()) + } else { + const iovec = this[_queue] + this[_queue] = [] + writev(this[_fd], iovec, this[_pos], + (er, bw) => this[_onwrite](er, bw)) + } + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) + } + } +} + +class WriteStreamSync extends WriteStream { + [_open] () { + let fd + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } catch (er) { + if (er.code === 'ENOENT') { + this[_flags] = 'w' + return this[_open]() + } else { + throw er + } + } + } else { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } + + this[_onopen](null, fd) + } + + [_close] () { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd] + this[_fd] = null + fs.closeSync(fd) + this.emit('close') + } + } + + [_write] (buf) { + // throw the original, but try to close if it fails + let threw = true + try { + this[_onwrite](null, + fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) + threw = false + } finally { + if (threw) { + try { + this[_close]() + } catch { + // ok error + } + } + } + } +} + +exports.ReadStream = ReadStream +exports.ReadStreamSync = ReadStreamSync + +exports.WriteStream = WriteStream +exports.WriteStreamSync = WriteStreamSync diff --git a/node_modules/pacote/node_modules/fs-minipass/package.json b/node_modules/pacote/node_modules/fs-minipass/package.json new file mode 100644 index 0000000000000..cba0d0cbc2dd8 --- /dev/null +++ b/node_modules/pacote/node_modules/fs-minipass/package.json @@ -0,0 +1,53 @@ +{ + "name": "fs-minipass", + "version": "3.0.1", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" + }, + "keywords": [], + "author": "GitHub Inc.", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-minipass.git" + }, + "bugs": { + "url": "https://github.com/npm/fs-minipass/issues" + }, + "homepage": "https://github.com/npm/fs-minipass#readme", + "description": "fs read and write streams based on minipass", + "dependencies": { + "minipass": "^4.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.1", + "@npmcli/template-oss": "4.11.3", + "mutate-fs": "^2.1.1", + "tap": "^16.3.2" + }, + "files": [ + "bin/", + "lib/" + ], + "tap": { + "check-coverage": true, + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.11.3" + } +} diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 7767513409985..ae4e871690eaa 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "15.0.7", + "version": "15.0.8", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { @@ -27,7 +27,7 @@ "devDependencies": { "@npmcli/arborist": "^6.0.0 || ^6.0.0-pre.0", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.10.0", + "@npmcli/template-oss": "4.11.0", "hosted-git-info": "^6.0.0", "mutate-fs": "^2.1.1", "nock": "^13.2.4", @@ -49,7 +49,7 @@ "@npmcli/promise-spawn": "^6.0.1", "@npmcli/run-script": "^6.0.0", "cacache": "^17.0.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "minipass": "^4.0.0", "npm-package-arg": "^10.0.0", "npm-packlist": "^7.0.0", @@ -71,7 +71,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.10.0", + "version": "4.11.0", "windowsCI": false } } diff --git a/package-lock.json b/package-lock.json index 11d78d934de9f..97bd0ef824ba7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,7 +135,7 @@ "npm-user-validate": "^1.0.1", "npmlog": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", @@ -212,7 +212,7 @@ "@npmcli/template-oss": "4.11.3", "nock": "^13.2.9", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "tap": "^16.3.2" }, "engines": { @@ -9478,9 +9478,9 @@ } }, "node_modules/pacote": { - "version": "15.0.7", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.7.tgz", - "integrity": "sha512-OFf4dl3SM1PpsZvi1zk4vvMA0EplnyO0Ajbrtoyx6E3dXOWBoPnMapnLgQdInEfqPkNT8mrd2bY6c5t8JZ69sQ==", + "version": "15.0.8", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.0.8.tgz", + "integrity": "sha512-UlcumB/XS6xyyIMwg/WwMAyUmga+RivB5KgkRwA1hZNtrx+0Bt41KxHCvg1kr0pZ/ZeD8qjhW4fph6VaYRCbLw==", "inBundle": true, "dependencies": { "@npmcli/git": "^4.0.0", @@ -9488,7 +9488,7 @@ "@npmcli/promise-spawn": "^6.0.1", "@npmcli/run-script": "^6.0.0", "cacache": "^17.0.0", - "fs-minipass": "^2.1.0", + "fs-minipass": "^3.0.0", "minipass": "^4.0.0", "npm-package-arg": "^10.0.0", "npm-packlist": "^7.0.0", @@ -9508,6 +9508,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/pacote/node_modules/fs-minipass": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.1.tgz", + "integrity": "sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==", + "inBundle": true, + "dependencies": { + "minipass": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -14414,7 +14426,7 @@ "npm-pick-manifest": "^8.0.1", "npm-registry-fetch": "^14.0.3", "npmlog": "^7.0.1", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", @@ -14494,7 +14506,7 @@ "diff": "^5.1.0", "minimatch": "^5.1.1", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "tar": "^6.1.13" }, "devDependencies": { @@ -14516,7 +14528,7 @@ "ci-info": "^3.7.0", "npm-package-arg": "^10.1.0", "npmlog": "^7.0.1", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "proc-log": "^3.0.0", "read": "^1.0.7", "read-package-json-fast": "^3.0.1", @@ -14595,7 +14607,7 @@ "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7" + "pacote": "^15.0.8" }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", diff --git a/package.json b/package.json index 1953dab2d1dbf..bca9126fc6468 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "npm-user-validate": "^1.0.1", "npmlog": "^7.0.1", "p-map": "^4.0.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 72ba4af4262ef..b6a040213be42 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -26,7 +26,7 @@ "npm-pick-manifest": "^8.0.1", "npm-registry-fetch": "^14.0.3", "npmlog": "^7.0.1", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 5c8202998c326..79d15b405c51e 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -54,7 +54,7 @@ "diff": "^5.1.0", "minimatch": "^5.1.1", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "tar": "^6.1.13" }, "templateOSS": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index c6ed4c7337d1b..a488c2488ae0c 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -67,7 +67,7 @@ "ci-info": "^3.7.0", "npm-package-arg": "^10.1.0", "npmlog": "^7.0.1", - "pacote": "^15.0.7", + "pacote": "^15.0.8", "proc-log": "^3.0.0", "read": "^1.0.7", "read-package-json-fast": "^3.0.1", diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 63c683dbd1726..ed3165d2e6848 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -39,7 +39,7 @@ "@npmcli/arborist": "^6.2.0", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", - "pacote": "^15.0.7" + "pacote": "^15.0.8" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" From 721fe3fac383d714aa7fd7285b4392619903b1e7 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 1 Feb 2023 15:34:05 -0800 Subject: [PATCH 036/868] deps: read-package-json-fast@3.0.2 --- node_modules/read-package-json-fast/lib/index.js | 10 ++-------- node_modules/read-package-json-fast/package.json | 6 +++--- package-lock.json | 13 +++++++------ package.json | 2 +- workspaces/arborist/package.json | 2 +- workspaces/config/package.json | 2 +- workspaces/libnpmexec/package.json | 2 +- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/node_modules/read-package-json-fast/lib/index.js b/node_modules/read-package-json-fast/lib/index.js index c5c896ffec004..beb089db8d53e 100644 --- a/node_modules/read-package-json-fast/lib/index.js +++ b/node_modules/read-package-json-fast/lib/index.js @@ -1,10 +1,6 @@ -const { promisify } = require('util') -const fs = require('fs') -const readFile = promisify(fs.readFile) -const lstat = promisify(fs.lstat) -const readdir = promisify(fs.readdir) +const { readFile, lstat, readdir } = require('fs/promises') const parse = require('json-parse-even-better-errors') - +const normalizePackageBin = require('npm-normalize-package-bin') const { resolve, dirname, join, relative } = require('path') const rpj = path => readFile(path, 'utf8') @@ -14,8 +10,6 @@ const rpj = path => readFile(path, 'utf8') throw er }) -const normalizePackageBin = require('npm-normalize-package-bin') - // load the directories.bin folder as a 'bin' object const readBinDir = async (path, data) => { if (data.bin) { diff --git a/node_modules/read-package-json-fast/package.json b/node_modules/read-package-json-fast/package.json index 7baa36cfbeb9e..4964bb0a934cb 100644 --- a/node_modules/read-package-json-fast/package.json +++ b/node_modules/read-package-json-fast/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json-fast", - "version": "3.0.1", + "version": "3.0.2", "description": "Like read-package-json, but faster", "main": "lib/index.js", "author": "GitHub Inc.", @@ -19,7 +19,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.5.1", + "@npmcli/template-oss": "4.11.0", "tap": "^16.3.0" }, "dependencies": { @@ -36,7 +36,7 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.5.1" + "version": "4.11.0" }, "tap": { "nyc-arg": [ diff --git a/package-lock.json b/package-lock.json index 97bd0ef824ba7..573ba5b9bec74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -141,7 +141,7 @@ "qrcode-terminal": "^0.12.0", "read": "~1.0.7", "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.8", "ssri": "^10.0.1", "tar": "^6.1.13", @@ -9963,9 +9963,10 @@ } }, "node_modules/read-package-json-fast": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "inBundle": true, - "license": "ISC", "dependencies": { "json-parse-even-better-errors": "^3.0.0", "npm-normalize-package-bin": "^3.0.0" @@ -14431,7 +14432,7 @@ "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "ssri": "^10.0.1", "treeverse": "^3.0.0", @@ -14464,7 +14465,7 @@ "ini": "^3.0.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", - "read-package-json-fast": "^3.0.0", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.5", "walk-up-path": "^1.0.0" }, @@ -14531,7 +14532,7 @@ "pacote": "^15.0.8", "proc-log": "^3.0.0", "read": "^1.0.7", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "walk-up-path": "^1.0.0" }, diff --git a/package.json b/package.json index bca9126fc6468..19e5e3b4ae37d 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "qrcode-terminal": "^0.12.0", "read": "~1.0.7", "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.8", "ssri": "^10.0.1", "tar": "^6.1.13", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index b6a040213be42..f5a6e184d371d 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -31,7 +31,7 @@ "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", "promise-call-limit": "^1.0.1", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "ssri": "^10.0.1", "treeverse": "^3.0.0", diff --git a/workspaces/config/package.json b/workspaces/config/package.json index dec63b58c9888..0defa2420dac1 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -41,7 +41,7 @@ "ini": "^3.0.0", "nopt": "^7.0.0", "proc-log": "^3.0.0", - "read-package-json-fast": "^3.0.0", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.5", "walk-up-path": "^1.0.0" }, diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index a488c2488ae0c..de56343150157 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -70,7 +70,7 @@ "pacote": "^15.0.8", "proc-log": "^3.0.0", "read": "^1.0.7", - "read-package-json-fast": "^3.0.1", + "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "walk-up-path": "^1.0.0" }, From bdf079d3b65c41a4abbbf2ea176aa047bfb815d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 23:53:20 +0000 Subject: [PATCH 037/868] chore: release 9.4.1 --- .release-please-manifest.json | 28 ++++++------ CHANGELOG.md | 30 +++++++++++++ package-lock.json | 64 +++++++++++++-------------- package.json | 28 ++++++------ workspaces/arborist/CHANGELOG.md | 15 +++++++ workspaces/arborist/package.json | 2 +- workspaces/config/CHANGELOG.md | 12 +++++ workspaces/config/package.json | 2 +- workspaces/libnpmaccess/CHANGELOG.md | 7 +++ workspaces/libnpmaccess/package.json | 2 +- workspaces/libnpmdiff/CHANGELOG.md | 9 ++++ workspaces/libnpmdiff/package.json | 4 +- workspaces/libnpmexec/CHANGELOG.md | 9 ++++ workspaces/libnpmexec/package.json | 4 +- workspaces/libnpmfund/CHANGELOG.md | 8 ++++ workspaces/libnpmfund/package.json | 4 +- workspaces/libnpmhook/CHANGELOG.md | 7 +++ workspaces/libnpmhook/package.json | 2 +- workspaces/libnpmorg/CHANGELOG.md | 7 +++ workspaces/libnpmorg/package.json | 2 +- workspaces/libnpmpack/CHANGELOG.md | 9 ++++ workspaces/libnpmpack/package.json | 4 +- workspaces/libnpmpublish/CHANGELOG.md | 7 +++ workspaces/libnpmpublish/package.json | 2 +- workspaces/libnpmsearch/CHANGELOG.md | 7 +++ workspaces/libnpmsearch/package.json | 2 +- workspaces/libnpmteam/CHANGELOG.md | 7 +++ workspaces/libnpmteam/package.json | 2 +- workspaces/libnpmversion/CHANGELOG.md | 7 +++ workspaces/libnpmversion/package.json | 2 +- 30 files changed, 218 insertions(+), 77 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a8f1cdcf352d9..15bc5e65349e3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,16 +1,16 @@ { - ".": "9.4.0", - "workspaces/arborist": "6.2.0", - "workspaces/libnpmaccess": "7.0.1", - "workspaces/libnpmdiff": "5.0.8", - "workspaces/libnpmexec": "5.0.8", - "workspaces/libnpmfund": "4.0.8", - "workspaces/libnpmhook": "9.0.1", - "workspaces/libnpmorg": "5.0.1", - "workspaces/libnpmpack": "5.0.8", - "workspaces/libnpmpublish": "7.0.6", - "workspaces/libnpmsearch": "6.0.1", - "workspaces/libnpmteam": "5.0.1", - "workspaces/libnpmversion": "4.0.1", - "workspaces/config": "6.1.1" + ".": "9.4.1", + "workspaces/arborist": "6.2.1", + "workspaces/libnpmaccess": "7.0.2", + "workspaces/libnpmdiff": "5.0.9", + "workspaces/libnpmexec": "5.0.9", + "workspaces/libnpmfund": "4.0.9", + "workspaces/libnpmhook": "9.0.2", + "workspaces/libnpmorg": "5.0.2", + "workspaces/libnpmpack": "5.0.9", + "workspaces/libnpmpublish": "7.0.7", + "workspaces/libnpmsearch": "6.0.2", + "workspaces/libnpmteam": "5.0.2", + "workspaces/libnpmversion": "4.0.2", + "workspaces/config": "6.1.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f3bf26391bd..73649282ac7aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [9.4.1](https://github.com/npm/cli/compare/v9.4.0...v9.4.1) (2023-02-01) + +### Bug Fixes + +* [`1525a5e`](https://github.com/npm/cli/commit/1525a5e7fba4c996ac3bed5fdb75da275c537da8) [#6082](https://github.com/npm/cli/pull/6082) unpublish with scoped registry (@wraithgar) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8` +* [`1820afe`](https://github.com/npm/cli/commit/1820afe4b34909b8702da69032dde9d3ecdbb447) `cacache@17.0.4` +* [`24b2ec4`](https://github.com/npm/cli/commit/24b2ec4e156f98ef80ed5ac8751d35a32ad1251a) `@npmcli/promise-spawn@6.0.2` +* [`4b8046e`](https://github.com/npm/cli/commit/4b8046e680d5907d2df71d6d3775b66e0bea7ed2) `@npmcli/name-from-folder@2.0.0` +* [`1d4be7a`](https://github.com/npm/cli/commit/1d4be7a5457fd0081696e29f8382645873cf13d9) `@npmcli/map-workspaces@3.0.1` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` +* [`64b06ed`](https://github.com/npm/cli/commit/64b06ed21fc165e413b3e6f1ae5a236350e5bfaf) [#6115](https://github.com/npm/cli/pull/6115) `http-cache-semantics@4.1.1` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1` +* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.2): `@npmcli/config@6.1.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmaccess-v7.0.2): `libnpmaccess@7.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.9): `libnpmdiff@5.0.9` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.9): `libnpmexec@5.0.9` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.9): `libnpmfund@4.0.9` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmhook-v9.0.2): `libnpmhook@9.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmorg-v5.0.2): `libnpmorg@5.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.9): `libnpmpack@5.0.9` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpublish-v7.0.7): `libnpmpublish@7.0.7` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmsearch-v6.0.2): `libnpmsearch@6.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmteam-v5.0.2): `libnpmteam@5.0.2` +* [Workspace](https://github.com/npm/cli/releases/tag/libnpmversion-v4.0.2): `libnpmversion@4.0.2` + ## [9.4.0](https://github.com/npm/cli/compare/v9.3.1...v9.4.0) (2023-01-25) ### Features diff --git a/package-lock.json b/package-lock.json index 573ba5b9bec74..d27815d239b0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "9.4.0", + "version": "9.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "9.4.0", + "version": "9.4.1", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -85,8 +85,8 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.2.0", - "@npmcli/config": "^6.1.1", + "@npmcli/arborist": "^6.2.1", + "@npmcli/config": "^6.1.2", "@npmcli/map-workspaces": "^3.0.1", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", @@ -107,17 +107,17 @@ "init-package-json": "^4.0.1", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", - "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.8", - "libnpmexec": "^5.0.8", - "libnpmfund": "^4.0.8", - "libnpmhook": "^9.0.1", - "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.8", - "libnpmpublish": "^7.0.6", - "libnpmsearch": "^6.0.1", - "libnpmteam": "^5.0.1", - "libnpmversion": "^4.0.1", + "libnpmaccess": "^7.0.2", + "libnpmdiff": "^5.0.9", + "libnpmexec": "^5.0.9", + "libnpmfund": "^4.0.9", + "libnpmhook": "^9.0.2", + "libnpmorg": "^5.0.2", + "libnpmpack": "^5.0.9", + "libnpmpublish": "^7.0.7", + "libnpmsearch": "^6.0.2", + "libnpmteam": "^5.0.2", + "libnpmversion": "^4.0.2", "make-fetch-happen": "^11.0.2", "minimatch": "^5.1.1", "minipass": "^4.0.0", @@ -14401,7 +14401,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "6.2.0", + "version": "6.2.1", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -14458,7 +14458,7 @@ }, "workspaces/config": { "name": "@npmcli/config", - "version": "6.1.1", + "version": "6.1.2", "license": "ISC", "dependencies": { "@npmcli/map-workspaces": "^3.0.1", @@ -14479,7 +14479,7 @@ } }, "workspaces/libnpmaccess": { - "version": "7.0.1", + "version": "7.0.2", "license": "ISC", "dependencies": { "npm-package-arg": "^10.1.0", @@ -14497,10 +14497,10 @@ } }, "workspaces/libnpmdiff": { - "version": "5.0.8", + "version": "5.0.9", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", @@ -14520,10 +14520,10 @@ } }, "workspaces/libnpmexec": { - "version": "5.0.8", + "version": "5.0.9", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", @@ -14552,10 +14552,10 @@ } }, "workspaces/libnpmfund": { - "version": "4.0.8", + "version": "4.0.9", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.2.0" + "@npmcli/arborist": "^6.2.1" }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", @@ -14567,7 +14567,7 @@ } }, "workspaces/libnpmhook": { - "version": "9.0.1", + "version": "9.0.2", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14584,7 +14584,7 @@ } }, "workspaces/libnpmorg": { - "version": "5.0.1", + "version": "5.0.2", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14602,10 +14602,10 @@ } }, "workspaces/libnpmpack": { - "version": "5.0.8", + "version": "5.0.9", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.8" @@ -14622,7 +14622,7 @@ } }, "workspaces/libnpmpublish": { - "version": "7.0.6", + "version": "7.0.7", "license": "ISC", "dependencies": { "normalize-package-data": "^5.0.0", @@ -14644,7 +14644,7 @@ } }, "workspaces/libnpmsearch": { - "version": "6.0.1", + "version": "6.0.2", "license": "ISC", "dependencies": { "npm-registry-fetch": "^14.0.3" @@ -14660,7 +14660,7 @@ } }, "workspaces/libnpmteam": { - "version": "5.0.1", + "version": "5.0.2", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14677,7 +14677,7 @@ } }, "workspaces/libnpmversion": { - "version": "4.0.1", + "version": "4.0.2", "license": "ISC", "dependencies": { "@npmcli/git": "^4.0.1", diff --git a/package.json b/package.json index 19e5e3b4ae37d..c696d36c600c0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "9.4.0", + "version": "9.4.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -53,8 +53,8 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^6.2.0", - "@npmcli/config": "^6.1.1", + "@npmcli/arborist": "^6.2.1", + "@npmcli/config": "^6.1.2", "@npmcli/map-workspaces": "^3.0.1", "@npmcli/package-json": "^3.0.0", "@npmcli/run-script": "^6.0.0", @@ -75,17 +75,17 @@ "init-package-json": "^4.0.1", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^3.0.0", - "libnpmaccess": "^7.0.1", - "libnpmdiff": "^5.0.8", - "libnpmexec": "^5.0.8", - "libnpmfund": "^4.0.8", - "libnpmhook": "^9.0.1", - "libnpmorg": "^5.0.1", - "libnpmpack": "^5.0.8", - "libnpmpublish": "^7.0.6", - "libnpmsearch": "^6.0.1", - "libnpmteam": "^5.0.1", - "libnpmversion": "^4.0.1", + "libnpmaccess": "^7.0.2", + "libnpmdiff": "^5.0.9", + "libnpmexec": "^5.0.9", + "libnpmfund": "^4.0.9", + "libnpmhook": "^9.0.2", + "libnpmorg": "^5.0.2", + "libnpmpack": "^5.0.9", + "libnpmpublish": "^7.0.7", + "libnpmsearch": "^6.0.2", + "libnpmteam": "^5.0.2", + "libnpmversion": "^4.0.2", "make-fetch-happen": "^11.0.2", "minimatch": "^5.1.1", "minipass": "^4.0.0", diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index 87937e6dd1670..4e134b1bdada9 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [6.2.1](https://github.com/npm/cli/compare/arborist-v6.2.0...arborist-v6.2.1) (2023-02-01) + +### Bug Fixes + +* [`72a7a59`](https://github.com/npm/cli/commit/72a7a5915e9d333d104d88bf73d7a555f9400e24) [#6095](https://github.com/npm/cli/pull/6095) only save package-lock when truly finished (@wraithgar) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8` +* [`1820afe`](https://github.com/npm/cli/commit/1820afe4b34909b8702da69032dde9d3ecdbb447) `cacache@17.0.4` +* [`4b8046e`](https://github.com/npm/cli/commit/4b8046e680d5907d2df71d6d3775b66e0bea7ed2) `@npmcli/name-from-folder@2.0.0` +* [`1d4be7a`](https://github.com/npm/cli/commit/1d4be7a5457fd0081696e29f8382645873cf13d9) `@npmcli/map-workspaces@3.0.1` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [6.2.0](https://github.com/npm/cli/compare/arborist-v6.1.6...arborist-v6.2.0) (2023-01-25) ### Features diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index f5a6e184d371d..b332a03cbc637 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "6.2.0", + "version": "6.2.1", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/workspaces/config/CHANGELOG.md b/workspaces/config/CHANGELOG.md index 1e67c20c3fe68..c439a9762838f 100644 --- a/workspaces/config/CHANGELOG.md +++ b/workspaces/config/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [6.1.2](https://github.com/npm/cli/compare/config-v6.1.1...config-v6.1.2) (2023-02-01) + +### Bug Fixes + +* [`328c3d8`](https://github.com/npm/cli/commit/328c3d8e7362eb08ae2aebabc47f8f3c2537a1d2) [#6093](https://github.com/npm/cli/pull/6093) repair config items using raw values when possible (@nlf) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`1d4be7a`](https://github.com/npm/cli/commit/1d4be7a5457fd0081696e29f8382645873cf13d9) `@npmcli/map-workspaces@3.0.1` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [6.1.1](https://github.com/npm/cli/compare/config-v6.1.0...config-v6.1.1) (2023-01-12) ### Bug Fixes diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 0defa2420dac1..f84e657e4aa00 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "6.1.1", + "version": "6.1.2", "files": [ "bin/", "lib/" diff --git a/workspaces/libnpmaccess/CHANGELOG.md b/workspaces/libnpmaccess/CHANGELOG.md index 4a4da5ac41a8e..4de553911b591 100644 --- a/workspaces/libnpmaccess/CHANGELOG.md +++ b/workspaces/libnpmaccess/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [7.0.2](https://github.com/npm/cli/compare/libnpmaccess-v7.0.1...libnpmaccess-v7.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [7.0.1](https://github.com/npm/cli/compare/libnpmaccess-v7.0.0...libnpmaccess-v7.0.1) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index e9f728b22997c..4d1f9b1c6d1d3 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -1,6 +1,6 @@ { "name": "libnpmaccess", - "version": "7.0.1", + "version": "7.0.2", "description": "programmatic library for `npm access` commands", "author": "GitHub Inc.", "license": "ISC", diff --git a/workspaces/libnpmdiff/CHANGELOG.md b/workspaces/libnpmdiff/CHANGELOG.md index 47b8f94334261..70ad839c28a23 100644 --- a/workspaces/libnpmdiff/CHANGELOG.md +++ b/workspaces/libnpmdiff/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [5.0.9](https://github.com/npm/cli/compare/libnpmdiff-v5.0.8...libnpmdiff-v5.0.9) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1` + ## [5.0.8](https://github.com/npm/cli/compare/libnpmdiff-v5.0.7...libnpmdiff-v5.0.8) (2023-01-25) ### Dependencies diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 79d15b405c51e..612a720205de6 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "5.0.8", + "version": "5.0.9", "description": "The registry diff", "repository": { "type": "git", @@ -47,7 +47,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.0", "binary-extensions": "^2.2.0", diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index bf6ff70afd410..c4de21bae1371 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [5.0.9](https://github.com/npm/cli/compare/libnpmexec-v5.0.8...libnpmexec-v5.0.9) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1` + ## [5.0.8](https://github.com/npm/cli/compare/libnpmexec-v5.0.7...libnpmexec-v5.0.8) (2023-01-25) ### Dependencies diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index de56343150157..16ab3f65b51d5 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "5.0.8", + "version": "5.0.9", "files": [ "bin/", "lib/" @@ -61,7 +61,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.0", diff --git a/workspaces/libnpmfund/CHANGELOG.md b/workspaces/libnpmfund/CHANGELOG.md index b32009bc518f1..d6b142fa2a4eb 100644 --- a/workspaces/libnpmfund/CHANGELOG.md +++ b/workspaces/libnpmfund/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [4.0.9](https://github.com/npm/cli/compare/libnpmfund-v4.0.8...libnpmfund-v4.0.9) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1` + ## [4.0.8](https://github.com/npm/cli/compare/libnpmfund-v4.0.7...libnpmfund-v4.0.8) (2023-01-25) ### Dependencies diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index b70bca44e11ce..db3e890363ae4 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "4.0.8", + "version": "4.0.9", "main": "lib/index.js", "files": [ "bin/", @@ -46,7 +46,7 @@ "tap": "^16.3.2" }, "dependencies": { - "@npmcli/arborist": "^6.2.0" + "@npmcli/arborist": "^6.2.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" diff --git a/workspaces/libnpmhook/CHANGELOG.md b/workspaces/libnpmhook/CHANGELOG.md index 580f1f601d156..4733dc30fad45 100644 --- a/workspaces/libnpmhook/CHANGELOG.md +++ b/workspaces/libnpmhook/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [9.0.2](https://github.com/npm/cli/compare/libnpmhook-v9.0.1...libnpmhook-v9.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [9.0.1](https://github.com/npm/cli/compare/libnpmhook-v9.0.0...libnpmhook-v9.0.1) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 7559f52aedabe..9d718a5d1c1e2 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -1,6 +1,6 @@ { "name": "libnpmhook", - "version": "9.0.1", + "version": "9.0.2", "description": "programmatic API for managing npm registry hooks", "main": "lib/index.js", "files": [ diff --git a/workspaces/libnpmorg/CHANGELOG.md b/workspaces/libnpmorg/CHANGELOG.md index 3994677e5e8cd..22ebbd07ccadb 100644 --- a/workspaces/libnpmorg/CHANGELOG.md +++ b/workspaces/libnpmorg/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [5.0.2](https://github.com/npm/cli/compare/libnpmorg-v5.0.1...libnpmorg-v5.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [5.0.1](https://github.com/npm/cli/compare/libnpmorg-v5.0.0...libnpmorg-v5.0.1) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 9a6fbddef77fe..38d5956ca6a28 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -1,6 +1,6 @@ { "name": "libnpmorg", - "version": "5.0.1", + "version": "5.0.2", "description": "Programmatic api for `npm org` commands", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/workspaces/libnpmpack/CHANGELOG.md b/workspaces/libnpmpack/CHANGELOG.md index 995e9962b5d32..f7cf4caad6831 100644 --- a/workspaces/libnpmpack/CHANGELOG.md +++ b/workspaces/libnpmpack/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [5.0.9](https://github.com/npm/cli/compare/libnpmpack-v5.0.8...libnpmpack-v5.0.9) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`6e4a649`](https://github.com/npm/cli/commit/6e4a64976dc9a359b97413cd725e93caa1f0fc28) `pacote@15.0.8` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` +* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.1): `@npmcli/arborist@6.2.1` + ## [5.0.8](https://github.com/npm/cli/compare/libnpmpack-v5.0.7...libnpmpack-v5.0.8) (2023-01-25) ### Dependencies diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index ed3165d2e6848..f39d81acad8dc 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "5.0.8", + "version": "5.0.9", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/arborist": "^6.2.0", + "@npmcli/arborist": "^6.2.1", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.8" diff --git a/workspaces/libnpmpublish/CHANGELOG.md b/workspaces/libnpmpublish/CHANGELOG.md index 4d0b6392fae47..1fa3b02d1e092 100644 --- a/workspaces/libnpmpublish/CHANGELOG.md +++ b/workspaces/libnpmpublish/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [7.0.7](https://github.com/npm/cli/compare/libnpmpublish-v7.0.6...libnpmpublish-v7.0.7) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [7.0.6](https://github.com/npm/cli/compare/libnpmpublish-v7.0.5...libnpmpublish-v7.0.6) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 5af8683854b66..9ba4d6e0a659b 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "7.0.6", + "version": "7.0.7", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/workspaces/libnpmsearch/CHANGELOG.md b/workspaces/libnpmsearch/CHANGELOG.md index 3bcc493208986..b4b4a3660080c 100644 --- a/workspaces/libnpmsearch/CHANGELOG.md +++ b/workspaces/libnpmsearch/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [6.0.2](https://github.com/npm/cli/compare/libnpmsearch-v6.0.1...libnpmsearch-v6.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [6.0.1](https://github.com/npm/cli/compare/libnpmsearch-v6.0.0...libnpmsearch-v6.0.1) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 5d11b783e396c..095cabeb40ebd 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "6.0.1", + "version": "6.0.2", "description": "Programmatic API for searching in npm and compatible registries.", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/workspaces/libnpmteam/CHANGELOG.md b/workspaces/libnpmteam/CHANGELOG.md index 9e7b92b148230..5a47517636ec5 100644 --- a/workspaces/libnpmteam/CHANGELOG.md +++ b/workspaces/libnpmteam/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [5.0.2](https://github.com/npm/cli/compare/libnpmteam-v5.0.1...libnpmteam-v5.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [5.0.1](https://github.com/npm/cli/compare/libnpmteam-v5.0.0...libnpmteam-v5.0.1) (2022-12-07) ### Dependencies diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 3cd79e409fedc..7533dbc301e3e 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -1,7 +1,7 @@ { "name": "libnpmteam", "description": "npm Team management APIs", - "version": "5.0.1", + "version": "5.0.2", "author": "GitHub Inc.", "license": "ISC", "main": "lib/index.js", diff --git a/workspaces/libnpmversion/CHANGELOG.md b/workspaces/libnpmversion/CHANGELOG.md index 2c13959b498b0..fe8b4ed22086f 100644 --- a/workspaces/libnpmversion/CHANGELOG.md +++ b/workspaces/libnpmversion/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.0.2](https://github.com/npm/cli/compare/libnpmversion-v4.0.1...libnpmversion-v4.0.2) (2023-02-01) + +### Dependencies + +* [`721fe3f`](https://github.com/npm/cli/commit/721fe3fac383d714aa7fd7285b4392619903b1e7) [#6118](https://github.com/npm/cli/pull/6118) `read-package-json-fast@3.0.2` +* [`a39556f`](https://github.com/npm/cli/commit/a39556f1cff4526dcbcb7b65cdd86a1ba092e13e) `@npmcli/template-oss@4.11.3` + ## [4.0.1](https://github.com/npm/cli/compare/libnpmversion-v4.0.0...libnpmversion-v4.0.1) (2022-11-02) ### Bug Fixes diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index f9159a25db8af..88ef389fced49 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "4.0.1", + "version": "4.0.2", "main": "lib/index.js", "files": [ "bin/", From 6ea2cd77c6ba92f213e4833c746f032ef9bfcc3d Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Mon, 6 Feb 2023 23:51:09 -0500 Subject: [PATCH 038/868] docs: update references to OTP to be accurate (#6134) --- docs/lib/content/commands/npm-access.md | 3 +-- docs/lib/content/commands/npm-dist-tag.md | 4 ++-- docs/lib/content/commands/npm-owner.md | 4 ++-- docs/lib/content/commands/npm-team.md | 3 ++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/lib/content/commands/npm-access.md b/docs/lib/content/commands/npm-access.md index 819fe9ad323bb..312546f05c88e 100644 --- a/docs/lib/content/commands/npm-access.md +++ b/docs/lib/content/commands/npm-access.md @@ -57,8 +57,7 @@ You must have privileges to set the access of a package: * You have been given read-write privileges for a package, either as a member of a team or directly as an owner. -If you have two-factor authentication enabled then you'll be prompted to -provide an otp token, or may use the `--otp=...` option to specify it on +If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on the command line. If your account is not paid, then attempts to publish scoped packages will diff --git a/docs/lib/content/commands/npm-dist-tag.md b/docs/lib/content/commands/npm-dist-tag.md index 34781ebe6777d..40484c63edad5 100644 --- a/docs/lib/content/commands/npm-dist-tag.md +++ b/docs/lib/content/commands/npm-dist-tag.md @@ -16,12 +16,12 @@ Add, remove, and enumerate distribution tags on a package: or the [`--tag` config](/using-npm/config#tag) if not specified. If you have two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with - `--otp `, or at the OTP prompt. + `--otp `, or go through a second factor flow based on your `authtype`. * 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 a one-time password on the command line with `--otp `, - or at the OTP prompt. + or go through a second factor flow based on your `authtype` * ls: Show all of the dist-tags for a package, defaulting to the package in the current prefix. This is the default action if none is specified. diff --git a/docs/lib/content/commands/npm-owner.md b/docs/lib/content/commands/npm-owner.md index a4c5762358111..9ff67b5784c59 100644 --- a/docs/lib/content/commands/npm-owner.md +++ b/docs/lib/content/commands/npm-owner.md @@ -24,8 +24,8 @@ or you can't. Future versions may contain more fine-grained access levels, but that is not implemented at this time. If you have two-factor authentication enabled with `auth-and-writes` (see -[`npm-profile`](/commands/npm-profile)) then you'll need to include an otp -on the command line when changing ownership with `--otp`. +[`npm-profile`](/commands/npm-profile)) then you'll need to go through a second factor +flow when changing ownership or include an otp on the command line with `--otp`. ### Configuration diff --git a/docs/lib/content/commands/npm-team.md b/docs/lib/content/commands/npm-team.md index 2672b466f75a1..435a56ca02727 100644 --- a/docs/lib/content/commands/npm-team.md +++ b/docs/lib/content/commands/npm-team.md @@ -20,7 +20,8 @@ as `@org:newteam` in these commands. If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp ]`. -If you don't include this then you will be prompted. +If you don't include this then you will be taken through a second factor flow based +on your `authtype`. * create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the From fc5332f4027f3019a855f12a66e29bca1b143364 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Mon, 6 Feb 2023 11:16:00 -0700 Subject: [PATCH 039/868] deps: read@2.0.0 --- lib/utils/read-user-info.js | 15 +- node_modules/.gitignore | 8 + .../node_modules/mute-stream/LICENSE | 15 ++ .../node_modules}/mute-stream/mute.js | 0 .../node_modules/mute-stream/package.json | 29 ++++ .../node_modules/read/LICENSE | 15 ++ .../node_modules/read/lib/read.js | 113 +++++++++++++ .../node_modules/read/package.json | 27 ++++ node_modules/mute-stream/lib/index.js | 142 ++++++++++++++++ node_modules/mute-stream/package.json | 45 ++++-- .../promzard/node_modules/mute-stream/LICENSE | 15 ++ .../promzard/node_modules/mute-stream/mute.js | 145 +++++++++++++++++ .../node_modules/mute-stream/package.json | 29 ++++ .../promzard/node_modules/read/LICENSE | 15 ++ .../promzard/node_modules/read/lib/read.js | 113 +++++++++++++ .../promzard/node_modules/read/package.json | 27 ++++ node_modules/read/lib/read.js | 151 +++++++----------- node_modules/read/package.json | 42 +++-- package-lock.json | 57 ++++++- package.json | 2 +- workspaces/libnpmexec/lib/index.js | 4 +- workspaces/libnpmexec/package.json | 2 +- 22 files changed, 879 insertions(+), 132 deletions(-) create mode 100644 node_modules/init-package-json/node_modules/mute-stream/LICENSE rename node_modules/{ => init-package-json/node_modules}/mute-stream/mute.js (100%) create mode 100644 node_modules/init-package-json/node_modules/mute-stream/package.json create mode 100644 node_modules/init-package-json/node_modules/read/LICENSE create mode 100644 node_modules/init-package-json/node_modules/read/lib/read.js create mode 100644 node_modules/init-package-json/node_modules/read/package.json create mode 100644 node_modules/mute-stream/lib/index.js create mode 100644 node_modules/promzard/node_modules/mute-stream/LICENSE create mode 100644 node_modules/promzard/node_modules/mute-stream/mute.js create mode 100644 node_modules/promzard/node_modules/mute-stream/package.json create mode 100644 node_modules/promzard/node_modules/read/LICENSE create mode 100644 node_modules/promzard/node_modules/read/lib/read.js create mode 100644 node_modules/promzard/node_modules/read/package.json diff --git a/lib/utils/read-user-info.js b/lib/utils/read-user-info.js index 26d5b36d55b58..1cac8ee6d2668 100644 --- a/lib/utils/read-user-info.js +++ b/lib/utils/read-user-info.js @@ -1,5 +1,4 @@ -const { promisify } = require('util') -const readAsync = promisify(require('read')) +const read = require('read') const userValidate = require('npm-user-validate') const log = require('./log-shim.js') @@ -17,9 +16,9 @@ const passwordPrompt = 'npm password: ' const usernamePrompt = 'npm username: ' const emailPrompt = 'email (this IS public): ' -function read (opts) { +function readWithProgress (opts) { log.clearProgress() - return readAsync(opts).finally(() => log.showProgress()) + return read(opts).finally(() => log.showProgress()) } function readOTP (msg = otpPrompt, otp, isRetry) { @@ -27,7 +26,7 @@ function readOTP (msg = otpPrompt, otp, isRetry) { return otp.replace(/\s+/g, '') } - return read({ prompt: msg, default: otp || '' }) + return readWithProgress({ prompt: msg, default: otp || '' }) .then((rOtp) => readOTP(msg, rOtp, true)) } @@ -36,7 +35,7 @@ function readPassword (msg = passwordPrompt, password, isRetry) { return password } - return read({ prompt: msg, silent: true, default: password || '' }) + return readWithProgress({ prompt: msg, silent: true, default: password || '' }) .then((rPassword) => readPassword(msg, rPassword, true)) } @@ -50,7 +49,7 @@ function readUsername (msg = usernamePrompt, username, isRetry) { } } - return read({ prompt: msg, default: username || '' }) + return readWithProgress({ prompt: msg, default: username || '' }) .then((rUsername) => readUsername(msg, rUsername, true)) } @@ -64,6 +63,6 @@ function readEmail (msg = emailPrompt, email, isRetry) { } } - return read({ prompt: msg, default: email || '' }) + return readWithProgress({ prompt: msg, default: email || '' }) .then((username) => readEmail(msg, username, true)) } diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 76e9c118ffaa2..6f37aae133b54 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -114,6 +114,10 @@ !/inherits !/ini !/init-package-json +!/init-package-json/node_modules/ +/init-package-json/node_modules/* +!/init-package-json/node_modules/mute-stream +!/init-package-json/node_modules/read !/ip-regex !/ip !/is-cidr @@ -227,6 +231,10 @@ !/promise-inflight !/promise-retry !/promzard +!/promzard/node_modules/ +/promzard/node_modules/* +!/promzard/node_modules/mute-stream +!/promzard/node_modules/read !/qrcode-terminal !/read-cmd-shim !/read-package-json-fast diff --git a/node_modules/init-package-json/node_modules/mute-stream/LICENSE b/node_modules/init-package-json/node_modules/mute-stream/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/init-package-json/node_modules/mute-stream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/mute-stream/mute.js b/node_modules/init-package-json/node_modules/mute-stream/mute.js similarity index 100% rename from node_modules/mute-stream/mute.js rename to node_modules/init-package-json/node_modules/mute-stream/mute.js diff --git a/node_modules/init-package-json/node_modules/mute-stream/package.json b/node_modules/init-package-json/node_modules/mute-stream/package.json new file mode 100644 index 0000000000000..56ebb363b9251 --- /dev/null +++ b/node_modules/init-package-json/node_modules/mute-stream/package.json @@ -0,0 +1,29 @@ +{ + "name": "mute-stream", + "version": "0.0.8", + "main": "mute.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "tap": "^12.1.1" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/mute-stream" + }, + "keywords": [ + "mute", + "stream", + "pipe" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "description": "Bytes go in, but they don't come out (when muted).", + "files": [ + "mute.js" + ] +} diff --git a/node_modules/init-package-json/node_modules/read/LICENSE b/node_modules/init-package-json/node_modules/read/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/init-package-json/node_modules/read/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/init-package-json/node_modules/read/lib/read.js b/node_modules/init-package-json/node_modules/read/lib/read.js new file mode 100644 index 0000000000000..a93d1b3b532c0 --- /dev/null +++ b/node_modules/init-package-json/node_modules/read/lib/read.js @@ -0,0 +1,113 @@ + +module.exports = read + +var readline = require('readline') +var Mute = require('mute-stream') + +function read (opts, cb) { + if (opts.num) { + throw new Error('read() no longer accepts a char number limit') + } + + if (typeof opts.default !== 'undefined' && + typeof opts.default !== 'string' && + typeof opts.default !== 'number') { + throw new Error('default value must be string or number') + } + + var input = opts.input || process.stdin + var output = opts.output || process.stdout + var prompt = (opts.prompt || '').trim() + ' ' + var silent = opts.silent + var editDef = false + var timeout = opts.timeout + + var def = opts.default || '' + if (def) { + if (silent) { + prompt += '(