From eac1bf26f28e9e8fc07e1350c3d7b14a94005ebf Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 1 Aug 2022 11:02:18 -0700 Subject: [PATCH 001/175] fix(ls): when filtering workspaces, make sure the edge has a to before checking if its a workspace (#5164) --- lib/commands/ls.js | 2 +- .../test/lib/commands/ls.js.test.cjs | 7 ++++ test/lib/commands/ls.js | 38 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib/commands/ls.js b/lib/commands/ls.js index d3932072b7d34..073ca0c6992e8 100644 --- a/lib/commands/ls.js +++ b/lib/commands/ls.js @@ -92,7 +92,7 @@ class LS extends ArboristWorkspaceCmd { } if (this.npm.flatOptions.includeWorkspaceRoot - && !edge.to.isWorkspace) { + && edge.to && !edge.to.isWorkspace) { return true } diff --git a/tap-snapshots/test/lib/commands/ls.js.test.cjs b/tap-snapshots/test/lib/commands/ls.js.test.cjs index a10d37ab92881..9b6749acfe3bb 100644 --- a/tap-snapshots/test/lib/commands/ls.js.test.cjs +++ b/tap-snapshots/test/lib/commands/ls.js.test.cjs @@ -678,6 +678,13 @@ dedupe-entries@1.0.0 {CWD}/tap-testdir-ls-ls-with-no-args-dedupe-entries-and-not ` +exports[`test/lib/commands/ls.js TAP ls workspace and missing optional dep > should omit missing optional dep 1`] = ` +root@ {CWD}/tap-testdir-ls-ls-workspace-and-missing-optional-dep ++-- baz@1.0.0 -> ./baz +\`-- foo@1.0.0 + +` + exports[`test/lib/commands/ls.js TAP show multiple invalid reasons > ls result 1`] = ` test-npm-ls@1.0.0 {cwd}/tap-testdir-ls-show-multiple-invalid-reasons +-- cat@1.0.0 invalid: "^2.0.0" from the root project diff --git a/test/lib/commands/ls.js b/test/lib/commands/ls.js index 412d5ce6532a0..f4cd4ef33d58e 100644 --- a/test/lib/commands/ls.js +++ b/test/lib/commands/ls.js @@ -178,6 +178,44 @@ t.test('ls', t => { ) }) + t.test('workspace and missing optional dep', async t => { + npm.prefix = npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'root', + dependencies: { + foo: '^1.0.0', + }, + optionalDependencies: { + bar: '^1.0.0', + }, + workspaces: ['./baz'], + }), + baz: { + 'package.json': JSON.stringify({ + name: 'baz', + version: '1.0.0', + }), + }, + node_modules: { + baz: t.fixture('symlink', '../baz'), + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + }), + }, + }, + }) + + npm.flatOptions.includeWorkspaceRoot = true + t.teardown(() => { + delete npm.flatOptions.includeWorkspaceRoot + }) + + await ls.execWorkspaces([], ['baz']) + t.matchSnapshot(redactCwd(result), 'should omit missing optional dep') + }) + t.test('extraneous deps', async t => { npm.prefix = t.testdir({ 'package.json': JSON.stringify({ From a6153cfd2b0764e69d103b33af6b42978b0403f4 Mon Sep 17 00:00:00 2001 From: Takuya N Date: Tue, 2 Aug 2022 03:11:12 +0900 Subject: [PATCH 002/175] docs: Use the full proper name of Travis CI (#5240) Use the full proper name of Travis CI Signed-off-by: Takuya Noguchi --- docs/content/commands/npm-ci.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/commands/npm-ci.md b/docs/content/commands/npm-ci.md index 30a03365ade81..3ecd7c6efb095 100644 --- a/docs/content/commands/npm-ci.md +++ b/docs/content/commands/npm-ci.md @@ -67,7 +67,7 @@ $ npm ci added 154 packages in 5s ``` -Configure Travis to build using `npm ci` instead of `npm install`: +Configure Travis CI to build using `npm ci` instead of `npm install`: ```bash # .travis.yml From 47cc95d9ffb37fc8ff62a1d5554eab16d303aa43 Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 1 Aug 2022 11:11:55 -0700 Subject: [PATCH 003/175] fix(arborist): use the sourceReference root rather than the node root for overrides (#5227) when we examine override references, if we look at only `this.from.root.package` the root could actually be a virtual one. in order to ensure we resolve references from the real root, we instead need to look at `this.from.sourceReference.root.package` to get the correct value. closes #4395 --- workspaces/arborist/lib/edge.js | 6 +- workspaces/arborist/test/edge.js | 141 +++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 1 deletion(-) diff --git a/workspaces/arborist/lib/edge.js b/workspaces/arborist/lib/edge.js index a04404f226563..5b248b9166208 100644 --- a/workspaces/arborist/lib/edge.js +++ b/workspaces/arborist/lib/edge.js @@ -169,7 +169,11 @@ class Edge { if (this.overrides && this.overrides.value && this.overrides.name === this.name) { if (this.overrides.value.startsWith('$')) { const ref = this.overrides.value.slice(1) - const pkg = this.from.root.package + // we may be a virtual root, if we are we want to resolve reference overrides + // from the real root, not the virtual one + const pkg = this.from.sourceReference + ? this.from.sourceReference.root.package + : this.from.root.package const overrideSpec = (pkg.devDependencies && pkg.devDependencies[ref]) || (pkg.optionalDependencies && pkg.optionalDependencies[ref]) || (pkg.dependencies && pkg.dependencies[ref]) || diff --git a/workspaces/arborist/test/edge.js b/workspaces/arborist/test/edge.js index 8bd12bbc1da91..9d1352351741e 100644 --- a/workspaces/arborist/test/edge.js +++ b/workspaces/arborist/test/edge.js @@ -809,6 +809,147 @@ t.same(bundledEdge.explain(), { from: bundleParent.explain(), }, 'bundled edge.explain as expected') +t.test('override references find the correct root', (t) => { + const overrides = new OverrideSet({ + overrides: { + foo: '$foo', + }, + }) + + const root = { + name: 'root', + packageName: 'root', + edgesOut: new Map(), + edgesIn: new Set(), + explain: () => 'root node explanation', + package: { + name: 'root', + version: '1.2.3', + dependencies: { + foo: '^1.0.0', + }, + overrides: { + foo: '$foo', + }, + }, + get version () { + return this.package.version + }, + isTop: true, + parent: null, + overrides, + resolve (n) { + return n === 'foo' ? foo : null + }, + addEdgeOut (edge) { + this.edgesOut.set(edge.name, edge) + }, + addEdgeIn (edge) { + this.edgesIn.add(edge) + }, + } + + const foo = { + name: 'foo', + packageName: 'foo', + edgesOut: new Map(), + edgesIn: new Set(), + explain: () => 'foo node explanation', + package: { + name: 'foo', + version: '1.2.3', + dependencies: {}, + }, + get version () { + return this.package.version + }, + parent: root, + root: root, + resolve (n) { + return n === 'bar' ? bar : this.parent.resolve(n) + }, + addEdgeOut (edge) { + this.edgesOut.set(edge.name, edge) + }, + addEdgeIn (edge) { + this.edgesIn.add(edge) + }, + } + foo.overrides = overrides.getNodeRule(foo) + + const bar = { + name: 'bar', + packageName: 'bar', + edgesOut: new Map(), + edgesIn: new Set(), + explain: () => 'bar node explanation', + package: { + name: 'bar', + version: '1.2.3', + dependencies: { + foo: '^2.0.0', + }, + }, + get version () { + return this.package.version + }, + parent: foo, + root: root, + resolve (n) { + return this.parent.resolve(n) + }, + addEdgeOut (edge) { + this.edgesOut.set(edge.name, edge) + }, + addEdgeIn (edge) { + this.edgesIn.add(edge) + }, + } + bar.overrides = foo.overrides.getNodeRule(bar) + + const virtualBar = { + name: 'bar', + packageName: 'bar', + edgesOut: new Map(), + edgesIn: new Set(), + explain: () => 'bar node explanation', + package: { + name: 'bar', + version: '1.2.3', + dependencies: { + foo: '^2.0.0', + }, + }, + parent: null, + root: null, + sourceReference: bar, + get version () { + return this.package.version + }, + resolve (n) { + return bar.resolve(n) + }, + addEdgeOut (edge) { + this.edgesOut.set(edge.name, edge) + }, + addEdgeIn (edge) { + this.edgesIn.add(edge) + }, + } + virtualBar.overrides = overrides + + const edge = new Edge({ + from: virtualBar, + type: 'prod', + spec: '^2.0.0', + name: 'foo', + overrides: overrides.getEdgeRule({ name: 'foo', spec: '^2.0.0' }), + }) + + t.ok(edge.valid, 'edge is valid') + t.end() +}) + t.test('shrinkwrapped and bundled deps are not overridden and remain valid', (t) => { const overrides = new OverrideSet({ overrides: { From 050284d2abb6aa91a0f9ffad5b0c4f074e5dbf6d Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 1 Aug 2022 11:20:50 -0700 Subject: [PATCH 004/175] fix(arborist): pass the edge to fromPath in order to determine correct path (#5233) by passing in the edge we can determine if the edge is overridden, and if it is the path we want to return is the project root since that's what user's will have define their overrides relative to --- .../arborist/lib/arborist/build-ideal-tree.js | 3 +- workspaces/arborist/lib/dep-valid.js | 2 +- workspaces/arborist/lib/from-path.js | 19 +- .../tap-snapshots/test/edge.js.test.cjs | 189 ++++++++++++++++++ workspaces/arborist/test/dep-valid.js | 53 ++--- workspaces/arborist/test/edge.js | 3 + workspaces/arborist/test/from-path.js | 29 ++- 7 files changed, 266 insertions(+), 32 deletions(-) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 0e98ed6fc533c..945bae56b63de 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -1076,9 +1076,8 @@ This is a one-time fix-up, please be patient... // if it fails at this point, though, dont' worry because it // may well be an optional dep that has gone missing. it'll // fail later anyway. - const from = fromPath(placed) promises.push(...this[_problemEdges](placed).map(e => - this[_fetchManifest](npa.resolve(e.name, e.spec, from)) + this[_fetchManifest](npa.resolve(e.name, e.spec, fromPath(placed, e))) .catch(er => null))) }, }) diff --git a/workspaces/arborist/lib/dep-valid.js b/workspaces/arborist/lib/dep-valid.js index c69ab557ae491..d02f397fcdf17 100644 --- a/workspaces/arborist/lib/dep-valid.js +++ b/workspaces/arborist/lib/dep-valid.js @@ -20,7 +20,7 @@ const depValid = (child, requested, requestor) => { // file: deps that depend on other files/dirs, we must resolve the // location based on the *requestor* file/dir, not where it ends up. // '' is equivalent to '*' - requested = npa.resolve(child.name, requested || '*', fromPath(requestor)) + requested = npa.resolve(child.name, requested || '*', fromPath(requestor, requestor.edgesOut.get(child.name))) } catch (er) { // Not invalid because the child doesn't match, but because // the spec itself is not supported. Nothing would match, diff --git a/workspaces/arborist/lib/from-path.js b/workspaces/arborist/lib/from-path.js index 2a3617844c001..1006f73af3d07 100644 --- a/workspaces/arborist/lib/from-path.js +++ b/workspaces/arborist/lib/from-path.js @@ -6,8 +6,19 @@ const { dirname } = require('path') const npa = require('npm-package-arg') -const fromPath = (node, spec) => - spec && spec.type === 'file' ? dirname(spec.fetchSpec) - : node.realpath +const fromPath = (node, spec, edge) => { + if (edge && edge.overrides && edge.overrides.name === edge.name && edge.overrides.value) { + // fromPath could be called with a node that has a virtual root, if that happens + // we want to make sure we get the real root node when overrides are in use. this + // is to allow things like overriding a dependency with a tarball file that's a + // relative path from the project root + return node.sourceReference + ? node.sourceReference.root.realpath + : node.root.realpath + } -module.exports = node => fromPath(node, node.resolved && npa(node.resolved)) + return spec && spec.type === 'file' ? dirname(spec.fetchSpec) + : node.realpath +} + +module.exports = (node, edge) => fromPath(node, node.resolved && npa(node.resolved), edge) diff --git a/workspaces/arborist/tap-snapshots/test/edge.js.test.cjs b/workspaces/arborist/tap-snapshots/test/edge.js.test.cjs index 6feae28b570d6..17dc0b0c9fb0b 100644 --- a/workspaces/arborist/tap-snapshots/test/edge.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/edge.js.test.cjs @@ -88,6 +88,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "invalid": false, @@ -188,6 +209,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "invalid": true, @@ -345,6 +387,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "resolve": Function resolve(n), @@ -414,6 +477,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "resolve": Function resolve(n), @@ -614,6 +698,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "resolve": Function resolve(n), @@ -697,6 +802,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "a" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "type": "peer", @@ -748,6 +874,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "invalid": false, @@ -814,6 +961,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "resolve": Function resolve(n), @@ -868,6 +1036,27 @@ Edge { "version": "1.2.3", }, "resolve": Function resolve(n), + "root": Object { + "addEdgeIn": Function addEdgeIn(edge), + "addEdgeOut": Function addEdgeOut(edge), + "edgesIn": Set {}, + "edgesOut": Map { + "missing" => Edge { + "peerConflicted": false, + }, + }, + "explain": Function explain(), + "isTop": true, + "name": "top", + "package": Object { + "name": "top", + "version": "1.2.3", + }, + "packageName": "top", + "parent": null, + "resolve": Function resolve(n), + "version": "1.2.3", + }, "version": "1.2.3", }, "invalid": false, diff --git a/workspaces/arborist/test/dep-valid.js b/workspaces/arborist/test/dep-valid.js index 901325b2390b9..8c0e761658873 100644 --- a/workspaces/arborist/test/dep-valid.js +++ b/workspaces/arborist/test/dep-valid.js @@ -4,7 +4,12 @@ const npa = require('npm-package-arg') const { normalizePaths } = require('./fixtures/utils.js') const { resolve } = require('path') -t.ok(depValid({}, '', null, {}), '* is always ok') +// dep-valid reads from requestor.edgesOut so we use this instead of {} in these tests +const emptyRequestor = { + edgesOut: new Map(), +} + +t.ok(depValid({}, '', null, emptyRequestor), '* is always ok') t.ok(depValid({ package: { @@ -13,7 +18,7 @@ t.ok(depValid({ get version () { return this.package.version }, -}, '1.x', null, {}), 'range that is satisfied') +}, '1.x', null, emptyRequestor), 'range that is satisfied') t.ok(depValid({ package: { @@ -22,21 +27,21 @@ t.ok(depValid({ get version () { return this.package.version }, -}, '1.x', '2.x', {}), 'range that is acceptable') +}, '1.x', '2.x', emptyRequestor), 'range that is acceptable') t.ok(depValid({ isLink: true, realpath: '/some/path', -}, normalizePaths(npa('file:/some/path')), null, {}), 'links must point at intended target') +}, normalizePaths(npa('file:/some/path')), null, emptyRequestor), 'links must point at intended target') t.notOk(depValid({ isLink: true, realpath: '/some/other/path', -}, 'file:/some/path', null, {}), 'links must point at intended target') +}, 'file:/some/path', null, emptyRequestor), 'links must point at intended target') t.notOk(depValid({ realpath: '/some/path', -}, 'file:/some/path', null, {}), 'file:// must be a link') +}, 'file:/some/path', null, emptyRequestor), 'file:// must be a link') t.ok(depValid({ name: 'foo', @@ -47,7 +52,7 @@ t.ok(depValid({ get version () { return this.package.version }, -}, 'git://host/repo#semver:1.x', null, {}), 'git url with semver range') +}, 'git://host/repo#semver:1.x', null, emptyRequestor), 'git url with semver range') t.ok(depValid({ name: 'foo', @@ -58,7 +63,7 @@ t.ok(depValid({ get version () { return this.package.version }, -}, 'npm:bar@1.2.3', null, {}), 'alias is ok') +}, 'npm:bar@1.2.3', null, emptyRequestor), 'alias is ok') t.ok(depValid({ resolved: 'https://registry/abbrev-1.1.1.tgz', @@ -66,7 +71,7 @@ t.ok(depValid({ get version () { return this.package.version }, -}, 'https://registry/abbrev-1.1.1.tgz', null, {}), 'remote url match') +}, 'https://registry/abbrev-1.1.1.tgz', null, emptyRequestor), 'remote url match') t.ok(depValid({ resolved: 'git+ssh://git@github.com/foo/bar', @@ -74,7 +79,7 @@ t.ok(depValid({ get version () { return this.package.version }, -}, 'git+ssh://git@github.com/foo/bar.git', null, {}), 'matching _from saveSpec') +}, 'git+ssh://git@github.com/foo/bar.git', null, emptyRequestor), 'matching _from saveSpec') t.notOk(depValid({ resolved: 'git+ssh://git@github.com/foo/bar', @@ -82,26 +87,26 @@ t.notOk(depValid({ get version () { return this.package.version }, -}, 'git+ssh://git@github.com/bar/foo.git', null, {}), 'different repo') +}, 'git+ssh://git@github.com/bar/foo.git', null, emptyRequestor), 'different repo') t.notOk(depValid({ package: {}, get version () { return this.package.version }, -}, 'git+ssh://git@github.com/bar/foo.git', null, {}), 'missing repo') +}, 'git+ssh://git@github.com/bar/foo.git', null, emptyRequestor), 'missing repo') t.ok(depValid({ resolved: `file:${resolve('/path/to/tarball.tgz')}`, -}, resolve('/path/to/tarball.tgz'), null, {}), 'same tarball') +}, resolve('/path/to/tarball.tgz'), null, emptyRequestor), 'same tarball') t.notOk(depValid({ resolved: 'file:/path/to/other/tarball.tgz', -}, '/path/to/tarball.tgz', null, {}), 'different tarball') +}, '/path/to/tarball.tgz', null, emptyRequestor), 'different tarball') t.notOk(depValid({ isLink: true, -}, '/path/to/tarball.tgz', null, {}), 'links are not tarballs') +}, '/path/to/tarball.tgz', null, emptyRequestor), 'links are not tarballs') t.ok(depValid({ package: { @@ -112,28 +117,28 @@ t.ok(depValid({ get version () { return this.package.version }, -}, './tarball.tgz', null, {}), 'probably the same-ish, hopefully') +}, './tarball.tgz', null, emptyRequestor), 'probably the same-ish, hopefully') t.notOk(depValid({ package: {}, get version () { return this.package.version }, -}, './tarball.tgz', null, {}), 'too uncertain, nope') +}, './tarball.tgz', null, emptyRequestor), 'too uncertain, nope') t.ok(depValid({ resolved: 'https://registry.npmjs.org/foo/foo-1.2.3.tgz', -}, 'latest', null, {}), 'tagged registry version needs remote tarball') +}, 'latest', null, emptyRequestor), 'tagged registry version needs remote tarball') t.notOk(depValid({ resolved: 'git+https://registry.npmjs.org/foo/foo-1.2.3.git', -}, 'latest', null, {}), 'tagged registry version needs remote tarball, not git') +}, 'latest', null, emptyRequestor), 'tagged registry version needs remote tarball, not git') -t.notOk(depValid({}, 'latest', null, {}), +t.notOk(depValid({}, 'latest', null, emptyRequestor), 'tagged registry version needs remote tarball resolution') t.test('unsupported dependency type', t => { - const requestor = { errors: [] } + const requestor = { errors: [], edgesOut: new Map() } const child = { name: 'kid' } const request = { type: 'not a type' } t.notOk(depValid(child, request, null, requestor)) @@ -148,7 +153,7 @@ t.test('unsupported dependency type', t => { }) t.test('invalid tag name', t => { - const requestor = { errors: [] } + const requestor = { errors: [], edgesOut: new Map() } const child = { name: 'kid' } const request = '!!@#$%!#@$!' t.notOk(depValid(child, request, null, requestor)) @@ -163,7 +168,7 @@ t.test('invalid tag name', t => { }) t.test('invalid request all together', t => { - const requestor = { errors: [] } + const requestor = { errors: [], edgesOut: new Map() } const child = { name: 'kid' } const request = null t.notOk(depValid(child, request, null, requestor)) @@ -178,7 +183,7 @@ t.test('invalid request all together', t => { }) t.test('installLinks makes Link nodes invalid', t => { - const requestor = { errors: [], installLinks: true } + const requestor = { errors: [], installLinks: true, edgesOut: new Map() } const child = { isLink: true, name: 'kid' } const request = { type: 'directory' } t.notOk(depValid(child, request, null, requestor)) diff --git a/workspaces/arborist/test/edge.js b/workspaces/arborist/test/edge.js index 9d1352351741e..f45cb87917702 100644 --- a/workspaces/arborist/test/edge.js +++ b/workspaces/arborist/test/edge.js @@ -71,6 +71,7 @@ const a = { }, isTop: false, parent: top, + root: top, resolve (n) { return n === 'aa' ? aa : this.parent.resolve(n) }, @@ -1008,6 +1009,7 @@ t.test('shrinkwrapped and bundled deps are not overridden and remain valid', (t) return this.package.version }, parent: root, + root, resolve (n) { return n === 'bar' ? bar : this.parent.resolve(n) }, @@ -1036,6 +1038,7 @@ t.test('shrinkwrapped and bundled deps are not overridden and remain valid', (t) return this.package.version }, parent: foo, + root, resolve (n) { return this.parent.resolve(n) }, diff --git a/workspaces/arborist/test/from-path.js b/workspaces/arborist/test/from-path.js index 5b5ea2084c498..3bfd0b6398a74 100644 --- a/workspaces/arborist/test/from-path.js +++ b/workspaces/arborist/test/from-path.js @@ -1,7 +1,7 @@ const t = require('tap') const { normalizePath } = require('./fixtures/utils.js') const fp = require('../lib/from-path.js') -const fromPath = obj => normalizePath(fp(obj)) +const fromPath = (node, edge) => normalizePath(fp(node, edge)) t.equal(fromPath({ realpath: '/some/path', @@ -21,3 +21,30 @@ t.equal(fromPath({ realpath: '/some/path/to/install/target', resolved: 'https://registry.com/package.tgz', }), '/some/path/to/install/target', 'use dirname if not dir or file type') + +t.equal(fromPath({ + root: { + realpath: '/some/root', + }, +}, { + name: 'foo', + overrides: { + name: 'foo', + value: 'foo@2', + }, +}), '/some/root', 'uses root realpath for overridden edges') + +t.equal(fromPath({ + sourceReference: { + root: { + realpath: '/some/root', + }, + }, + realpath: '/some/red/herring', +}, { + name: 'foo', + overrides: { + name: 'foo', + value: 'foo@2', + }, +}), '/some/root', 'uses sourceReferences root realpath for overridden edges') From 3c024ace60904c69e61da00e1fb56c0c1735804a Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 1 Aug 2022 14:29:56 -0400 Subject: [PATCH 005/175] feat: add npm query cmd (#5000) Co-authored-by: Gar --- docs/content/commands/npm-query.md | 236 ++++ .../content/using-npm/dependency-selectors.md | 168 +++ docs/nav.yml | 6 + lib/commands/query.js | 104 ++ lib/utils/cmd-list.js | 1 + node_modules/@npmcli/query/LICENSE | 20 + node_modules/@npmcli/query/lib/index.js | 187 +++ node_modules/@npmcli/query/package.json | 61 + node_modules/cssesc/LICENSE-MIT.txt | 20 + node_modules/cssesc/bin/cssesc | 116 ++ node_modules/cssesc/cssesc.js | 110 ++ node_modules/cssesc/man/cssesc.1 | 70 + node_modules/cssesc/package.json | 51 + node_modules/postcss-selector-parser/API.md | 873 ++++++++++++ .../postcss-selector-parser/LICENSE-MIT | 22 + .../postcss-selector-parser/dist/index.js | 24 + .../postcss-selector-parser/dist/parser.js | 1243 +++++++++++++++++ .../postcss-selector-parser/dist/processor.js | 206 +++ .../dist/selectors/attribute.js | 515 +++++++ .../dist/selectors/className.js | 69 + .../dist/selectors/combinator.js | 31 + .../dist/selectors/comment.js | 31 + .../dist/selectors/constructors.js | 102 ++ .../dist/selectors/container.js | 395 ++++++ .../dist/selectors/guards.js | 64 + .../dist/selectors/id.js | 37 + .../dist/selectors/index.js | 27 + .../dist/selectors/namespace.js | 101 ++ .../dist/selectors/nesting.js | 32 + .../dist/selectors/node.js | 239 ++++ .../dist/selectors/pseudo.js | 38 + .../dist/selectors/root.js | 60 + .../dist/selectors/selector.js | 31 + .../dist/selectors/string.js | 31 + .../dist/selectors/tag.js | 31 + .../dist/selectors/types.js | 28 + .../dist/selectors/universal.js | 32 + .../dist/sortAscending.js | 13 + .../dist/tokenTypes.js | 95 ++ .../postcss-selector-parser/dist/tokenize.js | 271 ++++ .../dist/util/ensureObject.js | 22 + .../dist/util/getProp.js | 24 + .../dist/util/index.js | 22 + .../dist/util/stripComments.js | 27 + .../dist/util/unesc.js | 93 ++ .../postcss-selector-parser/package.json | 78 ++ .../postcss-selector-parser.d.ts | 555 ++++++++ package-lock.json | 38 + .../tap-snapshots/test/index.js.test.cjs | 2 +- .../test/lib/commands/completion.js.test.cjs | 1 + .../test/lib/commands/query.js.test.cjs | 221 +++ .../test/lib/load-all-commands.js.test.cjs | 14 + tap-snapshots/test/lib/npm.js.test.cjs | 20 +- .../test/lib/utils/cmd-list.js.test.cjs | 6 + test/lib/commands/query.js | 199 +++ workspaces/arborist/lib/node.js | 8 + workspaces/arborist/lib/query-selector-all.js | 561 ++++++++ workspaces/arborist/package.json | 2 + workspaces/arborist/test/node.js | 12 +- .../arborist/test/query-selector-all.js | 704 ++++++++++ 60 files changed, 8391 insertions(+), 9 deletions(-) create mode 100644 docs/content/commands/npm-query.md create mode 100644 docs/content/using-npm/dependency-selectors.md create mode 100644 lib/commands/query.js create mode 100644 node_modules/@npmcli/query/LICENSE create mode 100644 node_modules/@npmcli/query/lib/index.js create mode 100644 node_modules/@npmcli/query/package.json create mode 100644 node_modules/cssesc/LICENSE-MIT.txt create mode 100755 node_modules/cssesc/bin/cssesc create mode 100644 node_modules/cssesc/cssesc.js create mode 100644 node_modules/cssesc/man/cssesc.1 create mode 100644 node_modules/cssesc/package.json create mode 100644 node_modules/postcss-selector-parser/API.md create mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT create mode 100644 node_modules/postcss-selector-parser/dist/index.js create mode 100644 node_modules/postcss-selector-parser/dist/parser.js create mode 100644 node_modules/postcss-selector-parser/dist/processor.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js create mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js create mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js create mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js create mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js create mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js create mode 100644 node_modules/postcss-selector-parser/dist/util/index.js create mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js create mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js create mode 100644 node_modules/postcss-selector-parser/package.json create mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts create mode 100644 tap-snapshots/test/lib/commands/query.js.test.cjs create mode 100644 test/lib/commands/query.js create mode 100644 workspaces/arborist/lib/query-selector-all.js create mode 100644 workspaces/arborist/test/query-selector-all.js diff --git a/docs/content/commands/npm-query.md b/docs/content/commands/npm-query.md new file mode 100644 index 0000000000000..424b9e7e45ae8 --- /dev/null +++ b/docs/content/commands/npm-query.md @@ -0,0 +1,236 @@ +--- +title: npm-query +section: 1 +description: Dependency selector query +--- + +### Synopsis + + + + + +```bash +npm query +``` + + + + + + +### Description + +The `npm query` command allows for usage of css selectors in order to retrieve +an array of dependency objects. + +### Piping npm query to other commands + +```bash +# find all dependencies with postinstall scripts & uninstall them +npm query ":attr(scripts, [postinstall])" | jq 'map(.name)|join("\n")' -r | xargs -I {} npm uninstall {} + +# find all git dependencies & explain who requires them +npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {} +``` + +### Extended Use Cases & Queries + +```stylus +// all deps +* + +// all direct deps +:root > * + +// direct production deps +:root > .prod + +// direct development deps +:root > .dev + +// any peer dep of a direct deps +:root > * > .peer + +// any workspace dep +.workspace + +// all workspaces that depend on another workspace +.workspace > .workspace + +// all workspaces that have peer deps +.workspace:has(.peer) + +// any dep named "lodash" +// equivalent to [name="lodash"] +#lodash + +// any deps named "lodash" & within semver range ^"1.2.3" +#lodash@^1.2.3 +// equivalent to... +[name="lodash"]:semver(^1.2.3) + +// get the hoisted node for a given semver range +#lodash@^1.2.3:not(:deduped) + +// querying deps with a specific version +#lodash@2.1.5 +// equivalent to... +[name="lodash"][version="2.1.5"] + +// has any deps +:has(*) + +// deps with no other deps (ie. "leaf" nodes) +:empty + +// manually querying git dependencies +[repository^=github:], +[repository^=git:], +[repository^=https://github.com], +[repository^=http://github.com], +[repository^=https://github.com], +[repository^=+git:...] + +// querying for all git dependencies +:type(git) + +// get production dependencies that aren't also dev deps +.prod:not(.dev) + +// get dependencies with specific licenses +[license=MIT], [license=ISC] + +// find all packages that have @ruyadorno as a contributor +:attr(contributors, [email=ruyadorno@github.com]) +``` + +### Example Response Output + +- an array of dependency objects is returned which can contain multiple copies of the same package which may or may not have been linked or deduped + +```json +[ + { + "name": "", + "version": "", + "description": "", + "homepage": "", + "bugs": {}, + "author": {}, + "license": {}, + "funding": {}, + "files": [], + "main": "", + "browser": "", + "bin": {}, + "man": [], + "directories": {}, + "repository": {}, + "scripts": {}, + "config": {}, + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "bundledDependencies": {}, + "peerDependencies": {}, + "peerDependenciesMeta": {}, + "engines": {}, + "os": [], + "cpu": [], + "workspaces": {}, + "keywords": [], + ... + }, + ... +``` + +### Configuration + + + + +#### `global` + +* Default: false +* Type: Boolean + +Operates in "global" mode, so that packages are installed into the `prefix` +folder instead of the current working directory. See +[folders](/configuring-npm/folders) for more on the differences in behavior. + +* packages are installed into the `{prefix}/lib/node_modules` folder, instead + of the current working directory. +* bin files are linked to `{prefix}/bin` +* man pages are linked to `{prefix}/share/man` + + + + +#### `workspace` + +* Default: +* Type: String (can be set multiple times) + +Enable running a command in the context of the configured workspaces of the +current project while filtering by running only the workspaces defined by +this configuration option. + +Valid values for the `workspace` config are either: + +* Workspace names +* Path to a workspace directory +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) + +When set for the `npm init` command, this may be set to the folder of a +workspace which does not yet exist, to create the folder and set it up as a +brand new workspace within the project. + +This value is not exported to the environment for child processes. + + + + +#### `workspaces` + +* Default: null +* Type: null or Boolean + +Set to true to run the command in the context of **all** configured +workspaces. + +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + +This value is not exported to the environment for child processes. + + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. + + + + + +## See Also + +* [dependency selector](/using-npm/dependency-selector) + diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md new file mode 100644 index 0000000000000..9d65baf631a7e --- /dev/null +++ b/docs/content/using-npm/dependency-selectors.md @@ -0,0 +1,168 @@ +--- +title: Dependency Selector Syntax & Querying +section: 7 +description: Dependency Selector Syntax & Querying +--- + +### Description + +The [`npm query`](/commands/npm-query) commmand exposes a new dependency selector syntax (informed by & respecting many aspects of the [CSS Selectors 4 Spec](https://dev.w3.org/csswg/selectors4/#relational)) which: + +- Standardizes the shape of, & querying of, dependency graphs with a robust object model, metadata & selector syntax +- Leverages existing, known language syntax & operators from CSS to make disparate package information broadly accessible +- Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata +- Consolidates redundant logic of similar query commands in `npm` (ex. `npm fund`, `npm ls`, `npm outdated`, `npm audit` ...) + +### Dependency Selector Syntax `v1.0.0` + +#### Overview: + +- there is no "type" or "tag" selectors (ex. `div, h1, a`) as a dependency/target is the only type of `Node` that can be queried +- the term "dependencies" is in reference to any `Node` found in a `tree` returned by `Arborist` + +#### Combinators + +- `>` direct descendant/child +- ` ` any descendant/child +- `~` sibling + +#### Selectors + +- `*` universal selector +- `#` dependency selector (equivalent to `[name="..."]`) +- `#@` (equivalent to `[name=]:semver()`) +- `,` selector list delimiter +- `.` dependency type selector +- `:` pseudo selector + +#### Dependency Type Selectors + +- `.prod` dependency found in the `dependencies` section of `package.json`, or is a child of said dependency +- `.dev` dependency found in the `devDependencies` section of `package.json`, or is a child of said dependency +- `.optional` dependency found in the `optionalDependencies` section of `package.json`, or has `"optional": true` set in its entry in the `peerDependenciesMeta` section of `package.json`, or a child of said dependency +- `.peer` dependency found in the `peerDependencies` section of `package.json` +- `.workspace` dependency found in the [`workspaces`](https://docs.npmjs.com/cli/v8/using-npm/workspaces) section of `package.json` +- `.bundled` dependency found in the `bundleDependencies` section of `package.json`, or is a child of said dependency + +#### Pseudo Selectors +- [`:not()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:not) +- [`:has()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) +- [`:is()`](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) +- [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) matches the root node/dependency +- [`:scope`](https://developer.mozilla.org/en-US/docs/Web/CSS/:scope) matches node/dependency it was queried against +- [`:empty`](https://developer.mozilla.org/en-US/docs/Web/CSS/:empty) when a dependency has no dependencies +- [`:private`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private) when a dependency is private +- `:link` when a dependency is linked (for instance, workspaces or packages manually [`linked`](https://docs.npmjs.com/cli/v8/commands/npm-link) +- `:deduped` when a dependency has been deduped (note that this does *not* always mean the dependency has been hoisted to the root of node_modules) +- `:override` when a dependency is an override (not implemented yet) +- `:extraneous` when a dependency exists but is not defined as a dependency of any node +- `:invalid` when a dependency version is out of its ancestors specified range +- `:missing` when a dependency is not found on disk +- `:semver()` matching a valid [`node-semver`](https://github.com/npm/node-semver) spec +- `:path()` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project +- `:type()` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object) + +#### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) + +The attribute selector evaluates the key/value pairs in `package.json` if they are `String`s. + +- `[]` attribute selector (ie. existence of attribute) +- `[attribute=value]` attribute value is equivalant... +- `[attribute~=value]` attribute value contains word... +- `[attribute*=value]` attribute value contains string... +- `[attribute|=value]` attribute value is equal to or starts with... +- `[attribute^=value]` attribute value starts with... +- `[attribute$=value]` attribute value ends with... + +#### `Array` & `Object` Attribute Selectors + +The generic `:attr()` pseudo selector standardizes a pattern which can be used for attribute selection of `Object`s, `Array`s or `Arrays` of `Object`s accessible via `Arborist`'s `Node.package` metadata. This allows for iterative attribute selection beyond top-level `String` evaluation. The last argument passed to `:attr()` must be an `attribute` selector or a nested `:attr()`. See examples below: + +#### `Objects` + +```css +/* return dependencies that have a `scripts.test` containing `"tap"` */ +*:attr(scripts, [test~=tap]) +``` + +#### Nested `Objects` + +Nested objects are expressed as sequential arguments to `:attr()`. + +```css +/* return dependencies that have a testling config for opera browsers */ +*:attr(testling, browsers, [~=opera]) +``` + +#### `Arrays` + +`Array`s specifically uses a special/reserved `.` character in place of a typical attribute name. `Arrays` also support exact `value` matching when a `String` is passed to the selector. + +##### Example of an `Array` Attribute Selection: +```css +/* removes the distinction between properties & arrays */ +/* ie. we'd have to check the property & iterate to match selection */ +*:attr([keywords^=react]) +*:attr(contributors, :attr([name~=Jordan])) +``` + +##### Example of an `Array` matching directly to a value: +```css +/* return dependencies that have the exact keyword "react" */ +/* this is equivalent to `*:keywords([value="react"])` */ +*:attr([keywords=react]) +``` + +##### Example of an `Array` of `Object`s: +```css +/* returns */ +*:attr(contributors, [email=ruyadorno@github.com]) +``` + +### Groups + +Dependency groups are defined by the package relationships to their ancestors (ie. the dependency types that are defined in `package.json`). This approach is user-centric as the ecosystem has been taught to think about dependencies in these groups first-and-foremost. Dependencies are allowed to be included in multiple groups (ex. a `prod` dependency may also be a `dev` dependency (in that it's also required by another `dev` dependency) & may also be `bundled` - a selector for that type of dependency would look like: `*.prod.dev.bundled`). + +- `.prod` +- `.dev` +- `.optional` +- `.peer` +- `.bundled` +- `.workspace` + +Please note that currently `workspace` deps are always `prod` dependencies. Additionally the `.root` dependency is also considered a `prod` dependency. + +### Programmatic Usage + +- `Arborist`'s `Node` Class has a `.querySelectorAll()` method + - this method will return a filtered, flattened dependency Arborist `Node` list based on a valid query selector + +```js +const Arborist = require('@npmcli/arborist') +const arb = new Arborist({}) +``` + +```js +// root-level +arb.loadActual((tree) => { + // query all production dependencies + const results = await tree.querySelectorAll('.prod') + console.log(results) +}) +``` + +```js +// iterative +arb.loadActual((tree) => { + // query for the deduped version of react + const results = await tree.querySelectorAll('#react:not(:deduped)') + // query the deduped react for git deps + const deps = await results[0].querySelectorAll(':type(git)') + console.log(deps) +}) +``` + +## See Also + +* [npm query](/commands/npm-query) +* [@npmcli/arborist](https://npm.im/@npmcli/arborist] diff --git a/docs/nav.yml b/docs/nav.yml index bc39b969eba40..565537054a0d7 100644 --- a/docs/nav.yml +++ b/docs/nav.yml @@ -132,6 +132,9 @@ - title: npm publish url: /commands/npm-publish description: Publish a package + - title: npm query + url: /commands/npm-query + description: Retrieve a filtered list of packages - title: npm rebuild url: /commands/npm-rebuild description: Rebuild a package @@ -253,6 +256,9 @@ - title: Organizations url: /using-npm/orgs description: Working with teams & organizations + - title: Dependency Selectors + url: /using-npm/dependency-selectors + description: Dependency Selector Syntax & Querying - title: Developers url: /using-npm/developers description: Developer guide diff --git a/lib/commands/query.js b/lib/commands/query.js new file mode 100644 index 0000000000000..371fddef9b440 --- /dev/null +++ b/lib/commands/query.js @@ -0,0 +1,104 @@ +'use strict' + +const { resolve } = require('path') +const Arborist = require('@npmcli/arborist') +const BaseCommand = require('../base-command.js') + +class QuerySelectorItem { + constructor (node) { + // all enumerable properties from the target + Object.assign(this, node.target.package) + + // append extra info + this.pkgid = node.target.pkgid + this.location = node.target.location + this.path = node.target.path + this.realpath = node.target.realpath + this.resolved = node.target.resolved + this.from = [] + this.to = [] + this.dev = node.target.dev + this.inBundle = node.target.inBundle + this.deduped = this.from.length > 1 + for (const edge of node.target.edgesIn) { + this.from.push(edge.from.location) + } + for (const [, edge] of node.target.edgesOut) { + if (edge.to) { + this.to.push(edge.to.location) + } + } + } +} + +class Query extends BaseCommand { + #response = [] // response is the query response + #seen = new Set() // paths we've seen so we can keep response deduped + + static description = 'Retrieve a filtered list of packages' + static name = 'query' + static usage = [''] + + static ignoreImplicitWorkspace = false + + static params = [ + 'global', + 'workspace', + 'workspaces', + 'include-workspace-root', + ] + + get parsedResponse () { + return JSON.stringify(this.#response, null, 2) + } + + async exec (args) { + // one dir up from wherever node_modules lives + const where = resolve(this.npm.dir, '..') + const opts = { + ...this.npm.flatOptions, + path: where, + } + const arb = new Arborist(opts) + const tree = await arb.loadActual(opts) + const items = await tree.querySelectorAll(args[0]) + this.buildResponse(items) + + this.npm.output(this.parsedResponse) + } + + async execWorkspaces (args, filters) { + await this.setWorkspaces(filters) + const opts = { + ...this.npm.flatOptions, + path: this.npm.prefix, + } + const arb = new Arborist(opts) + const tree = await arb.loadActual(opts) + for (const workspacePath of this.workspacePaths) { + let items + if (workspacePath === tree.root.path) { + // include-workspace-root + items = await tree.querySelectorAll(args[0]) + } else { + const [workspace] = await tree.querySelectorAll(`.workspace:path(${workspacePath})`) + items = await workspace.target.querySelectorAll(args[0]) + } + this.buildResponse(items) + } + this.npm.output(this.parsedResponse) + } + + // builds a normalized inventory + buildResponse (items) { + for (const node of items) { + if (!this.#seen.has(node.target.location)) { + const item = new QuerySelectorItem(node) + this.#response.push(item) + this.#seen.add(item.location) + } + } + } +} + +module.exports = Query diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js index c1d20186a82a6..38439542a21f9 100644 --- a/lib/utils/cmd-list.js +++ b/lib/utils/cmd-list.js @@ -114,6 +114,7 @@ const cmdList = [ 'profile', 'prune', 'publish', + 'query', 'rebuild', 'repo', 'restart', diff --git a/node_modules/@npmcli/query/LICENSE b/node_modules/@npmcli/query/LICENSE new file mode 100644 index 0000000000000..5fc208ff122e0 --- /dev/null +++ b/node_modules/@npmcli/query/LICENSE @@ -0,0 +1,20 @@ + + +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/query/lib/index.js b/node_modules/@npmcli/query/lib/index.js new file mode 100644 index 0000000000000..3986baeacc3c2 --- /dev/null +++ b/node_modules/@npmcli/query/lib/index.js @@ -0,0 +1,187 @@ +'use strict' + +const npa = require('npm-package-arg') +const parser = require('postcss-selector-parser') +const semver = require('semver') + +const arrayDelimiter = Symbol('arrayDelimiter') + +const escapeSlashes = str => + str.replace(/\//g, '\\/') + +const unescapeSlashes = str => + str.replace(/\\\//g, '/') + +const fixupIds = astNode => { + const { name, rawSpec: part } = npa(astNode.value) + const versionParts = [{ astNode, part }] + let currentAstNode = astNode.next() + + if (!part) { + return + } + + while (currentAstNode) { + versionParts.push({ astNode: currentAstNode, part: String(currentAstNode) }) + currentAstNode = currentAstNode.next() + } + + let version + let length = versionParts.length + while (!version && length) { + version = + semver.valid( + versionParts.slice(0, length).reduce((res, i) => `${res}${i.part}`, '') + ) + length-- + } + + astNode.value = `${name}@${version}` + + for (let i = 1; i <= length; i++) { + versionParts[i].astNode.remove() + } +} + +// recursively fixes up any :attr pseudo-class found +const fixupAttr = astNode => { + const properties = [] + const matcher = {} + for (const selectorAstNode of astNode.nodes) { + const [firstAstNode] = selectorAstNode.nodes + if (firstAstNode.type === 'tag') { + properties.push(firstAstNode.value) + } + } + + const lastSelectorAstNode = astNode.nodes.pop() + const [attributeAstNode] = lastSelectorAstNode.nodes + + if (attributeAstNode.value === ':attr') { + const appendParts = fixupAttr(attributeAstNode) + properties.push(arrayDelimiter, ...appendParts.lookupProperties) + matcher.qualifiedAttribute = appendParts.attributeMatcher.qualifiedAttribute + matcher.operator = appendParts.attributeMatcher.operator + matcher.value = appendParts.attributeMatcher.value + + // backwards compatibility + matcher.attribute = appendParts.attributeMatcher.attribute + + if (appendParts.attributeMatcher.insensitive) { + matcher.insensitive = true + } + } else { + matcher.qualifiedAttribute = attributeAstNode.qualifiedAttribute + matcher.operator = attributeAstNode.operator || '' + matcher.value = attributeAstNode.value + + // backwards compatibility + matcher.attribute = attributeAstNode.qualifiedAttribute + + if (attributeAstNode.insensitive) { + matcher.insensitive = true + } + + if (attributeAstNode.type !== 'attribute') { + throw Object.assign( + new Error('`:attr` pseudo-class expects an attribute matcher as the last value'), + { code: 'EQUERYATTR' } + ) + } + } + + astNode.lookupProperties = properties + astNode.attributeMatcher = matcher + astNode.nodes.length = 0 + return astNode +} + +// fixed up nested pseudo nodes will have their internal selectors moved +// to a new root node that will be referenced by the `nestedNode` property, +// this tweak makes it simpler to reuse `retrieveNodesFromParsedAst` to +// recursively parse and extract results from the internal selectors +const fixupNestedPseudo = astNode => { + // create a new ast root node and relocate any children + // selectors of the current ast node to this new root + const newRootNode = parser.root() + astNode.nestedNode = newRootNode + newRootNode.nodes = [...astNode.nodes] + + // clean up the ast by removing the children nodes from the + // current ast node while also cleaning up their `parent` refs + astNode.nodes.length = 0 + for (const currAstNode of newRootNode.nodes) { + currAstNode.parent = newRootNode + } + + // recursively fixup nodes of any nested selector + transformAst(newRootNode) +} + +const fixupSemverSpecs = astNode => { + const children = astNode.nodes[0].nodes + const value = children.reduce((res, i) => `${res}${String(i)}`, '') + + astNode.semverValue = value + astNode.nodes.length = 0 +} + +const fixupTypes = astNode => { + const [valueAstNode] = astNode.nodes[0].nodes + const { value } = valueAstNode || {} + astNode.typeValue = value + astNode.nodes.length = 0 +} + +const fixupPaths = astNode => { + astNode.pathValue = unescapeSlashes(String(astNode.nodes[0])) + astNode.nodes.length = 0 +} + +// a few of the supported ast nodes need to be tweaked in order to properly be +// interpreted as proper arborist query selectors, namely semver ranges from +// both ids and :semver pseudo-class selectors need to be translated from what +// are usually multiple ast nodes, such as: tag:1, class:.0, class:.0 to a +// single `1.0.0` value, other pseudo-class selectors also get preprocessed in +// order to make it simpler to execute later when traversing each ast node +// using rootNode.walk(), such as :path, :type, etc. transformAst handles all +// these modifications to the parsed ast by doing an extra, initial traversal +// of the parsed ast from the query and modifying the parsed nodes accordingly +const transformAst = selector => { + selector.walk((nextAstNode) => { + if (nextAstNode.type === 'id') { + fixupIds(nextAstNode) + } + + switch (nextAstNode.value) { + case ':attr': + return fixupAttr(nextAstNode) + case ':is': + case ':has': + case ':not': + return fixupNestedPseudo(nextAstNode) + case ':path': + return fixupPaths(nextAstNode) + case ':semver': + return fixupSemverSpecs(nextAstNode) + case ':type': + return fixupTypes(nextAstNode) + } + }) +} + +const queryParser = (query) => { + // if query is an empty string or any falsy + // value, just returns an empty result + if (!query) { + return [] + } + + return parser(transformAst) + .astSync(escapeSlashes(query), { lossless: false }) +} + +module.exports = { + parser: queryParser, + arrayDelimiter, +} diff --git a/node_modules/@npmcli/query/package.json b/node_modules/@npmcli/query/package.json new file mode 100644 index 0000000000000..f7f656233e73f --- /dev/null +++ b/node_modules/@npmcli/query/package.json @@ -0,0 +1,61 @@ +{ + "name": "@npmcli/query", + "version": "1.1.0", + "description": "npm query parser and tools", + "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", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" + }, + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "keywords": [ + "ast", + "npm", + "npmcli", + "parser", + "postcss", + "postcss-selector-parser", + "query" + ], + "author": "GitHub Inc.", + "license": "ISC", + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.2.0" + }, + "dependencies": { + "npm-package-arg": "^9.1.0", + "postcss-selector-parser": "^6.0.10", + "semver": "^7.3.7" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/query.git" + } +} diff --git a/node_modules/cssesc/LICENSE-MIT.txt b/node_modules/cssesc/LICENSE-MIT.txt new file mode 100644 index 0000000000000..a41e0a7ef970e --- /dev/null +++ b/node_modules/cssesc/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/cssesc/bin/cssesc b/node_modules/cssesc/bin/cssesc new file mode 100755 index 0000000000000..188c034ffe948 --- /dev/null +++ b/node_modules/cssesc/bin/cssesc @@ -0,0 +1,116 @@ +#!/usr/bin/env node +const fs = require('fs'); +const cssesc = require('../cssesc.js'); +const strings = process.argv.splice(2); +const stdin = process.stdin; +const options = {}; +const log = console.log; + +const main = function() { + const option = strings[0]; + + if (/^(?:-h|--help|undefined)$/.test(option)) { + log( + 'cssesc v%s - https://mths.be/cssesc', + cssesc.version + ); + log([ + '\nUsage:\n', + '\tcssesc [string]', + '\tcssesc [-i | --identifier] [string]', + '\tcssesc [-s | --single-quotes] [string]', + '\tcssesc [-d | --double-quotes] [string]', + '\tcssesc [-w | --wrap] [string]', + '\tcssesc [-e | --escape-everything] [string]', + '\tcssesc [-v | --version]', + '\tcssesc [-h | --help]', + '\nExamples:\n', + '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc' + ].join('\n')); + return process.exit(1); + } + + if (/^(?:-v|--version)$/.test(option)) { + log('v%s', cssesc.version); + return process.exit(1); + } + + strings.forEach(function(string) { + // Process options + if (/^(?:-i|--identifier)$/.test(string)) { + options.isIdentifier = true; + return; + } + if (/^(?:-s|--single-quotes)$/.test(string)) { + options.quotes = 'single'; + return; + } + if (/^(?:-d|--double-quotes)$/.test(string)) { + options.quotes = 'double'; + return; + } + if (/^(?:-w|--wrap)$/.test(string)) { + options.wrap = true; + return; + } + if (/^(?:-e|--escape-everything)$/.test(string)) { + options.escapeEverything = true; + return; + } + + // Process string(s) + let result; + try { + result = cssesc(string, options); + log(result); + } catch (exception) { + log(exception.message + '\n'); + log('Error: failed to escape.'); + log('If you think this is a bug in cssesc, please report it:'); + log('https://github.com/mathiasbynens/cssesc/issues/new'); + log( + '\nStack trace using cssesc@%s:\n', + cssesc.version + ); + log(exception.stack); + return process.exit(1); + } + }); + // Return with exit status 0 outside of the `forEach` loop, in case + // multiple strings were passed in. + return process.exit(0); + +}; + +if (stdin.isTTY) { + // handle shell arguments + main(); +} else { + let timeout; + // Either the script is called from within a non-TTY context, or `stdin` + // content is being piped in. + if (!process.stdout.isTTY) { + // The script was called from a non-TTY context. This is a rather uncommon + // use case we don’t actively support. However, we don’t want the script + // to wait forever in such cases, so… + timeout = setTimeout(function() { + // …if no piped data arrived after a whole minute, handle shell + // arguments instead. + main(); + }, 60000); + } + let data = ''; + stdin.on('data', function(chunk) { + clearTimeout(timeout); + data += chunk; + }); + stdin.on('end', function() { + strings.push(data.trim()); + main(); + }); + stdin.resume(); +} diff --git a/node_modules/cssesc/cssesc.js b/node_modules/cssesc/cssesc.js new file mode 100644 index 0000000000000..1c0928e45667c --- /dev/null +++ b/node_modules/cssesc/cssesc.js @@ -0,0 +1,110 @@ +/*! https://mths.be/cssesc v3.0.0 by @mathias */ +'use strict'; + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +var merge = function merge(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + for (var key in defaults) { + // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since + // only recognized option names are used. + result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; + } + return result; +}; + +var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; +var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; +var regexAlwaysEscape = /['"\\]/; +var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; + +// https://mathiasbynens.be/notes/css-escapes#css +var cssesc = function cssesc(string, options) { + options = merge(options, cssesc.options); + if (options.quotes != 'single' && options.quotes != 'double') { + options.quotes = 'single'; + } + var quote = options.quotes == 'double' ? '"' : '\''; + var isIdentifier = options.isIdentifier; + + var firstChar = string.charAt(0); + var output = ''; + var counter = 0; + var length = string.length; + while (counter < length) { + var character = string.charAt(counter++); + var codePoint = character.charCodeAt(); + var value = void 0; + // If it’s not a printable ASCII character… + if (codePoint < 0x20 || codePoint > 0x7E) { + if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { + // It’s a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // next character is low surrogate + codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000; + } else { + // It’s an unmatched surrogate; only append this code unit, in case + // the next code unit is the high surrogate of a surrogate pair. + counter--; + } + } + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else { + if (options.escapeEverything) { + if (regexAnySingleEscape.test(character)) { + value = '\\' + character; + } else { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } + } else if (/[\t\n\f\r\x0B]/.test(character)) { + value = '\\' + codePoint.toString(16).toUpperCase() + ' '; + } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { + value = '\\' + character; + } else { + value = character; + } + } + output += value; + } + + if (isIdentifier) { + if (/^-[-\d]/.test(output)) { + output = '\\-' + output.slice(1); + } else if (/\d/.test(firstChar)) { + output = '\\3' + firstChar + ' ' + output.slice(1); + } + } + + // Remove spaces after `\HEX` escapes that are not followed by a hex digit, + // since they’re redundant. Note that this is only possible if the escape + // sequence isn’t preceded by an odd number of backslashes. + output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { + if ($1 && $1.length % 2) { + // It’s not safe to remove the space, so don’t. + return $0; + } + // Strip the space. + return ($1 || '') + $2; + }); + + if (!isIdentifier && options.wrap) { + return quote + output + quote; + } + return output; +}; + +// Expose default options (so they can be overridden globally). +cssesc.options = { + 'escapeEverything': false, + 'isIdentifier': false, + 'quotes': 'single', + 'wrap': false +}; + +cssesc.version = '3.0.0'; + +module.exports = cssesc; diff --git a/node_modules/cssesc/man/cssesc.1 b/node_modules/cssesc/man/cssesc.1 new file mode 100644 index 0000000000000..eee4996daf543 --- /dev/null +++ b/node_modules/cssesc/man/cssesc.1 @@ -0,0 +1,70 @@ +.Dd August 9, 2013 +.Dt cssesc 1 +.Sh NAME +.Nm cssesc +.Nd escape text for use in CSS string literals or identifiers +.Sh SYNOPSIS +.Nm +.Op Fl i | -identifier Ar string +.br +.Op Fl s | -single-quotes Ar string +.br +.Op Fl d | -double-quotes Ar string +.br +.Op Fl w | -wrap Ar string +.br +.Op Fl e | -escape-everything Ar string +.br +.Op Fl v | -version +.br +.Op Fl h | -help +.Sh DESCRIPTION +.Nm +escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output. +.Sh OPTIONS +.Bl -ohang -offset +.It Sy "-s, --single-quotes" +Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes. +.It Sy "-d, --double-quotes" +Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes. +.It Sy "-w, --wrap" +Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the +.Ar -s | --single-quotes +or +.Ar -d | --double-quotes +settings. +.It Sy "-e, --escape-everything" +Escape all the symbols in the output, even printable ASCII symbols. +.It Sy "-v, --version" +Print cssesc's version. +.It Sy "-h, --help" +Show the help screen. +.El +.Sh EXIT STATUS +The +.Nm cssesc +utility exits with one of the following values: +.Pp +.Bl -tag -width flag -compact +.It Li 0 +.Nm +successfully escaped the given text and printed the result. +.It Li 1 +.Nm +wasn't instructed to escape anything (for example, the +.Ar --help +flag was set); or, an error occurred. +.El +.Sh EXAMPLES +.Bl -ohang -offset +.It Sy "cssesc 'foo bar baz'" +Print an escaped version of the given text. +.It Sy echo\ 'foo bar baz'\ |\ cssesc +Print an escaped version of the text that gets piped in. +.El +.Sh BUGS +cssesc's bug tracker is located at . +.Sh AUTHOR +Mathias Bynens +.Sh WWW + diff --git a/node_modules/cssesc/package.json b/node_modules/cssesc/package.json new file mode 100644 index 0000000000000..076c84dc83018 --- /dev/null +++ b/node_modules/cssesc/package.json @@ -0,0 +1,51 @@ +{ + "name": "cssesc", + "version": "3.0.0", + "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.", + "homepage": "https://mths.be/cssesc", + "engines": { + "node": ">=4" + }, + "main": "cssesc.js", + "bin": "bin/cssesc", + "man": "man/cssesc.1", + "keywords": [ + "css", + "escape", + "identifier", + "string", + "tool" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/cssesc.git" + }, + "bugs": "https://github.com/mathiasbynens/cssesc/issues", + "files": [ + "LICENSE-MIT.txt", + "cssesc.js", + "bin/", + "man/" + ], + "scripts": { + "build": "grunt template && babel cssesc.js -o cssesc.js", + "test": "mocha tests", + "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-env": "^1.6.1", + "codecov": "^1.0.1", + "grunt": "^1.0.1", + "grunt-template": "^1.0.0", + "istanbul": "^0.4.4", + "mocha": "^2.5.3", + "regenerate": "^1.2.1", + "requirejs": "^2.1.16" + } +} diff --git a/node_modules/postcss-selector-parser/API.md b/node_modules/postcss-selector-parser/API.md new file mode 100644 index 0000000000000..6aa1f1438f1be --- /dev/null +++ b/node_modules/postcss-selector-parser/API.md @@ -0,0 +1,873 @@ +# API Documentation + +*Please use only this documented API when working with the parser. Methods +not documented here are subject to change at any point.* + +## `parser` function + +This is the module's main entry point. + +```js +const parser = require('postcss-selector-parser'); +``` + +### `parser([transform], [options])` + +Creates a new `processor` instance + +```js +const processor = parser(); +``` + +Or, with optional transform function + +```js +const transform = selectors => { + selectors.walkUniversals(selector => { + selector.remove(); + }); +}; + +const processor = parser(transform) + +// Example +const result = processor.processSync('*.class'); +// => .class +``` + +[See processor documentation](#processor) + +Arguments: + +* `transform (function)`: Provide a function to work with the parsed AST. +* `options (object)`: Provide default options for all calls on the returned `Processor`. + +### `parser.attribute([props])` + +Creates a new attribute selector. + +```js +parser.attribute({attribute: 'href'}); +// => [href] +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.className([props])` + +Creates a new class selector. + +```js +parser.className({value: 'button'}); +// => .button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.combinator([props])` + +Creates a new selector combinator. + +```js +parser.combinator({value: '+'}); +// => + +``` + +Arguments: + +* `props (object)`: The new node's properties. + +Notes: +* **Descendant Combinators** The value of descendant combinators created by the + parser always just a single space (`" "`). For descendant selectors with no + comments, additional space is now stored in `node.spaces.before`. Depending + on the location of comments, additional spaces may be stored in + `node.raws.spaces.before`, `node.raws.spaces.after`, or `node.raws.value`. +* **Named Combinators** Although, nonstandard and unlikely to ever become a standard, + named combinators like `/deep/` and `/for/` are parsed as combinators. The + `node.value` is name after being unescaped and normalized as lowercase. The + original value for the combinator name is stored in `node.raws.value`. + + +### `parser.comment([props])` + +Creates a new comment. + +```js +parser.comment({value: '/* Affirmative, Dave. I read you. */'}); +// => /* Affirmative, Dave. I read you. */ +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.id([props])` + +Creates a new id selector. + +```js +parser.id({value: 'search'}); +// => #search +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.nesting([props])` + +Creates a new nesting selector. + +```js +parser.nesting(); +// => & +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.pseudo([props])` + +Creates a new pseudo selector. + +```js +parser.pseudo({value: '::before'}); +// => ::before +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.root([props])` + +Creates a new root node. + +```js +parser.root(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.selector([props])` + +Creates a new selector node. + +```js +parser.selector(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.string([props])` + +Creates a new string node. + +```js +parser.string(); +// => (empty) +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.tag([props])` + +Creates a new tag selector. + +```js +parser.tag({value: 'button'}); +// => button +``` + +Arguments: + +* `props (object)`: The new node's properties. + +### `parser.universal([props])` + +Creates a new universal selector. + +```js +parser.universal(); +// => * +``` + +Arguments: + +* `props (object)`: The new node's properties. + +## Node types + +### `node.type` + +A string representation of the selector type. It can be one of the following; +`attribute`, `class`, `combinator`, `comment`, `id`, `nesting`, `pseudo`, +`root`, `selector`, `string`, `tag`, or `universal`. Note that for convenience, +these constants are exposed on the main `parser` as uppercased keys. So for +example you can get `id` by querying `parser.ID`. + +```js +parser.attribute({attribute: 'href'}).type; +// => 'attribute' +``` + +### `node.parent` + +Returns the parent node. + +```js +root.nodes[0].parent === root; +``` + +### `node.toString()`, `String(node)`, or `'' + node` + +Returns a string representation of the node. + +```js +const id = parser.id({value: 'search'}); +console.log(String(id)); +// => #search +``` + +### `node.next()` & `node.prev()` + +Returns the next/previous child of the parent node. + +```js +const next = id.next(); +if (next && next.type !== 'combinator') { + throw new Error('Qualified IDs are not allowed!'); +} +``` + +### `node.replaceWith(node)` + +Replace a node with another. + +```js +const attr = selectors.first.first; +const className = parser.className({value: 'test'}); +attr.replaceWith(className); +``` + +Arguments: + +* `node`: The node to substitute the original with. + +### `node.remove()` + +Removes the node from its parent node. + +```js +if (node.type === 'id') { + node.remove(); +} +``` + +### `node.clone()` + +Returns a copy of a node, detached from any parent containers that the +original might have had. + +```js +const cloned = parser.id({value: 'search'}); +String(cloned); + +// => #search +``` + +### `node.isAtPosition(line, column)` + +Return a `boolean` indicating whether this node includes the character at the +position of the given line and column. Returns `undefined` if the nodes lack +sufficient source metadata to determine the position. + +Arguments: + +* `line`: 1-index based line number relative to the start of the selector. +* `column`: 1-index based column number relative to the start of the selector. + +### `node.spaces` + +Extra whitespaces around the node will be moved into `node.spaces.before` and +`node.spaces.after`. So for example, these spaces will be moved as they have +no semantic meaning: + +```css + h1 , h2 {} +``` + +For descendent selectors, the value is always a single space. + +```css +h1 h2 {} +``` + +Additional whitespace is found in either the `node.spaces.before` and `node.spaces.after` depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node's raw value is set to the actual space(s) found in the source. + +### `node.source` + +An object describing the node's start/end, line/column source position. + +Within the following CSS, the `.bar` class node ... + +```css +.foo, + .bar {} +``` + +... will contain the following `source` object. + +```js +source: { + start: { + line: 2, + column: 3 + }, + end: { + line: 2, + column: 6 + } +} +``` + +### `node.sourceIndex` + +The zero-based index of the node within the original source string. + +Within the following CSS, the `.baz` class node will have a `sourceIndex` of `12`. + +```css +.foo, .bar, .baz {} +``` + +## Container types + +The `root`, `selector`, and `pseudo` nodes have some helper methods for working +with their children. + +### `container.nodes` + +An array of the container's children. + +```js +// Input: h1 h2 +selectors.at(0).nodes.length // => 3 +selectors.at(0).nodes[0].value // => 'h1' +selectors.at(0).nodes[1].value // => ' ' +``` + +### `container.first` & `container.last` + +The first/last child of the container. + +```js +selector.first === selector.nodes[0]; +selector.last === selector.nodes[selector.nodes.length - 1]; +``` + +### `container.at(index)` + +Returns the node at position `index`. + +```js +selector.at(0) === selector.first; +selector.at(0) === selector.nodes[0]; +``` + +Arguments: + +* `index`: The index of the node to return. + +### `container.atPosition(line, column)` + +Returns the node at the source position `index`. + +```js +selector.at(0) === selector.first; +selector.at(0) === selector.nodes[0]; +``` + +Arguments: + +* `index`: The index of the node to return. + +### `container.index(node)` + +Return the index of the node within its container. + +```js +selector.index(selector.nodes[2]) // => 2 +``` + +Arguments: + +* `node`: A node within the current container. + +### `container.length` + +Proxy to the length of the container's nodes. + +```js +container.length === container.nodes.length +``` + +### `container` Array iterators + +The container class provides proxies to certain Array methods; these are: + +* `container.map === container.nodes.map` +* `container.reduce === container.nodes.reduce` +* `container.every === container.nodes.every` +* `container.some === container.nodes.some` +* `container.filter === container.nodes.filter` +* `container.sort === container.nodes.sort` + +Note that these methods only work on a container's immediate children; recursive +iteration is provided by `container.walk`. + +### `container.each(callback)` + +Iterate the container's immediate children, calling `callback` for each child. +You may return `false` within the callback to break the iteration. + +```js +let className; +selectors.each((selector, index) => { + if (selector.type === 'class') { + className = selector.value; + return false; + } +}); +``` + +Note that unlike `Array#forEach()`, this iterator is safe to use whilst adding +or removing nodes from the container. + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +### `container.walk(callback)` + +Like `container#each`, but will also iterate child nodes as long as they are +`container` types. + +```js +selectors.walk((selector, index) => { + // all nodes +}); +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + and `index` arguments. + +This iterator is safe to use whilst mutating `container.nodes`, +like `container#each`. + +### `container.walk` proxies + +The container class provides proxy methods for iterating over types of nodes, +so that it is easier to write modules that target specific selectors. Those +methods are: + +* `container.walkAttributes` +* `container.walkClasses` +* `container.walkCombinators` +* `container.walkComments` +* `container.walkIds` +* `container.walkNesting` +* `container.walkPseudos` +* `container.walkTags` +* `container.walkUniversals` + +### `container.split(callback)` + +This method allows you to split a group of nodes by returning `true` from +a callback. It returns an array of arrays, where each inner array corresponds +to the groups that you created via the callback. + +```js +// (input) => h1 h2>>h3 +const list = selectors.first.split(selector => { + return selector.type === 'combinator'; +}); + +// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']] +``` + +Arguments: + +* `callback (function)`: A function to call for each node, which receives `node` + as an argument. + +### `container.prepend(node)` & `container.append(node)` + +Add a node to the start/end of the container. Note that doing so will set +the parent property of the node to this container. + +```js +const id = parser.id({value: 'search'}); +selector.append(id); +``` + +Arguments: + +* `node`: The node to add. + +### `container.insertBefore(old, new)` & `container.insertAfter(old, new)` + +Add a node before or after an existing node in a container: + +```js +selectors.walk(selector => { + if (selector.type !== 'class') { + const className = parser.className({value: 'theme-name'}); + selector.parent.insertAfter(selector, className); + } +}); +``` + +Arguments: + +* `old`: The existing node in the container. +* `new`: The new node to add before/after the existing node. + +### `container.removeChild(node)` + +Remove the node from the container. Note that you can also use +`node.remove()` if you would like to remove just a single node. + +```js +selector.length // => 2 +selector.remove(id) +selector.length // => 1; +id.parent // undefined +``` + +Arguments: + +* `node`: The node to remove. + +### `container.removeAll()` or `container.empty()` + +Remove all children from the container. + +```js +selector.removeAll(); +selector.length // => 0 +``` + +## Root nodes + +A root node represents a comma separated list of selectors. Indeed, all +a root's `toString()` method does is join its selector children with a ','. +Other than this, it has no special functionality and acts like a container. + +### `root.trailingComma` + +This will be set to `true` if the input has a trailing comma, in order to +support parsing of legacy CSS hacks. + +## Selector nodes + +A selector node represents a single complex selector. For example, this +selector string `h1 h2 h3, [href] > p`, is represented as two selector nodes. +It has no special functionality of its own. + +## Pseudo nodes + +A pseudo selector extends a container node; if it has any parameters of its +own (such as `h1:not(h2, h3)`), they will be its children. Note that the pseudo +`value` will always contain the colons preceding the pseudo identifier. This +is so that both `:before` and `::before` are properly represented in the AST. + +## Attribute nodes + +### `attribute.quoted` + +Returns `true` if the attribute's value is wrapped in quotation marks, false if it is not. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* false */ +[href='foo'] /* true */ +[href="foo"] /* true */ +[href] /* undefined */ +``` + +### `attribute.qualifiedAttribute` + +Returns the attribute name qualified with the namespace if one is given. + +### `attribute.offsetOf(part)` + + Returns the offset of the attribute part specified relative to the + start of the node of the output string. This is useful in raising + error messages about a specific part of the attribute, especially + in combination with `attribute.sourceIndex`. + + Returns `-1` if the name is invalid or the value doesn't exist in this + attribute. + + The legal values for `part` are: + + * `"ns"` - alias for "namespace" + * `"namespace"` - the namespace if it exists. + * `"attribute"` - the attribute name + * `"attributeNS"` - the start of the attribute or its namespace + * `"operator"` - the match operator of the attribute + * `"value"` - The value (string or identifier) + * `"insensitive"` - the case insensitivity flag + +### `attribute.raws.unquoted` + +Returns the unquoted content of the attribute's value. +Remains `undefined` if there is no attribute value. + +```css +[href=foo] /* foo */ +[href='foo'] /* foo */ +[href="foo"] /* foo */ +[href] /* undefined */ +``` + +### `attribute.spaces` + +Like `node.spaces` with the `before` and `after` values containing the spaces +around the element, the parts of the attribute can also have spaces before +and after them. The for each of `attribute`, `operator`, `value` and +`insensitive` there is corresponding property of the same nam in +`node.spaces` that has an optional `before` or `after` string containing only +whitespace. + +Note that corresponding values in `attributes.raws.spaces` contain values +including any comments. If set, these values will override the +`attribute.spaces` value. Take care to remove them if changing +`attribute.spaces`. + +### `attribute.raws` + +The raws object stores comments and other information necessary to re-render +the node exactly as it was in the source. + +If a comment is embedded within the identifiers for the `namespace`, `attribute` +or `value` then a property is placed in the raws for that value containing the full source of the propery including comments. + +If a comment is embedded within the space between parts of the attribute +then the raw for that space is set accordingly. + +Setting an attribute's property `raws` value to be deleted. + +For now, changing the spaces required also updating or removing any of the +raws values that override them. + +Example: `[ /*before*/ href /* after-attr */ = /* after-operator */ te/*inside-value*/st/* wow */ /*omg*/i/*bbq*/ /*whodoesthis*/]` would parse as: + +```js +{ + attribute: "href", + operator: "=", + value: "test", + spaces: { + before: '', + after: '', + attribute: { before: ' ', after: ' ' }, + operator: { after: ' ' }, + value: { after: ' ' }, + insensitive: { after: ' ' } + }, + raws: { + spaces: { + attribute: { before: ' /*before*/ ', after: ' /* after-attr */ ' }, + operator: { after: ' /* after-operator */ ' }, + value: { after: '/* wow */ /*omg*/' }, + insensitive: { after: '/*bbq*/ /*whodoesthis*/' } + }, + unquoted: 'test', + value: 'te/*inside-value*/st' + } +} +``` + +## `Processor` + +### `ProcessorOptions` + +* `lossless` - When `true`, whitespace is preserved. Defaults to `true`. +* `updateSelector` - When `true`, if any processor methods are passed a postcss + `Rule` node instead of a string, then that Rule's selector is updated + with the results of the processing. Defaults to `true`. + +### `process|processSync(selectors, [options])` + +Processes the `selectors`, returning a string from the result of processing. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +**Example:** + +```js +const parser = require("postcss-selector-parser"); +const processor = parser(); + +let result = processor.processSync(' .class'); +console.log(result); +// => .class + +// Asynchronous operation +let promise = processor.process(' .class').then(result => { + console.log(result) + // => .class +}); + +// To have the parser normalize whitespace values, utilize the options +result = processor.processSync(' .class ', {lossless: false}); +console.log(result); +// => .class + +// For better syntax errors, pass a PostCSS Rule node. +const postcss = require('postcss'); +rule = postcss.rule({selector: ' #foo > a, .class '}); +processor.process(rule, {lossless: false, updateSelector: true}).then(result => { + console.log(result); + // => #foo>a,.class + console.log("rule:", rule.selector); + // => rule: #foo>a,.class +}) +``` + +Arguments: + +* `selectors (string|postcss.Rule)`: Either a selector string or a PostCSS Rule + node. +* `[options] (object)`: Process options + + +### `ast|astSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the `Root` node of the result +instead of a string. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### `transform|transformSync(selectors, [options])` + +Like `process()` and `processSync()` but after +processing the `selectors` these methods return the value returned by the +processor callback. + +Note: when the `updateSelector` option is set, the rule's selector +will be updated with the resulting string. + +### Error Handling Within Selector Processors + +The root node passed to the selector processor callback +has a method `error(message, options)` that returns an +error object. This method should always be used to raise +errors relating to the syntax of selectors. The options +to this method are passed to postcss's error constructor +([documentation](http://api.postcss.org/Container.html#error)). + +#### Async Error Example + +```js +let processor = (root) => { + return new Promise((resolve, reject) => { + root.walkClasses((classNode) => { + if (/^(.*)[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + reject(root.error(msg, { + index: classNode.sourceIndex + RegExp.$1.length + 1, + word: classNode.value + })); + } + }); + resolve(); + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + let promises = []; + root.walkRules(rule => { + promises.push(selectorProcessor.process(rule)); + }); + return Promise.all(promises); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` + +#### Synchronous Error Example + +```js +let processor = (root) => { + root.walkClasses((classNode) => { + if (/.*[-_]/.test(classNode.value)) { + let msg = "classes may not have underscores or dashes in them"; + throw root.error(msg, { + index: classNode.sourceIndex, + word: classNode.value + }); + } + }); +}; + +const postcss = require("postcss"); +const parser = require("postcss-selector-parser"); +const selectorProcessor = parser(processor); +const plugin = postcss.plugin('classValidator', (options) => { + return (root) => { + root.walkRules(rule => { + selectorProcessor.processSync(rule); + }); + }; +}); +postcss(plugin()).process(` +.foo-bar { + color: red; +} +`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString())); + +// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them +// +// > 1 | .foo-bar { +// | ^ +// 2 | color: red; +// 3 | } +``` diff --git a/node_modules/postcss-selector-parser/LICENSE-MIT b/node_modules/postcss-selector-parser/LICENSE-MIT new file mode 100644 index 0000000000000..fd0e863a614fb --- /dev/null +++ b/node_modules/postcss-selector-parser/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) Ben Briggs (http://beneb.info) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/postcss-selector-parser/dist/index.js b/node_modules/postcss-selector-parser/dist/index.js new file mode 100644 index 0000000000000..6e76a32bdd442 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/index.js @@ -0,0 +1,24 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _processor = _interopRequireDefault(require("./processor")); + +var selectors = _interopRequireWildcard(require("./selectors")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var parser = function parser(processor) { + return new _processor["default"](processor); +}; + +Object.assign(parser, selectors); +delete parser.__esModule; +var _default = parser; +exports["default"] = _default; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/parser.js b/node_modules/postcss-selector-parser/dist/parser.js new file mode 100644 index 0000000000000..e0451de00f43e --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/parser.js @@ -0,0 +1,1243 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _root = _interopRequireDefault(require("./selectors/root")); + +var _selector = _interopRequireDefault(require("./selectors/selector")); + +var _className = _interopRequireDefault(require("./selectors/className")); + +var _comment = _interopRequireDefault(require("./selectors/comment")); + +var _id = _interopRequireDefault(require("./selectors/id")); + +var _tag = _interopRequireDefault(require("./selectors/tag")); + +var _string = _interopRequireDefault(require("./selectors/string")); + +var _pseudo = _interopRequireDefault(require("./selectors/pseudo")); + +var _attribute = _interopRequireWildcard(require("./selectors/attribute")); + +var _universal = _interopRequireDefault(require("./selectors/universal")); + +var _combinator = _interopRequireDefault(require("./selectors/combinator")); + +var _nesting = _interopRequireDefault(require("./selectors/nesting")); + +var _sortAscending = _interopRequireDefault(require("./sortAscending")); + +var _tokenize = _interopRequireWildcard(require("./tokenize")); + +var tokens = _interopRequireWildcard(require("./tokenTypes")); + +var types = _interopRequireWildcard(require("./selectors/types")); + +var _util = require("./util"); + +var _WHITESPACE_TOKENS, _Object$assign; + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); +var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); + +function tokenStart(token) { + return { + line: token[_tokenize.FIELDS.START_LINE], + column: token[_tokenize.FIELDS.START_COL] + }; +} + +function tokenEnd(token) { + return { + line: token[_tokenize.FIELDS.END_LINE], + column: token[_tokenize.FIELDS.END_COL] + }; +} + +function getSource(startLine, startColumn, endLine, endColumn) { + return { + start: { + line: startLine, + column: startColumn + }, + end: { + line: endLine, + column: endColumn + } + }; +} + +function getTokenSource(token) { + return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); +} + +function getTokenSourceSpan(startToken, endToken) { + if (!startToken) { + return undefined; + } + + return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); +} + +function unescapeProp(node, prop) { + var value = node[prop]; + + if (typeof value !== "string") { + return; + } + + if (value.indexOf("\\") !== -1) { + (0, _util.ensureObject)(node, 'raws'); + node[prop] = (0, _util.unesc)(value); + + if (node.raws[prop] === undefined) { + node.raws[prop] = value; + } + } + + return node; +} + +function indexesOf(array, item) { + var i = -1; + var indexes = []; + + while ((i = array.indexOf(item, i + 1)) !== -1) { + indexes.push(i); + } + + return indexes; +} + +function uniqs() { + var list = Array.prototype.concat.apply([], arguments); + return list.filter(function (item, i) { + return i === list.indexOf(item); + }); +} + +var Parser = /*#__PURE__*/function () { + function Parser(rule, options) { + if (options === void 0) { + options = {}; + } + + this.rule = rule; + this.options = Object.assign({ + lossy: false, + safe: false + }, options); + this.position = 0; + this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector; + this.tokens = (0, _tokenize["default"])({ + css: this.css, + error: this._errorGenerator(), + safe: this.options.safe + }); + var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); + this.root = new _root["default"]({ + source: rootSource + }); + this.root.errorGenerator = this._errorGenerator(); + var selector = new _selector["default"]({ + source: { + start: { + line: 1, + column: 1 + } + } + }); + this.root.append(selector); + this.current = selector; + this.loop(); + } + + var _proto = Parser.prototype; + + _proto._errorGenerator = function _errorGenerator() { + var _this = this; + + return function (message, errorOptions) { + if (typeof _this.rule === 'string') { + return new Error(message); + } + + return _this.rule.error(message, errorOptions); + }; + }; + + _proto.attribute = function attribute() { + var attr = []; + var startingToken = this.currToken; + this.position++; + + while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + attr.push(this.currToken); + this.position++; + } + + if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { + return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + } + + var len = attr.length; + var node = { + source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + }; + + if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) { + return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]); + } + + var pos = 0; + var spaceBefore = ''; + var commentBefore = ''; + var lastAdded = null; + var spaceAfterMeaningfulToken = false; + + while (pos < len) { + var token = attr[pos]; + var content = this.content(token); + var next = attr[pos + 1]; + + switch (token[_tokenize.FIELDS.TYPE]) { + case tokens.space: + // if ( + // len === 1 || + // pos === 0 && this.content(next) === '|' + // ) { + // return this.expected('attribute', token[TOKEN.START_POS], content); + // } + spaceAfterMeaningfulToken = true; + + if (this.options.lossy) { + break; + } + + if (lastAdded) { + (0, _util.ensureObject)(node, 'spaces', lastAdded); + var prevContent = node.spaces[lastAdded].after || ''; + node.spaces[lastAdded].after = prevContent + content; + var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null; + + if (existingComment) { + node.raws.spaces[lastAdded].after = existingComment + content; + } + } else { + spaceBefore = spaceBefore + content; + commentBefore = commentBefore + content; + } + + break; + + case tokens.asterisk: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = spaceBefore; + commentBefore = ''; + } + + node.namespace = (node.namespace || "") + content; + var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null; + + if (rawValue) { + node.raws.namespace += content; + } + + lastAdded = 'namespace'; + } + + spaceAfterMeaningfulToken = false; + break; + + case tokens.dollar: + if (lastAdded === "value") { + var oldRawValue = (0, _util.getProp)(node, 'raws', 'value'); + node.value += "$"; + + if (oldRawValue) { + node.raws.value = oldRawValue + "$"; + } + + break; + } + + // Falls through + + case tokens.caret: + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + + spaceAfterMeaningfulToken = false; + break; + + case tokens.combinator: + if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } + + if (content !== '|') { + spaceAfterMeaningfulToken = false; + break; + } + + if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { + node.operator = content; + lastAdded = 'operator'; + } else if (!node.namespace && !node.attribute) { + node.namespace = true; + } + + spaceAfterMeaningfulToken = false; + break; + + case tokens.word: + if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved. + !node.operator && !node.namespace) { + node.namespace = content; + lastAdded = 'namespace'; + } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'attribute'); + node.spaces.attribute.before = spaceBefore; + spaceBefore = ''; + } + + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute'); + node.raws.spaces.attribute.before = commentBefore; + commentBefore = ''; + } + + node.attribute = (node.attribute || "") + content; + + var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null; + + if (_rawValue) { + node.raws.attribute += content; + } + + lastAdded = 'attribute'; + } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) { + var _unescaped = (0, _util.unesc)(content); + + var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || ''; + + var oldValue = node.value || ''; + node.value = oldValue + _unescaped; + node.quoteMark = null; + + if (_unescaped !== content || _oldRawValue) { + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = (_oldRawValue || oldValue) + content; + } + + lastAdded = 'value'; + } else { + var insensitive = content === 'i' || content === "I"; + + if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) { + node.insensitive = insensitive; + + if (!insensitive || content === "I") { + (0, _util.ensureObject)(node, 'raws'); + node.raws.insensitiveFlag = content; + } + + lastAdded = 'insensitive'; + + if (spaceBefore) { + (0, _util.ensureObject)(node, 'spaces', 'insensitive'); + node.spaces.insensitive.before = spaceBefore; + spaceBefore = ''; + } + + if (commentBefore) { + (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive'); + node.raws.spaces.insensitive.before = commentBefore; + commentBefore = ''; + } + } else if (node.value || node.value === '') { + lastAdded = 'value'; + node.value += content; + + if (node.raws.value) { + node.raws.value += content; + } + } + } + + spaceAfterMeaningfulToken = false; + break; + + case tokens.str: + if (!node.attribute || !node.operator) { + return this.error("Expected an attribute followed by an operator preceding the string.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + + var _unescapeValue = (0, _attribute.unescapeValue)(content), + unescaped = _unescapeValue.unescaped, + quoteMark = _unescapeValue.quoteMark; + + node.value = unescaped; + node.quoteMark = quoteMark; + lastAdded = 'value'; + (0, _util.ensureObject)(node, 'raws'); + node.raws.value = content; + spaceAfterMeaningfulToken = false; + break; + + case tokens.equals: + if (!node.attribute) { + return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content); + } + + if (node.value) { + return this.error('Unexpected "=" found; an operator was already defined.', { + index: token[_tokenize.FIELDS.START_POS] + }); + } + + node.operator = node.operator ? node.operator + content : content; + lastAdded = 'operator'; + spaceAfterMeaningfulToken = false; + break; + + case tokens.comment: + if (lastAdded) { + if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') { + var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || ''; + var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment; + (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded); + node.raws.spaces[lastAdded].after = rawLastComment + content; + } else { + var lastValue = node[lastAdded] || ''; + var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue; + (0, _util.ensureObject)(node, 'raws'); + node.raws[lastAdded] = rawLastValue + content; + } + } else { + commentBefore = commentBefore + content; + } + + break; + + default: + return this.error("Unexpected \"" + content + "\" found.", { + index: token[_tokenize.FIELDS.START_POS] + }); + } + + pos++; + } + + unescapeProp(node, "attribute"); + unescapeProp(node, "namespace"); + this.newNode(new _attribute["default"](node)); + this.position++; + } + /** + * return a node containing meaningless garbage up to (but not including) the specified token position. + * if the token position is negative, all remaining tokens are consumed. + * + * This returns an array containing a single string node if all whitespace, + * otherwise an array of comment nodes with space before and after. + * + * These tokens are not added to the current selector, the caller can add them or use them to amend + * a previous node's space metadata. + * + * In lossy mode, this returns only comments. + */ + ; + + _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { + if (stopPosition < 0) { + stopPosition = this.tokens.length; + } + + var startPosition = this.position; + var nodes = []; + var space = ""; + var lastComment = undefined; + + do { + if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { + if (!this.options.lossy) { + space += this.content(); + } + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { + var spaces = {}; + + if (space) { + spaces.before = space; + space = ""; + } + + lastComment = new _comment["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + spaces: spaces + }); + nodes.push(lastComment); + } + } while (++this.position < stopPosition); + + if (space) { + if (lastComment) { + lastComment.spaces.after = space; + } else if (!this.options.lossy) { + var firstToken = this.tokens[startPosition]; + var lastToken = this.tokens[this.position - 1]; + nodes.push(new _string["default"]({ + value: '', + source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: { + before: space, + after: '' + } + })); + } + } + + return nodes; + } + /** + * + * @param {*} nodes + */ + ; + + _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { + var _this2 = this; + + if (requiredSpace === void 0) { + requiredSpace = false; + } + + var space = ""; + var rawSpace = ""; + nodes.forEach(function (n) { + var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); + + var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); + + space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); + rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); + }); + + if (rawSpace === space) { + rawSpace = undefined; + } + + var result = { + space: space, + rawSpace: rawSpace + }; + return result; + }; + + _proto.isNamedCombinator = function isNamedCombinator(position) { + if (position === void 0) { + position = this.position; + } + + return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash; + }; + + _proto.namedCombinator = function namedCombinator() { + if (this.isNamedCombinator()) { + var nameRaw = this.content(this.tokens[this.position + 1]); + var name = (0, _util.unesc)(nameRaw).toLowerCase(); + var raws = {}; + + if (name !== nameRaw) { + raws.value = "/" + nameRaw + "/"; + } + + var node = new _combinator["default"]({ + value: "/" + name + "/", + source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], + raws: raws + }); + this.position = this.position + 3; + return node; + } else { + this.unexpected(); + } + }; + + _proto.combinator = function combinator() { + var _this3 = this; + + if (this.content() === '|') { + return this.namespace(); + } // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector. + + + var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); + + if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) { + var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + + if (nodes.length > 0) { + var last = this.current.last; + + if (last) { + var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), + space = _this$convertWhitespa.space, + rawSpace = _this$convertWhitespa.rawSpace; + + if (rawSpace !== undefined) { + last.rawSpaceAfter += rawSpace; + } + + last.spaces.after += space; + } else { + nodes.forEach(function (n) { + return _this3.newNode(n); + }); + } + } + + return; + } + + var firstToken = this.currToken; + var spaceOrDescendantSelectorNodes = undefined; + + if (nextSigTokenPos > this.position) { + spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); + } + + var node; + + if (this.isNamedCombinator()) { + node = this.namedCombinator(); + } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { + node = new _combinator["default"]({ + value: this.content(), + source: getTokenSource(this.currToken), + sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] + }); + this.position++; + } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {// pass + } else if (!spaceOrDescendantSelectorNodes) { + this.unexpected(); + } + + if (node) { + if (spaceOrDescendantSelectorNodes) { + var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), + _space = _this$convertWhitespa2.space, + _rawSpace = _this$convertWhitespa2.rawSpace; + + node.spaces.before = _space; + node.rawSpaceBefore = _rawSpace; + } + } else { + // descendant combinator + var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), + _space2 = _this$convertWhitespa3.space, + _rawSpace2 = _this$convertWhitespa3.rawSpace; + + if (!_rawSpace2) { + _rawSpace2 = _space2; + } + + var spaces = {}; + var raws = { + spaces: {} + }; + + if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) { + spaces.before = _space2.slice(0, _space2.length - 1); + raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); + } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) { + spaces.after = _space2.slice(1); + raws.spaces.after = _rawSpace2.slice(1); + } else { + raws.value = _rawSpace2; + } + + node = new _combinator["default"]({ + value: ' ', + source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), + sourceIndex: firstToken[_tokenize.FIELDS.START_POS], + spaces: spaces, + raws: raws + }); + } + + if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { + node.spaces.after = this.optionalSpace(this.content()); + this.position++; + } + + return this.newNode(node); + }; + + _proto.comma = function comma() { + if (this.position === this.tokens.length - 1) { + this.root.trailingComma = true; + this.position++; + return; + } + + this.current._inferEndPosition(); + + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position + 1]) + } + }); + this.current.parent.append(selector); + this.current = selector; + this.position++; + }; + + _proto.comment = function comment() { + var current = this.currToken; + this.newNode(new _comment["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + + _proto.error = function error(message, opts) { + throw this.root.error(message, opts); + }; + + _proto.missingBackslash = function missingBackslash() { + return this.error('Expected a backslash preceding the semicolon.', { + index: this.currToken[_tokenize.FIELDS.START_POS] + }); + }; + + _proto.missingParenthesis = function missingParenthesis() { + return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + }; + + _proto.missingSquareBracket = function missingSquareBracket() { + return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]); + }; + + _proto.unexpected = function unexpected() { + return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); + }; + + _proto.namespace = function namespace() { + var before = this.prevToken && this.content(this.prevToken) || true; + + if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.position++; + return this.word(before); + } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { + this.position++; + return this.universal(before); + } + }; + + _proto.nesting = function nesting() { + if (this.nextToken) { + var nextContent = this.content(this.nextToken); + + if (nextContent === "|") { + this.position++; + return; + } + } + + var current = this.currToken; + this.newNode(new _nesting["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + + _proto.parentheses = function parentheses() { + var last = this.current.last; + var unbalanced = 1; + this.position++; + + if (last && last.type === types.PSEUDO) { + var selector = new _selector["default"]({ + source: { + start: tokenStart(this.tokens[this.position - 1]) + } + }); + var cache = this.current; + last.append(selector); + this.current = selector; + + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + + if (unbalanced) { + this.parse(); + } else { + this.current.source.end = tokenEnd(this.currToken); + this.current.parent.source.end = tokenEnd(this.currToken); + this.position++; + } + } + + this.current = cache; + } else { + // I think this case should be an error. It's used to implement a basic parse of media queries + // but I don't think it's a good idea. + var parenStart = this.currToken; + var parenValue = "("; + var parenEnd; + + while (this.position < this.tokens.length && unbalanced) { + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + unbalanced++; + } + + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + unbalanced--; + } + + parenEnd = this.currToken; + parenValue += this.parseParenthesisToken(this.currToken); + this.position++; + } + + if (last) { + last.appendToPropertyAndEscape("value", parenValue, parenValue); + } else { + this.newNode(new _string["default"]({ + value: parenValue, + source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), + sourceIndex: parenStart[_tokenize.FIELDS.START_POS] + })); + } + } + + if (unbalanced) { + return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + + _proto.pseudo = function pseudo() { + var _this4 = this; + + var pseudoStr = ''; + var startingToken = this.currToken; + + while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { + pseudoStr += this.content(); + this.position++; + } + + if (!this.currToken) { + return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1); + } + + if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { + this.splitWord(false, function (first, length) { + pseudoStr += first; + + _this4.newNode(new _pseudo["default"]({ + value: pseudoStr, + source: getTokenSourceSpan(startingToken, _this4.currToken), + sourceIndex: startingToken[_tokenize.FIELDS.START_POS] + })); + + if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { + _this4.error('Misplaced parenthesis.', { + index: _this4.nextToken[_tokenize.FIELDS.START_POS] + }); + } + }); + } else { + return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]); + } + }; + + _proto.space = function space() { + var content = this.content(); // Handle space before and after the selector + + if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) { + return node.type === 'comment'; + })) { + this.spaces = this.optionalSpace(content); + this.position++; + } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { + this.current.last.spaces.after = this.optionalSpace(content); + this.position++; + } else { + this.combinator(); + } + }; + + _proto.string = function string() { + var current = this.currToken; + this.newNode(new _string["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + })); + this.position++; + }; + + _proto.universal = function universal(namespace) { + var nextToken = this.nextToken; + + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + + var current = this.currToken; + this.newNode(new _universal["default"]({ + value: this.content(), + source: getTokenSource(current), + sourceIndex: current[_tokenize.FIELDS.START_POS] + }), namespace); + this.position++; + }; + + _proto.splitWord = function splitWord(namespace, firstCallback) { + var _this5 = this; + + var nextToken = this.nextToken; + var word = this.content(); + + while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { + this.position++; + var current = this.content(); + word += current; + + if (current.lastIndexOf('\\') === current.length - 1) { + var next = this.nextToken; + + if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { + word += this.requiredSpace(this.content(next)); + this.position++; + } + } + + nextToken = this.nextToken; + } + + var hasClass = indexesOf(word, '.').filter(function (i) { + // Allow escaped dot within class name + var escapedDot = word[i - 1] === '\\'; // Allow decimal numbers percent in @keyframes + + var isKeyframesPercent = /^\d+\.\d+%$/.test(word); + return !escapedDot && !isKeyframesPercent; + }); + var hasId = indexesOf(word, '#').filter(function (i) { + return word[i - 1] !== '\\'; + }); // Eliminate Sass interpolations from the list of id indexes + + var interpolations = indexesOf(word, '#{'); + + if (interpolations.length) { + hasId = hasId.filter(function (hashIndex) { + return !~interpolations.indexOf(hashIndex); + }); + } + + var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); + indices.forEach(function (ind, i) { + var index = indices[i + 1] || word.length; + var value = word.slice(ind, index); + + if (i === 0 && firstCallback) { + return firstCallback.call(_this5, value, indices.length); + } + + var node; + var current = _this5.currToken; + var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i]; + var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1)); + + if (~hasClass.indexOf(ind)) { + var classNameOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _className["default"](unescapeProp(classNameOpts, "value")); + } else if (~hasId.indexOf(ind)) { + var idOpts = { + value: value.slice(1), + source: source, + sourceIndex: sourceIndex + }; + node = new _id["default"](unescapeProp(idOpts, "value")); + } else { + var tagOpts = { + value: value, + source: source, + sourceIndex: sourceIndex + }; + unescapeProp(tagOpts, "value"); + node = new _tag["default"](tagOpts); + } + + _this5.newNode(node, namespace); // Ensure that the namespace is used only once + + + namespace = null; + }); + this.position++; + }; + + _proto.word = function word(namespace) { + var nextToken = this.nextToken; + + if (nextToken && this.content(nextToken) === '|') { + this.position++; + return this.namespace(); + } + + return this.splitWord(namespace); + }; + + _proto.loop = function loop() { + while (this.position < this.tokens.length) { + this.parse(true); + } + + this.current._inferEndPosition(); + + return this.root; + }; + + _proto.parse = function parse(throwOnParenthesis) { + switch (this.currToken[_tokenize.FIELDS.TYPE]) { + case tokens.space: + this.space(); + break; + + case tokens.comment: + this.comment(); + break; + + case tokens.openParenthesis: + this.parentheses(); + break; + + case tokens.closeParenthesis: + if (throwOnParenthesis) { + this.missingParenthesis(); + } + + break; + + case tokens.openSquare: + this.attribute(); + break; + + case tokens.dollar: + case tokens.caret: + case tokens.equals: + case tokens.word: + this.word(); + break; + + case tokens.colon: + this.pseudo(); + break; + + case tokens.comma: + this.comma(); + break; + + case tokens.asterisk: + this.universal(); + break; + + case tokens.ampersand: + this.nesting(); + break; + + case tokens.slash: + case tokens.combinator: + this.combinator(); + break; + + case tokens.str: + this.string(); + break; + // These cases throw; no break needed. + + case tokens.closeSquare: + this.missingSquareBracket(); + + case tokens.semicolon: + this.missingBackslash(); + + default: + this.unexpected(); + } + } + /** + * Helpers + */ + ; + + _proto.expected = function expected(description, index, found) { + if (Array.isArray(description)) { + var last = description.pop(); + description = description.join(', ') + " or " + last; + } + + var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a'; + + if (!found) { + return this.error("Expected " + an + " " + description + ".", { + index: index + }); + } + + return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", { + index: index + }); + }; + + _proto.requiredSpace = function requiredSpace(space) { + return this.options.lossy ? ' ' : space; + }; + + _proto.optionalSpace = function optionalSpace(space) { + return this.options.lossy ? '' : space; + }; + + _proto.lossySpace = function lossySpace(space, required) { + if (this.options.lossy) { + return required ? ' ' : ''; + } else { + return space; + } + }; + + _proto.parseParenthesisToken = function parseParenthesisToken(token) { + var content = this.content(token); + + if (token[_tokenize.FIELDS.TYPE] === tokens.space) { + return this.requiredSpace(content); + } else { + return content; + } + }; + + _proto.newNode = function newNode(node, namespace) { + if (namespace) { + if (/^ +$/.test(namespace)) { + if (!this.options.lossy) { + this.spaces = (this.spaces || '') + namespace; + } + + namespace = true; + } + + node.namespace = namespace; + unescapeProp(node, "namespace"); + } + + if (this.spaces) { + node.spaces.before = this.spaces; + this.spaces = ''; + } + + return this.current.append(node); + }; + + _proto.content = function content(token) { + if (token === void 0) { + token = this.currToken; + } + + return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); + }; + + /** + * returns the index of the next non-whitespace, non-comment token. + * returns -1 if no meaningful token is found. + */ + _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { + if (startPosition === void 0) { + startPosition = this.position + 1; + } + + var searchPosition = startPosition; + + while (searchPosition < this.tokens.length) { + if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { + searchPosition++; + continue; + } else { + return searchPosition; + } + } + + return -1; + }; + + _createClass(Parser, [{ + key: "currToken", + get: function get() { + return this.tokens[this.position]; + } + }, { + key: "nextToken", + get: function get() { + return this.tokens[this.position + 1]; + } + }, { + key: "prevToken", + get: function get() { + return this.tokens[this.position - 1]; + } + }]); + + return Parser; +}(); + +exports["default"] = Parser; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/processor.js b/node_modules/postcss-selector-parser/dist/processor.js new file mode 100644 index 0000000000000..a00170c281f96 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/processor.js @@ -0,0 +1,206 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _parser = _interopRequireDefault(require("./parser")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var Processor = /*#__PURE__*/function () { + function Processor(func, options) { + this.func = func || function noop() {}; + + this.funcRes = null; + this.options = options; + } + + var _proto = Processor.prototype; + + _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) { + if (options === void 0) { + options = {}; + } + + var merged = Object.assign({}, this.options, options); + + if (merged.updateSelector === false) { + return false; + } else { + return typeof rule !== "string"; + } + }; + + _proto._isLossy = function _isLossy(options) { + if (options === void 0) { + options = {}; + } + + var merged = Object.assign({}, this.options, options); + + if (merged.lossless === false) { + return true; + } else { + return false; + } + }; + + _proto._root = function _root(rule, options) { + if (options === void 0) { + options = {}; + } + + var parser = new _parser["default"](rule, this._parseOptions(options)); + return parser.root; + }; + + _proto._parseOptions = function _parseOptions(options) { + return { + lossy: this._isLossy(options) + }; + }; + + _proto._run = function _run(rule, options) { + var _this = this; + + if (options === void 0) { + options = {}; + } + + return new Promise(function (resolve, reject) { + try { + var root = _this._root(rule, options); + + Promise.resolve(_this.func(root)).then(function (transform) { + var string = undefined; + + if (_this._shouldUpdateSelector(rule, options)) { + string = root.toString(); + rule.selector = string; + } + + return { + transform: transform, + root: root, + string: string + }; + }).then(resolve, reject); + } catch (e) { + reject(e); + return; + } + }); + }; + + _proto._runSync = function _runSync(rule, options) { + if (options === void 0) { + options = {}; + } + + var root = this._root(rule, options); + + var transform = this.func(root); + + if (transform && typeof transform.then === "function") { + throw new Error("Selector processor returned a promise to a synchronous call."); + } + + var string = undefined; + + if (options.updateSelector && typeof rule !== "string") { + string = root.toString(); + rule.selector = string; + } + + return { + transform: transform, + root: root, + string: string + }; + } + /** + * Process rule into a selector AST. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise} The AST of the selector after processing it. + */ + ; + + _proto.ast = function ast(rule, options) { + return this._run(rule, options).then(function (result) { + return result.root; + }); + } + /** + * Process rule into a selector AST synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {parser.Root} The AST of the selector after processing it. + */ + ; + + _proto.astSync = function astSync(rule, options) { + return this._runSync(rule, options).root; + } + /** + * Process a selector into a transformed value asynchronously + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {Promise} The value returned by the processor. + */ + ; + + _proto.transform = function transform(rule, options) { + return this._run(rule, options).then(function (result) { + return result.transform; + }); + } + /** + * Process a selector into a transformed value synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {any} The value returned by the processor. + */ + ; + + _proto.transformSync = function transformSync(rule, options) { + return this._runSync(rule, options).transform; + } + /** + * Process a selector into a new selector string asynchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */ + ; + + _proto.process = function process(rule, options) { + return this._run(rule, options).then(function (result) { + return result.string || result.root.toString(); + }); + } + /** + * Process a selector into a new selector string synchronously. + * + * @param rule {postcss.Rule | string} The css selector to be processed + * @param options The options for processing + * @returns {string} the selector after processing. + */ + ; + + _proto.processSync = function processSync(rule, options) { + var result = this._runSync(rule, options); + + return result.string || result.root.toString(); + }; + + return Processor; +}(); + +exports["default"] = Processor; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/attribute.js b/node_modules/postcss-selector-parser/dist/selectors/attribute.js new file mode 100644 index 0000000000000..8f535e5d73129 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/attribute.js @@ -0,0 +1,515 @@ +"use strict"; + +exports.__esModule = true; +exports.unescapeValue = unescapeValue; +exports["default"] = void 0; + +var _cssesc = _interopRequireDefault(require("cssesc")); + +var _unesc = _interopRequireDefault(require("../util/unesc")); + +var _namespace = _interopRequireDefault(require("./namespace")); + +var _types = require("./types"); + +var _CSSESC_QUOTE_OPTIONS; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var deprecate = require("util-deprecate"); + +var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; +var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead."); +var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); +var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); + +function unescapeValue(value) { + var deprecatedUsage = false; + var quoteMark = null; + var unescaped = value; + var m = unescaped.match(WRAPPED_IN_QUOTES); + + if (m) { + quoteMark = m[1]; + unescaped = m[2]; + } + + unescaped = (0, _unesc["default"])(unescaped); + + if (unescaped !== value) { + deprecatedUsage = true; + } + + return { + deprecatedUsage: deprecatedUsage, + unescaped: unescaped, + quoteMark: quoteMark + }; +} + +function handleDeprecatedContructorOpts(opts) { + if (opts.quoteMark !== undefined) { + return opts; + } + + if (opts.value === undefined) { + return opts; + } + + warnOfDeprecatedConstructor(); + + var _unescapeValue = unescapeValue(opts.value), + quoteMark = _unescapeValue.quoteMark, + unescaped = _unescapeValue.unescaped; + + if (!opts.raws) { + opts.raws = {}; + } + + if (opts.raws.value === undefined) { + opts.raws.value = opts.value; + } + + opts.value = unescaped; + opts.quoteMark = quoteMark; + return opts; +} + +var Attribute = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Attribute, _Namespace); + + function Attribute(opts) { + var _this; + + if (opts === void 0) { + opts = {}; + } + + _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; + _this.type = _types.ATTRIBUTE; + _this.raws = _this.raws || {}; + Object.defineProperty(_this.raws, 'unquoted', { + get: deprecate(function () { + return _this.value; + }, "attr.raws.unquoted is deprecated. Call attr.value instead."), + set: deprecate(function () { + return _this.value; + }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") + }); + _this._constructed = true; + return _this; + } + /** + * Returns the Attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute. + * + * You can also change the quotation used for the current value by setting quoteMark. + * + * Options: + * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this + * option is not set, the original value for quoteMark will be used. If + * indeterminate, a double quote is used. The legal values are: + * * `null` - the value will be unquoted and characters will be escaped as necessary. + * * `'` - the value will be quoted with a single quote and single quotes are escaped. + * * `"` - the value will be quoted with a double quote and double quotes are escaped. + * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark + * over the quoteMark option value. + * * smart {boolean} - if true, will select a quote mark based on the value + * and the other options specified here. See the `smartQuoteMark()` + * method. + **/ + + + var _proto = Attribute.prototype; + + _proto.getQuotedValue = function getQuotedValue(options) { + if (options === void 0) { + options = {}; + } + + var quoteMark = this._determineQuoteMark(options); + + var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; + var escaped = (0, _cssesc["default"])(this._value, cssescopts); + return escaped; + }; + + _proto._determineQuoteMark = function _determineQuoteMark(options) { + return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); + } + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + */ + ; + + _proto.setValue = function setValue(value, options) { + if (options === void 0) { + options = {}; + } + + this._value = value; + this._quoteMark = this._determineQuoteMark(options); + + this._syncRawValue(); + } + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + * + * @param options This takes the quoteMark and preferCurrentQuoteMark options + * from the quoteValue method. + */ + ; + + _proto.smartQuoteMark = function smartQuoteMark(options) { + var v = this.value; + var numSingleQuotes = v.replace(/[^']/g, '').length; + var numDoubleQuotes = v.replace(/[^"]/g, '').length; + + if (numSingleQuotes + numDoubleQuotes === 0) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + + if (escaped === v) { + return Attribute.NO_QUOTE; + } else { + var pref = this.preferredQuoteMark(options); + + if (pref === Attribute.NO_QUOTE) { + // pick a quote mark that isn't none and see if it's smaller + var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE; + var opts = CSSESC_QUOTE_OPTIONS[quote]; + var quoteValue = (0, _cssesc["default"])(v, opts); + + if (quoteValue.length < escaped.length) { + return quote; + } + } + + return pref; + } + } else if (numDoubleQuotes === numSingleQuotes) { + return this.preferredQuoteMark(options); + } else if (numDoubleQuotes < numSingleQuotes) { + return Attribute.DOUBLE_QUOTE; + } else { + return Attribute.SINGLE_QUOTE; + } + } + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */ + ; + + _proto.preferredQuoteMark = function preferredQuoteMark(options) { + var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; + + if (quoteMark === undefined) { + quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; + } + + if (quoteMark === undefined) { + quoteMark = Attribute.DOUBLE_QUOTE; + } + + return quoteMark; + }; + + _proto._syncRawValue = function _syncRawValue() { + var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); + + if (rawValue === this._value) { + if (this.raws) { + delete this.raws.value; + } + } else { + this.raws.value = rawValue; + } + }; + + _proto._handleEscapes = function _handleEscapes(prop, value) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(value, { + isIdentifier: true + }); + + if (escaped !== value) { + this.raws[prop] = escaped; + } else { + delete this.raws[prop]; + } + } + }; + + _proto._spacesFor = function _spacesFor(name) { + var attrSpaces = { + before: '', + after: '' + }; + var spaces = this.spaces[name] || {}; + var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; + return Object.assign(attrSpaces, spaces, rawSpaces); + }; + + _proto._stringFor = function _stringFor(name, spaceName, concat) { + if (spaceName === void 0) { + spaceName = name; + } + + if (concat === void 0) { + concat = defaultAttrConcat; + } + + var attrSpaces = this._spacesFor(spaceName); + + return concat(this.stringifyProperty(name), attrSpaces); + } + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */ + ; + + _proto.offsetOf = function offsetOf(name) { + var count = 1; + + var attributeSpaces = this._spacesFor("attribute"); + + count += attributeSpaces.before.length; + + if (name === "namespace" || name === "ns") { + return this.namespace ? count : -1; + } + + if (name === "attributeNS") { + return count; + } + + count += this.namespaceString.length; + + if (this.namespace) { + count += 1; + } + + if (name === "attribute") { + return count; + } + + count += this.stringifyProperty("attribute").length; + count += attributeSpaces.after.length; + + var operatorSpaces = this._spacesFor("operator"); + + count += operatorSpaces.before.length; + var operator = this.stringifyProperty("operator"); + + if (name === "operator") { + return operator ? count : -1; + } + + count += operator.length; + count += operatorSpaces.after.length; + + var valueSpaces = this._spacesFor("value"); + + count += valueSpaces.before.length; + var value = this.stringifyProperty("value"); + + if (name === "value") { + return value ? count : -1; + } + + count += value.length; + count += valueSpaces.after.length; + + var insensitiveSpaces = this._spacesFor("insensitive"); + + count += insensitiveSpaces.before.length; + + if (name === "insensitive") { + return this.insensitive ? count : -1; + } + + return -1; + }; + + _proto.toString = function toString() { + var _this2 = this; + + var selector = [this.rawSpaceBefore, '[']; + selector.push(this._stringFor('qualifiedAttribute', 'attribute')); + + if (this.operator && (this.value || this.value === '')) { + selector.push(this._stringFor('operator')); + selector.push(this._stringFor('value')); + selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) { + if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { + attrSpaces.before = " "; + } + + return defaultAttrConcat(attrValue, attrSpaces); + })); + } + + selector.push(']'); + selector.push(this.rawSpaceAfter); + return selector.join(''); + }; + + _createClass(Attribute, [{ + key: "quoted", + get: function get() { + var qm = this.quoteMark; + return qm === "'" || qm === '"'; + }, + set: function set(value) { + warnOfDeprecatedQuotedAssignment(); + } + /** + * returns a single (`'`) or double (`"`) quote character if the value is quoted. + * returns `null` if the value is not quoted. + * returns `undefined` if the quotation state is unknown (this can happen when + * the attribute is constructed without specifying a quote mark.) + */ + + }, { + key: "quoteMark", + get: function get() { + return this._quoteMark; + } + /** + * Set the quote mark to be used by this attribute's value. + * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute + * value is updated accordingly. + * + * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted. + */ + , + set: function set(quoteMark) { + if (!this._constructed) { + this._quoteMark = quoteMark; + return; + } + + if (this._quoteMark !== quoteMark) { + this._quoteMark = quoteMark; + + this._syncRawValue(); + } + } + }, { + key: "qualifiedAttribute", + get: function get() { + return this.qualifiedName(this.raws.attribute || this.attribute); + } + }, { + key: "insensitiveFlag", + get: function get() { + return this.insensitive ? 'i' : ''; + } + }, { + key: "value", + get: function get() { + return this._value; + } + /** + * Before 3.0, the value had to be set to an escaped value including any wrapped + * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value + * is unescaped during parsing and any quote marks are removed. + * + * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, + * a deprecation warning is raised when the new value contains any characters that would + * require escaping (including if it contains wrapped quotes). + * + * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe + * how the new value is quoted. + */ + , + set: function set(v) { + if (this._constructed) { + var _unescapeValue2 = unescapeValue(v), + deprecatedUsage = _unescapeValue2.deprecatedUsage, + unescaped = _unescapeValue2.unescaped, + quoteMark = _unescapeValue2.quoteMark; + + if (deprecatedUsage) { + warnOfDeprecatedValueAssignment(); + } + + if (unescaped === this._value && quoteMark === this._quoteMark) { + return; + } + + this._value = unescaped; + this._quoteMark = quoteMark; + + this._syncRawValue(); + } else { + this._value = v; + } + } + }, { + key: "attribute", + get: function get() { + return this._attribute; + }, + set: function set(name) { + this._handleEscapes("attribute", name); + + this._attribute = name; + } + }]); + + return Attribute; +}(_namespace["default"]); + +exports["default"] = Attribute; +Attribute.NO_QUOTE = null; +Attribute.SINGLE_QUOTE = "'"; +Attribute.DOUBLE_QUOTE = '"'; +var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { + "'": { + quotes: 'single', + wrap: true + }, + '"': { + quotes: 'double', + wrap: true + } +}, _CSSESC_QUOTE_OPTIONS[null] = { + isIdentifier: true +}, _CSSESC_QUOTE_OPTIONS); + +function defaultAttrConcat(attrValue, attrSpaces) { + return "" + attrSpaces.before + attrValue + attrSpaces.after; +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/className.js b/node_modules/postcss-selector-parser/dist/selectors/className.js new file mode 100644 index 0000000000000..22409914cf728 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/className.js @@ -0,0 +1,69 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _cssesc = _interopRequireDefault(require("cssesc")); + +var _util = require("../util"); + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var ClassName = /*#__PURE__*/function (_Node) { + _inheritsLoose(ClassName, _Node); + + function ClassName(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.CLASS; + _this._constructed = true; + return _this; + } + + var _proto = ClassName.prototype; + + _proto.valueToString = function valueToString() { + return '.' + _Node.prototype.valueToString.call(this); + }; + + _createClass(ClassName, [{ + key: "value", + get: function get() { + return this._value; + }, + set: function set(v) { + if (this._constructed) { + var escaped = (0, _cssesc["default"])(v, { + isIdentifier: true + }); + + if (escaped !== v) { + (0, _util.ensureObject)(this, "raws"); + this.raws.value = escaped; + } else if (this.raws) { + delete this.raws.value; + } + } + + this._value = v; + } + }]); + + return ClassName; +}(_node["default"]); + +exports["default"] = ClassName; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/combinator.js b/node_modules/postcss-selector-parser/dist/selectors/combinator.js new file mode 100644 index 0000000000000..271ab4d3b1f44 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/combinator.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Combinator = /*#__PURE__*/function (_Node) { + _inheritsLoose(Combinator, _Node); + + function Combinator(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.COMBINATOR; + return _this; + } + + return Combinator; +}(_node["default"]); + +exports["default"] = Combinator; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/comment.js b/node_modules/postcss-selector-parser/dist/selectors/comment.js new file mode 100644 index 0000000000000..e778094e110c2 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/comment.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Comment = /*#__PURE__*/function (_Node) { + _inheritsLoose(Comment, _Node); + + function Comment(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.COMMENT; + return _this; + } + + return Comment; +}(_node["default"]); + +exports["default"] = Comment; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/constructors.js b/node_modules/postcss-selector-parser/dist/selectors/constructors.js new file mode 100644 index 0000000000000..078023eb28f2d --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/constructors.js @@ -0,0 +1,102 @@ +"use strict"; + +exports.__esModule = true; +exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; + +var _attribute = _interopRequireDefault(require("./attribute")); + +var _className = _interopRequireDefault(require("./className")); + +var _combinator = _interopRequireDefault(require("./combinator")); + +var _comment = _interopRequireDefault(require("./comment")); + +var _id = _interopRequireDefault(require("./id")); + +var _nesting = _interopRequireDefault(require("./nesting")); + +var _pseudo = _interopRequireDefault(require("./pseudo")); + +var _root = _interopRequireDefault(require("./root")); + +var _selector = _interopRequireDefault(require("./selector")); + +var _string = _interopRequireDefault(require("./string")); + +var _tag = _interopRequireDefault(require("./tag")); + +var _universal = _interopRequireDefault(require("./universal")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var attribute = function attribute(opts) { + return new _attribute["default"](opts); +}; + +exports.attribute = attribute; + +var className = function className(opts) { + return new _className["default"](opts); +}; + +exports.className = className; + +var combinator = function combinator(opts) { + return new _combinator["default"](opts); +}; + +exports.combinator = combinator; + +var comment = function comment(opts) { + return new _comment["default"](opts); +}; + +exports.comment = comment; + +var id = function id(opts) { + return new _id["default"](opts); +}; + +exports.id = id; + +var nesting = function nesting(opts) { + return new _nesting["default"](opts); +}; + +exports.nesting = nesting; + +var pseudo = function pseudo(opts) { + return new _pseudo["default"](opts); +}; + +exports.pseudo = pseudo; + +var root = function root(opts) { + return new _root["default"](opts); +}; + +exports.root = root; + +var selector = function selector(opts) { + return new _selector["default"](opts); +}; + +exports.selector = selector; + +var string = function string(opts) { + return new _string["default"](opts); +}; + +exports.string = string; + +var tag = function tag(opts) { + return new _tag["default"](opts); +}; + +exports.tag = tag; + +var universal = function universal(opts) { + return new _universal["default"](opts); +}; + +exports.universal = universal; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/container.js b/node_modules/postcss-selector-parser/dist/selectors/container.js new file mode 100644 index 0000000000000..2626fb85bba85 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/container.js @@ -0,0 +1,395 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var types = _interopRequireWildcard(require("./types")); + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Container = /*#__PURE__*/function (_Node) { + _inheritsLoose(Container, _Node); + + function Container(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + + if (!_this.nodes) { + _this.nodes = []; + } + + return _this; + } + + var _proto = Container.prototype; + + _proto.append = function append(selector) { + selector.parent = this; + this.nodes.push(selector); + return this; + }; + + _proto.prepend = function prepend(selector) { + selector.parent = this; + this.nodes.unshift(selector); + return this; + }; + + _proto.at = function at(index) { + return this.nodes[index]; + }; + + _proto.index = function index(child) { + if (typeof child === 'number') { + return child; + } + + return this.nodes.indexOf(child); + }; + + _proto.removeChild = function removeChild(child) { + child = this.index(child); + this.at(child).parent = undefined; + this.nodes.splice(child, 1); + var index; + + for (var id in this.indexes) { + index = this.indexes[id]; + + if (index >= child) { + this.indexes[id] = index - 1; + } + } + + return this; + }; + + _proto.removeAll = function removeAll() { + for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) { + var node = _step.value; + node.parent = undefined; + } + + this.nodes = []; + return this; + }; + + _proto.empty = function empty() { + return this.removeAll(); + }; + + _proto.insertAfter = function insertAfter(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex + 1, 0, newNode); + newNode.parent = this; + var index; + + for (var id in this.indexes) { + index = this.indexes[id]; + + if (oldIndex <= index) { + this.indexes[id] = index + 1; + } + } + + return this; + }; + + _proto.insertBefore = function insertBefore(oldNode, newNode) { + newNode.parent = this; + var oldIndex = this.index(oldNode); + this.nodes.splice(oldIndex, 0, newNode); + newNode.parent = this; + var index; + + for (var id in this.indexes) { + index = this.indexes[id]; + + if (index <= oldIndex) { + this.indexes[id] = index + 1; + } + } + + return this; + }; + + _proto._findChildAtPosition = function _findChildAtPosition(line, col) { + var found = undefined; + this.each(function (node) { + if (node.atPosition) { + var foundChild = node.atPosition(line, col); + + if (foundChild) { + found = foundChild; + return false; + } + } else if (node.isAtPosition(line, col)) { + found = node; + return false; + } + }); + return found; + } + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param {number} line The line number of the node to find. (1-based index) + * @param {number} col The column number of the node to find. (1-based index) + */ + ; + + _proto.atPosition = function atPosition(line, col) { + if (this.isAtPosition(line, col)) { + return this._findChildAtPosition(line, col) || this; + } else { + return undefined; + } + }; + + _proto._inferEndPosition = function _inferEndPosition() { + if (this.last && this.last.source && this.last.source.end) { + this.source = this.source || {}; + this.source.end = this.source.end || {}; + Object.assign(this.source.end, this.last.source.end); + } + }; + + _proto.each = function each(callback) { + if (!this.lastEach) { + this.lastEach = 0; + } + + if (!this.indexes) { + this.indexes = {}; + } + + this.lastEach++; + var id = this.lastEach; + this.indexes[id] = 0; + + if (!this.length) { + return undefined; + } + + var index, result; + + while (this.indexes[id] < this.length) { + index = this.indexes[id]; + result = callback(this.at(index), index); + + if (result === false) { + break; + } + + this.indexes[id] += 1; + } + + delete this.indexes[id]; + + if (result === false) { + return false; + } + }; + + _proto.walk = function walk(callback) { + return this.each(function (node, i) { + var result = callback(node, i); + + if (result !== false && node.length) { + result = node.walk(callback); + } + + if (result === false) { + return false; + } + }); + }; + + _proto.walkAttributes = function walkAttributes(callback) { + var _this2 = this; + + return this.walk(function (selector) { + if (selector.type === types.ATTRIBUTE) { + return callback.call(_this2, selector); + } + }); + }; + + _proto.walkClasses = function walkClasses(callback) { + var _this3 = this; + + return this.walk(function (selector) { + if (selector.type === types.CLASS) { + return callback.call(_this3, selector); + } + }); + }; + + _proto.walkCombinators = function walkCombinators(callback) { + var _this4 = this; + + return this.walk(function (selector) { + if (selector.type === types.COMBINATOR) { + return callback.call(_this4, selector); + } + }); + }; + + _proto.walkComments = function walkComments(callback) { + var _this5 = this; + + return this.walk(function (selector) { + if (selector.type === types.COMMENT) { + return callback.call(_this5, selector); + } + }); + }; + + _proto.walkIds = function walkIds(callback) { + var _this6 = this; + + return this.walk(function (selector) { + if (selector.type === types.ID) { + return callback.call(_this6, selector); + } + }); + }; + + _proto.walkNesting = function walkNesting(callback) { + var _this7 = this; + + return this.walk(function (selector) { + if (selector.type === types.NESTING) { + return callback.call(_this7, selector); + } + }); + }; + + _proto.walkPseudos = function walkPseudos(callback) { + var _this8 = this; + + return this.walk(function (selector) { + if (selector.type === types.PSEUDO) { + return callback.call(_this8, selector); + } + }); + }; + + _proto.walkTags = function walkTags(callback) { + var _this9 = this; + + return this.walk(function (selector) { + if (selector.type === types.TAG) { + return callback.call(_this9, selector); + } + }); + }; + + _proto.walkUniversals = function walkUniversals(callback) { + var _this10 = this; + + return this.walk(function (selector) { + if (selector.type === types.UNIVERSAL) { + return callback.call(_this10, selector); + } + }); + }; + + _proto.split = function split(callback) { + var _this11 = this; + + var current = []; + return this.reduce(function (memo, node, index) { + var split = callback.call(_this11, node); + current.push(node); + + if (split) { + memo.push(current); + current = []; + } else if (index === _this11.length - 1) { + memo.push(current); + } + + return memo; + }, []); + }; + + _proto.map = function map(callback) { + return this.nodes.map(callback); + }; + + _proto.reduce = function reduce(callback, memo) { + return this.nodes.reduce(callback, memo); + }; + + _proto.every = function every(callback) { + return this.nodes.every(callback); + }; + + _proto.some = function some(callback) { + return this.nodes.some(callback); + }; + + _proto.filter = function filter(callback) { + return this.nodes.filter(callback); + }; + + _proto.sort = function sort(callback) { + return this.nodes.sort(callback); + }; + + _proto.toString = function toString() { + return this.map(String).join(''); + }; + + _createClass(Container, [{ + key: "first", + get: function get() { + return this.at(0); + } + }, { + key: "last", + get: function get() { + return this.at(this.length - 1); + } + }, { + key: "length", + get: function get() { + return this.nodes.length; + } + }]); + + return Container; +}(_node["default"]); + +exports["default"] = Container; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/guards.js b/node_modules/postcss-selector-parser/dist/selectors/guards.js new file mode 100644 index 0000000000000..c949af57eb1fd --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/guards.js @@ -0,0 +1,64 @@ +"use strict"; + +exports.__esModule = true; +exports.isNode = isNode; +exports.isPseudoElement = isPseudoElement; +exports.isPseudoClass = isPseudoClass; +exports.isContainer = isContainer; +exports.isNamespace = isNamespace; +exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; + +var _types = require("./types"); + +var _IS_TYPE; + +var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); + +function isNode(node) { + return typeof node === "object" && IS_TYPE[node.type]; +} + +function isNodeType(type, node) { + return isNode(node) && node.type === type; +} + +var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); +exports.isAttribute = isAttribute; +var isClassName = isNodeType.bind(null, _types.CLASS); +exports.isClassName = isClassName; +var isCombinator = isNodeType.bind(null, _types.COMBINATOR); +exports.isCombinator = isCombinator; +var isComment = isNodeType.bind(null, _types.COMMENT); +exports.isComment = isComment; +var isIdentifier = isNodeType.bind(null, _types.ID); +exports.isIdentifier = isIdentifier; +var isNesting = isNodeType.bind(null, _types.NESTING); +exports.isNesting = isNesting; +var isPseudo = isNodeType.bind(null, _types.PSEUDO); +exports.isPseudo = isPseudo; +var isRoot = isNodeType.bind(null, _types.ROOT); +exports.isRoot = isRoot; +var isSelector = isNodeType.bind(null, _types.SELECTOR); +exports.isSelector = isSelector; +var isString = isNodeType.bind(null, _types.STRING); +exports.isString = isString; +var isTag = isNodeType.bind(null, _types.TAG); +exports.isTag = isTag; +var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); +exports.isUniversal = isUniversal; + +function isPseudoElement(node) { + return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); +} + +function isPseudoClass(node) { + return isPseudo(node) && !isPseudoElement(node); +} + +function isContainer(node) { + return !!(isNode(node) && node.walk); +} + +function isNamespace(node) { + return isAttribute(node) || isTag(node); +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/id.js b/node_modules/postcss-selector-parser/dist/selectors/id.js new file mode 100644 index 0000000000000..4e83147e3c4ef --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/id.js @@ -0,0 +1,37 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var ID = /*#__PURE__*/function (_Node) { + _inheritsLoose(ID, _Node); + + function ID(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.ID; + return _this; + } + + var _proto = ID.prototype; + + _proto.valueToString = function valueToString() { + return '#' + _Node.prototype.valueToString.call(this); + }; + + return ID; +}(_node["default"]); + +exports["default"] = ID; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/index.js b/node_modules/postcss-selector-parser/dist/selectors/index.js new file mode 100644 index 0000000000000..1fe9b138a5a26 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/index.js @@ -0,0 +1,27 @@ +"use strict"; + +exports.__esModule = true; + +var _types = require("./types"); + +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + exports[key] = _types[key]; +}); + +var _constructors = require("./constructors"); + +Object.keys(_constructors).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _constructors[key]) return; + exports[key] = _constructors[key]; +}); + +var _guards = require("./guards"); + +Object.keys(_guards).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _guards[key]) return; + exports[key] = _guards[key]; +}); \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/namespace.js b/node_modules/postcss-selector-parser/dist/selectors/namespace.js new file mode 100644 index 0000000000000..fd6c729e16661 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/namespace.js @@ -0,0 +1,101 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _cssesc = _interopRequireDefault(require("cssesc")); + +var _util = require("../util"); + +var _node = _interopRequireDefault(require("./node")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Namespace = /*#__PURE__*/function (_Node) { + _inheritsLoose(Namespace, _Node); + + function Namespace() { + return _Node.apply(this, arguments) || this; + } + + var _proto = Namespace.prototype; + + _proto.qualifiedName = function qualifiedName(value) { + if (this.namespace) { + return this.namespaceString + "|" + value; + } else { + return value; + } + }; + + _proto.valueToString = function valueToString() { + return this.qualifiedName(_Node.prototype.valueToString.call(this)); + }; + + _createClass(Namespace, [{ + key: "namespace", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + if (namespace === true || namespace === "*" || namespace === "&") { + this._namespace = namespace; + + if (this.raws) { + delete this.raws.namespace; + } + + return; + } + + var escaped = (0, _cssesc["default"])(namespace, { + isIdentifier: true + }); + this._namespace = namespace; + + if (escaped !== namespace) { + (0, _util.ensureObject)(this, "raws"); + this.raws.namespace = escaped; + } else if (this.raws) { + delete this.raws.namespace; + } + } + }, { + key: "ns", + get: function get() { + return this._namespace; + }, + set: function set(namespace) { + this.namespace = namespace; + } + }, { + key: "namespaceString", + get: function get() { + if (this.namespace) { + var ns = this.stringifyProperty("namespace"); + + if (ns === true) { + return ''; + } else { + return ns; + } + } else { + return ''; + } + } + }]); + + return Namespace; +}(_node["default"]); + +exports["default"] = Namespace; +; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/nesting.js b/node_modules/postcss-selector-parser/dist/selectors/nesting.js new file mode 100644 index 0000000000000..3288c78f2dddb --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/nesting.js @@ -0,0 +1,32 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Nesting = /*#__PURE__*/function (_Node) { + _inheritsLoose(Nesting, _Node); + + function Nesting(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.NESTING; + _this.value = '&'; + return _this; + } + + return Nesting; +}(_node["default"]); + +exports["default"] = Nesting; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/node.js b/node_modules/postcss-selector-parser/dist/selectors/node.js new file mode 100644 index 0000000000000..e8eca11c70ecf --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/node.js @@ -0,0 +1,239 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _util = require("../util"); + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var cloneNode = function cloneNode(obj, parent) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var cloned = new obj.constructor(); + + for (var i in obj) { + if (!obj.hasOwnProperty(i)) { + continue; + } + + var value = obj[i]; + var type = typeof value; + + if (i === 'parent' && type === 'object') { + if (parent) { + cloned[i] = parent; + } + } else if (value instanceof Array) { + cloned[i] = value.map(function (j) { + return cloneNode(j, cloned); + }); + } else { + cloned[i] = cloneNode(value, cloned); + } + } + + return cloned; +}; + +var Node = /*#__PURE__*/function () { + function Node(opts) { + if (opts === void 0) { + opts = {}; + } + + Object.assign(this, opts); + this.spaces = this.spaces || {}; + this.spaces.before = this.spaces.before || ''; + this.spaces.after = this.spaces.after || ''; + } + + var _proto = Node.prototype; + + _proto.remove = function remove() { + if (this.parent) { + this.parent.removeChild(this); + } + + this.parent = undefined; + return this; + }; + + _proto.replaceWith = function replaceWith() { + if (this.parent) { + for (var index in arguments) { + this.parent.insertBefore(this, arguments[index]); + } + + this.remove(); + } + + return this; + }; + + _proto.next = function next() { + return this.parent.at(this.parent.index(this) + 1); + }; + + _proto.prev = function prev() { + return this.parent.at(this.parent.index(this) - 1); + }; + + _proto.clone = function clone(overrides) { + if (overrides === void 0) { + overrides = {}; + } + + var cloned = cloneNode(this); + + for (var name in overrides) { + cloned[name] = overrides[name]; + } + + return cloned; + } + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */ + ; + + _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + + var originalValue = this[name]; + var originalEscaped = this.raws[name]; + this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first. + + if (originalEscaped || valueEscaped !== value) { + this.raws[name] = (originalEscaped || originalValue) + valueEscaped; + } else { + delete this.raws[name]; // delete any escaped value that was created by the setter. + } + } + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows the escaped value to be specified directly, allowing illegal + * characters to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped the escaped value of the property. + */ + ; + + _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) { + if (!this.raws) { + this.raws = {}; + } + + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + + this.raws[name] = valueEscaped; + } + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param {string} name the property to set. + * @param {any} value The value that is both escaped and unescaped. + */ + ; + + _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) { + this[name] = value; // this may trigger a setter that updates raws, so it has to be set first. + + if (this.raws) { + delete this.raws[name]; + } + } + /** + * + * @param {number} line The number (starting with 1) + * @param {number} column The column number (starting with 1) + */ + ; + + _proto.isAtPosition = function isAtPosition(line, column) { + if (this.source && this.source.start && this.source.end) { + if (this.source.start.line > line) { + return false; + } + + if (this.source.end.line < line) { + return false; + } + + if (this.source.start.line === line && this.source.start.column > column) { + return false; + } + + if (this.source.end.line === line && this.source.end.column < column) { + return false; + } + + return true; + } + + return undefined; + }; + + _proto.stringifyProperty = function stringifyProperty(name) { + return this.raws && this.raws[name] || this[name]; + }; + + _proto.valueToString = function valueToString() { + return String(this.stringifyProperty("value")); + }; + + _proto.toString = function toString() { + return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(''); + }; + + _createClass(Node, [{ + key: "rawSpaceBefore", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; + + if (rawSpace === undefined) { + rawSpace = this.spaces && this.spaces.before; + } + + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.before = raw; + } + }, { + key: "rawSpaceAfter", + get: function get() { + var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; + + if (rawSpace === undefined) { + rawSpace = this.spaces.after; + } + + return rawSpace || ""; + }, + set: function set(raw) { + (0, _util.ensureObject)(this, "raws", "spaces"); + this.raws.spaces.after = raw; + } + }]); + + return Node; +}(); + +exports["default"] = Node; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/pseudo.js b/node_modules/postcss-selector-parser/dist/selectors/pseudo.js new file mode 100644 index 0000000000000..a0e7bca170a76 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/pseudo.js @@ -0,0 +1,38 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _container = _interopRequireDefault(require("./container")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Pseudo = /*#__PURE__*/function (_Container) { + _inheritsLoose(Pseudo, _Container); + + function Pseudo(opts) { + var _this; + + _this = _Container.call(this, opts) || this; + _this.type = _types.PSEUDO; + return _this; + } + + var _proto = Pseudo.prototype; + + _proto.toString = function toString() { + var params = this.length ? '(' + this.map(String).join(',') + ')' : ''; + return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(''); + }; + + return Pseudo; +}(_container["default"]); + +exports["default"] = Pseudo; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/root.js b/node_modules/postcss-selector-parser/dist/selectors/root.js new file mode 100644 index 0000000000000..be5c2ccb2dac8 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/root.js @@ -0,0 +1,60 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _container = _interopRequireDefault(require("./container")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Root = /*#__PURE__*/function (_Container) { + _inheritsLoose(Root, _Container); + + function Root(opts) { + var _this; + + _this = _Container.call(this, opts) || this; + _this.type = _types.ROOT; + return _this; + } + + var _proto = Root.prototype; + + _proto.toString = function toString() { + var str = this.reduce(function (memo, selector) { + memo.push(String(selector)); + return memo; + }, []).join(','); + return this.trailingComma ? str + ',' : str; + }; + + _proto.error = function error(message, options) { + if (this._error) { + return this._error(message, options); + } else { + return new Error(message); + } + }; + + _createClass(Root, [{ + key: "errorGenerator", + set: function set(handler) { + this._error = handler; + } + }]); + + return Root; +}(_container["default"]); + +exports["default"] = Root; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/selector.js b/node_modules/postcss-selector-parser/dist/selectors/selector.js new file mode 100644 index 0000000000000..699eeb6e546f9 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/selector.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _container = _interopRequireDefault(require("./container")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Selector = /*#__PURE__*/function (_Container) { + _inheritsLoose(Selector, _Container); + + function Selector(opts) { + var _this; + + _this = _Container.call(this, opts) || this; + _this.type = _types.SELECTOR; + return _this; + } + + return Selector; +}(_container["default"]); + +exports["default"] = Selector; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/string.js b/node_modules/postcss-selector-parser/dist/selectors/string.js new file mode 100644 index 0000000000000..e61df30c74a0a --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/string.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _node = _interopRequireDefault(require("./node")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var String = /*#__PURE__*/function (_Node) { + _inheritsLoose(String, _Node); + + function String(opts) { + var _this; + + _this = _Node.call(this, opts) || this; + _this.type = _types.STRING; + return _this; + } + + return String; +}(_node["default"]); + +exports["default"] = String; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/tag.js b/node_modules/postcss-selector-parser/dist/selectors/tag.js new file mode 100644 index 0000000000000..e298db15fafd1 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/tag.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _namespace = _interopRequireDefault(require("./namespace")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Tag = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Tag, _Namespace); + + function Tag(opts) { + var _this; + + _this = _Namespace.call(this, opts) || this; + _this.type = _types.TAG; + return _this; + } + + return Tag; +}(_namespace["default"]); + +exports["default"] = Tag; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/types.js b/node_modules/postcss-selector-parser/dist/selectors/types.js new file mode 100644 index 0000000000000..ab897b8ce5c12 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/types.js @@ -0,0 +1,28 @@ +"use strict"; + +exports.__esModule = true; +exports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0; +var TAG = 'tag'; +exports.TAG = TAG; +var STRING = 'string'; +exports.STRING = STRING; +var SELECTOR = 'selector'; +exports.SELECTOR = SELECTOR; +var ROOT = 'root'; +exports.ROOT = ROOT; +var PSEUDO = 'pseudo'; +exports.PSEUDO = PSEUDO; +var NESTING = 'nesting'; +exports.NESTING = NESTING; +var ID = 'id'; +exports.ID = ID; +var COMMENT = 'comment'; +exports.COMMENT = COMMENT; +var COMBINATOR = 'combinator'; +exports.COMBINATOR = COMBINATOR; +var CLASS = 'class'; +exports.CLASS = CLASS; +var ATTRIBUTE = 'attribute'; +exports.ATTRIBUTE = ATTRIBUTE; +var UNIVERSAL = 'universal'; +exports.UNIVERSAL = UNIVERSAL; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/selectors/universal.js b/node_modules/postcss-selector-parser/dist/selectors/universal.js new file mode 100644 index 0000000000000..cf25473d1c3d4 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/selectors/universal.js @@ -0,0 +1,32 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = void 0; + +var _namespace = _interopRequireDefault(require("./namespace")); + +var _types = require("./types"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var Universal = /*#__PURE__*/function (_Namespace) { + _inheritsLoose(Universal, _Namespace); + + function Universal(opts) { + var _this; + + _this = _Namespace.call(this, opts) || this; + _this.type = _types.UNIVERSAL; + _this.value = '*'; + return _this; + } + + return Universal; +}(_namespace["default"]); + +exports["default"] = Universal; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/sortAscending.js b/node_modules/postcss-selector-parser/dist/sortAscending.js new file mode 100644 index 0000000000000..3ef56acc570c8 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/sortAscending.js @@ -0,0 +1,13 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = sortAscending; + +function sortAscending(list) { + return list.sort(function (a, b) { + return a - b; + }); +} + +; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/tokenTypes.js b/node_modules/postcss-selector-parser/dist/tokenTypes.js new file mode 100644 index 0000000000000..48314b93e0058 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/tokenTypes.js @@ -0,0 +1,95 @@ +"use strict"; + +exports.__esModule = true; +exports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0; +var ampersand = 38; // `&`.charCodeAt(0); + +exports.ampersand = ampersand; +var asterisk = 42; // `*`.charCodeAt(0); + +exports.asterisk = asterisk; +var at = 64; // `@`.charCodeAt(0); + +exports.at = at; +var comma = 44; // `,`.charCodeAt(0); + +exports.comma = comma; +var colon = 58; // `:`.charCodeAt(0); + +exports.colon = colon; +var semicolon = 59; // `;`.charCodeAt(0); + +exports.semicolon = semicolon; +var openParenthesis = 40; // `(`.charCodeAt(0); + +exports.openParenthesis = openParenthesis; +var closeParenthesis = 41; // `)`.charCodeAt(0); + +exports.closeParenthesis = closeParenthesis; +var openSquare = 91; // `[`.charCodeAt(0); + +exports.openSquare = openSquare; +var closeSquare = 93; // `]`.charCodeAt(0); + +exports.closeSquare = closeSquare; +var dollar = 36; // `$`.charCodeAt(0); + +exports.dollar = dollar; +var tilde = 126; // `~`.charCodeAt(0); + +exports.tilde = tilde; +var caret = 94; // `^`.charCodeAt(0); + +exports.caret = caret; +var plus = 43; // `+`.charCodeAt(0); + +exports.plus = plus; +var equals = 61; // `=`.charCodeAt(0); + +exports.equals = equals; +var pipe = 124; // `|`.charCodeAt(0); + +exports.pipe = pipe; +var greaterThan = 62; // `>`.charCodeAt(0); + +exports.greaterThan = greaterThan; +var space = 32; // ` `.charCodeAt(0); + +exports.space = space; +var singleQuote = 39; // `'`.charCodeAt(0); + +exports.singleQuote = singleQuote; +var doubleQuote = 34; // `"`.charCodeAt(0); + +exports.doubleQuote = doubleQuote; +var slash = 47; // `/`.charCodeAt(0); + +exports.slash = slash; +var bang = 33; // `!`.charCodeAt(0); + +exports.bang = bang; +var backslash = 92; // '\\'.charCodeAt(0); + +exports.backslash = backslash; +var cr = 13; // '\r'.charCodeAt(0); + +exports.cr = cr; +var feed = 12; // '\f'.charCodeAt(0); + +exports.feed = feed; +var newline = 10; // '\n'.charCodeAt(0); + +exports.newline = newline; +var tab = 9; // '\t'.charCodeAt(0); +// Expose aliases primarily for readability. + +exports.tab = tab; +var str = singleQuote; // No good single character representation! + +exports.str = str; +var comment = -1; +exports.comment = comment; +var word = -2; +exports.word = word; +var combinator = -3; +exports.combinator = combinator; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/tokenize.js b/node_modules/postcss-selector-parser/dist/tokenize.js new file mode 100644 index 0000000000000..bee9fee632e84 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/tokenize.js @@ -0,0 +1,271 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = tokenize; +exports.FIELDS = void 0; + +var t = _interopRequireWildcard(require("./tokenTypes")); + +var _unescapable, _wordDelimiters; + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); +var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); +var hex = {}; +var hexChars = "0123456789abcdefABCDEF"; + +for (var i = 0; i < hexChars.length; i++) { + hex[hexChars.charCodeAt(i)] = true; +} +/** + * Returns the last index of the bar css word + * @param {string} css The string in which the word begins + * @param {number} start The index into the string where word's first letter occurs + */ + + +function consumeWord(css, start) { + var next = start; + var code; + + do { + code = css.charCodeAt(next); + + if (wordDelimiters[code]) { + return next - 1; + } else if (code === t.backslash) { + next = consumeEscape(css, next) + 1; + } else { + // All other characters are part of the word + next++; + } + } while (next < css.length); + + return next - 1; +} +/** + * Returns the last index of the escape sequence + * @param {string} css The string in which the sequence begins + * @param {number} start The index into the string where escape character (`\`) occurs. + */ + + +function consumeEscape(css, start) { + var next = start; + var code = css.charCodeAt(next + 1); + + if (unescapable[code]) {// just consume the escape char + } else if (hex[code]) { + var hexDigits = 0; // consume up to 6 hex chars + + do { + next++; + hexDigits++; + code = css.charCodeAt(next + 1); + } while (hex[code] && hexDigits < 6); // if fewer than 6 hex chars, a trailing space ends the escape + + + if (hexDigits < 6 && code === t.space) { + next++; + } + } else { + // the next char is part of the current word + next++; + } + + return next; +} + +var FIELDS = { + TYPE: 0, + START_LINE: 1, + START_COL: 2, + END_LINE: 3, + END_COL: 4, + START_POS: 5, + END_POS: 6 +}; +exports.FIELDS = FIELDS; + +function tokenize(input) { + var tokens = []; + var css = input.css.valueOf(); + var _css = css, + length = _css.length; + var offset = -1; + var line = 1; + var start = 0; + var end = 0; + var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; + + function unclosed(what, fix) { + if (input.safe) { + // fyi: this is never set to true. + css += fix; + next = css.length - 1; + } else { + throw input.error('Unclosed ' + what, line, start - offset, start); + } + } + + while (start < length) { + code = css.charCodeAt(start); + + if (code === t.newline) { + offset = start; + line += 1; + } + + switch (code) { + case t.space: + case t.tab: + case t.newline: + case t.cr: + case t.feed: + next = start; + + do { + next += 1; + code = css.charCodeAt(next); + + if (code === t.newline) { + offset = next; + line += 1; + } + } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); + + tokenType = t.space; + endLine = line; + endColumn = next - offset - 1; + end = next; + break; + + case t.plus: + case t.greaterThan: + case t.tilde: + case t.pipe: + next = start; + + do { + next += 1; + code = css.charCodeAt(next); + } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); + + tokenType = t.combinator; + endLine = line; + endColumn = start - offset; + end = next; + break; + // Consume these characters as single tokens. + + case t.asterisk: + case t.ampersand: + case t.bang: + case t.comma: + case t.equals: + case t.dollar: + case t.caret: + case t.openSquare: + case t.closeSquare: + case t.colon: + case t.semicolon: + case t.openParenthesis: + case t.closeParenthesis: + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + + case t.singleQuote: + case t.doubleQuote: + quote = code === t.singleQuote ? "'" : '"'; + next = start; + + do { + escaped = false; + next = css.indexOf(quote, next + 1); + + if (next === -1) { + unclosed('quote', quote); + } + + escapePos = next; + + while (css.charCodeAt(escapePos - 1) === t.backslash) { + escapePos -= 1; + escaped = !escaped; + } + } while (escaped); + + tokenType = t.str; + endLine = line; + endColumn = start - offset; + end = next + 1; + break; + + default: + if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { + next = css.indexOf('*/', start + 2) + 1; + + if (next === 0) { + unclosed('comment', '*/'); + } + + content = css.slice(start, next + 1); + lines = content.split('\n'); + last = lines.length - 1; + + if (last > 0) { + nextLine = line + last; + nextOffset = next - lines[last].length; + } else { + nextLine = line; + nextOffset = offset; + } + + tokenType = t.comment; + line = nextLine; + endLine = nextLine; + endColumn = next - nextOffset; + } else if (code === t.slash) { + next = start; + tokenType = code; + endLine = line; + endColumn = start - offset; + end = next + 1; + } else { + next = consumeWord(css, start); + tokenType = t.word; + endLine = line; + endColumn = next - offset; + } + + end = next + 1; + break; + } // Ensure that the token structure remains consistent + + + tokens.push([tokenType, // [0] Token type + line, // [1] Starting line + start - offset, // [2] Starting column + endLine, // [3] Ending line + endColumn, // [4] Ending column + start, // [5] Start position / Source index + end // [6] End position + ]); // Reset offset for the next token + + if (nextOffset) { + offset = nextOffset; + nextOffset = null; + } + + start = end; + } + + return tokens; +} \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/ensureObject.js b/node_modules/postcss-selector-parser/dist/util/ensureObject.js new file mode 100644 index 0000000000000..3472e07522840 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/ensureObject.js @@ -0,0 +1,22 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = ensureObject; + +function ensureObject(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + + while (props.length > 0) { + var prop = props.shift(); + + if (!obj[prop]) { + obj[prop] = {}; + } + + obj = obj[prop]; + } +} + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/getProp.js b/node_modules/postcss-selector-parser/dist/util/getProp.js new file mode 100644 index 0000000000000..53e07c90253eb --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/getProp.js @@ -0,0 +1,24 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = getProp; + +function getProp(obj) { + for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + props[_key - 1] = arguments[_key]; + } + + while (props.length > 0) { + var prop = props.shift(); + + if (!obj[prop]) { + return undefined; + } + + obj = obj[prop]; + } + + return obj; +} + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/index.js b/node_modules/postcss-selector-parser/dist/util/index.js new file mode 100644 index 0000000000000..043fda8c64b9a --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/index.js @@ -0,0 +1,22 @@ +"use strict"; + +exports.__esModule = true; +exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0; + +var _unesc = _interopRequireDefault(require("./unesc")); + +exports.unesc = _unesc["default"]; + +var _getProp = _interopRequireDefault(require("./getProp")); + +exports.getProp = _getProp["default"]; + +var _ensureObject = _interopRequireDefault(require("./ensureObject")); + +exports.ensureObject = _ensureObject["default"]; + +var _stripComments = _interopRequireDefault(require("./stripComments")); + +exports.stripComments = _stripComments["default"]; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/stripComments.js b/node_modules/postcss-selector-parser/dist/util/stripComments.js new file mode 100644 index 0000000000000..c74f1fecdcc64 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/stripComments.js @@ -0,0 +1,27 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = stripComments; + +function stripComments(str) { + var s = ""; + var commentStart = str.indexOf("/*"); + var lastEnd = 0; + + while (commentStart >= 0) { + s = s + str.slice(lastEnd, commentStart); + var commentEnd = str.indexOf("*/", commentStart + 2); + + if (commentEnd < 0) { + return s; + } + + lastEnd = commentEnd + 2; + commentStart = str.indexOf("/*", lastEnd); + } + + s = s + str.slice(lastEnd); + return s; +} + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/dist/util/unesc.js b/node_modules/postcss-selector-parser/dist/util/unesc.js new file mode 100644 index 0000000000000..3136e7e008420 --- /dev/null +++ b/node_modules/postcss-selector-parser/dist/util/unesc.js @@ -0,0 +1,93 @@ +"use strict"; + +exports.__esModule = true; +exports["default"] = unesc; + +// Many thanks for this post which made this migration much easier. +// https://mathiasbynens.be/notes/css-escapes + +/** + * + * @param {string} str + * @returns {[string, number]|undefined} + */ +function gobbleHex(str) { + var lower = str.toLowerCase(); + var hex = ''; + var spaceTerminated = false; + + for (var i = 0; i < 6 && lower[i] !== undefined; i++) { + var code = lower.charCodeAt(i); // check to see if we are dealing with a valid hex char [a-f|0-9] + + var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point + + spaceTerminated = code === 32; + + if (!valid) { + break; + } + + hex += lower[i]; + } + + if (hex.length === 0) { + return undefined; + } + + var codePoint = parseInt(hex, 16); + var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; // Add special case for + // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point" + // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point + + if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) { + return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; + } + + return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; +} + +var CONTAINS_ESCAPE = /\\/; + +function unesc(str) { + var needToProcess = CONTAINS_ESCAPE.test(str); + + if (!needToProcess) { + return str; + } + + var ret = ""; + + for (var i = 0; i < str.length; i++) { + if (str[i] === "\\") { + var gobbled = gobbleHex(str.slice(i + 1, i + 7)); + + if (gobbled !== undefined) { + ret += gobbled[0]; + i += gobbled[1]; + continue; + } // Retain a pair of \\ if double escaped `\\\\` + // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e + + + if (str[i + 1] === "\\") { + ret += "\\"; + i++; + continue; + } // if \\ is at the end of the string retain it + // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb + + + if (str.length === i + 1) { + ret += str[i]; + } + + continue; + } + + ret += str[i]; + } + + return ret; +} + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/postcss-selector-parser/package.json b/node_modules/postcss-selector-parser/package.json new file mode 100644 index 0000000000000..a6f33589ba051 --- /dev/null +++ b/node_modules/postcss-selector-parser/package.json @@ -0,0 +1,78 @@ +{ + "name": "postcss-selector-parser", + "version": "6.0.10", + "devDependencies": { + "@babel/cli": "^7.11.6", + "@babel/core": "^7.11.6", + "@babel/eslint-parser": "^7.11.5", + "@babel/eslint-plugin": "^7.11.5", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/preset-env": "^7.11.5", + "@babel/register": "^7.11.5", + "ava": "^3.12.1", + "babel-plugin-add-module-exports": "^1.0.4", + "coveralls": "^3.1.0", + "del-cli": "^3.0.1", + "eslint": "^7.9.0", + "eslint-plugin-import": "^2.22.0", + "glob": "^7.1.6", + "minimist": "^1.2.5", + "nyc": "^15.1.0", + "postcss": "^8.0.0", + "semver": "^7.3.2", + "typescript": "^4.0.3" + }, + "main": "dist/index.js", + "types": "postcss-selector-parser.d.ts", + "files": [ + "API.md", + "CHANGELOG.md", + "LICENSE-MIT", + "dist", + "postcss-selector-parser.d.ts", + "!**/__tests__" + ], + "scripts": { + "pretest": "eslint src && tsc --noEmit postcss-selector-parser.d.ts", + "prepare": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", + "lintfix": "eslint --fix src", + "report": "nyc report --reporter=html", + "test": "nyc ava src/__tests__/*.js ", + "testone": "ava" + }, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "license": "MIT", + "engines": { + "node": ">=4" + }, + "homepage": "https://github.com/postcss/postcss-selector-parser", + "contributors": [ + { + "name": "Ben Briggs", + "email": "beneb.info@gmail.com", + "url": "http://beneb.info" + }, + { + "name": "Chris Eppstein", + "email": "chris@eppsteins.net", + "url": "http://twitter.com/chriseppstein" + } + ], + "repository": "postcss/postcss-selector-parser", + "ava": { + "require": [ + "@babel/register" + ], + "concurrency": 5, + "timeout": "25s" + }, + "nyc": { + "exclude": [ + "node_modules", + "**/__tests__" + ] + } +} diff --git a/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts new file mode 100644 index 0000000000000..89a2c5239edb1 --- /dev/null +++ b/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts @@ -0,0 +1,555 @@ +// Type definitions for postcss-selector-parser 2.2.3 +// Definitions by: Chris Eppstein + +/*~ Note that ES6 modules cannot directly export callable functions. + *~ This file should be imported using the CommonJS-style: + *~ import x = require('someLibrary'); + *~ + *~ Refer to the documentation to understand common + *~ workarounds for this limitation of ES6 modules. + */ + +/*~ This declaration specifies that the function + *~ is the exported object from the file + */ +export = parser; + +// A type that's T but not U. +type Diff = T extends U ? never : T; + +// TODO: Conditional types in TS 1.8 will really clean this up. +declare function parser(): parser.Processor; +declare function parser(processor: parser.AsyncProcessor): parser.Processor; +declare function parser(processor: parser.AsyncProcessor): parser.Processor; +declare function parser(processor: parser.SyncProcessor): parser.Processor; +declare function parser(processor: parser.SyncProcessor): parser.Processor; +declare function parser(processor?: parser.SyncProcessor | parser.AsyncProcessor): parser.Processor; + +/*~ If you want to expose types from your module as well, you can + *~ place them in this block. Often you will want to describe the + *~ shape of the return type of the function; that type should + *~ be declared in here, as this example shows. + */ +declare namespace parser { + /* copied from postcss -- so we don't need to add a dependency */ + type ErrorOptions = { + plugin?: string; + word?: string; + index?: number + }; + /* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */ + type PostCSSRuleNode = { + selector: string + /** + * @returns postcss.CssSyntaxError but it's a complex object, caller + * should cast to it if they have a dependency on postcss. + */ + error(message: string, options?: ErrorOptions): Error; + }; + /** Accepts a string */ + type Selectors = string | PostCSSRuleNode + type ProcessorFn = (root: parser.Root) => ReturnType; + type SyncProcessor = ProcessorFn; + type AsyncProcessor = ProcessorFn>; + + const TAG: "tag"; + const STRING: "string"; + const SELECTOR: "selector"; + const ROOT: "root"; + const PSEUDO: "pseudo"; + const NESTING: "nesting"; + const ID: "id"; + const COMMENT: "comment"; + const COMBINATOR: "combinator"; + const CLASS: "class"; + const ATTRIBUTE: "attribute"; + const UNIVERSAL: "universal"; + + interface NodeTypes { + tag: Tag, + string: String, + selector: Selector, + root: Root, + pseudo: Pseudo, + nesting: Nesting, + id: Identifier, + comment: Comment, + combinator: Combinator, + class: ClassName, + attribute: Attribute, + universal: Universal + } + + type Node = NodeTypes[keyof NodeTypes]; + + function isNode(node: any): node is Node; + + interface Options { + /** + * Preserve whitespace when true. Default: false; + */ + lossless: boolean; + /** + * When true and a postcss.Rule is passed, set the result of + * processing back onto the rule when done. Default: false. + */ + updateSelector: boolean; + } + class Processor< + TransformType = never, + SyncSelectorsType extends Selectors | never = Selectors + > { + res: Root; + readonly result: String; + ast(selectors: Selectors, options?: Partial): Promise; + astSync(selectors: SyncSelectorsType, options?: Partial): Root; + transform(selectors: Selectors, options?: Partial): Promise; + transformSync(selectors: SyncSelectorsType, options?: Partial): TransformType; + process(selectors: Selectors, options?: Partial): Promise; + processSync(selectors: SyncSelectorsType, options?: Partial): string; + } + interface ParserOptions { + css: string; + error: (message: string, options: ErrorOptions) => Error; + options: Options; + } + class Parser { + input: ParserOptions; + lossy: boolean; + position: number; + root: Root; + selectors: string; + current: Selector; + constructor(input: ParserOptions); + /** + * Raises an error, if the processor is invoked on + * a postcss Rule node, a better error message is raised. + */ + error(message: string, options?: ErrorOptions): void; + } + interface NodeSource { + start?: { + line: number, + column: number + }, + end?: { + line: number, + column: number + } + } + interface SpaceAround { + before: string; + after: string; + } + interface Spaces extends SpaceAround { + [spaceType: string]: string | Partial | undefined; + } + interface NodeOptions { + value: Value; + spaces?: Partial; + source?: NodeSource; + sourceIndex?: number; + } + interface Base< + Value extends string | undefined = string, + ParentType extends Container | undefined = Container | undefined + > { + type: keyof NodeTypes; + parent: ParentType; + value: Value; + spaces: Spaces; + source?: NodeSource; + sourceIndex: number; + rawSpaceBefore: string; + rawSpaceAfter: string; + remove(): Node; + replaceWith(...nodes: Node[]): Node; + next(): Node; + prev(): Node; + clone(opts: {[override: string]:any}): Node; + /** + * Return whether this node includes the character at the position of the given line and column. + * Returns undefined if the nodes lack sufficient source metadata to determine the position. + * @param line 1-index based line number relative to the start of the selector. + * @param column 1-index based column number relative to the start of the selector. + */ + isAtPosition(line: number, column: number): boolean | undefined; + /** + * Some non-standard syntax doesn't follow normal escaping rules for css, + * this allows the escaped value to be specified directly, allowing illegal characters to be + * directly inserted into css output. + * @param name the property to set + * @param value the unescaped value of the property + * @param valueEscaped optional. the escaped value of the property. + */ + setPropertyAndEscape(name: string, value: any, valueEscaped: string): void; + /** + * When you want a value to passed through to CSS directly. This method + * deletes the corresponding raw value causing the stringifier to fallback + * to the unescaped value. + * @param name the property to set. + * @param value The value that is both escaped and unescaped. + */ + setPropertyWithoutEscape(name: string, value: any): void; + /** + * Some non-standard syntax doesn't follow normal escaping rules for css. + * This allows non standard syntax to be appended to an existing property + * by specifying the escaped value. By specifying the escaped value, + * illegal characters are allowed to be directly inserted into css output. + * @param {string} name the property to set + * @param {any} value the unescaped value of the property + * @param {string} valueEscaped optional. the escaped value of the property. + */ + appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void; + toString(): string; + } + interface ContainerOptions extends NodeOptions { + nodes?: Array; + } + interface Container< + Value extends string | undefined = string, + Child extends Node = Node + > extends Base { + nodes: Array; + append(selector: Selector): this; + prepend(selector: Selector): this; + at(index: number): Child; + /** + * Return the most specific node at the line and column number given. + * The source location is based on the original parsed location, locations aren't + * updated as selector nodes are mutated. + * + * Note that this location is relative to the location of the first character + * of the selector, and not the location of the selector in the overall document + * when used in conjunction with postcss. + * + * If not found, returns undefined. + * @param line The line number of the node to find. (1-based index) + * @param col The column number of the node to find. (1-based index) + */ + atPosition(line: number, column: number): Child; + index(child: Child): number; + readonly first: Child; + readonly last: Child; + readonly length: number; + removeChild(child: Child): this; + removeAll(): Container; + empty(): Container; + insertAfter(oldNode: Child, newNode: Child): this; + insertBefore(oldNode: Child, newNode: Child): this; + each(callback: (node: Child) => boolean | void): boolean | undefined; + walk( + callback: (node: Node) => boolean | void + ): boolean | undefined; + walkAttributes( + callback: (node: Attribute) => boolean | void + ): boolean | undefined; + walkClasses( + callback: (node: ClassName) => boolean | void + ): boolean | undefined; + walkCombinators( + callback: (node: Combinator) => boolean | void + ): boolean | undefined; + walkComments( + callback: (node: Comment) => boolean | void + ): boolean | undefined; + walkIds( + callback: (node: Identifier) => boolean | void + ): boolean | undefined; + walkNesting( + callback: (node: Nesting) => boolean | void + ): boolean | undefined; + walkPseudos( + callback: (node: Pseudo) => boolean | void + ): boolean | undefined; + walkTags(callback: (node: Tag) => boolean | void): boolean | undefined; + split(callback: (node: Child) => boolean): [Child[], Child[]]; + map(callback: (node: Child) => T): T[]; + reduce( + callback: ( + previousValue: Child, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => Child + ): Child; + reduce( + callback: ( + previousValue: Child, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => Child, + initialValue: Child + ): Child; + reduce( + callback: ( + previousValue: T, + currentValue: Child, + currentIndex: number, + array: readonly Child[] + ) => T, + initialValue: T + ): T; + every(callback: (node: Child) => boolean): boolean; + some(callback: (node: Child) => boolean): boolean; + filter(callback: (node: Child) => boolean): Child[]; + sort(callback: (nodeA: Child, nodeB: Child) => number): Child[]; + toString(): string; + } + function isContainer(node: any): node is Root | Selector | Pseudo; + + interface NamespaceOptions extends NodeOptions { + namespace?: string | true; + } + interface Namespace extends Base { + /** alias for namespace */ + ns: string | true; + /** + * namespace prefix. + */ + namespace: string | true; + /** + * If a namespace exists, prefix the value provided with it, separated by |. + */ + qualifiedName(value: string): string; + /** + * A string representing the namespace suitable for output. + */ + readonly namespaceString: string; + } + function isNamespace(node: any): node is Attribute | Tag; + + interface Root extends Container { + type: "root"; + /** + * Raises an error, if the processor is invoked on + * a postcss Rule node, a better error message is raised. + */ + error(message: string, options?: ErrorOptions): Error; + nodeAt(line: number, column: number): Node + } + function root(opts: ContainerOptions): Root; + function isRoot(node: any): node is Root; + + interface _Selector extends Container> { + type: "selector"; + } + type Selector = _Selector; + function selector(opts: ContainerOptions): Selector; + function isSelector(node: any): node is Selector; + + interface CombinatorRaws { + value?: string; + spaces?: { + before?: string; + after?: string; + }; + } + interface Combinator extends Base { + type: "combinator"; + raws?: CombinatorRaws; + } + function combinator(opts: NodeOptions): Combinator; + function isCombinator(node: any): node is Combinator; + + interface ClassName extends Base { + type: "class"; + } + function className(opts: NamespaceOptions): ClassName; + function isClassName(node: any): node is ClassName; + + type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*="; + type QuoteMark = '"' | "'" | null; + interface PreferredQuoteMarkOptions { + quoteMark?: QuoteMark; + preferCurrentQuoteMark?: boolean; + } + interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions { + smart?: boolean; + } + interface AttributeOptions extends NamespaceOptions { + attribute: string; + operator?: AttributeOperator; + insensitive?: boolean; + quoteMark?: QuoteMark; + /** @deprecated Use quoteMark instead. */ + quoted?: boolean; + spaces?: { + before?: string; + after?: string; + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + raws: { + unquoted?: string; + attribute?: string; + operator?: string; + value?: string; + insensitive?: string; + spaces?: { + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + }; + } + interface Attribute extends Namespace { + type: "attribute"; + attribute: string; + operator?: AttributeOperator; + insensitive?: boolean; + quoteMark: QuoteMark; + quoted?: boolean; + spaces: { + before: string; + after: string; + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + raws: { + /** @deprecated The attribute value is unquoted, use that instead.. */ + unquoted?: string; + attribute?: string; + operator?: string; + /** The value of the attribute with quotes and escapes. */ + value?: string; + insensitive?: string; + spaces?: { + attribute?: Partial; + operator?: Partial; + value?: Partial; + insensitive?: Partial; + } + }; + /** + * The attribute name after having been qualified with a namespace. + */ + readonly qualifiedAttribute: string; + + /** + * The case insensitivity flag or an empty string depending on whether this + * attribute is case insensitive. + */ + readonly insensitiveFlag : 'i' | ''; + + /** + * Returns the attribute's value quoted such that it would be legal to use + * in the value of a css file. The original value's quotation setting + * used for stringification is left unchanged. See `setValue(value, options)` + * if you want to control the quote settings of a new value for the attribute or + * `set quoteMark(mark)` if you want to change the quote settings of the current + * value. + * + * You can also change the quotation used for the current value by setting quoteMark. + **/ + getQuotedValue(options?: SmartQuoteMarkOptions): string; + + /** + * Set the unescaped value with the specified quotation options. The value + * provided must not include any wrapping quote marks -- those quotes will + * be interpreted as part of the value and escaped accordingly. + * @param value + */ + setValue(value: string, options?: SmartQuoteMarkOptions): void; + + /** + * Intelligently select a quoteMark value based on the value's contents. If + * the value is a legal CSS ident, it will not be quoted. Otherwise a quote + * mark will be picked that minimizes the number of escapes. + * + * If there's no clear winner, the quote mark from these options is used, + * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is + * true). If the quoteMark is unspecified, a double quote is used. + **/ + smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark; + + /** + * Selects the preferred quote mark based on the options and the current quote mark value. + * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)` + * instead. + */ + preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark + + /** + * returns the offset of the attribute part specified relative to the + * start of the node of the output string. + * + * * "ns" - alias for "namespace" + * * "namespace" - the namespace if it exists. + * * "attribute" - the attribute name + * * "attributeNS" - the start of the attribute or its namespace + * * "operator" - the match operator of the attribute + * * "value" - The value (string or identifier) + * * "insensitive" - the case insensitivity flag; + * @param part One of the possible values inside an attribute. + * @returns -1 if the name is invalid or the value doesn't exist in this attribute. + */ + offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number; + } + function attribute(opts: AttributeOptions): Attribute; + function isAttribute(node: any): node is Attribute; + + interface Pseudo extends Container { + type: "pseudo"; + } + function pseudo(opts: ContainerOptions): Pseudo; + /** + * Checks wether the node is the Psuedo subtype of node. + */ + function isPseudo(node: any): node is Pseudo; + + /** + * Checks wether the node is, specifically, a pseudo element instead of + * pseudo class. + */ + function isPseudoElement(node: any): node is Pseudo; + + /** + * Checks wether the node is, specifically, a pseudo class instead of + * pseudo element. + */ + function isPseudoClass(node: any): node is Pseudo; + + + interface Tag extends Namespace { + type: "tag"; + } + function tag(opts: NamespaceOptions): Tag; + function isTag(node: any): node is Tag; + + interface Comment extends Base { + type: "comment"; + } + function comment(opts: NodeOptions): Comment; + function isComment(node: any): node is Comment; + + interface Identifier extends Base { + type: "id"; + } + function id(opts: any): any; + function isIdentifier(node: any): node is Identifier; + + interface Nesting extends Base { + type: "nesting"; + } + function nesting(opts: any): any; + function isNesting(node: any): node is Nesting; + + interface String extends Base { + type: "string"; + } + function string(opts: NodeOptions): String; + function isString(node: any): node is String; + + interface Universal extends Base { + type: "universal"; + } + function universal(opts?: NamespaceOptions): any; + function isUniversal(node: any): node is Universal; +} diff --git a/package-lock.json b/package-lock.json index 9ff57a3ec5915..3eba393001c46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1043,6 +1043,19 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/@npmcli/query": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.1.0.tgz", + "integrity": "sha512-MQWugz9zqVS3w3ccaC3tN6oruM9W8sLPahdUu6No85Rn3EIppMYISdxnxDnYuQbVO1YVaa2kkWJ/jixCWZ59tg==", + "dependencies": { + "npm-package-arg": "^9.1.0", + "postcss-selector-parser": "^6.0.10", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/@npmcli/run-script": { "version": "4.1.7", "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.7.tgz", @@ -2012,6 +2025,17 @@ "node": ">= 8" } }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/cssom": { "version": "0.5.0", "dev": true, @@ -5694,6 +5718,18 @@ "dev": true, "license": "MIT" }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/prebuild-install": { "version": "6.1.4", "dev": true, @@ -10007,12 +10043,14 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", + "@npmcli/query": "^1.1.0", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.0.6", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", + "minimatch": "^5.1.0", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", diff --git a/smoke-tests/tap-snapshots/test/index.js.test.cjs b/smoke-tests/tap-snapshots/test/index.js.test.cjs index cca28b348ea40..68145ce52b12e 100644 --- a/smoke-tests/tap-snapshots/test/index.js.test.cjs +++ b/smoke-tests/tap-snapshots/test/index.js.test.cjs @@ -26,7 +26,7 @@ All commands: edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, - pkg, prefix, profile, prune, publish, rebuild, repo, + pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, set-script, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami diff --git a/tap-snapshots/test/lib/commands/completion.js.test.cjs b/tap-snapshots/test/lib/commands/completion.js.test.cjs index 232cfec669778..f08ef0f37c360 100644 --- a/tap-snapshots/test/lib/commands/completion.js.test.cjs +++ b/tap-snapshots/test/lib/commands/completion.js.test.cjs @@ -87,6 +87,7 @@ Array [ profile prune publish + query rebuild repo restart diff --git a/tap-snapshots/test/lib/commands/query.js.test.cjs b/tap-snapshots/test/lib/commands/query.js.test.cjs new file mode 100644 index 0000000000000..0a2aa769ee638 --- /dev/null +++ b/tap-snapshots/test/lib/commands/query.js.test.cjs @@ -0,0 +1,221 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/commands/query.js TAP global > should return global package 1`] = ` +[ + { + "name": "lorem", + "version": "2.0.0", + "_id": "lorem@2.0.0", + "pkgid": "lorem@2.0.0", + "location": "node_modules/lorem", + "path": "{CWD}/test/lib/commands/tap-testdir-query-global/global/node_modules/lorem", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-global/global/node_modules/lorem", + "resolved": null, + "from": [ + "" + ], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` + +exports[`test/lib/commands/query.js TAP include-workspace-root > should return workspace object and root object 1`] = ` +[ + { + "name": "project", + "workspaces": [ + "c" + ], + "dependencies": { + "a": "^1.0.0", + "b": "^1.0.0" + }, + "pkgid": "project@", + "location": "", + "path": "{CWD}/test/lib/commands/tap-testdir-query-include-workspace-root/prefix", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-include-workspace-root/prefix", + "resolved": null, + "from": [], + "to": [ + "node_modules/c", + "node_modules/a", + "node_modules/b" + ], + "dev": false, + "inBundle": false, + "deduped": false + }, + { + "name": "c", + "version": "1.0.0", + "_id": "c@1.0.0", + "pkgid": "c@1.0.0", + "location": "c", + "path": "{CWD}/test/lib/commands/tap-testdir-query-include-workspace-root/prefix/c", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-include-workspace-root/prefix/c", + "resolved": null, + "from": [], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` + +exports[`test/lib/commands/query.js TAP linked node > should return linked node res 1`] = ` +[ + { + "name": "a", + "version": "1.0.0", + "_id": "a@1.0.0", + "pkgid": "a@1.0.0", + "location": "a", + "path": "{CWD}/test/lib/commands/tap-testdir-query-linked-node/prefix/a", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-linked-node/prefix/a", + "resolved": null, + "from": [], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` + +exports[`test/lib/commands/query.js TAP recursive tree > should return everything in the tree, accounting for recursion 1`] = ` +[ + { + "name": "project", + "dependencies": { + "a": "^1.0.0", + "b": "^1.0.0" + }, + "pkgid": "project@", + "location": "", + "path": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix", + "resolved": null, + "from": [], + "to": [ + "node_modules/a", + "node_modules/b" + ], + "dev": false, + "inBundle": false, + "deduped": false + }, + { + "pkgid": "a@", + "location": "node_modules/a", + "path": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix/node_modules/a", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix/node_modules/a", + "resolved": null, + "from": [ + "" + ], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + }, + { + "pkgid": "b@", + "location": "node_modules/b", + "path": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix/node_modules/b", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-recursive-tree/prefix/node_modules/b", + "resolved": null, + "from": [ + "" + ], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` + +exports[`test/lib/commands/query.js TAP simple query > should return root object and direct children 1`] = ` +[ + { + "name": "project", + "dependencies": { + "a": "^1.0.0", + "b": "^1.0.0" + }, + "peerDependencies": { + "c": "1.0.0" + }, + "pkgid": "project@", + "location": "", + "path": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix", + "resolved": null, + "from": [], + "to": [ + "node_modules/a", + "node_modules/b" + ], + "dev": false, + "inBundle": false, + "deduped": false + }, + { + "pkgid": "a@", + "location": "node_modules/a", + "path": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix/node_modules/a", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix/node_modules/a", + "resolved": null, + "from": [ + "" + ], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + }, + { + "pkgid": "b@", + "location": "node_modules/b", + "path": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix/node_modules/b", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-simple-query/prefix/node_modules/b", + "resolved": null, + "from": [ + "" + ], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` + +exports[`test/lib/commands/query.js TAP workspace query > should return workspace object 1`] = ` +[ + { + "name": "c", + "version": "1.0.0", + "_id": "c@1.0.0", + "pkgid": "c@1.0.0", + "location": "c", + "path": "{CWD}/test/lib/commands/tap-testdir-query-workspace-query/prefix/c", + "realpath": "{CWD}/test/lib/commands/tap-testdir-query-workspace-query/prefix/c", + "resolved": null, + "from": [], + "to": [], + "dev": false, + "inBundle": false, + "deduped": false + } +] +` diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 88b1d49556fd8..eac037f4b2708 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -693,6 +693,20 @@ Options: Run "npm help publish" for more info ` +exports[`test/lib/load-all-commands.js TAP load each command query > must match snapshot 1`] = ` +Retrieve a filtered list of packages + +Usage: +npm query + +Options: +[-g|--global] +[-w|--workspace [-w|--workspace ...]] +[-ws|--workspaces] [--include-workspace-root] + +Run "npm help query" for more info +` + exports[`test/lib/load-all-commands.js TAP load each command rebuild > must match snapshot 1`] = ` Rebuild a package diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs index ea7d2a7e1cdc0..094792afd5620 100644 --- a/tap-snapshots/test/lib/npm.js.test.cjs +++ b/tap-snapshots/test/lib/npm.js.test.cjs @@ -26,7 +26,7 @@ All commands: edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, - pkg, prefix, profile, prune, publish, rebuild, repo, + pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, set-script, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami @@ -62,7 +62,7 @@ All commands: edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, - pkg, prefix, profile, prune, publish, rebuild, repo, + pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, set-script, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami @@ -98,7 +98,7 @@ All commands: edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, - pkg, prefix, profile, prune, publish, rebuild, repo, + pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, set-script, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami @@ -134,7 +134,7 @@ All commands: edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, - pkg, prefix, profile, prune, publish, rebuild, repo, + pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, set-script, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami @@ -746,6 +746,18 @@ All commands: Run "npm help publish" for more info + query Retrieve a filtered list of packages + + Usage: + npm query + + Options: + [-g|--global] + [-w|--workspace [-w|--workspace ...]] + [-ws|--workspaces] [--include-workspace-root] + + Run "npm help query" for more info + rebuild Rebuild a package Usage: diff --git a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs index 9413f8e9a6d52..dd0df9b868c7a 100644 --- a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs +++ b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs @@ -218,6 +218,11 @@ Object { "publi": "publish", "publis": "publish", "publish": "publish", + "q": "query", + "qu": "query", + "que": "query", + "quer": "query", + "query": "query", "r": "r", "rb": "rb", "reb": "rebuild", @@ -453,6 +458,7 @@ Object { "profile", "prune", "publish", + "query", "rebuild", "repo", "restart", diff --git a/test/lib/commands/query.js b/test/lib/commands/query.js new file mode 100644 index 0000000000000..fb5b4843c34ee --- /dev/null +++ b/test/lib/commands/query.js @@ -0,0 +1,199 @@ +const t = require('tap') +const { load: loadMockNpm } = require('../../fixtures/mock-npm') + +t.cleanSnapshot = (str) => { + const normalizePath = p => p + .replace(/\\+/g, '/') + .replace(/\r\n/g, '\n') + return normalizePath(str) + .replace(new RegExp(normalizePath(process.cwd()), 'g'), '{CWD}') + // normalize between windows and posix + .replace(new RegExp('lib/node_modules', 'g'), 'node_modules') +} + +t.test('simple query', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: { + node_modules: { + a: { + name: 'a', + version: '1.0.0', + }, + b: { + name: 'b', + version: '^2.0.0', + }, + }, + 'package.json': JSON.stringify({ + name: 'project', + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + }, + peerDependencies: { + c: '1.0.0', + }, + }), + }, + }) + await npm.exec('query', [':root, :root > *']) + t.matchSnapshot(joinedOutput(), 'should return root object and direct children') +}) + +t.test('recursive tree', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: { + node_modules: { + a: { + name: 'a', + version: '1.0.0', + }, + b: { + name: 'b', + version: '^2.0.0', + dependencies: { + a: '1.0.0', + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'project', + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + }, + }), + }, + }) + await npm.exec('query', ['*']) + t.matchSnapshot(joinedOutput(), 'should return everything in the tree, accounting for recursion') +}) +t.test('workspace query', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + config: { + workspaces: ['c'], + }, + prefixDir: { + node_modules: { + a: { + name: 'a', + version: '1.0.0', + }, + b: { + name: 'b', + version: '^2.0.0', + }, + c: t.fixture('symlink', '../c'), + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + }), + }, + 'package.json': JSON.stringify({ + name: 'project', + workspaces: ['c'], + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + }, + }), + }, + }) + await npm.exec('query', [':scope'], ['c']) + t.matchSnapshot(joinedOutput(), 'should return workspace object') +}) + +t.test('include-workspace-root', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + config: { + 'include-workspace-root': true, + workspaces: ['c'], + }, + prefixDir: { + node_modules: { + a: { + name: 'a', + version: '1.0.0', + }, + b: { + name: 'b', + version: '^2.0.0', + }, + c: t.fixture('symlink', '../c'), + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + }), + }, + 'package.json': JSON.stringify({ + name: 'project', + workspaces: ['c'], + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + }, + }), + }, + }) + await npm.exec('query', [':scope'], ['c']) + t.matchSnapshot(joinedOutput(), 'should return workspace object and root object') +}) +t.test('linked node', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: { + node_modules: { + a: t.fixture('symlink', '../a'), + }, + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + }), + }, + 'package.json': JSON.stringify({ + name: 'project', + dependencies: { + a: 'file:./a', + }, + }), + }, + }) + await npm.exec('query', ['[name=a]']) + t.matchSnapshot(joinedOutput(), 'should return linked node res') +}) + +t.test('global', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + config: { + global: true, + }, + // This is a global dir that works in both windows and non-windows, that's + // why it has two node_modules folders + globalPrefixDir: { + node_modules: { + lorem: { + 'package.json': JSON.stringify({ + name: 'lorem', + version: '2.0.0', + }), + }, + }, + lib: { + node_modules: { + lorem: { + 'package.json': JSON.stringify({ + name: 'lorem', + version: '2.0.0', + }), + }, + }, + }, + }, + }) + await npm.exec('query', ['[name=lorem]']) + t.matchSnapshot(joinedOutput(), 'should return global package') +}) diff --git a/workspaces/arborist/lib/node.js b/workspaces/arborist/lib/node.js index 66d46d746abf3..be973565750a1 100644 --- a/workspaces/arborist/lib/node.js +++ b/workspaces/arborist/lib/node.js @@ -69,6 +69,8 @@ const consistentResolve = require('./consistent-resolve.js') const printableTree = require('./printable.js') const CaseInsensitiveMap = require('./case-insensitive-map.js') +const querySelectorAll = require('./query-selector-all.js') + class Node { constructor (options) { // NB: path can be null if it's a link target @@ -1446,6 +1448,12 @@ class Node { return base === name && basename(nm) === 'node_modules' ? dir : false } + // maybe accept both string value or array of strings + // seems to be what dom API does + querySelectorAll (query) { + return querySelectorAll(this, query) + } + toJSON () { return printableTree(this) } diff --git a/workspaces/arborist/lib/query-selector-all.js b/workspaces/arborist/lib/query-selector-all.js new file mode 100644 index 0000000000000..f4903f3e2009b --- /dev/null +++ b/workspaces/arborist/lib/query-selector-all.js @@ -0,0 +1,561 @@ +'use strict' + +const { resolve } = require('path') +const { parser, arrayDelimiter } = require('@npmcli/query') +const localeCompare = require('@isaacs/string-locale-compare')('en') +const npa = require('npm-package-arg') +const minimatch = require('minimatch') +const semver = require('semver') + +// handle results for parsed query asts, results are stored in a map that has a +// key that points to each ast selector node and stores the resulting array of +// arborist nodes as its value, that is essential to how we handle multiple +// query selectors, e.g: `#a, #b, #c` <- 3 diff ast selector nodes +class Results { + #currentAstSelector + #initialItems + #inventory + #pendingCombinator + #results = new Map() + #targetNode + + constructor (opts) { + this.#currentAstSelector = opts.rootAstNode.nodes[0] + this.#inventory = opts.inventory + this.#initialItems = opts.initialItems + this.#targetNode = opts.targetNode + + this.currentResults = this.#initialItems + + // reset by rootAstNode walker + this.currentAstNode = opts.rootAstNode + } + + get currentResults () { + return this.#results.get(this.#currentAstSelector) + } + + set currentResults (value) { + this.#results.set(this.#currentAstSelector, value) + } + + // retrieves the initial items to which start the filtering / matching + // for most of the different types of recognized ast nodes, e.g: class (aka + // depType), id, *, etc in different contexts we need to start with the + // current list of filtered results, for example a query for `.workspace` + // actually means the same as `*.workspace` so we want to start with the full + // inventory if that's the first ast node we're reading but if it appears in + // the middle of a query it should respect the previous filtered results, + // combinators are a special case in which we always want to have the + // complete inventory list in order to use the left-hand side ast node as a + // filter combined with the element on its right-hand side + get initialItems () { + const firstParsed = + (this.currentAstNode.parent.nodes[0] === this.currentAstNode) && + (this.currentAstNode.parent.parent.type === 'root') + + if (firstParsed) { + return this.#initialItems + } + if (this.currentAstNode.prev().type === 'combinator') { + return this.#inventory + } + return this.currentResults + } + + // combinators need information about previously filtered items along + // with info of the items parsed / retrieved from the selector right + // past the combinator, for this reason combinators are stored and + // only ran as the last part of each selector logic + processPendingCombinator (nextResults) { + if (this.#pendingCombinator) { + const res = this.#pendingCombinator(this.currentResults, nextResults) + this.#pendingCombinator = null + this.currentResults = res + } else { + this.currentResults = nextResults + } + } + + // when collecting results to a root astNode, we traverse the list of child + // selector nodes and collect all of their resulting arborist nodes into a + // single/flat Set of items, this ensures we also deduplicate items + collect (rootAstNode) { + return new Set(rootAstNode.nodes.flatMap(n => this.#results.get(n))) + } + + // selector types map to the '.type' property of the ast nodes via `${astNode.type}Type` + // + // attribute selector [name=value], etc + attributeType () { + const nextResults = this.initialItems.filter(node => + attributeMatch(this.currentAstNode, node.package) + ) + this.processPendingCombinator(nextResults) + } + + // dependency type selector (i.e. .prod, .dev, etc) + // css calls this class, we interpret is as dependency type + classType () { + const depTypeFn = depTypes[String(this.currentAstNode)] + if (!depTypeFn) { + throw Object.assign( + new Error(`\`${String(this.currentAstNode)}\` is not a supported dependency type.`), + { code: 'EQUERYNODEPTYPE' } + ) + } + const nextResults = depTypeFn(this.initialItems) + this.processPendingCombinator(nextResults) + } + + // combinators (i.e. '>', ' ', '~') + combinatorType () { + this.#pendingCombinator = combinators[String(this.currentAstNode)] + } + + // name selectors (i.e. #foo, #foo@1.0.0) + // css calls this id, we interpret it as name + idType () { + const spec = npa(this.currentAstNode.value) + const nextResults = this.initialItems.filter(node => + (node.name === spec.name || node.package.name === spec.name) && + (semver.satisfies(node.version, spec.fetchSpec) || !spec.rawSpec)) + this.processPendingCombinator(nextResults) + } + + // pseudo selectors (prefixed with :) + pseudoType () { + const pseudoFn = `${this.currentAstNode.value.slice(1)}Pseudo` + if (!this[pseudoFn]) { + throw Object.assign( + new Error(`\`${this.currentAstNode.value + }\` is not a supported pseudo selector.`), + { code: 'EQUERYNOPSEUDO' } + ) + } + const nextResults = this[pseudoFn]() + this.processPendingCombinator(nextResults) + } + + selectorType () { + this.#currentAstSelector = this.currentAstNode + // starts a new array in which resulting items + // can be stored for each given ast selector + if (!this.currentResults) { + this.currentResults = [] + } + } + + universalType () { + this.processPendingCombinator(this.initialItems) + } + + // pseudo selectors map to the 'value' property of the pseudo selectors in the ast nodes + // via selectors via `${value.slice(1)}Pseudo` + attrPseudo () { + const { lookupProperties, attributeMatcher } = this.currentAstNode + + return this.initialItems.filter(node => { + let objs = [node.package] + for (const prop of lookupProperties) { + // if an isArray symbol is found that means we'll need to iterate + // over the previous found array to basically make sure we traverse + // all its indexes testing for possible objects that may eventually + // hold more keys specified in a selector + if (prop === arrayDelimiter) { + objs = objs.flat() + continue + } + + // otherwise just maps all currently found objs + // to the next prop from the lookup properties list, + // filters out any empty key lookup + objs = objs.flatMap(obj => obj[prop] || []) + + // in case there's no property found in the lookup + // just filters that item out + const noAttr = objs.every(obj => !obj) + if (noAttr) { + return false + } + } + + // if any of the potential object matches + // that item should be in the final result + return objs.some(obj => attributeMatch(attributeMatcher, obj)) + }) + } + + emptyPseudo () { + return this.initialItems.filter(node => node.edgesOut.size === 0) + } + + extraneousPseudo () { + return this.initialItems.filter(node => node.extraneous) + } + + hasPseudo () { + const found = [] + for (const item of this.initialItems) { + const res = retrieveNodesFromParsedAst({ + // This is the one time initialItems differs from inventory + initialItems: [item], + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: item, + }) + if (res.size > 0) { + found.push(item) + } + } + return found + } + + invalidPseudo () { + const found = [] + for (const node of this.initialItems) { + for (const edge of node.edgesIn) { + if (edge.invalid) { + found.push(node) + break + } + } + } + return found + } + + isPseudo () { + const res = retrieveNodesFromParsedAst({ + initialItems: this.initialItems, + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: this.currentAstNode, + }) + return [...res] + } + + linkPseudo () { + return this.initialItems.filter(node => node.isLink || (node.isTop && !node.isRoot)) + } + + missingPseudo () { + return this.#inventory.reduce((res, node) => { + for (const edge of node.edgesOut.values()) { + if (edge.missing) { + const pkg = { name: edge.name, version: edge.spec } + res.push(new this.#targetNode.constructor({ pkg })) + } + } + return res + }, []) + } + + notPseudo () { + const res = retrieveNodesFromParsedAst({ + initialItems: this.initialItems, + inventory: this.#inventory, + rootAstNode: this.currentAstNode.nestedNode, + targetNode: this.currentAstNode, + }) + const internalSelector = new Set(res) + return this.initialItems.filter(node => + !internalSelector.has(node)) + } + + pathPseudo () { + return this.initialItems.filter(node => { + if (!this.currentAstNode.pathValue) { + return true + } + return minimatch( + node.realpath.replace(/\\+/g, '/'), + resolve(node.root.realpath, this.currentAstNode.pathValue).replace(/\\+/g, '/') + ) + }) + } + + privatePseudo () { + return this.initialItems.filter(node => node.package.private) + } + + rootPseudo () { + return this.initialItems.filter(node => node === this.#targetNode.root) + } + + scopePseudo () { + return this.initialItems.filter(node => node === this.#targetNode) + } + + semverPseudo () { + if (!this.currentAstNode.semverValue) { + return this.initialItems + } + return this.initialItems.filter(node => + semver.satisfies(node.version, this.currentAstNode.semverValue)) + } + + typePseudo () { + if (!this.currentAstNode.typeValue) { + return this.initialItems + } + return this.initialItems + .flatMap(node => { + const found = [] + for (const edge of node.edgesIn) { + if (npa(`${edge.name}@${edge.spec}`).type === this.currentAstNode.typeValue) { + found.push(edge.to) + } + } + return found + }) + } + + dedupedPseudo () { + return this.initialItems.filter(node => node.target.edgesIn.size > 1) + } +} + +// operators for attribute selectors +const attributeOperators = { + // existence of the attribute + '' ({ attr }) { + return Boolean(attr) + }, + // attribute value is equivalent + '=' ({ attr, value, insensitive }) { + return attr === value + }, + // attribute value contains word + '~=' ({ attr, value, insensitive }) { + return (attr.match(/\w+/g) || []).includes(value) + }, + // attribute value contains string + '*=' ({ attr, value, insensitive }) { + return attr.includes(value) + }, + // attribute value is equal or starts with + '|=' ({ attr, value, insensitive }) { + return attr.startsWith(`${value}-`) + }, + // attribute value starts with + '^=' ({ attr, value, insensitive }) { + return attr.startsWith(value) + }, + // attribute value ends with + '$=' ({ attr, value, insensitive }) { + return attr.endsWith(value) + }, +} + +const attributeOperator = ({ attr, value, insensitive, operator }) => { + if (typeof attr === 'number') { + attr = String(attr) + } + if (typeof attr !== 'string') { + // It's an object or an array, bail + return false + } + if (insensitive) { + attr = attr.toLowerCase() + } + return attributeOperators[operator]({ + attr, + insensitive, + value, + }) +} + +const attributeMatch = (matcher, obj) => { + const insensitive = !!matcher.insensitive + const operator = matcher.operator || '' + const attribute = matcher.qualifiedAttribute + let value = matcher.value || '' + if (insensitive) { + value = value.toLowerCase() + } + // in case the current object is an array + // then we try to match every item in the array + if (Array.isArray(obj[attribute])) { + return obj[attribute].find((i, index) => { + const attr = obj[attribute][index] || '' + return attributeOperator({ attr, value, insensitive, operator }) + }) + } else { + const attr = obj[attribute] || '' + return attributeOperator({ attr, value, insensitive, operator }) + } +} + +const edgeIsType = (node, type, seen = new Set()) => { + for (const edgeIn of node.edgesIn) { + // TODO Need a test with an infinite loop + if (seen.has(edgeIn)) { + continue + } + seen.add(edgeIn) + if (edgeIn.type === type || edgeIn.from[type] || edgeIsType(edgeIn.from, type, seen)) { + return true + } + } + return false +} + +const filterByType = (nodes, type) => { + const found = [] + for (const node of nodes) { + if (node[type] || edgeIsType(node, type)) { + found.push(node) + } + } + return found +} + +const depTypes = { + // dependency + '.prod' (prevResults) { + const found = [] + for (const node of prevResults) { + if (!node.dev) { + found.push(node) + } + } + return found + }, + // devDependency + '.dev' (prevResults) { + return filterByType(prevResults, 'dev') + }, + // optionalDependency + '.optional' (prevResults) { + return filterByType(prevResults, 'optional') + }, + // peerDependency + '.peer' (prevResults) { + return filterByType(prevResults, 'peer') + }, + // workspace + '.workspace' (prevResults) { + return prevResults.filter(node => node.isWorkspace) + }, + // bundledDependency + '.bundled' (prevResults) { + return prevResults.filter(node => node.inBundle) + }, +} + +// checks if a given node has a direct parent in any of the nodes provided in +// the compare nodes array +const hasParent = (node, compareNodes) => { + // All it takes is one so we loop and return on the first hit + for (const compareNode of compareNodes) { + // follows logical parent for link anscestors + if (node.isTop && (node.resolveParent === compareNode)) { + return true + } + // follows edges-in to check if they match a possible parent + for (const edge of node.edgesIn) { + if (edge && edge.from === compareNode) { + return true + } + } + } + return false +} + +// checks if a given node is a descendant of any of the nodes provided in the +// compareNodes array +const hasAscendant = (node, compareNodes, seen = new Set()) => { + // TODO (future) loop over ancestry property + if (hasParent(node, compareNodes)) { + return true + } + + if (node.isTop && node.resolveParent) { + return hasAscendant(node.resolveParent, compareNodes) + } + for (const edge of node.edgesIn) { + // TODO Need a test with an infinite loop + if (seen.has(edge)) { + continue + } + seen.add(edge) + if (edge && edge.from && hasAscendant(edge.from, compareNodes, seen)) { + return true + } + } + return false +} + +const combinators = { + // direct descendant + '>' (prevResults, nextResults) { + return nextResults.filter(node => hasParent(node, prevResults)) + }, + // any descendant + ' ' (prevResults, nextResults) { + return nextResults.filter(node => hasAscendant(node, prevResults)) + }, + // sibling + '~' (prevResults, nextResults) { + // Return any node in nextResults that is a sibling of (aka shares a + // parent with) a node in prevResults + const parentNodes = new Set() // Parents of everything in prevResults + for (const node of prevResults) { + for (const edge of node.edgesIn) { + // edge.from always exists cause it's from another node's edgesIn + parentNodes.add(edge.from) + } + } + return nextResults.filter(node => + !prevResults.includes(node) && hasParent(node, [...parentNodes]) + ) + }, +} + +const retrieveNodesFromParsedAst = (opts) => { + // when we first call this it's the parsed query. all other times it's + // results.currentNode.nestedNode + const rootAstNode = opts.rootAstNode + + if (!rootAstNode.nodes) { + return new Set() + } + + const results = new Results(opts) + + rootAstNode.walk((nextAstNode) => { + // This is the only place we reset currentAstNode + results.currentAstNode = nextAstNode + const updateFn = `${results.currentAstNode.type}Type` + if (typeof results[updateFn] !== 'function') { + throw Object.assign( + new Error(`\`${results.currentAstNode.type}\` is not a supported selector.`), + { code: 'EQUERYNOSELECTOR' } + ) + } + results[updateFn]() + }) + + return results.collect(rootAstNode) +} + +// We are keeping this async in the event that we do add async operators, we +// won't have to have a breaking change on this function signature. +const querySelectorAll = async (targetNode, query) => { + // This never changes ever we just pass it around. But we can't scope it to + // this whole file if we ever want to support concurrent calls to this + // function. + const inventory = [...targetNode.root.inventory.values()] + // res is a Set of items returned for each parsed css ast selector + const res = retrieveNodesFromParsedAst({ + initialItems: inventory, + inventory, + rootAstNode: parser(query), + targetNode, + }) + + // returns nodes ordered by realpath + return [...res].sort((a, b) => localeCompare(a.location, b.location)) +} + +module.exports = querySelectorAll diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 48814eda69166..9c87667c5920c 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -11,12 +11,14 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", + "@npmcli/query": "^1.1.0", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.0.6", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", + "minimatch": "^5.1.0", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", diff --git a/workspaces/arborist/test/node.js b/workspaces/arborist/test/node.js index 36856a4cc557e..0db439cbabc31 100644 --- a/workspaces/arborist/test/node.js +++ b/workspaces/arborist/test/node.js @@ -62,8 +62,8 @@ t.test('basic instantiation', t => { t.end() }) -t.test('testing with dep tree', t => { - const runTest = rootMetadata => t => { +t.test('testing with dep tree', async t => { + const runTest = rootMetadata => async t => { const root = new Node({ pkg: { name: 'root', @@ -115,6 +115,10 @@ t.test('testing with dep tree', t => { t.equal(meta.isDescendantOf(root), true, 'meta descends from root') t.equal(meta.root, root, 'meta rooted in same tree via parent') + // retrieve a node using querySelectorAll + const queryResult = await root.querySelectorAll('* #meta') + t.same(queryResult, [meta], 'should retrieve node using querySelectorAll') + const bundled = new Node({ pkg: { name: 'bundled', @@ -344,14 +348,14 @@ t.test('testing with dep tree', t => { t.end() } - t.test('without meta', runTest()) + t.test('without meta', await runTest()) const meta = new Shrinkwrap({ path: '/home/user/projects/root' }) meta.data = { lockfileVersion: 2, packages: {}, dependencies: {}, } - t.test('with meta', runTest(meta)) + t.test('with meta', await runTest(meta)) t.end() }) diff --git a/workspaces/arborist/test/query-selector-all.js b/workspaces/arborist/test/query-selector-all.js new file mode 100644 index 0000000000000..ec8c116122099 --- /dev/null +++ b/workspaces/arborist/test/query-selector-all.js @@ -0,0 +1,704 @@ +'use strict' + +const t = require('tap') +const Arborist = require('..') + +const q = require('../lib/query-selector-all.js') + +// test helper that spits out pkgid for readability +// and deduplicates link/target from results +const querySelectorAll = async (tree, query) => { + const res = await q(tree, query) + return [...new Set(res.map(i => i.pkgid))] +} + +t.test('query-selector-all', async t => { + /* + fixture tree: + + query-selector-all-tests@1.0.0 + ├── @npmcli/abbrev@2.0.0 (extraneous) + ├─┬ a@1.0.0 -> ./a (production dep of query-selector-all-tests, workspace) + │ └─┬ baz@1.0.0 (optional dep of a) + │ └── lorem@1.0.0 (production dep of baz) + ├── abbrev@1.1.1 (production dep of query-selector-all-tests) + ├─┬ b@1.0.0 -> ./b (workspace) + │ └── bar@2.0.0 (production dep of b, deduped) + ├─┬ bar@2.0.0 (production dep of query-selector-all-tests) + │ └── moo@3.0.0 (production dep of bar) + ├─┬ foo@2.2.2 (dev dep of query-selector-all-tests) + │ ├─┬ bar@1.4.0 (production dep of foo, deduped) + │ │ └── dasher@2.0.0 (peer dep of bar) + │ └── dash-separated-pkg@1.0.0 (production dep of foo) + ├── moo@3.0.0 (dev dep of query-selector-all-tests) + └─┬ recur@1.0.0 (dev dep of query-selector-all-tests) + └─┬ sive@1.0.0 (production dep of recur) + └── recur@1.0.0 (recursive production dep of recur, deduped) + + */ + const path = t.testdir({ + node_modules: { + '@npmcli': { + abbrev: { + 'package.json': JSON.stringify({ + name: '@npmcli/abbrev', + version: '2.0.0-beta.45', + }), + }, + }, + a: t.fixture('symlink', '../a'), + abbrev: { + 'package.json': JSON.stringify({ + name: 'abbrev', + version: '1.1.1', + license: 'ISC', + }), + }, + b: t.fixture('symlink', '../b'), + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '2.0.0', + dependencies: { + moo: '3.0.0', + }, + arbitrary: { + foo: [ + false, + 'foo', + 'bar', + { funding: { type: 'GH' } }, + { funding: { type: 'MS' } }, + 10000, + 13000, + 15000, + ], + bar: 'bar', + baz: ['a', 'b', 'c'], + }, + }), + }, + baz: { + 'package.json': JSON.stringify({ + name: 'baz', + version: '1.0.0', + license: ['ISC', 'Something'], + dependencies: { + lorem: 'latest', + }, + }), + }, + foo: { + node_modules: { + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.4.0', + peerDependencies: { + dasher: '2.0.0', + }, + }), + }, + }, + 'package.json': JSON.stringify({ + name: 'foo', + version: '2.2.2', + arbitrary: 'foo key', + dependencies: { + bar: '^1.0.0', + 'dash-separated-pkg': '^1.0.0', + }, + }), + }, + 'dash-separated-pkg': { + 'package.json': JSON.stringify({ + name: 'dash-separated-pkg', + version: '1.0.0', + description: 'One of the best libraries every dev should know about.', + }), + }, + dasher: { + 'package.json': JSON.stringify({ + name: 'dasher', + version: '2.0.0', + description: 'The best library ever.', + }), + }, + ipsum: { + 'package.json': JSON.stringify({ + name: 'sit', + version: '1.0.0', + keywords: ['lorem', 'ipsum', 'dolor'], + dependencies: { + 'missing-dep': '^1.0.0', + }, + }), + }, + lorem: { + 'package.json': JSON.stringify({ + name: 'lorem', + version: '1.0.0', + keywords: ['lorem', 'ipsum', 'sit', 'amet'], + devDependencies: { + moo: '^3.0.0', + }, + funding: [ + { type: 'GitHub', url: 'https://github.com/sponsors' }, + ], + }), + }, + moo: { + 'package.json': JSON.stringify({ + name: 'moo', + version: '3.0.0', + }), + }, + recur: { + 'package.json': JSON.stringify({ + name: 'recur', + version: '1.0.0', + dependencies: { + sive: '1.0.0', + }, + }), + }, + sive: { + 'package.json': JSON.stringify({ + name: 'sive', + version: '1.0.0', + dependencies: { + recur: '1.0.0', + }, + }), + }, + }, + a: { 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + optionalDependencies: { + baz: '^1.0.0', + }, + }) }, + b: { 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + private: true, + devDependencies: { + a: '^1.0.0', + }, + dependencies: { + bar: '^2.0.0', + }, + }) }, + 'package.json': JSON.stringify({ + name: 'query-selector-all-tests', + version: '1.0.0', + workspaces: ['a', 'b'], + dependencies: { + a: '^1.0.0', + abbrev: '^1.1.1', + bar: '^2.0.0', + ipsum: 'npm:sit@1.0.0', + }, + devDependencies: { + foo: '^2.0.0', + moo: '^3.0.0', + recur: '1.0.0', + }, + bundleDependencies: ['abbrev'], + }), + }) + + const opts = { + path, + fullMetadata: true, + } + const arb = new Arborist(opts) + const tree = await arb.loadActual(opts) + + // empty query? + const emptyRes = await q(tree, '') + t.same(emptyRes, [], 'empty query') + + // missing pseudo selector + t.rejects( + q(tree, ':foo'), + { code: 'EQUERYNOPSEUDO' }, + 'should throw on missing pseudo selector' + ) + + // missing depType + t.rejects( + q(tree, '.foo'), + { code: 'EQUERYNODEPTYPE' }, + 'should throw on missing dep type' + ) + + // missing attribute matcher on :attr + t.rejects( + q(tree, ':attr(foo, bar)'), + { code: 'EQUERYATTR' }, + 'should throw on missing attribute matcher on :attr pseudo' + ) + + // no type or tag selectors, as documented + t.rejects( + q(tree, 'node'), + { code: 'EQUERYNOSELECTOR' }, + 'should throw in invalid selector' + ) + + // :scope pseudo + const [nodeFoo] = await q(tree, '#foo') + const scopeRes = await querySelectorAll(nodeFoo, ':scope') + t.same(scopeRes, ['foo@2.2.2'], ':scope') + + const scopeChildren = await querySelectorAll(nodeFoo, ':scope > *') + t.same(scopeChildren, [ + 'dash-separated-pkg@1.0.0', + 'bar@1.4.0', + ], ':scope > *') + + const runSpecParsing = async testCase => { + for (const [selector, expected] of testCase) { + t.test(selector, async t => { + const res = await querySelectorAll(tree, selector) + t.same( + res, + expected, + selector + ) + }) + } + } + + await runSpecParsing([ + // universal selector + ['*', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + ['* > *', [ + 'a@1.0.0', + 'b@1.0.0', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + ['> #a', ['a@1.0.0']], + + // pseudo :root + [':root', ['query-selector-all-tests@1.0.0']], + [':scope', ['query-selector-all-tests@1.0.0']], // same as root in this context + [':root > *', [ + 'a@1.0.0', + 'b@1.0.0', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'foo@2.2.2', + 'ipsum@npm:sit@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + ]], + [':root > .workspace', ['a@1.0.0', 'b@1.0.0']], + [':root > *.workspace', ['a@1.0.0', 'b@1.0.0']], + [':root > .workspace[name=a]', ['a@1.0.0']], + [':root > [name=bar]', ['bar@2.0.0']], + [':root > .workspace[version=1.0.0]', ['a@1.0.0', 'b@1.0.0']], + [':root > .workspace[name=a][version=1.0.0]', ['a@1.0.0']], + [':root > :root', []], + ['* > :root', []], + ['* :root', []], + [':root, :root', ['query-selector-all-tests@1.0.0']], + ['#a *:root', []], + ['#a > :root', []], + ['#a ~ :root', []], + + // pseudo miscelaneous + [':empty', [ + '@npmcli/abbrev@2.0.0-beta.45', + 'a@1.0.0', + 'abbrev@1.1.1', + 'b@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + ]], + [':root > :empty', [ + 'a@1.0.0', + 'abbrev@1.1.1', + 'b@1.0.0', + 'moo@3.0.0', + ]], + [':extraneous', ['@npmcli/abbrev@2.0.0-beta.45']], + [':invalid', ['lorem@1.0.0']], + [':link', ['a@1.0.0', 'b@1.0.0']], + [':link', ['a@1.0.0', 'b@1.0.0']], + [':deduped', [ + 'bar@2.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + ]], + [':missing', ['missing-dep@^1.0.0']], + [':private', ['b@1.0.0']], + + // :not pseudo + [':not(#foo)', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + [':root > .workspace:not(#b)', ['a@1.0.0']], + [':root > .workspace > *:not(#bar)', ['a@1.0.0', 'baz@1.0.0']], + ['.bundled ~ :not(.workspace)', [ + 'bar@2.0.0', + 'foo@2.2.2', + 'ipsum@npm:sit@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + ]], + ['*:root > *:empty:not(*[name^=a], #b)', ['moo@3.0.0']], + [':not(:not(:link))', [ + 'a@1.0.0', + 'b@1.0.0', + ]], + + // has pseudo + [':root > *:has(* > #bar@1.4.0)', ['foo@2.2.2']], + ['*:has(* > #bar@1.4.0)', ['foo@2.2.2']], + ['*:has(> #bar@1.4.0)', ['foo@2.2.2']], + ['.workspace:has(> * > #lorem)', ['a@1.0.0']], + ['.workspace:has(* #lorem, ~ #b)', ['a@1.0.0']], + + // is pseudo + [':is(#a, #b) > *', ['a@1.0.0', 'bar@2.0.0', 'baz@1.0.0']], + // TODO: ipsum is not empty but its child is missing so it doesn't return a + // result here + [':root > *:is(.prod:not(:empty), .dev > [name=bar]) > *', [ + 'a@1.0.0', + 'bar@2.0.0', + 'baz@1.0.0', + 'dasher@2.0.0', + 'moo@3.0.0', + ]], + [':is(*:semver(2.0.0), :semver(=2.0.0-beta.45))', [ + '@npmcli/abbrev@2.0.0-beta.45', + 'bar@2.0.0', + 'dasher@2.0.0', + ]], + + // type pseudo + [':type()', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + [':type(tag)', ['lorem@1.0.0']], + [':type(alias)', ['ipsum@npm:sit@1.0.0']], + [':type(range)', [ + 'a@1.0.0', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'moo@3.0.0', + ]], + [':type(git)', []], + + // path pseudo + [':path(node_modules/*)', [ + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + [':path(node_modules/bar)', ['bar@2.0.0']], + [':path(./node_modules/bar)', ['bar@2.0.0']], + [':path(node_modules/foo/node_modules/bar)', ['bar@1.4.0']], + [':path(**/bar)', ['bar@2.0.0', 'bar@1.4.0']], + [':path(*)', ['a@1.0.0', 'b@1.0.0']], + [':path()', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + + // semver pseudo + [':semver()', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + [':semver(*)', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + [':semver(2.0.0)', [ + 'bar@2.0.0', + 'dasher@2.0.0', + ]], + [':semver(>=2)', [ + 'bar@2.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'moo@3.0.0', + ]], + [':semver(~2.0.x)', [ + 'bar@2.0.0', + 'dasher@2.0.0', + ]], + [':semver(2 - 3)', [ + 'bar@2.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'moo@3.0.0', + ]], + [':semver(=1.4.0)', ['bar@1.4.0']], + [':semver(1.4.0 || 2.2.2)', ['foo@2.2.2', 'bar@1.4.0']], + + // attr pseudo + [':attr([name=dasher])', ['dasher@2.0.0']], + [':attr(dependencies, [bar="^1.0.0"])', ['foo@2.2.2']], + [':attr(dependencies, :attr([bar="^1.0.0"]))', ['foo@2.2.2']], + [':attr([keywords=lorem])', ['ipsum@npm:sit@1.0.0', 'lorem@1.0.0']], + [':attr(arbitrary, [foo$=oo])', ['bar@2.0.0']], + [':attr(arbitrary, [foo*=oo])', ['bar@2.0.0']], + [':attr(arbitrary, [foo|=oo])', []], + [':attr(funding, :attr([type=GitHub]))', ['lorem@1.0.0']], + [':attr(arbitrary, foo, :attr(funding, [type=GH]))', ['bar@2.0.0']], + [':attr(arbitrary, foo, :attr(funding, [type=gh i]))', ['bar@2.0.0']], + [':attr(arbitrary, :attr([foo=10000]))', ['bar@2.0.0']], + + // attribute matchers + ['[name]', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + ['[name=a]', ['a@1.0.0']], + ['[name=@npmcli/abbrev]', ['@npmcli/abbrev@2.0.0-beta.45']], + ['[name=a], [name=b]', ['a@1.0.0', 'b@1.0.0']], + ['[name=a], *[name=b]', ['a@1.0.0', 'b@1.0.0']], + ['[name^=a]', ['a@1.0.0', 'abbrev@1.1.1']], + ['[name|=dash]', ['dash-separated-pkg@1.0.0']], + ['[name$=oo]', ['foo@2.2.2', 'moo@3.0.0']], + ['[description]', [ + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + ]], + ['[description~=ever]', ['dasher@2.0.0']], + ['[description~=best]', [ + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + ]], + ['[name*=a]', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + '@npmcli/abbrev@2.0.0-beta.45', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'bar@1.4.0', + ]], + ['[arbitrary^=foo]', ['foo@2.2.2']], + ['[license=ISC]', ['abbrev@1.1.1', 'baz@1.0.0']], + ['[license=isc i]', ['abbrev@1.1.1', 'baz@1.0.0']], + + // types + ['.prod', [ + 'query-selector-all-tests@1.0.0', + 'a@1.0.0', + 'b@1.0.0', + 'abbrev@1.1.1', + 'bar@2.0.0', + 'baz@1.0.0', + 'ipsum@npm:sit@1.0.0', + 'lorem@1.0.0', + 'moo@3.0.0', + ]], + ['.workspace', ['a@1.0.0', 'b@1.0.0']], + ['.workspace > *', ['a@1.0.0', 'bar@2.0.0', 'baz@1.0.0']], + ['.workspace ~ *', [ + 'abbrev@1.1.1', + 'bar@2.0.0', + 'foo@2.2.2', + 'ipsum@npm:sit@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + ]], + ['.dev', [ + '@npmcli/abbrev@2.0.0-beta.45', + 'a@1.0.0', + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'foo@2.2.2', + 'bar@1.4.0', + 'moo@3.0.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + ['.dev *', [ + 'dash-separated-pkg@1.0.0', + 'dasher@2.0.0', + 'bar@1.4.0', + 'recur@1.0.0', + 'sive@1.0.0', + ]], + ['.peer', ['@npmcli/abbrev@2.0.0-beta.45', 'dasher@2.0.0']], + ['.optional', ['@npmcli/abbrev@2.0.0-beta.45', 'baz@1.0.0', 'lorem@1.0.0']], + ['.bundled', ['abbrev@1.1.1']], + ['.bundled ~ *', [ + 'a@1.0.0', + 'b@1.0.0', + 'bar@2.0.0', + 'foo@2.2.2', + 'ipsum@npm:sit@1.0.0', + 'moo@3.0.0', + 'recur@1.0.0', + ]], + + // id selector + ['#bar', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar@2.0.0', ['bar@2.0.0']], + ['#@npmcli/abbrev@2.0.0-beta.45', ['@npmcli/abbrev@2.0.0-beta.45']], + ['#bar:semver(2.0)', ['bar@2.0.0']], + ['#bar:semver(2)', ['bar@2.0.0']], + ['#bar:semver(^2.0.0)', ['bar@2.0.0']], + ['#bar:semver(~2.0.0)', ['bar@2.0.0']], + ['#bar:semver(=2.0.0)', ['bar@2.0.0']], + ['#bar:semver(>=2.0.0)', ['bar@2.0.0']], + ['#bar:semver(<3.0.0)', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar:semver(2 - 3)', ['bar@2.0.0']], + ['#bar:semver(2.0.0 - 3.0.0)', ['bar@2.0.0']], + ['#bar:semver(*)', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar:semver(^2.0.0-beta.0)', ['bar@2.0.0']], + ['#bar:semver(>1.5.0 <3.0.0)', ['bar@2.0.0']], + ['#bar:semver(2.x)', ['bar@2.0.0']], + ['#bar:semver(2.x.x)', ['bar@2.0.0']], + ['#bar:semver(1||2)', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar:semver(1 || 2)', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar:semver(1 || 2.0.0)', ['bar@2.0.0', 'bar@1.4.0']], + ['#bar:semver(1.4.0 || 2)', ['bar@2.0.0', 'bar@1.4.0']], + ['#ipsum', ['ipsum@npm:sit@1.0.0']], + ['#bar > *', ['dasher@2.0.0', 'moo@3.0.0']], + [':root > #bar', ['bar@2.0.0']], + [':root > #bar > *', ['moo@3.0.0']], + [':root #bar > *', ['dasher@2.0.0', 'moo@3.0.0']], + [':root #bar:semver(1) > *', ['dasher@2.0.0']], + [':root #bar:semver(1) ~ *', ['dash-separated-pkg@1.0.0']], + ['#bar:semver(2), #foo', ['bar@2.0.0', 'foo@2.2.2']], + ['#a, #bar:semver(2), #foo@2.2.2', ['a@1.0.0', 'bar@2.0.0', 'foo@2.2.2']], + ]) +}) From d315ead7a7f6d531eb57cfa4350bb08949c60997 Mon Sep 17 00:00:00 2001 From: Neel Dani Date: Tue, 2 Aug 2022 21:27:02 +0530 Subject: [PATCH 006/175] fix: gracefully exit login and publish commands on Ctrl+C (SIGINT) in the new webAuthn flow (#5243) --- lib/utils/open-url-prompt.js | 9 +++++++++ test/lib/utils/open-url-prompt.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lib/utils/open-url-prompt.js b/lib/utils/open-url-prompt.js index 3eb3ac288c035..290040e5d14aa 100644 --- a/lib/utils/open-url-prompt.js +++ b/lib/utils/open-url-prompt.js @@ -34,6 +34,11 @@ const promptOpen = async (npm, url, title, prompt, emitter) => { }) const tryOpen = await new Promise(resolve => { + rl.on('SIGINT', () => { + rl.close() + resolve('SIGINT') + }) + rl.question(prompt, () => { resolve(true) }) @@ -50,6 +55,10 @@ const promptOpen = async (npm, url, title, prompt, emitter) => { } }) + if (tryOpen === 'SIGINT') { + throw new Error('canceled') + } + if (!tryOpen) { return } diff --git a/test/lib/utils/open-url-prompt.js b/test/lib/utils/open-url-prompt.js index 6908e36b7c81e..03f6b596d7643 100644 --- a/test/lib/utils/open-url-prompt.js +++ b/test/lib/utils/open-url-prompt.js @@ -28,6 +28,8 @@ const opener = (url, opts, cb) => { } let questionShouldResolve = true +let openUrlPromptInterrupted = false + const readline = { createInterface: () => ({ question: (_q, cb) => { @@ -36,6 +38,11 @@ const readline = { } }, close: () => {}, + on: (_signal, cb) => { + if (openUrlPromptInterrupted && _signal === 'SIGINT') { + cb() + } + }, }), } @@ -148,3 +155,25 @@ t.test('returns error when opener errors', async t => { ) t.equal(openerUrl, 'https://www.npmjs.com', 'did not open') }) + +t.test('throws "canceled" error on SIGINT', async t => { + t.teardown(() => { + openerUrl = null + openerOpts = null + OUTPUT.length = 0 + questionShouldResolve = true + openUrlPromptInterrupted = false + }) + + questionShouldResolve = false + openUrlPromptInterrupted = true + const emitter = new EventEmitter() + + const open = openUrlPrompt(npm, 'https://www.npmjs.com', 'npm home', 'prompt', emitter) + + try { + await open + } catch (err) { + t.equal(err.message, 'canceled') + } +}) From fd030c86b1e01b7df1b9d73fda07496742a4737f Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 2 Aug 2022 12:57:18 -0700 Subject: [PATCH 007/175] deps: npm-profile@6.2.1 (#5245) --- DEPENDENCIES.md | 12 +++++++++++- node_modules/npm-profile/lib/index.js | 9 ++++----- node_modules/npm-profile/package.json | 2 +- package-lock.json | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 421efae116298..5fc3ac432104d 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -157,6 +157,7 @@ graph LR; npmcli-arborist-->npmcli-name-from-folder["@npmcli/name-from-folder"]; npmcli-arborist-->npmcli-node-gyp["@npmcli/node-gyp"]; npmcli-arborist-->npmcli-package-json["@npmcli/package-json"]; + npmcli-arborist-->npmcli-query["@npmcli/query"]; npmcli-arborist-->npmcli-run-script["@npmcli/run-script"]; npmcli-arborist-->npmcli-template-oss["@npmcli/template-oss"]; npmcli-arborist-->npmlog; @@ -186,6 +187,8 @@ graph LR; npmcli-metavuln-calculator-->pacote; npmcli-metavuln-calculator-->semver; npmcli-promise-spawn-->infer-owner; + npmcli-query-->npm-package-arg; + npmcli-query-->semver; npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"]; npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"]; npmcli-run-script-->read-package-json-fast; @@ -567,6 +570,7 @@ graph LR; npmcli-arborist-->json-parse-even-better-errors; npmcli-arborist-->json-stringify-nice; npmcli-arborist-->minify-registry-metadata; + npmcli-arborist-->minimatch; npmcli-arborist-->mkdirp-infer-owner; npmcli-arborist-->mkdirp; npmcli-arborist-->nock; @@ -583,6 +587,7 @@ graph LR; npmcli-arborist-->npmcli-name-from-folder["@npmcli/name-from-folder"]; npmcli-arborist-->npmcli-node-gyp["@npmcli/node-gyp"]; npmcli-arborist-->npmcli-package-json["@npmcli/package-json"]; + npmcli-arborist-->npmcli-query["@npmcli/query"]; npmcli-arborist-->npmcli-run-script["@npmcli/run-script"]; npmcli-arborist-->npmcli-template-oss["@npmcli/template-oss"]; npmcli-arborist-->npmlog; @@ -634,6 +639,9 @@ graph LR; npmcli-move-file-->rimraf; npmcli-package-json-->json-parse-even-better-errors; npmcli-promise-spawn-->infer-owner; + npmcli-query-->npm-package-arg; + npmcli-query-->postcss-selector-parser; + npmcli-query-->semver; npmcli-run-script-->node-gyp; npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"]; npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"]; @@ -669,6 +677,8 @@ graph LR; parse-conflict-json-->json-parse-even-better-errors; parse-conflict-json-->just-diff-apply; parse-conflict-json-->just-diff; + postcss-selector-parser-->cssesc; + postcss-selector-parser-->util-deprecate; promise-retry-->err-code; promise-retry-->retry; promzard-->read; @@ -742,6 +752,6 @@ packages higher up the chain. - pacote, libnpmaccess, libnpmhook, libnpmorg, libnpmsearch, libnpmteam, npm-profile - npm-registry-fetch - make-fetch-happen, libnpmversion, @npmcli/config, init-package-json - - @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, @npmcli/git, @npmcli/run-script, npm-packlist, read-package-json, readdir-scoped-modules, promzard + - @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, @npmcli/git, @npmcli/run-script, npm-packlist, read-package-json, @npmcli/query, readdir-scoped-modules, promzard - npm-bundled, read-package-json-fast, @npmcli/fs, unique-filename, @npmcli/promise-spawn, npm-package-arg, normalize-package-data, bin-links, nopt, npm-install-checks, npmlog, dezalgo, read - npm-normalize-package-bin, @npmcli/name-from-folder, semver, @npmcli/move-file, fs-minipass, infer-owner, ssri, unique-slug, proc-log, @npmcli/node-gyp, hosted-git-info, validate-npm-package-name, ignore-walk, minipass-fetch, @npmcli/package-json, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, parse-conflict-json, wrappy, treeverse, @npmcli/eslint-config, @npmcli/template-oss, @npmcli/disparity-colors, @npmcli/ci-detect, mute-stream, ini, npm-audit-report, npm-user-validate \ No newline at end of file diff --git a/node_modules/npm-profile/lib/index.js b/node_modules/npm-profile/lib/index.js index e4ac5622e0d5c..ce78882a55438 100644 --- a/node_modules/npm-profile/lib/index.js +++ b/node_modules/npm-profile/lib/index.js @@ -56,13 +56,11 @@ const webAuth = (opener, opts, body) => { const { hostname } = opts body.hostname = hostname || os.hostname() const target = '/-/v1/login' + const doneEmitter = new EventEmitter() return fetch(target, { ...opts, method: 'POST', body, - headers: { - 'npm-use-webauthn': opts.authType === 'webauthn', - }, }).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { @@ -75,8 +73,6 @@ const webAuth = (opener, opts, body) => { }).then(({ doneUrl, loginUrl }) => { log.verbose('web auth', 'opening url pair') - const doneEmitter = new EventEmitter() - const openPromise = opener(loginUrl, doneEmitter) const webAuthCheckPromise = webAuthCheckLogin(doneUrl, { ...opts, cache: false }) .then(authResult => { @@ -93,6 +89,9 @@ const webAuth = (opener, opts, body) => { ([, authResult]) => authResult ) }).catch(er => { + // cancel open prompt if it's present + doneEmitter.emit('abort') + if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) { throw new WebLoginNotSupported('POST', { status: er.statusCode, diff --git a/node_modules/npm-profile/package.json b/node_modules/npm-profile/package.json index bd4ebd3176115..457a1fb0988fb 100644 --- a/node_modules/npm-profile/package.json +++ b/node_modules/npm-profile/package.json @@ -1,6 +1,6 @@ { "name": "npm-profile", - "version": "6.2.0", + "version": "6.2.1", "description": "Library for updating an npmjs.com profile", "keywords": [], "author": "GitHub Inc.", diff --git a/package-lock.json b/package-lock.json index 3eba393001c46..f947eef55389a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5199,9 +5199,9 @@ } }, "node_modules/npm-profile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.2.0.tgz", - "integrity": "sha512-wG7ZAsLvhqDc2b9COAuGUJgPRUfvCnQI8NEYeifSHZpSYXAgTsHu5812kkcwZeX/5WPd/ARX/MJRWTBFjlUxvg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.2.1.tgz", + "integrity": "sha512-Tlu13duByHyDd4Xy0PgroxzxnBYWbGGL5aZifNp8cx2DxUrHSoETXtPKg38aRPsBWMRfDtvcvVfJNasj7oImQQ==", "inBundle": true, "dependencies": { "npm-registry-fetch": "^13.0.1", From 703dbbf2a8149dff72c848d60600889a76779828 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Tue, 2 Aug 2022 14:44:59 -0700 Subject: [PATCH 008/175] feat: add --replace-registry-host= (#4860) feat: add --replace-registry-host=| --- docs/content/using-npm/config.md | 18 +++ lib/utils/config/definitions.js | 18 +++ .../test/lib/commands/config.js.test.cjs | 2 + .../lib/utils/config/definitions.js.test.cjs | 18 +++ .../lib/utils/config/describe-all.js.test.cjs | 18 +++ workspaces/arborist/lib/arborist/index.js | 4 + workspaces/arborist/lib/arborist/reify.js | 10 +- workspaces/arborist/test/arborist/index.js | 9 ++ workspaces/arborist/test/arborist/reify.js | 130 ++++++++++++++++++ workspaces/arborist/test/fixtures/tnock.js | 14 ++ 10 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 workspaces/arborist/test/fixtures/tnock.js diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index e3e1bd6c73bb3..4689d340b5878 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -1393,6 +1393,24 @@ The base URL of the npm registry. +#### `replace-registry-host` + +* Default: "npmjs" +* Type: "npmjs", "never", "always", or String + +Defines behavior for replacing the registry host in a lockfile with the +configured registry. + +The default behavior is to replace package dist URLs from the default +registry (https://registry.npmjs.org) to the configured registry. If set to +"never", then use the registry value. If set to "always", then replace the +registry host with the configured host every time. + +You may also specify a bare hostname (e.g., "registry.npmjs.org"). + + + + #### `save` * Default: `true` unless when using `npm update` where it defaults to `false` diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 7d6af2473f2bd..04576df0abf8e 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1649,6 +1649,24 @@ define('registry', { flatten, }) +define('replace-registry-host', { + default: 'npmjs', + hint: ' | hostname', + type: ['npmjs', 'never', 'always', String], + description: ` + Defines behavior for replacing the registry host in a lockfile with the + configured registry. + + The default behavior is to replace package dist URLs from the default + registry (https://registry.npmjs.org) to the configured registry. If set to + "never", then use the registry value. If set to "always", then replace the + registry host with the configured host every time. + + You may also specify a bare hostname (e.g., "registry.npmjs.org"). + `, + flatten, +}) + define('save', { default: true, defaultDescription: `\`true\` unless when using \`npm update\` where it diff --git a/tap-snapshots/test/lib/commands/config.js.test.cjs b/tap-snapshots/test/lib/commands/config.js.test.cjs index fe392344ed35a..5c3f86415dfff 100644 --- a/tap-snapshots/test/lib/commands/config.js.test.cjs +++ b/tap-snapshots/test/lib/commands/config.js.test.cjs @@ -121,6 +121,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna "read-only": false, "rebuild-bundle": true, "registry": "https://registry.npmjs.org/", + "replace-registry-host": "npmjs", "save": true, "save-bundle": false, "save-dev": false, @@ -277,6 +278,7 @@ proxy = null read-only = false rebuild-bundle = true registry = "https://registry.npmjs.org/" +replace-registry-host = "npmjs" save = true save-bundle = false save-dev = false diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 89c9969d69424..324118f1de1b1 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -116,6 +116,7 @@ Array [ "read-only", "rebuild-bundle", "registry", + "replace-registry-host", "save", "save-bundle", "save-dev", @@ -1460,6 +1461,23 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for regis The base URL of the npm registry. ` +exports[`test/lib/utils/config/definitions.js TAP > config description for replace-registry-host 1`] = ` +#### \`replace-registry-host\` + +* Default: "npmjs" +* Type: "npmjs", "never", "always", or String + +Defines behavior for replacing the registry host in a lockfile with the +configured registry. + +The default behavior is to replace package dist URLs from the default +registry (https://registry.npmjs.org) to the configured registry. If set to +"never", then use the registry value. If set to "always", then replace the +registry host with the configured host every time. + +You may also specify a bare hostname (e.g., "registry.npmjs.org"). +` + exports[`test/lib/utils/config/definitions.js TAP > config description for save 1`] = ` #### \`save\` diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index a9247f49c0418..032caefbda18e 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -1266,6 +1266,24 @@ The base URL of the npm registry. +#### \`replace-registry-host\` + +* Default: "npmjs" +* Type: "npmjs", "never", "always", or String + +Defines behavior for replacing the registry host in a lockfile with the +configured registry. + +The default behavior is to replace package dist URLs from the default +registry (https://registry.npmjs.org) to the configured registry. If set to +"never", then use the registry value. If set to "always", then replace the +registry host with the configured host every time. + +You may also specify a bare hostname (e.g., "registry.npmjs.org"). + + + + #### \`save\` * Default: \`true\` unless when using \`npm update\` where it defaults to \`false\` diff --git a/workspaces/arborist/lib/arborist/index.js b/workspaces/arborist/lib/arborist/index.js index cb6ef1e0c2ccb..9564f7648f92c 100644 --- a/workspaces/arborist/lib/arborist/index.js +++ b/workspaces/arborist/lib/arborist/index.js @@ -74,8 +74,12 @@ class Arborist extends Base { cache: options.cache || `${homedir()}/.npm/_cacache`, packumentCache: options.packumentCache || new Map(), workspacesEnabled: options.workspacesEnabled !== false, + replaceRegistryHost: options.replaceRegistryHost, lockfileVersion: lockfileVersion(options.lockfileVersion), } + this.replaceRegistryHost = this.options.replaceRegistryHost = + (!this.options.replaceRegistryHost || this.options.replaceRegistryHost === 'npmjs') ? + 'registry.npmjs.org' : this.options.replaceRegistryHost this[_workspacesEnabled] = this.options.workspacesEnabled diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index 4f1061e4abe50..7663a3a342cc6 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -712,13 +712,19 @@ module.exports = cls => class Reifier extends cls { [_registryResolved] (resolved) { // the default registry url is a magic value meaning "the currently // configured registry". + // `resolved` must never be falsey. // // XXX: use a magic string that isn't also a valid value, like // ${REGISTRY} or something. This has to be threaded through the // Shrinkwrap and Node classes carefully, so for now, just treat // the default reg as the magical animal that it has been. - return resolved && resolved - .replace(/^https?:\/\/registry\.npmjs\.org\//, this.registry) + const resolvedURL = new URL(resolved) + if ((this.options.replaceRegistryHost === resolvedURL.hostname) + || this.options.replaceRegistryHost === 'always') { + // this.registry always has a trailing slash + resolved = `${this.registry.slice(0, -1)}${resolvedURL.pathname}${resolvedURL.searchParams}` + } + return resolved } // bundles are *sort of* like shrinkwraps, in that the branch is defined diff --git a/workspaces/arborist/test/arborist/index.js b/workspaces/arborist/test/arborist/index.js index 3469c5c73591d..7f69eb36ef74f 100644 --- a/workspaces/arborist/test/arborist/index.js +++ b/workspaces/arborist/test/arborist/index.js @@ -236,3 +236,12 @@ t.test('lockfileVersion config validation', async t => { message: 'Invalid lockfileVersion config: banana', }) }) + +t.test('valid replaceRegistryHost values', t => { + t.equal(new Arborist({ replaceRegistryHost: 'registry.garbage.com' }).options.replaceRegistryHost, 'registry.garbage.com') + t.equal(new Arborist({ replaceRegistryHost: 'npmjs' }).options.replaceRegistryHost, 'registry.npmjs.org') + t.equal(new Arborist({ replaceRegistryHost: undefined }).options.replaceRegistryHost, 'registry.npmjs.org') + t.equal(new Arborist({ replaceRegistryHost: 'always' }).options.replaceRegistryHost, 'always') + t.equal(new Arborist({ replaceRegistryHost: 'never' }).options.replaceRegistryHost, 'never') + t.end() +}) diff --git a/workspaces/arborist/test/arborist/reify.js b/workspaces/arborist/test/arborist/reify.js index 406b4281dc5be..db5a9c1fe1af6 100644 --- a/workspaces/arborist/test/arborist/reify.js +++ b/workspaces/arborist/test/arborist/reify.js @@ -2,6 +2,7 @@ const { join, resolve, basename } = require('path') const t = require('tap') const runScript = require('@npmcli/run-script') const localeCompare = require('@isaacs/string-locale-compare')('en') +const tnock = require('../fixtures/tnock') // mock rimraf so we can make it fail in rollback tests const realRimraf = require('rimraf') @@ -2923,3 +2924,132 @@ t.test('installLinks', (t) => { t.end() }) + +t.only('should preserve exact ranges, missing actual tree', 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', + }, + }, + }, + }) + + const abbrevPackument2 = 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.garbage.org/abbrev/-/abbrev-1.1.1.tgz', + }, + }, + }, + }) + + t.only('host should not be replaced replaceRegistryHost=never', 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.github.com') + .get('/abbrev') + .reply(200, abbrevPackument) + + tnock(t, 'https://registry.npmjs.org') + .get('/abbrev/-/abbrev-1.1.1.tgz') + .reply(200, abbrevTGZ) + + const arb = new Arborist({ + path: resolve(testdir, 'project'), + registry: 'https://registry.github.com', + cache: resolve(testdir, 'cache'), + replaceRegistryHost: 'never', + }) + await arb.reify() + }) + + t.only('host should be replaced replaceRegistryHost=npmjs', 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.github.com') + .get('/abbrev') + .reply(200, abbrevPackument) + + tnock(t, 'https://registry.github.com') + .get('/abbrev/-/abbrev-1.1.1.tgz') + .reply(200, abbrevTGZ) + + const arb = new Arborist({ + path: resolve(testdir, 'project'), + registry: 'https://registry.github.com', + cache: resolve(testdir, 'cache'), + replaceRegistryHost: 'npmjs', + }) + await arb.reify() + }) + + t.only('host should be always replaceRegistryHost=always', 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.github.com') + .get('/abbrev') + .reply(200, abbrevPackument2) + + tnock(t, 'https://registry.github.com') + .get('/abbrev/-/abbrev-1.1.1.tgz') + .reply(200, abbrevTGZ) + + const arb = new Arborist({ + path: resolve(testdir, 'project'), + registry: 'https://registry.github.com', + cache: resolve(testdir, 'cache'), + replaceRegistryHost: 'always', + }) + await arb.reify() + }) +}) diff --git a/workspaces/arborist/test/fixtures/tnock.js b/workspaces/arborist/test/fixtures/tnock.js new file mode 100644 index 0000000000000..2e07f73647892 --- /dev/null +++ b/workspaces/arborist/test/fixtures/tnock.js @@ -0,0 +1,14 @@ +'use strict' + +const nock = require('nock') + +module.exports = tnock +function tnock (t, host) { + const server = nock(host) + nock.disableNetConnect() + t.teardown(function () { + nock.enableNetConnect() + server.done() + }) + return server +} From c18dbc4393491e02532d698351747307848d2e20 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Aug 2022 08:51:55 -0700 Subject: [PATCH 009/175] deps: add @npmcli/fs@2.1.1 --- DEPENDENCIES.md | 2 + .../fs/lib/common/file-url-to-path/index.js | 17 --- .../lib/common/file-url-to-path/polyfill.js | 121 ------------------ .../@npmcli/fs/lib/common/owner-sync.js | 4 +- node_modules/@npmcli/fs/lib/common/owner.js | 4 +- node_modules/@npmcli/fs/lib/index.js | 2 +- node_modules/@npmcli/fs/lib/mkdir.js | 19 +++ node_modules/@npmcli/fs/lib/mkdir/index.js | 29 ----- node_modules/@npmcli/fs/lib/mkdir/polyfill.js | 81 ------------ node_modules/@npmcli/fs/lib/with-temp-dir.js | 2 +- node_modules/@npmcli/fs/package.json | 8 +- package-lock.json | 7 +- workspaces/libnpmexec/package.json | 1 + 13 files changed, 36 insertions(+), 261 deletions(-) delete mode 100644 node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js delete mode 100644 node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js create mode 100644 node_modules/@npmcli/fs/lib/mkdir.js delete mode 100644 node_modules/@npmcli/fs/lib/mkdir/index.js delete mode 100644 node_modules/@npmcli/fs/lib/mkdir/polyfill.js diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 5fc3ac432104d..0223c09b8315a 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -35,6 +35,7 @@ graph LR; libnpmexec-->npmcli-arborist["@npmcli/arborist"]; libnpmexec-->npmcli-ci-detect["@npmcli/ci-detect"]; libnpmexec-->npmcli-eslint-config["@npmcli/eslint-config"]; + libnpmexec-->npmcli-fs["@npmcli/fs"]; libnpmexec-->npmcli-run-script["@npmcli/run-script"]; libnpmexec-->npmcli-template-oss["@npmcli/template-oss"]; libnpmexec-->npmlog; @@ -345,6 +346,7 @@ graph LR; libnpmexec-->npmcli-arborist["@npmcli/arborist"]; libnpmexec-->npmcli-ci-detect["@npmcli/ci-detect"]; libnpmexec-->npmcli-eslint-config["@npmcli/eslint-config"]; + libnpmexec-->npmcli-fs["@npmcli/fs"]; libnpmexec-->npmcli-run-script["@npmcli/run-script"]; libnpmexec-->npmcli-template-oss["@npmcli/template-oss"]; libnpmexec-->npmlog; diff --git a/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js b/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js deleted file mode 100644 index 7755d1c10e6d0..0000000000000 --- a/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js +++ /dev/null @@ -1,17 +0,0 @@ -const url = require('url') - -const node = require('../node.js') -const polyfill = require('./polyfill.js') - -const useNative = node.satisfies('>=10.12.0') - -const fileURLToPath = (path) => { - // the polyfill is tested separately from this module, no need to hack - // process.version to try to trigger it just for coverage - // istanbul ignore next - return useNative - ? url.fileURLToPath(path) - : polyfill(path) -} - -module.exports = fileURLToPath diff --git a/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js b/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js deleted file mode 100644 index 6cc90f0b07d79..0000000000000 --- a/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js +++ /dev/null @@ -1,121 +0,0 @@ -const { URL, domainToUnicode } = require('url') - -const CHAR_LOWERCASE_A = 97 -const CHAR_LOWERCASE_Z = 122 - -const isWindows = process.platform === 'win32' - -class ERR_INVALID_FILE_URL_HOST extends TypeError { - constructor (platform) { - super(`File URL host must be "localhost" or empty on ${platform}`) - this.code = 'ERR_INVALID_FILE_URL_HOST' - } - - toString () { - return `${this.name} [${this.code}]: ${this.message}` - } -} - -class ERR_INVALID_FILE_URL_PATH extends TypeError { - constructor (msg) { - super(`File URL path ${msg}`) - this.code = 'ERR_INVALID_FILE_URL_PATH' - } - - toString () { - return `${this.name} [${this.code}]: ${this.message}` - } -} - -class ERR_INVALID_ARG_TYPE extends TypeError { - constructor (name, actual) { - super(`The "${name}" argument must be one of type string or an instance ` + - `of URL. Received type ${typeof actual} ${actual}`) - this.code = 'ERR_INVALID_ARG_TYPE' - } - - toString () { - return `${this.name} [${this.code}]: ${this.message}` - } -} - -class ERR_INVALID_URL_SCHEME extends TypeError { - constructor (expected) { - super(`The URL must be of scheme ${expected}`) - this.code = 'ERR_INVALID_URL_SCHEME' - } - - toString () { - return `${this.name} [${this.code}]: ${this.message}` - } -} - -const isURLInstance = (input) => { - return input != null && input.href && input.origin -} - -const getPathFromURLWin32 = (url) => { - const hostname = url.hostname - let pathname = url.pathname - for (let n = 0; n < pathname.length; n++) { - if (pathname[n] === '%') { - const third = pathname.codePointAt(n + 2) | 0x20 - if ((pathname[n + 1] === '2' && third === 102) || - (pathname[n + 1] === '5' && third === 99)) { - throw new ERR_INVALID_FILE_URL_PATH('must not include encoded \\ or / characters') - } - } - } - - pathname = pathname.replace(/\//g, '\\') - pathname = decodeURIComponent(pathname) - if (hostname !== '') { - return `\\\\${domainToUnicode(hostname)}${pathname}` - } - - const letter = pathname.codePointAt(1) | 0x20 - const sep = pathname[2] - if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || - (sep !== ':')) { - throw new ERR_INVALID_FILE_URL_PATH('must be absolute') - } - - return pathname.slice(1) -} - -const getPathFromURLPosix = (url) => { - if (url.hostname !== '') { - throw new ERR_INVALID_FILE_URL_HOST(process.platform) - } - - const pathname = url.pathname - - for (let n = 0; n < pathname.length; n++) { - if (pathname[n] === '%') { - const third = pathname.codePointAt(n + 2) | 0x20 - if (pathname[n + 1] === '2' && third === 102) { - throw new ERR_INVALID_FILE_URL_PATH('must not include encoded / characters') - } - } - } - - return decodeURIComponent(pathname) -} - -const fileURLToPath = (path) => { - if (typeof path === 'string') { - path = new URL(path) - } else if (!isURLInstance(path)) { - throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path) - } - - if (path.protocol !== 'file:') { - throw new ERR_INVALID_URL_SCHEME('file') - } - - return isWindows - ? getPathFromURLWin32(path) - : getPathFromURLPosix(path) -} - -module.exports = fileURLToPath diff --git a/node_modules/@npmcli/fs/lib/common/owner-sync.js b/node_modules/@npmcli/fs/lib/common/owner-sync.js index 2055c4b21dec9..8fa18d5121eff 100644 --- a/node_modules/@npmcli/fs/lib/common/owner-sync.js +++ b/node_modules/@npmcli/fs/lib/common/owner-sync.js @@ -1,6 +1,6 @@ const { dirname, resolve } = require('path') +const url = require('url') -const fileURLToPath = require('./file-url-to-path/index.js') const fs = require('../fs.js') // given a path, find the owner of the nearest parent @@ -13,7 +13,7 @@ const find = (path) => { // fs methods accept URL objects with a scheme of file: so we need to unwrap // those into an actual path string before we can resolve it const resolved = path != null && path.href && path.origin - ? resolve(fileURLToPath(path)) + ? resolve(url.fileURLToPath(path)) : resolve(path) let stat diff --git a/node_modules/@npmcli/fs/lib/common/owner.js b/node_modules/@npmcli/fs/lib/common/owner.js index e3468b077d00e..3fe167cfc30aa 100644 --- a/node_modules/@npmcli/fs/lib/common/owner.js +++ b/node_modules/@npmcli/fs/lib/common/owner.js @@ -1,6 +1,6 @@ const { dirname, resolve } = require('path') +const url = require('url') -const fileURLToPath = require('./file-url-to-path/index.js') const fs = require('../fs.js') // given a path, find the owner of the nearest parent @@ -13,7 +13,7 @@ const find = async (path) => { // fs methods accept URL objects with a scheme of file: so we need to unwrap // those into an actual path string before we can resolve it const resolved = path != null && path.href && path.origin - ? resolve(fileURLToPath(path)) + ? resolve(url.fileURLToPath(path)) : resolve(path) let stat diff --git a/node_modules/@npmcli/fs/lib/index.js b/node_modules/@npmcli/fs/lib/index.js index 43892df5fee07..3a98648eca9a1 100644 --- a/node_modules/@npmcli/fs/lib/index.js +++ b/node_modules/@npmcli/fs/lib/index.js @@ -2,7 +2,7 @@ module.exports = { ...require('./fs.js'), copyFile: require('./copy-file.js'), cp: require('./cp/index.js'), - mkdir: require('./mkdir/index.js'), + mkdir: require('./mkdir.js'), mkdtemp: require('./mkdtemp.js'), rm: require('./rm/index.js'), withTempDir: require('./with-temp-dir.js'), diff --git a/node_modules/@npmcli/fs/lib/mkdir.js b/node_modules/@npmcli/fs/lib/mkdir.js new file mode 100644 index 0000000000000..098d8d0a09ae3 --- /dev/null +++ b/node_modules/@npmcli/fs/lib/mkdir.js @@ -0,0 +1,19 @@ +const fs = require('./fs.js') +const getOptions = require('./common/get-options.js') +const withOwner = require('./with-owner.js') + +// extends mkdir with the ability to specify an owner of the new dir +const mkdir = async (path, opts) => { + const options = getOptions(opts, { + copy: ['mode', 'recursive'], + wrap: 'mode', + }) + + return withOwner( + path, + () => fs.mkdir(path, options), + opts + ) +} + +module.exports = mkdir diff --git a/node_modules/@npmcli/fs/lib/mkdir/index.js b/node_modules/@npmcli/fs/lib/mkdir/index.js deleted file mode 100644 index e2691042daa26..0000000000000 --- a/node_modules/@npmcli/fs/lib/mkdir/index.js +++ /dev/null @@ -1,29 +0,0 @@ -const fs = require('../fs.js') -const getOptions = require('../common/get-options.js') -const node = require('../common/node.js') -const withOwner = require('../with-owner.js') - -const polyfill = require('./polyfill.js') - -// node 10.12.0 added the options parameter, which allows recursive and mode -// properties to be passed -const useNative = node.satisfies('>=10.12.0') - -// extends mkdir with the ability to specify an owner of the new dir -const mkdir = async (path, opts) => { - const options = getOptions(opts, { - copy: ['mode', 'recursive'], - wrap: 'mode', - }) - - // the polyfill is tested separately from this module, no need to hack - // process.version to try to trigger it just for coverage - // istanbul ignore next - return withOwner( - path, - () => useNative ? fs.mkdir(path, options) : polyfill(path, options), - opts - ) -} - -module.exports = mkdir diff --git a/node_modules/@npmcli/fs/lib/mkdir/polyfill.js b/node_modules/@npmcli/fs/lib/mkdir/polyfill.js deleted file mode 100644 index 4f8e6f006a30e..0000000000000 --- a/node_modules/@npmcli/fs/lib/mkdir/polyfill.js +++ /dev/null @@ -1,81 +0,0 @@ -const { dirname } = require('path') - -const fileURLToPath = require('../common/file-url-to-path/index.js') -const fs = require('../fs.js') - -const defaultOptions = { - mode: 0o777, - recursive: false, -} - -const mkdir = async (path, opts) => { - const options = { ...defaultOptions, ...opts } - - // if we're not in recursive mode, just call the real mkdir with the path and - // the mode option only - if (!options.recursive) { - return fs.mkdir(path, options.mode) - } - - const makeDirectory = async (dir, mode) => { - // we can't use dirname directly since these functions support URL - // objects with the file: protocol as the path input, so first we get a - // string path, then we can call dirname on that - const parent = dir != null && dir.href && dir.origin - ? dirname(fileURLToPath(dir)) - : dirname(dir) - - // if the parent is the dir itself, try to create it. anything but EISDIR - // should be rethrown - if (parent === dir) { - try { - await fs.mkdir(dir, opts) - } catch (err) { - if (err.code !== 'EISDIR') { - throw err - } - } - return undefined - } - - try { - await fs.mkdir(dir, mode) - return dir - } catch (err) { - // ENOENT means the parent wasn't there, so create that - if (err.code === 'ENOENT') { - const made = await makeDirectory(parent, mode) - await makeDirectory(dir, mode) - // return the shallowest path we created, i.e. the result of creating - // the parent - return made - } - - // an EEXIST means there's already something there - // an EROFS means we have a read-only filesystem and can't create a dir - // any other error is fatal and we should give up now - if (err.code !== 'EEXIST' && err.code !== 'EROFS') { - throw err - } - - // stat the directory, if the result is a directory, then we successfully - // created this one so return its path. otherwise, we reject with the - // original error by ignoring the error in the catch - try { - const stat = await fs.stat(dir) - if (stat.isDirectory()) { - // if it already existed, we didn't create anything so return - // undefined - return undefined - } - } catch (_) {} - - // if the thing that's there isn't a directory, then just re-throw - throw err - } - } - - return makeDirectory(path, options.mode) -} - -module.exports = mkdir diff --git a/node_modules/@npmcli/fs/lib/with-temp-dir.js b/node_modules/@npmcli/fs/lib/with-temp-dir.js index ac9ebb714b989..ad08e6ee6e6d6 100644 --- a/node_modules/@npmcli/fs/lib/with-temp-dir.js +++ b/node_modules/@npmcli/fs/lib/with-temp-dir.js @@ -1,7 +1,7 @@ const { join, sep } = require('path') const getOptions = require('./common/get-options.js') -const mkdir = require('./mkdir/index.js') +const mkdir = require('./mkdir.js') const mkdtemp = require('./mkdtemp.js') const rm = require('./rm/index.js') diff --git a/node_modules/@npmcli/fs/package.json b/node_modules/@npmcli/fs/package.json index 799bf514f200b..9e18028218d1a 100644 --- a/node_modules/@npmcli/fs/package.json +++ b/node_modules/@npmcli/fs/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/fs", - "version": "2.1.0", + "version": "2.1.1", "description": "filesystem utilities for the npm cli", "main": "lib/index.js", "files": [ @@ -33,8 +33,8 @@ "license": "ISC", "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.1.2", - "tap": "^15.1.6" + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" }, "dependencies": { "@gar/promisify": "^1.1.3", @@ -45,6 +45,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.1.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index f947eef55389a..baf220b12e6ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -916,9 +916,9 @@ } }, "node_modules/@npmcli/fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.0.tgz", - "integrity": "sha512-DmfBvNXGaetMxj9LTp8NAN9vEidXURrf5ZTslQzEAi/6GbW+4yjaLFQc6Tue5cpZ9Frlk4OBo/Snf1Bh/S7qTQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.1.tgz", + "integrity": "sha512-1Q0uzx6c/NVNGszePbr5Gc2riSU1zLpNlo/1YWntH+eaPmMgBssAW0qXofCVkpdj3ce4swZtlDYQu+NKiYcptg==", "inBundle": true, "dependencies": { "@gar/promisify": "^1.1.3", @@ -10136,6 +10136,7 @@ "dependencies": { "@npmcli/arborist": "^5.0.0", "@npmcli/ci-detect": "^2.0.0", + "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.1.3", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index d163103ea2b0b..e0be916765593 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -57,6 +57,7 @@ "dependencies": { "@npmcli/arborist": "^5.0.0", "@npmcli/ci-detect": "^2.0.0", + "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.1.3", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", From cd6bafdfbbd7a054709c11850b58f7dbc26eb8da Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Aug 2022 08:52:38 -0700 Subject: [PATCH 010/175] deps: add semver@7.3.7 --- DEPENDENCIES.md | 2 ++ package-lock.json | 1 + workspaces/libnpmexec/package.json | 1 + 3 files changed, 4 insertions(+) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 0223c09b8315a..92b0b85846804 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -43,6 +43,7 @@ graph LR; libnpmexec-->proc-log; libnpmexec-->read-package-json-fast; libnpmexec-->read; + libnpmexec-->semver; libnpmfund-->npmcli-arborist["@npmcli/arborist"]; libnpmfund-->npmcli-eslint-config["@npmcli/eslint-config"]; libnpmfund-->npmcli-template-oss["@npmcli/template-oss"]; @@ -354,6 +355,7 @@ graph LR; libnpmexec-->proc-log; libnpmexec-->read-package-json-fast; libnpmexec-->read; + libnpmexec-->semver; libnpmexec-->tap; libnpmexec-->walk-up-path; libnpmfund-->npmcli-arborist["@npmcli/arborist"]; diff --git a/package-lock.json b/package-lock.json index baf220b12e6ea..16e153b1dad9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10146,6 +10146,7 @@ "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", + "semver": "^7.3.7", "walk-up-path": "^1.0.0" }, "devDependencies": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index e0be916765593..58c546fc2c8d9 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -67,6 +67,7 @@ "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", + "semver": "^7.3.7", "walk-up-path": "^1.0.0" }, "templateOSS": { From d0be9a2bb53e74b30e13751afd1f6924990c8422 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Aug 2022 10:12:34 -0700 Subject: [PATCH 011/175] deps: @npmcli/run-script@4.2.0 - add `binPaths` param --- .../@npmcli/run-script/lib/make-spawn-args.js | 7 +++++-- .../@npmcli/run-script/lib/run-script-pkg.js | 2 ++ node_modules/@npmcli/run-script/lib/set-path.js | 12 ++++++------ node_modules/@npmcli/run-script/package.json | 2 +- package-lock.json | 10 +++++----- package.json | 2 +- workspaces/libnpmexec/package.json | 2 +- 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/node_modules/@npmcli/run-script/lib/make-spawn-args.js index f2253d7cc607b..7725fd976c893 100644 --- a/node_modules/@npmcli/run-script/lib/make-spawn-args.js +++ b/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -20,6 +20,7 @@ const makeSpawnArgs = options => { event, path, scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh', + binPaths, env = {}, stdio, cmd, @@ -27,7 +28,7 @@ const makeSpawnArgs = options => { stdioString = false, } = options - const spawnEnv = setPATH(path, { + const spawnEnv = setPATH(path, binPaths, { // we need to at least save the PATH environment var ...process.env, ...env, @@ -100,7 +101,9 @@ const makeSpawnArgs = options => { // delete the script, this is just a best effort try { unlink(scriptFile) - } catch (err) {} + } catch (err) { + // ignore errors + } } return [scriptShell, spawnArgs, spawnOpts, cleanup] diff --git a/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node_modules/@npmcli/run-script/lib/run-script-pkg.js index 84c5e2bfe0c52..ec6ef31e50ab0 100644 --- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -14,6 +14,7 @@ const runScriptPkg = async options => { event, path, scriptShell, + binPaths = false, env = {}, stdio = 'pipe', pkg, @@ -58,6 +59,7 @@ const runScriptPkg = async options => { event, path, scriptShell, + binPaths, env: packageEnvs(env, pkg), stdio, cmd, diff --git a/node_modules/@npmcli/run-script/lib/set-path.js b/node_modules/@npmcli/run-script/lib/set-path.js index 07671f44579dc..c59c270d9969a 100644 --- a/node_modules/@npmcli/run-script/lib/set-path.js +++ b/node_modules/@npmcli/run-script/lib/set-path.js @@ -1,5 +1,4 @@ -const { resolve, dirname } = require('path') -const isWindows = require('./is-windows.js') +const { resolve, dirname, delimiter } = require('path') // the path here is relative, even though it does not need to be // in order to make the posix tests pass in windows const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin') @@ -7,18 +6,19 @@ const nodeGypPath = resolve(__dirname, '../lib/node-gyp-bin') // Windows typically calls its PATH environ 'Path', but this is not // guaranteed, nor is it guaranteed to be the only one. Merge them // all together in the order they appear in the object. -const setPATH = (projectPath, env) => { - // not require('path').delimiter, because we fake this for testing - const delimiter = isWindows ? ';' : ':' +const setPATH = (projectPath, binPaths, env) => { const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p]) .map(p => env[p].split(delimiter)) .reduce((set, p) => set.concat(p.filter(concatted => !set.includes(concatted))), []) .join(delimiter) const pathArr = [] + if (binPaths) { + pathArr.push(...binPaths) + } // unshift the ./node_modules/.bin from every folder // walk up until dirname() does nothing, at the root - // XXX should we specify a cwd that we don't go above? + // XXX we should specify a cwd that we don't go above let p = projectPath let pp do { diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index c096f39421bf1..a6629826d29c2 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "4.1.7", + "version": "4.2.0", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "GitHub Inc.", "license": "ISC", diff --git a/package-lock.json b/package-lock.json index 16e153b1dad9d..4a952e2ff5e50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,7 +94,7 @@ "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^4.1.7", + "@npmcli/run-script": "^4.2.0", "abbrev": "~1.1.1", "archy": "~1.0.0", "cacache": "^16.1.1", @@ -1057,9 +1057,9 @@ } }, "node_modules/@npmcli/run-script": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.1.7.tgz", - "integrity": "sha512-WXr/MyM4tpKA4BotB81NccGAv8B48lNH0gRoILucbcAhTQXLCoi6HflMV3KdXubIqvP9SuLsFn68Z7r4jl+ppw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.0.tgz", + "integrity": "sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA==", "inBundle": true, "dependencies": { "@npmcli/node-gyp": "^2.0.0", @@ -10137,7 +10137,7 @@ "@npmcli/arborist": "^5.0.0", "@npmcli/ci-detect": "^2.0.0", "@npmcli/fs": "^2.1.1", - "@npmcli/run-script": "^4.1.3", + "@npmcli/run-script": "^4.2.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", "npm-package-arg": "^9.0.1", diff --git a/package.json b/package.json index 7526c4754b0ff..1adb37652a075 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^4.1.7", + "@npmcli/run-script": "^4.2.0", "abbrev": "~1.1.1", "archy": "~1.0.0", "cacache": "^16.1.1", diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 58c546fc2c8d9..349e82715f9af 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -58,7 +58,7 @@ "@npmcli/arborist": "^5.0.0", "@npmcli/ci-detect": "^2.0.0", "@npmcli/fs": "^2.1.1", - "@npmcli/run-script": "^4.1.3", + "@npmcli/run-script": "^4.2.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", "npm-package-arg": "^9.0.1", From ea449954844f21abbf984e09e421f0e03485a535 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 Aug 2022 08:50:28 -0700 Subject: [PATCH 012/175] fix: properly find locally/globally/npxCache packages Lots of bugfixes here, we properly parse ranges and versions, and we also now work with git repos and gists, and know when they are already installed. --- docs/content/commands/npm-exec.md | 2 +- docs/content/using-npm/config.md | 2 +- lib/commands/exec.js | 2 + lib/utils/config/definitions.js | 2 +- .../lib/utils/config/definitions.js.test.cjs | 2 +- .../libnpmexec/lib/cache-install-dir.js | 20 - workspaces/libnpmexec/lib/file-exists.js | 22 +- workspaces/libnpmexec/lib/index.js | 216 ++++++----- .../libnpmexec/test/cache-install-dir.js | 12 - workspaces/libnpmexec/test/index.js | 353 +++++++++++++++++- .../content/ruyadorno/create-index.json | 2 +- 11 files changed, 480 insertions(+), 155 deletions(-) delete mode 100644 workspaces/libnpmexec/lib/cache-install-dir.js delete mode 100644 workspaces/libnpmexec/test/cache-install-dir.js diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md index 8ccfa75c73386..3d8de1ea54ad6 100644 --- a/docs/content/commands/npm-exec.md +++ b/docs/content/commands/npm-exec.md @@ -127,7 +127,7 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo * Default: * Type: String (can be set multiple times) -The package to install for [`npm exec`](/commands/npm-exec) +The package or packages to install for [`npm exec`](/commands/npm-exec) diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index 4689d340b5878..cd13237f34dd3 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -1244,7 +1244,7 @@ Directory in which `npm pack` will save tarballs. * Default: * Type: String (can be set multiple times) -The package to install for [`npm exec`](/commands/npm-exec) +The package or packages to install for [`npm exec`](/commands/npm-exec) diff --git a/lib/commands/exec.js b/lib/commands/exec.js index d9a686cc9a3be..0bbf7b3fa0b72 100644 --- a/lib/commands/exec.js +++ b/lib/commands/exec.js @@ -49,8 +49,10 @@ class Exec extends BaseCommand { static isShellout = true async exec (_args, { locationMsg, runPath } = {}) { + // This is where libnpmexec will look for locally installed packages const path = this.npm.localPrefix + // This is where libnpmexec will actually run the scripts from if (!runPath) { runPath = process.cwd() } diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 04576df0abf8e..a132c8456b0fa 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1470,7 +1470,7 @@ define('package', { hint: '', type: [String, Array], description: ` - The package to install for [\`npm exec\`](/commands/npm-exec) + The package or packages to install for [\`npm exec\`](/commands/npm-exec) `, flatten, }) diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 324118f1de1b1..024ad345a5d32 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -1316,7 +1316,7 @@ exports[`test/lib/utils/config/definitions.js TAP > config description for packa * Default: * Type: String (can be set multiple times) -The package to install for [\`npm exec\`](/commands/npm-exec) +The package or packages to install for [\`npm exec\`](/commands/npm-exec) ` exports[`test/lib/utils/config/definitions.js TAP > config description for package-lock 1`] = ` diff --git a/workspaces/libnpmexec/lib/cache-install-dir.js b/workspaces/libnpmexec/lib/cache-install-dir.js deleted file mode 100644 index 77466938762d0..0000000000000 --- a/workspaces/libnpmexec/lib/cache-install-dir.js +++ /dev/null @@ -1,20 +0,0 @@ -const crypto = require('crypto') - -const { resolve } = require('path') - -const cacheInstallDir = ({ npxCache, packages }) => { - if (!npxCache) { - throw new Error('Must provide a valid npxCache path') - } - - // only packages not found in ${prefix}/node_modules - return resolve(npxCache, getHash(packages)) -} - -const getHash = (packages) => - crypto.createHash('sha512') - .update(packages.sort((a, b) => a.localeCompare(b, 'en')).join('\n')) - .digest('hex') - .slice(0, 16) - -module.exports = cacheInstallDir diff --git a/workspaces/libnpmexec/lib/file-exists.js b/workspaces/libnpmexec/lib/file-exists.js index f89cfc217d61d..e5cd474dac388 100644 --- a/workspaces/libnpmexec/lib/file-exists.js +++ b/workspaces/libnpmexec/lib/file-exists.js @@ -1,23 +1,25 @@ const { resolve } = require('path') -const { promisify } = require('util') -const stat = promisify(require('fs').stat) +const fs = require('@npmcli/fs') const walkUp = require('walk-up-path') -const fileExists = (file) => stat(file) - .then((res) => res.isFile()) - .catch(() => false) - -const localFileExists = async (dir, binName, root = '/') => { - root = resolve(root).toLowerCase() +const fileExists = async (file) => { + try { + const res = await fs.stat(file) + return res.isFile() + } catch { + return false + } +} - for (const path of walkUp(resolve(dir))) { +const localFileExists = async (dir, binName, root) => { + for (const path of walkUp(dir)) { const binDir = resolve(path, 'node_modules', '.bin') if (await fileExists(resolve(binDir, binName))) { return binDir } - if (path.toLowerCase() === root) { + if (path.toLowerCase() === resolve(root).toLowerCase()) { return false } } diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index dfe7560120702..227dc2cdda1ac 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -1,27 +1,74 @@ -const { delimiter, dirname, resolve } = require('path') +'use strict' + const { promisify } = require('util') -const read = promisify(require('read')) const Arborist = require('@npmcli/arborist') const ciDetect = require('@npmcli/ci-detect') +const crypto = require('crypto') const log = require('proc-log') -const npmlog = require('npmlog') const mkdirp = require('mkdirp-infer-owner') const npa = require('npm-package-arg') +const npmlog = require('npmlog') const pacote = require('pacote') +const read = promisify(require('read')) +const semver = require('semver') -const cacheInstallDir = require('./cache-install-dir.js') const { fileExists, localFileExists } = require('./file-exists.js') const getBinFromManifest = require('./get-bin-from-manifest.js') const noTTY = require('./no-tty.js') const runScript = require('./run-script.js') const isWindows = require('./is-windows.js') -const _localManifest = Symbol('localManifest') -/* istanbul ignore next */ -const PATH = ( - process.env.PATH || process.env.Path || process.env.path -).split(delimiter) +const { delimiter, dirname, resolve } = require('path') + +const pathArr = process.env.PATH.split(delimiter) + +// when checking the local tree we look up manifests, cache those results by +// spec.raw so we don't have to fetch again when we check npxCache +const manifests = new Map() + +// Returns the required manifest if the spec is missing from the tree +const missingFromTree = async ({ spec, tree, pacoteOpts }) => { + if (spec.registry && (spec.rawSpec === '' || spec.type !== 'tag')) { + // registry spec that is not a specific tag. + const nodesBySpec = tree.inventory.query('packageName', spec.name) + for (const node of nodesBySpec) { + if (spec.type === 'tag') { + // package requested by name only + return + } else if (spec.type === 'version') { + // package requested by specific version + if (node.pkgid === spec.raw) { + return + } + } else { + // package requested by version range, only remaining registry type + if (semver.satisfies(node.package.version, spec.rawSpec)) { + return + } + } + } + if (!manifests.get(spec.raw)) { + manifests.set(spec.raw, await pacote.manifest(spec, pacoteOpts)) + } + return manifests.get(spec.raw) + } else { + // non-registry spec, or a specific tag. Look up manifest and check + // resolved to see if it's in the tree. + if (!manifests.get(spec.raw)) { + manifests.set(spec.raw, await pacote.manifest(spec, pacoteOpts)) + } + const manifest = manifests.get(spec.raw) + const nodesByManifest = tree.inventory.query('packageName', manifest.name) + for (const node of nodesByManifest) { + if (node.package.resolved === manifest._resolved) { + // we have a package by the same name and the same resolved destination, nothing to add. + return + } + } + return manifest + } +} const exec = async (opts) => { const { @@ -32,7 +79,8 @@ const exec = async (opts) => { locationMsg = undefined, globalBin = '', output, - packages: _packages = [], + // dereference values because we manipulate it later + packages: [...packages] = [], path = '.', runPath = '.', scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh', @@ -40,10 +88,7 @@ const exec = async (opts) => { ...flatOptions } = opts - // dereferences values because we manipulate it later - const packages = [..._packages] - const pathArr = [...PATH] - const _run = () => runScript({ + const run = () => runScript({ args, call, color, @@ -56,120 +101,87 @@ const exec = async (opts) => { scriptShell, }) - // nothing to maybe install, skip the arborist dance + // interactive mode if (!call && !args.length && !packages.length) { - return await _run() + return run() } - const needPackageCommandSwap = args.length && !packages.length - // if there's an argument and no package has been explicitly asked for - // check the local and global bin paths for a binary named the same as - // the argument and run it if it exists, otherwise fall through to - // the behavior of treating the single argument as a package name + const pacoteOpts = { ...flatOptions, perferOnline: true } + + const needPackageCommandSwap = (args.length > 0) && (packages.length === 0) if (needPackageCommandSwap) { - let binExists = false const dir = dirname(dirname(localBin)) - const localBinPath = await localFileExists(dir, args[0]) + const localBinPath = await localFileExists(dir, args[0], '/') if (localBinPath) { - pathArr.unshift(localBinPath) - binExists = true + // @npmcli/run-script adds local bin to $PATH itself + return await run() } else if (await fileExists(`${globalBin}/${args[0]}`)) { pathArr.unshift(globalBin) - binExists = true - } - - if (binExists) { - return await _run() + return await run() } + // We swap out args[0] with the bin from the manifest later packages.push(args[0]) } - // figure out whether we need to install stuff, or if local is fine - const localArb = new Arborist({ - ...flatOptions, - path, - }) + const localArb = new Arborist({ ...flatOptions, path }) const localTree = await localArb.loadActual() - const getLocalManifest = ({ tree, name }) => { - // look up the package name in the current tree inventory, - // if it's found then return that normalized pkg data - const [node] = tree.inventory.query('packageName', name) - - if (node) { - return { - _id: node.pkgid, - ...node.package, - [_localManifest]: true, - } - } - } - - // If we do `npm exec foo`, and have a `foo` locally, then we'll - // always use that, so we don't really need to fetch the manifest. - // So: run npa on each packages entry, and if it is a name with a - // rawSpec==='', then try to find that node name in the tree inventory - // and only pacote fetch if that fails. - const manis = await Promise.all(packages.map(async p => { - const spec = npa(p, path) - if (spec.type === 'tag' && spec.rawSpec === '') { - const localManifest = getLocalManifest({ - tree: localTree, - name: spec.name, - }) - if (localManifest) { - return localManifest - } + // Find anything that isn't installed locally + const needInstall = [] + await Promise.all(packages.map(async pkg => { + const spec = npa(pkg, path) + const manifest = await missingFromTree({ spec, tree: localTree, pacoteOpts }) + if (manifest) { + needInstall.push({ spec, manifest }) } - // Force preferOnline to true so we are making sure to pull in the latest - // This is especially useful if the user didn't give us a version, and - // they expect to be running @latest - return await pacote.manifest(p, { - ...flatOptions, - preferOnline: true, - }) })) if (needPackageCommandSwap) { - args[0] = getBinFromManifest(manis[0]) + // Either we have a scoped package or the bin of our package we inferred + // from arg[0] is not identical to the package name + let commandManifest + if (needInstall.length === 0) { + commandManifest = await pacote.manifest(args[0], { + ...flatOptions, + preferOnline: true, + }) + } else { + commandManifest = needInstall[0].manifest + } + args[0] = getBinFromManifest(commandManifest) } - // are all packages from the manifest list installed? - const needInstall = - manis.some(manifest => !manifest[_localManifest]) - - if (needInstall) { + const add = [] + if (needInstall.length > 0) { + // Install things to the npx cache, if needed const { npxCache } = flatOptions - const installDir = cacheInstallDir({ npxCache, packages }) + if (!npxCache) { + throw new Error('Must provide a valid npxCache path') + } + const hash = crypto.createHash('sha512') + .update(packages.sort((a, b) => a.localeCompare(b, 'en')).join('\n')) + .digest('hex') + .slice(0, 16) + const installDir = resolve(npxCache, hash) await mkdirp(installDir) - const arb = new Arborist({ + const npxArb = new Arborist({ ...flatOptions, path: installDir, }) - const tree = await arb.loadActual() - - // inspect the npx-space installed tree to check if the package is already - // there, if that's the case also check that it's version matches the same - // version expected by the user requested pkg returned by pacote.manifest - const filterMissingPackagesFromInstallDir = (mani) => { - const localManifest = getLocalManifest({ tree, name: mani.name }) - if (localManifest) { - return localManifest.version !== mani.version + const npxTree = await npxArb.loadActual() + await Promise.all(needInstall.map(async ({ spec }) => { + const manifest = await missingFromTree({ spec, tree: npxTree, pacoteOpts }) + if (manifest) { + // Manifest is not in npxCache, we need to install it there + if (!spec.registry) { + add.push(manifest._from) + } else { + add.push(manifest._id) + } } - return true - } - - // at this point, we have to ensure that we get the exact same - // version, because it's something that has only ever been installed - // by npm exec in the cache install directory - const add = manis - .filter(mani => !mani[_localManifest]) - .filter(filterMissingPackagesFromInstallDir) - .map(mani => mani._id || mani._from) - .sort((a, b) => a.localeCompare(b, 'en')) + })) - // no need to install if already present if (add.length) { if (!yes) { // set -n to always say no @@ -196,7 +208,7 @@ const exec = async (opts) => { } } } - await arb.reify({ + await npxArb.reify({ ...flatOptions, add, }) @@ -204,7 +216,7 @@ const exec = async (opts) => { pathArr.unshift(resolve(installDir, 'node_modules/.bin')) } - return await _run() + return await run() } module.exports = exec diff --git a/workspaces/libnpmexec/test/cache-install-dir.js b/workspaces/libnpmexec/test/cache-install-dir.js deleted file mode 100644 index 9a7aee6d7c7e3..0000000000000 --- a/workspaces/libnpmexec/test/cache-install-dir.js +++ /dev/null @@ -1,12 +0,0 @@ -const t = require('tap') - -const cacheInstallDir = require('../lib/cache-install-dir.js') - -t.test('invalid npxCache path', t => { - t.throws( - () => cacheInstallDir({}), - /Must provide a valid npxCache path/, - 'should throw invalid path error' - ) - t.end() -}) diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index d42947e83687c..0eae95910848e 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -66,7 +66,7 @@ require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') }) -t.test('local pkg, must not fetch manifest for avail pkg', async t => { +t.test('locally available pkg - by name', async t => { const pkg = { name: '@ruyadorno/create-index', version: '2.0.0', @@ -121,6 +121,186 @@ t.test('local pkg, must not fetch manifest for avail pkg', async t => { t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') }) +t.test('locally available pkg - by version', async t => { + const pkg = { + name: '@ruyadorno/create-index', + version: '1.0.0', + bin: { + 'create-index': './index.js', + }, + } + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '.bin': {}, + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify(pkg), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('resfile', 'LOCAL PKG')`, + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^1.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + const executable = + resolve(path, 'node_modules/@ruyadorno/create-index/index.js') + fs.chmodSync(executable, 0o775) + + await binLinks({ + path: resolve(path, 'node_modules/@ruyadorno/create-index'), + pkg, + }) + + await libexec({ + ...baseOpts, + cache, + npxCache, + args: ['@ruyadorno/create-index@1.0.0'], + path, + runPath, + }) + + const res = fs.readFileSync(resolve(path, 'resfile')).toString() + t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') +}) + +t.test('locally available pkg - by range', async t => { + const pkg = { + name: '@ruyadorno/create-index', + version: '2.0.0', + bin: { + 'create-index': './index.js', + }, + } + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '.bin': {}, + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify(pkg), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^2.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + const executable = + resolve(path, 'node_modules/@ruyadorno/create-index/index.js') + fs.chmodSync(executable, 0o775) + + await binLinks({ + path: resolve(path, 'node_modules/@ruyadorno/create-index'), + pkg, + }) + + await libexec({ + ...baseOpts, + cache, + npxCache, + packages: ['@ruyadorno/create-index@^2.0.0'], + call: 'create-index resfile', + path, + runPath, + }) + + const res = fs.readFileSync(resolve(path, 'resfile')).toString() + t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') +}) + +t.test('locally available pkg - by tag', async t => { + const pkg = { + name: '@ruyadorno/create-index', + version: '1.0.0', + bin: { + 'create-index': './index.js', + }, + } + + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '.bin': {}, + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify(pkg), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, + }, + }, + '.package-lock.json': JSON.stringify({ + name: 'lock', + lockfileVersion: 3, + requires: true, + packages: { + 'node_modules/@ruyadorno/create-index': { + version: '1.0.0', + resolved: 'https://registry.npmjs.org/@ruyadorno/create-index/-/create-index-1.0.0.tgz', + bin: { + 'create-index': 'create-index.js', + }, + }, + }, + + }), + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^1.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + const executable = + resolve(path, 'node_modules/@ruyadorno/create-index/index.js') + fs.chmodSync(executable, 0o775) + + await binLinks({ + path: resolve(path, 'node_modules/@ruyadorno/create-index'), + pkg, + }) + + await libexec({ + ...baseOpts, + cache, + npxCache, + packages: ['@ruyadorno/create-index@latest'], + call: 'create-index resfile', + path, + runPath, + }) + + const res = fs.readFileSync(resolve(path, 'resfile')).toString() + t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') +}) + t.test('multiple local pkgs', async t => { const foo = { name: '@ruyadorno/create-foo', @@ -197,6 +377,35 @@ t.test('multiple local pkgs', async t => { t.equal(resBar, 'bar', 'should run local pkg bin script') }) +t.test('no npxCache', async t => { + const path = t.testdir({ + cache: {}, + a: { + 'package.json': JSON.stringify({ + name: 'a', + bin: { + a: './index.js', + }, + }), + 'index.js': `#!/usr/bin/env node +require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, + }, + }) + const runPath = path + const cache = resolve(path, 'cache') + + const executable = resolve(path, 'a/index.js') + fs.chmodSync(executable, 0o775) + + await t.rejects(libexec({ + ...baseOpts, + args: [`file:${resolve(path, 'a')}`, 'resfile'], + cache, + path, + runPath, + }), /Must provide a valid npxCache path/) +}) + t.test('local file system path', async t => { const path = t.testdir({ cache: {}, @@ -276,7 +485,7 @@ t.test('global space pkg', async t => { t.equal(res, 'GLOBAL PKG', 'should run local pkg bin script') }) -t.test('run from registry', async t => { +t.test('run from registry - no local packages', async t => { const testdir = t.testdir({ cache: {}, npxCache: {}, @@ -305,6 +514,132 @@ t.test('run from registry', async t => { t.ok(fs.statSync(resolve(path, 'index.js')).isFile(), 'ran create pkg') }) +t.test('run from registry - local version mismatch', async t => { + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify({ + name: '@ruyadorno/create-index', + version: '2.0.0', + }), + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^2.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + await libexec({ + ...baseOpts, + args: ['@ruyadorno/create-index@1.0.0'], + cache, + npxCache, + path, + runPath, + }) + + t.ok(fs.statSync(resolve(path, 'index.js')).isFile(), 'ran create pkg from registry') +}) + +t.test('run from registry - local range mismatch', async t => { + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify({ + name: '@ruyadorno/create-index', + version: '2.0.0', + }), + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^2.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + await libexec({ + ...baseOpts, + args: ['@ruyadorno/create-index@^1.0.0'], + cache, + npxCache, + path, + runPath, + }) + + t.ok(fs.statSync(resolve(path, 'index.js')).isFile(), 'ran create pkg from registry') +}) + +t.test('run from registry - local tag mismatch', async t => { + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '@ruyadorno': { + 'create-index': { + 'package.json': JSON.stringify({ + name: '@ruyadorno/create-index', + version: '2.0.0', + }), + }, + }, + '.package-lock.json': JSON.stringify({ + name: 'lock', + lockfileVersion: 3, + requires: true, + packages: { + 'node_modules/@ruyadorno/create-index': { + version: '2.0.0', + resolved: 'https://registry.npmjs.org/@ruyadorno/create-index/-/create-index-2.0.0.tgz', + bin: { + 'create-index': 'create-index.js', + }, + }, + }, + + }), + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@ruyadorno/create-index': '^2.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + await libexec({ + ...baseOpts, + args: ['@ruyadorno/create-index@latest'], + cache, + npxCache, + path, + runPath, + }) + + t.ok(fs.statSync(resolve(path, 'index.js')).isFile(), 'ran create pkg from registry') +}) + t.test('avoid install when exec from registry an available pkg', async t => { const testdir = t.testdir({ cache: {}, @@ -656,9 +991,15 @@ t.test('no prompt if CI, multiple packages', async t => { 'proc-log': { warn (title, msg) { t.equal(title, 'exec', 'should warn exec title') - const expected = 'The following packages were not found and will be ' + - 'installed: @ruyadorno/create-index@1.0.0, @ruyadorno/create-test@1.0.0' - t.equal(msg, expected, 'should warn installing pkg') + // this message is nondeterministic as it queries manifests so we just + // test the constituent parts + t.match( + msg, + 'The following packages were not found and will be installed:', + 'should warn installing packages' + ) + t.match(msg, '@ruyadorno/create-index@1.0.0', 'includes package being installed') + t.match(msg, '@ruyadorno/create-test@1.0.0', 'includes package being installed') }, }, }) @@ -675,7 +1016,7 @@ t.test('no prompt if CI, multiple packages', async t => { }) }) -t.test('sane defaults', async t => { +t.test('defaults', async t => { const testdir = t.testdir({ cache: {}, npxCache: {}, diff --git a/workspaces/libnpmexec/test/registry/content/ruyadorno/create-index.json b/workspaces/libnpmexec/test/registry/content/ruyadorno/create-index.json index 1e85cbbabec73..6118dec7dfd87 100644 --- a/workspaces/libnpmexec/test/registry/content/ruyadorno/create-index.json +++ b/workspaces/libnpmexec/test/registry/content/ruyadorno/create-index.json @@ -78,4 +78,4 @@ "readmeFilename": "README.md", "_cached": false, "_contentLength": 0 -} \ No newline at end of file +} From 19f1497322411f1566885bd53e63dc39f0df27ea Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 2 Aug 2022 09:12:52 -0700 Subject: [PATCH 013/175] fix: use binPaths This will allow for a locally installed package to differ from the one requested on the command line, the one requested will now actually run. --- workspaces/libnpmexec/lib/index.js | 12 ++++++------ workspaces/libnpmexec/lib/run-script.js | 8 ++------ workspaces/libnpmexec/test/run-script.js | 1 - 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 227dc2cdda1ac..0c66a2836aa15 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -19,9 +19,9 @@ const noTTY = require('./no-tty.js') const runScript = require('./run-script.js') const isWindows = require('./is-windows.js') -const { delimiter, dirname, resolve } = require('path') +const { dirname, resolve } = require('path') -const pathArr = process.env.PATH.split(delimiter) +const binPaths = [] // when checking the local tree we look up manifests, cache those results by // spec.raw so we don't have to fetch again when we check npxCache @@ -96,7 +96,7 @@ const exec = async (opts) => { locationMsg, output, path, - pathArr, + binPaths, runPath, scriptShell, }) @@ -113,10 +113,10 @@ const exec = async (opts) => { const dir = dirname(dirname(localBin)) const localBinPath = await localFileExists(dir, args[0], '/') if (localBinPath) { - // @npmcli/run-script adds local bin to $PATH itself + binPaths.push(localBinPath) return await run() } else if (await fileExists(`${globalBin}/${args[0]}`)) { - pathArr.unshift(globalBin) + binPaths.push(globalBin) return await run() } @@ -213,7 +213,7 @@ const exec = async (opts) => { add, }) } - pathArr.unshift(resolve(installDir, 'node_modules/.bin')) + binPaths.push(resolve(installDir, 'node_modules/.bin')) } return await run() diff --git a/workspaces/libnpmexec/lib/run-script.js b/workspaces/libnpmexec/lib/run-script.js index 97543e6ff0d08..18dcf7d8356c5 100644 --- a/workspaces/libnpmexec/lib/run-script.js +++ b/workspaces/libnpmexec/lib/run-script.js @@ -1,5 +1,3 @@ -const { delimiter } = require('path') - const chalk = require('chalk') const ciDetect = require('@npmcli/ci-detect') const runScript = require('@npmcli/run-script') @@ -22,7 +20,7 @@ const run = async ({ locationMsg, output = () => {}, path, - pathArr, + binPaths, runPath, scriptShell, }) => { @@ -71,11 +69,9 @@ const run = async ({ // we always run in cwd, not --prefix path: runPath, stdioString: true, + binPaths, event: 'npx', args, - env: { - PATH: pathArr.join(delimiter), - }, stdio: 'inherit', }) } finally { diff --git a/workspaces/libnpmexec/test/run-script.js b/workspaces/libnpmexec/test/run-script.js index 0b97a72ac04cb..9e0db1367fed1 100644 --- a/workspaces/libnpmexec/test/run-script.js +++ b/workspaces/libnpmexec/test/run-script.js @@ -5,7 +5,6 @@ const baseOpts = { call: '', color: false, path: '', - pathArr: [''], runPath: '', shell: process.platform === 'win32' ? process.env.ComSpec || 'cmd' From 3b30af25e93665f5aa21897910a65d7f26bbd066 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 2 Aug 2022 10:53:54 -0700 Subject: [PATCH 014/175] fix: fix exec tests and clean up workspace-location-msg The workspace-location-msg file was being called improperly by `npm init` and not even tested, and when digging in it probably shouldn't be used at all from there. It's not always a workspace in this context. --- lib/commands/exec.js | 34 +- lib/commands/init.js | 10 +- lib/exec/get-workspace-location-msg.js | 25 - .../lib/utils/config/describe-all.js.test.cjs | 2 +- test/lib/commands/exec.js | 1590 +---------------- 5 files changed, 76 insertions(+), 1585 deletions(-) delete mode 100644 lib/exec/get-workspace-location-msg.js diff --git a/lib/commands/exec.js b/lib/commands/exec.js index 0bbf7b3fa0b72..85a71923f521f 100644 --- a/lib/commands/exec.js +++ b/lib/commands/exec.js @@ -1,31 +1,5 @@ const libexec = require('libnpmexec') const BaseCommand = require('../base-command.js') -const getLocationMsg = require('../exec/get-workspace-location-msg.js') - -// it's like this: -// -// npm x pkg@version <-- runs the bin named "pkg" or the only bin if only 1 -// -// { name: 'pkg', bin: { pkg: 'pkg.js', foo: 'foo.js' }} <-- run pkg -// { name: 'pkg', bin: { foo: 'foo.js' }} <-- run foo? -// -// npm x -p pkg@version -- foo -// -// npm x -p pkg@version -- foo --registry=/dev/null -// -// const pkg = npm.config.get('package') || getPackageFrom(args[0]) -// const cmd = getCommand(pkg, args[0]) -// --> npm x -c 'cmd ...args.slice(1)' -// -// we've resolved cmd and args, and escaped them properly, and installed the -// relevant packages. -// -// Add the ${npx install prefix}/node_modules/.bin to PATH -// -// pkg = readPackageJson('./package.json') -// pkg.scripts.___npx = ${the -c arg} -// runScript({ pkg, event: 'npx', ... }) -// process.env.npm_lifecycle_event = 'npx' class Exec extends BaseCommand { static description = 'Run a command from a local or remote npm package' @@ -64,7 +38,7 @@ class Exec extends BaseCommand { localBin, globalBin, } = this.npm - const output = (...outputArgs) => this.npm.output(...outputArgs) + const output = this.npm.output.bind(this.npm) const scriptShell = this.npm.config.get('script-shell') || undefined const packages = this.npm.config.get('package') const yes = this.npm.config.get('yes') @@ -94,10 +68,10 @@ class Exec extends BaseCommand { async execWorkspaces (args, filters) { await this.setWorkspaces(filters) - const color = this.npm.color - for (const path of this.workspacePaths) { - const locationMsg = await getLocationMsg({ color, path }) + for (const [name, path] of this.workspaces) { + const locationMsg = + `in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}` await this.exec(args, { locationMsg, runPath: path }) } } diff --git a/lib/commands/init.js b/lib/commands/init.js index cff8340dcd707..039f08e06059e 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -10,7 +10,6 @@ const PackageJson = require('@npmcli/package-json') const log = require('../utils/log-shim.js') const updateWorkspaces = require('../workspaces/update-workspaces.js') -const getLocationMsg = require('../exec/get-workspace-location-msg.js') const BaseCommand = require('../base-command.js') class Init extends BaseCommand { @@ -119,13 +118,7 @@ class Init extends BaseCommand { localBin, globalBin, } = this.npm - // this function is definitely called. But because of coverage map stuff - // it ends up both uncovered, and the coverage report doesn't even mention. - // the tests do assert that some output happens, so we know this line is - // being hit. - /* istanbul ignore next */ - const output = (...outputArgs) => this.npm.output(...outputArgs) - const locationMsg = await getLocationMsg({ color, path }) + const output = this.npm.output.bind(this.npm) const runPath = path const scriptShell = this.npm.config.get('script-shell') || undefined const yes = this.npm.config.get('yes') @@ -135,7 +128,6 @@ class Init extends BaseCommand { args: newArgs, color, localBin, - locationMsg, globalBin, output, path, diff --git a/lib/exec/get-workspace-location-msg.js b/lib/exec/get-workspace-location-msg.js deleted file mode 100644 index 813b11e789222..0000000000000 --- a/lib/exec/get-workspace-location-msg.js +++ /dev/null @@ -1,25 +0,0 @@ -const chalk = require('chalk') -const readPackageJson = require('read-package-json-fast') - -const nocolor = { - dim: s => s, - green: s => s, -} - -const getLocationMsg = async ({ color, path }) => { - const colorize = color ? chalk : nocolor - const { _id } = - await readPackageJson(`${path}/package.json`) - .catch(() => ({})) - - const workspaceMsg = _id - ? ` in workspace ${colorize.green(_id)}` - : ` in a ${colorize.green('new')} workspace` - const locationMsg = ` at location:\n${ - colorize.dim(path) - }` - - return `${workspaceMsg}${locationMsg}` -} - -module.exports = getLocationMsg diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index 032caefbda18e..a03d22e5e6305 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -1117,7 +1117,7 @@ Directory in which \`npm pack\` will save tarballs. * Default: * Type: String (can be set multiple times) -The package to install for [\`npm exec\`](/commands/npm-exec) +The package or packages to install for [\`npm exec\`](/commands/npm-exec) diff --git a/test/lib/commands/exec.js b/test/lib/commands/exec.js index 049ed327c8fc5..6ac719122bfb2 100644 --- a/test/lib/commands/exec.js +++ b/test/lib/commands/exec.js @@ -1,1547 +1,97 @@ const t = require('tap') -const { fake: mockNpm } = require('../../fixtures/mock-npm') -const { resolve, delimiter } = require('path') +const fs = require('@npmcli/fs') +const path = require('path') +const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') +const MockRegistry = require('../../fixtures/mock-registry.js') -const ARB_CTOR = [] -const ARB_ACTUAL_TREE = {} -const ARB_REIFY = [] -class Arborist { - constructor (options) { - ARB_CTOR.push(options) - this.path = options.path - } - - async loadActual () { - return ARB_ACTUAL_TREE[this.path] - } - - async reify (options) { - ARB_REIFY.push(options) - } -} - -let PROGRESS_ENABLED = true -const LOG_WARN = [] -let PROGRESS_IGNORED = false -const flatOptions = { - npxCache: 'npx-cache-dir', - color: false, - cache: 'cache-dir', - legacyPeerDeps: false, - package: [], -} -const config = { - cache: 'bad-cache-dir', // this should never show up passed into libnpmexec - yes: true, - call: '', - package: [], - 'script-shell': 'shell-cmd', -} - -const npm = mockNpm({ - flatOptions, - config, - localPrefix: 'local-prefix', - localBin: 'local-bin', - globalBin: 'global-bin', -}) - -const RUN_SCRIPTS = [] -const runScript = async opt => { - RUN_SCRIPTS.push(opt) - if (!PROGRESS_IGNORED && PROGRESS_ENABLED) { - throw new Error('progress not disabled during run script!') - } -} - -const MANIFESTS = {} -const pacote = { - manifest: async (spec, options) => { - return MANIFESTS[spec] - }, -} - -const MKDIRPS = [] -const mkdirp = async path => MKDIRPS.push(path) - -let READ_RESULT = '' -let READ_ERROR = null -const READ = [] -const read = (options, cb) => { - READ.push(options) - process.nextTick(() => cb(READ_ERROR, READ_RESULT)) -} - -let CI_NAME = 'travis-ci' - -const log = { - 'proc-log': { - warn: (...args) => { - LOG_WARN.push(args) - }, - }, - npmlog: { - disableProgress: () => { - PROGRESS_ENABLED = false - }, - enableProgress: () => { - PROGRESS_ENABLED = true - }, - clearProgress: () => {}, - }, -} - -const mocks = { - libnpmexec: t.mock('libnpmexec', { - '@npmcli/arborist': Arborist, - '@npmcli/run-script': runScript, - '@npmcli/ci-detect': () => CI_NAME, - pacote, - read, - 'mkdirp-infer-owner': mkdirp, - ...log, - }), - ...log, -} -const Exec = t.mock('../../../lib/commands/exec.js', mocks) -const exec = new Exec(npm) - -t.afterEach(() => { - MKDIRPS.length = 0 - ARB_CTOR.length = 0 - ARB_REIFY.length = 0 - RUN_SCRIPTS.length = 0 - READ.length = 0 - READ_RESULT = '' - READ_ERROR = null - LOG_WARN.length = 0 - PROGRESS_IGNORED = false - flatOptions.legacyPeerDeps = false - flatOptions.color = false - config['script-shell'] = 'shell-cmd' - config.package = [] - flatOptions.package = [] - config.call = '' - config.yes = true - npm.color = false - npm.localBin = 'local-bin' - npm.globalBin = 'global-bin' -}) - -t.test('npx foo, bin already exists locally', async t => { - const path = t.testdir({ - node_modules: { - '.bin': { - foo: 'just some file', - }, - }, - }) - - PROGRESS_IGNORED = true - npm.localBin = resolve(path, 'node_modules', '.bin') - - await exec.exec(['foo', 'one arg', 'two arg']) - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - cache: flatOptions.cache, - npxCache: flatOptions.npxCache, - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { - PATH: [npm.localBin, process.env.PATH].join(delimiter), - }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npx foo, bin already exists globally', async t => { - const path = t.testdir({ - node_modules: { - '.bin': { - foo: 'just some file', - }, - }, - }) - - PROGRESS_IGNORED = true - npm.globalBin = resolve(path, 'node_modules', '.bin') - - await exec.exec(['foo', 'one arg', 'two arg']) - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { - PATH: [npm.globalBin, process.env.PATH].join(delimiter), - }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec foo, already present locally', async t => { - const path = t.testdir() - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - await exec.exec(['foo', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec , run interactive shell', t => { - CI_NAME = null - const { isTTY } = process.stdin - process.stdin.isTTY = true - t.teardown(() => (process.stdin.isTTY = isTTY)) - - const run = async (t, doRun) => { - LOG_WARN.length = 0 - ARB_CTOR.length = 0 - MKDIRPS.length = 0 - ARB_REIFY.length = 0 - npm._mockOutputs.length = 0 - await exec.exec([]) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.strictSame(ARB_CTOR, [], 'no need to instantiate arborist') - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - if (doRun) { - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'shell-cmd' } }, - args: [], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) - } else { - t.strictSame(RUN_SCRIPTS, []) - } - - RUN_SCRIPTS.length = 0 - } - t.test('print message when tty and not in CI', async t => { - CI_NAME = null - process.stdin.isTTY = true - await run(t, true) - t.strictSame(LOG_WARN, []) - t.strictSame( - npm._mockOutputs, - [ - [ - /* eslint-disable-next-line max-len */ - `\nEntering npm script environment at location:\n${process.cwd()}\nType 'exit' or ^D when finished\n`, - ], - ], - 'printed message about interactive shell' - ) - }) - - t.test('print message with color when tty and not in CI', async t => { - CI_NAME = null - process.stdin.isTTY = true - npm.color = true - flatOptions.color = true - - await run(t, true) - t.strictSame(LOG_WARN, []) - t.strictSame( - npm._mockOutputs, - [ - [ - /* eslint-disable-next-line max-len */ - `\u001b[0m\u001b[0m\n\u001b[0mEntering npm script environment\u001b[0m\u001b[0m at location:\u001b[0m\n\u001b[0m\u001b[2m${process.cwd()}\u001b[22m\u001b[0m\u001b[1m\u001b[22m\n\u001b[1mType 'exit' or ^D when finished\u001b[22m\n\u001b[1m\u001b[22m`, - ], - ], - 'printed message about interactive shell' - ) - }) - - t.test('no message when not TTY', async t => { - CI_NAME = null - process.stdin.isTTY = false - await run(t, true) - t.strictSame(LOG_WARN, []) - t.strictSame(npm._mockOutputs, [], 'no message about interactive shell') - }) - - t.test('print warning when in CI and interactive', async t => { - CI_NAME = 'travis-ci' - process.stdin.isTTY = true - await run(t, false) - t.strictSame(LOG_WARN, [['exec', 'Interactive mode disabled in CI environment']]) - t.strictSame(npm._mockOutputs, [], 'no message about interactive shell') - }) - - t.test('not defined script-shell config value', async t => { - CI_NAME = null - process.stdin.isTTY = true - config['script-shell'] = undefined - - await exec.exec([]) - - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: /sh|cmd/ } }, - }, - ]) - - LOG_WARN.length = 0 - ARB_CTOR.length = 0 - MKDIRPS.length = 0 - ARB_REIFY.length = 0 - npm._mockOutputs.length = 0 - RUN_SCRIPTS.length = 0 - }) - - t.end() -}) - -t.test('npm exec foo, not present locally or in central loc', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - await exec.exec(['foo', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add: ['foo@'], legacyPeerDeps: false }], 'need to install foo@') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec foo, packageLockOnly set to true', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - npm.localPrefix = path - npm.config.set('package-lock-only', true) - t.teardown(() => { - npm.config.set('package-lock-only', false) - }) - - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - await exec.exec(['foo', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ - path, - packageLockOnly: false, - }]) - t.match(ARB_REIFY, [{ - add: ['foo@'], - legacyPeerDeps: false, - packageLockOnly: false, - }], 'need to install foo@') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec foo, not present locally but in central loc', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - await exec.exec(['foo', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to install again, already there') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec foo, present locally but wrong version', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/2badf4630f1cfaad') - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS['foo@2.x'] = { - name: 'foo', - version: '2.3.4', - bin: { - foo: 'foo', - }, - _from: 'foo@2.x', - } - await exec.exec(['foo@2.x', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add: ['foo@2.x'], legacyPeerDeps: false }], 'need to add foo@2.x') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec foo, present locally but outdated version', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '2.3.4', - bin: { - foo: 'foo', - }, - _from: 'foo@2.x', - } - await exec.exec(['foo', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add: ['foo'], legacyPeerDeps: false }], 'need to add foo@2.x') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec --package=foo bar', async t => { - const path = t.testdir() - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - config.package = ['foo'] - flatOptions.package = ['foo'] - await exec.exec(['bar', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'bar' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('npm exec @foo/bar -- --some=arg, locally installed', async t => { - const foobarManifest = { - name: '@foo/bar', - version: '1.2.3', - bin: { - foo: 'foo', - bar: 'bar', - }, - } - const path = t.testdir({ - node_modules: { - '@foo/bar': { - 'package.json': JSON.stringify(foobarManifest), - }, - }, - }) - const pkg = { - name: '@foo/bar', - version: '1.2.3', - bin: { foo: 'foo', bar: 'bar' }, - } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS['@foo/bar'] = foobarManifest - await exec.exec(['@foo/bar', '--some=arg']) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'bar' } }, - args: ['--some=arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test( - 'npm exec @foo/bar, with same bin alias and no unscoped named bin, locally installed', - async t => { - const pkg = { - name: '@foo/bar', - version: '1.2.3', - bin: { - baz: 'corge', // pick the first one - qux: 'corge', - quux: 'corge', - }, - } - const path = t.testdir({ - node_modules: { - '@foo/bar': { - 'package.json': JSON.stringify(pkg), - }, - }, - }) - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS['@foo/bar'] = pkg - await exec.exec(['@foo/bar', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'baz' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) - } -) - -t.test( - 'npm exec @foo/bar, with different bin alias and no unscoped named bin, locally installed', - async t => { - const path = t.testdir() - const pkg = { - name: '@foo/bar', - version: '1.2.3.', - bin: { foo: 'qux', corge: 'qux', baz: 'quux' }, - } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ - ...pkg, - package: pkg, - pkgid: `${pkg.name}@${pkg.version}`, - }]) - }, - }, - } - MANIFESTS['@foo/bar'] = { - name: '@foo/bar', - version: '1.2.3', - bin: { - foo: 'qux', - corge: 'qux', - baz: 'quux', - }, - _from: 'foo@', - _id: '@foo/bar@1.2.3', - } - await t.rejects(exec.exec(['@foo/bar']), { - message: 'could not determine executable to run', - pkgid: '@foo/bar@1.2.3', - }) - } -) - -t.test('run command with 2 packages, need install, verify sort', async t => { - // test both directions, should use same install dir both times - // also test the read() call here, verify that the prompts match - const cases = [ - ['foo', 'bar'], - ['bar', 'foo'], - ] - t.plan(cases.length) - for (const packages of cases) { - t.test(packages.join(', '), async t => { - config.package = packages - const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b, 'en')) - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', - }, - _from: 'bar@', - } - await exec.exec(['foobar', 'one arg', 'two arg']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add, legacyPeerDeps: false }], 'need to install both packages') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foobar' } }, - args: ['one arg', 'two arg'], - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) - }) - } -}) - -t.test('npm exec foo, no bin in package', async t => { - const pkg = { name: 'foo', version: '1.2.3' } - const path = t.testdir({ - node_modules: { - foo: { - 'package.json': JSON.stringify(pkg), - }, - }, - }) - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ - ...pkg, - package: pkg, - pkgid: `${pkg.name}@${pkg.version}`, - }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - _from: 'foo@', - _id: 'foo@1.2.3', - } - await t.rejects(exec.exec(['foo']), { - message: 'could not determine executable to run', - pkgid: 'foo@1.2.3', - }) -}) - -t.test('npm exec foo, many bins in package, none named foo', async t => { - const path = t.testdir() - const pkg = { - name: 'foo', - version: '1.2.3', - bin: { bar: 'bar', baz: 'baz' }, - } - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ - ...pkg, - package: pkg, - pkgid: `${pkg.name}@${pkg.version}`, - }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - bar: 'bar', - baz: 'baz', - }, - _from: 'foo@', - _id: 'foo@1.2.3', - } - await t.rejects(exec.exec(['foo']), { - message: 'could not determine executable to run', - pkgid: 'foo@1.2.3', - }) -}) - -t.test('npm exec -p foo -c "ls -laF"', async t => { - const path = t.testdir() - const pkg = { name: 'foo', version: '1.2.3' } - npm.localPrefix = path - config.package = ['foo'] - config.call = 'ls -laF' - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - _from: 'foo@', - } - await exec.exec([]) - t.strictSame(MKDIRPS, [], 'no need to make any dirs') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no need to reify anything') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'ls -laF' } }, - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH: process.env.PATH }, - stdio: 'inherit', - }, - ]) -}) - -t.test('positional args and --call together is an error', async t => { - config.call = 'true' - await t.rejects(exec.exec(['foo']), exec.usage) -}) - -t.test('prompt when installs are needed if not already present and shell is a TTY', async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' - }) - process.stdout.isTTY = true - process.stdin.isTTY = true - CI_NAME = false - - const packages = ['foo', 'bar'] - READ_RESULT = 'yolo' - - config.package = packages - config.yes = undefined - - const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b, 'en')) - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', +t.test('call with args', async t => { + const { npm } = await loadMockNpm(t, { + config: { + call: 'foo', }, - _from: 'bar@', - } - await exec.exec(['foobar']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add, legacyPeerDeps: false }], 'need to install both packages') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foobar' } }, - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) - t.strictSame(READ, [ - { - prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', - default: 'y', - }, - ]) -}) - -t.test( - /* eslint-disable-next-line max-len */ - 'skip prompt when installs are needed if not already present and shell is not a tty (multiple packages)', - async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' - }) - process.stdout.isTTY = false - process.stdin.isTTY = false - CI_NAME = false - - const packages = ['foo', 'bar'] - READ_RESULT = 'yolo' - - config.package = packages - config.yes = undefined - - const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b, 'en')) - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', - }, - _from: 'bar@', - } - await exec.exec(['foobar']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add, legacyPeerDeps: false }], 'need to install both packages') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foobar' } }, - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) - t.strictSame(READ, [], 'should not have prompted') - t.strictSame( - LOG_WARN, - [['exec', 'The following packages were not found and will be installed: bar, foo']], - 'should have printed a warning' - ) - } -) - -t.test( - /* eslint-disable-next-line max-len */ - 'skip prompt when installs are needed if not already present and shell is not a tty (single package)', - async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' - }) - process.stdout.isTTY = false - process.stdin.isTTY = false - CI_NAME = false - - const packages = ['foo'] - READ_RESULT = 'yolo' - - config.package = packages - config.yes = undefined - - const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b, 'en')) - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - await exec.exec(['foobar']) - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.match(ARB_REIFY, [{ add, legacyPeerDeps: false }], 'need to install the package') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foobar' } }, - banner: false, - path: process.cwd(), - stdioString: true, - event: 'npx', - env: { PATH }, - stdio: 'inherit', - }, - ]) - t.strictSame(READ, [], 'should not have prompted') - t.strictSame( - LOG_WARN, - [['exec', 'The following package was not found and will be installed: foo']], - 'should have printed a warning' - ) - } -) - -t.test('abort if prompt rejected', async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' }) - process.stdout.isTTY = true - process.stdin.isTTY = true - CI_NAME = false - - const packages = ['foo', 'bar'] - READ_RESULT = 'no, why would I want such a thing??' - config.package = packages - config.yes = undefined - - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', - }, - _from: 'bar@', - } - await t.rejects(exec.exec(['foobar']), /canceled/, 'should be canceled') - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no install performed') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.strictSame(RUN_SCRIPTS, []) - t.strictSame(READ, [ - { - prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', - default: 'y', - }, - ]) + await t.rejects( + npm.exec('exec', ['bar']), + { code: 'EUSAGE' } + ) }) -t.test('abort if prompt false', async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' +t.test('registry package', async t => { + const registry = new MockRegistry({ + tap: t, + registry: 'https://registry.npmjs.org/', }) - process.stdout.isTTY = true - process.stdin.isTTY = true - CI_NAME = false - - const packages = ['foo', 'bar'] - READ_ERROR = 'canceled' - config.package = packages - config.yes = undefined + const manifest = registry.manifest({ name: '@npmcli/npx-test' }) + manifest.versions['1.0.0'].bin = { 'npx-test': 'index.js' } - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, + const { npm } = await loadMockNpm(t, { + config: { + yes: true, }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() + prefixDir: { + 'npm-exec-test': { + 'package.json': JSON.stringify(manifest), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-success', '')`, }, }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', - }, - _from: 'bar@', - } - await t.rejects(exec.exec(['foobar']), 'canceled', 'should be canceled') - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no install performed') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.strictSame(RUN_SCRIPTS, []) - t.strictSame(READ, [ - { - prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', - default: 'y', - }, - ]) -}) - -t.test('abort if -n provided', async t => { - const stdoutTTY = process.stdout.isTTY - const stdinTTY = process.stdin.isTTY - t.teardown(() => { - process.stdout.isTTY = stdoutTTY - process.stdin.isTTY = stdinTTY - CI_NAME = 'travis-ci' + globals: ({ prefix }) => ({ + 'process.cwd': () => prefix, + }), }) - process.stdout.isTTY = true - process.stdin.isTTY = true - CI_NAME = false - const packages = ['foo', 'bar'] + await registry.package({ manifest, + tarballs: { + '1.0.0': path.join(npm.prefix, 'npm-exec-test'), + } }) - config.package = packages - config.yes = false - - const path = t.testdir() - const installDir = resolve('npx-cache-dir/07de77790e5f40f2') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - MANIFESTS.bar = { - name: 'bar', - version: '1.2.3', - bin: { - bar: 'bar', - }, - _from: 'bar@', - } - await t.rejects(exec.exec(['foobar']), /canceled/, 'should be canceled') - t.strictSame(MKDIRPS, [installDir], 'need to make install dir') - t.match(ARB_CTOR, [{ path }]) - t.strictSame(ARB_REIFY, [], 'no install performed') - t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') - t.strictSame(RUN_SCRIPTS, []) - t.strictSame(READ, []) -}) - -t.test('forward legacyPeerDeps opt', async t => { - const path = t.testdir() - const installDir = resolve('npx-cache-dir/f7fbba6e0636f890') - npm.localPrefix = path - ARB_ACTUAL_TREE[path] = { - inventory: { - query () { - return new Set() - }, - }, - } - ARB_ACTUAL_TREE[installDir] = { - inventory: { - query () { - return new Set() - }, - }, - } - MANIFESTS.foo = { - name: 'foo', - version: '1.2.3', - bin: { - foo: 'foo', - }, - _from: 'foo@', - } - config.yes = true - flatOptions.legacyPeerDeps = true - await exec.exec(['foo']) - t.match( - ARB_REIFY, - [{ add: ['foo@'], legacyPeerDeps: true }], - 'need to install foo@ using legacyPeerDeps opt' - ) + await npm.exec('exec', ['@npmcli/npx-test']) + const exists = await fs.stat(path.join(npm.prefix, 'npm-exec-test-success')) + t.ok(exists.isFile(), 'bin ran, creating file') }) t.test('workspaces', async t => { - npm.localPrefix = t.testdir({ - node_modules: { - '.bin': { - a: '', - foo: '', - }, - }, - packages: { - a: { + const registry = new MockRegistry({ + tap: t, + registry: 'https://registry.npmjs.org/', + }) + + const manifest = registry.manifest({ name: '@npmcli/npx-test' }) + manifest.versions['1.0.0'].bin = { 'npx-test': 'index.js' } + + const { npm } = await loadMockNpm(t, { + config: { + yes: true, + workspace: ['workspace-a'], + }, + prefixDir: { + 'npm-exec-test': { + 'package.json': JSON.stringify(manifest), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-success', '')`, + }, + 'package.json': JSON.stringify({ + name: '@npmcli/npx-workspace-test', + workspaces: ['workspace-a'], + }), + 'workspace-a': { 'package.json': JSON.stringify({ - name: 'a', - version: '1.0.0', - bin: 'cli.js', - }), - 'cli.js': '', - }, - b: { - 'package.json': JSON.stringify({ - name: 'b', - version: '1.0.0', + name: 'workspace-a', }), }, }, - 'package.json': JSON.stringify({ - name: 'root', - version: '1.0.0', - workspaces: ['packages/*'], + globals: ({ prefix }) => ({ + 'process.cwd': () => prefix, }), }) - const pkg = { name: 'foo', version: '1.2.3', bin: { foo: 'foo' } } - PROGRESS_IGNORED = true - npm.localBin = resolve(npm.localPrefix, 'node_modules', '.bin') - - // with arg matching existing bin, run scripts in the context of a workspace - await exec.execWorkspaces(['foo', 'one arg', 'two arg'], ['a', 'b']) - - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: npm.localPrefix, - stdioString: true, - event: 'npx', - env: { - PATH: [npm.localBin, process.env.PATH].join(delimiter), - }, - stdio: 'inherit', - }, - { - pkg: { scripts: { npx: 'foo' } }, - args: ['one arg', 'two arg'], - banner: false, - path: npm.localPrefix, - stdioString: true, - event: 'npx', - env: { - PATH: [npm.localBin, process.env.PATH].join(delimiter), - }, - stdio: 'inherit', - }, - ], 'should run with multiple args across multiple workspaces') - - // clean up - RUN_SCRIPTS.length = 0 - - // with packages, run scripts in the context of a workspace - config.package = ['foo'] - config.call = 'foo' - config.yes = false - - ARB_ACTUAL_TREE[npm.localPrefix] = { - inventory: { - query () { - return new Set([{ ...pkg, package: pkg }]) - }, - }, - } - - await exec.execWorkspaces([], ['a', 'b']) - - // path should point to the workspace folder - t.match(RUN_SCRIPTS, [ - { - pkg: { scripts: { npx: 'foo' } }, - args: [], - banner: false, - path: resolve(npm.localPrefix, 'packages', 'a'), - stdioString: true, - event: 'npx', - stdio: 'inherit', - }, - { - pkg: { scripts: { npx: 'foo' } }, - args: [], - banner: false, - path: resolve(npm.localPrefix, 'packages', 'b'), - stdioString: true, - event: 'npx', - stdio: 'inherit', - }, - ], 'should run without args in multiple workspaces') - - t.match(ARB_CTOR, [ - { path: npm.localPrefix }, - { path: npm.localPrefix }, - ]) - - // no args, spawn interactive shell - CI_NAME = null - config.package = [] - config.call = '' - process.stdin.isTTY = true - - await exec.execWorkspaces([], ['a']) - - t.strictSame(LOG_WARN, []) - t.strictSame( - npm._mockOutputs, - [ - [ - `\nEntering npm script environment in workspace a@1.0.0 at location:\n${resolve( - npm.localPrefix, - 'packages/a' - )}\nType 'exit' or ^D when finished\n`, - ], - ], - 'printed message about interactive shell' - ) - - npm.color = true - flatOptions.color = true - npm._mockOutputs.length = 0 - await exec.execWorkspaces([], ['a']) - - t.strictSame(LOG_WARN, []) - t.strictSame( - npm._mockOutputs, - [ - [ - /* eslint-disable-next-line max-len */ - `\u001b[0m\u001b[0m\n\u001b[0mEntering npm script environment\u001b[0m\u001b[0m in workspace \u001b[32ma@1.0.0\u001b[39m at location:\u001b[0m\n\u001b[0m\u001b[2m${resolve( - npm.localPrefix, - 'packages/a' - /* eslint-disable-next-line max-len */ - )}\u001b[22m\u001b[0m\u001b[1m\u001b[22m\n\u001b[1mType 'exit' or ^D when finished\u001b[22m\n\u001b[1m\u001b[22m`, - ], - ], - 'printed message about interactive shell' - ) + await registry.package({ manifest, + tarballs: { + '1.0.0': path.join(npm.prefix, 'npm-exec-test'), + } }) + await npm.exec('exec', ['@npmcli/npx-test']) + const exists = await fs.stat(path.join(npm.prefix, 'workspace-a', 'npm-exec-test-success')) + t.ok(exists.isFile(), 'bin ran, creating file inside workspace') }) From d55007d9c535b17612a07a7a58cb6be94eedf77a Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 3 Aug 2022 08:26:48 -0700 Subject: [PATCH 015/175] deps: @npmcli/query@1.1.1 (#5247) --- node_modules/@npmcli/query/lib/index.js | 20 ++++++++++---------- node_modules/@npmcli/query/package.json | 2 +- package-lock.json | 8 ++++---- workspaces/arborist/package.json | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/node_modules/@npmcli/query/lib/index.js b/node_modules/@npmcli/query/lib/index.js index 3986baeacc3c2..36a8c700caae1 100644 --- a/node_modules/@npmcli/query/lib/index.js +++ b/node_modules/@npmcli/query/lib/index.js @@ -71,23 +71,23 @@ const fixupAttr = astNode => { matcher.insensitive = true } } else { - matcher.qualifiedAttribute = attributeAstNode.qualifiedAttribute - matcher.operator = attributeAstNode.operator || '' + if (attributeAstNode.type !== 'attribute') { + throw Object.assign( + new Error('`:attr` pseudo-class expects an attribute matcher as the last value'), + { code: 'EQUERYATTR' } + ) + } + + matcher.qualifiedAttribute = unescapeSlashes(attributeAstNode.qualifiedAttribute) + matcher.operator = attributeAstNode.operator matcher.value = attributeAstNode.value // backwards compatibility - matcher.attribute = attributeAstNode.qualifiedAttribute + matcher.attribute = matcher.qualifiedAttribute if (attributeAstNode.insensitive) { matcher.insensitive = true } - - if (attributeAstNode.type !== 'attribute') { - throw Object.assign( - new Error('`:attr` pseudo-class expects an attribute matcher as the last value'), - { code: 'EQUERYATTR' } - ) - } } astNode.lookupProperties = properties diff --git a/node_modules/@npmcli/query/package.json b/node_modules/@npmcli/query/package.json index f7f656233e73f..0c9247e0bb23b 100644 --- a/node_modules/@npmcli/query/package.json +++ b/node_modules/@npmcli/query/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/query", - "version": "1.1.0", + "version": "1.1.1", "description": "npm query parser and tools", "main": "lib/index.js", "scripts": { diff --git a/package-lock.json b/package-lock.json index 4a952e2ff5e50..5df46ecca633a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1044,9 +1044,9 @@ } }, "node_modules/@npmcli/query": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.1.0.tgz", - "integrity": "sha512-MQWugz9zqVS3w3ccaC3tN6oruM9W8sLPahdUu6No85Rn3EIppMYISdxnxDnYuQbVO1YVaa2kkWJ/jixCWZ59tg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.1.1.tgz", + "integrity": "sha512-UF3I0fD94wzQ84vojMO2jDB8ibjRSTqhi8oz2mzVKiJ9gZHbeGlu9kzPvgHuGDK0Hf2cARhWtTfCDHNEwlL9hg==", "dependencies": { "npm-package-arg": "^9.1.0", "postcss-selector-parser": "^6.0.10", @@ -10043,7 +10043,7 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", - "@npmcli/query": "^1.1.0", + "@npmcli/query": "^1.1.1", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.0.6", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 9c87667c5920c..4f529a0a8c8bf 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -11,7 +11,7 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", - "@npmcli/query": "^1.1.0", + "@npmcli/query": "^1.1.1", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.0.6", From 8233fca44321186c485964d26aa3c7c43eafff3d Mon Sep 17 00:00:00 2001 From: Darcy Clarke Date: Wed, 3 Aug 2022 11:32:12 -0400 Subject: [PATCH 016/175] fix(arborist): fix bare attribute queries (#5248) --- workspaces/arborist/lib/query-selector-all.js | 8 ++++---- workspaces/arborist/test/query-selector-all.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/workspaces/arborist/lib/query-selector-all.js b/workspaces/arborist/lib/query-selector-all.js index f4903f3e2009b..6c540dea3c872 100644 --- a/workspaces/arborist/lib/query-selector-all.js +++ b/workspaces/arborist/lib/query-selector-all.js @@ -317,10 +317,6 @@ class Results { // operators for attribute selectors const attributeOperators = { - // existence of the attribute - '' ({ attr }) { - return Boolean(attr) - }, // attribute value is equivalent '=' ({ attr, value, insensitive }) { return attr === value @@ -370,6 +366,10 @@ const attributeMatch = (matcher, obj) => { const operator = matcher.operator || '' const attribute = matcher.qualifiedAttribute let value = matcher.value || '' + // return early if checking existence + if (operator === '') { + return Boolean(obj[attribute]) + } if (insensitive) { value = value.toLowerCase() } diff --git a/workspaces/arborist/test/query-selector-all.js b/workspaces/arborist/test/query-selector-all.js index ec8c116122099..c335a82cbaf4b 100644 --- a/workspaces/arborist/test/query-selector-all.js +++ b/workspaces/arborist/test/query-selector-all.js @@ -86,6 +86,9 @@ t.test('query-selector-all', async t => { dependencies: { lorem: 'latest', }, + scripts: { + test: 'tap', + }, }), }, foo: { @@ -567,6 +570,9 @@ t.test('query-selector-all', async t => { [':attr(arbitrary, :attr([foo=10000]))', ['bar@2.0.0']], // attribute matchers + ['[scripts]', [ + 'baz@1.0.0', + ]], ['[name]', [ 'query-selector-all-tests@1.0.0', 'a@1.0.0', From 19a834610d154f36748536b27aed13bfdb5ee748 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 3 Aug 2022 08:36:47 -0700 Subject: [PATCH 017/175] fix: properly find and run global scoped packages (#5250) --- lib/commands/exec.js | 7 +++-- test/fixtures/mock-npm.js | 2 +- test/lib/commands/exec.js | 4 ++- workspaces/libnpmexec/lib/index.js | 48 ++++++++++++++++++----------- workspaces/libnpmexec/test/index.js | 45 +++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 22 deletions(-) diff --git a/lib/commands/exec.js b/lib/commands/exec.js index 85a71923f521f..ddbb5f7cf9d79 100644 --- a/lib/commands/exec.js +++ b/lib/commands/exec.js @@ -1,3 +1,4 @@ +const path = require('path') const libexec = require('libnpmexec') const BaseCommand = require('../base-command.js') @@ -24,7 +25,7 @@ class Exec extends BaseCommand { async exec (_args, { locationMsg, runPath } = {}) { // This is where libnpmexec will look for locally installed packages - const path = this.npm.localPrefix + const localPrefix = this.npm.localPrefix // This is where libnpmexec will actually run the scripts from if (!runPath) { @@ -37,6 +38,7 @@ class Exec extends BaseCommand { flatOptions, localBin, globalBin, + globalDir, } = this.npm const output = this.npm.output.bind(this.npm) const scriptShell = this.npm.config.get('script-shell') || undefined @@ -57,9 +59,10 @@ class Exec extends BaseCommand { localBin, locationMsg, globalBin, + globalPath: path.resolve(globalDir, '..'), output, packages, - path, + path: localPrefix, runPath, scriptShell, yes, diff --git a/test/fixtures/mock-npm.js b/test/fixtures/mock-npm.js index 90bf7da4c10bc..adf6c7432a561 100644 --- a/test/fixtures/mock-npm.js +++ b/test/fixtures/mock-npm.js @@ -63,7 +63,7 @@ const LoadMockNpm = async (t, { prefixDir = {}, homeDir = {}, cacheDir = {}, - globalPrefixDir = {}, + globalPrefixDir = { lib: {} }, config = {}, mocks = {}, globals = null, diff --git a/test/lib/commands/exec.js b/test/lib/commands/exec.js index 6ac719122bfb2..6e4c3e2246a6a 100644 --- a/test/lib/commands/exec.js +++ b/test/lib/commands/exec.js @@ -42,7 +42,9 @@ t.test('registry package', async t => { }), }) - await registry.package({ manifest, + await registry.package({ + times: 2, + manifest, tarballs: { '1.0.0': path.join(npm.prefix, 'npm-exec-test'), } }) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 0c66a2836aa15..fcc596d313778 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -27,8 +27,16 @@ const binPaths = [] // spec.raw so we don't have to fetch again when we check npxCache const manifests = new Map() +const getManifest = async (spec, flatOptions) => { + if (!manifests.get(spec.raw)) { + const manifest = await pacote.manifest(spec, { ...flatOptions, preferOnline: true }) + manifests.set(spec.raw, manifest) + } + return manifests.get(spec.raw) +} + // Returns the required manifest if the spec is missing from the tree -const missingFromTree = async ({ spec, tree, pacoteOpts }) => { +const missingFromTree = async ({ spec, tree, flatOptions }) => { if (spec.registry && (spec.rawSpec === '' || spec.type !== 'tag')) { // registry spec that is not a specific tag. const nodesBySpec = tree.inventory.query('packageName', spec.name) @@ -48,17 +56,11 @@ const missingFromTree = async ({ spec, tree, pacoteOpts }) => { } } } - if (!manifests.get(spec.raw)) { - manifests.set(spec.raw, await pacote.manifest(spec, pacoteOpts)) - } - return manifests.get(spec.raw) + return await getManifest(spec, flatOptions) } else { // non-registry spec, or a specific tag. Look up manifest and check // resolved to see if it's in the tree. - if (!manifests.get(spec.raw)) { - manifests.set(spec.raw, await pacote.manifest(spec, pacoteOpts)) - } - const manifest = manifests.get(spec.raw) + const manifest = await getManifest(spec, flatOptions) const nodesByManifest = tree.inventory.query('packageName', manifest.name) for (const node of nodesByManifest) { if (node.package.resolved === manifest._resolved) { @@ -78,6 +80,7 @@ const exec = async (opts) => { localBin = resolve('./node_modules/.bin'), locationMsg = undefined, globalBin = '', + globalPath = '', output, // dereference values because we manipulate it later packages: [...packages] = [], @@ -106,9 +109,9 @@ const exec = async (opts) => { return run() } - const pacoteOpts = { ...flatOptions, perferOnline: true } - const needPackageCommandSwap = (args.length > 0) && (packages.length === 0) + // If they asked for a command w/o specifying a package, see if there is a + // bin that directly matches that name either globally or in the local tree. if (needPackageCommandSwap) { const dir = dirname(dirname(localBin)) const localBinPath = await localFileExists(dir, args[0], '/') @@ -131,25 +134,34 @@ const exec = async (opts) => { const needInstall = [] await Promise.all(packages.map(async pkg => { const spec = npa(pkg, path) - const manifest = await missingFromTree({ spec, tree: localTree, pacoteOpts }) + const manifest = await missingFromTree({ spec, tree: localTree, flatOptions }) if (manifest) { + // Package does not exist in the local tree needInstall.push({ spec, manifest }) } })) if (needPackageCommandSwap) { // Either we have a scoped package or the bin of our package we inferred - // from arg[0] is not identical to the package name + // from arg[0] might not be identical to the package name + const spec = npa(args[0]) let commandManifest if (needInstall.length === 0) { - commandManifest = await pacote.manifest(args[0], { - ...flatOptions, - preferOnline: true, - }) + commandManifest = await getManifest(spec, flatOptions) } else { commandManifest = needInstall[0].manifest } + args[0] = getBinFromManifest(commandManifest) + + // See if the package is installed globally, and run the translated bin + const globalArb = new Arborist({ ...flatOptions, path: globalPath, global: true }) + const globalTree = await globalArb.loadActual() + const globalManifest = await missingFromTree({ spec, tree: globalTree, flatOptions }) + if (!globalManifest) { + binPaths.push(globalBin) + return await run() + } } const add = [] @@ -171,7 +183,7 @@ const exec = async (opts) => { }) const npxTree = await npxArb.loadActual() await Promise.all(needInstall.map(async ({ spec }) => { - const manifest = await missingFromTree({ spec, tree: npxTree, pacoteOpts }) + const manifest = await missingFromTree({ spec, tree: npxTree, flatOptions }) if (manifest) { // Manifest is not in npxCache, we need to install it there if (!spec.registry) { diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index 0eae95910848e..236e4f508f107 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -485,6 +485,51 @@ t.test('global space pkg', async t => { t.equal(res, 'GLOBAL PKG', 'should run local pkg bin script') }) +t.test('global scoped pkg', async t => { + const pkg = { + name: '@ruyadorno/create-test', + bin: { + 'create-test': 'index.js', + }, + } + const path = t.testdir({ + cache: {}, + npxCache: {}, + global: { + node_modules: { + '.bin': {}, + '@ruyadorno': { + 'create-test': { + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync(process.argv.slice(2)[0], 'GLOBAL PKG')`, + 'package.json': JSON.stringify(pkg), + }, + }, + }, + }, + }) + const globalBin = resolve(path, 'global/node_modules/.bin') + const globalPath = resolve(path, 'global') + const runPath = path + + await binLinks({ + path: resolve(path, 'global/node_modules/@ruyadorno/create-test'), + pkg, + }) + + await libexec({ + ...baseOpts, + args: ['@ruyadorno/create-test', 'resfile'], + globalBin, + globalPath, + path, + runPath, + }) + + const res = fs.readFileSync(resolve(path, 'resfile')).toString() + t.equal(res, 'GLOBAL PKG', 'should run global pkg bin script') +}) + t.test('run from registry - no local packages', async t => { const testdir = t.testdir({ cache: {}, From 9580e49ee518a7f57d1b89f338ddf3873171948d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:33:48 +0000 Subject: [PATCH 018/175] chore(latest): release arborist 5.4.0 --- workspaces/arborist/CHANGELOG.md | 21 +++++++++++++++++++++ workspaces/arborist/package.json | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index 25a15874bb7a8..086923db3b41e 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [5.4.0](https://github.com/npm/cli/compare/arborist-v5.3.1...arborist-v5.4.0) (2022-08-03) + + +### Features + +* add --replace-registry-host= ([#4860](https://github.com/npm/cli/issues/4860)) ([703dbbf](https://github.com/npm/cli/commit/703dbbf2a8149dff72c848d60600889a76779828)) +* add --replace-registry-host=| ([703dbbf](https://github.com/npm/cli/commit/703dbbf2a8149dff72c848d60600889a76779828)) +* add npm query cmd ([#5000](https://github.com/npm/cli/issues/5000)) ([3c024ac](https://github.com/npm/cli/commit/3c024ace60904c69e61da00e1fb56c0c1735804a)) + + +### Bug Fixes + +* **arborist:** fix bare attribute queries ([#5248](https://github.com/npm/cli/issues/5248)) ([8233fca](https://github.com/npm/cli/commit/8233fca44321186c485964d26aa3c7c43eafff3d)) +* **arborist:** pass the edge to fromPath in order to determine correct path ([#5233](https://github.com/npm/cli/issues/5233)) ([050284d](https://github.com/npm/cli/commit/050284d2abb6aa91a0f9ffad5b0c4f074e5dbf6d)) +* **arborist:** use the sourceReference root rather than the node root for overrides ([#5227](https://github.com/npm/cli/issues/5227)) ([47cc95d](https://github.com/npm/cli/commit/47cc95d9ffb37fc8ff62a1d5554eab16d303aa43)), closes [#4395](https://github.com/npm/cli/issues/4395) + + +### Dependencies + +* @npmcli/query@1.1.1 ([#5247](https://github.com/npm/cli/issues/5247)) ([d55007d](https://github.com/npm/cli/commit/d55007d9c535b17612a07a7a58cb6be94eedf77a)) + ## [5.3.1](https://github.com/npm/cli/compare/arborist-v5.3.0...arborist-v5.3.1) (2022-07-27) diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 4f529a0a8c8bf..7bfb90a079da4 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "5.3.1", + "version": "5.4.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", From c650a29a664aa303d8b8761dcf50236baf4bb4ca Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 3 Aug 2022 15:34:14 +0000 Subject: [PATCH 019/175] deps: @npmcli/arborist@5.4.0 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 5df46ecca633a..a3244ce655fdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10032,7 +10032,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "5.3.1", + "version": "5.4.0", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", From 1dd6c7fe30a08ce2257d4a17e31cb1124ec74c50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:38:56 +0000 Subject: [PATCH 020/175] chore(latest): release libnpmexec 4.0.9 --- workspaces/libnpmexec/CHANGELOG.md | 17 +++++++++++++++++ workspaces/libnpmexec/package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index de5bd563340f1..8003ca3d4fa08 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [4.0.9](https://github.com/npm/cli/compare/libnpmexec-v4.0.8...libnpmexec-v4.0.9) (2022-08-03) + + +### Bug Fixes + +* fix exec tests and clean up workspace-location-msg ([3b30af2](https://github.com/npm/cli/commit/3b30af25e93665f5aa21897910a65d7f26bbd066)) +* properly find and run global scoped packages ([#5250](https://github.com/npm/cli/issues/5250)) ([19a8346](https://github.com/npm/cli/commit/19a834610d154f36748536b27aed13bfdb5ee748)) +* properly find locally/globally/npxCache packages ([ea44995](https://github.com/npm/cli/commit/ea449954844f21abbf984e09e421f0e03485a535)) +* use binPaths ([19f1497](https://github.com/npm/cli/commit/19f1497322411f1566885bd53e63dc39f0df27ea)) + + +### Dependencies + +* @npmcli/run-script@4.2.0 ([d0be9a2](https://github.com/npm/cli/commit/d0be9a2bb53e74b30e13751afd1f6924990c8422)) +* add @npmcli/fs@2.1.1 ([c18dbc4](https://github.com/npm/cli/commit/c18dbc4393491e02532d698351747307848d2e20)) +* add semver@7.3.7 ([cd6bafd](https://github.com/npm/cli/commit/cd6bafdfbbd7a054709c11850b58f7dbc26eb8da)) + ## [4.0.8](https://github.com/npm/cli/compare/libnpmexec-v4.0.7...libnpmexec-v4.0.8) (2022-06-23) diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 349e82715f9af..9fcb0b2016784 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "4.0.8", + "version": "4.0.9", "files": [ "bin/", "lib/" From 4b7b48befdca90e0114f4c64eac1d96fea1cc191 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 3 Aug 2022 15:39:25 +0000 Subject: [PATCH 021/175] deps: libnpmexec@4.0.9 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index a3244ce655fdf..dd32c99ccccd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10131,7 +10131,7 @@ } }, "workspaces/libnpmexec": { - "version": "4.0.8", + "version": "4.0.9", "license": "ISC", "dependencies": { "@npmcli/arborist": "^5.0.0", From 4a832aba44ad8f20eb9059f48bf2d6f2ea18baf6 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 3 Aug 2022 08:55:54 -0700 Subject: [PATCH 022/175] chore: changelog for v8.16.0 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9ce840bb2a7..c6de53a087785 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Changelog +## v8.16.0 (2022-08-03) + +### Features + + * [`3c024ac`](https://github.com/npm/cli/commit/3c024ace60904c69e61da00e1fb56c0c1735804a) [#5000](https://github.com/npm/cli/pull/5000) feat: add npm query cmd ([@ruyadorno](https://github.com/ruyadorno)) ([@wraithgar](https://github.com/wraithgar)) + * [`703dbbf`](https://github.com/npm/cli/commit/703dbbf2a8149dff72c848d60600889a76779828) [#4860](https://github.com/npm/cli/pull/4860) feat: add --replace-registry-host= ([@fritzy](https://github.com/fritzy)) + +### Bug Fixes + + * [`eac1bf2`](https://github.com/npm/cli/commit/eac1bf26f28e9e8fc07e1350c3d7b14a94005ebf) [#5164](https://github.com/npm/cli/pull/5164) fix(ls): when filtering workspaces, make sure the edge has a to before checking if its a workspace ([@nlf](https://github.com/nlf)) + * [`47cc95d`](https://github.com/npm/cli/commit/47cc95d9ffb37fc8ff62a1d5554eab16d303aa43) [#5227](https://github.com/npm/cli/pull/5227) fix(arborist): use the sourceReference root rather than the node root for overrides ([@nlf](https://github.com/nlf)) + * [`050284d`](https://github.com/npm/cli/commit/050284d2abb6aa91a0f9ffad5b0c4f074e5dbf6d) [#5233](https://github.com/npm/cli/pull/5233) fix(arborist): pass the edge to fromPath in order to determine correct path ([@nlf](https://github.com/nlf)) + * [`d315ead`](https://github.com/npm/cli/commit/d315ead7a7f6d531eb57cfa4350bb08949c60997) [#5243](https://github.com/npm/cli/pull/5243) fix: gracefully exit login and publish commands on Ctrl+C (SIGINT) in the new webAuthn flow ([@neeldani](https://github.com/neeldani)) + * [`ea44995`](https://github.com/npm/cli/commit/ea449954844f21abbf984e09e421f0e03485a535) [#5244](https://github.com/npm/cli/pull/5244) fix: properly find locally/globally/npxCache packages ([@wraithgar](https://github.com/wraithgar)) + * [`19f1497`](https://github.com/npm/cli/commit/19f1497322411f1566885bd53e63dc39f0df27ea) [#5244](https://github.com/npm/cli/pull/5244) fix: use binPaths ([@wraithgar](https://github.com/wraithgar)) + * [`3b30af2`](https://github.com/npm/cli/commit/3b30af25e93665f5aa21897910a65d7f26bbd066) [#5244](https://github.com/npm/cli/pull/5244) fix: fix exec tests and clean up workspace-location-msg ([@wraithgar](https://github.com/wraithgar)) + * [`8233fca`](https://github.com/npm/cli/commit/8233fca44321186c485964d26aa3c7c43eafff3d) [#5248](https://github.com/npm/cli/pull/5248) fix(arborist): fix bare attribute queries ([@darcyclarke](https://github.com/darcyclarke)) + * [`19a8346`](https://github.com/npm/cli/commit/19a834610d154f36748536b27aed13bfdb5ee748) [#5250](https://github.com/npm/cli/pull/5250) fix: properly find and run global scoped packages ([@wraithgar](https://github.com/wraithgar)) + +### Documentation + + * [`a6153cf`](https://github.com/npm/cli/commit/a6153cfd2b0764e69d103b33af6b42978b0403f4) [#5240](https://github.com/npm/cli/pull/5240) docs: Use the full proper name of Travis CI ([@tnir](https://github.com/tnir)) + +### Dependencies + + * [`fd030c8`](https://github.com/npm/cli/commit/fd030c86b1e01b7df1b9d73fda07496742a4737f) [#5245](https://github.com/npm/cli/pull/5245) deps: `npm-profile@6.2.1` + * [`c18dbc4`](https://github.com/npm/cli/commit/c18dbc4393491e02532d698351747307848d2e20) [#5244](https://github.com/npm/cli/pull/5244) deps: add `@npmcli/fs@2.1.1` + * [`cd6bafd`](https://github.com/npm/cli/commit/cd6bafdfbbd7a054709c11850b58f7dbc26eb8da) [#5244](https://github.com/npm/cli/pull/5244) deps: add `semver@7.3.7` + * [`d0be9a2`](https://github.com/npm/cli/commit/d0be9a2bb53e74b30e13751afd1f6924990c8422) [#5244](https://github.com/npm/cli/pull/5244) deps: `@npmcli/run-script@4.2.0` + * [`d55007d`](https://github.com/npm/cli/commit/d55007d9c535b17612a07a7a58cb6be94eedf77a) [#5247](https://github.com/npm/cli/pull/5247) deps: `@npmcli/query@1.1.1` + * [`c650a29`](https://github.com/npm/cli/commit/c650a29a664aa303d8b8761dcf50236baf4bb4ca) [#5241](https://github.com/npm/cli/pull/5241) deps: `@npmcli/arborist@5.4.0` + * [`4b7b48b`](https://github.com/npm/cli/commit/4b7b48befdca90e0114f4c64eac1d96fea1cc191) [#5246](https://github.com/npm/cli/pull/5246) deps: `libnpmexec@4.0.9` + ## v8.15.1 (2022-07-27) ### Bug Fixes From c301f4402995d49b0e0ed4f4986aa261fe66eaf7 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 3 Aug 2022 08:56:09 -0700 Subject: [PATCH 023/175] chore: update AUTHORS --- AUTHORS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index 519977bea81b3..29a062c7f6b64 100644 --- a/AUTHORS +++ b/AUTHORS @@ -844,3 +844,5 @@ Jon Jensen JC (Jonathan Chen) MapleCCC Patryk Ludwikowski +Takuya N +Neel Dani From ca756fda3e0ddff2c0aeb85c21b10977c8bce3b6 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 3 Aug 2022 08:56:09 -0700 Subject: [PATCH 024/175] 8.16.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd32c99ccccd0..167f06964af58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "8.15.1", + "version": "8.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "8.15.1", + "version": "8.16.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", diff --git a/package.json b/package.json index 1adb37652a075..6efd43f49e96f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.15.1", + "version": "8.16.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ From 96b6781086143d7285c2c5bf7808c24b2c87e4dd Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 4 Aug 2022 13:43:27 -0700 Subject: [PATCH 025/175] feat(arborist): add option to forcibly skip loading a virtual tree --- .../arborist/lib/arborist/load-actual.js | 35 +++++++++++-------- .../test/arborist/load-actual.js.test.cjs | 35 ++++++++++++++++++- .../arborist/test/arborist/load-actual.js | 13 +++++-- 3 files changed, 65 insertions(+), 18 deletions(-) diff --git a/workspaces/arborist/lib/arborist/load-actual.js b/workspaces/arborist/lib/arborist/load-actual.js index d4eabe8c0fdfd..bca7cef9476ff 100644 --- a/workspaces/arborist/lib/arborist/load-actual.js +++ b/workspaces/arborist/lib/arborist/load-actual.js @@ -115,6 +115,7 @@ module.exports = cls => class ActualLoader extends cls { root = null, transplantFilter = () => true, ignoreMissing = false, + forceActual = false, } = options this[_filter] = filter this[_transplantFilter] = transplantFilter @@ -141,26 +142,30 @@ module.exports = cls => class ActualLoader extends cls { this[_actualTree].assertRootOverrides() - // Note: hidden lockfile will be rejected if it's not the latest thing - // in the folder, or if any of the entries in the hidden lockfile are - // missing. - const meta = await Shrinkwrap.load({ - path: this[_actualTree].path, - hiddenLockfile: true, - resolveOptions: this.options, - }) - if (meta.loadedFromDisk) { - this[_actualTree].meta = meta - return this[_loadActualVirtually]({ root }) - } else { + // if forceActual is set, don't even try the hidden lockfile + if (!forceActual) { + // Note: hidden lockfile will be rejected if it's not the latest thing + // in the folder, or if any of the entries in the hidden lockfile are + // missing. const meta = await Shrinkwrap.load({ path: this[_actualTree].path, - lockfileVersion: this.options.lockfileVersion, + hiddenLockfile: true, resolveOptions: this.options, }) - this[_actualTree].meta = meta - return this[_loadActualActually]({ root, ignoreMissing }) + + if (meta.loadedFromDisk) { + this[_actualTree].meta = meta + return this[_loadActualVirtually]({ root }) + } } + + const meta = await Shrinkwrap.load({ + path: this[_actualTree].path, + lockfileVersion: this.options.lockfileVersion, + resolveOptions: this.options, + }) + this[_actualTree].meta = meta + return this[_loadActualActually]({ root, ignoreMissing }) } async [_loadActualVirtually] ({ root }) { diff --git a/workspaces/arborist/tap-snapshots/test/arborist/load-actual.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/load-actual.js.test.cjs index b7177c7d248f6..35ba9f7cafa84 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/load-actual.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/load-actual.js.test.cjs @@ -1084,6 +1084,39 @@ ArboristNode { } ` +exports[`test/arborist/load-actual.js TAP do not load from a hidden lockfile when forceActual is set > must match snapshot 1`] = ` +ArboristNode { + "children": Map { + "abbrev" => ArboristNode { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "abbrev", + "spec": "^1.1.1", + "type": "prod", + }, + }, + "location": "node_modules/abbrev", + "name": "abbrev", + "path": "hidden-lockfile/node_modules/abbrev", + "version": "1.1.1", + }, + }, + "edgesOut": Map { + "abbrev" => EdgeOut { + "name": "abbrev", + "spec": "^1.1.1", + "to": "node_modules/abbrev", + "type": "prod", + }, + }, + "isProjectRoot": true, + "location": "", + "name": "hidden-lockfile", + "path": "hidden-lockfile", +} +` + exports[`test/arborist/load-actual.js TAP external-dep/root > loaded tree 1`] = ` ArboristNode { "edgesOut": Map { @@ -3760,7 +3793,7 @@ ArboristNode { } ` -exports[`test/arborist/load-actual.js TAP load from a hidden lockfile > expect resolving Promise 1`] = ` +exports[`test/arborist/load-actual.js TAP load from a hidden lockfile > must match snapshot 1`] = ` ArboristNode { "children": Map { "abbrev" => ArboristNode { diff --git a/workspaces/arborist/test/arborist/load-actual.js b/workspaces/arborist/test/arborist/load-actual.js index 8b84bb330ad25..72ab5e60fbf38 100644 --- a/workspaces/arborist/test/arborist/load-actual.js +++ b/workspaces/arborist/test/arborist/load-actual.js @@ -199,8 +199,17 @@ t.test('missing symlinks', t => 'bar has error') })) -t.test('load from a hidden lockfile', t => - t.resolveMatchSnapshot(loadActual(resolve(fixtures, 'hidden-lockfile')))) +t.test('load from a hidden lockfile', async (t) => { + const tree = await loadActual(resolve(fixtures, 'hidden-lockfile')) + t.ok(tree.meta.loadedFromDisk, 'meta was loaded from disk') + t.matchSnapshot(tree) +}) + +t.test('do not load from a hidden lockfile when forceActual is set', async (t) => { + const tree = await loadActual(resolve(fixtures, 'hidden-lockfile'), { forceActual: true }) + t.not(tree.meta.loadedFromDisk, 'meta was NOT loaded from disk') + t.matchSnapshot(tree) +}) t.test('load a global space', t => t.resolveMatchSnapshot(loadActual(resolve(fixtures, 'global-style/lib'), { From 9078e27cef0233d6fc81e0ca824a34fd7685d93c Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 4 Aug 2022 13:44:31 -0700 Subject: [PATCH 026/175] fix(query): tell arborist to load an actual tree, not a virtual one --- lib/commands/query.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/commands/query.js b/lib/commands/query.js index 371fddef9b440..60294acaf4a68 100644 --- a/lib/commands/query.js +++ b/lib/commands/query.js @@ -58,6 +58,7 @@ class Query extends BaseCommand { const opts = { ...this.npm.flatOptions, path: where, + forceActual: true, } const arb = new Arborist(opts) const tree = await arb.loadActual(opts) From c992fd6757505974dc8e92a9e2886d2233e098eb Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 8 Aug 2022 08:47:19 -0700 Subject: [PATCH 027/175] fix: look up local command bins from local tree (#5273) --- workspaces/libnpmexec/lib/index.js | 54 ++++++++++++++++------------- workspaces/libnpmexec/test/index.js | 54 +++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 25 deletions(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index fcc596d313778..efaeccafb615b 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -28,7 +28,7 @@ const binPaths = [] const manifests = new Map() const getManifest = async (spec, flatOptions) => { - if (!manifests.get(spec.raw)) { + if (!manifests.has(spec.raw)) { const manifest = await pacote.manifest(spec, { ...flatOptions, preferOnline: true }) manifests.set(spec.raw, manifest) } @@ -36,6 +36,7 @@ const getManifest = async (spec, flatOptions) => { } // Returns the required manifest if the spec is missing from the tree +// Returns the found node if it is in the tree const missingFromTree = async ({ spec, tree, flatOptions }) => { if (spec.registry && (spec.rawSpec === '' || spec.type !== 'tag')) { // registry spec that is not a specific tag. @@ -43,20 +44,21 @@ const missingFromTree = async ({ spec, tree, flatOptions }) => { for (const node of nodesBySpec) { if (spec.type === 'tag') { // package requested by name only - return + return { node } } else if (spec.type === 'version') { // package requested by specific version if (node.pkgid === spec.raw) { - return + return { node } } } else { // package requested by version range, only remaining registry type if (semver.satisfies(node.package.version, spec.rawSpec)) { - return + return { node } } } } - return await getManifest(spec, flatOptions) + const manifest = await getManifest(spec, flatOptions) + return { manifest } } else { // non-registry spec, or a specific tag. Look up manifest and check // resolved to see if it's in the tree. @@ -65,10 +67,10 @@ const missingFromTree = async ({ spec, tree, flatOptions }) => { for (const node of nodesByManifest) { if (node.package.resolved === manifest._resolved) { // we have a package by the same name and the same resolved destination, nothing to add. - return + return { node } } } - return manifest + return { manifest } } } @@ -132,35 +134,37 @@ const exec = async (opts) => { // Find anything that isn't installed locally const needInstall = [] - await Promise.all(packages.map(async pkg => { + let commandManifest + await Promise.all(packages.map(async (pkg, i) => { const spec = npa(pkg, path) - const manifest = await missingFromTree({ spec, tree: localTree, flatOptions }) + const { manifest, node } = await missingFromTree({ spec, tree: localTree, flatOptions }) if (manifest) { // Package does not exist in the local tree needInstall.push({ spec, manifest }) + if (i === 0) { + commandManifest = manifest + } + } else if (i === 0) { + // The node.package has enough to look up the bin + commandManifest = node.package } })) if (needPackageCommandSwap) { - // Either we have a scoped package or the bin of our package we inferred - // from arg[0] might not be identical to the package name const spec = npa(args[0]) - let commandManifest - if (needInstall.length === 0) { - commandManifest = await getManifest(spec, flatOptions) - } else { - commandManifest = needInstall[0].manifest - } args[0] = getBinFromManifest(commandManifest) - // See if the package is installed globally, and run the translated bin - const globalArb = new Arborist({ ...flatOptions, path: globalPath, global: true }) - const globalTree = await globalArb.loadActual() - const globalManifest = await missingFromTree({ spec, tree: globalTree, flatOptions }) - if (!globalManifest) { - binPaths.push(globalBin) - return await run() + if (needInstall.length > 0) { + // See if the package is installed globally, and run the translated bin + const globalArb = new Arborist({ ...flatOptions, path: globalPath, global: true }) + const globalTree = await globalArb.loadActual() + const { manifest: globalManifest } = + await missingFromTree({ spec, tree: globalTree, flatOptions }) + if (!globalManifest) { + binPaths.push(globalBin) + return await run() + } } } @@ -183,7 +187,7 @@ const exec = async (opts) => { }) const npxTree = await npxArb.loadActual() await Promise.all(needInstall.map(async ({ spec }) => { - const manifest = await missingFromTree({ spec, tree: npxTree, flatOptions }) + const { manifest } = await missingFromTree({ spec, tree: npxTree, flatOptions }) if (manifest) { // Manifest is not in npxCache, we need to install it there if (!spec.registry) { diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index 236e4f508f107..578221cc070b7 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -66,6 +66,60 @@ require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') }) +t.test('locally available pkg - by scoped name only', async t => { + const pkg = { + name: '@npmcli/npx-local-test', + version: '2.0.0', + bin: { + 'npx-local-test': './index.js', + }, + } + const path = t.testdir({ + cache: {}, + npxCache: {}, + node_modules: { + '.bin': {}, + '@npmcli': { + 'npx-local-test': { + 'package.json': JSON.stringify(pkg), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, + }, + }, + }, + 'package.json': JSON.stringify({ + name: 'pkg', + dependencies: { + '@npmcli/npx-local-test': '^2.0.0', + }, + }), + }) + const runPath = path + const cache = resolve(path, 'cache') + const npxCache = resolve(path, 'npxCache') + + const executable = + resolve(path, 'node_modules/@npmcli/npx-local-test/index.js') + fs.chmodSync(executable, 0o775) + + await binLinks({ + path: resolve(path, 'node_modules/@npmcli/npx-local-test'), + pkg, + }) + + await libexec({ + ...baseOpts, + cache, + npxCache, + args: ['@npmcli/npx-local-test', 'resfile'], + path, + runPath, + }) + + const res = fs.readFileSync(resolve(path, 'resfile')).toString() + t.equal(res, 'LOCAL PKG', 'should run local pkg bin script') +}) + t.test('locally available pkg - by name', async t => { const pkg = { name: '@ruyadorno/create-index', From f281ec8a1aec43439281a8fca4c255b0d94a0c94 Mon Sep 17 00:00:00 2001 From: Anton Rieder <1301152+aried3r@users.noreply.github.com> Date: Mon, 8 Aug 2022 18:01:56 +0200 Subject: [PATCH 028/175] docs: Fix link syntax in `dependency-selectors.md` (#5257) Fix link syntax in `dependency-selectors.md` --- docs/content/using-npm/dependency-selectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md index 9d65baf631a7e..45febf7cc7300 100644 --- a/docs/content/using-npm/dependency-selectors.md +++ b/docs/content/using-npm/dependency-selectors.md @@ -165,4 +165,4 @@ arb.loadActual((tree) => { ## See Also * [npm query](/commands/npm-query) -* [@npmcli/arborist](https://npm.im/@npmcli/arborist] +* [@npmcli/arborist](https://npm.im/@npmcli/arborist) From 95ae9f2e2555ef592777399bf8fee5206d77f41d Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 12:33:19 -0700 Subject: [PATCH 029/175] fix: only try to run global bin if the bin name exists (#5253) subdeps are in the tree but they don't have a bin --- workspaces/libnpmexec/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index efaeccafb615b..0b0565ca92072 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -161,7 +161,7 @@ const exec = async (opts) => { const globalTree = await globalArb.loadActual() const { manifest: globalManifest } = await missingFromTree({ spec, tree: globalTree, flatOptions }) - if (!globalManifest) { + if (!globalManifest && await fileExists(`${globalBin}/${args[0]}`)) { binPaths.push(globalBin) return await run() } From a4808fbd5601df10f6bdf20029cdbf1f06966c98 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 12:37:09 -0700 Subject: [PATCH 030/175] chore: allow for much slower tests (#5276) --- test/lib/commands/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/commands/init.js b/test/lib/commands/init.js index e7b2739341437..2dcca5b7f0adc 100644 --- a/test/lib/commands/init.js +++ b/test/lib/commands/init.js @@ -371,7 +371,7 @@ t.test('workspaces', t => { }) const init = new Init(npm) await init.execWorkspaces([], ['a']) - const output = npm._mockOutputs.map(arr => arr.map(i => i.replace(/[0-9]*ms$/, '100ms'))) + const output = npm._mockOutputs.map(arr => arr.map(i => i.replace(/[0-9]*m?s$/, '100ms'))) t.matchSnapshot(output, 'should print helper info') const lockFilePath = resolve(npm.localPrefix, 'package-lock.json') const lockFile = fs.readFileSync(lockFilePath, { encoding: 'utf8' }) From daaf4619c85ecf62346770735cfa8e2ddecbef8b Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 10 Aug 2022 09:34:24 -0700 Subject: [PATCH 031/175] fix: ignore global prefix if --prefix is used (#5291) When `--prefix` is used, both the local and global prefix values are set to be identical. This is functionally broken because their directory structures are inherently different (for instance, in posix the tree is in `lib/node_modules` in the global prefix). This commit makes npm exec ignore the global folders if it detects both local and global prefix are identical. --- lib/commands/exec.js | 9 +++++- test/lib/commands/exec.js | 43 ++++++++++++++++++++++++++++- workspaces/libnpmexec/lib/index.js | 6 ++-- workspaces/libnpmexec/test/index.js | 16 +++++++---- 4 files changed, 63 insertions(+), 11 deletions(-) diff --git a/lib/commands/exec.js b/lib/commands/exec.js index ddbb5f7cf9d79..a77a6326c00f2 100644 --- a/lib/commands/exec.js +++ b/lib/commands/exec.js @@ -34,6 +34,7 @@ class Exec extends BaseCommand { const args = [..._args] const call = this.npm.config.get('call') + let globalPath const { flatOptions, localBin, @@ -44,6 +45,12 @@ class Exec extends BaseCommand { const scriptShell = this.npm.config.get('script-shell') || undefined const packages = this.npm.config.get('package') const yes = this.npm.config.get('yes') + // --prefix sets both of these to the same thing, meaning the global prefix + // is invalid (i.e. no lib/node_modules). This is not a trivial thing to + // untangle and fix so we work around it here. + if (this.npm.localPrefix !== this.npm.globalPrefix) { + globalPath = path.resolve(globalDir, '..') + } if (call && _args.length) { throw this.usageError() @@ -59,7 +66,7 @@ class Exec extends BaseCommand { localBin, locationMsg, globalBin, - globalPath: path.resolve(globalDir, '..'), + globalPath, output, packages, path: localPrefix, diff --git a/test/lib/commands/exec.js b/test/lib/commands/exec.js index 6e4c3e2246a6a..f2bccf9e0d85c 100644 --- a/test/lib/commands/exec.js +++ b/test/lib/commands/exec.js @@ -28,6 +28,7 @@ t.test('registry package', async t => { const { npm } = await loadMockNpm(t, { config: { + audit: false, yes: true, }, prefixDir: { @@ -43,7 +44,46 @@ t.test('registry package', async t => { }) await registry.package({ - times: 2, + manifest, + tarballs: { + '1.0.0': path.join(npm.prefix, 'npm-exec-test'), + } }) + + await npm.exec('exec', ['@npmcli/npx-test']) + const exists = await fs.stat(path.join(npm.prefix, 'npm-exec-test-success')) + t.ok(exists.isFile(), 'bin ran, creating file') +}) + +t.test('--prefix', async t => { + const registry = new MockRegistry({ + tap: t, + registry: 'https://registry.npmjs.org/', + }) + + const manifest = registry.manifest({ name: '@npmcli/npx-test' }) + manifest.versions['1.0.0'].bin = { 'npx-test': 'index.js' } + + const { npm } = await loadMockNpm(t, { + config: { + audit: false, + yes: true, + }, + prefixDir: { + 'npm-exec-test': { + 'package.json': JSON.stringify(manifest), + 'index.js': `#!/usr/bin/env node + require('fs').writeFileSync('npm-exec-test-success', '')`, + }, + }, + globals: ({ prefix }) => ({ + 'process.cwd': () => prefix, + }), + }) + + // This is what `--prefix` does + npm.globalPrefix = npm.localPrefix + + await registry.package({ manifest, tarballs: { '1.0.0': path.join(npm.prefix, 'npm-exec-test'), @@ -65,6 +105,7 @@ t.test('workspaces', async t => { const { npm } = await loadMockNpm(t, { config: { + audit: false, yes: true, workspace: ['workspace-a'], }, diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 0b0565ca92072..15d5ba4eeca17 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -82,7 +82,7 @@ const exec = async (opts) => { localBin = resolve('./node_modules/.bin'), locationMsg = undefined, globalBin = '', - globalPath = '', + globalPath, output, // dereference values because we manipulate it later packages: [...packages] = [], @@ -120,7 +120,7 @@ const exec = async (opts) => { if (localBinPath) { binPaths.push(localBinPath) return await run() - } else if (await fileExists(`${globalBin}/${args[0]}`)) { + } else if (globalPath && await fileExists(`${globalBin}/${args[0]}`)) { binPaths.push(globalBin) return await run() } @@ -155,7 +155,7 @@ const exec = async (opts) => { args[0] = getBinFromManifest(commandManifest) - if (needInstall.length > 0) { + if (needInstall.length > 0 && globalPath) { // See if the package is installed globally, and run the translated bin const globalArb = new Arborist({ ...flatOptions, path: globalPath, global: true }) const globalTree = await globalArb.loadActual() diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index 578221cc070b7..3e218b75cbe5a 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -517,6 +517,7 @@ t.test('global space pkg', async t => { }, }) const globalBin = resolve(path, 'global/node_modules/.bin') + const globalPath = resolve(path, 'global') const runPath = path const executable = resolve(path, 'global/node_modules/a') @@ -531,6 +532,7 @@ t.test('global space pkg', async t => { ...baseOpts, args: ['a', 'resfile'], globalBin, + globalPath, path, runPath, }) @@ -588,12 +590,13 @@ t.test('run from registry - no local packages', async t => { const testdir = t.testdir({ cache: {}, npxCache: {}, + global: { + lib: {}, + bin: {}, + }, work: {}, }) const path = resolve(testdir, 'work') - const runPath = path - const cache = resolve(testdir, 'cache') - const npxCache = resolve(testdir, 'npxCache') t.throws( () => fs.statSync(resolve(path, 'index.js')), @@ -604,10 +607,11 @@ t.test('run from registry - no local packages', async t => { await libexec({ ...baseOpts, args: ['@ruyadorno/create-index'], - cache, - npxCache, + cache: resolve(testdir, 'cache'), + globalPath: resolve(testdir, 'global'), + npxCache: resolve(testdir, 'npxCache'), path, - runPath, + runPath: path, }) t.ok(fs.statSync(resolve(path, 'index.js')).isFile(), 'ran create pkg') From 741bccf24ad1fa420a6c6182e04487abc02f8ccf Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 09:43:08 -0700 Subject: [PATCH 032/175] deps: @npmcli/config@4.2.1 * correctly handle nerf-darted env vars --- node_modules/@npmcli/config/lib/index.js | 16 +- .../@npmcli/config/node_modules/.bin/nopt | 1 + .../@npmcli/config/node_modules/nopt/LICENSE | 15 + .../config/node_modules/nopt/bin/nopt.js | 56 ++ .../config/node_modules/nopt/lib/nopt.js | 515 ++++++++++++++++++ .../config/node_modules/nopt/package.json | 53 ++ node_modules/@npmcli/config/package.json | 4 +- package-lock.json | 25 +- package.json | 2 +- test/lib/commands/adduser.js | 2 - 10 files changed, 670 insertions(+), 19 deletions(-) create mode 120000 node_modules/@npmcli/config/node_modules/.bin/nopt create mode 100644 node_modules/@npmcli/config/node_modules/nopt/LICENSE create mode 100755 node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js create mode 100644 node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js create mode 100644 node_modules/@npmcli/config/node_modules/nopt/package.json diff --git a/node_modules/@npmcli/config/lib/index.js b/node_modules/@npmcli/config/lib/index.js index 8c2b181ca9c61..93fbcad72bc79 100644 --- a/node_modules/@npmcli/config/lib/index.js +++ b/node_modules/@npmcli/config/lib/index.js @@ -296,6 +296,7 @@ class Config { // might be a security hazard, which was the intention. try { this.setCredentialsByURI(reg, creds) + // eslint-disable-next-line no-empty } catch (_) {} process.emit('timeEnd', 'config:load:credentials') @@ -366,9 +367,11 @@ class Config { if (!/^npm_config_/i.test(envKey) || envVal === '') { continue } - const key = envKey.slice('npm_config_'.length) - .replace(/(?!^)_/g, '-') // don't replace _ at the start of the key - .toLowerCase() + let key = envKey.slice('npm_config_'.length) + if (!key.startsWith('//')) { // don't normalize nerf-darted keys + key = key.replace(/(?!^)_/g, '-') // don't replace _ at the start of the key + .toLowerCase() + } conf[key] = envVal } this[_loadObject](conf, 'env', 'environment') @@ -654,6 +657,7 @@ class Config { // saved back to the .npmrc file, so we're good. try { this.setCredentialsByURI(reg, creds) + // eslint-disable-next-line no-empty } catch (_) {} } @@ -691,8 +695,6 @@ class Config { this.delete(`_password`, 'user') this.delete(`username`, 'user') } - this.delete(`${nerfed}:-authtoken`, 'user') - this.delete(`${nerfed}:_authtoken`, 'user') this.delete(`${nerfed}:_authToken`, 'user') this.delete(`${nerfed}:_auth`, 'user') this.delete(`${nerfed}:_password`, 'user') @@ -732,8 +734,6 @@ class Config { // send auth if we have it, only to the URIs under the nerf dart. this.delete(`${nerfed}:always-auth`, 'user') - this.delete(`${nerfed}:-authtoken`, 'user') - this.delete(`${nerfed}:_authtoken`, 'user') this.delete(`${nerfed}:email`, 'user') if (certfile && keyfile) { this.set(`${nerfed}:certfile`, certfile, 'user') @@ -781,8 +781,6 @@ class Config { } const tokenReg = this.get(`${nerfed}:_authToken`) || - this.get(`${nerfed}:_authtoken`) || - this.get(`${nerfed}:-authtoken`) || nerfed === nerfDart(this.get('registry')) && this.get('_authToken') if (tokenReg) { diff --git a/node_modules/@npmcli/config/node_modules/.bin/nopt b/node_modules/@npmcli/config/node_modules/.bin/nopt new file mode 120000 index 0000000000000..6b6566ea7febb --- /dev/null +++ b/node_modules/@npmcli/config/node_modules/.bin/nopt @@ -0,0 +1 @@ +../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/@npmcli/config/node_modules/nopt/LICENSE b/node_modules/@npmcli/config/node_modules/nopt/LICENSE new file mode 100644 index 0000000000000..19129e315fe59 --- /dev/null +++ b/node_modules/@npmcli/config/node_modules/nopt/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/@npmcli/config/node_modules/nopt/bin/nopt.js b/node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js new file mode 100755 index 0000000000000..bb04291c607ac --- /dev/null +++ b/node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js @@ -0,0 +1,56 @@ +#!/usr/bin/env node +var nopt = require('../lib/nopt') +var path = require('path') +var types = { num: Number, + bool: Boolean, + help: Boolean, + list: Array, + 'num-list': [Number, Array], + 'str-list': [String, Array], + 'bool-list': [Boolean, Array], + str: String, + clear: Boolean, + config: Boolean, + length: Number, + file: path, +} +var shorthands = { s: ['--str', 'astring'], + b: ['--bool'], + nb: ['--no-bool'], + tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'], + '?': ['--help'], + h: ['--help'], + H: ['--help'], + n: ['--num', '125'], + c: ['--config'], + l: ['--length'], + f: ['--file'], +} +var parsed = nopt(types + , shorthands + , process.argv + , 2) + +console.log('parsed', parsed) + +if (parsed.help) { + console.log('') + console.log('nopt cli tester') + console.log('') + console.log('types') + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (mappedType) { + return mappedType.name + })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log('') + console.log('shorthands') + console.log(shorthands) +} diff --git a/node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js b/node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js new file mode 100644 index 0000000000000..5829c2fe0f637 --- /dev/null +++ b/node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js @@ -0,0 +1,515 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { + console.error.apply(console, arguments) + } + : function () {} + +var url = require('url') +var path = require('path') +var Stream = require('stream').Stream +var abbrev = require('abbrev') +var os = require('os') + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String: { type: String, validate: validateString }, + Boolean: { type: Boolean, validate: validateBoolean }, + url: { type: url, validate: validateUrl }, + Number: { type: Number, validate: validateNumber }, + path: { type: path, validate: validatePath }, + Stream: { type: Stream, validate: validateStream }, + Date: { type: Date, validate: validateDate }, + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== 'number') { + slice = 2 + } + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + var argv = { + remain: [], + cooked: args, + original: args.slice(0), + } + + parse(args, data, argv.remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = argv + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(' ') + }, + enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + var typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === 'argv') { + return + } + var val = data[k] + var isArray = Array.isArray(val) + var type = types[k] + if (!isArray) { + val = [val] + } + if (!type) { + type = typeDefault + } + if (type === Array) { + type = typeDefault.concat(Array) + } + if (!Array.isArray(type)) { + type = [type] + } + + debug('val=%j', val) + debug('types=', type) + val = val.map(function (v) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof v === 'string') { + debug('string %j', v) + v = v.trim() + if ((v === 'null' && ~type.indexOf(null)) + || (v === 'true' && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (v === 'false' && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + v = JSON.parse(v) + debug('jsonable %j', v) + } else if (~type.indexOf(Number) && !isNaN(v)) { + debug('convert to number', v) + v = +v + } else if (~type.indexOf(Date) && !isNaN(Date.parse(v))) { + debug('convert to date', v) + v = new Date(v) + } + } + + if (!Object.prototype.hasOwnProperty.call(types, k)) { + return v + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (v === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + v = null + } + + var d = {} + d[k] = v + debug('prevalidated val', d, v, types[k]) + if (!validate(d, k, v, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, v, types[k], data) + } else if (exports.invalidHandler !== false) { + debug('invalid: ' + k + '=' + v, types[k]) + } + return remove + } + debug('validated v', d, v, types[k]) + return d[k] + }).filter(function (v) { + return v !== remove + }) + + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && type.indexOf(Array) === -1) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) + delete data[k] + } else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else { + data[k] = val[0] + } + + debug('k=%s val=%j', k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) { + return false + } + if (val === null) { + return true + } + + val = String(val) + + var isWin = process.platform === 'win32' + var homePattern = isWin ? /^~(\/|\\)/ : /^~\// + var home = os.homedir() + + if (home && val.match(homePattern)) { + data[k] = path.resolve(home, val.slice(2)) + } else { + data[k] = path.resolve(val) + } + return true +} + +function validateNumber (data, k, val) { + debug('validate Number %j %j %j', k, val, isNaN(val)) + if (isNaN(val)) { + return false + } + data[k] = +val +} + +function validateDate (data, k, val) { + var s = Date.parse(val) + debug('validate Date %j %j %j', k, val, s) + if (isNaN(s)) { + return false + } + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) { + val = val.valueOf() + } else if (typeof val === 'string') { + if (!isNaN(val)) { + val = !!(+val) + } else if (val === 'null' || val === 'false') { + val = false + } else { + val = true + } + } else { + val = !!val + } + data[k] = val +} + +function validateUrl (data, k, val) { + // Changing this would be a breaking change in the npm cli + /* eslint-disable-next-line node/no-deprecated-api */ + val = url.parse(String(val)) + if (!val.host) { + return false + } + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) { + return false + } + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (let i = 0, l = type.length; i < l; i++) { + if (type[i] === Array) { + continue + } + if (validate(data, k, val, type[i], typeDefs)) { + return true + } + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) { + return true + } + + // Original comment: + // NaN is poisonous. Means that something is not allowed. + // New comment: Changing this to an isNaN check breaks a lot of tests. + // Something is being assumed here that is not actually what happens in + // practice. Fixing it is outside the scope of getting linting to pass in + // this repo. Leaving as-is for now. + /* eslint-disable-next-line no-self-compare */ + if (type !== type) { + debug('Poison NaN', k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug('Explicitly allowed %j', val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + var types = Object.keys(typeDefs) + for (let i = 0, l = types.length; i < l; i++) { + debug('test type %j %j %j', k, val, types[i]) + var t = typeDefs[types[i]] + if (t && ( + (type && type.name && t.type && t.type.name) ? + (type.name === t.type.name) : + (type === t.type) + )) { + var d = {} + ok = t.validate(d, k, val) !== false + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1]) + + if (!ok) { + delete data[k] + } + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug('parse', args, data, remain) + + var abbrevs = abbrev(Object.keys(types)) + var shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i++) { + var arg = args[i] + debug('arg', arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = '--' + break + } + var hadEq = false + if (arg.charAt(0) === '-' && arg.length > 1) { + var at = arg.indexOf('=') + if (at > -1) { + hadEq = true + var v = arg.slice(at + 1) + arg = arg.slice(0, at) + args.splice(i, 1, arg, v) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug('arg=%j shRes=%j', arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i-- + continue + } + } + arg = arg.replace(/^-+/, '') + var no = null + while (arg.toLowerCase().indexOf('no-') === 0) { + no = !no + arg = arg.slice(3) + } + + if (abbrevs[arg]) { + arg = abbrevs[arg] + } + + var argType = types[arg] + var isTypeArray = Array.isArray(argType) + if (isTypeArray && argType.length === 1) { + isTypeArray = false + argType = argType[0] + } + + var isArray = argType === Array || + isTypeArray && argType.indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if ( + !Object.prototype.hasOwnProperty.call(types, arg) && + Object.prototype.hasOwnProperty.call(data, arg) + ) { + if (!Array.isArray(data[arg])) { + data[arg] = [data[arg]] + } + isArray = true + } + + var val + var la = args[i + 1] + + var isBool = typeof no === 'boolean' || + argType === Boolean || + isTypeArray && argType.indexOf(Boolean) !== -1 || + (typeof argType === 'undefined' && !hadEq) || + (la === 'false' && + (argType === null || + isTypeArray && ~argType.indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === 'true' || la === 'false') { + val = JSON.parse(la) + la = null + if (no) { + val = !val + } + i++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (isTypeArray && la) { + if (~argType.indexOf(la)) { + // an explicit type + val = la + i++ + } else if (la === 'null' && ~argType.indexOf(null)) { + // null allowed + val = null + i++ + } else if (!la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~argType.indexOf(Number)) { + // number + val = +la + i++ + } else if (!la.match(/^-[^-]/) && ~argType.indexOf(String)) { + // string + val = la + i++ + } + } + + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } + + continue + } + + if (argType === String) { + if (la === undefined) { + la = '' + } else if (la.match(/^-{1,2}[^-]+/)) { + la = '' + i-- + } + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i-- + } + + val = la === undefined ? true : la + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } + + i++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) { + return null + } + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l, r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split('').filter(function (c) { + return singles[c] + }) + + if (chrs.join('') === arg) { + return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + } + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) { + return null + } + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) { + arg = shortAbbr[arg] + } + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + + return shorthands[arg] +} diff --git a/node_modules/@npmcli/config/node_modules/nopt/package.json b/node_modules/@npmcli/config/node_modules/nopt/package.json new file mode 100644 index 0000000000000..a3cd13d8c714b --- /dev/null +++ b/node_modules/@npmcli/config/node_modules/nopt/package.json @@ -0,0 +1,53 @@ +{ + "name": "nopt", + "version": "6.0.0", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "GitHub Inc.", + "main": "lib/nopt.js", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "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" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/nopt.git" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "license": "ISC", + "dependencies": { + "abbrev": "^1.0.0" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "tap": { + "lines": 87, + "functions": 91, + "branches": 81, + "statements": 87 + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "3.5.0" + } +} diff --git a/node_modules/@npmcli/config/package.json b/node_modules/@npmcli/config/package.json index 2f561c12233dc..275044e4ae48e 100644 --- a/node_modules/@npmcli/config/package.json +++ b/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "4.2.0", + "version": "4.2.1", "files": [ "bin/", "lib/" @@ -38,7 +38,7 @@ "@npmcli/map-workspaces": "^2.0.2", "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "proc-log": "^2.0.0", "read-package-json-fast": "^2.0.3", "semver": "^7.3.5", diff --git a/package-lock.json b/package-lock.json index 167f06964af58..d31e204ebb96d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^5.0.4", "@npmcli/ci-detect": "^2.0.0", - "@npmcli/config": "^4.2.0", + "@npmcli/config": "^4.2.1", "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", @@ -867,15 +867,15 @@ } }, "node_modules/@npmcli/config": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.0.tgz", - "integrity": "sha512-imWNz5dNWb2u+y41jyxL2WB389tkhu3a01Rchn16O/ur6GrnKySgOqdNG3N/9Z+mqxdISMEGKXI/POCauzz0dA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.1.tgz", + "integrity": "sha512-iJEnXNAGGr7sGUcoKmeJNrc943vFiWrDWq6DNK/t+SuqoObmozMb3tN3G5T9yo3uBf5Cw4h+SWgoqSaiwczl0Q==", "inBundle": true, "dependencies": { "@npmcli/map-workspaces": "^2.0.2", "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "proc-log": "^2.0.0", "read-package-json-fast": "^2.0.3", "semver": "^7.3.5", @@ -885,6 +885,21 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/@npmcli/config/node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "inBundle": true, + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/@npmcli/disparity-colors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz", diff --git a/package.json b/package.json index 6efd43f49e96f..5f345a43edf84 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/arborist": "^5.0.4", "@npmcli/ci-detect": "^2.0.0", - "@npmcli/config": "^4.2.0", + "@npmcli/config": "^4.2.1", "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", diff --git a/test/lib/commands/adduser.js b/test/lib/commands/adduser.js index 7c7079394f132..94e58a6d3cb0e 100644 --- a/test/lib/commands/adduser.js +++ b/test/lib/commands/adduser.js @@ -34,9 +34,7 @@ t.test('simple login', async t => { '_authtoken=user', '-authtoken=user', '_authToken=user', - '//registry.npmjs.org/:-authtoken=user', '//registry.npmjs.org/:_authToken=user', - '//registry.npmjs.org/:_authtoken=user', '//registry.npmjs.org/:always-auth=user', '//registry.npmjs.org/:email=test-email-old@npmjs.org', ].join('\n'), From 7f31b85db650c7a2b3b0577840251f5e25e63a01 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 09:45:24 -0700 Subject: [PATCH 033/175] deps: nopt@6.0.0 --- .../config/node_modules/nopt/bin/nopt.js | 56 --- .../config/node_modules/nopt/package.json | 53 --- .../node_modules/.bin/nopt | 0 .../node_modules/nopt/LICENSE | 0 .../node-gyp/node_modules/nopt/bin/nopt.js | 54 +++ .../node_modules/nopt/lib/nopt.js | 370 +++++++----------- .../node-gyp/node_modules/nopt/package.json | 34 ++ node_modules/nopt/bin/nopt.js | 80 ++-- node_modules/nopt/lib/nopt.js | 370 +++++++++++------- node_modules/nopt/package.json | 35 +- package-lock.json | 43 +- package.json | 2 +- workspaces/arborist/package.json | 2 +- 13 files changed, 550 insertions(+), 549 deletions(-) delete mode 100755 node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js delete mode 100644 node_modules/@npmcli/config/node_modules/nopt/package.json rename node_modules/{@npmcli/config => node-gyp}/node_modules/.bin/nopt (100%) rename node_modules/{@npmcli/config => node-gyp}/node_modules/nopt/LICENSE (100%) create mode 100755 node_modules/node-gyp/node_modules/nopt/bin/nopt.js rename node_modules/{@npmcli/config => node-gyp}/node_modules/nopt/lib/nopt.js (51%) create mode 100644 node_modules/node-gyp/node_modules/nopt/package.json diff --git a/node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js b/node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js deleted file mode 100755 index bb04291c607ac..0000000000000 --- a/node_modules/@npmcli/config/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node -var nopt = require('../lib/nopt') -var path = require('path') -var types = { num: Number, - bool: Boolean, - help: Boolean, - list: Array, - 'num-list': [Number, Array], - 'str-list': [String, Array], - 'bool-list': [Boolean, Array], - str: String, - clear: Boolean, - config: Boolean, - length: Number, - file: path, -} -var shorthands = { s: ['--str', 'astring'], - b: ['--bool'], - nb: ['--no-bool'], - tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'], - '?': ['--help'], - h: ['--help'], - H: ['--help'], - n: ['--num', '125'], - c: ['--config'], - l: ['--length'], - f: ['--file'], -} -var parsed = nopt(types - , shorthands - , process.argv - , 2) - -console.log('parsed', parsed) - -if (parsed.help) { - console.log('') - console.log('nopt cli tester') - console.log('') - console.log('types') - console.log(Object.keys(types).map(function M (t) { - var type = types[t] - if (Array.isArray(type)) { - return [t, type.map(function (mappedType) { - return mappedType.name - })] - } - return [t, type && type.name] - }).reduce(function (s, i) { - s[i[0]] = i[1] - return s - }, {})) - console.log('') - console.log('shorthands') - console.log(shorthands) -} diff --git a/node_modules/@npmcli/config/node_modules/nopt/package.json b/node_modules/@npmcli/config/node_modules/nopt/package.json deleted file mode 100644 index a3cd13d8c714b..0000000000000 --- a/node_modules/@npmcli/config/node_modules/nopt/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "nopt", - "version": "6.0.0", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": "GitHub Inc.", - "main": "lib/nopt.js", - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "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" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/nopt.git" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "license": "ISC", - "dependencies": { - "abbrev": "^1.0.0" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.5.0", - "tap": "^16.3.0" - }, - "tap": { - "lines": 87, - "functions": 91, - "branches": 81, - "statements": 87 - }, - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "windowsCI": false, - "version": "3.5.0" - } -} diff --git a/node_modules/@npmcli/config/node_modules/.bin/nopt b/node_modules/node-gyp/node_modules/.bin/nopt similarity index 100% rename from node_modules/@npmcli/config/node_modules/.bin/nopt rename to node_modules/node-gyp/node_modules/.bin/nopt diff --git a/node_modules/@npmcli/config/node_modules/nopt/LICENSE b/node_modules/node-gyp/node_modules/nopt/LICENSE similarity index 100% rename from node_modules/@npmcli/config/node_modules/nopt/LICENSE rename to node_modules/node-gyp/node_modules/nopt/LICENSE diff --git a/node_modules/node-gyp/node_modules/nopt/bin/nopt.js b/node_modules/node-gyp/node_modules/nopt/bin/nopt.js new file mode 100755 index 0000000000000..3232d4c570fdc --- /dev/null +++ b/node_modules/node-gyp/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js b/node_modules/node-gyp/node_modules/nopt/lib/nopt.js similarity index 51% rename from node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js rename to node_modules/node-gyp/node_modules/nopt/lib/nopt.js index 5829c2fe0f637..ecfa5da933683 100644 --- a/node_modules/@npmcli/config/node_modules/nopt/lib/nopt.js +++ b/node_modules/node-gyp/node_modules/nopt/lib/nopt.js @@ -1,147 +1,130 @@ // info about each config option. var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { - console.error.apply(console, arguments) - } + ? function () { console.error.apply(console, arguments) } : function () {} -var url = require('url') -var path = require('path') -var Stream = require('stream').Stream -var abbrev = require('abbrev') -var os = require('os') +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + , os = require("os") module.exports = exports = nopt exports.clean = clean exports.typeDefs = - { String: { type: String, validate: validateString }, - Boolean: { type: Boolean, validate: validateBoolean }, - url: { type: url, validate: validateUrl }, - Number: { type: Number, validate: validateNumber }, - path: { type: path, validate: validatePath }, - Stream: { type: Stream, validate: validateStream }, - Date: { type: Date, validate: validateDate }, + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } } function nopt (types, shorthands, args, slice) { args = args || process.argv types = types || {} shorthands = shorthands || {} - if (typeof slice !== 'number') { - slice = 2 - } + if (typeof slice !== "number") slice = 2 debug(types, shorthands, args, slice) args = args.slice(slice) var data = {} - var argv = { - remain: [], - cooked: args, - original: args.slice(0), - } + , key + , argv = { + remain: [], + cooked: args, + original: args.slice(0) + } parse(args, data, argv.remain, types, shorthands) // now data is full clean(data, types, exports.typeDefs) data.argv = argv Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(' ') - }, - enumerable: false }) + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) return data } function clean (data, types, typeDefs) { typeDefs = typeDefs || exports.typeDefs var remove = {} - var typeDefault = [false, true, null, String, Array] + , typeDefault = [false, true, null, String, Array] Object.keys(data).forEach(function (k) { - if (k === 'argv') { - return - } + if (k === "argv") return var val = data[k] - var isArray = Array.isArray(val) - var type = types[k] - if (!isArray) { - val = [val] - } - if (!type) { - type = typeDefault - } - if (type === Array) { - type = typeDefault.concat(Array) - } - if (!Array.isArray(type)) { - type = [type] - } - - debug('val=%j', val) - debug('types=', type) - val = val.map(function (v) { + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof v === 'string') { - debug('string %j', v) - v = v.trim() - if ((v === 'null' && ~type.indexOf(null)) - || (v === 'true' && + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (v === 'false' && + || (val === "false" && (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - v = JSON.parse(v) - debug('jsonable %j', v) - } else if (~type.indexOf(Number) && !isNaN(v)) { - debug('convert to number', v) - v = +v - } else if (~type.indexOf(Date) && !isNaN(Date.parse(v))) { - debug('convert to date', v) - v = new Date(v) + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) } } - if (!Object.prototype.hasOwnProperty.call(types, k)) { - return v + if (!types.hasOwnProperty(k)) { + return val } // allow `--no-blah` to set 'blah' to null if null is allowed - if (v === false && ~type.indexOf(null) && + if (val === false && ~type.indexOf(null) && !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - v = null + val = null } var d = {} - d[k] = v - debug('prevalidated val', d, v, types[k]) - if (!validate(d, k, v, types[k], typeDefs)) { + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { if (exports.invalidHandler) { - exports.invalidHandler(k, v, types[k], data) + exports.invalidHandler(k, val, types[k], data) } else if (exports.invalidHandler !== false) { - debug('invalid: ' + k + '=' + v, types[k]) + debug("invalid: "+k+"="+val, types[k]) } return remove } - debug('validated v', d, v, types[k]) + debug("validated val", d, val, types[k]) return d[k] - }).filter(function (v) { - return v !== remove - }) + }).filter(function (val) { return val !== remove }) // if we allow Array specifically, then an empty array is how we // express 'no value here', not null. Allow it. if (!val.length && type.indexOf(Array) === -1) { debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) delete data[k] - } else if (isArray) { + } + else if (isArray) { debug(isArray, data[k], val) data[k] = val - } else { - data[k] = val[0] - } + } else data[k] = val[0] - debug('k=%s val=%j', k, val, data[k]) + debug("k=%s val=%j", k, val, data[k]) }) } @@ -150,21 +133,17 @@ function validateString (data, k, val) { } function validatePath (data, k, val) { - if (val === true) { - return false - } - if (val === null) { - return true - } + if (val === true) return false + if (val === null) return true val = String(val) - var isWin = process.platform === 'win32' - var homePattern = isWin ? /^~(\/|\\)/ : /^~\// - var home = os.homedir() + var isWin = process.platform === 'win32' + , homePattern = isWin ? /^~(\/|\\)/ : /^~\// + , home = os.homedir() if (home && val.match(homePattern)) { - data[k] = path.resolve(home, val.slice(2)) + data[k] = path.resolve(home, val.substr(2)) } else { data[k] = path.resolve(val) } @@ -172,92 +151,63 @@ function validatePath (data, k, val) { } function validateNumber (data, k, val) { - debug('validate Number %j %j %j', k, val, isNaN(val)) - if (isNaN(val)) { - return false - } + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false data[k] = +val } function validateDate (data, k, val) { var s = Date.parse(val) - debug('validate Date %j %j %j', k, val, s) - if (isNaN(s)) { - return false - } + debug("validate Date %j %j %j", k, val, s) + if (isNaN(s)) return false data[k] = new Date(val) } function validateBoolean (data, k, val) { - if (val instanceof Boolean) { - val = val.valueOf() - } else if (typeof val === 'string') { - if (!isNaN(val)) { - val = !!(+val) - } else if (val === 'null' || val === 'false') { - val = false - } else { - val = true - } - } else { - val = !!val - } + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val data[k] = val } function validateUrl (data, k, val) { - // Changing this would be a breaking change in the npm cli - /* eslint-disable-next-line node/no-deprecated-api */ val = url.parse(String(val)) - if (!val.host) { - return false - } + if (!val.host) return false data[k] = val.href } function validateStream (data, k, val) { - if (!(val instanceof Stream)) { - return false - } + if (!(val instanceof Stream)) return false data[k] = val } function validate (data, k, val, type, typeDefs) { // arrays are lists of types. if (Array.isArray(type)) { - for (let i = 0, l = type.length; i < l; i++) { - if (type[i] === Array) { - continue - } - if (validate(data, k, val, type[i], typeDefs)) { - return true - } + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true } delete data[k] return false } // an array of anything? - if (type === Array) { - return true - } + if (type === Array) return true - // Original comment: // NaN is poisonous. Means that something is not allowed. - // New comment: Changing this to an isNaN check breaks a lot of tests. - // Something is being assumed here that is not actually what happens in - // practice. Fixing it is outside the scope of getting linting to pass in - // this repo. Leaving as-is for now. - /* eslint-disable-next-line no-self-compare */ if (type !== type) { - debug('Poison NaN', k, val, type) + debug("Poison NaN", k, val, type) delete data[k] return false } // explicit list of values if (val === type) { - debug('Explicitly allowed %j', val) + debug("Explicitly allowed %j", val) // if (isArray) (data[k] = data[k] || []).push(val) // else data[k] = val data[k] = val @@ -266,17 +216,14 @@ function validate (data, k, val, type, typeDefs) { // now go through the list of typeDefs, validate against each one. var ok = false - var types = Object.keys(typeDefs) - for (let i = 0, l = types.length; i < l; i++) { - debug('test type %j %j %j', k, val, types[i]) + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) var t = typeDefs[types[i]] - if (t && ( - (type && type.name && t.type && t.type.name) ? - (type.name === t.type.name) : - (type === t.type) - )) { + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { var d = {} - ok = t.validate(d, k, val) !== false + ok = false !== t.validate(d, k, val) val = d[k] if (ok) { // if (isArray) (data[k] = data[k] || []).push(val) @@ -286,63 +233,60 @@ function validate (data, k, val, type, typeDefs) { } } } - debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1]) + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) - if (!ok) { - delete data[k] - } + if (!ok) delete data[k] return ok } function parse (args, data, remain, types, shorthands) { - debug('parse', args, data, remain) + debug("parse", args, data, remain) - var abbrevs = abbrev(Object.keys(types)) - var shortAbbr = abbrev(Object.keys(shorthands)) + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) - for (var i = 0; i < args.length; i++) { + for (var i = 0; i < args.length; i ++) { var arg = args[i] - debug('arg', arg) + debug("arg", arg) if (arg.match(/^-{2,}$/)) { // done with keys. // the rest are args. remain.push.apply(remain, args.slice(i + 1)) - args[i] = '--' + args[i] = "--" break } var hadEq = false - if (arg.charAt(0) === '-' && arg.length > 1) { + if (arg.charAt(0) === "-" && arg.length > 1) { var at = arg.indexOf('=') if (at > -1) { hadEq = true - var v = arg.slice(at + 1) - arg = arg.slice(0, at) + var v = arg.substr(at + 1) + arg = arg.substr(0, at) args.splice(i, 1, arg, v) } // see if it's a shorthand // if so, splice and back up to re-parse it. var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug('arg=%j shRes=%j', arg, shRes) + debug("arg=%j shRes=%j", arg, shRes) if (shRes) { debug(arg, shRes) args.splice.apply(args, [i, 1].concat(shRes)) if (arg !== shRes[0]) { - i-- + i -- continue } } - arg = arg.replace(/^-+/, '') + arg = arg.replace(/^-+/, "") var no = null - while (arg.toLowerCase().indexOf('no-') === 0) { + while (arg.toLowerCase().indexOf("no-") === 0) { no = !no - arg = arg.slice(3) + arg = arg.substr(3) } - if (abbrevs[arg]) { - arg = abbrevs[arg] - } + if (abbrevs[arg]) arg = abbrevs[arg] var argType = types[arg] var isTypeArray = Array.isArray(argType) @@ -355,24 +299,20 @@ function parse (args, data, remain, types, shorthands) { isTypeArray && argType.indexOf(Array) !== -1 // allow unknown things to be arrays if specified multiple times. - if ( - !Object.prototype.hasOwnProperty.call(types, arg) && - Object.prototype.hasOwnProperty.call(data, arg) - ) { - if (!Array.isArray(data[arg])) { + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) data[arg] = [data[arg]] - } isArray = true } var val - var la = args[i + 1] + , la = args[i + 1] var isBool = typeof no === 'boolean' || argType === Boolean || isTypeArray && argType.indexOf(Boolean) !== -1 || (typeof argType === 'undefined' && !hadEq) || - (la === 'false' && + (la === "false" && (argType === null || isTypeArray && ~argType.indexOf(null))) @@ -380,13 +320,11 @@ function parse (args, data, remain, types, shorthands) { // just set and move along val = !no // however, also support --bool true or --bool false - if (la === 'true' || la === 'false') { + if (la === "true" || la === "false") { val = JSON.parse(la) la = null - if (no) { - val = !val - } - i++ + if (no) val = !val + i ++ } // also support "foo":[Boolean, "bar"] and "--foo bar" @@ -394,55 +332,49 @@ function parse (args, data, remain, types, shorthands) { if (~argType.indexOf(la)) { // an explicit type val = la - i++ - } else if (la === 'null' && ~argType.indexOf(null)) { + i ++ + } else if ( la === "null" && ~argType.indexOf(null) ) { // null allowed val = null - i++ - } else if (!la.match(/^-{2,}[^-]/) && + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && !isNaN(la) && - ~argType.indexOf(Number)) { + ~argType.indexOf(Number) ) { // number val = +la - i++ - } else if (!la.match(/^-[^-]/) && ~argType.indexOf(String)) { + i ++ + } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { // string val = la - i++ + i ++ } } - if (isArray) { - (data[arg] = data[arg] || []).push(val) - } else { - data[arg] = val - } + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val continue } if (argType === String) { if (la === undefined) { - la = '' + la = "" } else if (la.match(/^-{1,2}[^-]+/)) { - la = '' - i-- + la = "" + i -- } } if (la && la.match(/^-{2,}$/)) { la = undefined - i-- + i -- } val = la === undefined ? true : la - if (isArray) { - (data[arg] = data[arg] || []).push(val) - } else { - data[arg] = val - } + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val - i++ + i ++ continue } remain.push(arg) @@ -457,16 +389,14 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { arg = arg.replace(/^-+/, '') // if it's an exact known option, then don't go any further - if (abbrevs[arg] === arg) { + if (abbrevs[arg] === arg) return null - } // if it's an exact known shortopt, same deal if (shorthands[arg]) { // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + if (shorthands[arg] && !Array.isArray(shorthands[arg])) shorthands[arg] = shorthands[arg].split(/\s+/) - } return shorthands[arg] } @@ -476,7 +406,7 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { if (!singles) { singles = Object.keys(shorthands).filter(function (s) { return s.length === 1 - }).reduce(function (l, r) { + }).reduce(function (l,r) { l[r] = true return l }, {}) @@ -484,32 +414,28 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { debug('shorthand singles', singles) } - var chrs = arg.split('').filter(function (c) { + var chrs = arg.split("").filter(function (c) { return singles[c] }) - if (chrs.join('') === arg) { - return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - } + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg - if (abbrevs[arg] && !shorthands[arg]) { + if (abbrevs[arg] && !shorthands[arg]) return null - } // if it's an abbr for a shorthand, then use that - if (shortAbbr[arg]) { + if (shortAbbr[arg]) arg = shortAbbr[arg] - } // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + if (shorthands[arg] && !Array.isArray(shorthands[arg])) shorthands[arg] = shorthands[arg].split(/\s+/) - } return shorthands[arg] } diff --git a/node_modules/node-gyp/node_modules/nopt/package.json b/node_modules/node-gyp/node_modules/nopt/package.json new file mode 100644 index 0000000000000..12ed02da5a832 --- /dev/null +++ b/node_modules/node-gyp/node_modules/nopt/package.json @@ -0,0 +1,34 @@ +{ + "name": "nopt", + "version": "5.0.0", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "main": "lib/nopt.js", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/nopt.git" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "devDependencies": { + "tap": "^14.10.6" + }, + "files": [ + "bin", + "lib" + ], + "engines": { + "node": ">=6" + } +} diff --git a/node_modules/nopt/bin/nopt.js b/node_modules/nopt/bin/nopt.js index 3232d4c570fdc..bb04291c607ac 100755 --- a/node_modules/nopt/bin/nopt.js +++ b/node_modules/nopt/bin/nopt.js @@ -1,54 +1,56 @@ #!/usr/bin/env node -var nopt = require("../lib/nopt") - , path = require("path") - , types = { num: Number - , bool: Boolean - , help: Boolean - , list: Array - , "num-list": [Number, Array] - , "str-list": [String, Array] - , "bool-list": [Boolean, Array] - , str: String - , clear: Boolean - , config: Boolean - , length: Number - , file: path - } - , shorthands = { s: [ "--str", "astring" ] - , b: [ "--bool" ] - , nb: [ "--no-bool" ] - , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] - , "?": ["--help"] - , h: ["--help"] - , H: ["--help"] - , n: [ "--num", "125" ] - , c: ["--config"] - , l: ["--length"] - , f: ["--file"] - } - , parsed = nopt( types - , shorthands - , process.argv - , 2 ) +var nopt = require('../lib/nopt') +var path = require('path') +var types = { num: Number, + bool: Boolean, + help: Boolean, + list: Array, + 'num-list': [Number, Array], + 'str-list': [String, Array], + 'bool-list': [Boolean, Array], + str: String, + clear: Boolean, + config: Boolean, + length: Number, + file: path, +} +var shorthands = { s: ['--str', 'astring'], + b: ['--bool'], + nb: ['--no-bool'], + tft: ['--bool-list', '--no-bool-list', '--bool-list', 'true'], + '?': ['--help'], + h: ['--help'], + H: ['--help'], + n: ['--num', '125'], + c: ['--config'], + l: ['--length'], + f: ['--file'], +} +var parsed = nopt(types + , shorthands + , process.argv + , 2) -console.log("parsed", parsed) +console.log('parsed', parsed) if (parsed.help) { - console.log("") - console.log("nopt cli tester") - console.log("") - console.log("types") + console.log('') + console.log('nopt cli tester') + console.log('') + console.log('types') console.log(Object.keys(types).map(function M (t) { var type = types[t] if (Array.isArray(type)) { - return [t, type.map(function (type) { return type.name })] + return [t, type.map(function (mappedType) { + return mappedType.name + })] } return [t, type && type.name] }).reduce(function (s, i) { s[i[0]] = i[1] return s }, {})) - console.log("") - console.log("shorthands") + console.log('') + console.log('shorthands') console.log(shorthands) } diff --git a/node_modules/nopt/lib/nopt.js b/node_modules/nopt/lib/nopt.js index ecfa5da933683..5829c2fe0f637 100644 --- a/node_modules/nopt/lib/nopt.js +++ b/node_modules/nopt/lib/nopt.js @@ -1,130 +1,147 @@ // info about each config option. var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { console.error.apply(console, arguments) } + ? function () { + console.error.apply(console, arguments) + } : function () {} -var url = require("url") - , path = require("path") - , Stream = require("stream").Stream - , abbrev = require("abbrev") - , os = require("os") +var url = require('url') +var path = require('path') +var Stream = require('stream').Stream +var abbrev = require('abbrev') +var os = require('os') module.exports = exports = nopt exports.clean = clean exports.typeDefs = - { String : { type: String, validate: validateString } - , Boolean : { type: Boolean, validate: validateBoolean } - , url : { type: url, validate: validateUrl } - , Number : { type: Number, validate: validateNumber } - , path : { type: path, validate: validatePath } - , Stream : { type: Stream, validate: validateStream } - , Date : { type: Date, validate: validateDate } + { String: { type: String, validate: validateString }, + Boolean: { type: Boolean, validate: validateBoolean }, + url: { type: url, validate: validateUrl }, + Number: { type: Number, validate: validateNumber }, + path: { type: path, validate: validatePath }, + Stream: { type: Stream, validate: validateStream }, + Date: { type: Date, validate: validateDate }, } function nopt (types, shorthands, args, slice) { args = args || process.argv types = types || {} shorthands = shorthands || {} - if (typeof slice !== "number") slice = 2 + if (typeof slice !== 'number') { + slice = 2 + } debug(types, shorthands, args, slice) args = args.slice(slice) var data = {} - , key - , argv = { - remain: [], - cooked: args, - original: args.slice(0) - } + var argv = { + remain: [], + cooked: args, + original: args.slice(0), + } parse(args, data, argv.remain, types, shorthands) // now data is full clean(data, types, exports.typeDefs) data.argv = argv Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(" ") - }, enumerable: false }) + return this.original.map(JSON.stringify).join(' ') + }, + enumerable: false }) return data } function clean (data, types, typeDefs) { typeDefs = typeDefs || exports.typeDefs var remove = {} - , typeDefault = [false, true, null, String, Array] + var typeDefault = [false, true, null, String, Array] Object.keys(data).forEach(function (k) { - if (k === "argv") return + if (k === 'argv') { + return + } var val = data[k] - , isArray = Array.isArray(val) - , type = types[k] - if (!isArray) val = [val] - if (!type) type = typeDefault - if (type === Array) type = typeDefault.concat(Array) - if (!Array.isArray(type)) type = [type] - - debug("val=%j", val) - debug("types=", type) - val = val.map(function (val) { + var isArray = Array.isArray(val) + var type = types[k] + if (!isArray) { + val = [val] + } + if (!type) { + type = typeDefault + } + if (type === Array) { + type = typeDefault.concat(Array) + } + if (!Array.isArray(type)) { + type = [type] + } + + debug('val=%j', val) + debug('types=', type) + val = val.map(function (v) { // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof val === "string") { - debug("string %j", val) - val = val.trim() - if ((val === "null" && ~type.indexOf(null)) - || (val === "true" && + if (typeof v === 'string') { + debug('string %j', v) + v = v.trim() + if ((v === 'null' && ~type.indexOf(null)) + || (v === 'true' && (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (val === "false" && + || (v === 'false' && (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - val = JSON.parse(val) - debug("jsonable %j", val) - } else if (~type.indexOf(Number) && !isNaN(val)) { - debug("convert to number", val) - val = +val - } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { - debug("convert to date", val) - val = new Date(val) + v = JSON.parse(v) + debug('jsonable %j', v) + } else if (~type.indexOf(Number) && !isNaN(v)) { + debug('convert to number', v) + v = +v + } else if (~type.indexOf(Date) && !isNaN(Date.parse(v))) { + debug('convert to date', v) + v = new Date(v) } } - if (!types.hasOwnProperty(k)) { - return val + if (!Object.prototype.hasOwnProperty.call(types, k)) { + return v } // allow `--no-blah` to set 'blah' to null if null is allowed - if (val === false && ~type.indexOf(null) && + if (v === false && ~type.indexOf(null) && !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - val = null + v = null } var d = {} - d[k] = val - debug("prevalidated val", d, val, types[k]) - if (!validate(d, k, val, types[k], typeDefs)) { + d[k] = v + debug('prevalidated val', d, v, types[k]) + if (!validate(d, k, v, types[k], typeDefs)) { if (exports.invalidHandler) { - exports.invalidHandler(k, val, types[k], data) + exports.invalidHandler(k, v, types[k], data) } else if (exports.invalidHandler !== false) { - debug("invalid: "+k+"="+val, types[k]) + debug('invalid: ' + k + '=' + v, types[k]) } return remove } - debug("validated val", d, val, types[k]) + debug('validated v', d, v, types[k]) return d[k] - }).filter(function (val) { return val !== remove }) + }).filter(function (v) { + return v !== remove + }) // if we allow Array specifically, then an empty array is how we // express 'no value here', not null. Allow it. if (!val.length && type.indexOf(Array) === -1) { debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) delete data[k] - } - else if (isArray) { + } else if (isArray) { debug(isArray, data[k], val) data[k] = val - } else data[k] = val[0] + } else { + data[k] = val[0] + } - debug("k=%s val=%j", k, val, data[k]) + debug('k=%s val=%j', k, val, data[k]) }) } @@ -133,17 +150,21 @@ function validateString (data, k, val) { } function validatePath (data, k, val) { - if (val === true) return false - if (val === null) return true + if (val === true) { + return false + } + if (val === null) { + return true + } val = String(val) - var isWin = process.platform === 'win32' - , homePattern = isWin ? /^~(\/|\\)/ : /^~\// - , home = os.homedir() + var isWin = process.platform === 'win32' + var homePattern = isWin ? /^~(\/|\\)/ : /^~\// + var home = os.homedir() if (home && val.match(homePattern)) { - data[k] = path.resolve(home, val.substr(2)) + data[k] = path.resolve(home, val.slice(2)) } else { data[k] = path.resolve(val) } @@ -151,63 +172,92 @@ function validatePath (data, k, val) { } function validateNumber (data, k, val) { - debug("validate Number %j %j %j", k, val, isNaN(val)) - if (isNaN(val)) return false + debug('validate Number %j %j %j', k, val, isNaN(val)) + if (isNaN(val)) { + return false + } data[k] = +val } function validateDate (data, k, val) { var s = Date.parse(val) - debug("validate Date %j %j %j", k, val, s) - if (isNaN(s)) return false + debug('validate Date %j %j %j', k, val, s) + if (isNaN(s)) { + return false + } data[k] = new Date(val) } function validateBoolean (data, k, val) { - if (val instanceof Boolean) val = val.valueOf() - else if (typeof val === "string") { - if (!isNaN(val)) val = !!(+val) - else if (val === "null" || val === "false") val = false - else val = true - } else val = !!val + if (val instanceof Boolean) { + val = val.valueOf() + } else if (typeof val === 'string') { + if (!isNaN(val)) { + val = !!(+val) + } else if (val === 'null' || val === 'false') { + val = false + } else { + val = true + } + } else { + val = !!val + } data[k] = val } function validateUrl (data, k, val) { + // Changing this would be a breaking change in the npm cli + /* eslint-disable-next-line node/no-deprecated-api */ val = url.parse(String(val)) - if (!val.host) return false + if (!val.host) { + return false + } data[k] = val.href } function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false + if (!(val instanceof Stream)) { + return false + } data[k] = val } function validate (data, k, val, type, typeDefs) { // arrays are lists of types. if (Array.isArray(type)) { - for (var i = 0, l = type.length; i < l; i ++) { - if (type[i] === Array) continue - if (validate(data, k, val, type[i], typeDefs)) return true + for (let i = 0, l = type.length; i < l; i++) { + if (type[i] === Array) { + continue + } + if (validate(data, k, val, type[i], typeDefs)) { + return true + } } delete data[k] return false } // an array of anything? - if (type === Array) return true + if (type === Array) { + return true + } + // Original comment: // NaN is poisonous. Means that something is not allowed. + // New comment: Changing this to an isNaN check breaks a lot of tests. + // Something is being assumed here that is not actually what happens in + // practice. Fixing it is outside the scope of getting linting to pass in + // this repo. Leaving as-is for now. + /* eslint-disable-next-line no-self-compare */ if (type !== type) { - debug("Poison NaN", k, val, type) + debug('Poison NaN', k, val, type) delete data[k] return false } // explicit list of values if (val === type) { - debug("Explicitly allowed %j", val) + debug('Explicitly allowed %j', val) // if (isArray) (data[k] = data[k] || []).push(val) // else data[k] = val data[k] = val @@ -216,14 +266,17 @@ function validate (data, k, val, type, typeDefs) { // now go through the list of typeDefs, validate against each one. var ok = false - , types = Object.keys(typeDefs) - for (var i = 0, l = types.length; i < l; i ++) { - debug("test type %j %j %j", k, val, types[i]) + var types = Object.keys(typeDefs) + for (let i = 0, l = types.length; i < l; i++) { + debug('test type %j %j %j', k, val, types[i]) var t = typeDefs[types[i]] - if (t && - ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + if (t && ( + (type && type.name && t.type && t.type.name) ? + (type.name === t.type.name) : + (type === t.type) + )) { var d = {} - ok = false !== t.validate(d, k, val) + ok = t.validate(d, k, val) !== false val = d[k] if (ok) { // if (isArray) (data[k] = data[k] || []).push(val) @@ -233,60 +286,63 @@ function validate (data, k, val, type, typeDefs) { } } } - debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1]) - if (!ok) delete data[k] + if (!ok) { + delete data[k] + } return ok } function parse (args, data, remain, types, shorthands) { - debug("parse", args, data, remain) + debug('parse', args, data, remain) - var key = null - , abbrevs = abbrev(Object.keys(types)) - , shortAbbr = abbrev(Object.keys(shorthands)) + var abbrevs = abbrev(Object.keys(types)) + var shortAbbr = abbrev(Object.keys(shorthands)) - for (var i = 0; i < args.length; i ++) { + for (var i = 0; i < args.length; i++) { var arg = args[i] - debug("arg", arg) + debug('arg', arg) if (arg.match(/^-{2,}$/)) { // done with keys. // the rest are args. remain.push.apply(remain, args.slice(i + 1)) - args[i] = "--" + args[i] = '--' break } var hadEq = false - if (arg.charAt(0) === "-" && arg.length > 1) { + if (arg.charAt(0) === '-' && arg.length > 1) { var at = arg.indexOf('=') if (at > -1) { hadEq = true - var v = arg.substr(at + 1) - arg = arg.substr(0, at) + var v = arg.slice(at + 1) + arg = arg.slice(0, at) args.splice(i, 1, arg, v) } // see if it's a shorthand // if so, splice and back up to re-parse it. var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug("arg=%j shRes=%j", arg, shRes) + debug('arg=%j shRes=%j', arg, shRes) if (shRes) { debug(arg, shRes) args.splice.apply(args, [i, 1].concat(shRes)) if (arg !== shRes[0]) { - i -- + i-- continue } } - arg = arg.replace(/^-+/, "") + arg = arg.replace(/^-+/, '') var no = null - while (arg.toLowerCase().indexOf("no-") === 0) { + while (arg.toLowerCase().indexOf('no-') === 0) { no = !no - arg = arg.substr(3) + arg = arg.slice(3) } - if (abbrevs[arg]) arg = abbrevs[arg] + if (abbrevs[arg]) { + arg = abbrevs[arg] + } var argType = types[arg] var isTypeArray = Array.isArray(argType) @@ -299,20 +355,24 @@ function parse (args, data, remain, types, shorthands) { isTypeArray && argType.indexOf(Array) !== -1 // allow unknown things to be arrays if specified multiple times. - if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { - if (!Array.isArray(data[arg])) + if ( + !Object.prototype.hasOwnProperty.call(types, arg) && + Object.prototype.hasOwnProperty.call(data, arg) + ) { + if (!Array.isArray(data[arg])) { data[arg] = [data[arg]] + } isArray = true } var val - , la = args[i + 1] + var la = args[i + 1] var isBool = typeof no === 'boolean' || argType === Boolean || isTypeArray && argType.indexOf(Boolean) !== -1 || (typeof argType === 'undefined' && !hadEq) || - (la === "false" && + (la === 'false' && (argType === null || isTypeArray && ~argType.indexOf(null))) @@ -320,11 +380,13 @@ function parse (args, data, remain, types, shorthands) { // just set and move along val = !no // however, also support --bool true or --bool false - if (la === "true" || la === "false") { + if (la === 'true' || la === 'false') { val = JSON.parse(la) la = null - if (no) val = !val - i ++ + if (no) { + val = !val + } + i++ } // also support "foo":[Boolean, "bar"] and "--foo bar" @@ -332,49 +394,55 @@ function parse (args, data, remain, types, shorthands) { if (~argType.indexOf(la)) { // an explicit type val = la - i ++ - } else if ( la === "null" && ~argType.indexOf(null) ) { + i++ + } else if (la === 'null' && ~argType.indexOf(null)) { // null allowed val = null - i ++ - } else if ( !la.match(/^-{2,}[^-]/) && + i++ + } else if (!la.match(/^-{2,}[^-]/) && !isNaN(la) && - ~argType.indexOf(Number) ) { + ~argType.indexOf(Number)) { // number val = +la - i ++ - } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { + i++ + } else if (!la.match(/^-[^-]/) && ~argType.indexOf(String)) { // string val = la - i ++ + i++ } } - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } continue } if (argType === String) { if (la === undefined) { - la = "" + la = '' } else if (la.match(/^-{1,2}[^-]+/)) { - la = "" - i -- + la = '' + i-- } } if (la && la.match(/^-{2,}$/)) { la = undefined - i -- + i-- } val = la === undefined ? true : la - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } - i ++ + i++ continue } remain.push(arg) @@ -389,14 +457,16 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { arg = arg.replace(/^-+/, '') // if it's an exact known option, then don't go any further - if (abbrevs[arg] === arg) + if (abbrevs[arg] === arg) { return null + } // if it's an exact known shortopt, same deal if (shorthands[arg]) { // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { shorthands[arg] = shorthands[arg].split(/\s+/) + } return shorthands[arg] } @@ -406,7 +476,7 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { if (!singles) { singles = Object.keys(shorthands).filter(function (s) { return s.length === 1 - }).reduce(function (l,r) { + }).reduce(function (l, r) { l[r] = true return l }, {}) @@ -414,28 +484,32 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) { debug('shorthand singles', singles) } - var chrs = arg.split("").filter(function (c) { + var chrs = arg.split('').filter(function (c) { return singles[c] }) - if (chrs.join("") === arg) return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - + if (chrs.join('') === arg) { + return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + } // if it's an arg abbrev, and not a literal shorthand, then prefer the arg - if (abbrevs[arg] && !shorthands[arg]) + if (abbrevs[arg] && !shorthands[arg]) { return null + } // if it's an abbr for a shorthand, then use that - if (shortAbbr[arg]) + if (shortAbbr[arg]) { arg = shortAbbr[arg] + } // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { shorthands[arg] = shorthands[arg].split(/\s+/) + } return shorthands[arg] } diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json index 12ed02da5a832..a3cd13d8c714b 100644 --- a/node_modules/nopt/package.json +++ b/node_modules/nopt/package.json @@ -1,14 +1,20 @@ { "name": "nopt", - "version": "5.0.0", + "version": "6.0.0", "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "author": "GitHub Inc.", "main": "lib/nopt.js", "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "test": "tap test/*.js" + "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" }, "repository": { "type": "git", @@ -19,16 +25,29 @@ }, "license": "ISC", "dependencies": { - "abbrev": "1" + "abbrev": "^1.0.0" }, "devDependencies": { - "tap": "^14.10.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "tap": { + "lines": 87, + "functions": 91, + "branches": 81, + "statements": 87 }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "windowsCI": false, + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index d31e204ebb96d..2dbdf09372909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -129,7 +129,7 @@ "mkdirp-infer-owner": "^2.0.0", "ms": "^2.1.2", "node-gyp": "^9.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.1.0", @@ -885,21 +885,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@npmcli/config/node_modules/nopt": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", - "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", - "inBundle": true, - "dependencies": { - "abbrev": "^1.0.0" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/@npmcli/disparity-colors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz", @@ -5067,6 +5052,21 @@ "node": "*" } }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "inBundle": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/node-modules-regexp": { "version": "1.0.0", "dev": true, @@ -5089,17 +5089,18 @@ } }, "node_modules/nopt": { - "version": "5.0.0", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", "inBundle": true, - "license": "ISC", "dependencies": { - "abbrev": "1" + "abbrev": "^1.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/normalize-package-data": { @@ -10068,7 +10069,7 @@ "minimatch": "^5.1.0", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", "npm-pick-manifest": "^7.0.0", diff --git a/package.json b/package.json index 5f345a43edf84..4fda192af5cc9 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "mkdirp-infer-owner": "^2.0.0", "ms": "^2.1.2", "node-gyp": "^9.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.1.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 7bfb90a079da4..98b183091ca4e 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -21,7 +21,7 @@ "minimatch": "^5.1.0", "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", - "nopt": "^5.0.0", + "nopt": "^6.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", "npm-pick-manifest": "^7.0.0", From 2569d82d0408e158b4b28cab6f23e1b7dc468553 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 09:47:42 -0700 Subject: [PATCH 034/175] deps: node-gyp@9.1.0 --- .../docs/Updating-npm-bundled-node-gyp.md | 2 +- node_modules/node-gyp/lib/build.js | 7 + node_modules/node-gyp/lib/configure.js | 25 ++- .../node-gyp/lib/find-visualstudio.js | 17 +- node_modules/node-gyp/macOS_Catalina.md | 2 +- node_modules/node-gyp/package.json | 4 +- .../node-gyp/test/fixtures/ca-bundle.crt | 40 ----- node_modules/node-gyp/test/fixtures/ca.crt | 21 --- node_modules/node-gyp/test/fixtures/certs.js | 150 ++++++++++++++++++ .../node-gyp/test/fixtures/server.crt | 21 --- .../node-gyp/test/fixtures/server.key | 27 ---- .../node-gyp/test/test-configure-python.js | 4 +- node_modules/node-gyp/test/test-download.js | 24 ++- package-lock.json | 7 +- package.json | 2 +- 15 files changed, 219 insertions(+), 134 deletions(-) delete mode 100644 node_modules/node-gyp/test/fixtures/ca-bundle.crt delete mode 100644 node_modules/node-gyp/test/fixtures/ca.crt create mode 100644 node_modules/node-gyp/test/fixtures/certs.js delete mode 100644 node_modules/node-gyp/test/fixtures/server.crt delete mode 100644 node_modules/node-gyp/test/fixtures/server.key diff --git a/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md b/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md index 1d91af6bb26d5..5759add3fee57 100644 --- a/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md +++ b/node_modules/node-gyp/docs/Updating-npm-bundled-node-gyp.md @@ -4,7 +4,7 @@ **Note: These instructions will be undone if you reinstall or upgrade npm or node! For a more permanent (and simpler) solution, see [Force-npm-to-use-global-node-gyp.md](Force-npm-to-use-global-node-gyp.md). (npm 6 or older only!)** -[Many issues](https://github.com/nodejs/node-gyp/labels/ERR%21%20node-gyp%20-v%20%3C%3D%20v5.1.0) are opened by users who are +[Many issues](https://github.com/nodejs/node-gyp/issues?q=label%3A"ERR!+node-gyp+-v+<%3D+v9.x.x") are opened by users who are not running a [current version of node-gyp](https://github.com/nodejs/node-gyp/releases). `npm` bundles its own, internal, copy of `node-gyp`. This internal copy is independent of any globally installed copy of node-gyp that diff --git a/node_modules/node-gyp/lib/build.js b/node_modules/node-gyp/lib/build.js index c2388fb348cc5..3baba4140c9cb 100644 --- a/node_modules/node-gyp/lib/build.js +++ b/node_modules/node-gyp/lib/build.js @@ -185,6 +185,13 @@ function build (gyp, argv, callback) { } } + if (!win) { + // Add build-time dependency symlinks (such as Python) to PATH + const buildBinsDir = path.resolve('build', 'node_gyp_bins') + process.env.PATH = `${buildBinsDir}:${process.env.PATH}` + log.verbose('bin symlinks', `adding symlinks (such as Python), at "${buildBinsDir}", to PATH`) + } + var proc = gyp.spawn(command, argv) proc.on('exit', onExit) } diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js index 17a6487fa9caf..c7010385b5e0d 100644 --- a/node_modules/node-gyp/lib/configure.js +++ b/node_modules/node-gyp/lib/configure.js @@ -17,6 +17,7 @@ if (win) { function configure (gyp, argv, callback) { var python var buildDir = path.resolve('build') + var buildBinsDir = path.join(buildDir, 'node_gyp_bins') var configNames = ['config.gypi', 'common.gypi'] var configs = [] var nodeDir @@ -73,7 +74,9 @@ function configure (gyp, argv, callback) { function createBuildDir () { log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) - fs.mkdir(buildDir, { recursive: true }, function (err, isNew) { + + const deepestBuildDirSubdirectory = win ? buildDir : buildBinsDir + fs.mkdir(deepestBuildDirSubdirectory, { recursive: true }, function (err, isNew) { if (err) { return callback(err) } @@ -84,11 +87,31 @@ function configure (gyp, argv, callback) { findVisualStudio(release.semver, gyp.opts.msvs_version, createConfigFile) } else { + createPythonSymlink() createConfigFile() } }) } + function createPythonSymlink () { + const symlinkDestination = path.join(buildBinsDir, 'python3') + + log.verbose('python symlink', `creating symlink to "${python}" at "${symlinkDestination}"`) + + fs.unlink(symlinkDestination, function (err) { + if (err && err.code !== 'ENOENT') { + log.verbose('python symlink', 'error when attempting to remove existing symlink') + log.verbose('python symlink', err.stack, 'errno: ' + err.errno) + } + fs.symlink(python, symlinkDestination, function (err) { + if (err) { + log.verbose('python symlink', 'error when attempting to create Python symlink') + log.verbose('python symlink', err.stack, 'errno: ' + err.errno) + } + }) + }) + } + function createConfigFile (err, vsInfo) { if (err) { return callback(err) diff --git a/node_modules/node-gyp/lib/find-visualstudio.js b/node_modules/node-gyp/lib/find-visualstudio.js index 64af7be3460ef..8a5cfc1ea9b93 100644 --- a/node_modules/node-gyp/lib/find-visualstudio.js +++ b/node_modules/node-gyp/lib/find-visualstudio.js @@ -314,29 +314,30 @@ VisualStudioFinder.prototype = { getSDK: function getSDK (info) { const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK' const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.' + const win11SDKPrefix = 'Microsoft.VisualStudio.Component.Windows11SDK.' - var Win10SDKVer = 0 + var Win10or11SDKVer = 0 info.packages.forEach((pkg) => { - if (!pkg.startsWith(win10SDKPrefix)) { + if (!pkg.startsWith(win10SDKPrefix) && !pkg.startsWith(win11SDKPrefix)) { return } const parts = pkg.split('.') if (parts.length > 5 && parts[5] !== 'Desktop') { - this.log.silly('- ignoring non-Desktop Win10SDK:', pkg) + this.log.silly('- ignoring non-Desktop Win10/11SDK:', pkg) return } const foundSdkVer = parseInt(parts[4], 10) if (isNaN(foundSdkVer)) { // Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb - this.log.silly('- failed to parse Win10SDK number:', pkg) + this.log.silly('- failed to parse Win10/11SDK number:', pkg) return } - this.log.silly('- found Win10SDK:', foundSdkVer) - Win10SDKVer = Math.max(Win10SDKVer, foundSdkVer) + this.log.silly('- found Win10/11SDK:', foundSdkVer) + Win10or11SDKVer = Math.max(Win10or11SDKVer, foundSdkVer) }) - if (Win10SDKVer !== 0) { - return `10.0.${Win10SDKVer}.0` + if (Win10or11SDKVer !== 0) { + return `10.0.${Win10or11SDKVer}.0` } else if (info.packages.indexOf(win8SDK) !== -1) { this.log.silly('- found Win8SDK') return '8.1' diff --git a/node_modules/node-gyp/macOS_Catalina.md b/node_modules/node-gyp/macOS_Catalina.md index 4fe0f29b21eb5..dde5fe3f7d4fb 100644 --- a/node_modules/node-gyp/macOS_Catalina.md +++ b/node_modules/node-gyp/macOS_Catalina.md @@ -37,7 +37,7 @@ If `ProductVersion` is less then `10.15` then this document is not for you. Norm ### The acid test To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run: ``` -curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash +curl -sL https://github.com/nodejs/node-gyp/raw/main/macOS_Catalina_acid_test.sh | bash ``` If test succeeded, _you are done_! You should be ready to [install](https://github.com/nodejs/node-gyp#installation) `node-gyp`. diff --git a/node_modules/node-gyp/package.json b/node_modules/node-gyp/package.json index e795db1834538..ecf4d8ae893d8 100644 --- a/node_modules/node-gyp/package.json +++ b/node_modules/node-gyp/package.json @@ -11,7 +11,7 @@ "bindings", "gyp" ], - "version": "9.0.0", + "version": "9.1.0", "installVersion": 9, "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { @@ -45,6 +45,6 @@ }, "scripts": { "lint": "standard */*.js test/**/*.js", - "test": "npm run lint && tap --timeout=120 test/test-*" + "test": "npm run lint && tap --timeout=600 test/test-*" } } diff --git a/node_modules/node-gyp/test/fixtures/ca-bundle.crt b/node_modules/node-gyp/test/fixtures/ca-bundle.crt deleted file mode 100644 index fb1dea98a78c8..0000000000000 --- a/node_modules/node-gyp/test/fixtures/ca-bundle.crt +++ /dev/null @@ -1,40 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH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0IAYPln+ -YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n -VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ -uGZtfEvhbNm6m2i4UNmpCXxUZQ== ------END CERTIFICATE----- diff --git a/node_modules/node-gyp/test/fixtures/ca.crt b/node_modules/node-gyp/test/fixtures/ca.crt deleted file mode 100644 index aaf97575b18b4..0000000000000 --- a/node_modules/node-gyp/test/fixtures/ca.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZDCCAkwCCQCAzfCLqrJvuTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsMCG5vZGUt -Z3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1aWxkQG5v -ZGVqcy5vcmcwHhcNMTkwNjIyMDYyMjMzWhcNMjIwNDExMDYyMjMzWjB0MQswCQYD -VQQGEwJVUzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsM -CG5vZGUtZ3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1 -aWxkQG5vZGVqcy5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDS -CHjvtVW4HdbbUwZ/ZV9s6U4x0KSoyNQrsCZjB8kRpFPe50DS5mfmu2SNBGYKRgzk -4QEEwFB9N2o8YTWsCefSRl6ti4ToPZqulU4hhRKYrEGtMJcRzi3IN7s200JaO3UH -01Su8ruO0NESb5zEU1Ykfh8Lub8TGEAINmgI61d/5d5Aq3kDjUHQJt1Ekw03Ylnu -juQyCGZxLxnngu0mIvwzyL/UeeUgsfQLzvppUk6In7tC1zzMjSPWo0c8qu6KvrW4 -bKYnkZkzdQifzbpO5ERMEsh5HWq0uHa6+dgcVHFvlhdqF4Uat87ygNplVf0txsZB -MNVqbz1k6xkZYMnzDoydAgMBAAEwDQYJKoZIhvcNAQELBQADggEBADspZGtKpWxy -J1W3FA1aeQhMvequQTcMRz4avkm4K4HfTdV1iVD4CbvdezBphouBlyLVLDFJP7RZ -m7dBJVgBwnxufoFLne8cR2MGqDRoySbFT1AtDJdxabE6Fg+QGUpgOQfeBJ6ANlSB -+qJ+HG4QA+Ouh5hxz9mgYwkIsMUABHiwENdZ/kT8Edw4xKgd3uH0YP4iiePMD66c -rzW3uXH5J1jnKgBlpxtog4P6dHCcoq+PZJ17W5bdXNyqC1LPzQqniZ2BNcEZ4ix3 -slAZAOWD1zLLGJhBPMV1fa0sHNBWc6oicr3YK/IDb0cp9kiLvnUu1pHy+LWQGqtC -rceJuGsnJEQ= ------END CERTIFICATE----- diff --git a/node_modules/node-gyp/test/fixtures/certs.js b/node_modules/node-gyp/test/fixtures/certs.js new file mode 100644 index 0000000000000..766e54b5ed390 --- /dev/null +++ b/node_modules/node-gyp/test/fixtures/certs.js @@ -0,0 +1,150 @@ +module.exports['ca.key'] = ` +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAtTbG0k2UFUyCdZuip0TTEtXRHh57qosegrpHPBreSNTxt7OT +KfOUZp2rToTHeN9w0ZbV2eKRI5AuFx8Cmlm73/KIHKzSNTBATGMeeHnGaxvL/W/s +KJdTDRNf7/qCXHQ+gsuEWWCFzOZuHmmAQa2IBX2HAQTqXJI8+2iJ9gytFfJLxjqy +6O4u9ugZVHSyQJWs49tGRcWMlNm7EMStADFvJn3S11xe/kwIA2mSI/eddDnzL0Mx +AkR9dQBL66xOABLL5v3QQdhipfHluX6HLbDd/1YsFTuOpgvLRlr72rTAFrQZCokV +hXPiqstn5zJFW5arHakvMR0+OPaICF5feh/4qQIDAQABAoIBAHWg6exnWUF+GY0Y +CrwDS/QFASpI5UNt7M809bqJQlMKjyEMm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GSIb3DQEBCwUAA4IBAQA9 +D+qoKw0njub+NaFRS2DFbSiKb5JKTxVjU5aNusFONFLSXBuRpnYyjjkXpJy8JMWz +g8GFDEPP6kiSb8xaPNrFcUzb4PFzJabNTuaLJpBpd2gNBj5AeYwwpRa2DPv/b4yw +y2mfULuCWS09ZAguI2OcaARlAsFxYN0IuQ6pN1AvGFGee67ve9l2VF/hhwEi4lCk +MM0CWlP6COJ8TX7X0MTtexVOgo9m3hBuTSYEZClYFIdSOk10xkPl8Y3Iz/x6mzfK +Uu2l2ZtYvSdAX1CQMds3ZWt0ChNNEjOKPv4g2QSDhGkiqrmi4wUS81g68wKqOpqn +GbN8uKxIfyMjqZKaujPR +-----END CERTIFICATE----- +` + +module.exports['server.key'] = ` +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAvPM99BkYrBcTM355dhz4XzhSDRGxa9qttUlBSgEsbu2UjsRm +XjDS+60XXd66tWpPwLeUd2uvlC/ltv5ekv+EBu35j1KfA1+K1rtFzb1i40kMCsns +OoXjgpsN2wvkxMdFkT2bkqKCS6X0xzlWea1t4poKh9iG7n3otk4RzPNawfwQ9W5n +o9/8i6AUwDbuK4dhAId/Inw2aKrMyQ+AiSvsDM2wUMq+pV7nP46f7MhR4xiGz14z +ATFdjM3Oo/1NKrr0WgVM6i0eNAtuIDqIs8YE7SfODe/SzpJySxewutfYi62OaLh/ +hmWByj/pF5SoNMLyJHxn4GyKK+Qle9NJAThLiwIDAQABAoIBAQCZs4h/Cvct7etZ +pRUqxnAoDQl5xh28LXvGj1uD1qaNacfBxvO6xR6rSedLHcZlkqBjlTI5XqjJ85h6 +njrSevWsKWMrejsNpGetO1OSA+/wEVixYgY+qPEkKftAZ1Fl3O+zMRlfU8CHxuzy +Lqsweap8fW/5h2JjmJp3ydPjE0aNqpQ+0LtYBBawKDIe2zPNOmTPwz3D8qJNQJKU +Qdj08dO/vPZncllPagGvpqhfv4hMyNChr71eBbEFsi3O5VJxfZyj+fQG0DGocr/y +sV54HtYk5j06wMxZFLQtaJn+1pOXquZMNwodSPnbrR/+CI1SZeB8N6VyqqOdmrDz +5NbfGJiRAoGBAPrCuQxJwgc2MzpEtrXA4+1uuV8QWGy3+wNKxKw4lgyC7peXXrVK +l9FkOOAPr8puPRABgDS9t6vo59BAP3Wrx0oJ9PA/Qn03WYLfJMepWqlK7ni9kS04 +5owRTduK7P190sp0m6iicsnchGSSOchECwB5UmtHysEFiuY0T+0pdNbjAoGBAMDl +57lwZDfNTGGDxLQYVzbrXgKcD60DW9MhvH3uso6cw5NYs3tmENCh9D6YrCNN4PmL +zdp4dKbOFoGJdy22TK31nrezUuNKSK+QKH2gsmNVI+a5QokNO1Cfk+PMLoOR5du2 +nwyVvzdaBwuXU4fhmwvLv/SCFNEJ0EgUILeMETE5AoGBAIwLXf9v3e3bJkb/gy8E +mAbNVLez0D5/ja9r/WTVgW9hXFDLF/iVvS4TE/SGrj2WzYF35RsPbVmUDIrwpsBX +/EfsQaA/JCn8VIBTkR31Bg4QLBjAfijMY22MaHgZIXv83lF1SE2o1ATKpCHqzFx9 +K8vK9e22PZUJPGaOhqjEA13TAoGAEPipSJFw38/6NmInfkjd84EFxmkAoBI5k/vV +36aOoyl7s40MTYEPXavCF3fLPVfuwUXhmKUcbkiXhlIX4De3y15e1n66fjDc8EVY +qqTmzQKCpBwMlI5Ld65yjoo6VW0SsiABIlRSfIY5NHXd7YiV4ZXNj6+aMUIRxyWu +Mzfpk1ECgYBZw8lML+F8XbcmCLGYuicf0V/wgFaJr8nnPeW7AiQrv13Ju1ItEaC8 +Tz8F7OfC+FoUb0MGjXHKquDVBDs4xSuS+Ol+rlZEK68ALpm8sUgp6YjARYiXlprs +6o4kN0P5F+DVU2SP6fo9zKLCxaTH9VAQ9C3VUViGAFLBt4DVDmj77g== +-----END RSA PRIVATE KEY----- +` + +module.exports['server.crt'] = ` +-----BEGIN CERTIFICATE----- +MIIDNzCCAh8CFBg1Ph5t5rBlAbCrEn/PexNy9WunMA0G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nJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae +KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ +YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n +VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ +uGZtfEvhbNm6m2i4UNmpCXxUZQ== +-----END CERTIFICATE----- +` diff --git a/node_modules/node-gyp/test/fixtures/server.crt b/node_modules/node-gyp/test/fixtures/server.crt deleted file mode 100644 index 5d0c440e0788a..0000000000000 --- a/node_modules/node-gyp/test/fixtures/server.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYjCCAkoCCQCSlmGR7KzZGTANBgkqhkiG9w0BAQsFADB0MQswCQYDVQQGEwJV -UzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsMCG5vZGUt -Z3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEGJ1aWxkQG5v -ZGVqcy5vcmcwHhcNMTkwNjIyMDYyNTU1WhcNMjkwNjE5MDYyNTU1WjByMQswCQYD -VQQGEwJVUzELMAkGA1UECAwCQ0ExEDAOBgNVBAoMB05vZGUuanMxETAPBgNVBAsM -CG5vZGUtZ3lwMRIwEAYDVQQDDAlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEWDmJ1 -aWxkQGlvanMub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6S1E -2WchgmbJYqCnpN7310ZgHjIOqeJe6MpSue2u6z6mTNd5izgvQNaANmn3xLFCS5zs -uZaTvdPYPkcmSQzb1YcZSUYnAxZifjYARc6kb5GSBl3q+O70ELyFrimXfZ4JI+bd -IG9KiHY17DlvZZZj/csGYVWWg0mkeH3O5LPX6/DXQVh/9+gZ02/cdIBCAtZHQwqx -7tF/qZA/kD4GZNFpU1DYHzf9H6g9htoCqmNHQWrV2T9yFybt6mbZp9kglBmyKYCc -7hmQnb7N/mHn1yIuwhBsirCJTfKH86gN81u8M3+SVHA2VUHDllcNhpDWlmInXA+I -tHdGZHCp95ohqpCPgQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCdvYj6CD0ZLwT2 -3t1r+deC3TJuHlNVSeKeT7wIfFnh2FW5riGV0q/w6eXPLTHjuiS6YmpAAbdNUgX/ -sq64FqI2RLpX6pgY5yB0SKopMcJxMLKqmF4zHpIHxtYN5EmN3PR0vehneBR/nZ2T -3ikvWD5JeXlm7Dfw+tjijdxM/sEoDWErGup4mMKMd1s5s830p+ITJUa50d0DLFdH -mqPSbUZF8mMPwGJd+nu1Ht3gTLtK7+gYJgGtXMJmGC0Qg77EJHDB2NbotgDGNmSU -1H9BpAeFHHIcbh2Rr7kkTvnh/c03vFe+CsDZmezcmRpRzW1fKj3YbfqBxU4XwJrL -a5T/N9xU ------END CERTIFICATE----- diff --git a/node_modules/node-gyp/test/fixtures/server.key b/node_modules/node-gyp/test/fixtures/server.key deleted file mode 100644 index a8447391e02e2..0000000000000 --- a/node_modules/node-gyp/test/fixtures/server.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA6S1E2WchgmbJYqCnpN7310ZgHjIOqeJe6MpSue2u6z6mTNd5 -izgvQNaANmn3xLFCS5zsuZaTvdPYPkcmSQzb1YcZSUYnAxZifjYARc6kb5GSBl3q -+O70ELyFrimXfZ4JI+bdIG9KiHY17DlvZZZj/csGYVWWg0mkeH3O5LPX6/DXQVh/ -9+gZ02/cdIBCAtZHQwqx7tF/qZA/kD4GZNFpU1DYHzf9H6g9htoCqmNHQWrV2T9y -Fybt6mbZp9kglBmyKYCc7hmQnb7N/mHn1yIuwhBsirCJTfKH86gN81u8M3+SVHA2 -VUHDllcNhpDWlmInXA+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AY7bwGKRq55Z -fUmfAoGBANOYFyoJoDLcl+Jd750lyqfCifcGtkRdmZMtrPXaYnD8ZGme9vz1vsK/ -4iUkV3mi7Z9s1LXMa/tPPfKdVhCM1PXost3/si0+u1Bz5yKqEPXlyy2ltpIVyGu8 -yiy7y75asp8Iii/1cgtwyp9+VeSif8wJ+MHQoGdGxvAQP80R3EjF ------END RSA PRIVATE KEY----- diff --git a/node_modules/node-gyp/test/test-configure-python.js b/node_modules/node-gyp/test/test-configure-python.js index 4290e7af1bb1c..aacd75f7c7294 100644 --- a/node_modules/node-gyp/test/test-configure-python.js +++ b/node_modules/node-gyp/test/test-configure-python.js @@ -14,7 +14,9 @@ const configure = requireInject('../lib/configure', { mkdir: function (dir, options, cb) { cb() }, promises: { writeFile: function (file, data) { return Promise.resolve(null) } - } + }, + unlink: function (path, cb) { cb() }, + symlink: function (target, path, cb) { cb() } } }) diff --git a/node_modules/node-gyp/test/test-download.js b/node_modules/node-gyp/test/test-download.js index 71a3c0d092dfe..c4caad9e8346d 100644 --- a/node_modules/node-gyp/test/test-download.js +++ b/node_modules/node-gyp/test/test-download.js @@ -12,6 +12,7 @@ const devDir = require('./common').devDir() const rimraf = require('rimraf') const gyp = require('../lib/node-gyp') const log = require('npmlog') +const certs = require('./fixtures/certs') log.level = 'warn' @@ -40,12 +41,12 @@ test('download over http', async (t) => { test('download over https with custom ca', async (t) => { t.plan(3) - const cafile = path.join(__dirname, '/fixtures/ca.crt') - const [cert, key, ca] = await Promise.all([ - fs.promises.readFile(path.join(__dirname, 'fixtures/server.crt'), 'utf8'), - fs.promises.readFile(path.join(__dirname, 'fixtures/server.key'), 'utf8'), - install.test.readCAFile(cafile) - ]) + const cafile = path.join(__dirname, 'fixtures/ca.crt') + const cacontents = certs['ca.crt'] + const cert = certs['server.crt'] + const key = certs['server.key'] + await fs.promises.writeFile(cafile, cacontents, 'utf8') + const ca = await install.test.readCAFile(cafile) t.strictEqual(ca.length, 1) @@ -55,7 +56,10 @@ test('download over https with custom ca', async (t) => { res.end('ok') }) - t.tearDown(() => new Promise((resolve) => server.close(resolve))) + t.tearDown(async () => { + await new Promise((resolve) => server.close(resolve)) + await fs.promises.unlink(cafile) + }) server.on('clientError', (err) => { throw err }) @@ -150,6 +154,12 @@ test('download with missing cafile', async (t) => { }) test('check certificate splitting', async (t) => { + const cafile = path.join(__dirname, 'fixtures/ca-bundle.crt') + const cacontents = certs['ca-bundle.crt'] + await fs.promises.writeFile(cafile, cacontents, 'utf8') + t.tearDown(async () => { + await fs.promises.unlink(cafile) + }) const cas = await install.test.readCAFile(path.join(__dirname, 'fixtures/ca-bundle.crt')) t.plan(2) t.strictEqual(cas.length, 2) diff --git a/package-lock.json b/package-lock.json index 2dbdf09372909..67c0af1cba3e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,7 +128,7 @@ "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "ms": "^2.1.2", - "node-gyp": "^9.0.0", + "node-gyp": "^9.1.0", "nopt": "^6.0.0", "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", @@ -4988,9 +4988,10 @@ "license": "MIT" }, "node_modules/node-gyp": { - "version": "9.0.0", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", + "integrity": "sha512-HkmN0ZpQJU7FLbJauJTHkHlSVAXlNGDAzH/VYFZGDOnFyn/Na3GlNJfkudmufOdS6/jNFhy88ObzL7ERz9es1g==", "inBundle": true, - "license": "MIT", "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", diff --git a/package.json b/package.json index 4fda192af5cc9..902dac43bd8ae 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "ms": "^2.1.2", - "node-gyp": "^9.0.0", + "node-gyp": "^9.1.0", "nopt": "^6.0.0", "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", From a396f8dd0968971ddb6f491a0bc645132c82021a Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 09:49:13 -0700 Subject: [PATCH 035/175] deps: @npmcli/map-workspaces@2.0.4 --- node_modules/@npmcli/map-workspaces/lib/index.js | 2 +- node_modules/@npmcli/map-workspaces/package.json | 6 +++--- package-lock.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/node_modules/@npmcli/map-workspaces/lib/index.js b/node_modules/@npmcli/map-workspaces/lib/index.js index 3ac545e9c15c4..f93bc2911e89f 100644 --- a/node_modules/@npmcli/map-workspaces/lib/index.js +++ b/node_modules/@npmcli/map-workspaces/lib/index.js @@ -12,7 +12,7 @@ function appendNegatedPatterns (patterns) { for (let pattern of patterns) { const excl = pattern.match(/^!+/) if (excl) { - pattern = pattern.substr(excl[0].length) + pattern = pattern.slice(excl[0].length) } // strip off any / from the start of the pattern. /foo => foo diff --git a/node_modules/@npmcli/map-workspaces/package.json b/node_modules/@npmcli/map-workspaces/package.json index 3025081e5529b..a71a1d2805efa 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": "2.0.3", + "version": "2.0.4", "main": "lib/index.js", "files": [ "bin/", @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.4.1", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, "dependencies": { @@ -53,6 +53,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.4.1" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 67c0af1cba3e9..8cc2d576e983d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -964,9 +964,9 @@ } }, "node_modules/@npmcli/map-workspaces": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.3.tgz", - "integrity": "sha512-X6suAun5QyupNM8iHkNPh0AHdRC2rb1W+MTdMvvA/2ixgmqZwlq5cGUBgmKHUHT2LgrkKJMAXbfAoTxOigpK8Q==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz", + "integrity": "sha512-bMo0aAfwhVwqoVM5UzX1DJnlvVvzDCHae821jv48L1EsrYwfOZChlqWYXEtto/+BkBXetPbEWgau++/brh4oVg==", "inBundle": true, "dependencies": { "@npmcli/name-from-folder": "^1.0.1", From a9b5306627058b8869a6221a0c099493c206a3f2 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:12:54 -0700 Subject: [PATCH 036/175] deps: is-core-module@2.10.0 --- node_modules/is-core-module/core.json | 2 +- node_modules/is-core-module/package.json | 2 +- node_modules/is-core-module/test/index.js | 2 +- package-lock.json | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/node_modules/is-core-module/core.json b/node_modules/is-core-module/core.json index 058584b78998a..b1d7e46606b77 100644 --- a/node_modules/is-core-module/core.json +++ b/node_modules/is-core-module/core.json @@ -112,7 +112,7 @@ "node:string_decoder": [">= 14.18 && < 15", ">= 16"], "sys": [">= 0.4 && < 0.7", ">= 0.8"], "node:sys": [">= 14.18 && < 15", ">= 16"], - "node:test": ">= 18", + "node:test": [">= 16.17 && < 17", ">= 18"], "timers": true, "node:timers": [">= 14.18 && < 15", ">= 16"], "timers/promises": ">= 15", diff --git a/node_modules/is-core-module/package.json b/node_modules/is-core-module/package.json index 80ce9f5bb1797..c2830d63202a9 100644 --- a/node_modules/is-core-module/package.json +++ b/node_modules/is-core-module/package.json @@ -1,6 +1,6 @@ { "name": "is-core-module", - "version": "2.9.0", + "version": "2.10.0", "description": "Is this specifier a node.js core module?", "main": "index.js", "sideEffects": false, diff --git a/node_modules/is-core-module/test/index.js b/node_modules/is-core-module/test/index.js index 4385b20ea1489..912808b9d0000 100644 --- a/node_modules/is-core-module/test/index.js +++ b/node_modules/is-core-module/test/index.js @@ -44,7 +44,7 @@ test('core modules', function (t) { t.test('core via repl module', { skip: !data.repl }, function (st) { var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle if (!libs) { - st.skip('module.builtinModules does not exist'); + st.skip('repl._builtinLibs does not exist'); } else { for (var i = 0; i < libs.length; ++i) { var mod = libs[i]; diff --git a/package-lock.json b/package-lock.json index 8cc2d576e983d..ffcdc16be1969 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3878,9 +3878,9 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "inBundle": true, "dependencies": { "has": "^1.0.3" From 786f753b0db49340a0e26ec8fb5425773a7f0558 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:15:05 -0700 Subject: [PATCH 037/175] deps: lru-cache@7.13.2 --- node_modules/lru-cache/index.d.ts | 7 +++--- node_modules/lru-cache/index.js | 39 +++++++++++++++++++++-------- node_modules/lru-cache/package.json | 5 ++-- package-lock.json | 6 ++--- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/node_modules/lru-cache/index.d.ts b/node_modules/lru-cache/index.d.ts index b9375a8b96a71..e5481b3f92637 100644 --- a/node_modules/lru-cache/index.d.ts +++ b/node_modules/lru-cache/index.d.ts @@ -1,4 +1,3 @@ -// Type definitions for lru-cache 7.10.0 // Project: https://github.com/isaacs/node-lru-cache // Based initially on @types/lru-cache // https://github.com/DefinitelyTyped/DefinitelyTyped @@ -32,7 +31,6 @@ // Changes by Isaac Z. Schlueter released under the terms found in the // LICENSE file within this project. -/// //tslint:disable:member-access declare class LRUCache implements Iterable<[K, V]> { constructor(options: LRUCache.Options) @@ -569,10 +567,11 @@ declare namespace LRUCache { /** * options which override the options set in the LRUCache constructor * when making `cache.fetch()` calls. - * This is the union of GetOptions and SetOptions, plus the - * `noDeleteOnFetchRejection` and `fetchContext` fields. + * This is the union of GetOptions and SetOptions, plus + * `noDeleteOnFetchRejection`, `forceRefresh`, and `fetchContext` */ interface FetchOptions extends FetcherFetchOptions { + forceRefresh?: boolean fetchContext?: any } diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js index 479ffc8656b70..0a551c9d1d6f2 100644 --- a/node_modules/lru-cache/index.js +++ b/node_modules/lru-cache/index.js @@ -364,8 +364,10 @@ class LRUCache { initializeSizeTracking() { this.calculatedSize = 0 this.sizes = new ZeroArray(this.max) - this.removeItemSize = index => - (this.calculatedSize -= this.sizes[index]) + this.removeItemSize = index => { + this.calculatedSize -= this.sizes[index] + this.sizes[index] = 0 + } this.requireSize = (k, v, size, sizeCalculation) => { if (!isPosInt(size)) { if (sizeCalculation) { @@ -386,7 +388,7 @@ class LRUCache { } return size } - this.addItemSize = (index, v, k, size) => { + this.addItemSize = (index, size) => { this.sizes[index] = size const maxSize = this.maxSize - this.sizes[index] while (this.calculatedSize > maxSize) { @@ -396,7 +398,7 @@ class LRUCache { } } removeItemSize(index) {} - addItemSize(index, v, k, size) {} + addItemSize(index, size) {} requireSize(k, v, size, sizeCalculation) { if (size || sizeCalculation) { throw new TypeError( @@ -523,7 +525,9 @@ class LRUCache { for (const i of this.indexes({ allowStale: true })) { const key = this.keyList[i] const v = this.valList[i] - const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v const entry = { value } if (this.ttls) { entry.ttl = this.ttls[i] @@ -569,6 +573,10 @@ class LRUCache { } = {} ) { size = this.requireSize(k, v, size, sizeCalculation) + // if the item doesn't fit, don't do anything + if (this.maxSize && size > this.maxSize) { + return this + } let index = this.size === 0 ? undefined : this.keyMap.get(k) if (index === undefined) { // addition @@ -580,7 +588,7 @@ class LRUCache { this.prev[index] = this.tail this.tail = index this.size++ - this.addItemSize(index, v, k, size) + this.addItemSize(index, size) noUpdateTTL = false } else { // update @@ -598,7 +606,7 @@ class LRUCache { } this.removeItemSize(index) this.valList[index] = v - this.addItemSize(index, v, k, size) + this.addItemSize(index, size) } this.moveToTail(index) } @@ -680,7 +688,9 @@ class LRUCache { peek(k, { allowStale = this.allowStale } = {}) { const index = this.keyMap.get(k) if (index !== undefined && (allowStale || !this.isStale(index))) { - return this.valList[index] + const v = this.valList[index] + // either stale and allowed, or forcing a refresh of non-stale value + return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v } } @@ -763,10 +773,15 @@ class LRUCache { // fetch exclusive options noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, fetchContext = this.fetchContext, + forceRefresh = false, } = {} ) { if (!this.fetchMethod) { - return this.get(k, { allowStale, updateAgeOnGet, noDeleteOnStaleGet }) + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + }) } const options = { @@ -794,7 +809,9 @@ class LRUCache { : (v.__returned = v) } - if (!this.isStale(index)) { + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + if (!forceRefresh && !this.isStale(index)) { this.moveToTail(index) if (updateAgeOnGet) { this.updateItemAge(index) @@ -802,7 +819,7 @@ class LRUCache { return v } - // ok, it is stale, and not already fetching + // ok, it is stale or a forced refresh, and not already fetching. // refresh the cache. const p = this.backgroundFetch(k, index, options, fetchContext) return allowStale && p.__staleWhileFetching !== undefined diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json index c023ce6c49aca..c3c62e0a3254e 100644 --- a/node_modules/lru-cache/package.json +++ b/node_modules/lru-cache/package.json @@ -1,13 +1,14 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "7.12.0", + "version": "7.13.2", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", "lru", "cache" ], + "sideEffects": false, "scripts": { "build": "", "size": "size-limit", @@ -26,7 +27,7 @@ "@types/tap": "^15.0.6", "benchmark": "^2.1.4", "c8": "^7.11.2", - "clock-mock": "^1.0.4", + "clock-mock": "^1.0.6", "eslint-config-prettier": "^8.5.0", "prettier": "^2.6.2", "size-limit": "^7.0.8", diff --git a/package-lock.json b/package-lock.json index ffcdc16be1969..def6d84a38a2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4598,9 +4598,9 @@ } }, "node_modules/lru-cache": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.12.0.tgz", - "integrity": "sha512-OIP3DwzRZDfLg9B9VP/huWBlpvbkmbfiBy8xmsXp4RPmE4A3MhwNozc5ZJ3fWnSg8fDcdlE/neRTPG2ycEKliw==", + "version": "7.13.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.2.tgz", + "integrity": "sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==", "inBundle": true, "engines": { "node": ">=12" From 7b702b6d490d37bdfa52b623dd42ce185846b1bc Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:16:15 -0700 Subject: [PATCH 038/175] deps: are-we-there-yet@3.0.1 --- .../are-we-there-yet/lib/tracker-group.js | 2 +- node_modules/are-we-there-yet/package.json | 25 +++++++++---------- package-lock.json | 7 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/node_modules/are-we-there-yet/lib/tracker-group.js b/node_modules/are-we-there-yet/lib/tracker-group.js index 9da13f8a7e116..a3c7af804c4d3 100644 --- a/node_modules/are-we-there-yet/lib/tracker-group.js +++ b/node_modules/are-we-there-yet/lib/tracker-group.js @@ -103,7 +103,7 @@ TrackerGroup.prototype.finish = function () { var buffer = ' ' TrackerGroup.prototype.debug = function (depth) { depth = depth || 0 - var indent = depth ? buffer.substr(0, depth) : '' + var indent = depth ? buffer.slice(0, depth) : '' var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' this.trackers.forEach(function (tracker) { if (tracker instanceof TrackerGroup) { diff --git a/node_modules/are-we-there-yet/package.json b/node_modules/are-we-there-yet/package.json index 67c01e9cbc8e4..cc3d7504299fa 100644 --- a/node_modules/are-we-there-yet/package.json +++ b/node_modules/are-we-there-yet/package.json @@ -1,12 +1,12 @@ { "name": "are-we-there-yet", - "version": "3.0.0", + "version": "3.0.1", "description": "Keep track of the overall completion of many disparate processes", "main": "lib/index.js", "scripts": { "test": "tap", "npmclilint": "npmcli-lint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", @@ -14,8 +14,8 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force" + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", @@ -28,22 +28,20 @@ }, "homepage": "https://github.com/npm/are-we-there-yet", "devDependencies": { - "@npmcli/eslint-config": "^2.0.0", - "@npmcli/template-oss": "^2.7.1", - "eslint": "^8.8.0", - "eslint-plugin-node": "^11.1.0", - "tap": "^15.0.9" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" }, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "tap": { "branches": 68, @@ -52,6 +50,7 @@ "lines": 92 }, "templateOSS": { - "version": "2.7.1" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index def6d84a38a2d..8f71c874d3889 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1301,15 +1301,16 @@ "license": "MIT" }, "node_modules/are-we-there-yet": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", "inBundle": true, - "license": "ISC", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/arg": { From e74f99e7ccdfce1519cc45bb58054d94b748146c Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:20:05 -0700 Subject: [PATCH 039/175] deps: just-diff@5.1.1 --- node_modules/just-diff/package.json | 8 +++++--- package-lock.json | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/node_modules/just-diff/package.json b/node_modules/just-diff/package.json index 9c6a8bbe2f94b..035daf034fcc9 100644 --- a/node_modules/just-diff/package.json +++ b/node_modules/just-diff/package.json @@ -1,14 +1,16 @@ { "name": "just-diff", - "version": "5.0.3", + "version": "5.1.1", "description": "Return an object representing the diffs between two objects. Supports jsonPatch protocol", "main": "index.js", "module": "index.mjs", "exports": { ".": { "require": "./index.js", + "types": "./index.d.ts", "default": "./index.mjs" - } + }, + "./package.json": "./package.json" }, "types": "index.d.ts", "scripts": { @@ -28,4 +30,4 @@ "bugs": { "url": "https://github.com/angus-c/just/issues" } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8f71c874d3889..4d98c74be5604 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4415,9 +4415,9 @@ } }, "node_modules/just-diff": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.0.3.tgz", - "integrity": "sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-5.1.1.tgz", + "integrity": "sha512-u8HXJ3HlNrTzY7zrYYKjNEfBlyjqhdBkoyTVdjtn7p02RJD5NvR8rIClzeGA7t+UYP1/7eAkWNLU0+P3QrEqKQ==", "inBundle": true }, "node_modules/just-diff-apply": { From 983306637579ab5c062878c0153671007cceea2b Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:20:28 -0700 Subject: [PATCH 040/175] deps: just-diff-apply@5.4.1 --- node_modules/just-diff-apply/package.json | 8 +++++--- package-lock.json | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/node_modules/just-diff-apply/package.json b/node_modules/just-diff-apply/package.json index b2f80b73a19c6..5317303a8bd1b 100644 --- a/node_modules/just-diff-apply/package.json +++ b/node_modules/just-diff-apply/package.json @@ -1,14 +1,16 @@ { "name": "just-diff-apply", - "version": "5.3.1", + "version": "5.4.1", "description": "Apply a diff to an object. Optionally supports jsonPatch protocol", "main": "index.js", "module": "index.mjs", "exports": { ".": { "require": "./index.js", + "types": "./index.d.ts", "default": "./index.mjs" - } + }, + "./package.json": "./package.json" }, "types": "index.d.ts", "scripts": { @@ -29,4 +31,4 @@ "bugs": { "url": "https://github.com/angus-c/just/issues" } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4d98c74be5604..a25e5710bf2cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4421,9 +4421,9 @@ "inBundle": true }, "node_modules/just-diff-apply": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.3.1.tgz", - "integrity": "sha512-dgFenZnMsc1xGNqgdtgnh7DK+Oy352CE3VZLbzcbQpsBs9iI2K3M0IRrdgREZ72eItTjbl0suRyvKRdVQa9GbA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.4.1.tgz", + "integrity": "sha512-AAV5Jw7tsniWwih8Ly3fXxEZ06y+6p5TwQMsw0dzZ/wPKilzyDgdAnL0Ug4NNIquPUOh1vfFWEHbmXUqM5+o8g==", "inBundle": true }, "node_modules/lcov-parse": { From 4e5dd732d7fe39490be1d9f8e81cbdba602c67fe Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 9 Aug 2022 10:22:44 -0700 Subject: [PATCH 041/175] deps: socks@2.7.0 --- node_modules/ip/lib/ip.js | 113 +++++++++--------- node_modules/ip/package.json | 2 +- .../socks/build/client/socksclient.js | 6 +- .../socks/build/client/socksclient.js.map | 2 +- .../socks/build/common/receivebuffer.js.map | 2 +- node_modules/socks/build/common/util.js | 1 - node_modules/socks/build/common/util.js.map | 2 +- node_modules/socks/build/index.js | 6 +- node_modules/socks/build/index.js.map | 2 +- node_modules/socks/package.json | 49 ++------ .../socks/typings/client/socksclient.d.ts | 10 +- .../socks/typings/common/constants.d.ts | 2 + node_modules/socks/typings/common/util.d.ts | 2 +- package-lock.json | 14 +-- 14 files changed, 97 insertions(+), 116 deletions(-) diff --git a/node_modules/ip/lib/ip.js b/node_modules/ip/lib/ip.js index 5b5ccc246a4ab..4b2adb5addd96 100644 --- a/node_modules/ip/lib/ip.js +++ b/node_modules/ip/lib/ip.js @@ -1,24 +1,24 @@ -var ip = exports; -var { Buffer } = require('buffer'); -var os = require('os'); +const ip = exports; +const { Buffer } = require('buffer'); +const os = require('os'); ip.toBuffer = function (ip, buff, offset) { offset = ~~offset; - var result; + let result; if (this.isV4Format(ip)) { - result = buff || new Buffer(offset + 4); + result = buff || Buffer.alloc(offset + 4); ip.split(/\./g).map((byte) => { result[offset++] = parseInt(byte, 10) & 0xff; }); } else if (this.isV6Format(ip)) { - var sections = ip.split(':', 8); + const sections = ip.split(':', 8); - var i; + let i; for (i = 0; i < sections.length; i++) { - var isv4 = this.isV4Format(sections[i]); - var v4Buffer; + const isv4 = this.isV4Format(sections[i]); + let v4Buffer; if (isv4) { v4Buffer = this.toBuffer(sections[i]); @@ -36,16 +36,16 @@ ip.toBuffer = function (ip, buff, offset) { while (sections.length < 8) sections.push('0'); } else if (sections.length < 8) { for (i = 0; i < sections.length && sections[i] !== ''; i++); - var argv = [i, 1]; + const argv = [i, 1]; for (i = 9 - sections.length; i > 0; i--) { argv.push('0'); } - sections.splice.apply(sections, argv); + sections.splice(...argv); } - result = buff || new Buffer(offset + 16); + result = buff || Buffer.alloc(offset + 16); for (i = 0; i < sections.length; i++) { - var word = parseInt(sections[i], 16); + const word = parseInt(sections[i], 16); result[offset++] = (word >> 8) & 0xff; result[offset++] = word & 0xff; } @@ -62,17 +62,16 @@ ip.toString = function (buff, offset, length) { offset = ~~offset; length = length || (buff.length - offset); - var result = []; - var i; + let result = []; if (length === 4) { // IPv4 - for (i = 0; i < length; i++) { + for (let i = 0; i < length; i++) { result.push(buff[offset + i]); } result = result.join('.'); } else if (length === 16) { // IPv6 - for (i = 0; i < length; i += 2) { + for (let i = 0; i < length; i += 2) { result.push(buff.readUInt16BE(offset + i).toString(16)); } result = result.join(':'); @@ -83,8 +82,8 @@ ip.toString = function (buff, offset, length) { return result; }; -var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; -var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; +const ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; +const ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; ip.isV4Format = function (ip) { return ipv4Regex.test(ip); @@ -111,14 +110,14 @@ ip.fromPrefixLen = function (prefixlen, family) { family = _normalizeFamily(family); } - var len = 4; + let len = 4; if (family === 'ipv6') { len = 16; } - var buff = new Buffer(len); + const buff = Buffer.alloc(len); - for (var i = 0, n = buff.length; i < n; ++i) { - var bits = 8; + for (let i = 0, n = buff.length; i < n; ++i) { + let bits = 8; if (prefixlen < 8) { bits = prefixlen; } @@ -134,10 +133,10 @@ ip.mask = function (addr, mask) { addr = ip.toBuffer(addr); mask = ip.toBuffer(mask); - var result = new Buffer(Math.max(addr.length, mask.length)); + const result = Buffer.alloc(Math.max(addr.length, mask.length)); // Same protocol - do bitwise and - var i; + let i; if (addr.length === mask.length) { for (i = 0; i < addr.length; i++) { result[i] = addr[i] & mask[i]; @@ -170,30 +169,30 @@ ip.mask = function (addr, mask) { }; ip.cidr = function (cidrString) { - var cidrParts = cidrString.split('/'); + const cidrParts = cidrString.split('/'); - var addr = cidrParts[0]; + const addr = cidrParts[0]; if (cidrParts.length !== 2) { throw new Error(`invalid CIDR subnet: ${addr}`); } - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); + const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); }; ip.subnet = function (addr, mask) { - var networkAddress = ip.toLong(ip.mask(addr, mask)); + const networkAddress = ip.toLong(ip.mask(addr, mask)); // Calculate the mask's length. - var maskBuffer = ip.toBuffer(mask); - var maskLength = 0; + const maskBuffer = ip.toBuffer(mask); + let maskLength = 0; - for (var i = 0; i < maskBuffer.length; i++) { + for (let i = 0; i < maskBuffer.length; i++) { if (maskBuffer[i] === 0xff) { maskLength += 8; } else { - var octet = maskBuffer[i] & 0xff; + let octet = maskBuffer[i] & 0xff; while (octet) { octet = (octet << 1) & 0xff; maskLength++; @@ -201,7 +200,7 @@ ip.subnet = function (addr, mask) { } } - var numberOfAddresses = Math.pow(2, 32 - maskLength); + const numberOfAddresses = 2 ** (32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), @@ -224,50 +223,48 @@ ip.subnet = function (addr, mask) { }; ip.cidrSubnet = function (cidrString) { - var cidrParts = cidrString.split('/'); + const cidrParts = cidrString.split('/'); - var addr = cidrParts[0]; + const addr = cidrParts[0]; if (cidrParts.length !== 2) { throw new Error(`invalid CIDR subnet: ${addr}`); } - var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); + const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); }; ip.not = function (addr) { - var buff = ip.toBuffer(addr); - for (var i = 0; i < buff.length; i++) { + const buff = ip.toBuffer(addr); + for (let i = 0; i < buff.length; i++) { buff[i] = 0xff ^ buff[i]; } return ip.toString(buff); }; ip.or = function (a, b) { - var i; - a = ip.toBuffer(a); b = ip.toBuffer(b); // same protocol if (a.length === b.length) { - for (i = 0; i < a.length; ++i) { + for (let i = 0; i < a.length; ++i) { a[i] |= b[i]; } return ip.toString(a); // mixed protocols } - var buff = a; - var other = b; + let buff = a; + let other = b; if (b.length > a.length) { buff = b; other = a; } - var offset = buff.length - other.length; - for (i = offset; i < buff.length; ++i) { + const offset = buff.length - other.length; + for (let i = offset; i < buff.length; ++i) { buff[i] |= other[i - offset]; } @@ -275,14 +272,12 @@ ip.or = function (a, b) { }; ip.isEqual = function (a, b) { - var i; - a = ip.toBuffer(a); b = ip.toBuffer(b); // Same protocol if (a.length === b.length) { - for (i = 0; i < a.length; i++) { + for (let i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; @@ -290,20 +285,20 @@ ip.isEqual = function (a, b) { // Swap if (b.length === 4) { - var t = b; + const t = b; b = a; a = t; } // a - IPv4, b - IPv6 - for (i = 0; i < 10; i++) { + for (let i = 0; i < 10; i++) { if (b[i] !== 0) return false; } - var word = b.readUInt16BE(10); + const word = b.readUInt16BE(10); if (word !== 0 && word !== 0xffff) return false; - for (i = 0; i < 4; i++) { + for (let i = 0; i < 4; i++) { if (a[i] !== b[i + 12]) return false; } @@ -365,7 +360,7 @@ ip.loopback = function (family) { // * undefined: First address with `ipv4` or loopback address `127.0.0.1`. // ip.address = function (name, family) { - var interfaces = os.networkInterfaces(); + const interfaces = os.networkInterfaces(); // // Default to `ipv4` @@ -377,8 +372,8 @@ ip.address = function (name, family) { // return the address. // if (name && name !== 'private' && name !== 'public') { - var res = interfaces[name].filter((details) => { - var itemFamily = _normalizeFamily(details.family); + const res = interfaces[name].filter((details) => { + const itemFamily = _normalizeFamily(details.family); return itemFamily === family; }); if (res.length === 0) { @@ -387,12 +382,12 @@ ip.address = function (name, family) { return res[0].address; } - var all = Object.keys(interfaces).map((nic) => { + const all = Object.keys(interfaces).map((nic) => { // // Note: name will only be `public` or `private` // when this is called. // - var addresses = interfaces[nic].filter((details) => { + const addresses = interfaces[nic].filter((details) => { details.family = _normalizeFamily(details.family); if (details.family !== family || ip.isLoopback(details.address)) { return false; @@ -411,7 +406,7 @@ ip.address = function (name, family) { }; ip.toLong = function (ip) { - var ipl = 0; + let ipl = 0; ip.split('.').forEach((octet) => { ipl <<= 8; ipl += parseInt(octet); diff --git a/node_modules/ip/package.json b/node_modules/ip/package.json index 70e1a4f02aeb7..f0d95e9b789a6 100644 --- a/node_modules/ip/package.json +++ b/node_modules/ip/package.json @@ -1,6 +1,6 @@ { "name": "ip", - "version": "1.1.8", + "version": "2.0.0", "author": "Fedor Indutny ", "homepage": "https://github.com/indutny/node-ip", "repository": { diff --git a/node_modules/socks/build/client/socksclient.js b/node_modules/socks/build/client/socksclient.js index 40a82a53214a4..05da4baa4b0e3 100644 --- a/node_modules/socks/build/client/socksclient.js +++ b/node_modules/socks/build/client/socksclient.js @@ -45,6 +45,7 @@ class SocksClient extends events_1.EventEmitter { catch (err) { if (typeof callback === 'function') { callback(err); + // eslint-disable-next-line @typescript-eslint/no-explicit-any return resolve(err); // Resolves pending promise (prevents memory leaks). } else { @@ -68,6 +69,7 @@ class SocksClient extends events_1.EventEmitter { client.removeAllListeners(); if (typeof callback === 'function') { callback(err); + // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve(err); // Resolves pending promise (prevents memory leaks). } else { @@ -86,6 +88,7 @@ class SocksClient extends events_1.EventEmitter { * @returns { Promise } */ static createConnectionChain(options, callback) { + // eslint-disable-next-line no-async-promise-executor return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { // Validate SocksClientChainOptions try { @@ -94,6 +97,7 @@ class SocksClient extends events_1.EventEmitter { catch (err) { if (typeof callback === 'function') { callback(err); + // eslint-disable-next-line @typescript-eslint/no-explicit-any return resolve(err); // Resolves pending promise (prevents memory leaks). } else { @@ -106,7 +110,6 @@ class SocksClient extends events_1.EventEmitter { (0, util_1.shuffleArray)(options.proxies); } try { - // tslint:disable-next-line:no-increment-decrement for (let i = 0; i < options.proxies.length; i++) { const nextProxy = options.proxies[i]; // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. @@ -140,6 +143,7 @@ class SocksClient extends events_1.EventEmitter { catch (err) { if (typeof callback === 'function') { callback(err); + // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve(err); // Resolves pending promise (prevents memory leaks). } else { diff --git a/node_modules/socks/build/client/socksclient.js.map b/node_modules/socks/build/client/socksclient.js.map index 15d0b565ac33f..b39f3add4cb59 100644 --- a/node_modules/socks/build/client/socksclient.js.map +++ b/node_modules/socks/build/client/socksclient.js.map @@ -1 +1 @@ -{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAkB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AAg7B5D,iGAh7BM,uBAAgB,OAg7BN;AAt5BlB,MAAM,WAAY,SAAQ,qBAAY;IAgBpC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,IAAA,oCAA0B,EAAC,OAAO,CA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oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,OAAO,EACf;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file +{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAkB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AA07B5D,iGA17BM,uBAAgB,OA07BN;AAh6BlB,MAAM,WAAY,SAAQ,qBAAY;IAgBpC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,IAAA,oCAA0B,EAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA2B,EAC3B,QAGS;QAET,OAAO,IAAI,OAAO,CAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClE,8BAA8B;YAC9B,IAAI;gBACF,IAAA,oCAA0B,EAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;aAClD;YAAC,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AAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,OAAO,EACf;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file diff --git a/node_modules/socks/build/common/receivebuffer.js.map b/node_modules/socks/build/common/receivebuffer.js.map index 144edb0b9b336..af5e220901695 100644 --- a/node_modules/socks/build/common/receivebuffer.js.map +++ b/node_modules/socks/build/common/receivebuffer.js.map @@ -1 +1 @@ -{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACnD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAC9B,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACtC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CACjC,CACF,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACvB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEO,sCAAa"} \ No newline at end of file +{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,IAAI,GAAG,IAAI;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED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CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEO,sCAAa"} \ No newline at end of file diff --git a/node_modules/socks/build/common/util.js b/node_modules/socks/build/common/util.js index 283314a0d4456..f66b72e43e386 100644 --- a/node_modules/socks/build/common/util.js +++ b/node_modules/socks/build/common/util.js @@ -16,7 +16,6 @@ exports.SocksClientError = SocksClientError; * @param array The array to shuffle. */ function shuffleArray(array) { - // tslint:disable-next-line:no-increment-decrement for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; diff --git a/node_modules/socks/build/common/util.js.map b/node_modules/socks/build/common/util.js.map index 8d94a2ace787a..f1993233d693d 100644 --- a/node_modules/socks/build/common/util.js.map +++ b/node_modules/socks/build/common/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAwBuB,4CAAgB;AAtBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAY;IAChC,kDAAkD;IAClD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"} \ No newline at end of file +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAuBuB,4CAAgB;AArBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAgB;IACpC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"} \ No newline at end of file diff --git a/node_modules/socks/build/index.js b/node_modules/socks/build/index.js index 17b6f42df8e5b..05fbb1d949b48 100644 --- a/node_modules/socks/build/index.js +++ b/node_modules/socks/build/index.js @@ -1,7 +1,11 @@ "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; diff --git a/node_modules/socks/build/index.js.map b/node_modules/socks/build/index.js.map index ff654a08e01b3..0e2bcb27b8ba1 100644 --- a/node_modules/socks/build/index.js.map +++ b/node_modules/socks/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"} \ No newline at end of file diff --git a/node_modules/socks/package.json b/node_modules/socks/package.json index 61c3f1dcf17fd..ac0b6d39fbdf7 100644 --- a/node_modules/socks/package.json +++ b/node_modules/socks/package.json @@ -1,7 +1,7 @@ { "name": "socks", "private": false, - "version": "2.6.2", + "version": "2.7.0", "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", "main": "build/index.js", "typings": "typings/index.d.ts", @@ -34,50 +34,25 @@ "readmeFilename": "README.md", "devDependencies": { "@types/ip": "1.1.0", - "@types/mocha": "^9.1.0", - "@types/node": "^17.0.15", - "coveralls": "^3.1.1", - "mocha": "^9.2.0", - "nyc": "15.1.0", - "prettier": "^2.5.1", - "socks5-server": "^0.1.1", - "ts-node": "^10.4.0", - "typescript": "^4.5.5" + "@types/mocha": "^9.1.1", + "@types/node": "^18.0.6", + "@typescript-eslint/eslint-plugin": "^5.30.6", + "@typescript-eslint/parser": "^5.30.6", + "eslint": "^8.20.0", + "mocha": "^10.0.0", + "prettier": "^2.7.1", + "ts-node": "^10.9.1", + "typescript": "^4.7.4" }, "dependencies": { - "ip": "^1.1.5", + "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, "scripts": { "prepublish": "npm install -g typescript && npm run build", "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", - "coverage": "NODE_ENV=test nyc npm test", - "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", - "lint": "tslint --project tsconfig.json 'src/**/*.ts'", + "lint": "eslint 'src/**/*.ts'", "build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ." - }, - "nyc": { - "extension": [ - ".ts", - ".tsx" - ], - "include": [ - "src/*.ts", - "src/**/*.ts" - ], - "exclude": [ - "**.*.d.ts", - "node_modules", - "typings" - ], - "require": [ - "ts-node/register" - ], - "reporter": [ - "json", - "html" - ], - "all": true } } diff --git a/node_modules/socks/typings/client/socksclient.d.ts b/node_modules/socks/typings/client/socksclient.d.ts index d8ce1b965f0e0..b886d95710b31 100644 --- a/node_modules/socks/typings/client/socksclient.d.ts +++ b/node_modules/socks/typings/client/socksclient.d.ts @@ -1,4 +1,6 @@ /// +/// +/// import { EventEmitter } from 'events'; import { SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksClientBoundEvent, SocksClientEstablishedEvent, SocksUDPFrameDetails } from '../common/constants'; import { SocksClientError } from '../common/util'; @@ -7,11 +9,11 @@ declare interface SocksClient { on(event: 'error', listener: (err: SocksClientError) => void): this; on(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; on(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; - once(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: unknown[]) => void): this; once(event: 'error', listener: (err: SocksClientError) => void): this; once(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; once(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; + emit(event: string | symbol, ...args: unknown[]): boolean; emit(event: 'error', err: SocksClientError): boolean; emit(event: 'bound', info: SocksClientBoundEvent): boolean; emit(event: 'established', info: SocksClientEstablishedEvent): boolean; @@ -36,7 +38,7 @@ declare class SocksClient extends EventEmitter implements SocksClient { * @param callback { Function } An optional callback function. * @returns { Promise } */ - static createConnection(options: SocksClientOptions, callback?: Function): Promise; + static createConnection(options: SocksClientOptions, callback?: (error: Error | null, info?: SocksClientEstablishedEvent) => void): Promise; /** * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. * @@ -46,7 +48,7 @@ declare class SocksClient extends EventEmitter implements SocksClient { * @param callback { Function } An optional callback function. * @returns { Promise } */ - static createConnectionChain(options: SocksClientChainOptions, callback?: Function): Promise; + static createConnectionChain(options: SocksClientChainOptions, callback?: (error: Error | null, socket?: SocksClientEstablishedEvent) => void): Promise; /** * Creates a SOCKS UDP Frame. * @param options diff --git a/node_modules/socks/typings/common/constants.d.ts b/node_modules/socks/typings/common/constants.d.ts index 664795cb180fb..32a5705283507 100644 --- a/node_modules/socks/typings/common/constants.d.ts +++ b/node_modules/socks/typings/common/constants.d.ts @@ -1,4 +1,6 @@ /// +/// +/// import { Duplex } from 'stream'; import { Socket, SocketConnectOpts } from 'net'; import { RequireOnlyOne } from './util'; diff --git a/node_modules/socks/typings/common/util.d.ts b/node_modules/socks/typings/common/util.d.ts index 29c539adaabc4..83f20e7b5978e 100644 --- a/node_modules/socks/typings/common/util.d.ts +++ b/node_modules/socks/typings/common/util.d.ts @@ -10,7 +10,7 @@ declare class SocksClientError extends Error { * Shuffles a given array. * @param array The array to shuffle. */ -declare function shuffleArray(array: any[]): void; +declare function shuffleArray(array: unknown[]): void; declare type RequireOnlyOne = Pick> & { [K in Keys]?: Required> & Partial, undefined>>; }[Keys]; diff --git a/package-lock.json b/package-lock.json index a25e5710bf2cc..2da0537a28dcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3762,9 +3762,9 @@ } }, "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "inBundle": true }, "node_modules/ip-regex": { @@ -6676,12 +6676,12 @@ "link": true }, "node_modules/socks": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", - "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", + "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", "inBundle": true, "dependencies": { - "ip": "^1.1.5", + "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, "engines": { From d0f5995e0399a093c8037057150a922e56b1d7ca Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 10 Aug 2022 08:30:32 -0700 Subject: [PATCH 042/175] deps: @npmcli/run-script@4.2.1 * add arguments back to the logged banner * remove the temp file entirely --- node_modules/@npmcli/run-script/lib/escape.js | 13 +---- .../@npmcli/run-script/lib/make-spawn-args.js | 51 ++++--------------- .../@npmcli/run-script/lib/run-script-pkg.js | 19 +++++-- node_modules/@npmcli/run-script/package.json | 2 +- package-lock.json | 8 +-- package.json | 2 +- 6 files changed, 33 insertions(+), 62 deletions(-) diff --git a/node_modules/@npmcli/run-script/lib/escape.js b/node_modules/@npmcli/run-script/lib/escape.js index 303100d337eb7..9aca8bde70a6e 100644 --- a/node_modules/@npmcli/run-script/lib/escape.js +++ b/node_modules/@npmcli/run-script/lib/escape.js @@ -36,14 +36,11 @@ const cmd = (input, doubleEscape) => { } // and finally, prefix shell meta chars with a ^ - result = result.replace(/[ !^&()<>|"]/g, '^$&') + result = result.replace(/[ !%^&()<>|"]/g, '^$&') if (doubleEscape) { - result = result.replace(/[ !^&()<>|"]/g, '^$&') + result = result.replace(/[ !%^&()<>|"]/g, '^$&') } - // except for % which is escaped with another %, and only once - result = result.replace(/%/g, '%%') - return result } @@ -65,13 +62,7 @@ const sh = (input) => { return result } -// disabling the no-control-regex rule for this line as we very specifically _do_ want to -// replace those characters if they somehow exist at this point, which is highly unlikely -// eslint-disable-next-line no-control-regex -const filename = (input) => input.replace(/[<>:"/\\|?*\x00-\x1F]/g, '') - module.exports = { cmd, sh, - filename, } diff --git a/node_modules/@npmcli/run-script/lib/make-spawn-args.js b/node_modules/@npmcli/run-script/lib/make-spawn-args.js index 7725fd976c893..5b06db3c16eac 100644 --- a/node_modules/@npmcli/run-script/lib/make-spawn-args.js +++ b/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -1,19 +1,10 @@ /* eslint camelcase: "off" */ const isWindows = require('./is-windows.js') const setPATH = require('./set-path.js') -const { unlinkSync: unlink, writeFileSync: writeFile } = require('fs') -const { tmpdir } = require('os') const { resolve } = require('path') const which = require('which') const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') const escape = require('./escape.js') -const { randomBytes } = require('crypto') - -const translateWinPathToPosix = (path) => { - return path - .replace(/^([A-z]):/, '/$1') - .replace(/\\/g, '/') -} const makeSpawnArgs = options => { const { @@ -38,10 +29,7 @@ const makeSpawnArgs = options => { npm_config_node_gyp, }) - const fileName = escape.filename(`${event}-${randomBytes(4).toString('hex')}`) - let scriptFile - let script = '' - + let doubleEscape = false const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(scriptShell) if (isCmd) { let initialCmd = '' @@ -68,26 +56,18 @@ const makeSpawnArgs = options => { pathToInitial = initialCmd.toLowerCase() } - const doubleEscape = pathToInitial.endsWith('.cmd') || pathToInitial.endsWith('.bat') - - scriptFile = resolve(tmpdir(), `${fileName}.cmd`) - script += '@echo off\n' - script += cmd - if (args.length) { - script += ` ${args.map((arg) => escape.cmd(arg, doubleEscape)).join(' ')}` - } - } else { - scriptFile = resolve(tmpdir(), `${fileName}.sh`) - script = cmd - if (args.length) { - script += ` ${args.map((arg) => escape.sh(arg)).join(' ')}` - } + doubleEscape = pathToInitial.endsWith('.cmd') || pathToInitial.endsWith('.bat') } - writeFile(scriptFile, script) + let script = cmd + for (const arg of args) { + script += isCmd + ? ` ${escape.cmd(arg, doubleEscape)}` + : ` ${escape.sh(arg)}` + } const spawnArgs = isCmd - ? ['/d', '/s', '/c', escape.cmd(scriptFile)] - : [isWindows ? translateWinPathToPosix(scriptFile) : scriptFile] + ? ['/d', '/s', '/c', script] + : ['-c', '--', script] const spawnOpts = { env: spawnEnv, @@ -97,16 +77,7 @@ const makeSpawnArgs = options => { ...(isCmd ? { windowsVerbatimArguments: true } : {}), } - const cleanup = () => { - // delete the script, this is just a best effort - try { - unlink(scriptFile) - } catch (err) { - // ignore errors - } - } - - return [scriptShell, spawnArgs, spawnOpts, cleanup] + return [scriptShell, spawnArgs, spawnOpts] } module.exports = makeSpawnArgs diff --git a/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/node_modules/@npmcli/run-script/lib/run-script-pkg.js index ec6ef31e50ab0..c10d20bb73480 100644 --- a/node_modules/@npmcli/run-script/lib/run-script-pkg.js +++ b/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -6,8 +6,17 @@ const signalManager = require('./signal-manager.js') const isServerPackage = require('./is-server-package.js') // you wouldn't like me when I'm angry... -const bruce = (id, event, cmd) => - `\n> ${id ? id + ' ' : ''}${event}\n> ${cmd.trim().replace(/\n/g, '\n> ')}\n` +const bruce = (id, event, cmd, args) => { + let banner = id + ? `\n> ${id} ${event}\n` + : `\n> ${event}\n` + banner += `> ${cmd.trim().replace(/\n/g, '\n> ')}` + if (args.length) { + banner += ` ${args.join(' ')}` + } + banner += '\n' + return banner +} const runScriptPkg = async options => { const { @@ -52,10 +61,10 @@ const runScriptPkg = async options => { if (stdio === 'inherit' && banner !== false) { // we're dumping to the parent's stdout, so print the banner - console.log(bruce(pkg._id, event, cmd)) + console.log(bruce(pkg._id, event, cmd, args)) } - const [spawnShell, spawnArgs, spawnOpts, cleanup] = makeSpawnArgs({ + const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({ event, path, scriptShell, @@ -93,7 +102,7 @@ const runScriptPkg = async options => { } else { throw er } - }).finally(cleanup) + }) } module.exports = runScriptPkg diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index a6629826d29c2..551dc610f4914 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "4.2.0", + "version": "4.2.1", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "GitHub Inc.", "license": "ISC", diff --git a/package-lock.json b/package-lock.json index 2da0537a28dcd..853fe2d7bf42b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,7 +94,7 @@ "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^4.2.0", + "@npmcli/run-script": "^4.2.1", "abbrev": "~1.1.1", "archy": "~1.0.0", "cacache": "^16.1.1", @@ -1057,9 +1057,9 @@ } }, "node_modules/@npmcli/run-script": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.0.tgz", - "integrity": "sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-4.2.1.tgz", + "integrity": "sha512-7dqywvVudPSrRCW5nTHpHgeWnbBtz8cFkOuKrecm6ih+oO9ciydhWt6OF7HlqupRRmB8Q/gECVdB9LMfToJbRg==", "inBundle": true, "dependencies": { "@npmcli/node-gyp": "^2.0.0", diff --git a/package.json b/package.json index 902dac43bd8ae..e44f524e111af 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.3", "@npmcli/package-json": "^2.0.0", - "@npmcli/run-script": "^4.2.0", + "@npmcli/run-script": "^4.2.1", "abbrev": "~1.1.1", "archy": "~1.0.0", "cacache": "^16.1.1", From 76e477c1f82fd5eca7028169b820cddf3155b4b4 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 10 Aug 2022 09:10:17 -0700 Subject: [PATCH 043/175] chore(arborist): fix test snapshots for @npmcli/run-script@4.2.1 --- .../tap-snapshots/test/arborist/rebuild.js.test.cjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workspaces/arborist/tap-snapshots/test/arborist/rebuild.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/rebuild.js.test.cjs index 473a466789550..3a500be6571ad 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/rebuild.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/rebuild.js.test.cjs @@ -8,7 +8,7 @@ exports[`test/arborist/rebuild.js TAP verify dep flags in script environments > saved script results 1`] = ` Array [ Object { - "cmd": "{TMP}/postinstall{HASH}", + "cmd": "node ../../env.js", "code": 0, "event": "postinstall", "pkg": Object { @@ -30,7 +30,7 @@ Array [ "stdout": "npm_package_dev\\n", }, Object { - "cmd": "{TMP}/postinstall{HASH}", + "cmd": "node ../../env.js", "code": 0, "event": "postinstall", "pkg": Object { @@ -46,7 +46,7 @@ Array [ "stdout": "npm_package_dev_optional\\n", }, Object { - "cmd": "{TMP}/postinstall{HASH}", + "cmd": "node ../../env.js", "code": 0, "event": "postinstall", "pkg": Object { @@ -66,7 +66,7 @@ Array [ ), }, Object { - "cmd": "{TMP}/postinstall{HASH}", + "cmd": "node ../../env.js", "code": 0, "event": "postinstall", "pkg": Object { From 222f4fe985f58bf62882cdbb1ab0de3d872e9fd8 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 10 Aug 2022 09:28:41 -0700 Subject: [PATCH 044/175] chore: fix tests for @npmcli/run-script@4.2.1 --- test/lib/commands/edit.js | 46 +++++------------------------------- test/lib/commands/restart.js | 17 ++++++------- test/lib/commands/start.js | 17 +++++-------- test/lib/commands/stop.js | 16 ++++--------- test/lib/commands/test.js | 16 ++++--------- 5 files changed, 29 insertions(+), 83 deletions(-) diff --git a/test/lib/commands/edit.js b/test/lib/commands/edit.js index b2a10be135ad9..22543f8e3cdc6 100644 --- a/test/lib/commands/edit.js +++ b/test/lib/commands/edit.js @@ -1,5 +1,4 @@ const t = require('tap') -const fs = require('fs') const path = require('path') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -39,24 +38,13 @@ t.test('npm edit', async t => { const { npm, joinedOutput } = await loadMockNpm(t, npmConfig) const semverPath = path.resolve(npm.prefix, 'node_modules', 'semver') - const [scriptShell] = makeSpawnArgs({ + const [scriptShell, scriptArgs] = makeSpawnArgs({ event: 'install', path: npm.prefix, cmd: 'testinstall', }) spawk.spawn('testeditor', [semverPath]) - spawk.spawn( - scriptShell, - args => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('install') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('testinstall') - return rightExtension && rightFilename && rightContents - }, - { cwd: semverPath } - ) + spawk.spawn(scriptShell, scriptArgs, { cwd: semverPath }) await npm.exec('edit', ['semver']) t.match(joinedOutput(), 'rebuilt dependencies successfully') }) @@ -64,24 +52,13 @@ t.test('npm edit', async t => { t.test('rebuild failure', async t => { const { npm } = await loadMockNpm(t, npmConfig) const semverPath = path.resolve(npm.prefix, 'node_modules', 'semver') - const [scriptShell] = makeSpawnArgs({ + const [scriptShell, scriptArgs] = makeSpawnArgs({ event: 'install', path: npm.prefix, cmd: 'testinstall', }) spawk.spawn('testeditor', [semverPath]) - spawk.spawn( - scriptShell, - args => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('install') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('testinstall') - return rightExtension && rightFilename && rightContents - }, - { cwd: semverPath } - ).exit(1).stdout('test error') + spawk.spawn(scriptShell, scriptArgs, { cwd: semverPath }).exit(1).stdout('test error') await t.rejects( npm.exec('edit', ['semver']), { message: 'command failed' } @@ -108,24 +85,13 @@ t.test('npm edit editor has flags', async t => { }) const semverPath = path.resolve(npm.prefix, 'node_modules', 'semver') - const [scriptShell] = makeSpawnArgs({ + const [scriptShell, scriptArgs] = makeSpawnArgs({ event: 'install', path: npm.prefix, cmd: 'testinstall', }) spawk.spawn('testeditor', ['--flag', semverPath]) - spawk.spawn( - scriptShell, - args => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('install') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('testinstall') - return rightExtension && rightFilename && rightContents - }, - { cwd: semverPath } - ) + spawk.spawn(scriptShell, scriptArgs, { cwd: semverPath }) await npm.exec('edit', ['semver']) }) diff --git a/test/lib/commands/restart.js b/test/lib/commands/restart.js index bfbe715e8c688..c2257b8cebf84 100644 --- a/test/lib/commands/restart.js +++ b/test/lib/commands/restart.js @@ -1,5 +1,3 @@ -const fs = require('fs') -const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -26,15 +24,14 @@ t.test('should run restart script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-restart.js' }) - const script = spawk.spawn(scriptShell, (args) => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('restart') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('foo') - return rightExtension && rightFilename && rightContents + const [scriptShell, scriptArgs] = makeSpawnArgs({ + path: npm.prefix, + cmd: 'node ./test-restart.js', }) + let scriptContent = scriptArgs.pop() + scriptContent += ' foo' + scriptArgs.push(scriptContent) + const script = spawk.spawn(scriptShell, scriptArgs) await npm.exec('restart', ['foo']) t.ok(script.called, 'script ran') }) diff --git a/test/lib/commands/start.js b/test/lib/commands/start.js index 79c2133bc69fc..3caaa478f02e3 100644 --- a/test/lib/commands/start.js +++ b/test/lib/commands/start.js @@ -1,5 +1,3 @@ -const fs = require('fs') -const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -26,15 +24,12 @@ t.test('should run start script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-start.js' }) - const script = spawk.spawn(scriptShell, (args) => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('start') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('foo') - return rightExtension && rightFilename && rightContents - }) + const [scriptShell, scriptArgs] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-start.js' }) + // we're calling the script with 'foo' as an argument, so add that to the script + let scriptContent = scriptArgs.pop() + scriptContent += ' foo' + scriptArgs.push(scriptContent) + const script = spawk.spawn(scriptShell, scriptArgs) await npm.exec('start', ['foo']) t.ok(script.called, 'script ran') }) diff --git a/test/lib/commands/stop.js b/test/lib/commands/stop.js index 1a4abd0b3abda..72c2843adec9d 100644 --- a/test/lib/commands/stop.js +++ b/test/lib/commands/stop.js @@ -1,5 +1,3 @@ -const fs = require('fs') -const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -26,15 +24,11 @@ t.test('should run stop script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-stop.js' }) - const script = spawk.spawn(scriptShell, (args) => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('stop') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('foo') - return rightExtension && rightFilename && rightContents - }) + const [scriptShell, scriptArgs] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-stop.js' }) + let scriptContent = scriptArgs.pop() + scriptContent += ' foo' + scriptArgs.push(scriptContent) + const script = spawk.spawn(scriptShell, scriptArgs) await npm.exec('stop', ['foo']) t.ok(script.called, 'script ran') }) diff --git a/test/lib/commands/test.js b/test/lib/commands/test.js index c6d3f530bb69e..a6a6f723afe7d 100644 --- a/test/lib/commands/test.js +++ b/test/lib/commands/test.js @@ -1,5 +1,3 @@ -const fs = require('fs') -const path = require('path') const t = require('tap') const tspawk = require('../../fixtures/tspawk') const { load: loadMockNpm } = require('../../fixtures/mock-npm') @@ -26,15 +24,11 @@ t.test('should run test script from package.json', async t => { loglevel: 'silent', }, }) - const [scriptShell] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-test.js' }) - const script = spawk.spawn(scriptShell, (args) => { - const lastArg = args[args.length - 1] - const rightExtension = lastArg.endsWith('.cmd') || lastArg.endsWith('.sh') - const rightFilename = path.basename(lastArg).startsWith('test') - const rightContents = fs.readFileSync(lastArg, { encoding: 'utf8' }) - .trim().endsWith('foo') - return rightExtension && rightFilename && rightContents - }) + const [scriptShell, scriptArgs] = makeSpawnArgs({ path: npm.prefix, cmd: 'node ./test-test.js' }) + let scriptContent = scriptArgs.pop() + scriptContent += ' foo' + scriptArgs.push(scriptContent) + const script = spawk.spawn(scriptShell, scriptArgs) await npm.exec('test', ['foo']) t.ok(script.called, 'script ran') }) From f3765539abcf82b6ff1dc4145e9b988a49192fc1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:39:00 -0700 Subject: [PATCH 045/175] chore(latest): release arborist 5.5.0 (#5274) * chore(latest): release arborist 5.5.0 * deps: @npmcli/arborist@5.5.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: npm CLI robot --- package-lock.json | 2 +- workspaces/arborist/CHANGELOG.md | 17 +++++++++++++++++ workspaces/arborist/package.json | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 853fe2d7bf42b..d92d17e9ebed0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10050,7 +10050,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "5.4.0", + "version": "5.5.0", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index 086923db3b41e..4928e162afa0c 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [5.5.0](https://github.com/npm/cli/compare/arborist-v5.4.0...arborist-v5.5.0) (2022-08-10) + + +### Features + +* **arborist:** add option to forcibly skip loading a virtual tree ([96b6781](https://github.com/npm/cli/commit/96b6781086143d7285c2c5bf7808c24b2c87e4dd)) + + +### Bug Fixes + +* **query:** tell arborist to load an actual tree, not a virtual one ([9078e27](https://github.com/npm/cli/commit/9078e27cef0233d6fc81e0ca824a34fd7685d93c)) + + +### Dependencies + +* nopt@6.0.0 ([7f31b85](https://github.com/npm/cli/commit/7f31b85db650c7a2b3b0577840251f5e25e63a01)) + ## [5.4.0](https://github.com/npm/cli/compare/arborist-v5.3.1...arborist-v5.4.0) (2022-08-03) diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 98b183091ca4e..e76a87a32e86b 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "5.4.0", + "version": "5.5.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", From 1ffcfed76cbafa8b9b24b835d3baba2e25e83428 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Aug 2022 16:54:55 +0000 Subject: [PATCH 046/175] chore(latest): release libnpmexec 4.0.10 --- workspaces/libnpmexec/CHANGELOG.md | 9 +++++++++ workspaces/libnpmexec/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index 8003ca3d4fa08..e645499426ae7 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [4.0.10](https://github.com/npm/cli/compare/libnpmexec-v4.0.9...libnpmexec-v4.0.10) (2022-08-10) + + +### Bug Fixes + +* ignore global prefix if --prefix is used ([#5291](https://github.com/npm/cli/issues/5291)) ([daaf461](https://github.com/npm/cli/commit/daaf4619c85ecf62346770735cfa8e2ddecbef8b)) +* look up local command bins from local tree ([#5273](https://github.com/npm/cli/issues/5273)) ([c992fd6](https://github.com/npm/cli/commit/c992fd6757505974dc8e92a9e2886d2233e098eb)) +* only try to run global bin if the bin name exists ([#5253](https://github.com/npm/cli/issues/5253)) ([95ae9f2](https://github.com/npm/cli/commit/95ae9f2e2555ef592777399bf8fee5206d77f41d)) + ## [4.0.9](https://github.com/npm/cli/compare/libnpmexec-v4.0.8...libnpmexec-v4.0.9) (2022-08-03) diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 9fcb0b2016784..a83447d9ea695 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "4.0.9", + "version": "4.0.10", "files": [ "bin/", "lib/" From 8d870c56eed20f352695c3c06be07a656ada4ba7 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 10 Aug 2022 16:55:27 +0000 Subject: [PATCH 047/175] deps: libnpmexec@4.0.10 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d92d17e9ebed0..15e4be80decfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10149,7 +10149,7 @@ } }, "workspaces/libnpmexec": { - "version": "4.0.9", + "version": "4.0.10", "license": "ISC", "dependencies": { "@npmcli/arborist": "^5.0.0", From 59f6c8ad665cb8afd0e93b310954ab9360e1881d Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 10 Aug 2022 10:47:30 -0700 Subject: [PATCH 048/175] chore: changelog for v8.17.0 --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6de53a087785..ffd21d93cf6d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## v8.17.0 (2022-08-10) + +### Features + + * [`96b6781`](https://github.com/npm/cli/commit/96b6781086143d7285c2c5bf7808c24b2c87e4dd) [#5263](https://github.com/npm/cli/pull/5263) feat(arborist): add option to forcibly skip loading a virtual tree ([@nlf](https://github.com/nlf)) + +### Bug Fixes + + * [`9078e27`](https://github.com/npm/cli/commit/9078e27cef0233d6fc81e0ca824a34fd7685d93c) [#5263](https://github.com/npm/cli/pull/5263) fix(query): tell arborist to load an actual tree, not a virtual one ([@nlf](https://github.com/nlf)) + * [`c992fd6`](https://github.com/npm/cli/commit/c992fd6757505974dc8e92a9e2886d2233e098eb) [#5273](https://github.com/npm/cli/pull/5273) fix: look up local command bins from local tree ([@wraithgar](https://github.com/wraithgar)) + * [`95ae9f2`](https://github.com/npm/cli/commit/95ae9f2e2555ef592777399bf8fee5206d77f41d) [#5253](https://github.com/npm/cli/pull/5253) fix: only try to run global bin if the bin name exists ([@wraithgar](https://github.com/wraithgar)) + * [`daaf461`](https://github.com/npm/cli/commit/daaf4619c85ecf62346770735cfa8e2ddecbef8b) [#5291](https://github.com/npm/cli/pull/5291) fix: ignore global prefix if --prefix is used ([@wraithgar](https://github.com/wraithgar)) + +### Documentation + + * [`f281ec8`](https://github.com/npm/cli/commit/f281ec8a1aec43439281a8fca4c255b0d94a0c94) [#5257](https://github.com/npm/cli/pull/5257) docs: Fix link syntax in `dependency-selectors.md` ([@aried3r](https://github.com/aried3r)) + +### Dependencies + + * [`741bccf`](https://github.com/npm/cli/commit/741bccf24ad1fa420a6c6182e04487abc02f8ccf) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/config@4.2.1` + * [`7f31b85`](https://github.com/npm/cli/commit/7f31b85db650c7a2b3b0577840251f5e25e63a01) [#5284](https://github.com/npm/cli/pull/5284) deps: `nopt@6.0.0` + * [`2569d82`](https://github.com/npm/cli/commit/2569d82d0408e158b4b28cab6f23e1b7dc468553) [#5284](https://github.com/npm/cli/pull/5284) deps: `node-gyp@9.1.0` + * [`a396f8d`](https://github.com/npm/cli/commit/a396f8dd0968971ddb6f491a0bc645132c82021a) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/map-workspaces@2.0.4` + * [`a9b5306`](https://github.com/npm/cli/commit/a9b5306627058b8869a6221a0c099493c206a3f2) [#5284](https://github.com/npm/cli/pull/5284) deps: `is-core-module@2.10.0` + * [`786f753`](https://github.com/npm/cli/commit/786f753b0db49340a0e26ec8fb5425773a7f0558) [#5284](https://github.com/npm/cli/pull/5284) deps: `lru-cache@7.13.2` + * [`7b702b6`](https://github.com/npm/cli/commit/7b702b6d490d37bdfa52b623dd42ce185846b1bc) [#5284](https://github.com/npm/cli/pull/5284) deps: `are-we-there-yet@3.0.1` + * [`e74f99e`](https://github.com/npm/cli/commit/e74f99e7ccdfce1519cc45bb58054d94b748146c) [#5284](https://github.com/npm/cli/pull/5284) deps: `just-diff@5.1.1` + * [`9833066`](https://github.com/npm/cli/commit/983306637579ab5c062878c0153671007cceea2b) [#5284](https://github.com/npm/cli/pull/5284) deps: `just-diff-apply@5.4.1` + * [`4e5dd73`](https://github.com/npm/cli/commit/4e5dd732d7fe39490be1d9f8e81cbdba602c67fe) [#5284](https://github.com/npm/cli/pull/5284) deps: `socks@2.7.0` + * [`d0f5995`](https://github.com/npm/cli/commit/d0f5995e0399a093c8037057150a922e56b1d7ca) [#5284](https://github.com/npm/cli/pull/5284) deps: `@npmcli/run-script@4.2.1` + * [`8d870c5`](https://github.com/npm/cli/commit/8d870c56eed20f352695c3c06be07a656ada4ba7) [#5275](https://github.com/npm/cli/pull/5275) deps: `libnpmexec@4.0.10` + ## v8.16.0 (2022-08-03) ### Features From d54ab91aabb576503567195d2e88d09f1435a9a3 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 10 Aug 2022 10:47:56 -0700 Subject: [PATCH 049/175] chore: update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 29a062c7f6b64..fb7d537fd4d29 100644 --- a/AUTHORS +++ b/AUTHORS @@ -846,3 +846,4 @@ MapleCCC Patryk Ludwikowski Takuya N Neel Dani +Anton Rieder <1301152+aried3r@users.noreply.github.com> From 9dc69830a5d78aa4042746d54e2a6b0d2af70caa Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 10 Aug 2022 10:47:56 -0700 Subject: [PATCH 050/175] 8.17.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15e4be80decfe..3f49f87b2b836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "8.16.0", + "version": "8.17.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "8.16.0", + "version": "8.17.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", diff --git a/package.json b/package.json index e44f524e111af..3641c1475185f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.16.0", + "version": "8.17.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ From e6d4304bbd03e38dcf2c7467bb1e61b5740a4c73 Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 15 Aug 2022 13:31:10 -0700 Subject: [PATCH 051/175] feat(arborist): add overridden getter to Node class --- workspaces/arborist/lib/node.js | 4 +++ workspaces/arborist/test/node.js | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/workspaces/arborist/lib/node.js b/workspaces/arborist/lib/node.js index be973565750a1..8ec90ff3c8495 100644 --- a/workspaces/arborist/lib/node.js +++ b/workspaces/arborist/lib/node.js @@ -334,6 +334,10 @@ class Node { return `${myname}@${alias}${version}` } + get overridden () { + return !!(this.overrides && this.overrides.value && this.overrides.name === this.name) + } + get package () { return this[_package] } diff --git a/workspaces/arborist/test/node.js b/workspaces/arborist/test/node.js index 0db439cbabc31..d89bf804a509a 100644 --- a/workspaces/arborist/test/node.js +++ b/workspaces/arborist/test/node.js @@ -2728,6 +2728,52 @@ t.test('overrides', (t) => { t.end() }) + t.test('node.overridden is true when an override applies to a specific node', async (t) => { + const tree = new Node({ + loadOverrides: true, + path: '/some/path', + pkg: { + name: 'foo', + dependencies: { + bar: '^1', + }, + overrides: { + baz: '1.0.0', + }, + }, + children: [{ + name: 'bar', + version: '1.0.0', + pkg: { + dependencies: { + baz: '2.0.0', + }, + }, + children: [{ + name: 'baz', + version: '1.0.0', + pkg: { + dependencies: { + buzz: '1.0.0', + }, + }, + children: [{ + name: 'buzz', + version: '1.0.0', + pkg: {}, + }], + }], + }], + }) + + const bar = tree.edgesOut.get('bar').to + t.not(bar.overridden, 'bar was not overridden') + const baz = bar.edgesOut.get('baz').to + t.ok(baz.overridden, 'baz was overridden') + const buzz = baz.edgesOut.get('buzz').to + t.not(buzz.overridden, 'buzz was not overridden') + }) + t.test('assertRootOverrides throws when a dependency and override conflict', async (t) => { const conflictingTree = new Node({ loadOverrides: true, From 05d9bcf7e557e0dbecbd80d4d1be332963761e69 Mon Sep 17 00:00:00 2001 From: nlf Date: Mon, 15 Aug 2022 13:55:07 -0700 Subject: [PATCH 052/175] fix(ls): display overridden nodes --- lib/commands/ls.js | 13 + .../test/lib/commands/ls.js.test.cjs | 20 + test/lib/commands/ls.js | 342 +++++++++++++++++- 3 files changed, 363 insertions(+), 12 deletions(-) diff --git a/lib/commands/ls.js b/lib/commands/ls.js index 073ca0c6992e8..6812c3923787e 100644 --- a/lib/commands/ls.js +++ b/lib/commands/ls.js @@ -329,6 +329,11 @@ const getHumanOutputItem = (node, { args, color, global, long }) => { ? ' ' + (color ? chalk.green.bgBlack('extraneous') : 'extraneous') : '' ) + + ( + node.overridden + ? ' ' + (color ? chalk.gray('overridden') : 'overridden') + : '' + ) + (isGitNode(node) ? ` (${node.resolved})` : '') + (node.isLink ? ` -> ${relativePrefix}${targetLocation}` : '') + (long ? `${EOL}${node.package.description || ''}` : '') @@ -347,6 +352,13 @@ const getJsonOutputItem = (node, { global, long }) => { item.resolved = node.resolved } + // if the node is the project root, do not add the overridden flag. the project root can't be + // overridden anyway, and if we add the flag it causes undesirable behavior when `npm ls --json` + // is ran in an empty directory since we end up printing an object with only an overridden prop + if (!node.isProjectRoot) { + item.overridden = node.overridden + } + item[_name] = node.name // special formatting for top-level package name @@ -555,6 +567,7 @@ const parseableOutput = ({ global, long, seenNodes }) => { out += node.path !== node.realpath ? `:${node.realpath}` : '' out += isExtraneous(node, { global }) ? ':EXTRANEOUS' : '' out += node[_invalid] ? ':INVALID' : '' + out += node.overridden ? ':OVERRIDDEN' : '' } out += EOL } diff --git a/tap-snapshots/test/lib/commands/ls.js.test.cjs b/tap-snapshots/test/lib/commands/ls.js.test.cjs index 9b6749acfe3bb..f511dec7cf205 100644 --- a/tap-snapshots/test/lib/commands/ls.js.test.cjs +++ b/tap-snapshots/test/lib/commands/ls.js.test.cjs @@ -255,6 +255,12 @@ exports[`test/lib/commands/ls.js TAP ls --parseable no args > should output pars {CWD}/tap-testdir-ls-ls---parseable-no-args/node_modules/dog ` +exports[`test/lib/commands/ls.js TAP ls --parseable overridden dep > should contain overridden outout 1`] = ` +{CWD}/tap-testdir-ls-ls---parseable-overridden-dep:test-overridden@1.0.0 +{CWD}/tap-testdir-ls-ls---parseable-overridden-dep/node_modules/foo:foo@1.0.0 +{CWD}/tap-testdir-ls-ls---parseable-overridden-dep/node_modules/bar:bar@1.0.0:OVERRIDDEN +` + exports[`test/lib/commands/ls.js TAP ls --parseable resolved points to git ref > should output tree containing git refs 1`] = ` {CWD}/tap-testdir-ls-ls---parseable-resolved-points-to-git-ref {CWD}/tap-testdir-ls-ls---parseable-resolved-points-to-git-ref/node_modules/abbrev @@ -567,6 +573,20 @@ test-npm-ls@1.0.0 {CWD}/tap-testdir-ls-ls-no-args ` +exports[`test/lib/commands/ls.js TAP ls overridden dep > should contain overridden outout 1`] = ` +test-overridden@1.0.0 {CWD}/tap-testdir-ls-ls-overridden-dep +\`-- foo@1.0.0 + \`-- bar@1.0.0 overridden + +` + +exports[`test/lib/commands/ls.js TAP ls overridden dep w/ color > should contain overridden outout 1`] = ` +test-overridden@1.0.0 {CWD}/tap-testdir-ls-ls-overridden-dep-w-color +\`-- foo@1.0.0 + \`-- bar@1.0.0 overridden + +` + exports[`test/lib/commands/ls.js TAP ls print deduped symlinks > should output tree containing linked deps 1`] = ` print-deduped-symlinks@1.0.0 {CWD}/tap-testdir-ls-ls-print-deduped-symlinks +-- a@1.0.0 diff --git a/test/lib/commands/ls.js b/test/lib/commands/ls.js index f4cd4ef33d58e..764d95298ca10 100644 --- a/test/lib/commands/ls.js +++ b/test/lib/commands/ls.js @@ -231,6 +231,88 @@ t.test('ls', t => { t.matchSnapshot(redactCwd(result), 'should output containing problems info') }) + t.test('overridden dep', async t => { + config.all = true + t.teardown(() => { + config.all = false + }) + + npm.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-overridden', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + }, + overrides: { + bar: '1.0.0', + }, + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + dependencies: { + bar: '^2.0.0', + }, + }), + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + }), + }, + }, + }) + + await ls.exec([]) + t.matchSnapshot(redactCwd(result), 'should contain overridden outout') + }) + + t.test('overridden dep w/ color', async t => { + config.all = true + npm.color = true + t.teardown(() => { + config.all = false + npm.color = false + }) + + npm.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-overridden', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + }, + overrides: { + bar: '1.0.0', + }, + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + dependencies: { + bar: '^2.0.0', + }, + }), + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + }), + }, + }, + }) + + await ls.exec([]) + t.matchSnapshot(redactCwd(result), 'should contain overridden outout') + }) + t.test('with filter arg', async t => { npm.color = true npm.prefix = t.testdir({ @@ -1621,6 +1703,47 @@ t.test('ls --parseable', t => { t.matchSnapshot(redactCwd(result), 'should output containing problems info') }) + t.test('overridden dep', async t => { + config.all = true + config.long = true + t.teardown(() => { + config.all = false + config.long = false + }) + npm.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-overridden', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + }, + overrides: { + bar: '1.0.0', + }, + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + dependencies: { + bar: '^2.0.0', + }, + }), + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + }), + }, + }, + }) + + await ls.exec([]) + t.matchSnapshot(redactCwd(result), 'should contain overridden outout') + }) + t.test('with filter arg', async t => { npm.prefix = t.testdir({ 'package.json': JSON.stringify({ @@ -2413,14 +2536,17 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2448,6 +2574,7 @@ t.test('ls --json', t => { dog: { version: '1.0.0', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: dog@1.0.0 {CWD}/tap-testdir-ls-ls---json-missing-package.json/node_modules/dog', @@ -2456,6 +2583,7 @@ t.test('ls --json', t => { foo: { version: '1.0.0', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: foo@1.0.0 {CWD}/tap-testdir-ls-ls---json-missing-package.json/node_modules/foo', @@ -2469,6 +2597,7 @@ t.test('ls --json', t => { chai: { version: '1.0.0', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: chai@1.0.0 {CWD}/tap-testdir-ls-ls---json-missing-package.json/node_modules/chai', @@ -2503,15 +2632,18 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: chai@1.0.0 {CWD}/tap-testdir-ls-ls---json-extraneous-deps/node_modules/chai', @@ -2523,6 +2655,58 @@ t.test('ls --json', t => { ) }) + t.test('overridden dep', async t => { + config.all = true + t.teardown(() => config.all = false) + npm.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-overridden', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + }, + overrides: { + bar: '1.0.0', + }, + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + dependencies: { + bar: '^2.0.0', + }, + }), + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + }), + }, + }, + }) + + await ls.exec([]) + t.same(JSON.parse(result), { + name: 'test-overridden', + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + overridden: false, + dependencies: { + bar: { + version: '1.0.0', + overridden: true, + }, + }, + }, + }, + }) + }) + t.test('missing deps --long', async t => { t.plan(3) config.long = true @@ -2581,6 +2765,7 @@ t.test('ls --json', t => { dependencies: { chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2610,9 +2795,11 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, @@ -2653,14 +2840,17 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2717,9 +2907,11 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2752,9 +2944,11 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2787,14 +2981,17 @@ t.test('ls --json', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -2833,6 +3030,7 @@ t.test('ls --json', t => { foo: { version: '1.0.0', invalid: '"^2.0.0" from the root project', + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'invalid: foo@1.0.0 {CWD}/tap-testdir-ls-ls---json-missing-invalid-extraneous/node_modules/foo', @@ -2840,12 +3038,14 @@ t.test('ls --json', t => { dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: chai@1.0.0 {CWD}/tap-testdir-ls-ls---json-missing-invalid-extraneous/node_modules/chai', @@ -2893,10 +3093,17 @@ t.test('ls --json', t => { dependencies: { 'dev-dep': { version: '1.0.0', + overridden: false, dependencies: { foo: { version: '1.0.0', - dependencies: { dog: { version: '1.0.0' } }, + overridden: false, + dependencies: { + dog: { + version: '1.0.0', + overridden: false, + }, + }, }, }, }, @@ -2949,6 +3156,7 @@ t.test('ls --json', t => { 'linked-dep': { version: '1.0.0', resolved: 'file:../linked-dep', + overridden: false, }, }, }, @@ -2986,9 +3194,24 @@ t.test('ls --json', t => { name: 'test-npm-ls', version: '1.0.0', dependencies: { - chai: { version: '1.0.0' }, - 'optional-dep': { version: '1.0.0' }, - 'prod-dep': { version: '1.0.0', dependencies: { dog: { version: '2.0.0' } } }, + chai: { + version: '1.0.0', + overridden: false, + }, + 'optional-dep': { + version: '1.0.0', + overridden: false, + }, + 'prod-dep': { + version: '1.0.0', + overridden: false, + dependencies: { + dog: { + version: '2.0.0', + overridden: false, + }, + }, + }, }, }, 'should output json containing production deps' @@ -3111,6 +3334,7 @@ t.test('ls --json', t => { dependencies: { '@isaacs/dedupe-tests-a': { version: '1.0.1', + overridden: false, resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-a/-/dedupe-tests-a-1.0.1.tgz', dependencies: { @@ -3118,6 +3342,7 @@ t.test('ls --json', t => { resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-1.0.0.tgz', extraneous: true, + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'extraneous: @isaacs/dedupe-tests-b@ {CWD}/tap-testdir-ls-ls---json-from-lockfile/node_modules/@isaacs/dedupe-tests-a/node_modules/@isaacs/dedupe-tests-b', @@ -3127,6 +3352,7 @@ t.test('ls --json', t => { }, '@isaacs/dedupe-tests-b': { version: '2.0.0', + overridden: false, resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-2.0.0.tgz', }, @@ -3171,6 +3397,7 @@ t.test('ls --json', t => { dependencies: { 'peer-dep': { name: 'peer-dep', + overridden: false, description: 'Peer-dep description here', version: '1.0.0', _id: 'peer-dep@1.0.0', @@ -3182,15 +3409,18 @@ t.test('ls --json', t => { }, 'dev-dep': { name: 'dev-dep', + overridden: false, description: 'A DEV dep kind of dep', version: '1.0.0', dependencies: { foo: { name: 'foo', version: '1.0.0', + overridden: false, dependencies: { dog: { name: 'dog', + overridden: false, version: '1.0.0', _id: 'dog@1.0.0', devDependencies: {}, @@ -3217,6 +3447,7 @@ t.test('ls --json', t => { }, chai: { name: 'chai', + overridden: false, version: '1.0.0', _id: 'chai@1.0.0', devDependencies: {}, @@ -3227,6 +3458,7 @@ t.test('ls --json', t => { }, 'optional-dep': { name: 'optional-dep', + overridden: false, description: 'Maybe a dep?', version: '1.0.0', _id: 'optional-dep@1.0.0', @@ -3238,11 +3470,13 @@ t.test('ls --json', t => { }, 'prod-dep': { name: 'prod-dep', + overridden: false, description: 'A PROD dep kind of dep', version: '1.0.0', dependencies: { dog: { name: 'dog', + overridden: false, description: 'A dep that bars', version: '2.0.0', _id: 'dog@2.0.0', @@ -3308,6 +3542,7 @@ t.test('ls --json', t => { dependencies: { 'peer-dep': { name: 'peer-dep', + overridden: false, description: 'Peer-dep description here', version: '1.0.0', _id: 'peer-dep@1.0.0', @@ -3319,6 +3554,7 @@ t.test('ls --json', t => { }, 'dev-dep': { name: 'dev-dep', + overridden: false, description: 'A DEV dep kind of dep', version: '1.0.0', _id: 'dev-dep@1.0.0', @@ -3330,6 +3566,7 @@ t.test('ls --json', t => { }, chai: { name: 'chai', + overridden: false, version: '1.0.0', _id: 'chai@1.0.0', devDependencies: {}, @@ -3340,6 +3577,7 @@ t.test('ls --json', t => { }, 'optional-dep': { name: 'optional-dep', + overridden: false, description: 'Maybe a dep?', version: '1.0.0', _id: 'optional-dep@1.0.0', @@ -3351,6 +3589,7 @@ t.test('ls --json', t => { }, 'prod-dep': { name: 'prod-dep', + overridden: false, description: 'A PROD dep kind of dep', version: '1.0.0', _id: 'prod-dep@1.0.0', @@ -3439,6 +3678,7 @@ t.test('ls --json', t => { 'peer-dep': { version: '1.0.0', invalid: '"^2.0.0" from the root project', + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'invalid: peer-dep@1.0.0 {CWD}/tap-testdir-ls-ls---json-unmet-peer-dep/node_modules/peer-dep', @@ -3446,16 +3686,38 @@ t.test('ls --json', t => { }, 'dev-dep': { version: '1.0.0', + overridden: false, dependencies: { foo: { version: '1.0.0', - dependencies: { dog: { version: '1.0.0' } }, + overridden: false, + dependencies: { + dog: { + version: '1.0.0', + overridden: false, + }, + }, + }, + }, + }, + chai: { + version: '1.0.0', + overridden: false, + }, + 'optional-dep': { + version: '1.0.0', + overridden: false, + }, + 'prod-dep': { + version: '1.0.0', + overridden: false, + dependencies: { + dog: { + version: '2.0.0', + overridden: false, }, }, }, - chai: { version: '1.0.0' }, - 'optional-dep': { version: '1.0.0' }, - 'prod-dep': { version: '1.0.0', dependencies: { dog: { version: '2.0.0' } } }, }, }, 'should output json signaling missing peer dep in problems' @@ -3502,6 +3764,7 @@ t.test('ls --json', t => { 'optional-dep': { version: '1.0.0', invalid: '"^2.0.0" from the root project', + overridden: false, problems: [ /* eslint-disable-next-line max-len */ 'invalid: optional-dep@1.0.0 {CWD}/tap-testdir-ls-ls---json-unmet-optional-dep/node_modules/optional-dep', @@ -3509,18 +3772,38 @@ t.test('ls --json', t => { }, 'peer-dep': { version: '1.0.0', + overridden: false, }, 'dev-dep': { version: '1.0.0', + overridden: false, dependencies: { foo: { version: '1.0.0', - dependencies: { dog: { version: '1.0.0' } }, + overridden: false, + dependencies: { + dog: { + version: '1.0.0', + overridden: false, + }, + }, + }, + }, + }, + chai: { + version: '1.0.0', + overridden: false, + }, + 'prod-dep': { + version: '1.0.0', + overridden: false, + dependencies: { + dog: { + version: '2.0.0', + overridden: false, }, }, }, - chai: { version: '1.0.0' }, - 'prod-dep': { version: '1.0.0', dependencies: { dog: { version: '2.0.0' } } }, 'missing-optional-dep': {}, // missing optional dep has an empty entry in json output }, }, @@ -3567,11 +3850,15 @@ t.test('ls --json', t => { dependencies: { a: { version: '1.0.0', + overridden: false, dependencies: { b: { version: '1.0.0', + overridden: false, dependencies: { - a: { version: '1.0.0' }, + a: { + version: '1.0.0', + }, }, }, }, @@ -3623,6 +3910,7 @@ t.test('ls --json', t => { dependencies: { a: { version: '1.0.0', + overridden: false, resolved: 'https://localhost:8080/abbrev/-/abbrev-1.1.1.tgz', }, }, @@ -3683,6 +3971,7 @@ t.test('ls --json', t => { dependencies: { abbrev: { version: '1.1.1', + overridden: false, /* eslint-disable-next-line max-len */ resolved: 'git+ssh://git@github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', }, @@ -3760,6 +4049,7 @@ t.test('ls --json', t => { dependencies: { 'simple-output': { version: '2.1.1', + overridden: false, resolved: 'https://registry.npmjs.org/simple-output/-/simple-output-2.1.1.tgz', }, }, @@ -3823,12 +4113,15 @@ t.test('ls --json', t => { dependencies: { a: { version: '1.0.0', + overridden: false, }, b: { version: '1.0.0', + overridden: false, dependencies: { c: { version: '1.0.0', + overridden: false, }, }, }, @@ -3934,14 +4227,17 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -3984,9 +4280,11 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, @@ -4080,6 +4378,7 @@ t.test('ls --package-lock-only', t => { dependencies: { chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -4127,9 +4426,11 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, @@ -4179,14 +4480,17 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -4273,9 +4577,11 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -4323,9 +4629,11 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -4373,14 +4681,17 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, chai: { version: '1.0.0', + overridden: false, }, }, }, @@ -4431,6 +4742,7 @@ t.test('ls --package-lock-only', t => { dependencies: { foo: { version: '1.0.0', + overridden: false, invalid: '"^2.0.0" from the root project', problems: [ /* eslint-disable-next-line max-len */ @@ -4439,6 +4751,7 @@ t.test('ls --package-lock-only', t => { dependencies: { dog: { version: '1.0.0', + overridden: false, }, }, }, @@ -4544,11 +4857,13 @@ t.test('ls --package-lock-only', t => { dependencies: { '@isaacs/dedupe-tests-a': { version: '1.0.1', + overridden: false, resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-a/-/dedupe-tests-a-1.0.1.tgz', dependencies: { '@isaacs/dedupe-tests-b': { version: '1.0.0', + overridden: false, resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-1.0.0.tgz', }, @@ -4556,6 +4871,7 @@ t.test('ls --package-lock-only', t => { }, '@isaacs/dedupe-tests-b': { version: '2.0.0', + overridden: false, resolved: 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-2.0.0.tgz', }, @@ -4592,6 +4908,7 @@ t.test('ls --package-lock-only', t => { dependencies: { a: { version: '1.0.0', + overridden: false, resolved: 'https://localhost:8080/abbrev/-/abbrev-1.0.0.tgz', }, }, @@ -4634,6 +4951,7 @@ t.test('ls --package-lock-only', t => { abbrev: { /* eslint-disable-next-line max-len */ resolved: 'git+ssh://git@github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', + overridden: false, }, }, }, From cd2b1e6f5fbd85691465bbfe275c8baf1b6e2746 Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 16 Aug 2022 10:07:55 -0700 Subject: [PATCH 053/175] fix(explain): display override information --- lib/commands/explain.js | 3 ++- lib/utils/explain-dep.js | 17 +++++++++++--- .../test/lib/utils/explain-dep.js.test.cjs | 22 +++++++++++++++++++ test/lib/utils/explain-dep.js | 17 ++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/lib/commands/explain.js b/lib/commands/explain.js index c0ef04548a4ed..a06ad24152a1e 100644 --- a/lib/commands/explain.js +++ b/lib/commands/explain.js @@ -59,7 +59,7 @@ class Explain extends ArboristWorkspaceCmd { const expls = [] for (const node of nodes) { - const { extraneous, dev, optional, devOptional, peer, inBundle } = node + const { extraneous, dev, optional, devOptional, peer, inBundle, overridden } = node const expl = node.explain() if (extraneous) { expl.extraneous = true @@ -69,6 +69,7 @@ class Explain extends ArboristWorkspaceCmd { expl.devOptional = devOptional expl.peer = peer expl.bundled = inBundle + expl.overridden = overridden } expls.push(expl) } diff --git a/lib/utils/explain-dep.js b/lib/utils/explain-dep.js index 107f68549ef1d..cd53a2269640e 100644 --- a/lib/utils/explain-dep.js +++ b/lib/utils/explain-dep.js @@ -8,6 +8,7 @@ const nocolor = { magenta: s => s, blue: s => s, green: s => s, + gray: s => s, } const { relative } = require('path') @@ -18,13 +19,14 @@ const explainNode = (node, depth, color) => explainLinksIn(node, depth, color) const colorType = (type, color) => { - const { red, yellow, cyan, magenta, blue, green } = color ? chalk : nocolor + const { red, yellow, cyan, magenta, blue, green, gray } = color ? chalk : nocolor const style = type === 'extraneous' ? red : type === 'dev' ? yellow : type === 'optional' ? cyan : type === 'peer' ? magenta : type === 'bundled' ? blue : type === 'workspace' ? green + : type === 'overridden' ? gray : /* istanbul ignore next */ s => s return style(type) } @@ -40,6 +42,7 @@ const printNode = (node, color) => { peer, bundled, isWorkspace, + overridden, } = node const { bold, dim, green } = color ? chalk : nocolor const extra = [] @@ -63,6 +66,10 @@ const printNode = (node, color) => { extra.push(' ' + bold(colorType('bundled', color))) } + if (overridden) { + extra.push(' ' + bold(colorType('overridden', color))) + } + const pkgid = isWorkspace ? green(`${name}@${version}`) : `${bold(name)}@${bold(version)}` @@ -112,11 +119,15 @@ const explainDependents = ({ name, dependents }, depth, color) => { return str.split('\n').join('\n ') } -const explainEdge = ({ name, type, bundled, from, spec }, depth, color) => { +const explainEdge = ({ name, type, bundled, from, spec, rawSpec, overridden }, depth, color) => { const { bold } = color ? chalk : nocolor - const dep = type === 'workspace' + let dep = type === 'workspace' ? bold(relative(from.location, spec.slice('file:'.length))) : `${bold(name)}@"${bold(spec)}"` + if (overridden) { + dep = `${colorType('overridden', color)} ${dep} (was "${rawSpec}")` + } + const fromMsg = ` from ${explainFrom(from, depth, color)}` return (type === 'prod' ? '' : `${colorType(type, color)} `) + diff --git a/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs b/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs index 4d6f4686df8c4..8550617eb0a00 100644 --- a/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs +++ b/tap-snapshots/test/lib/utils/explain-dep.js.test.cjs @@ -156,6 +156,28 @@ optdep@1.0.0 optional node_modules/optdep ` +exports[`test/lib/utils/explain-dep.js TAP overridden > explain color deep 1`] = ` +overridden-root@1.0.0 overridden +node_modules/overridden-root + overridden overridden-dep@"1.0.0" (was "^2.0.0") from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP overridden > explain nocolor shallow 1`] = ` +overridden-root@1.0.0 overridden +node_modules/overridden-root + overridden overridden-dep@"1.0.0" (was "^2.0.0") from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP overridden > print color 1`] = ` +overridden-root@1.0.0 overridden +node_modules/overridden-root +` + +exports[`test/lib/utils/explain-dep.js TAP overridden > print nocolor 1`] = ` +overridden-root@1.0.0 overridden +node_modules/overridden-root +` + exports[`test/lib/utils/explain-dep.js TAP peer > explain color deep 1`] = ` peer@1.0.0 peer node_modules/peer diff --git a/test/lib/utils/explain-dep.js b/test/lib/utils/explain-dep.js index 000f5b8165a9b..ed006c01d78fb 100644 --- a/test/lib/utils/explain-dep.js +++ b/test/lib/utils/explain-dep.js @@ -129,6 +129,23 @@ const cases = { dependents: [], extraneous: true, }, + + overridden: { + name: 'overridden-root', + version: '1.0.0', + location: 'node_modules/overridden-root', + overridden: true, + dependents: [{ + type: 'prod', + name: 'overridden-dep', + spec: '1.0.0', + rawSpec: '^2.0.0', + overridden: true, + from: { + location: '/path/to/project', + }, + }], + }, } cases.manyDeps = { From d221f72c00e13258469a748227a1d6f9953a5948 Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 16 Aug 2022 10:23:06 -0700 Subject: [PATCH 054/175] feat(arborist): add :overridden pseudo selector --- workspaces/arborist/lib/query-selector-all.js | 4 ++++ workspaces/arborist/test/query-selector-all.js | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/workspaces/arborist/lib/query-selector-all.js b/workspaces/arborist/lib/query-selector-all.js index 6c540dea3c872..a3eac5ddc1238 100644 --- a/workspaces/arborist/lib/query-selector-all.js +++ b/workspaces/arborist/lib/query-selector-all.js @@ -262,6 +262,10 @@ class Results { !internalSelector.has(node)) } + overriddenPseudo () { + return this.initialItems.filter(node => node.overridden) + } + pathPseudo () { return this.initialItems.filter(node => { if (!this.currentAstNode.pathValue) { diff --git a/workspaces/arborist/test/query-selector-all.js b/workspaces/arborist/test/query-selector-all.js index c335a82cbaf4b..3bfe34bd8ef2c 100644 --- a/workspaces/arborist/test/query-selector-all.js +++ b/workspaces/arborist/test/query-selector-all.js @@ -28,7 +28,7 @@ t.test('query-selector-all', async t => { │ └── moo@3.0.0 (production dep of bar) ├─┬ foo@2.2.2 (dev dep of query-selector-all-tests) │ ├─┬ bar@1.4.0 (production dep of foo, deduped) - │ │ └── dasher@2.0.0 (peer dep of bar) + │ │ └── dasher@2.0.0 (overridden peer dep of bar) │ └── dash-separated-pkg@1.0.0 (production dep of foo) ├── moo@3.0.0 (dev dep of query-selector-all-tests) └─┬ recur@1.0.0 (dev dep of query-selector-all-tests) @@ -98,7 +98,7 @@ t.test('query-selector-all', async t => { name: 'bar', version: '1.4.0', peerDependencies: { - dasher: '2.0.0', + dasher: '2.1.0', }, }), }, @@ -203,6 +203,9 @@ t.test('query-selector-all', async t => { bar: '^2.0.0', ipsum: 'npm:sit@1.0.0', }, + overrides: { + dasher: '2.0.0', + }, devDependencies: { foo: '^2.0.0', moo: '^3.0.0', @@ -368,6 +371,7 @@ t.test('query-selector-all', async t => { ]], [':missing', ['missing-dep@^1.0.0']], [':private', ['b@1.0.0']], + [':overridden', ['dasher@2.0.0']], // :not pseudo [':not(#foo)', [ From 0d4ed0fb1cd86edd827cac0b5367b73bb864a9bf Mon Sep 17 00:00:00 2001 From: nlf Date: Tue, 16 Aug 2022 10:27:55 -0700 Subject: [PATCH 055/175] feat(query): support :overridden pseudo selector --- .../content/using-npm/dependency-selectors.md | 2 +- lib/commands/query.js | 1 + .../test/lib/commands/query.js.test.cjs | 33 ++++++++++++------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md index 45febf7cc7300..c96057c798ef5 100644 --- a/docs/content/using-npm/dependency-selectors.md +++ b/docs/content/using-npm/dependency-selectors.md @@ -54,7 +54,7 @@ The [`npm query`](/commands/npm-query) commmand exposes a new dependency selecto - [`:private`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private) when a dependency is private - `:link` when a dependency is linked (for instance, workspaces or packages manually [`linked`](https://docs.npmjs.com/cli/v8/commands/npm-link) - `:deduped` when a dependency has been deduped (note that this does *not* always mean the dependency has been hoisted to the root of node_modules) -- `:override` when a dependency is an override (not implemented yet) +- `:overridden` when a dependency has been overridden - `:extraneous` when a dependency exists but is not defined as a dependency of any node - `:invalid` when a dependency version is out of its ancestors specified range - `:missing` when a dependency is not found on disk diff --git a/lib/commands/query.js b/lib/commands/query.js index 60294acaf4a68..231329b19b5c8 100644 --- a/lib/commands/query.js +++ b/lib/commands/query.js @@ -20,6 +20,7 @@ class QuerySelectorItem { this.dev = node.target.dev this.inBundle = node.target.inBundle this.deduped = this.from.length > 1 + this.overridden = node.overridden for (const edge of node.target.edgesIn) { this.from.push(edge.from.location) } diff --git a/tap-snapshots/test/lib/commands/query.js.test.cjs b/tap-snapshots/test/lib/commands/query.js.test.cjs index 0a2aa769ee638..d827b62eef740 100644 --- a/tap-snapshots/test/lib/commands/query.js.test.cjs +++ b/tap-snapshots/test/lib/commands/query.js.test.cjs @@ -22,7 +22,8 @@ exports[`test/lib/commands/query.js TAP global > should return global package 1` "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` @@ -51,7 +52,8 @@ exports[`test/lib/commands/query.js TAP include-workspace-root > should return w ], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false }, { "name": "c", @@ -66,7 +68,8 @@ exports[`test/lib/commands/query.js TAP include-workspace-root > should return w "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` @@ -86,7 +89,8 @@ exports[`test/lib/commands/query.js TAP linked node > should return linked node "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` @@ -111,7 +115,8 @@ exports[`test/lib/commands/query.js TAP recursive tree > should return everythin ], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false }, { "pkgid": "a@", @@ -125,7 +130,8 @@ exports[`test/lib/commands/query.js TAP recursive tree > should return everythin "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false }, { "pkgid": "b@", @@ -139,7 +145,8 @@ exports[`test/lib/commands/query.js TAP recursive tree > should return everythin "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` @@ -167,7 +174,8 @@ exports[`test/lib/commands/query.js TAP simple query > should return root object ], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false }, { "pkgid": "a@", @@ -181,7 +189,8 @@ exports[`test/lib/commands/query.js TAP simple query > should return root object "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false }, { "pkgid": "b@", @@ -195,7 +204,8 @@ exports[`test/lib/commands/query.js TAP simple query > should return root object "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` @@ -215,7 +225,8 @@ exports[`test/lib/commands/query.js TAP workspace query > should return workspac "to": [], "dev": false, "inBundle": false, - "deduped": false + "deduped": false, + "overridden": false } ] ` From bc66ffa76005c882cc5fd237af87b7ca79375097 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 16 Aug 2022 17:55:19 -0700 Subject: [PATCH 056/175] docs: update --no-optional to --omit=optional (#5304) --- docs/content/configuring-npm/package-json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/configuring-npm/package-json.md b/docs/content/configuring-npm/package-json.md index b0231662f6930..5b4acf187f777 100644 --- a/docs/content/configuring-npm/package-json.md +++ b/docs/content/configuring-npm/package-json.md @@ -873,7 +873,7 @@ be found or fails to install, then you may put it in the `optionalDependencies` object. This is a map of package name to version or url, just like the `dependencies` object. The difference is that build failures do not cause installation to fail. Running `npm install ---no-optional` will prevent these dependencies from being installed. +--omit=optional` will prevent these dependencies from being installed. It is still your program's responsibility to handle the lack of the dependency. For example, something like this: From e5a9162a9dae9471e1ea77ad38baa02bb8d9852e Mon Sep 17 00:00:00 2001 From: William Marlow Date: Wed, 17 Aug 2022 01:57:51 +0100 Subject: [PATCH 057/175] fix: npm exec does not use script-shell option to run commands (#5297) --- workspaces/libnpmexec/lib/run-script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/workspaces/libnpmexec/lib/run-script.js b/workspaces/libnpmexec/lib/run-script.js index 18dcf7d8356c5..cee8ba45ae8e9 100644 --- a/workspaces/libnpmexec/lib/run-script.js +++ b/workspaces/libnpmexec/lib/run-script.js @@ -73,6 +73,7 @@ const run = async ({ event: 'npx', args, stdio: 'inherit', + scriptShell, }) } finally { npmlog.enableProgress() From 6eba13164d84efb34554c7dddeb2dbfed063ac0a Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 16 Aug 2022 17:58:47 -0700 Subject: [PATCH 058/175] fix: don't prompt on `npm exec [directory]` (#5298) Local directories have to be "installed" so that their bins are linked and set up and callable, the user shouldn't need to be prompted to do that. Note that this does NOT affect anything passed via the `--package` param, because that may also contain non-directory specs so the existing behavior needs to be preserved. This is a small QOL improvement for the isolated use case of "npm exec [directory]" This also updates the hashing method used to come up with the `.npx` directory to resolve the paths to packages first, so that `npm exec .` in different directories don't share the same `.npx` directory. --- workspaces/libnpmexec/lib/index.js | 29 +++++++++++++++++++++++++++-- workspaces/libnpmexec/test/index.js | 11 ++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 15d5ba4eeca17..45c75d4715674 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -63,6 +63,9 @@ const missingFromTree = async ({ spec, tree, flatOptions }) => { // non-registry spec, or a specific tag. Look up manifest and check // resolved to see if it's in the tree. const manifest = await getManifest(spec, flatOptions) + if (spec.type === 'directory') { + return { manifest } + } const nodesByManifest = tree.inventory.query('packageName', manifest.name) for (const node of nodesByManifest) { if (node.package.resolved === manifest._resolved) { @@ -89,10 +92,10 @@ const exec = async (opts) => { path = '.', runPath = '.', scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh', - yes = undefined, ...flatOptions } = opts + let yes = opts.yes const run = () => runScript({ args, call, @@ -129,6 +132,16 @@ const exec = async (opts) => { packages.push(args[0]) } + // Resolve any directory specs so that the npx directory is unique to the + // resolved directory, not the potentially relative one (i.e. "npx .") + for (const i in packages) { + const pkg = packages[i] + const spec = npa(pkg) + if (spec.type === 'directory') { + packages[i] = spec.fetchSpec + } + } + const localArb = new Arborist({ ...flatOptions, path }) const localTree = await localArb.loadActual() @@ -153,6 +166,10 @@ const exec = async (opts) => { if (needPackageCommandSwap) { const spec = npa(args[0]) + if (spec.type === 'directory') { + yes = true + } + args[0] = getBinFromManifest(commandManifest) if (needInstall.length > 0 && globalPath) { @@ -176,7 +193,15 @@ const exec = async (opts) => { throw new Error('Must provide a valid npxCache path') } const hash = crypto.createHash('sha512') - .update(packages.sort((a, b) => a.localeCompare(b, 'en')).join('\n')) + .update(packages.map(p => { + // Keeps the npx directory unique to the resolved directory, not the + // potentially relative one (i.e. "npx .") + const spec = npa(p) + if (spec.type === 'directory') { + return spec.fetchSpec + } + return p + }).sort((a, b) => a.localeCompare(b, 'en')).join('\n')) .digest('hex') .slice(0, 16) const installDir = resolve(npxCache, hash) diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index 3e218b75cbe5a..8d34118296200 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -482,7 +482,16 @@ require('fs').writeFileSync(process.argv.slice(2)[0], 'LOCAL PKG')`, const executable = resolve(path, 'a/index.js') fs.chmodSync(executable, 0o775) - await libexec({ + const mockexec = t.mock('../lib/index.js', { + '@npmcli/ci-detect': () => true, + 'proc-log': { + warn (title, msg) { + t.fail('should not warn about local file package install') + }, + }, + }) + + await mockexec({ ...baseOpts, args: [`file:${resolve(path, 'a')}`, 'resfile'], cache, From fc158b036d3d44ed8981bad0025a076795fd51ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Aug 2022 00:59:56 +0000 Subject: [PATCH 059/175] chore(latest): release libnpmexec 4.0.11 --- workspaces/libnpmexec/CHANGELOG.md | 8 ++++++++ workspaces/libnpmexec/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index e645499426ae7..cad3767839277 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [4.0.11](https://github.com/npm/cli/compare/libnpmexec-v4.0.10...libnpmexec-v4.0.11) (2022-08-17) + + +### Bug Fixes + +* don't prompt on `npm exec [directory]` ([#5298](https://github.com/npm/cli/issues/5298)) ([6eba131](https://github.com/npm/cli/commit/6eba13164d84efb34554c7dddeb2dbfed063ac0a)) +* npm exec does not use script-shell option to run commands ([#5297](https://github.com/npm/cli/issues/5297)) ([e5a9162](https://github.com/npm/cli/commit/e5a9162a9dae9471e1ea77ad38baa02bb8d9852e)) + ## [4.0.10](https://github.com/npm/cli/compare/libnpmexec-v4.0.9...libnpmexec-v4.0.10) (2022-08-10) diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index a83447d9ea695..4de7259071fd2 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "4.0.10", + "version": "4.0.11", "files": [ "bin/", "lib/" From 8460ccf8de0744e9b7228af682bbeb2eebb00e98 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 17 Aug 2022 01:00:27 +0000 Subject: [PATCH 060/175] deps: libnpmexec@4.0.11 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 3f49f87b2b836..fd1ad8eabe1ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10149,7 +10149,7 @@ } }, "workspaces/libnpmexec": { - "version": "4.0.10", + "version": "4.0.11", "license": "ISC", "dependencies": { "@npmcli/arborist": "^5.0.0", From 75c7c7e9dc3d58ab7c962ecc6001407e5fee0733 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Aug 2022 00:56:01 +0000 Subject: [PATCH 061/175] chore(latest): release arborist 5.6.0 --- workspaces/arborist/CHANGELOG.md | 9 +++++++++ workspaces/arborist/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index 4928e162afa0c..f1132c9e67457 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [5.6.0](https://github.com/npm/cli/compare/arborist-v5.5.0...arborist-v5.6.0) (2022-08-17) + + +### Features + +* **arborist:** add :overridden pseudo selector ([d221f72](https://github.com/npm/cli/commit/d221f72c00e13258469a748227a1d6f9953a5948)) +* **arborist:** add overridden getter to Node class ([e6d4304](https://github.com/npm/cli/commit/e6d4304bbd03e38dcf2c7467bb1e61b5740a4c73)) +* **query:** support :overridden pseudo selector ([0d4ed0f](https://github.com/npm/cli/commit/0d4ed0fb1cd86edd827cac0b5367b73bb864a9bf)) + ## [5.5.0](https://github.com/npm/cli/compare/arborist-v5.4.0...arborist-v5.5.0) (2022-08-10) diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index e76a87a32e86b..86e36e486c880 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "5.5.0", + "version": "5.6.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", From 41d0f51c34b24659d080beff0d53905975d34213 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 17 Aug 2022 00:56:29 +0000 Subject: [PATCH 062/175] deps: @npmcli/arborist@5.6.0 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index fd1ad8eabe1ef..9bb2d7a44f833 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10050,7 +10050,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "5.5.0", + "version": "5.6.0", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", From 4e08d71e76fb2355dc93fcd7695e1ae20d6446af Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 11:46:57 -0700 Subject: [PATCH 063/175] deps: pacote@13.6.2 (#5315) --- node_modules/pacote/lib/bin.js | 11 ++++++++--- node_modules/pacote/lib/fetcher.js | 6 +++++- node_modules/pacote/lib/git.js | 17 ++++++++--------- node_modules/pacote/lib/remote.js | 1 + node_modules/pacote/package.json | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/node_modules/pacote/lib/bin.js b/node_modules/pacote/lib/bin.js index 4a1f911e42bc5..f35b62ca71a53 100755 --- a/node_modules/pacote/lib/bin.js +++ b/node_modules/pacote/lib/bin.js @@ -18,10 +18,15 @@ const run = conf => { case 'tarball': if (!conf._[2] || conf._[2] === '-') { return pacote.tarball.stream(conf._[1], stream => { - stream.pipe(conf.testStdout || - /* istanbul ignore next */ process.stdout) + stream.pipe( + conf.testStdout || + /* istanbul ignore next */ + process.stdout + ) // make sure it resolves something falsey - return stream.promise().then(() => {}) + return stream.promise().then(() => { + return false + }) }, conf) } else { return pacote.tarball.file(conf._[1], conf._[2], conf) diff --git a/node_modules/pacote/lib/fetcher.js b/node_modules/pacote/lib/fetcher.js index 5f93e703bca4b..95b6d3ee432bb 100644 --- a/node_modules/pacote/lib/fetcher.js +++ b/node_modules/pacote/lib/fetcher.js @@ -254,6 +254,7 @@ class FetcherBase { cstream.on('error', err => stream.emit('error', err)) stream.pipe(cstream) + // eslint-disable-next-line promise/catch-or-return cstream.promise().catch(() => {}).then(() => middleStream.end()) return middleStream } @@ -269,7 +270,10 @@ class FetcherBase { } // override the types getter - get types () {} + get types () { + return false + } + [_assertType] () { if (this.types && !this.types.includes(this.spec.type)) { throw new TypeError(`Wrong spec type (${ diff --git a/node_modules/pacote/lib/git.js b/node_modules/pacote/lib/git.js index 9d84d95fa62ab..c4819b4fdf49c 100644 --- a/node_modules/pacote/lib/git.js +++ b/node_modules/pacote/lib/git.js @@ -239,7 +239,7 @@ class GitFetcher extends Fetcher { tarballOk = tarballOk && h && resolved === repoUrl(h, { noCommittish: false }) && h.tarball - return cacache.tmp.withTmp(this.cache, o, tmp => { + return cacache.tmp.withTmp(this.cache, o, async tmp => { // if we're resolved, and have a tarball url, shell out to RemoteFetcher if (tarballOk) { const nameat = this.spec.name ? `${this.spec.name}@` : '' @@ -259,16 +259,15 @@ class GitFetcher extends Fetcher { }) } - return ( + const sha = await ( h ? this[_cloneHosted](ref, tmp) : this[_cloneRepo](this.spec.fetchSpec, ref, tmp) - ).then(sha => { - this.resolvedSha = sha - if (!this.resolved) { - this[_addGitSha](sha) - } - }) - .then(() => handler(tmp)) + ) + this.resolvedSha = sha + if (!this.resolved) { + await this[_addGitSha](sha) + } + return handler(tmp) }) } diff --git a/node_modules/pacote/lib/remote.js b/node_modules/pacote/lib/remote.js index 6759dbba3ed2f..a361a9e89782e 100644 --- a/node_modules/pacote/lib/remote.js +++ b/node_modules/pacote/lib/remote.js @@ -41,6 +41,7 @@ class RemoteFetcher extends Fetcher { algorithms: [this.pickIntegrityAlgorithm()], } + // eslint-disable-next-line promise/always-return fetch(this.resolved, fetchOpts).then(res => { res.body.on('error', /* istanbul ignore next - exceedingly rare and hard to simulate */ diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index 696c925d35320..960530ec0b33d 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "13.6.1", + "version": "13.6.2", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { diff --git a/package-lock.json b/package-lock.json index 9bb2d7a44f833..3f71974880e0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -140,7 +140,7 @@ "npmlog": "^6.0.2", "opener": "^1.5.2", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", @@ -5598,9 +5598,9 @@ } }, "node_modules/pacote": { - "version": "13.6.1", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.1.tgz", - "integrity": "sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw==", + "version": "13.6.2", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.6.2.tgz", + "integrity": "sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg==", "inBundle": true, "dependencies": { "@npmcli/git": "^3.0.0", diff --git a/package.json b/package.json index 3641c1475185f..f95332f2662a9 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "npmlog": "^6.0.2", "opener": "^1.5.2", "p-map": "^4.0.0", - "pacote": "^13.6.1", + "pacote": "^13.6.2", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", From 46e875306f551e3b89e2786d0fc8f0f3e4a8aa82 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 11:51:27 -0700 Subject: [PATCH 064/175] deps: npm-registry-fetch@13.3.1 (#5316) --- node_modules/npm-registry-fetch/lib/check-response.js | 4 +++- node_modules/npm-registry-fetch/lib/clean-url.js | 4 +++- node_modules/npm-registry-fetch/package.json | 4 +++- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/node_modules/npm-registry-fetch/lib/check-response.js b/node_modules/npm-registry-fetch/lib/check-response.js index 714513908df40..066ac3c32420f 100644 --- a/node_modules/npm-registry-fetch/lib/check-response.js +++ b/node_modules/npm-registry-fetch/lib/check-response.js @@ -61,7 +61,9 @@ function checkErrors (method, res, startTime, opts) { let parsed = body try { parsed = JSON.parse(body.toString('utf8')) - } catch (e) {} + } catch { + // ignore errors + } if (res.status === 401 && res.headers.get('www-authenticate')) { const auth = res.headers.get('www-authenticate') .split(/,\s*/) diff --git a/node_modules/npm-registry-fetch/lib/clean-url.js b/node_modules/npm-registry-fetch/lib/clean-url.js index ba31dc462f3c5..a419b47d6a339 100644 --- a/node_modules/npm-registry-fetch/lib/clean-url.js +++ b/node_modules/npm-registry-fetch/lib/clean-url.js @@ -14,7 +14,9 @@ const cleanUrl = (str) => { if (url.password) { str = str.replace(url.password, replace) } - } catch {} + } catch { + // ignore errors + } return str .replace(tokenRegex, `npm_${replace}`) diff --git a/node_modules/npm-registry-fetch/package.json b/node_modules/npm-registry-fetch/package.json index 8a0189a9ef74d..7a3885ae12e88 100644 --- a/node_modules/npm-registry-fetch/package.json +++ b/node_modules/npm-registry-fetch/package.json @@ -1,6 +1,6 @@ { "name": "npm-registry-fetch", - "version": "13.3.0", + "version": "13.3.1", "description": "Fetch-based http client for use with npm registry APIs", "main": "lib", "files": [ @@ -46,8 +46,10 @@ "@npmcli/eslint-config": "^3.0.1", "@npmcli/template-oss": "3.5.0", "cacache": "^16.0.2", + "mkdirp": "^1.0.4", "nock": "^13.2.4", "require-inject": "^1.4.4", + "rimraf": "^3.0.2", "ssri": "^9.0.0", "tap": "^16.0.1" }, diff --git a/package-lock.json b/package-lock.json index 3f71974880e0c..6355a9efebe20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -135,7 +135,7 @@ "npm-package-arg": "^9.1.0", "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.2.0", - "npm-registry-fetch": "^13.3.0", + "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", @@ -5230,9 +5230,9 @@ } }, "node_modules/npm-registry-fetch": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz", - "integrity": "sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg==", + "version": "13.3.1", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-13.3.1.tgz", + "integrity": "sha512-eukJPi++DKRTjSBRcDZSDDsGqRK3ehbxfFUcgaRd0Yp6kRwOwh2WVn0r+8rMB4nnuzvAk6rQVzl6K5CkYOmnvw==", "inBundle": true, "dependencies": { "make-fetch-happen": "^10.0.6", diff --git a/package.json b/package.json index f95332f2662a9..49ddfa179b0cf 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "npm-package-arg": "^9.1.0", "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.2.0", - "npm-registry-fetch": "^13.3.0", + "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.2", "opener": "^1.5.2", From d39b2ee671f2c7adf041b07a1d4e8bdc24ef7588 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:32:06 -0700 Subject: [PATCH 065/175] deps: normalize-package-data@4.0.1 --- .../lib/extract_description.js | 12 ++++--- .../normalize-package-data/lib/fixer.js | 36 +++++++++---------- .../normalize-package-data/package.json | 26 +++++++------- package-lock.json | 7 ++-- 4 files changed, 43 insertions(+), 38 deletions(-) diff --git a/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/normalize-package-data/lib/extract_description.js index bf9896812e5f5..631966b5f29af 100644 --- a/node_modules/normalize-package-data/lib/extract_description.js +++ b/node_modules/normalize-package-data/lib/extract_description.js @@ -11,12 +11,14 @@ function extractDescription (d) { // the first block of text before the first heading // that isn't the first line heading d = d.trim().split('\n') - for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s++) { - ; + let s = 0 + while (d[s] && d[s].trim().match(/^(#|$)/)) { + s++ } - var l = d.length - for (var e = s + 1; e < l && d[e].trim(); e++) { - ; + const l = d.length + let e = s + 1 + while (e < l && d[e].trim()) { + e++ } return d.slice(s, e).join(' ').trim() } diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js index 0846f2c045a6e..bb78231d83ca9 100644 --- a/node_modules/normalize-package-data/lib/fixer.js +++ b/node_modules/normalize-package-data/lib/fixer.js @@ -121,17 +121,17 @@ module.exports = { this.warn('nonArrayBundleDependencies') delete data[bd] } else if (data[bd]) { - data[bd] = data[bd].filter(function (bd) { - if (!bd || typeof bd !== 'string') { - this.warn('nonStringBundleDependency', bd) + data[bd] = data[bd].filter(function (filtered) { + if (!filtered || typeof filtered !== 'string') { + this.warn('nonStringBundleDependency', filtered) return false } else { if (!data.dependencies) { data.dependencies = {} } - if (!Object.prototype.hasOwnProperty.call(data.dependencies, bd)) { - this.warn('nonDependencyBundleDependency', bd) - data.dependencies[bd] = '*' + if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) { + this.warn('nonDependencyBundleDependency', filtered) + data.dependencies[filtered] = '*' } return true } @@ -389,28 +389,28 @@ function unParsePerson (person) { } var name = person.name || '' var u = person.url || person.web - var url = u ? (' (' + u + ')') : '' + var wrappedUrl = u ? (' (' + u + ')') : '' var e = person.email || person.mail - var email = e ? (' <' + e + '>') : '' - return name + email + url + var wrappedEmail = e ? (' <' + e + '>') : '' + return name + wrappedEmail + wrappedUrl } function parsePerson (person) { if (typeof person !== 'string') { return person } - var name = person.match(/^([^(<]+)/) - var url = person.match(/\(([^()]+)\)/) - var email = person.match(/<([^<>]+)>/) + var matchedName = person.match(/^([^(<]+)/) + var matchedUrl = person.match(/\(([^()]+)\)/) + var matchedEmail = person.match(/<([^<>]+)>/) var obj = {} - if (name && name[0].trim()) { - obj.name = name[0].trim() + if (matchedName && matchedName[0].trim()) { + obj.name = matchedName[0].trim() } - if (email) { - obj.email = email[1] + if (matchedEmail) { + obj.email = matchedEmail[1] } - if (url) { - obj.url = url[1] + if (matchedUrl) { + obj.url = matchedUrl[1] } return obj } diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json index a6f1244eb5a25..1bec9bb8645e7 100644 --- a/node_modules/normalize-package-data/package.json +++ b/node_modules/normalize-package-data/package.json @@ -1,12 +1,12 @@ { "name": "normalize-package-data", - "version": "4.0.0", + "version": "4.0.1", "author": "GitHub Inc.", "description": "Normalizes data that can be found in package.json files.", "license": "BSD-2-Clause", "repository": { "type": "git", - "url": "git://github.com/npm/normalize-package-data.git" + "url": "https://github.com/npm/normalize-package-data.git" }, "main": "lib/normalize.js", "scripts": { @@ -15,13 +15,13 @@ "preversion": "npm test", "test": "tap", "npmclilint": "npmcli-lint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", - "snap": "tap" + "postlint": "template-oss-check", + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" }, "dependencies": { "hosted-git-info": "^5.0.0", @@ -30,18 +30,20 @@ "validate-npm-package-license": "^3.0.4" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", - "tap": "^15.0.9" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" }, "tap": { "branches": 86, diff --git a/package-lock.json b/package-lock.json index 6355a9efebe20..e790b1a369d76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5106,9 +5106,10 @@ } }, "node_modules/normalize-package-data": { - "version": "4.0.0", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-4.0.1.tgz", + "integrity": "sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==", "inBundle": true, - "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^5.0.0", "is-core-module": "^2.8.1", @@ -5116,7 +5117,7 @@ "validate-npm-package-license": "^3.0.4" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/normalize-path": { From 7d564bd73bcac909a922d88986e3a55fe343ca44 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:33:07 -0700 Subject: [PATCH 066/175] deps: make-fetch-happen@10.2.1 --- node_modules/make-fetch-happen/lib/cache/entry.js | 1 + node_modules/make-fetch-happen/package.json | 2 +- package-lock.json | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/node_modules/make-fetch-happen/lib/cache/entry.js b/node_modules/make-fetch-happen/lib/cache/entry.js index 4307962b889d0..dba89d715d8a5 100644 --- a/node_modules/make-fetch-happen/lib/cache/entry.js +++ b/node_modules/make-fetch-happen/lib/cache/entry.js @@ -288,6 +288,7 @@ class CacheEntry { // stick a flag on here so downstream users will know if they can expect integrity events tee.pipe(cacheStream) // TODO if the cache write fails, log a warning but return the response anyway + // eslint-disable-next-line promise/catch-or-return cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) body.unshift(tee) body.unshift(this.response.body) diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index 8b21901f34fc1..fc491d1152e15 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.2.0", + "version": "10.2.1", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ diff --git a/package-lock.json b/package-lock.json index e790b1a369d76..6d6236a22182f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4637,9 +4637,9 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.0.tgz", - "integrity": "sha512-OnEfCLofQVJ5zgKwGk55GaqosqKjaR6khQlJY3dBAA+hM25Bc5CmX5rKUfVut+rYA3uidA7zb7AvcglU87rPRg==", + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.2.1", From 5a566863ca96f641fcecacd1ad20a7c837dccfeb Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:22:50 -0700 Subject: [PATCH 067/175] deps: @npmcli/git@3.0.2 --- node_modules/@npmcli/git/lib/which.js | 4 +++- node_modules/@npmcli/git/package.json | 8 +++++--- package-lock.json | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/node_modules/@npmcli/git/lib/which.js b/node_modules/@npmcli/git/lib/which.js index a2f690e1bce80..dc2a1ad212166 100644 --- a/node_modules/@npmcli/git/lib/which.js +++ b/node_modules/@npmcli/git/lib/which.js @@ -3,7 +3,9 @@ const which = require('which') let gitPath try { gitPath = which.sync('git') -} catch (e) {} +} catch { + // ignore errors +} module.exports = (opts = {}) => { if (opts.git) { diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index 08525ae99e8ec..86b8e85399266 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "3.0.1", + "version": "3.0.2", "main": "lib/index.js", "files": [ "bin/", @@ -31,7 +31,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", + "npm-package-arg": "^9.1.0", + "rimraf": "^3.0.2", "slash": "^3.0.0", "tap": "^16.0.1" }, @@ -52,6 +54,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 6d6236a22182f..c1bd310dd095d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -929,9 +929,9 @@ } }, "node_modules/@npmcli/git": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", - "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.2.tgz", + "integrity": "sha512-CAcd08y3DWBJqJDpfuVL0uijlq5oaXaOJEKHKc4wqrjd00gkvTZB+nFuLn+doOOKddaQS9JfqtNoFCO2LCvA3w==", "inBundle": true, "dependencies": { "@npmcli/promise-spawn": "^3.0.0", From 3c5a866cc6e58e660a0aedb8ce6fec258e523a21 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:24:10 -0700 Subject: [PATCH 068/175] deps: bin-links@3.0.2 --- node_modules/bin-links/lib/link-gently.js | 2 ++ node_modules/bin-links/lib/shim-bin.js | 5 +++-- node_modules/bin-links/package.json | 8 ++++---- package-lock.json | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/node_modules/bin-links/lib/link-gently.js b/node_modules/bin-links/lib/link-gently.js index 671ce38a586e7..d9ef25e7c5b0b 100644 --- a/node_modules/bin-links/lib/link-gently.js +++ b/node_modules/bin-links/lib/link-gently.js @@ -64,6 +64,8 @@ const linkGently = async ({ path, to, from, absFrom, force }) => { if (target.indexOf(path) === 0 || force) { return rm(to).then(() => CLOBBER) } + // neither skip nor clobber + return false }) } else { // doesn't exist, dir might not either diff --git a/node_modules/bin-links/lib/shim-bin.js b/node_modules/bin-links/lib/shim-bin.js index 70259a49e5b0c..bde328e510c53 100644 --- a/node_modules/bin-links/lib/shim-bin.js +++ b/node_modules/bin-links/lib/shim-bin.js @@ -56,12 +56,12 @@ const shimBin = ({ path, to, from, absFrom, force }) => { } if (force) { - return + return false } return Promise.all(shims.map((s, i) => [s, stats[i]]).map(([s, st]) => { if (!st) { - return + return false } return readCmdShim(s) .then(target => { @@ -69,6 +69,7 @@ const shimBin = ({ path, to, from, absFrom, force }) => { if (target.indexOf(resolve(path)) !== 0) { return failEEXIST({ from, to, path }) } + return false }, er => handleReadCmdShimError({ er, from, to })) })) }) diff --git a/node_modules/bin-links/package.json b/node_modules/bin-links/package.json index a86948de153c5..aba3d8f6c0908 100644 --- a/node_modules/bin-links/package.json +++ b/node_modules/bin-links/package.json @@ -1,6 +1,6 @@ { "name": "bin-links", - "version": "3.0.1", + "version": "3.0.2", "description": "JavaScript package binary linker", "main": "./lib/index.js", "scripts": { @@ -35,10 +35,10 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "mkdirp": "^1.0.3", "require-inject": "^1.4.4", - "tap": "^15.0.10" + "tap": "^16.0.1" }, "tap": { "check-coverage": true, @@ -55,6 +55,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index c1bd310dd095d..9430ea24064e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1484,9 +1484,9 @@ } }, "node_modules/bin-links": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", - "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.2.tgz", + "integrity": "sha512-+oSWBdbCUK6X4LOCSrU36fWRzZNaK7/evX7GozR9xwl2dyiVi3UOUwTyyOVYI1FstgugfsM9QESRrWo7gjCYbg==", "dependencies": { "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", From 07536a4be30ac3305fe4827335d621387bae3ca7 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:25:19 -0700 Subject: [PATCH 069/175] deps: @npmcli/fs@2.1.2 --- node_modules/@npmcli/fs/lib/common/owner-sync.js | 8 ++++++-- node_modules/@npmcli/fs/lib/common/owner.js | 8 ++++++-- node_modules/@npmcli/fs/lib/with-temp-dir.js | 4 +++- node_modules/@npmcli/fs/package.json | 2 +- package-lock.json | 6 +++--- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/node_modules/@npmcli/fs/lib/common/owner-sync.js b/node_modules/@npmcli/fs/lib/common/owner-sync.js index 8fa18d5121eff..3704aa6d18e1e 100644 --- a/node_modules/@npmcli/fs/lib/common/owner-sync.js +++ b/node_modules/@npmcli/fs/lib/common/owner-sync.js @@ -50,11 +50,15 @@ const update = (path, uid, gid) => { if (uid === stat.uid && gid === stat.gid) { return } - } catch (err) {} + } catch { + // ignore errors + } try { fs.chownSync(path, uid, gid) - } catch (err) {} + } catch { + // ignore errors + } } // accepts a `path` and the `owner` property of an options object and normalizes diff --git a/node_modules/@npmcli/fs/lib/common/owner.js b/node_modules/@npmcli/fs/lib/common/owner.js index 3fe167cfc30aa..9f02d41a5e4b3 100644 --- a/node_modules/@npmcli/fs/lib/common/owner.js +++ b/node_modules/@npmcli/fs/lib/common/owner.js @@ -50,11 +50,15 @@ const update = async (path, uid, gid) => { if (uid === stat.uid && gid === stat.gid) { return } - } catch (err) {} + } catch { + // ignore errors + } try { await fs.chown(path, uid, gid) - } catch (err) {} + } catch { + // ignore errors + } } // accepts a `path` and the `owner` property of an options object and normalizes diff --git a/node_modules/@npmcli/fs/lib/with-temp-dir.js b/node_modules/@npmcli/fs/lib/with-temp-dir.js index ad08e6ee6e6d6..81db59dd054b4 100644 --- a/node_modules/@npmcli/fs/lib/with-temp-dir.js +++ b/node_modules/@npmcli/fs/lib/with-temp-dir.js @@ -27,7 +27,9 @@ const withTempDir = async (root, fn, opts) => { try { await rm(target, { force: true, recursive: true }) - } catch {} + } catch { + // ignore errors + } if (err) { throw err diff --git a/node_modules/@npmcli/fs/package.json b/node_modules/@npmcli/fs/package.json index 9e18028218d1a..1512fd6e4b0ac 100644 --- a/node_modules/@npmcli/fs/package.json +++ b/node_modules/@npmcli/fs/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/fs", - "version": "2.1.1", + "version": "2.1.2", "description": "filesystem utilities for the npm cli", "main": "lib/index.js", "files": [ diff --git a/package-lock.json b/package-lock.json index 9430ea24064e7..516d0738810f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -916,9 +916,9 @@ } }, "node_modules/@npmcli/fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.1.tgz", - "integrity": "sha512-1Q0uzx6c/NVNGszePbr5Gc2riSU1zLpNlo/1YWntH+eaPmMgBssAW0qXofCVkpdj3ce4swZtlDYQu+NKiYcptg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", "inBundle": true, "dependencies": { "@gar/promisify": "^1.1.3", From 81655017172eaedd346b3efe63c5975c803c82b4 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:26:35 -0700 Subject: [PATCH 070/175] deps: @npmcli/move-file@2.0.1 --- node_modules/@npmcli/move-file/lib/index.js | 22 +++++++++++++++------ node_modules/@npmcli/move-file/package.json | 6 +++--- package-lock.json | 6 +++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/node_modules/@npmcli/move-file/lib/index.js b/node_modules/@npmcli/move-file/lib/index.js index ecc55f0171da5..5789bb127e096 100644 --- a/node_modules/@npmcli/move-file/lib/index.js +++ b/node_modules/@npmcli/move-file/lib/index.js @@ -97,14 +97,19 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = await stat(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } await symlink( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) })) await rimraf(source) @@ -157,14 +162,19 @@ const moveFileSync = (source, destination, options = {}, root = true, symlinks = } // try to determine what the actual file is so we can create the correct // type of symlink in windows - let targetStat + let targetStat = 'file' try { targetStat = statSync(resolve(dirname(symSource), target)) - } catch (err) {} + if (targetStat.isDirectory()) { + targetStat = 'junction' + } + } catch { + // targetStat remains 'file' + } symlinkSync( target, symDestination, - targetStat && targetStat.isDirectory() ? 'junction' : 'file' + targetStat ) } rimrafSync(source) diff --git a/node_modules/@npmcli/move-file/package.json b/node_modules/@npmcli/move-file/package.json index 1b1d377b0c7b2..58793b93a9ca0 100644 --- a/node_modules/@npmcli/move-file/package.json +++ b/node_modules/@npmcli/move-file/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/move-file", - "version": "2.0.0", + "version": "2.0.1", "files": [ "bin/", "lib/" @@ -13,7 +13,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, "scripts": { @@ -42,6 +42,6 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 516d0738810f5..67cddf08dc0d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -993,9 +993,9 @@ } }, "node_modules/@npmcli/move-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", - "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", "inBundle": true, "dependencies": { "mkdirp": "^1.0.4", From cbee6385a3231ea9ba02aa23d9dd110ba369217b Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:27:26 -0700 Subject: [PATCH 071/175] deps: cacache@16.1.2 --- node_modules/cacache/lib/content/read.js | 2 +- node_modules/cacache/lib/content/write.js | 2 ++ node_modules/cacache/lib/entry-index.js | 1 + node_modules/cacache/lib/get.js | 1 + node_modules/cacache/package.json | 2 +- package-lock.json | 6 +++--- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/node_modules/cacache/lib/content/read.js b/node_modules/cacache/lib/content/read.js index 8367ccb205d0b..7c20c75257b4f 100644 --- a/node_modules/cacache/lib/content/read.js +++ b/node_modules/cacache/lib/content/read.js @@ -81,7 +81,7 @@ function readStream (cache, integrity, opts = {}) { return stream.emit('error', sizeError(size, stat.size)) } - readPipeline(cpath, stat.size, sri, stream) + return readPipeline(cpath, stat.size, sri, stream) }).catch(err => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/lib/content/write.js b/node_modules/cacache/lib/content/write.js index 62388dc81d0fd..0e8c0f4936064 100644 --- a/node_modules/cacache/lib/content/write.js +++ b/node_modules/cacache/lib/content/write.js @@ -80,9 +80,11 @@ class CacacheWriteStream extends Flush { // defer this one tick by rejecting a promise on it. return Promise.reject(e).catch(cb) } + // eslint-disable-next-line promise/catch-or-return this.handleContentP.then( (res) => { res.integrity && this.emit('integrity', res.integrity) + // eslint-disable-next-line promise/always-return res.size !== null && this.emit('size', res.size) cb() }, diff --git a/node_modules/cacache/lib/entry-index.js b/node_modules/cacache/lib/entry-index.js index cbfa619099f90..1dc73a93f6b29 100644 --- a/node_modules/cacache/lib/entry-index.js +++ b/node_modules/cacache/lib/entry-index.js @@ -285,6 +285,7 @@ function lsStream (cache) { })) })) stream.end() + return stream }).catch(err => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/lib/get.js b/node_modules/cacache/lib/get.js index cc9d8f6796647..254b4ecc38b57 100644 --- a/node_modules/cacache/lib/get.js +++ b/node_modules/cacache/lib/get.js @@ -155,6 +155,7 @@ function getStream (cache, key, opts = {}) { stream.unshift(memoStream) } stream.unshift(src) + return stream }).catch((err) => stream.emit('error', err)) return stream diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index bb5674dafca81..3f19d07d44166 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "16.1.1", + "version": "16.1.2", "cache-version": { "content": "2", "index": "5" diff --git a/package-lock.json b/package-lock.json index 67cddf08dc0d0..66e80b12d628c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1596,9 +1596,9 @@ } }, "node_modules/cacache": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.1.tgz", - "integrity": "sha512-VDKN+LHyCQXaaYZ7rA/qtkURU+/yYhviUdvqEv2LT6QPZU8jpyzEkEVAcKlKLt5dJ5BRp11ym8lo3NKLluEPLg==", + "version": "16.1.2", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.2.tgz", + "integrity": "sha512-Xx+xPlfCZIUHagysjjOAje9nRo8pRDczQCcXb4J2O0BLtH+xeVue6ba4y1kfJfQMAnM2mkcoMIAyOctlaRGWYA==", "inBundle": true, "dependencies": { "@npmcli/fs": "^2.1.0", From 1f6daf5b9df054952a47df01780039bd5da8f024 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:28:19 -0700 Subject: [PATCH 072/175] deps: write-file-atomic@4.0.2 --- node_modules/write-file-atomic/lib/index.js | 13 ++++++++--- node_modules/write-file-atomic/package.json | 24 +++++++++++---------- package-lock.json | 7 +++--- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/node_modules/write-file-atomic/lib/index.js b/node_modules/write-file-atomic/lib/index.js index 118666d2ce6d8..9d79d797a553f 100644 --- a/node_modules/write-file-atomic/lib/index.js +++ b/node_modules/write-file-atomic/lib/index.js @@ -39,7 +39,9 @@ function cleanupOnExit (tmpfile) { return () => { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) - } catch (_) {} + } catch { + // ignore errors + } } } @@ -156,7 +158,7 @@ async function writeFileAsync (filename, data, options = {}) { } } -function writeFile (filename, data, options, callback) { +async function writeFile (filename, data, options, callback) { if (options instanceof Function) { callback = options options = {} @@ -164,7 +166,12 @@ function writeFile (filename, data, options, callback) { const promise = writeFileAsync(filename, data, options) if (callback) { - promise.then(callback, callback) + try { + const result = await promise + return callback(result) + } catch (err) { + return callback(err) + } } return promise diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json index 7219f90b97be0..86e2a0fbadfeb 100644 --- a/node_modules/write-file-atomic/package.json +++ b/node_modules/write-file-atomic/package.json @@ -1,23 +1,23 @@ { "name": "write-file-atomic", - "version": "4.0.1", + "version": "4.0.2", "description": "Write files in an atomic fashion w/configurable ownership", "main": "./lib/index.js", "scripts": { "test": "tap", "posttest": "npm run lint", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "lintfix": "npm run lint -- --fix", "snap": "tap", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "git://github.com/npm/write-file-atomic.git" + "url": "https://github.com/npm/write-file-atomic.git" }, "keywords": [ "writeFile", @@ -34,20 +34,22 @@ "signal-exit": "^3.0.7" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", "mkdirp": "^1.0.4", "rimraf": "^3.0.2", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "2.7.1" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 66e80b12d628c..299e955141fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9824,15 +9824,16 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "4.0.1", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "inBundle": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/ws": { From 409468f25e783d0941e76c7a9a64a751a574176b Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:34:15 -0700 Subject: [PATCH 073/175] deps: minipass-fetch@2.1.1 --- node_modules/minipass-fetch/lib/body.js | 24 +++++++++++++----------- node_modules/minipass-fetch/package.json | 7 ++++--- package-lock.json | 5 +++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/node_modules/minipass-fetch/lib/body.js b/node_modules/minipass-fetch/lib/body.js index c7ffa5babcbc6..58893309e63f9 100644 --- a/node_modules/minipass-fetch/lib/body.js +++ b/node_modules/minipass-fetch/lib/body.js @@ -10,7 +10,9 @@ const FetchError = require('./fetch-error.js') let convert try { convert = require('encoding').convert -} catch (e) {} +} catch (e) { + // defer error until textConverted is called +} const INTERNALS = Symbol('Body internals') const CONSUME_BODY = Symbol('consumeBody') @@ -69,16 +71,16 @@ class Body { )) } - json () { - return this[CONSUME_BODY]().then(buf => { - try { - return JSON.parse(buf.toString()) - } catch (er) { - return Promise.reject(new FetchError( - `invalid json response body at ${ - this.url} reason: ${er.message}`, 'invalid-json')) - } - }) + async json () { + try { + const buf = await this[CONSUME_BODY]() + return JSON.parse(buf.toString()) + } catch (er) { + throw new FetchError( + `invalid json response body at ${this.url} reason: ${er.message}`, + 'invalid-json' + ) + } } text () { diff --git a/node_modules/minipass-fetch/package.json b/node_modules/minipass-fetch/package.json index 1f663b9245dea..b47077adc111a 100644 --- a/node_modules/minipass-fetch/package.json +++ b/node_modules/minipass-fetch/package.json @@ -1,6 +1,6 @@ { "name": "minipass-fetch", - "version": "2.1.0", + "version": "2.1.1", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", @@ -23,10 +23,11 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.1.2", + "@npmcli/template-oss": "3.5.0", "@ungap/url-search-params": "^0.2.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "~1.7.3", + "encoding": "^0.1.13", "form-data": "^4.0.0", "nock": "^13.2.4", "parted": "^0.1.1", @@ -61,6 +62,6 @@ "author": "GitHub Inc.", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.1.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 299e955141fe6..ba7a51e0a872f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4819,9 +4819,10 @@ } }, "node_modules/minipass-fetch": { - "version": "2.1.0", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.1.tgz", + "integrity": "sha512-/kgtXVGS10PTFET6dAbOBWQtgH+iDiI4NhRqAftojRlsOJhk0y45sVVxqCaRQC+AMFH7JkHiWpuKJKQ+mojKiA==", "inBundle": true, - "license": "MIT", "dependencies": { "minipass": "^3.1.6", "minipass-sized": "^1.0.3", From 3ac4a3bce8ca0822b1ebe6bc71112ea3ab0ea5c0 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:51:35 -0700 Subject: [PATCH 074/175] chore: changelog for v8.18.0 --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffd21d93cf6d5..a476fd2ba775a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog +## v8.18.0 (2022-08-17) + +### Features + + * [`e6d4304`](https://github.com/npm/cli/commit/e6d4304bbd03e38dcf2c7467bb1e61b5740a4c73) [#5306](https://github.com/npm/cli/pull/5306) feat(arborist): add overridden getter to Node class ([@nlf](https://github.com/nlf)) + * [`d221f72`](https://github.com/npm/cli/commit/d221f72c00e13258469a748227a1d6f9953a5948) [#5306](https://github.com/npm/cli/pull/5306) feat(arborist): add :overridden pseudo selector ([@nlf](https://github.com/nlf)) + * [`0d4ed0f`](https://github.com/npm/cli/commit/0d4ed0fb1cd86edd827cac0b5367b73bb864a9bf) [#5306](https://github.com/npm/cli/pull/5306) feat(query): support :overridden pseudo selector ([@nlf](https://github.com/nlf)) + +### Bug Fixes + + * [`05d9bcf`](https://github.com/npm/cli/commit/05d9bcf7e557e0dbecbd80d4d1be332963761e69) [#5306](https://github.com/npm/cli/pull/5306) fix(ls): display overridden nodes ([@nlf](https://github.com/nlf)) + * [`cd2b1e6`](https://github.com/npm/cli/commit/cd2b1e6f5fbd85691465bbfe275c8baf1b6e2746) [#5306](https://github.com/npm/cli/pull/5306) fix(explain): display override information ([@nlf](https://github.com/nlf)) + * [`e5a9162`](https://github.com/npm/cli/commit/e5a9162a9dae9471e1ea77ad38baa02bb8d9852e) [#5297](https://github.com/npm/cli/pull/5297) fix: npm exec does not use script-shell option to run commands ([@lux01](https://github.com/lux01)) + * [`6eba131`](https://github.com/npm/cli/commit/6eba13164d84efb34554c7dddeb2dbfed063ac0a) [#5298](https://github.com/npm/cli/pull/5298) fix: don't prompt on `npm exec [directory]` ([@wraithgar](https://github.com/wraithgar)) + +### Documentation + + * [`bc66ffa`](https://github.com/npm/cli/commit/bc66ffa76005c882cc5fd237af87b7ca79375097) [#5304](https://github.com/npm/cli/pull/5304) docs: update --no-optional to --omit=optional ([@wraithgar](https://github.com/wraithgar)) + +### Dependencies + + * [`8460ccf`](https://github.com/npm/cli/commit/8460ccf8de0744e9b7228af682bbeb2eebb00e98) [#5311](https://github.com/npm/cli/pull/5311) deps: `libnpmexec@4.0.11` + * [`41d0f51`](https://github.com/npm/cli/commit/41d0f51c34b24659d080beff0d53905975d34213) [#5310](https://github.com/npm/cli/pull/5310) deps: `@npmcli/arborist@5.6.0` + * [`4e08d71`](https://github.com/npm/cli/commit/4e08d71e76fb2355dc93fcd7695e1ae20d6446af) [#5315](https://github.com/npm/cli/pull/5315) deps: `pacote@13.6.2` + * [`46e8753`](https://github.com/npm/cli/commit/46e875306f551e3b89e2786d0fc8f0f3e4a8aa82) [#5316](https://github.com/npm/cli/pull/5316) deps: `npm-registry-fetch@13.3.1` + * [`d39b2ee`](https://github.com/npm/cli/commit/d39b2ee671f2c7adf041b07a1d4e8bdc24ef7588) [#5318](https://github.com/npm/cli/pull/5318) deps: `normalize-package-data@4.0.1` + * [`7d564bd`](https://github.com/npm/cli/commit/7d564bd73bcac909a922d88986e3a55fe343ca44) [#5318](https://github.com/npm/cli/pull/5318) deps: `make-fetch-happen@10.2.1` + * [`5a56686`](https://github.com/npm/cli/commit/5a566863ca96f641fcecacd1ad20a7c837dccfeb) [#5318](https://github.com/npm/cli/pull/5318) deps: `@npmcli/git@3.0.2` + * [`3c5a866`](https://github.com/npm/cli/commit/3c5a866cc6e58e660a0aedb8ce6fec258e523a21) [#5318](https://github.com/npm/cli/pull/5318) deps: `bin-links@3.0.2` + * [`07536a4`](https://github.com/npm/cli/commit/07536a4be30ac3305fe4827335d621387bae3ca7) [#5318](https://github.com/npm/cli/pull/5318) deps: `@npmcli/fs@2.1.2` + * [`8165501`](https://github.com/npm/cli/commit/81655017172eaedd346b3efe63c5975c803c82b4) [#5318](https://github.com/npm/cli/pull/5318) deps: `@npmcli/move-file@2.0.1` + * [`cbee638`](https://github.com/npm/cli/commit/cbee6385a3231ea9ba02aa23d9dd110ba369217b) [#5318](https://github.com/npm/cli/pull/5318) deps: `cacache@16.1.2` + * [`1f6daf5`](https://github.com/npm/cli/commit/1f6daf5b9df054952a47df01780039bd5da8f024) [#5318](https://github.com/npm/cli/pull/5318) deps: `write-file-atomic@4.0.2` + * [`409468f`](https://github.com/npm/cli/commit/409468f25e783d0941e76c7a9a64a751a574176b) [#5318](https://github.com/npm/cli/pull/5318) deps: `minipass-fetch@2.1.1` + ## v8.17.0 (2022-08-10) ### Features From 141faf0c19eae382d0e19833129f5545fc2355c8 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:51:47 -0700 Subject: [PATCH 075/175] chore: update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index fb7d537fd4d29..c8c2d12543d7e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -847,3 +847,4 @@ Patryk Ludwikowski Takuya N Neel Dani Anton Rieder <1301152+aried3r@users.noreply.github.com> +William Marlow From c383564213c709aa9d82aeb21333516fc78d5165 Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Wed, 17 Aug 2022 12:51:47 -0700 Subject: [PATCH 076/175] 8.18.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba7a51e0a872f..613148fdaea98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "8.17.0", + "version": "8.18.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "npm", - "version": "8.17.0", + "version": "8.18.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", diff --git a/package.json b/package.json index 49ddfa179b0cf..f631c9f0683b2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.17.0", + "version": "8.18.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ From 8ab12dc32b26db770b868cf694cedab38f4e7460 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 27 Jul 2022 14:59:47 -0700 Subject: [PATCH 077/175] deps: @npmcli/eslint-config@3.1.0 --- docs/package.json | 2 +- node_modules/.gitignore | 21 + package-lock.json | 585 ++++++++++++++++++++++---- package.json | 2 +- smoke-tests/package.json | 2 +- workspaces/arborist/package.json | 2 +- workspaces/libnpmaccess/package.json | 2 +- workspaces/libnpmdiff/package.json | 2 +- workspaces/libnpmexec/package.json | 2 +- workspaces/libnpmfund/package.json | 2 +- workspaces/libnpmhook/package.json | 2 +- workspaces/libnpmorg/package.json | 2 +- workspaces/libnpmpack/package.json | 2 +- workspaces/libnpmpublish/package.json | 2 +- workspaces/libnpmsearch/package.json | 2 +- workspaces/libnpmteam/package.json | 2 +- workspaces/libnpmversion/package.json | 2 +- 17 files changed, 539 insertions(+), 97 deletions(-) diff --git a/docs/package.json b/docs/package.json index ba913b1ea6844..98fe8becd8318 100644 --- a/docs/package.json +++ b/docs/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@mdx-js/mdx": "^1.6.22", - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", diff --git a/node_modules/.gitignore b/node_modules/.gitignore index aa43a2716ee15..bf2a67651159b 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -59,6 +59,7 @@ __pycache__ /@npmcli/eslint-config /@npmcli/template-oss /@types/hast +/@types/json5 /@types/mdast /@types/parse5 /@types/unist @@ -73,6 +74,8 @@ __pycache__ /arg /argparse /array-find-index +/array-includes +/array.prototype.flat /asn1 /assert-plus /async-hook-domain @@ -137,13 +140,18 @@ __pycache__ /ecc-jsbn /end-of-stream /es-abstract +/es-shim-unscopables /es-to-primitive /es6-error /escape-string-regexp /escodegen /eslint +/eslint-import-resolver-node +/eslint-module-utils /eslint-plugin-es +/eslint-plugin-import /eslint-plugin-node +/eslint-plugin-promise /eslint-scope /eslint-utils /eslint-visitor-keys @@ -164,6 +172,7 @@ __pycache__ /file-uri-to-path /fill-range /find-cache-dir +/find-up /findit /flat-cache /flatted @@ -178,7 +187,9 @@ __pycache__ /fs-exists-cached /fsevents /function-loop +/function.prototype.name /functional-red-black-tree +/functions-have-names /gensync /get-caller-file /get-intrinsic @@ -192,6 +203,7 @@ __pycache__ /har-schema /har-validator /has-bigints +/has-property-descriptors /has-symbols /has-tostringtag /hasha @@ -263,6 +275,7 @@ __pycache__ /levn /libtap /licensee +/locate-path /lodash /lodash.clonedeep /lodash.flattendeep @@ -304,13 +317,18 @@ __pycache__ /object-keys /object.assign /object.getownpropertydescriptors +/object.values /optionator /own-or /own-or-env +/p-limit +/p-locate +/p-try /package-hash /parent-module /parse-entities /parse5 +/path-exists /path-key /path-parse /performance-now @@ -331,6 +349,7 @@ __pycache__ /rc /read-package-tree /readdirp +/regexp.prototype.flags /regexpp /release-zalgo /remark-footnotes @@ -368,6 +387,7 @@ __pycache__ /state-toggle /string.prototype.trimend /string.prototype.trimstart +/strip-bom /strip-json-comments /style-to-object /supports-preserve-symlinks-flag @@ -389,6 +409,7 @@ __pycache__ /trivial-deferred /trough /ts-node +/tsconfig-paths /tunnel-agent /tweetnacl /type-check diff --git a/package-lock.json b/package-lock.json index 613148fdaea98..44a4a360cba00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -164,7 +164,7 @@ "npx": "bin/npx-cli.js" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "licensee": "^8.2.0", "nock": "^13.2.4", @@ -180,7 +180,7 @@ "license": "ISC", "devDependencies": { "@mdx-js/mdx": "^1.6.22", - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", @@ -578,19 +578,20 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.2.1", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.3.2", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { @@ -599,8 +600,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0", "peer": true }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { @@ -615,9 +617,10 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.13.0", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "type-fest": "^0.20.2" @@ -631,8 +634,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "argparse": "^2.0.1" @@ -656,8 +660,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "peer": true, "engines": { "node": ">=10" @@ -897,9 +902,9 @@ } }, "node_modules/@npmcli/eslint-config": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/eslint-config/-/eslint-config-3.0.1.tgz", - "integrity": "sha512-a5tr7iOeVePL/GOZyFNbG0+dUH0H2QYHmrRGCOE7y+qA7OrMDDOiHe/Wt1PiSDo+Y9IxNKuxhj6TY01Hq56QKg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/eslint-config/-/eslint-config-3.1.0.tgz", + "integrity": "sha512-t+FYG0KSpEAfz7CUHW/S2V/01bRuFCXmBxRBrhV9mp01qFXtrKa3IgBhmxM0uQ18v2YBT4+5r4P/Xn3mxB33IA==", "dev": true, "dependencies": { "which": "^2.0.2" @@ -908,11 +913,13 @@ "lint": "bin/index.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "peerDependencies": { - "eslint": ">= 8", - "eslint-plugin-node": "^11.1.0" + "eslint": "^8.13.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.0.0" } }, "node_modules/@npmcli/fs": { @@ -1128,6 +1135,13 @@ "@types/unist": "*" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "peer": true + }, "node_modules/@types/mdast": { "version": "3.0.10", "dev": true, @@ -1178,8 +1192,9 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -1336,6 +1351,45 @@ "node": ">=0.10.0" } }, + "node_modules/array-includes": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/asap": { "version": "2.0.6", "inBundle": true, @@ -1676,8 +1730,9 @@ }, "node_modules/callsites": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -2178,14 +2233,19 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, - "license": "MIT", "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/delayed-stream": { @@ -2330,30 +2390,34 @@ "license": "MIT" }, "node_modules/es-abstract": { - "version": "1.19.2", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2362,6 +2426,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "peer": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "dev": true, @@ -2472,12 +2546,13 @@ } }, "node_modules/eslint": { - "version": "8.12.0", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz", + "integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { - "@eslint/eslintrc": "^1.2.1", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -2488,14 +2563,14 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -2504,7 +2579,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -2523,6 +2598,51 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "dev": true, + "peer": true, + "dependencies": { + "debug": "^3.2.7", + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, "node_modules/eslint-plugin-es": { "version": "3.0.1", "dev": true, @@ -2542,6 +2662,88 @@ "eslint": ">=4.19.1" } }, + "node_modules/eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "peer": true, + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "peer": true + }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "dev": true, @@ -2595,6 +2797,19 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-promise": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", + "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.1.1", "dev": true, @@ -2634,8 +2849,9 @@ }, "node_modules/eslint-visitor-keys": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, - "license": "Apache-2.0", "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2698,9 +2914,10 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.13.0", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "type-fest": "^0.20.2" @@ -2739,8 +2956,9 @@ }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "peer": true, "engines": { "node": ">=10" @@ -2750,13 +2968,14 @@ } }, "node_modules/espree": { - "version": "9.3.1", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, - "license": "BSD-2-Clause", "peer": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -2764,9 +2983,10 @@ } }, "node_modules/espree/node_modules/acorn": { - "version": "8.7.0", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true, - "license": "MIT", "peer": true, "bin": { "acorn": "bin/acorn" @@ -2996,6 +3216,19 @@ "node": ">=8" } }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/findit": { "version": "2.0.0", "dev": true, @@ -3163,12 +3396,39 @@ "integrity": "sha512-ktIR+O6i/4h+j/ZhZJNdzeI4i9lEPeEK6UPR2EVyTVBqOwcU3Za9xYKLH64ZR9HmcROyRrOkizNyjjtWJzDDkQ==", "dev": true }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "dev": true, "license": "MIT", "peer": true }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gauge": { "version": "4.0.4", "inBundle": true, @@ -3364,9 +3624,10 @@ } }, "node_modules/has-bigints": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3379,6 +3640,18 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "dev": true, @@ -3667,8 +3940,9 @@ }, "node_modules/import-fresh": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "parent-module": "^1.0.0", @@ -3799,8 +4073,9 @@ }, "node_modules/is-bigint": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -3821,8 +4096,9 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3974,9 +4250,10 @@ } }, "node_modules/is-number-object": { - "version": "1.0.6", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, - "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4016,9 +4293,13 @@ } }, "node_modules/is-shared-array-buffer": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, - "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -4562,6 +4843,20 @@ "semver": "bin/semver.js" } }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/lodash": { "version": "4.17.21", "dev": true, @@ -5522,6 +5817,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.values": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "inBundle": true, @@ -5570,6 +5883,32 @@ "own-or": "^1.0.0" } }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "peer": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -5585,6 +5924,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/package-hash": { "version": "4.0.0", "dev": true, @@ -5636,8 +5985,9 @@ }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "license": "MIT", "peer": true, "dependencies": { "callsites": "^3.0.0" @@ -5681,6 +6031,16 @@ "dev": true, "license": "MIT" }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "inBundle": true, @@ -6232,6 +6592,23 @@ "node": ">=8.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regexpp": { "version": "3.2.0", "dev": true, @@ -6435,8 +6812,9 @@ }, "node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=4" @@ -6923,24 +7301,28 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.4", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.4", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, - "license": "MIT", "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6957,10 +7339,21 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "license": "MIT", "peer": true, "engines": { "node": ">=8" @@ -9290,6 +9683,32 @@ "node": ">=0.3.1" } }, + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "peer": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "dev": true, @@ -9356,13 +9775,14 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, - "license": "MIT", "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { @@ -9763,8 +10183,9 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, - "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -10039,7 +10460,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", "minify-registry-metadata": "^2.2.0", @@ -10097,7 +10518,7 @@ "arborist": "bin/index.js" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", @@ -10120,7 +10541,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10143,7 +10564,7 @@ "tar": "^6.1.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, @@ -10171,7 +10592,7 @@ "walk-up-path": "^1.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", "tap": "^16.0.1" @@ -10187,7 +10608,7 @@ "@npmcli/arborist": "^5.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, @@ -10203,7 +10624,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10220,7 +10641,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "minipass": "^3.1.1", "nock": "^13.2.4", @@ -10239,7 +10660,7 @@ "pacote": "^13.6.1" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.0.7", "tap": "^16.0.1" @@ -10259,7 +10680,7 @@ "ssri": "^9.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", @@ -10277,7 +10698,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10294,7 +10715,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10314,7 +10735,7 @@ "semver": "^7.3.7" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "require-inject": "^1.4.4", "tap": "^16.0.1" diff --git a/package.json b/package.json index f631c9f0683b2..cb36e55f47593 100644 --- a/package.json +++ b/package.json @@ -201,7 +201,7 @@ "write-file-atomic" ], "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "licensee": "^8.2.0", "nock": "^13.2.4", diff --git a/smoke-tests/package.json b/smoke-tests/package.json index b06404681e347..40e794e82e03c 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -20,7 +20,7 @@ "directory": "smoke-tests" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", "minify-registry-metadata": "^2.2.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 86e36e486c880..124cb6650ce00 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -41,7 +41,7 @@ "walk-up-path": "^1.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 55ad695b29d1c..ca1ee7055b3ab 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -19,7 +19,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 814629dd2e295..d0e92f42c94f2 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -45,7 +45,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 4de7259071fd2..53fc335ed821f 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -49,7 +49,7 @@ "files": "test/*.js" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", "tap": "^16.0.1" diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 7dd3e1b648474..aa2186148e353 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -44,7 +44,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 2f76b52f8e1be..a26338262e96b 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -39,7 +39,7 @@ "npm-registry-fetch": "^13.0.0" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 280fa5339ca53..852aa69e3a3f3 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -30,7 +30,7 @@ "lib/" ], "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "minipass": "^3.1.1", "nock": "^13.2.4", diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 86bec9ff1d618..c1303e37eb8aa 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -25,7 +25,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.0.7", "tap": "^16.0.1" diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 9d1f9de5c5e20..c561b86b9ea71 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -27,7 +27,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index dc28a374b21ec..12b62afc91a14 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -28,7 +28,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 569678b5d864a..54fdab0a6c9b8 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -18,7 +18,7 @@ "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "nock": "^13.2.4", "tap": "^16.0.1" diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index c5c1a0398bb16..bf24cc3878ffe 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -30,7 +30,7 @@ "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", + "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "require-inject": "^1.4.4", "tap": "^16.0.1" From 3a212d7177bac622224175aac3e223bef1e447a6 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 07:15:35 -0700 Subject: [PATCH 078/175] chore: add fs-minipass to devDependencies It's used in tests so it needs to be in the manifest --- DEPENDENCIES.md | 2 ++ package-lock.json | 4 +++- package.json | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 92b0b85846804..c602e479ba1ad 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -86,6 +86,7 @@ graph LR; normalize-package-data-->semver; npm-->abbrev; npm-->cacache; + npm-->fs-minipass; npm-->hosted-git-info; npm-->ini; npm-->init-package-json; @@ -472,6 +473,7 @@ graph LR; npm-->columnify; npm-->docs; npm-->fastest-levenshtein; + npm-->fs-minipass; npm-->glob; npm-->graceful-fs; npm-->hosted-git-info; diff --git a/package-lock.json b/package-lock.json index 44a4a360cba00..e6c6ff741454f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -166,6 +166,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", + "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "nock": "^13.2.4", "spawk": "^1.7.1", @@ -3359,8 +3360,9 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "inBundle": true, - "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, diff --git a/package.json b/package.json index cb36e55f47593..f841d97497373 100644 --- a/package.json +++ b/package.json @@ -145,6 +145,7 @@ "cli-table3", "columnify", "fastest-levenshtein", + "fs-minipass", "glob", "graceful-fs", "hosted-git-info", @@ -203,6 +204,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", + "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "nock": "^13.2.4", "spawk": "^1.7.1", From 8c9b034cce69b2a9550dcd1d8b85ab08d54ecc61 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 07:17:06 -0700 Subject: [PATCH 079/175] chore: add @npmcli/promise-spawn to devDependencies It's used in tests so it needs to be in the manifest --- DEPENDENCIES.md | 2 ++ package-lock.json | 2 ++ package.json | 2 ++ 3 files changed, 6 insertions(+) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index c602e479ba1ad..9d7ff0e6e39b4 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -116,6 +116,7 @@ graph LR; npm-->npmcli-fs["@npmcli/fs"]; npm-->npmcli-map-workspaces["@npmcli/map-workspaces"]; npm-->npmcli-package-json["@npmcli/package-json"]; + npm-->npmcli-promise-spawn["@npmcli/promise-spawn"]; npm-->npmcli-run-script["@npmcli/run-script"]; npm-->npmcli-template-oss["@npmcli/template-oss"]; npm-->npmlog; @@ -517,6 +518,7 @@ graph LR; npm-->npmcli-fs["@npmcli/fs"]; npm-->npmcli-map-workspaces["@npmcli/map-workspaces"]; npm-->npmcli-package-json["@npmcli/package-json"]; + npm-->npmcli-promise-spawn["@npmcli/promise-spawn"]; npm-->npmcli-run-script["@npmcli/run-script"]; npm-->npmcli-template-oss["@npmcli/template-oss"]; npm-->npmlog; diff --git a/package-lock.json b/package-lock.json index e6c6ff741454f..51aa07ecce565 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "cli-table3", "columnify", "fastest-levenshtein", + "fs-minipass", "glob", "graceful-fs", "hosted-git-info", @@ -165,6 +166,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", + "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", diff --git a/package.json b/package.json index f841d97497373..4468123739551 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,7 @@ "@npmcli/fs", "@npmcli/map-workspaces", "@npmcli/package-json", + "@npmcli/promise-spawn", "@npmcli/run-script", "abbrev", "archy", @@ -203,6 +204,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.1.0", + "@npmcli/promise-spawn": "^3.0.0", "@npmcli/template-oss": "3.5.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", From 159ae355bae1b41be4d904663caa7ae5a3e57d90 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 07:17:57 -0700 Subject: [PATCH 080/175] chore: add minimatch to devDependencies It's used in tests so it needs to be in the manifest --- DEPENDENCIES.md | 1 + package-lock.json | 1 + package.json | 2 ++ 3 files changed, 4 insertions(+) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 9d7ff0e6e39b4..4bc47e3225c13 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -496,6 +496,7 @@ graph LR; npm-->libnpmversion; npm-->licensee; npm-->make-fetch-happen; + npm-->minimatch; npm-->minipass-pipeline; npm-->minipass; npm-->mkdirp-infer-owner; diff --git a/package-lock.json b/package-lock.json index 51aa07ecce565..91106377523a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -170,6 +170,7 @@ "@npmcli/template-oss": "3.5.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", + "minimatch": "^5.1.0", "nock": "^13.2.4", "spawk": "^1.7.1", "tap": "^16.0.1" diff --git a/package.json b/package.json index 4468123739551..e86e488926e04 100644 --- a/package.json +++ b/package.json @@ -166,6 +166,7 @@ "libnpmteam", "libnpmversion", "make-fetch-happen", + "minimatch", "minipass", "minipass-pipeline", "mkdirp", @@ -208,6 +209,7 @@ "@npmcli/template-oss": "3.5.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", + "minimatch": "^5.1.0", "nock": "^13.2.4", "spawk": "^1.7.1", "tap": "^16.0.1" From a33d774e00c3b2cf4613e1ed4649d6a6d1bfda87 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 07:54:07 -0700 Subject: [PATCH 081/175] chore: add mkdirp to devDependencies It's used it tests --- DEPENDENCIES.md | 1 + package-lock.json | 4 +++- workspaces/libnpmexec/package.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 4bc47e3225c13..76cd12965802e 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -345,6 +345,7 @@ graph LR; libnpmexec-->bin-links; libnpmexec-->chalk; libnpmexec-->mkdirp-infer-owner; + libnpmexec-->mkdirp; libnpmexec-->npm-package-arg; libnpmexec-->npmcli-arborist["@npmcli/arborist"]; libnpmexec-->npmcli-ci-detect["@npmcli/ci-detect"]; diff --git a/package-lock.json b/package-lock.json index 91106377523a3..bd96bd7bf8fd3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5191,8 +5191,9 @@ }, "node_modules/mkdirp": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "inBundle": true, - "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -10600,6 +10601,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", + "mkdirp": "^1.0.4", "tap": "^16.0.1" }, "engines": { diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 53fc335ed821f..b59d296c57ff5 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -52,6 +52,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", + "mkdirp": "^1.0.4", "tap": "^16.0.1" }, "dependencies": { From 897d2183d4ba1223e1084b9d574b7afa9cc9cd46 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 07:57:16 -0700 Subject: [PATCH 082/175] chore: add minify-registry-metadata to devDependencies It's used in tests --- DEPENDENCIES.md | 1 + package-lock.json | 8 ++++++-- workspaces/libnpmexec/package.json | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 76cd12965802e..1ddd85b3d411d 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -344,6 +344,7 @@ graph LR; libnpmdiff-->tar; libnpmexec-->bin-links; libnpmexec-->chalk; + libnpmexec-->minify-registry-metadata; libnpmexec-->mkdirp-infer-owner; libnpmexec-->mkdirp; libnpmexec-->npm-package-arg; diff --git a/package-lock.json b/package-lock.json index bd96bd7bf8fd3..ce443bce578ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@npmcli/fs", "@npmcli/map-workspaces", "@npmcli/package-json", + "@npmcli/promise-spawn", "@npmcli/run-script", "abbrev", "archy", @@ -45,6 +46,7 @@ "libnpmteam", "libnpmversion", "make-fetch-happen", + "minimatch", "minipass", "minipass-pipeline", "mkdirp", @@ -5075,8 +5077,9 @@ }, "node_modules/minify-registry-metadata": { "version": "2.2.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/minify-registry-metadata/-/minify-registry-metadata-2.2.0.tgz", + "integrity": "sha512-kBVcTfDnYx9nL1U+6l6drCrZHPlkEoniLLud//nXxXvJAx0D7P4IHU2vkcCrLozoAPomiIX/CzaEXFm1CmT/8A==", + "dev": true }, "node_modules/minimatch": { "version": "5.1.0", @@ -10601,6 +10604,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", + "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", "tap": "^16.0.1" }, diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index b59d296c57ff5..e7640d66f0999 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -52,6 +52,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", "bin-links": "^3.0.0", + "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", "tap": "^16.0.1" }, From d54f03132a5e8247cdd8a3c165669477e95980fb Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 08:01:06 -0700 Subject: [PATCH 083/175] chore: linting In preparation for @npmcli/eslint-config@3.1.0 --- scripts/bundle-and-gitignore-deps.js | 3 + workspaces/libnpmaccess/test/index.js | 267 +++++++++-------------- workspaces/libnpmdiff/test/tarball.js | 33 ++- workspaces/libnpmexec/test/run-script.js | 22 +- workspaces/libnpmorg/test/index.js | 62 ++---- workspaces/libnpmsearch/test/index.js | 140 ++++++------ workspaces/libnpmteam/test/index.js | 179 ++++++--------- 7 files changed, 278 insertions(+), 428 deletions(-) diff --git a/scripts/bundle-and-gitignore-deps.js b/scripts/bundle-and-gitignore-deps.js index 93d8d89617eb4..cdfa0c3bcff3b 100644 --- a/scripts/bundle-and-gitignore-deps.js +++ b/scripts/bundle-and-gitignore-deps.js @@ -8,7 +8,10 @@ const bundle = [] const arb = new Arborist({ path: resolve(__dirname, '..') }) const shouldIgnore = [] +// disabling to get linting to pass, this file is going away soon +// eslint-disable-next-line arb.loadVirtual().then(tree => { + // eslint-disable-next-line for (const node of tree.children.values()) { const has = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) const nonProdWorkspace = diff --git a/workspaces/libnpmaccess/test/index.js b/workspaces/libnpmaccess/test/index.js index 7417ab56233c3..689788d5269f7 100644 --- a/workspaces/libnpmaccess/test/index.js +++ b/workspaces/libnpmaccess/test/index.js @@ -10,127 +10,96 @@ const OPTS = { registry: REG, } -t.test('access public', t => { +t.test('access public', async t => { tnock(t, REG).post( '/-/package/%40foo%2Fbar/access', { access: 'public' } ).reply(200) - return access.public('@foo/bar', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.public('@foo/bar', OPTS)) }) -t.test('access public - failure', t => { +t.test('access public - failure', async t => { tnock(t, REG).post( '/-/package/%40foo%2Fbar/access', { access: 'public' } ).reply(418) - return access.public('@foo/bar', OPTS) - .catch(err => { - t.equal(err.statusCode, 418, 'fails with code from registry') - }) + await t.rejects( + access.public('@foo/bar', OPTS), + { statusCode: 418 }, + 'fails with code from registry' + ) }) -t.test('access restricted', t => { +t.test('access restricted', async t => { tnock(t, REG).post( '/-/package/%40foo%2Fbar/access', { access: 'restricted' } ).reply(200) - return access.restricted('@foo/bar', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.restricted('@foo/bar', OPTS)) }) -t.test('access restricted - failure', t => { +t.test('access restricted - failure', async t => { tnock(t, REG).post( '/-/package/%40foo%2Fbar/access', { access: 'restricted' } ).reply(418) - return access.restricted('@foo/bar', OPTS) - .catch(err => { - t.equal(err.statusCode, 418, 'fails with code from registry') - }) + await t.rejects( + access.restricted('@foo/bar', OPTS), + { statusCode: 418 }, + 'fails with code from registry') }) -t.test('access 2fa-required', t => { +t.test('access 2fa-required', async t => { tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { publish_requires_tfa: true, }).reply(200, { ok: true }) - return access.tfaRequired('@foo/bar', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.tfaRequired('@foo/bar', OPTS)) }) -t.test('access 2fa-not-required', t => { +t.test('access 2fa-not-required', async t => { tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { publish_requires_tfa: false, }).reply(200, { ok: true }) - return access.tfaNotRequired('@foo/bar', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.tfaNotRequired('@foo/bar', OPTS)) }) -t.test('access grant basic read-write', t => { +t.test('access grant basic read-write', async t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: '@foo/bar', permissions: 'read-write', }).reply(201) - return access.grant( - '@foo/bar', 'myorg:myteam', 'read-write', OPTS - ).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.grant('@foo/bar', 'myorg:myteam', 'read-write', OPTS)) }) -t.test('access grant basic read-only', t => { +t.test('access grant basic read-only', async t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: '@foo/bar', permissions: 'read-only', }).reply(201) - return access.grant( - '@foo/bar', 'myorg:myteam', 'read-only', OPTS - ).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.grant('@foo/bar', 'myorg:myteam', 'read-only', OPTS)) }) -t.test('access grant bad perm', t => { - return access.grant( - '@foo/bar', 'myorg:myteam', 'unknown', OPTS - ).then(ret => { - throw new Error('should not have succeeded') - }, err => { - t.match( - err.message, - /must be.*read-write.*read-only/, - 'only read-write and read-only are accepted' - ) - }) +t.test('access grant bad perm', async t => { + await t.rejects( + access.grant('@foo/bar', 'myorg:myteam', 'unknown', OPTS), + { message: /must be.*read-write.*read-only/ }, + 'only read-write and read-only are accepted' + ) }) -t.test('access grant no entity', t => { - return access.grant( - '@foo/bar', undefined, 'read-write', OPTS - ).then(ret => { - throw new Error('should not have succeeded') - }, err => { - t.match( - err.message, - /Expected string/, - 'passing undefined entity gives useful error' - ) - }) +t.test('access grant no entity', async t => { + await t.rejects( + access.grant('@foo/bar', undefined, 'read-write', OPTS), + { message: /Expected string/ }, + 'passing undefined entity gives useful error' + ) }) -t.test('access grant basic unscoped', t => { +t.test('access grant basic unscoped', async t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: 'bar', permissions: 'read-write', }).reply(201) - return access.grant( - 'bar', 'myorg:myteam', 'read-write', OPTS - ).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.grant('bar', 'myorg:myteam', 'read-write', OPTS)) }) -t.test('access grant no opts passed', t => { +t.test('access grant no opts passed', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url tnock(t, 'https://registry.npmjs.org') @@ -139,31 +108,24 @@ t.test('access grant no opts passed', t => { permissions: 'read-write', }) .reply(201) - return access.grant('bar', 'myorg:myteam', 'read-write') - .then(ret => { - t.equal(ret, true, 'request succeeded') - }) + await t.resolves(access.grant('bar', 'myorg:myteam', 'read-write')) }) -t.test('access revoke basic', t => { +t.test('access revoke basic', async t => { tnock(t, REG).delete('/-/team/myorg/myteam/package', { package: '@foo/bar', }).reply(200) - return access.revoke('@foo/bar', 'myorg:myteam', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.revoke('@foo/bar', 'myorg:myteam', OPTS)) }) -t.test('access revoke basic unscoped', t => { +t.test('access revoke basic unscoped', async t => { tnock(t, REG).delete('/-/team/myorg/myteam/package', { package: 'bar', }).reply(200, { accessChanged: true }) - return access.revoke('bar', 'myorg:myteam', OPTS).then(ret => { - t.same(ret, true, 'request succeeded') - }) + await t.resolves(access.revoke('bar', 'myorg:myteam', OPTS)) }) -t.test('access revoke no opts passed', t => { +t.test('access revoke no opts passed', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url tnock(t, 'https://registry.npmjs.org') @@ -171,13 +133,10 @@ t.test('access revoke no opts passed', t => { package: 'bar', }) .reply(201) - return access.revoke('bar', 'myorg:myteam') - .then(ret => { - t.equal(ret, true, 'request succeeded') - }) + await t.resolves(access.revoke('bar', 'myorg:myteam')) }) -t.test('ls-packages on team', t => { +t.test('ls-packages on team', async t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -191,12 +150,11 @@ t.test('ls-packages on team', t => { tnock(t, REG).get( '/-/team/myorg/myteam/package?format=cli' ).reply(200, serverPackages) - return access.lsPackages('myorg:myteam', OPTS).then(data => { - t.same(data, clientPackages, 'got client package info') - }) + const data = await access.lsPackages('myorg:myteam', OPTS) + t.same(data, clientPackages, 'got client package info') }) -t.test('ls-packages on org', t => { +t.test('ls-packages on org', async t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -210,12 +168,11 @@ t.test('ls-packages on org', t => { tnock(t, REG).get( '/-/org/myorg/package?format=cli' ).reply(200, serverPackages) - return access.lsPackages('myorg', OPTS).then(data => { - t.same(data, clientPackages, 'got client package info') - }) + const data = await access.lsPackages('myorg', OPTS) + t.same(data, clientPackages, 'got client package info') }) -t.test('ls-packages on user', t => { +t.test('ls-packages on user', async t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -229,43 +186,39 @@ t.test('ls-packages on user', t => { const srv = tnock(t, REG) srv.get('/-/org/myuser/package?format=cli').reply(404, { error: 'not found' }) srv.get('/-/user/myuser/package?format=cli').reply(200, serverPackages) - return access.lsPackages('myuser', OPTS).then(data => { - t.same(data, clientPackages, 'got client package info') - }) + const data = await access.lsPackages('myuser', OPTS) + t.same(data, clientPackages, 'got client package info') }) -t.test('ls-packages error on team', t => { +t.test('ls-packages error on team', async t => { tnock(t, REG).get('/-/team/myorg/myteam/package?format=cli').reply(404) - return access.lsPackages('myorg:myteam', OPTS).then( - () => { - throw new Error('should not have succeeded') - }, - err => t.equal(err.code, 'E404', 'spit out 404 directly if team provided') + await t.rejects( + access.lsPackages('myorg:myteam', OPTS), + { code: 'E404' }, + 'spit out 404 directly if team provided' ) }) -t.test('ls-packages error on user', t => { +t.test('ls-packages error on user', async t => { const srv = tnock(t, REG) srv.get('/-/org/myuser/package?format=cli').reply(404, { error: 'not found' }) srv.get('/-/user/myuser/package?format=cli').reply(404, { error: 'not found' }) - return access.lsPackages('myuser', OPTS).then( - () => { - throw new Error('should not have succeeded') - }, - err => t.equal(err.code, 'E404', 'spit out 404 if both reqs fail') + await t.rejects( + access.lsPackages('myuser', OPTS), + { code: 'E404' }, + 'spit out 404 if both reqs fail' ) }) -t.test('ls-packages bad response', t => { +t.test('ls-packages bad response', async t => { tnock(t, REG).get( '/-/team/myorg/myteam/package?format=cli' ).reply(200, JSON.stringify(null)) - return access.lsPackages('myorg:myteam', OPTS).then(data => { - t.same(data, null, 'succeeds with null') - }) + const data = await access.lsPackages('myorg:myteam', OPTS) + t.same(data, null, 'succeeds with null') }) -t.test('ls-packages stream', t => { +t.test('ls-packages stream', async t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -279,14 +232,11 @@ t.test('ls-packages stream', t => { tnock(t, REG).get( '/-/team/myorg/myteam/package?format=cli' ).reply(200, serverPackages) - return access.lsPackages.stream('myorg:myteam', OPTS) - .collect() - .then(data => { - t.same(data, clientPackages, 'got streamed client package info') - }) + const data = await access.lsPackages.stream('myorg:myteam', OPTS).collect() + t.same(data, clientPackages, 'got streamed client package info') }) -t.test('ls-packages stream no opts', t => { +t.test('ls-packages stream no opts', async t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -302,14 +252,11 @@ t.test('ls-packages stream no opts', t => { tnock(t, 'https://registry.npmjs.org') .get('/-/team/myorg/myteam/package?format=cli') .reply(200, serverPackages) - return access.lsPackages.stream('myorg:myteam') - .collect() - .then(data => { - t.same(data, clientPackages, 'got streamed client package info') - }) + const data = await access.lsPackages.stream('myorg:myteam').collect() + t.same(data, clientPackages, 'got streamed client package info') }) -t.test('ls-collaborators', t => { +t.test('ls-collaborators', async t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -323,12 +270,11 @@ t.test('ls-collaborators', t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli' ).reply(200, serverCollaborators) - return access.lsCollaborators('@foo/bar', OPTS).then(data => { - t.same(data, clientCollaborators, 'got collaborators') - }) + const data = await access.lsCollaborators('@foo/bar', OPTS) + t.same(data, clientCollaborators, 'got collaborators') }) -t.test('ls-collaborators stream', t => { +t.test('ls-collaborators stream', async t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -342,14 +288,11 @@ t.test('ls-collaborators stream', t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli' ).reply(200, serverCollaborators) - return access.lsCollaborators.stream('@foo/bar', OPTS) - .collect() - .then(data => { - t.same(data, clientCollaborators, 'got collaborators') - }) + const data = await access.lsCollaborators.stream('@foo/bar', OPTS).collect() + t.same(data, clientCollaborators, 'got collaborators') }) -t.test('ls-collaborators w/scope', t => { +t.test('ls-collaborators w/scope', async t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -363,12 +306,11 @@ t.test('ls-collaborators w/scope', t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli&user=zkat' ).reply(200, serverCollaborators) - return access.lsCollaborators('@foo/bar', 'zkat', OPTS).then(data => { - t.same(data, clientCollaborators, 'got collaborators') - }) + const data = await access.lsCollaborators('@foo/bar', 'zkat', OPTS) + t.same(data, clientCollaborators, 'got collaborators') }) -t.test('ls-collaborators w/o scope', t => { +t.test('ls-collaborators w/o scope', async t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -382,36 +324,33 @@ t.test('ls-collaborators w/o scope', t => { tnock(t, REG).get( '/-/package/bar/collaborators?format=cli&user=zkat' ).reply(200, serverCollaborators) - return access.lsCollaborators('bar', 'zkat', OPTS).then(data => { - t.same(data, clientCollaborators, 'got collaborators') - }) + const data = await access.lsCollaborators('bar', 'zkat', OPTS) + t.same(data, clientCollaborators, 'got collaborators') }) -t.test('ls-collaborators bad response', t => { +t.test('ls-collaborators bad response', async t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli' ).reply(200, JSON.stringify(null)) - return access.lsCollaborators('@foo/bar', null, OPTS).then(data => { - t.same(data, null, 'succeeds with null') - }) + const data = await access.lsCollaborators('@foo/bar', null, OPTS) + t.same(data, null, 'succeeds with null') }) -t.test('error on non-registry specs', t => { - const resolve = () => { - throw new Error('should not succeed') - } - const reject = err => t.match( - err.message, /spec.*must be a registry spec/, 'registry spec required' - ) - return Promise.all([ - access.public('githubusername/reponame').then(resolve, reject), - access.restricted('foo/bar').then(resolve, reject), - access.grant('foo/bar', 'myorg', 'myteam', 'read-only').then(resolve, reject), - access.revoke('foo/bar', 'myorg', 'myteam').then(resolve, reject), - access.lsCollaborators('foo/bar').then(resolve, reject), - access.tfaRequired('foo/bar').then(resolve, reject), - access.tfaNotRequired('foo/bar').then(resolve, reject), - ]) +t.test('error on non-registry specs', async t => { + await t.rejects(access.public('githubusername/reponame'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.restricted('foo/bar'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.grant('foo/bar', 'myorg', 'myteam', 'read-only'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.revoke('foo/bar', 'myorg', 'myteam'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.lsCollaborators('foo/bar'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.tfaRequired('foo/bar'), + /spec.*must be a registry spec/, 'registry spec required') + await t.rejects(access.tfaNotRequired('foo/bar'), + /spec.*must be a registry spec/, 'registry spec required') }) t.test('edit', t => { diff --git a/workspaces/libnpmdiff/test/tarball.js b/workspaces/libnpmdiff/test/tarball.js index b0a507c84cdd1..cb61556286879 100644 --- a/workspaces/libnpmdiff/test/tarball.js +++ b/workspaces/libnpmdiff/test/tarball.js @@ -11,7 +11,7 @@ const tarball = require('../lib/tarball.js') const json = (obj) => `${JSON.stringify(obj, null, 2)}\n` -t.test('returns a tarball from node_modules', t => { +t.test('returns a tarball from node_modules', async t => { t.plan(2) const path = t.testdir({ @@ -33,22 +33,21 @@ t.test('returns a tarball from node_modules', t => { process.chdir(_cwd) }) - tarball({ bin: { a: 'index.js' }, _resolved: resolve(path, 'node_modules/a') }, { where: path }) - .then(res => { - tar.list({ - filter: p => { - t.match( - p, - /package.json|index.js/, - 'should return tarball with expected files' - ) - }, - }) - .on('error', e => { - throw e - }) - .end(res) - }) + const res = await tarball( + { bin: { a: 'index.js' }, _resolved: resolve(path, 'node_modules/a') }, + { where: path } + ) + tar.list({ + filter: p => { + t.match( + p, + /package.json|index.js/, + 'should return tarball with expected files' + ) + }, + }).on('error', e => { + throw e + }).end(res) }) t.test('node_modules folder within a linked dir', async t => { diff --git a/workspaces/libnpmexec/test/run-script.js b/workspaces/libnpmexec/test/run-script.js index 9e0db1367fed1..40b31ebdf2b19 100644 --- a/workspaces/libnpmexec/test/run-script.js +++ b/workspaces/libnpmexec/test/run-script.js @@ -55,7 +55,7 @@ t.test('no package.json', t => { runScript(baseOpts) }) -t.test('colorized interactive mode msg', t => { +t.test('colorized interactive mode msg', async t => { t.plan(2) const runScript = t.mock('../lib/run-script.js', { @@ -67,7 +67,7 @@ t.test('colorized interactive mode msg', t => { }) const OUTPUT = [] - runScript({ + await runScript({ ...baseOpts, output: msg => { OUTPUT.push(msg) @@ -75,15 +75,10 @@ t.test('colorized interactive mode msg', t => { runPath: '/foo/', color: true, }) - .then(() => { - t.matchSnapshot(OUTPUT.join('\n'), 'should print colorized output') - }) - .catch(err => { - throw err - }) + t.matchSnapshot(OUTPUT.join('\n'), 'should print colorized output') }) -t.test('no color interactive mode msg', t => { +t.test('no color interactive mode msg', async t => { t.plan(2) const runScript = t.mock('../lib/run-script.js', { @@ -95,19 +90,14 @@ t.test('no color interactive mode msg', t => { }) const OUTPUT = [] - runScript({ + await runScript({ ...baseOpts, output: msg => { OUTPUT.push(msg) }, runPath: '/foo/', }) - .then(() => { - t.matchSnapshot(OUTPUT.join('\n'), 'should print non-colorized output') - }) - .catch(err => { - throw err - }) + t.matchSnapshot(OUTPUT.join('\n'), 'should print non-colorized output') }) t.test('no tty', t => { diff --git a/workspaces/libnpmorg/test/index.js b/workspaces/libnpmorg/test/index.js index ecdda07c06aca..bbe4ff4fcd02a 100644 --- a/workspaces/libnpmorg/test/index.js +++ b/workspaces/libnpmorg/test/index.js @@ -11,7 +11,7 @@ const OPTS = { } const REG = 'https://registry.npmjs.org/' -test('set', t => { +test('set', async t => { const memDeets = { org: { name: 'myorg', @@ -27,13 +27,11 @@ test('set', t => { }) .reply(201, memDeets) - return org.set('myorg', 'myuser', 'admin', OPTS) - .then(res => { - t.same(res, memDeets, 'got a membership details object back') - }) + const res = await org.set('myorg', 'myuser', 'admin', OPTS) + t.same(res, memDeets, 'got a membership details object back') }) -test('optional role for set', t => { +test('optional role for set', async t => { const memDeets = { org: { name: 'myorg', @@ -45,57 +43,48 @@ test('optional role for set', t => { tnock(t, OPTS.registry).put('/-/org/myorg/user', { user: 'myuser', }).reply(201, memDeets) - return org.set('myorg', 'myuser', OPTS).then(res => { - t.same(res, memDeets, 'got a membership details object back') - }) + const res = await org.set('myorg', 'myuser', OPTS) + t.same(res, memDeets, 'got a membership details object back') }) -test('rm with no options', t => { +test('rm with no options', async t => { tnock(t, REG).delete('/-/org/myorg/user', { user: 'myuser', }).reply(204) - return org.rm('myorg', 'myuser').then(() => { - t.ok(true, 'request succeeded') - }) + await t.resolves(org.rm('myorg', 'myuser')) }) -test('rm', t => { +test('rm', async t => { tnock(t, OPTS.registry).delete('/-/org/myorg/user', { user: 'myuser', }).reply(204) - return org.rm('myorg', 'myuser', OPTS) - .then(ret => { - t.equal(ret, null, 'null return value') - t.ok(true, 'request succeeded') - }) + const ret = await org.rm('myorg', 'myuser', OPTS) + t.equal(ret, null, 'null return value') }) -test('ls with no options', t => { +test('ls with no options', async t => { const roster = { zkat: 'developer', iarna: 'admin', isaacs: 'owner', } tnock(t, REG).get('/-/org/myorg/user').reply(200, roster) - return org.ls('myorg').then(res => { - t.same(res, roster, 'got back a roster') - }) + const res = await org.ls('myorg') + t.same(res, roster, 'got back a roster') }) -test('ls', t => { +test('ls', async t => { const roster = { zkat: 'developer', iarna: 'admin', isaacs: 'owner', } tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) - return org.ls('myorg', OPTS).then(res => { - t.same(res, roster, 'got back a roster') - }) + const res = await org.ls('myorg', OPTS) + t.same(res, roster, 'got back a roster') }) -test('ls stream with no options', t => { - t.plan(2) +test('ls stream with no options', async t => { const roster = { zkat: 'developer', iarna: 'admin', @@ -105,14 +94,11 @@ test('ls stream with no options', t => { tnock(t, REG).get('/-/org/myorg/user').reply(200, roster) const result = org.ls.stream('myorg') t.ok(Minipass.isStream(result), 'returns a stream') - return result.collect() - .then(res => { - t.same(res, rosterArr, 'got back a roster, in entries format') - }) + const res = await result.collect() + t.same(res, rosterArr, 'got back a roster, in entries format') }) -test('ls stream', t => { - t.plan(2) +test('ls stream', async t => { const roster = { zkat: 'developer', iarna: 'admin', @@ -122,8 +108,6 @@ test('ls stream', t => { tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) const result = org.ls.stream('myorg', OPTS) t.ok(Minipass.isStream(result), 'returns a stream') - return result.collect() - .then(res => { - t.same(res, rosterArr, 'got back a roster, in entries format') - }) + const res = await result.collect() + t.same(res, rosterArr, 'got back a roster, in entries format') }) diff --git a/workspaces/libnpmsearch/test/index.js b/workspaces/libnpmsearch/test/index.js index 8512ecb0f18f5..dd54949dae613 100644 --- a/workspaces/libnpmsearch/test/index.js +++ b/workspaces/libnpmsearch/test/index.js @@ -12,7 +12,7 @@ const REG = OPTS.registry const NPM_REG = 'https://registry.npmjs.org/' const search = require('../lib/index.js') -test('basic test no options', t => { +test('basic test no options', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -27,18 +27,17 @@ test('basic test no options', t => { { package: { name: 'foo', version: '2.0.0' } }, ], }) - return search('oo').then(results => { - t.match(results, [{ - name: 'cool', - version: '1.0.0', - }, { - name: 'foo', - version: '2.0.0', - }], 'got back an array of search results') - }) + const results = await search('oo') + t.match(results, [{ + name: 'cool', + version: '1.0.0', + }, { + name: 'foo', + version: '2.0.0', + }], 'got back an array of search results') }) -test('basic test', t => { +test('basic test', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -53,18 +52,17 @@ test('basic test', t => { { package: { name: 'foo', version: '2.0.0' } }, ], }) - return search('oo', OPTS).then(results => { - t.match(results, [{ - name: 'cool', - version: '1.0.0', - }, { - name: 'foo', - version: '2.0.0', - }], 'got back an array of search results') - }) + const results = await search('oo', OPTS) + t.match(results, [{ + name: 'cool', + version: '1.0.0', + }, { + name: 'foo', + version: '2.0.0', + }], 'got back an array of search results') }) -test('basic test supports nested options', t => { +test('basic test supports nested options', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -82,18 +80,17 @@ test('basic test supports nested options', t => { // this test is to ensure we don't break the nested opts parameter // that the cli supplies when a user passes --searchopts= - return search('oo', { ...OPTS, opts: { from: 1 } }).then(results => { - t.match(results, [{ - name: 'cool', - version: '1.0.0', - }, { - name: 'foo', - version: '2.0.0', - }], 'got back an array of search results') - }) + const results = await search('oo', { ...OPTS, opts: { from: 1 } }) + t.match(results, [{ + name: 'cool', + version: '1.0.0', + }, { + name: 'foo', + version: '2.0.0', + }], 'got back an array of search results') }) -test('search.stream', t => { +test('search.stream', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -108,18 +105,17 @@ test('search.stream', t => { { package: { name: 'foo', version: '2.0.0' } }, ], }) - return search.stream('oo', OPTS).collect().then(results => { - t.match(results, [{ - name: 'cool', - version: '1.0.0', - }, { - name: 'foo', - version: '2.0.0', - }], 'has a stream-based API function with identical results') - }) + const results = await search.stream('oo', OPTS).collect() + t.match(results, [{ + name: 'cool', + version: '1.0.0', + }, { + name: 'foo', + version: '2.0.0', + }], 'has a stream-based API function with identical results') }) -test('accepts a limit option', t => { +test('accepts a limit option', async t => { const query = qs.stringify({ text: 'oo', size: 3, @@ -136,12 +132,11 @@ test('accepts a limit option', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { ...OPTS, limit: 3 }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) + const results = await search('oo', { ...OPTS, limit: 3 }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('accepts a from option', t => { +test('accepts a from option', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -158,12 +153,11 @@ test('accepts a from option', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { ...OPTS, from: 1 }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) + const results = await search('oo', { ...OPTS, from: 1 }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('accepts quality/mainenance/popularity options', t => { +test('accepts quality/mainenance/popularity options', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -180,17 +174,16 @@ test('accepts quality/mainenance/popularity options', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { + const results = await search('oo', { ...OPTS, quality: 1, popularity: 2, maintenance: 3, - }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('sortBy: quality', t => { +test('sortBy: quality', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -207,15 +200,14 @@ test('sortBy: quality', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { + const results = await search('oo', { ...OPTS, sortBy: 'quality', - }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('sortBy: popularity', t => { +test('sortBy: popularity', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -232,15 +224,14 @@ test('sortBy: popularity', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { + const results = await search('oo', { ...OPTS, sortBy: 'popularity', - }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('sortBy: maintenance', t => { +test('sortBy: maintenance', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -257,15 +248,14 @@ test('sortBy: maintenance', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { + const results = await search('oo', { ...OPTS, sortBy: 'maintenance', - }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('sortBy: optimal', t => { +test('sortBy: optimal', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -282,15 +272,14 @@ test('sortBy: optimal', t => { { package: { name: 'cool', version: '1.0.0' } }, ], }) - return search('oo', { + const results = await search('oo', { ...OPTS, sortBy: 'optimal', - }).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') }) + t.equal(results.length, 4, 'returns more results if endpoint does so') }) -test('detailed format', t => { +test('detailed format', async t => { const query = qs.stringify({ text: 'oo', size: 20, @@ -328,16 +317,15 @@ test('detailed format', t => { tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { objects: results, }) - return search('oo', { + const res = await search('oo', { ...OPTS, sortBy: 'maintenance', detailed: true, - }).then(res => { - t.same(res, results, 'return full-format results with opts.detailed') }) + t.same(res, results, 'return full-format results with opts.detailed') }) -test('space-separates and URI-encodes multiple search params', t => { +test('space-separates and URI-encodes multiple search params', async t => { const query = qs.stringify({ text: 'foo bar:baz quux?=', size: 1, @@ -348,13 +336,11 @@ test('space-separates and URI-encodes multiple search params', t => { }).replace(/%20/g, '+') tnock(t, REG).get(`/-/v1/search?${query}`).reply(200, { objects: [] }) - return search(['foo', 'bar:baz', 'quux?='], { + await t.resolves(search(['foo', 'bar:baz', 'quux?='], { ...OPTS, limit: 1, quality: 1, popularity: 2, maintenance: 3, - }).then( - () => t.ok(true, 'sent parameters correctly urlencoded') - ) + })) }) diff --git a/workspaces/libnpmteam/test/index.js b/workspaces/libnpmteam/test/index.js index 6e0b92976a215..fd02666e014f6 100644 --- a/workspaces/libnpmteam/test/index.js +++ b/workspaces/libnpmteam/test/index.js @@ -10,249 +10,198 @@ const OPTS = { registry: REG, } -test('create', t => { +test('create', async t => { tnock(t, REG).put( '/-/org/foo/team', { name: 'cli' } ).reply(201, { name: 'cli' }) - return team.create('@foo:cli', OPTS).then(ret => { - t.same(ret, { name: 'cli' }, 'request succeeded') - }) + const ret = await team.create('@foo:cli', OPTS) + t.same(ret, { name: 'cli' }, 'request succeeded') }) -test('create - no options', t => { +test('create - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .put('/-/org/foo/team', { name: 'cli' }) .reply(201, { name: 'cli' }) - return team.create('@foo:cli') - .then(ret => { - t.same(ret, { name: 'cli' }) - }) + const ret = await team.create('@foo:cli') + t.same(ret, { name: 'cli' }) }) -test('create bad entity name', t => { - return team.create('go away', OPTS).then( - () => { - throw new Error('should not succeed') - }, - err => { - t.ok(err, 'error on bad entity name') - } - ) +test('create bad entity name', async t => { + await t.rejects(team.create('go away', OPTS)) }) -test('create empty entity', t => { - return team.create(undefined, OPTS).then( - () => { - throw new Error('should not succeed') - }, - err => { - t.ok(err, 'error on bad entity name') - } - ) +test('create empty entity', async t => { + await t.rejects(team.create(undefined, OPTS)) }) -test('create w/ description', t => { +test('create w/ description', async t => { tnock(t, REG).put('/-/org/foo/team', { name: 'cli', description: 'just some cool folx', }).reply(201, { name: 'cli' }) - return team.create('@foo:cli', { + const ret = await team.create('@foo:cli', { ...OPTS, description: 'just some cool folx', - }).then(ret => { - t.same(ret, { name: 'cli' }, 'no desc in return') }) + t.same(ret, { name: 'cli' }, 'no desc in return') }) -test('destroy', t => { +test('destroy', async t => { tnock(t, REG).delete( '/-/team/foo/cli' ).reply(204, {}) - return team.destroy('@foo:cli', OPTS).then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.destroy('@foo:cli', OPTS) + t.same(ret, {}, 'request succeeded') }) -test('destroy - no options', t => { +test('destroy - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .delete('/-/team/foo/cli') .reply(204, {}) - return team.destroy('@foo:cli').then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.destroy('@foo:cli') + t.same(ret, {}, 'request succeeded') }) -test('add', t => { +test('add', async t => { tnock(t, REG).put( '/-/team/foo/cli/user', { user: 'zkat' } ).reply(201, {}) - return team.add('zkat', '@foo:cli', OPTS).then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.add('zkat', '@foo:cli', OPTS) + t.same(ret, {}, 'request succeeded') }) -test('add - no options', t => { +test('add - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .put('/-/team/foo/cli/user', { user: 'zkat' }) .reply(201, {}) - return team.add('zkat', '@foo:cli').then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.add('zkat', '@foo:cli') + t.same(ret, {}, 'request succeeded') }) -test('rm', t => { +test('rm', async t => { tnock(t, REG).delete( '/-/team/foo/cli/user', { user: 'zkat' } ).reply(204, {}) - return team.rm('zkat', '@foo:cli', OPTS).then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.rm('zkat', '@foo:cli', OPTS) + t.same(ret, {}, 'request succeeded') }) -test('rm - no options', t => { +test('rm - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .delete('/-/team/foo/cli/user', { user: 'zkat' }) .reply(204, {}) - return team.rm('zkat', '@foo:cli').then(ret => { - t.same(ret, {}, 'request succeeded') - }) + const ret = await team.rm('zkat', '@foo:cli') + t.same(ret, {}, 'request succeeded') }) -test('lsTeams', t => { +test('lsTeams', async t => { tnock(t, REG).get( '/-/org/foo/team?format=cli' ).reply(200, ['foo:bar', 'foo:cli']) - return team.lsTeams('foo', OPTS).then(ret => { - t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) + const ret = await team.lsTeams('foo', OPTS) + t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') }) -test('lsTeams - no options', t => { +test('lsTeams - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .get('/-/org/foo/team?format=cli') .reply(200, ['foo:bar', 'foo:cli']) - return team.lsTeams('foo').then(ret => { - t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) + const ret = await team.lsTeams('foo') + t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') }) -test('lsTeams error', t => { +test('lsTeams error', async t => { tnock(t, REG).get( '/-/org/foo/team?format=cli' ).reply(500) - return team.lsTeams('foo', OPTS).then( - () => { - throw new Error('should not succeed') - }, - err => { - t.equal(err.code, 'E500', 'got error code') - } + await t.rejects( + team.lsTeams('foo', OPTS), + { code: 'E500' } ) }) -test('lsTeams.stream', t => { +test('lsTeams.stream', async t => { tnock(t, REG).get( '/-/org/foo/team?format=cli' ).reply(200, ['foo:bar', 'foo:cli']) - return team.lsTeams.stream('foo', OPTS) - .collect() - .then(ret => { - t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) + const ret = await team.lsTeams.stream('foo', OPTS).collect() + t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') }) -test('lsTeams.stream - no options', t => { +test('lsTeams.stream - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .get('/-/org/foo/team?format=cli') .reply(200, ['foo:bar', 'foo:cli']) - return team.lsTeams.stream('foo') - .collect() - .then(ret => { - t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) + const ret = await team.lsTeams.stream('foo').collect() + t.same(ret, ['foo:bar', 'foo:cli'], 'got teams') }) -test('lsUsers', t => { +test('lsUsers', async t => { tnock(t, REG).get( '/-/team/foo/cli/user?format=cli' ).reply(500) - return team.lsUsers('@foo:cli', OPTS).then( - () => { - throw new Error('should not succeed') - }, - err => { - t.equal(err.code, 'E500', 'got error code') - } + await t.rejects( + team.lsUsers('@foo:cli', OPTS), + { code: 'E500' } ) }) -test('lsUsers - no options', t => { +test('lsUsers - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .get('/-/team/foo/cli/user?format=cli') .reply(500) - return team.lsUsers('@foo:cli').then( - () => { - throw new Error('should not succeed') - }, - err => { - t.equal(err.code, 'E500', 'got error code') - } + await t.rejects( + team.lsUsers('@foo:cli'), + { code: 'E500' } ) }) -test('lsUsers error', t => { +test('lsUsers error', async t => { tnock(t, REG).get( '/-/team/foo/cli/user?format=cli' ).reply(200, ['iarna', 'zkat']) - return team.lsUsers('@foo:cli', OPTS).then(ret => { - t.same(ret, ['iarna', 'zkat'], 'got team members') - }) + const ret = await team.lsUsers('@foo:cli', OPTS) + t.same(ret, ['iarna', 'zkat'], 'got team members') }) -test('lsUsers.stream', t => { +test('lsUsers.stream', async t => { tnock(t, REG).get( '/-/team/foo/cli/user?format=cli' ).reply(200, ['iarna', 'zkat']) - return team.lsUsers.stream('@foo:cli', OPTS) - .collect() - .then(ret => { - t.same(ret, ['iarna', 'zkat'], 'got team members') - }) + const ret = await team.lsUsers.stream('@foo:cli', OPTS).collect() + t.same(ret, ['iarna', 'zkat'], 'got team members') }) -test('lsUsers.stream - no options', t => { +test('lsUsers.stream - no options', async t => { // NOTE: mocking real url, because no opts variable means `registry` value // will be defauled to real registry url in `npm-registry-fetch` tnock(t, 'https://registry.npmjs.org') .get('/-/team/foo/cli/user?format=cli') .reply(200, ['iarna', 'zkat']) - return team.lsUsers.stream('@foo:cli') - .collect() - .then(ret => { - t.same(ret, ['iarna', 'zkat'], 'got team members') - }) + const ret = await team.lsUsers.stream('@foo:cli').collect() + t.same(ret, ['iarna', 'zkat'], 'got team members') }) test('edit', t => { From bd2ae5d79eb8807bfca6075e98432c545a9ededa Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 08:00:46 -0700 Subject: [PATCH 084/175] fix: linting In preparation for @npmcli/eslint-config@3.1.0 --- lib/commands/audit.js | 5 +- lib/commands/edit.js | 9 +- lib/commands/org.js | 135 +++--- lib/commands/outdated.js | 1 + lib/commands/token.js | 45 +- lib/npm.js | 20 +- lib/utils/queryable.js | 4 +- scripts/dependency-graph.js | 2 + test/lib/commands/shrinkwrap.js | 4 +- workspaces/arborist/bin/index.js | 1 + .../arborist/lib/arborist/build-ideal-tree.js | 43 +- .../arborist/lib/arborist/load-actual.js | 1 + workspaces/arborist/lib/arborist/rebuild.js | 3 + workspaces/arborist/lib/arborist/reify.js | 82 ++-- workspaces/arborist/lib/audit-report.js | 2 + workspaces/arborist/lib/link.js | 1 + workspaces/arborist/lib/node.js | 3 +- workspaces/arborist/lib/shrinkwrap.js | 62 +-- workspaces/arborist/lib/signal-handling.js | 8 +- workspaces/arborist/lib/spec-from-lock.js | 6 +- workspaces/arborist/scripts/benchmark.js | 7 +- .../arborist/scripts/benchmark/reify.js | 16 +- .../test/arborist/build-ideal-tree.js | 18 +- .../arborist/test/arborist/load-actual.js | 42 +- workspaces/arborist/test/arborist/reify.js | 47 +- workspaces/arborist/test/shrinkwrap.js | 404 +++++++++--------- workspaces/arborist/test/yarn-lock.js | 8 +- workspaces/libnpmversion/lib/version.js | 4 +- .../libnpmversion/test/enforce-clean.js | 76 ++-- 29 files changed, 535 insertions(+), 524 deletions(-) diff --git a/lib/commands/audit.js b/lib/commands/audit.js index 779bc22fc6aaf..6ec870f03a8a5 100644 --- a/lib/commands/audit.js +++ b/lib/commands/audit.js @@ -178,11 +178,12 @@ class VerifySignatures { let name = edge.name try { name = npa(edge.spec).subSpec.name - } catch (_) { + } catch { + // leave it as edge.name } try { return npa(`${name}@${edge.spec}`) - } catch (_) { + } catch { // Skip packages with invalid spec } } diff --git a/lib/commands/edit.js b/lib/commands/edit.js index 0256f4f3a6f01..67ac32e017184 100644 --- a/lib/commands/edit.js +++ b/lib/commands/edit.js @@ -58,11 +58,16 @@ class Edit extends BaseCommand { } const [bin, ...args] = this.npm.config.get('editor').split(/\s+/) const editor = cp.spawn(bin, [...args, dir], { stdio: 'inherit' }) - editor.on('exit', (code) => { + editor.on('exit', async (code) => { if (code) { return reject(new Error(`editor process exited with code: ${code}`)) } - this.npm.exec('rebuild', [dir]).catch(reject).then(resolve) + try { + await this.npm.exec('rebuild', [dir]) + } catch (err) { + reject(err) + } + resolve() }) }) }) diff --git a/lib/commands/org.js b/lib/commands/org.js index 599b4b9c8758a..f49556c8d6a19 100644 --- a/lib/commands/org.js +++ b/lib/commands/org.js @@ -50,7 +50,7 @@ class Org extends BaseCommand { }) } - set (org, user, role, opts) { + async set (org, user, role, opts) { role = role || 'developer' if (!org) { throw new Error('First argument `orgname` is required.') @@ -67,27 +67,26 @@ class Org extends BaseCommand { ) } - return liborg.set(org, user, role, opts).then(memDeets => { - if (opts.json) { - this.npm.output(JSON.stringify(memDeets, null, 2)) - } else if (opts.parseable) { - this.npm.output(['org', 'orgsize', 'user', 'role'].join('\t')) - this.npm.output( - [memDeets.org.name, memDeets.org.size, memDeets.user, memDeets.role].join('\t') - ) - } else if (!this.npm.silent) { - this.npm.output( - `Added ${memDeets.user} as ${memDeets.role} to ${memDeets.org.name}. You now have ${ + const memDeets = await liborg.set(org, user, role, opts) + if (opts.json) { + this.npm.output(JSON.stringify(memDeets, null, 2)) + } else if (opts.parseable) { + this.npm.output(['org', 'orgsize', 'user', 'role'].join('\t')) + this.npm.output( + [memDeets.org.name, memDeets.org.size, memDeets.user, memDeets.role].join('\t') + ) + } else if (!this.npm.silent) { + this.npm.output( + `Added ${memDeets.user} as ${memDeets.role} to ${memDeets.org.name}. You now have ${ memDeets.org.size } member${memDeets.org.size === 1 ? '' : 's'} in this org.` - ) - } + ) + } - return memDeets - }) + return memDeets } - rm (org, user, opts) { + async rm (org, user, opts) { if (!org) { throw new Error('First argument `orgname` is required.') } @@ -96,68 +95,62 @@ class Org extends BaseCommand { throw new Error('Second argument `username` is required.') } - return liborg - .rm(org, user, opts) - .then(() => { - return liborg.ls(org, opts) - }) - .then(roster => { - user = user.replace(/^[~@]?/, '') - org = org.replace(/^[~@]?/, '') - const userCount = Object.keys(roster).length - if (opts.json) { - this.npm.output( - JSON.stringify({ - user, - org, - userCount, - deleted: true, - }) - ) - } else if (opts.parseable) { - this.npm.output(['user', 'org', 'userCount', 'deleted'].join('\t')) - this.npm.output([user, org, userCount, true].join('\t')) - } else if (!this.npm.silent) { - this.npm.output( - `Successfully removed ${user} from ${org}. You now have ${userCount} member${ - userCount === 1 ? '' : 's' - } in this org.` - ) - } - }) + await liborg.rm(org, user, opts) + const roster = await liborg.ls(org, opts) + user = user.replace(/^[~@]?/, '') + org = org.replace(/^[~@]?/, '') + const userCount = Object.keys(roster).length + if (opts.json) { + this.npm.output( + JSON.stringify({ + user, + org, + userCount, + deleted: true, + }) + ) + } else if (opts.parseable) { + this.npm.output(['user', 'org', 'userCount', 'deleted'].join('\t')) + this.npm.output([user, org, userCount, true].join('\t')) + } else if (!this.npm.silent) { + this.npm.output( + `Successfully removed ${user} from ${org}. You now have ${userCount} member${ + userCount === 1 ? '' : 's' + } in this org.` + ) + } } - ls (org, user, opts) { + async ls (org, user, opts) { if (!org) { throw new Error('First argument `orgname` is required.') } - return liborg.ls(org, opts).then(roster => { - if (user) { - const newRoster = {} - if (roster[user]) { - newRoster[user] = roster[user] - } - - roster = newRoster + let roster = await liborg.ls(org, opts) + if (user) { + const newRoster = {} + if (roster[user]) { + newRoster[user] = roster[user] } - if (opts.json) { - this.npm.output(JSON.stringify(roster, null, 2)) - } else if (opts.parseable) { - this.npm.output(['user', 'role'].join('\t')) - Object.keys(roster).forEach(user => { - this.npm.output([user, roster[user]].join('\t')) + + roster = newRoster + } + if (opts.json) { + this.npm.output(JSON.stringify(roster, null, 2)) + } else if (opts.parseable) { + this.npm.output(['user', 'role'].join('\t')) + Object.keys(roster).forEach(user => { + this.npm.output([user, roster[user]].join('\t')) + }) + } else if (!this.npm.silent) { + const table = new Table({ head: ['user', 'role'] }) + Object.keys(roster) + .sort() + .forEach(user => { + table.push([user, roster[user]]) }) - } else if (!this.npm.silent) { - const table = new Table({ head: ['user', 'role'] }) - Object.keys(roster) - .sort() - .forEach(user => { - table.push([user, roster[user]]) - }) - this.npm.output(table.toString()) - } - }) + this.npm.output(table.toString()) + } } } module.exports = Org diff --git a/lib/commands/outdated.js b/lib/commands/outdated.js index 042b776f71e0d..9e2060658ed72 100644 --- a/lib/commands/outdated.js +++ b/lib/commands/outdated.js @@ -196,6 +196,7 @@ class Outdated extends ArboristWorkspaceCmd { try { alias = npa(edge.spec).subSpec } catch (err) { + // ignore errors, no alias } const spec = npa(alias ? alias.name : edge.name) const node = edge.to || edge diff --git a/lib/commands/token.js b/lib/commands/token.js index cf3b8cbee53a4..de8e61101d8ac 100644 --- a/lib/commands/token.js +++ b/lib/commands/token.js @@ -140,32 +140,27 @@ class Token extends BaseCommand { const cidr = conf.cidr const readonly = conf.readOnly - return readUserInfo - .password() - .then(password => { - const validCIDR = this.validateCIDRList(cidr) - log.info('token', 'creating') - return pulseTillDone.withPromise( - otplease(this.npm, conf, conf => { - return profile.createToken(password, readonly, validCIDR, conf) - }) - ) - }) - .then(result => { - delete result.key - delete result.updated - if (conf.json) { - this.npm.output(JSON.stringify(result)) - } else if (conf.parseable) { - Object.keys(result).forEach(k => this.npm.output(k + '\t' + result[k])) - } else { - const table = new Table() - for (const k of Object.keys(result)) { - table.push({ [chalk.bold(k)]: String(result[k]) }) - } - this.npm.output(table.toString()) - } + const password = await readUserInfo.password() + const validCIDR = this.validateCIDRList(cidr) + log.info('token', 'creating') + const result = await pulseTillDone.withPromise( + otplease(this.npm, conf, conf => { + return profile.createToken(password, readonly, validCIDR, conf) }) + ) + delete result.key + delete result.updated + if (conf.json) { + this.npm.output(JSON.stringify(result)) + } else if (conf.parseable) { + Object.keys(result).forEach(k => this.npm.output(k + '\t' + result[k])) + } else { + const table = new Table() + for (const k of Object.keys(result)) { + table.push({ [chalk.bold(k)]: String(result[k]) }) + } + this.npm.output(table.toString()) + } } config () { diff --git a/lib/npm.js b/lib/npm.js index 66111cab89a84..b116ec5cc68a4 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -112,6 +112,7 @@ class Npm extends EventEmitter { // this is async but we dont await it, since its ok if it doesnt // finish before the command finishes running. it uses command and argv // so it must be initiated here, after the command name is set + // eslint-disable-next-line promise/catch-or-return updateNotifier(this).then((msg) => (this.updateNotification = msg)) // Options are prefixed by a hyphen-minus (-, \u2d). @@ -173,16 +174,15 @@ class Npm extends EventEmitter { async load () { if (!this.#loadPromise) { - this.#loadPromise = this.time('npm:load', () => this[_load]().catch(er => er).then((er) => { - this.loadErr = er - if (!er) { - if (this.config.get('force')) { - log.warn('using --force', 'Recommended protections disabled.') - } - } else { + this.#loadPromise = this.time('npm:load', async () => { + await this[_load]().catch((er) => { + this.loadErr = er throw er + }) + if (this.config.get('force')) { + log.warn('using --force', 'Recommended protections disabled.') } - })) + }) } return this.#loadPromise } @@ -229,7 +229,9 @@ class Npm extends EventEmitter { const node = this.time('npm:load:whichnode', () => { try { return which.sync(process.argv[0]) - } catch {} // TODO should we throw here? + } catch { + // TODO should we throw here? + } }) if (node && node.toUpperCase() !== process.execPath.toUpperCase()) { diff --git a/lib/utils/queryable.js b/lib/utils/queryable.js index ceb06bdccd103..7c5bb7fe87baf 100644 --- a/lib/utils/queryable.js +++ b/lib/utils/queryable.js @@ -148,7 +148,9 @@ const setter = ({ data, key, value, force }) => { let maybeIndex = Number.NaN try { maybeIndex = Number(_key) - } catch (err) {} + } catch { + // leave it NaN + } if (!Number.isNaN(maybeIndex)) { _key = maybeIndex } diff --git a/scripts/dependency-graph.js b/scripts/dependency-graph.js index 318b9f39b4292..1f18307582fd0 100644 --- a/scripts/dependency-graph.js +++ b/scripts/dependency-graph.js @@ -168,7 +168,9 @@ const iterate = function (node, dependedBy, annotations, onlyOurs) { main().then(() => { process.exit(0) + return 0 }).catch(err => { console.error(err) process.exit(1) + return 1 }) diff --git a/test/lib/commands/shrinkwrap.js b/test/lib/commands/shrinkwrap.js index e3fc1f9356705..812a9e23ec7f6 100644 --- a/test/lib/commands/shrinkwrap.js +++ b/test/lib/commands/shrinkwrap.js @@ -13,7 +13,9 @@ t.formatSnapshot = obj => (k, v) => { try { return JSON.parse(v) - } catch {} + } catch { + // leave invalid JSON as a string + } return v }, 2 diff --git a/workspaces/arborist/bin/index.js b/workspaces/arborist/bin/index.js index 0c1e98445341f..ff356fafab7c3 100755 --- a/workspaces/arborist/bin/index.js +++ b/workspaces/arborist/bin/index.js @@ -99,6 +99,7 @@ for (const file of commandFiles) { if (bin.loglevel !== 'silent') { console[process.exitCode ? 'error' : 'log'](r) } + return r }) } } diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 945bae56b63de..31a4e8c821a8c 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -378,6 +378,7 @@ Try using the package name instead, e.g: this.idealTree = tree this.virtualTree = null process.emit('timeEnd', 'idealTree:init') + return tree }) } @@ -531,12 +532,12 @@ Try using the package name instead, e.g: // This returns a promise because we might not have the name yet, // and need to call pacote.manifest to find the name. - [_add] (tree, { add, saveType = null, saveBundle = false }) { + async [_add] (tree, { add, saveType = null, saveBundle = false }) { // get the name for each of the specs in the list. // ie, doing `foo@bar` we just return foo // but if it's a url or git, we don't know the name until we // fetch it and look in its manifest. - return Promise.all(add.map(async rawSpec => { + const resolvedAdd = await Promise.all(add.map(async rawSpec => { // We do NOT provide the path to npa here, because user-additions // need to be resolved relative to the CWD the user is in. const spec = await this[_retrieveSpecName](npa(rawSpec)) @@ -544,17 +545,16 @@ Try using the package name instead, e.g: .then(spec => this[_followSymlinkPath](spec)) spec.tree = tree return spec - })).then(add => { - this[_resolvedAdd].push(...add) - // now add is a list of spec objects with names. - // find a home for each of them! - addRmPkgDeps.add({ - pkg: tree.package, - add, - saveBundle, - saveType, - path: this.path, - }) + })) + this[_resolvedAdd].push(...resolvedAdd) + // now resolvedAdd is a list of spec objects with names. + // find a home for each of them! + addRmPkgDeps.add({ + pkg: tree.package, + add: resolvedAdd, + saveBundle, + saveType, + path: this.path, }) } @@ -781,17 +781,18 @@ This is a one-time fix-up, please be patient... const spec = npa.resolve(name, id, dirname(path)) const t = `idealTree:inflate:${location}` this.addTracker(t) - await pacote.manifest(spec, { - ...this.options, - resolved: resolved, - integrity: integrity, - fullMetadata: false, - }).then(mani => { + try { + const mani = await pacote.manifest(spec, { + ...this.options, + resolved: resolved, + integrity: integrity, + fullMetadata: false, + }) node.package = { ...mani, _id: `${mani.name}@${mani.version}` } - }).catch((er) => { + } catch (er) { const warning = `Could not fetch metadata for ${name}@${id}` log.warn(heading, warning, er) - }) + } this.finishTracker(t) }) } diff --git a/workspaces/arborist/lib/arborist/load-actual.js b/workspaces/arborist/lib/arborist/load-actual.js index bca7cef9476ff..7ab65f5b00d8b 100644 --- a/workspaces/arborist/lib/arborist/load-actual.js +++ b/workspaces/arborist/lib/arborist/load-actual.js @@ -347,6 +347,7 @@ module.exports = cls => class ActualLoader extends cls { // node_modules hierarchy, then load that node as well. return this[_loadFSTree](link.target).then(() => link) } else if (target.then) { + // eslint-disable-next-line promise/catch-or-return target.then(node => link.target = node) } diff --git a/workspaces/arborist/lib/arborist/rebuild.js b/workspaces/arborist/lib/arborist/rebuild.js index e9b79031ef427..7e97984c06aa7 100644 --- a/workspaces/arborist/lib/arborist/rebuild.js +++ b/workspaces/arborist/lib/arborist/rebuild.js @@ -359,6 +359,9 @@ module.exports = cls => class Builder extends cls { pkg, path, event, + // I do not know why this needs to be on THIS line but refactoring + // this function would be quite a process + // eslint-disable-next-line promise/always-return cmd: args && args[args.length - 1], env, code, diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index 7663a3a342cc6..0c9026f5e4d1e 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -69,7 +69,6 @@ const _symlink = Symbol('symlink') const _warnDeprecated = Symbol('warnDeprecated') const _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees') const _submitQuickAudit = Symbol('submitQuickAudit') -const _awaitQuickAudit = Symbol('awaitQuickAudit') const _unpackNewModules = Symbol.for('unpackNewModules') const _moveContents = Symbol.for('moveContents') const _moveBackRetiredUnchanged = Symbol.for('moveBackRetiredUnchanged') @@ -156,7 +155,8 @@ module.exports = cls => class Reifier extends cls { await this[_reifyPackages]() await this[_saveIdealTree](options) await this[_copyIdealToActual]() - await this[_awaitQuickAudit]() + // This is a very bad pattern and I can't wait to stop doing it + this.auditReport = await this.auditReport this.finishTracker('reify') process.emit('timeEnd', 'reify') @@ -531,12 +531,12 @@ module.exports = cls => class Reifier extends cls { const targets = [...roots, ...Object.keys(this[_retiredPaths])] const unlinks = targets .map(path => rimraf(path).catch(er => failures.push([path, er]))) - return promiseAllRejectLate(unlinks) - .then(() => { - if (failures.length) { - log.warn('cleanup', 'Failed to remove some directories', failures) - } - }) + return promiseAllRejectLate(unlinks).then(() => { + // eslint-disable-next-line promise/always-return + if (failures.length) { + log.warn('cleanup', 'Failed to remove some directories', failures) + } + }) .then(() => process.emit('timeEnd', 'reify:rollback:createSparse')) .then(() => this[_rollbackRetireShallowNodes](er)) } @@ -592,21 +592,21 @@ module.exports = cls => class Reifier extends cls { this.addTracker('reify', node.name, node.location) const { npmVersion, nodeVersion } = this.options - const p = Promise.resolve() - .then(async () => { - // when we reify an optional node, check the engine and platform - // first. be sure to ignore the --force and --engine-strict flags, - // since we always want to skip any optional packages we can't install. - // these checks throwing will result in a rollback and removal - // of the mismatches - if (node.optional) { - checkEngine(node.package, npmVersion, nodeVersion, false) - checkPlatform(node.package, false) - } - await this[_checkBins](node) - await this[_extractOrLink](node) - await this[_warnDeprecated](node) - }) + const p = Promise.resolve().then(async () => { + // when we reify an optional node, check the engine and platform + // first. be sure to ignore the --force and --engine-strict flags, + // since we always want to skip any optional packages we can't install. + // these checks throwing will result in a rollback and removal + // of the mismatches + // eslint-disable-next-line promise/always-return + if (node.optional) { + checkEngine(node.package, npmVersion, nodeVersion, false) + checkPlatform(node.package, false) + } + await this[_checkBins](node) + await this[_extractOrLink](node) + await this[_warnDeprecated](node) + }) return this[_handleOptionalFailure](node, p) .then(() => { @@ -916,9 +916,10 @@ module.exports = cls => class Reifier extends cls { } } - [_submitQuickAudit] () { + async [_submitQuickAudit] () { if (this.options.audit === false) { - return this.auditReport = null + this.auditReport = null + return } // we submit the quick audit at this point in the process, as soon as @@ -940,16 +941,10 @@ module.exports = cls => class Reifier extends cls { ) } - this.auditReport = AuditReport.load(tree, options) - .then(res => { - process.emit('timeEnd', 'reify:audit') - this.auditReport = res - }) - } - - // return the promise if we're waiting for it, or the replaced result - [_awaitQuickAudit] () { - return this.auditReport + this.auditReport = AuditReport.load(tree, options).then(res => { + process.emit('timeEnd', 'reify:audit') + return res + }) } // ok! actually unpack stuff into their target locations! @@ -1126,7 +1121,7 @@ module.exports = cls => class Reifier extends cls { // remove the retired folders, and any deleted nodes // If this fails, there isn't much we can do but tell the user about it. // Thankfully, it's pretty unlikely that it'll fail, since rimraf is a tank. - [_removeTrash] () { + async [_removeTrash] () { process.emit('time', 'reify:trash') const promises = [] const failures = [] @@ -1136,12 +1131,11 @@ module.exports = cls => class Reifier extends cls { promises.push(rm(path)) } - return promiseAllRejectLate(promises).then(() => { - if (failures.length) { - log.warn('cleanup', 'Failed to remove some directories', failures) - } - }) - .then(() => process.emit('timeEnd', 'reify:trash')) + await promiseAllRejectLate(promises) + if (failures.length) { + log.warn('cleanup', 'Failed to remove some directories', failures) + } + process.emit('timeEnd', 'reify:trash') } // last but not least, we save the ideal tree metadata to the package-lock @@ -1302,7 +1296,9 @@ module.exports = cls => class Reifier extends cls { if (semver.subset(edge.spec, node.version)) { return false } - } catch {} + } catch { + // ignore errors + } } return true } diff --git a/workspaces/arborist/lib/audit-report.js b/workspaces/arborist/lib/audit-report.js index 9bef84686f4b4..387919f610829 100644 --- a/workspaces/arborist/lib/audit-report.js +++ b/workspaces/arborist/lib/audit-report.js @@ -175,7 +175,9 @@ class AuditReport extends Map { } else { // calculate a metavuln, if necessary const calc = this.calculator.calculate(dep.packageName, advisory) + // eslint-disable-next-line promise/always-return p.push(calc.then(meta => { + // eslint-disable-next-line promise/always-return if (meta.testVersion(dep.version, spec)) { advisories.add(meta) } diff --git a/workspaces/arborist/lib/link.js b/workspaces/arborist/lib/link.js index 6fed063772b6a..d58c6e2375099 100644 --- a/workspaces/arborist/lib/link.js +++ b/workspaces/arborist/lib/link.js @@ -66,6 +66,7 @@ class Link extends Node { // can set to a promise during an async tree build operation // wait until then to assign it. this[_target] = target + // eslint-disable-next-line promise/always-return, promise/catch-or-return target.then(node => { this[_target] = null this.target = node diff --git a/workspaces/arborist/lib/node.js b/workspaces/arborist/lib/node.js index 8ec90ff3c8495..60ce3eda0eb42 100644 --- a/workspaces/arborist/lib/node.js +++ b/workspaces/arborist/lib/node.js @@ -564,7 +564,8 @@ class Node { // this allows us to do new Node({...}) and then set the root later. // just make the assignment so we don't lose it, and move on. if (!this.path || !root.realpath || !root.path) { - return this[_root] = root + this[_root] = root + return } // temporarily become a root node diff --git a/workspaces/arborist/lib/shrinkwrap.js b/workspaces/arborist/lib/shrinkwrap.js index e2180fd4c8076..d5448bbcba927 100644 --- a/workspaces/arborist/lib/shrinkwrap.js +++ b/workspaces/arborist/lib/shrinkwrap.js @@ -184,34 +184,32 @@ const assertNoNewer = async (path, data, lockTime, dir = path, seen = null) => { ? Promise.resolve([{ name: 'node_modules', isDirectory: () => true }]) : readdir(parent, { withFileTypes: true }) - return children.catch(() => []) - .then(ents => Promise.all(ents.map(async ent => { - const child = resolve(parent, ent.name) - if (ent.isDirectory() && !/^\./.test(ent.name)) { - await assertNoNewer(path, data, lockTime, child, seen) - } else if (ent.isSymbolicLink()) { - const target = resolve(parent, await readlink(child)) - const tstat = await stat(target).catch( - /* istanbul ignore next - windows */ () => null) - seen.add(relpath(path, child)) - /* istanbul ignore next - windows cannot do this */ - if (tstat && tstat.isDirectory() && !seen.has(relpath(path, target))) { - await assertNoNewer(path, data, lockTime, target, seen) - } - } - }))) - .then(() => { - if (dir !== path) { - return + const ents = await children.catch(() => []) + await Promise.all(ents.map(async ent => { + const child = resolve(parent, ent.name) + if (ent.isDirectory() && !/^\./.test(ent.name)) { + await assertNoNewer(path, data, lockTime, child, seen) + } else if (ent.isSymbolicLink()) { + const target = resolve(parent, await readlink(child)) + const tstat = await stat(target).catch( + /* istanbul ignore next - windows */ () => null) + seen.add(relpath(path, child)) + /* istanbul ignore next - windows cannot do this */ + if (tstat && tstat.isDirectory() && !seen.has(relpath(path, target))) { + await assertNoNewer(path, data, lockTime, target, seen) } + } + })) + if (dir !== path) { + return + } - // assert that all the entries in the lockfile were seen - for (const loc of new Set(Object.keys(data.packages))) { - if (!seen.has(loc)) { - throw 'missing from node_modules: ' + loc - } - } - }) + // assert that all the entries in the lockfile were seen + for (const loc of new Set(Object.keys(data.packages))) { + if (!seen.has(loc)) { + throw 'missing from node_modules: ' + loc + } + } } const _awaitingUpdate = Symbol('_awaitingUpdate') @@ -261,7 +259,9 @@ class Shrinkwrap { s.lockfileVersion = json.lockfileVersion } } - } catch (e) {} + } catch { + // ignore errors + } return s } @@ -442,7 +442,7 @@ class Shrinkwrap { this.newline = newline !== undefined ? newline : this.newline } - load () { + async load () { // we don't need to load package-lock.json except for top of tree nodes, // only npm-shrinkwrap.json. return this[_maybeRead]().then(([sw, lock, yarn]) => { @@ -464,7 +464,9 @@ class Shrinkwrap { // ignore invalid yarn data. we'll likely clobber it later anyway. try { this.yarnLock.parse(yarn) - } catch (_) {} + } catch { + // ignore errors + } } return data ? parseJSON(data) : {} @@ -515,8 +517,10 @@ class Shrinkwrap { !(lock.lockfileVersion >= 2) && !lock.requires // load old lockfile deps into the packages listing + // eslint-disable-next-line promise/always-return if (lock.dependencies && !lock.packages) { return rpj(this.path + '/package.json').then(pkg => pkg, er => ({})) + // eslint-disable-next-line promise/always-return .then(pkg => { this[_loadAll]('', null, this.data) this[_fixDependencies](pkg) diff --git a/workspaces/arborist/lib/signal-handling.js b/workspaces/arborist/lib/signal-handling.js index 0afbb05dcfc64..18841d944ffe7 100644 --- a/workspaces/arborist/lib/signal-handling.js +++ b/workspaces/arborist/lib/signal-handling.js @@ -19,7 +19,9 @@ const setup = fn => { for (const sig of signals) { try { process.removeListener(sig, sigListeners[sig]) - } catch (er) {} + } catch { + // ignore errors + } } process.removeListener('beforeExit', onBeforeExit) sigListeners.loaded = false @@ -62,7 +64,9 @@ const setup = fn => { process.setMaxListeners(length + 1) } process.on(sig, sigListeners[sig]) - } catch (er) {} + } catch { + // ignore errors + } } sigListeners.loaded = true diff --git a/workspaces/arborist/lib/spec-from-lock.js b/workspaces/arborist/lib/spec-from-lock.js index 789741976269d..49b53c8f6aaca 100644 --- a/workspaces/arborist/lib/spec-from-lock.js +++ b/workspaces/arborist/lib/spec-from-lock.js @@ -21,10 +21,12 @@ const specFromLock = (name, lock, where) => { if (lock.resolved) { return npa.resolve(name, lock.resolved, where) } - } catch (_) { } + } catch { + // ignore errors + } try { return npa.resolve(name, lock.version, where) - } catch (_) { + } catch { return {} } } diff --git a/workspaces/arborist/scripts/benchmark.js b/workspaces/arborist/scripts/benchmark.js index f6b2b02942981..f4d26871b5ecb 100644 --- a/workspaces/arborist/scripts/benchmark.js +++ b/workspaces/arborist/scripts/benchmark.js @@ -151,7 +151,7 @@ const suite = new Suite({ } }, - onComplete () { + async onComplete () { rimraf.sync(lastBenchmark) mkdirp.sync(resolve(__dirname, 'benchmark/saved')) // always save with sha @@ -168,12 +168,13 @@ const suite = new Suite({ } linkSync(saveThis, lastBenchmark) - teardown().then(() => Promise.all([ + await teardown() + await Promise.all([ registryServer.stop(), new Promise((res, rej) => { rimraf(this.cache, er => er ? rej(er) : res()) }), - ])) + ]) }, }) diff --git a/workspaces/arborist/scripts/benchmark/reify.js b/workspaces/arborist/scripts/benchmark/reify.js index b826533d0006d..f477cfbd19f29 100644 --- a/workspaces/arborist/scripts/benchmark/reify.js +++ b/workspaces/arborist/scripts/benchmark/reify.js @@ -49,10 +49,9 @@ const suite = async (suite, { registry, cache }) => { version: '1.0.0', dependencies, })) - await arb.reify().then(() => { - // grab this so we can make setup faster - packageLock = require(resolve(path, 'package-lock.json')) - }) + await arb.reify() + // grab this so we can make setup faster + packageLock = require(resolve(path, 'package-lock.json')) } // just reify them all fast. we'll remove the bits we don't want later. @@ -96,14 +95,13 @@ const suite = async (suite, { registry, cache }) => { rimraf.sync(resolve(path, 'cache')) } }, - fn (d) { - new Arborist({ + async fn (d) { + await new Arborist({ path, registry, cache: /no-cache/.test(path) ? resolve(path, 'cache') : cache, - }).reify().then(() => d.resolve(), er => { - throw er - }) + }).reify() + d.resolve() }, }) } diff --git a/workspaces/arborist/test/arborist/build-ideal-tree.js b/workspaces/arborist/test/arborist/build-ideal-tree.js index 0aadd7adf815f..87783086b65c3 100644 --- a/workspaces/arborist/test/arborist/build-ideal-tree.js +++ b/workspaces/arborist/test/arborist/build-ideal-tree.js @@ -1080,7 +1080,7 @@ t.test('pathologically nested dependency cycle', async t => { resolve(fixtures, 'pathological-dep-nesting-cycle'))) }) -t.test('resolve file deps from cwd', t => { +t.test('resolve file deps from cwd', async t => { const cwd = process.cwd() t.teardown(() => process.chdir(cwd)) const path = t.testdir({ @@ -1094,17 +1094,16 @@ t.test('resolve file deps from cwd', t => { path: resolve(path, 'global'), ...OPT, }) - return arb.buildIdealTree({ + const tree = await arb.buildIdealTree({ path: `${path}/local`, add: ['child-1.2.3.tgz'], global: true, - }).then(tree => { - const resolved = `file:${resolve(fixturedir, 'child-1.2.3.tgz')}` - t.equal(normalizePath(tree.children.get('child').resolved), normalizePath(resolved)) }) + const resolved = `file:${resolve(fixturedir, 'child-1.2.3.tgz')}` + t.equal(normalizePath(tree.children.get('child').resolved), normalizePath(resolved)) }) -t.test('resolve links in global mode', t => { +t.test('resolve links in global mode', async t => { const cwd = process.cwd() t.teardown(() => process.chdir(cwd)) const path = t.testdir({ @@ -1127,13 +1126,12 @@ t.test('resolve links in global mode', t => { global: true, path: resolve(path, 'global'), }) - return arb.buildIdealTree({ + const tree = await arb.buildIdealTree({ add: ['file:../../linked-dep'], global: true, - }).then(tree => { - const resolved = 'file:../../linked-dep' - t.equal(tree.children.get('linked-dep').resolved, resolved) }) + const resolved = 'file:../../linked-dep' + t.equal(tree.children.get('linked-dep').resolved, resolved) }) t.test('dont get confused if root matches duped metadep', async t => { diff --git a/workspaces/arborist/test/arborist/load-actual.js b/workspaces/arborist/test/arborist/load-actual.js index 72ab5e60fbf38..9c2c8bf1cd4b8 100644 --- a/workspaces/arborist/test/arborist/load-actual.js +++ b/workspaces/arborist/test/arborist/load-actual.js @@ -170,34 +170,34 @@ t.test('shake out Link target timing issue', t => { t.matchSnapshot(tree, 'loaded tree')) }) -t.test('broken json', t => - loadActual(resolve(fixtures, 'bad')).then(d => { - t.ok(d.errors.length, 'Got an error object') - t.equal(d.errors[0] && d.errors[0].code, 'EJSONPARSE') - t.ok(d, 'Got a tree') - })) +t.test('broken json', async t => { + const d = await loadActual(resolve(fixtures, 'bad')) + t.ok(d.errors.length, 'Got an error object') + t.equal(d.errors[0] && d.errors[0].code, 'EJSONPARSE') + t.ok(d, 'Got a tree') +}) -t.test('missing json does not obscure deeper errors', t => - loadActual(resolve(fixtures, 'empty')).then(d => { - t.match(d, { errors: [{ code: 'ENOENT' }] }, - 'Error reading json of top level') - t.match(d.children.get('foo'), { errors: [{ code: 'EJSONPARSE' }] }, - 'Error parsing JSON of child node') - })) +t.test('missing json does not obscure deeper errors', async t => { + const d = await loadActual(resolve(fixtures, 'empty')) + t.match(d, { errors: [{ code: 'ENOENT' }] }, + 'Error reading json of top level') + t.match(d.children.get('foo'), { errors: [{ code: 'EJSONPARSE' }] }, + 'Error parsing JSON of child node') +}) t.test('missing folder', t => t.rejects(loadActual(resolve(fixtures, 'does-not-exist')), { code: 'ENOENT', })) -t.test('missing symlinks', t => - loadActual(resolve(fixtures, 'badlink')).then(d => { - t.equal(d.children.size, 2, 'both broken children are included') - t.match(d.children.get('foo'), { errors: [{ code: 'ELOOP' }] }, - 'foo has error') - t.match(d.children.get('bar'), { errors: [{ code: 'ENOENT' }] }, - 'bar has error') - })) +t.test('missing symlinks', async t => { + const d = await loadActual(resolve(fixtures, 'badlink')) + t.equal(d.children.size, 2, 'both broken children are included') + t.match(d.children.get('foo'), { errors: [{ code: 'ELOOP' }] }, + 'foo has error') + t.match(d.children.get('bar'), { errors: [{ code: 'ENOENT' }] }, + 'bar has error') +}) t.test('load from a hidden lockfile', async (t) => { const tree = await loadActual(resolve(fixtures, 'hidden-lockfile')) diff --git a/workspaces/arborist/test/arborist/reify.js b/workspaces/arborist/test/arborist/reify.js index db5a9c1fe1af6..01945f7136c41 100644 --- a/workspaces/arborist/test/arborist/reify.js +++ b/workspaces/arborist/test/arborist/reify.js @@ -232,6 +232,7 @@ t.test('omit peer deps', t => { } const lock = require(tree.path + '/package-lock.json') + // eslint-disable-next-line promise/always-return for (const [loc, meta] of Object.entries(lock.packages)) { if (meta.peer) { t.throws(() => fs.statSync(resolve(path, loc)), 'peer not reified') @@ -240,6 +241,7 @@ t.test('omit peer deps', t => { } } }) + // eslint-disable-next-line promise/always-return .then(() => { process.removeListener('time', onTime) process.removeListener('timeEnd', onTimeEnd) @@ -335,15 +337,15 @@ t.test('omit optional dep', t => { const ignoreScripts = true const arb = newArb({ path, ignoreScripts }) - return arb.reify({ omit: ['optional'] }) - .then(tree => { - t.equal(tree.children.get('fsevents'), undefined, 'no fsevents in tree') - t.throws(() => fs.statSync(path + '/node_modules/fsevents'), 'no fsevents unpacked') - t.match(require(path + '/package-lock.json').dependencies.fsevents, { - dev: true, - optional: true, - }, 'fsevents present in lockfile') - }) + // eslint-disable-next-line promise/always-return + return arb.reify({ omit: ['optional'] }).then(tree => { + t.equal(tree.children.get('fsevents'), undefined, 'no fsevents in tree') + t.throws(() => fs.statSync(path + '/node_modules/fsevents'), 'no fsevents unpacked') + t.match(require(path + '/package-lock.json').dependencies.fsevents, { + dev: true, + optional: true, + }, 'fsevents present in lockfile') + }) .then(() => t.ok(arb.diff, 'has a diff tree')) }) @@ -737,6 +739,7 @@ t.test('rollbacks', { buffered: false }, t => { return t.rejects(a.reify({ update: ['@isaacs/testing-bundledeps-parent'], }).then(tree => 'it worked'), new Error('poop')) + // eslint-disable-next-line promise/always-return .then(() => { const warnings = check() t.equal(warnings.length, 2) @@ -858,6 +861,7 @@ t.test('rollbacks', { buffered: false }, t => { return t.resolveMatchSnapshot(a.reify({ update: ['@isaacs/testing-bundledeps-parent'], save: false, + // eslint-disable-next-line promise/always-return }).then(tree => printTree(tree))).then(() => { const warnings = check() t.equal(warnings.length, 2) @@ -1019,6 +1023,7 @@ t.test('saving the ideal tree', t => { // NB: these are all going to be marked as extraneous, because we're // skipping the actual buildIdealTree step that flags them properly return a[kSaveIdealTree]({}) + // eslint-disable-next-line promise/always-return }).then(saved => { t.ok(saved, 'true, because it was saved') t.matchSnapshot(require(path + '/package-lock.json'), 'lock after save') @@ -1159,12 +1164,10 @@ t.test('workspaces', t => { t.test('reify simple-workspaces', t => t.resolveMatchSnapshot(printReified(fixture(t, 'workspaces-simple')), 'should reify simple workspaces')) - t.test('reify workspaces lockfile', t => { + t.test('reify workspaces lockfile', async t => { const path = fixture(t, 'workspaces-simple') - reify(path).then(() => { - t.matchSnapshot(require(path + '/package-lock.json'), 'should lock workspaces config') - t.end() - }) + await reify(path) + t.matchSnapshot(require(path + '/package-lock.json'), 'should lock workspaces config') }) t.test('reify workspaces bin files', t => { @@ -1195,20 +1198,16 @@ t.test('workspaces', t => { 'should not clean up entire nm folder for no reason' )) - t.test('add new workspaces dep', t => { + t.test('add new workspaces dep', async t => { const path = fixture(t, 'workspaces-add-new-dep') - reify(path).then(() => { - t.matchSnapshot(require(path + '/package-lock.json'), 'should update package-lock with new added dep') - t.end() - }) + await reify(path) + t.matchSnapshot(require(path + '/package-lock.json'), 'should update package-lock with new added dep') }) - t.test('root as-a-workspace', t => { + t.test('root as-a-workspace', async t => { const path = fixture(t, 'workspaces-root-linked') - reify(path).then(() => { - t.matchSnapshot(require(path + '/package-lock.json'), 'should produce expected package-lock file') - t.end() - }) + await reify(path) + t.matchSnapshot(require(path + '/package-lock.json'), 'should produce expected package-lock file') }) t.end() diff --git a/workspaces/arborist/test/shrinkwrap.js b/workspaces/arborist/test/shrinkwrap.js index 07178062e3a40..46f8ceccff915 100644 --- a/workspaces/arborist/test/shrinkwrap.js +++ b/workspaces/arborist/test/shrinkwrap.js @@ -54,31 +54,31 @@ t.test('load and change lockfileVersion', async t => { t.equal(v3Data.dependencies, undefined, 'v3 data does not have dependencies') }) -t.test('load and then reset gets empty lockfile', t => - Shrinkwrap.load({ path: fixture }).then(sw => { - sw.reset() - t.strictSame(sw.data, { - lockfileVersion: 2, - requires: true, - dependencies: {}, - packages: {}, - }) - t.equal(sw.loadedFromDisk, true) - t.equal(sw.filename, resolve(fixture, 'package-lock.json')) - })) +t.test('load and then reset gets empty lockfile', async t => { + const sw = await Shrinkwrap.load({ path: fixture }) + sw.reset() + t.strictSame(sw.data, { + lockfileVersion: 2, + requires: true, + dependencies: {}, + packages: {}, + }) + t.equal(sw.loadedFromDisk, true) + t.equal(sw.filename, resolve(fixture, 'package-lock.json')) +}) -t.test('starting out with a reset lockfile is an empty lockfile', t => - Shrinkwrap.reset({ path: fixture }).then(sw => { - t.strictSame(sw.data, { - lockfileVersion: 2, - requires: true, - dependencies: {}, - packages: {}, - }) - t.equal(sw.originalLockfileVersion, 2) - t.equal(sw.loadedFromDisk, true) - t.equal(sw.filename, resolve(fixture, 'package-lock.json')) - })) +t.test('starting out with a reset lockfile is an empty lockfile', async t => { + const sw = await Shrinkwrap.reset({ path: fixture }) + t.strictSame(sw.data, { + lockfileVersion: 2, + requires: true, + dependencies: {}, + packages: {}, + }) + t.equal(sw.originalLockfileVersion, 2) + t.equal(sw.loadedFromDisk, true) + t.equal(sw.filename, resolve(fixture, 'package-lock.json')) +}) t.test('reset in a bad dir gets an empty lockfile with no lockfile version', async t => { const nullLockDir = t.testdir({ @@ -109,103 +109,103 @@ t.test('reset in a bad dir gets an empty lockfile with no lockfile version', asy t.equal(swNullLock.loadedFromDisk, true) }) -t.test('loading in bad dir gets empty lockfile', t => - Shrinkwrap.load({ path: 'path/which/does/not/exist' }).then(sw => { - t.strictSame(sw.data, { - lockfileVersion: 2, - requires: true, - dependencies: {}, - packages: {}, - }) - t.equal(sw.loadedFromDisk, false) - })) +t.test('loading in bad dir gets empty lockfile', async t => { + const sw = await Shrinkwrap.load({ path: 'path/which/does/not/exist' }) + t.strictSame(sw.data, { + lockfileVersion: 2, + requires: true, + dependencies: {}, + packages: {}, + }) + t.equal(sw.loadedFromDisk, false) +}) -t.test('failure to parse json gets empty lockfile', t => - Shrinkwrap.load({ path: badJsonFixture }).then(sw => { - t.strictSame(sw.data, { - lockfileVersion: 2, - requires: true, - dependencies: {}, - packages: {}, - }) - t.equal(sw.loadedFromDisk, false) - })) +t.test('failure to parse json gets empty lockfile', async t => { + const sw = await Shrinkwrap.load({ path: badJsonFixture }) + t.strictSame(sw.data, { + lockfileVersion: 2, + requires: true, + dependencies: {}, + packages: {}, + }) + t.equal(sw.loadedFromDisk, false) +}) -t.test('loading in empty dir gets empty lockfile', t => - Shrinkwrap.load({ path: emptyFixture }).then(sw => { - t.strictSame(sw.data, { - lockfileVersion: 2, - requires: true, - dependencies: {}, - packages: {}, - }) - t.equal(sw.loadedFromDisk, false) - // update with an empty node, set name to node name, not package name - const root = new Node({ - path: emptyFixture, - realpath: emptyFixture, - }) - root.peer = false - root.dev = false - root.devOptional = false - root.optional = false - root.extraneous = false - sw.add(root) - t.strictSame(sw.commit(), { - name: 'empty', - lockfileVersion: 2, - requires: true, - packages: {}, - }) - })) +t.test('loading in empty dir gets empty lockfile', async t => { + const sw = await Shrinkwrap.load({ path: emptyFixture }) + t.strictSame(sw.data, { + lockfileVersion: 2, + requires: true, + dependencies: {}, + packages: {}, + }) + t.equal(sw.loadedFromDisk, false) + // update with an empty node, set name to node name, not package name + const root = new Node({ + path: emptyFixture, + realpath: emptyFixture, + }) + root.peer = false + root.dev = false + root.devOptional = false + root.optional = false + root.extraneous = false + sw.add(root) + t.strictSame(sw.commit(), { + name: 'empty', + lockfileVersion: 2, + requires: true, + packages: {}, + }) +}) -t.test('look up from locks and such', t => - new Shrinkwrap({ path: fixture }).load().then(m => { - t.strictSame(m.get(''), { - name: 'a', - version: '1.2.3', - dependencies: { - abbrev: '^1.1.1', - 'full-git-url': 'git+https://github.com/isaacs/abbrev-js.git', - ghshort: 'github:isaacs/abbrev-js', - old: 'npm:abbrev@^1.0.3', - pinned: 'npm:abbrev@^1.1.1', - reg: 'npm:abbrev@^1.1.1', - remote: 'https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz', - symlink: 'file:./abbrev-link-target', - tarball: 'file:abbrev-1.1.1.tgz', - bundler: '1.2.3', - }, - }, 'root metadata') - t.match(m.data, { - lockfileVersion: 2, - requires: true, - dependencies: Object, - packages: Object, - }) - t.equal(m.loadedFromDisk, true) - t.matchSnapshot(m.get('node_modules/abbrev'), 'basic package') +t.test('look up from locks and such', async t => { + const m = await new Shrinkwrap({ path: fixture }).load() + t.strictSame(m.get(''), { + name: 'a', + version: '1.2.3', + dependencies: { + abbrev: '^1.1.1', + 'full-git-url': 'git+https://github.com/isaacs/abbrev-js.git', + ghshort: 'github:isaacs/abbrev-js', + old: 'npm:abbrev@^1.0.3', + pinned: 'npm:abbrev@^1.1.1', + reg: 'npm:abbrev@^1.1.1', + remote: 'https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz', + symlink: 'file:./abbrev-link-target', + tarball: 'file:abbrev-1.1.1.tgz', + bundler: '1.2.3', + }, + }, 'root metadata') + t.match(m.data, { + lockfileVersion: 2, + requires: true, + dependencies: Object, + packages: Object, + }) + t.equal(m.loadedFromDisk, true) + t.matchSnapshot(m.get('node_modules/abbrev'), 'basic package') + t.matchSnapshot(m.get( + 'node_modules/abbrev/node_modules/@scope/name/node_modules/@otherscope/othername', 'scoped package')) + t.matchSnapshot(m.get('package/not/found'), 'not found') + + t.matchSnapshot(m.get('node_modules/old/node_modules/notfound'), 'fall off the dep tree') + + t.test('lockfile', t => { + const p = m.data.packages + m.data.packages = {} + t.matchSnapshot(m.get('node_modules/abbrev'), 'basic pkg, from lock') + t.matchSnapshot(m.data.packages, 'saved fetched metadata back to packages section') t.matchSnapshot(m.get( 'node_modules/abbrev/node_modules/@scope/name/node_modules/@otherscope/othername', 'scoped package')) t.matchSnapshot(m.get('package/not/found'), 'not found') - - t.matchSnapshot(m.get('node_modules/old/node_modules/notfound'), 'fall off the dep tree') - - t.test('lockfile', t => { - const p = m.data.packages - m.data.packages = {} - t.matchSnapshot(m.get('node_modules/abbrev'), 'basic pkg, from lock') - t.matchSnapshot(m.data.packages, 'saved fetched metadata back to packages section') - t.matchSnapshot(m.get( - 'node_modules/abbrev/node_modules/@scope/name/node_modules/@otherscope/othername', 'scoped package')) - t.matchSnapshot(m.get('package/not/found'), 'not found') - t.matchSnapshot(m.get('node_modules/full-git-url'), 'full git') - t.matchSnapshot(m.get('node_modules/symlink'), 'symlink') - t.matchSnapshot(m.get('node_modules/unhosted-git'), 'unhosted git') - m.data.packages = p - t.end() - }) - })) + t.matchSnapshot(m.get('node_modules/full-git-url'), 'full git') + t.matchSnapshot(m.get('node_modules/symlink'), 'symlink') + t.matchSnapshot(m.get('node_modules/unhosted-git'), 'unhosted git') + m.data.packages = p + t.end() + }) +}) t.test('load a shrinkwrap with some dev and optional flags', t => Shrinkwrap.load({ path: depTypesFixture }).then(m => @@ -616,39 +616,38 @@ t.test('saving dependency-free shrinkwrap object', t => { t.test('write the shrinkwrap back to disk', t => { const dir = t.testdir({}) - t.test('just read and write back', t => - Shrinkwrap.load({ path: fixture }).then(s => { - s.filename = dir + '/test-shrinkwrap.json' - return s.save().then(() => - t.strictSame(require(s.filename), s.data, 'saved json matches data')) - })) - t.test('write back with pending changes', t => - Shrinkwrap.load({ path: fixture }).then(s => { - const dir = t.testdir({}) - s.filename = dir + '/test-shrinkwrap-with-changes.json' - const node = new Node({ - path: fixture + '/node_modules/newthing', - pkg: { - name: 'newthing', - version: '1.2.3', - }, - }) - s.add(node) - const preCommit = JSON.parse(JSON.stringify(s.data)) - const postCommit = s.commit() - t.notSame(postCommit, preCommit, 'committing changes the data') - // delete and re-add to put us back in the pre-commit state - s.delete(node.location) - s.add(node) - return s.save().then(() => { - t.strictSame(s.data, postCommit, 'committed changes to data') - t.strictSame(require(s.filename), s.data, 'saved json matches data') - }) - })) + t.test('just read and write back', async t => { + const s = await Shrinkwrap.load({ path: fixture }) + s.filename = dir + '/test-shrinkwrap.json' + await s.save() + t.strictSame(require(s.filename), s.data, 'saved json matches data') + }) + t.test('write back with pending changes', async t => { + const s = await Shrinkwrap.load({ path: fixture }) + const dir = t.testdir({}) + s.filename = dir + '/test-shrinkwrap-with-changes.json' + const node = new Node({ + path: fixture + '/node_modules/newthing', + pkg: { + name: 'newthing', + version: '1.2.3', + }, + }) + s.add(node) + const preCommit = JSON.parse(JSON.stringify(s.data)) + const postCommit = s.commit() + t.notSame(postCommit, preCommit, 'committing changes the data') + // delete and re-add to put us back in the pre-commit state + s.delete(node.location) + s.add(node) + await s.save() + t.strictSame(s.data, postCommit, 'committed changes to data') + t.strictSame(require(s.filename), s.data, 'saved json matches data') + }) t.end() }) -t.test('load shrinkwrap if no package-lock.json present', t => { +t.test('load shrinkwrap if no package-lock.json present', async t => { const dir = t.testdir({ 'npm-shrinkwrap.json': JSON.stringify({ lockfileVersion: 1, @@ -656,41 +655,39 @@ t.test('load shrinkwrap if no package-lock.json present', t => { version: '1.2.3', }), }) - return Promise.all([ - Shrinkwrap.load({ path: dir, shrinkwrapOnly: true }).then(s => - t.equal(s.type, 'npm-shrinkwrap.json', 'loaded with swonly')), - Shrinkwrap.reset({ path: dir, shrinkwrapOnly: true }).then(s => - t.equal(s.type, 'npm-shrinkwrap.json', 'loaded fresh')), - Shrinkwrap.load({ path: dir }).then(s => - t.equal(s.type, 'npm-shrinkwrap.json', 'loaded without swonly')), - Shrinkwrap.reset({ path: dir }).then(s => - t.equal(s.type, 'npm-shrinkwrap.json', 'loaded fresh without swonly')), - ]) + let s + s = await Shrinkwrap.load({ path: dir, shrinkwrapOnly: true }) + t.equal(s.type, 'npm-shrinkwrap.json', 'loaded with swonly') + s = await Shrinkwrap.reset({ path: dir, shrinkwrapOnly: true }) + t.equal(s.type, 'npm-shrinkwrap.json', 'loaded fresh') + s = await Shrinkwrap.load({ path: dir }) + t.equal(s.type, 'npm-shrinkwrap.json', 'loaded without swonly') + s = await Shrinkwrap.reset({ path: dir }) + t.equal(s.type, 'npm-shrinkwrap.json', 'loaded fresh without swonly') }) -t.test('load yarn.lock file if present', t => - Shrinkwrap.load({ path: yarnFixture }).then(s => { - t.type(s.yarnLock, YarnLock, 'loaded a yarn lock file') - t.not(s.yarnLock.entries.size, 0, 'got some entries') - })) +t.test('load yarn.lock file if present', async t => { + const s = await Shrinkwrap.load({ path: yarnFixture }) + t.type(s.yarnLock, YarnLock, 'loaded a yarn lock file') + t.not(s.yarnLock.entries.size, 0, 'got some entries') +}) -t.test('save yarn lock if loaded', t => - Shrinkwrap.load({ path: yarnFixture }).then(s => { - s.path = t.testdir() - s.filename = s.path + '/package-lock.json' - return s.save() - .then(() => Shrinkwrap.load({ path: s.path })) - .then(ss => t.strictSame(s.yarnLock, ss.yarnLock)) - })) +t.test('save yarn lock if loaded', async t => { + const s = await Shrinkwrap.load({ path: yarnFixture }) + s.path = t.testdir() + s.filename = s.path + '/package-lock.json' + await s.save() + const ss = await Shrinkwrap.load({ path: s.path }) + t.strictSame(s.yarnLock, ss.yarnLock) +}) -t.test('ignore yarn lock file parse errors', t => { +t.test('ignore yarn lock file parse errors', async t => { const dir = t.testdir({ 'yarn.lock': 'this is not a yarn lock file!', }) - return Shrinkwrap.load({ path: dir }).then(s => { - t.type(s.yarnLock, YarnLock, 'got a yarn lock object because a yarn lock exists') - t.equal(s.yarnLock.entries.size, 0, 'did not get any entries out of it') - }) + const s = await Shrinkwrap.load({ path: dir }) + t.type(s.yarnLock, YarnLock, 'got a yarn lock object because a yarn lock exists') + t.equal(s.yarnLock.entries.size, 0, 'did not get any entries out of it') }) t.test('load a resolution from yarn.lock if we dont have our own', async t => { @@ -811,38 +808,38 @@ t.test('handle missing dependencies object without borking', t => { t.end() }) -t.test('load a hidden lockfile', t => { +t.test('load a hidden lockfile', async t => { // ensure the hidden lockfile is newer than the contents // otherwise this can fail on a fresh checkout. fs.utimesSync(resolve(hiddenLockfileFixture, hidden), new Date(), new Date()) - return Shrinkwrap.load({ + const s = await Shrinkwrap.load({ path: hiddenLockfileFixture, hiddenLockfile: true, - }).then(s => { - t.matchSnapshot(s.data) - // make sure it does not add to the dependencies block when a new - // node is added. - s.data.dependencies = {} - s.add(new Node({ - path: hiddenLockfileFixture + '/node_modules/foo', - pkg: { - name: 'foo', - version: '1.2.3', - _integrity: 'sha512-deadbeef', - _resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz', - }, - })) - t.strictSame(s.data.dependencies, {}, 'did not add to legacy data') - const data = s.commit() - t.equal(data.packages[''], undefined, 'no root entry') - t.equal(data.dependencies, undefined, 'deleted legacy metadata') }) + t.matchSnapshot(s.data) + // make sure it does not add to the dependencies block when a new + // node is added. + s.data.dependencies = {} + s.add(new Node({ + path: hiddenLockfileFixture + '/node_modules/foo', + pkg: { + name: 'foo', + version: '1.2.3', + _integrity: 'sha512-deadbeef', + _resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz', + }, + })) + t.strictSame(s.data.dependencies, {}, 'did not add to legacy data') + const data = s.commit() + t.equal(data.packages[''], undefined, 'no root entry') + t.equal(data.dependencies, undefined, 'deleted legacy metadata') }) -t.test('load a fresh hidden lockfile', t => Shrinkwrap.reset({ - path: hiddenLockfileFixture, - hiddenLockfile: true, -}).then(sw => { +t.test('load a fresh hidden lockfile', async t => { + const sw = await Shrinkwrap.reset({ + path: hiddenLockfileFixture, + hiddenLockfile: true, + }) t.strictSame(sw.data, { lockfileVersion: 3, requires: true, @@ -851,7 +848,7 @@ t.test('load a fresh hidden lockfile', t => Shrinkwrap.reset({ }) t.equal(sw.loadedFromDisk, true) t.equal(sw.filename, resolve(hiddenLockfileFixture, hidden)) -})) +}) t.test('hidden lockfile only used if up to date', async t => { const lockdata = require(resolve(hiddenLockfileFixture, hidden)) @@ -1188,18 +1185,19 @@ t.test('loadActual tests', t => { roots.push('tap-with-yarn-lock') - t.plan(roots.length) - roots.forEach(root => { + for (const root of roots) { const path = resolve(fixtures, root) - t.test(root, t => new Arborist({ path }).loadActual().then(tree => { + t.test(root, async t => { + const tree = await new Arborist({ path }).loadActual() const shrinkwrap = tree.meta.commit() t.matchSnapshot(shrinkwrap, 'shrinkwrap data') if (tree.meta.yarnLock) { const yarnLock = tree.meta.yarnLock.toString() t.matchSnapshot(yarnLock, 'yarn.lock data') } - })) - }) + }) + } + t.end() }) t.test('set integrity because location and resolved match', async t => { diff --git a/workspaces/arborist/test/yarn-lock.js b/workspaces/arborist/test/yarn-lock.js index 06c16556c2384..402afb717e004 100644 --- a/workspaces/arborist/test/yarn-lock.js +++ b/workspaces/arborist/test/yarn-lock.js @@ -86,11 +86,13 @@ t.test('load a yarn lock from an actual tree', t => { resolve(__dirname, 'fixtures/install-types'), resolve(__dirname, 'fixtures/links-all-over'), ] - fixtures.forEach(fixture => t.test(basename(fixture), t => - new Arborist({ path: fixture }).loadActual().then(tree => { + for (const fixture of fixtures) { + t.test(basename(fixture), async t => { + const tree = await new Arborist({ path: fixture }).loadActual() const y = YarnLock.fromTree(tree) t.matchSnapshot(y.toString(), 'yarn.lock from a package tree') - }))) + }) + } t.end() }) diff --git a/workspaces/libnpmversion/lib/version.js b/workspaces/libnpmversion/lib/version.js index 12be89b040df7..f14b95e3233f0 100644 --- a/workspaces/libnpmversion/lib/version.js +++ b/workspaces/libnpmversion/lib/version.js @@ -90,7 +90,9 @@ module.exports = async (newversion, opts) => { } await writeJson(lock, sw) haveLocks.push(lock) - } catch (er) {} + } catch { + // ignore errors + } } if (!ignoreScripts) { diff --git a/workspaces/libnpmversion/test/enforce-clean.js b/workspaces/libnpmversion/test/enforce-clean.js index d96fb09ffa594..3badf47ea5bc4 100644 --- a/workspaces/libnpmversion/test/enforce-clean.js +++ b/workspaces/libnpmversion/test/enforce-clean.js @@ -21,48 +21,42 @@ const enforceClean = requireInject('../lib/enforce-clean.js', { const warnings = [] -t.test('clean, ok', t => - t.resolveMatch(enforceClean({ cwd: 'clean' }), true) - .then(() => t.strictSame(warnings, [])) - .then(() => { - warnings.length = 0 - })) +t.afterEach(() => { + warnings.length = 0 +}) -t.test('unclean, no force, throws', t => - t.rejects(enforceClean({ cwd: 'unclean' })) - .then(() => t.strictSame(warnings, [])) - .then(() => { - warnings.length = 0 - })) +t.test('clean, ok', async t => { + await t.resolveMatch(enforceClean({ cwd: 'clean' }), true) + t.strictSame(warnings, []) +}) -t.test('unclean, forced, no throw', t => - t.resolveMatch(enforceClean({ cwd: 'unclean', force: true }), true) - .then(() => t.strictSame(warnings, [ - [ - 'version', - 'Git working directory not clean, proceeding forcefully.', - ], - ])) - .then(() => { - warnings.length = 0 - })) +t.test('unclean, no force, throws', async t => { + await t.rejects(enforceClean({ cwd: 'unclean' })) + t.strictSame(warnings, []) +}) -t.test('nogit, return false, no throw', t => - t.resolveMatch(enforceClean({ cwd: 'nogit' }), false) - .then(() => t.strictSame(warnings, [ - [ - 'version', - 'This is a Git checkout, but the git command was not found.', - 'npm could not create a Git tag for this release!', - ], - ])) - .then(() => { - warnings.length = 0 - })) +t.test('unclean, forced, no throw', async t => { + await t.resolveMatch(enforceClean({ cwd: 'unclean', force: true }), true) + t.strictSame(warnings, [ + [ + 'version', + 'Git working directory not clean, proceeding forcefully.', + ], + ]) +}) -t.test('other error, throw it', t => - t.rejects(enforceClean({ cwd: 'error' }), new Error('poop')) - .then(() => t.strictSame(warnings, [])) - .then(() => { - warnings.length = 0 - })) +t.test('nogit, return false, no throw', async t => { + await t.resolveMatch(enforceClean({ cwd: 'nogit' }), false) + t.strictSame(warnings, [ + [ + 'version', + 'This is a Git checkout, but the git command was not found.', + 'npm could not create a Git tag for this release!', + ], + ]) +}) + +t.test('other error, throw it', async t => { + await t.rejects(enforceClean({ cwd: 'error' }), new Error('poop')) + t.strictSame(warnings, []) +}) From fa014a5567566c764942600441a5e01c3e2f229b Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 18 Aug 2022 11:45:12 -0700 Subject: [PATCH 085/175] chore: temporarily remove extraneous deps linting from docs #5309 will turn it back on --- docs/.eslintrc.local.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/.eslintrc.local.json diff --git a/docs/.eslintrc.local.json b/docs/.eslintrc.local.json new file mode 100644 index 0000000000000..ed467baedee00 --- /dev/null +++ b/docs/.eslintrc.local.json @@ -0,0 +1 @@ +{ "rules": { "import/no-extraneous-dependencies": "off" } } From 645c6804c09014b96c2d1eff191b174d12a2b7c0 Mon Sep 17 00:00:00 2001 From: KevinBrother <1301239018@qq.com> Date: Thu, 25 Aug 2022 01:19:12 +0800 Subject: [PATCH 086/175] fix: update `index.js` spelling error in comment (#5329) Update index.js 'depdencies' has a spelling problem. --- workspaces/arborist/lib/arborist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/arborist/lib/arborist/index.js b/workspaces/arborist/lib/arborist/index.js index 9564f7648f92c..6bffd843186ea 100644 --- a/workspaces/arborist/lib/arborist/index.js +++ b/workspaces/arborist/lib/arborist/index.js @@ -134,7 +134,7 @@ class Arborist extends Base { return wsDepSet } - // returns a set of root dependencies, excluding depdencies that are + // returns a set of root dependencies, excluding dependencies that are // exclusively workspace dependencies excludeWorkspacesDependencySet (tree) { const rootDepSet = new Set() From 414667a1e6d7d7a3ab0cb64704c3aa696eae8715 Mon Sep 17 00:00:00 2001 From: Kyle West Date: Wed, 24 Aug 2022 11:19:41 -0600 Subject: [PATCH 087/175] docs(dependency-selectors): fix Arborist example in docs (#5328) * [dependency-selectors] fix example in docs * Add async to the function declaration because awaits are used --- docs/content/using-npm/dependency-selectors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/using-npm/dependency-selectors.md b/docs/content/using-npm/dependency-selectors.md index c96057c798ef5..a9433a537f985 100644 --- a/docs/content/using-npm/dependency-selectors.md +++ b/docs/content/using-npm/dependency-selectors.md @@ -144,7 +144,7 @@ const arb = new Arborist({}) ```js // root-level -arb.loadActual((tree) => { +arb.loadActual().then(async (tree) => { // query all production dependencies const results = await tree.querySelectorAll('.prod') console.log(results) @@ -153,7 +153,7 @@ arb.loadActual((tree) => { ```js // iterative -arb.loadActual((tree) => { +arb.loadActual().then(async (tree) => { // query for the deduped version of react const results = await tree.querySelectorAll('#react:not(:deduped)') // query the deduped react for git deps From 356909424f60a26d90faf25594085e79e93f09d5 Mon Sep 17 00:00:00 2001 From: Nathan Hughes Date: Wed, 24 Aug 2022 10:20:00 -0700 Subject: [PATCH 088/175] docs: fix link to dependency selectors page (#5321) fix: correct link to dependency selectors --- docs/content/commands/npm-query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/commands/npm-query.md b/docs/content/commands/npm-query.md index 424b9e7e45ae8..c6303c2eb963d 100644 --- a/docs/content/commands/npm-query.md +++ b/docs/content/commands/npm-query.md @@ -232,5 +232,5 @@ This value is not exported to the environment for child processes. ## See Also -* [dependency selector](/using-npm/dependency-selector) +* [dependency selectors](/using-npm/dependency-selectors) From ea5e3a319a7c1b5f7f2a66284227a34b79b2c831 Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 23 Aug 2022 08:23:20 -0700 Subject: [PATCH 089/175] fix: inline single-use functions --- workspaces/arborist/lib/add-rm-pkg-deps.js | 131 ++++++++-------- .../arborist/lib/arborist/build-ideal-tree.js | 148 ++++++------------ 2 files changed, 112 insertions(+), 167 deletions(-) diff --git a/workspaces/arborist/lib/add-rm-pkg-deps.js b/workspaces/arborist/lib/add-rm-pkg-deps.js index f59df359e9456..7b43c38e2492b 100644 --- a/workspaces/arborist/lib/add-rm-pkg-deps.js +++ b/workspaces/arborist/lib/add-rm-pkg-deps.js @@ -4,8 +4,67 @@ const log = require('proc-log') const localeCompare = require('@isaacs/string-locale-compare')('en') const add = ({ pkg, add, saveBundle, saveType }) => { - for (const spec of add) { - addSingle({ pkg, spec, saveBundle, saveType }) + for (const { name, rawSpec } of add) { + // if the user does not give us a type, we infer which type(s) + // to keep based on the same order of priority we do when + // building the tree as defined in the _loadDeps method of + // the node class. + if (!saveType) { + saveType = inferSaveType(pkg, name) + } + + if (saveType === 'prod') { + // a production dependency can only exist as production (rpj ensures it + // doesn't coexist w/ optional) + deleteSubKey(pkg, 'devDependencies', name, 'dependencies') + deleteSubKey(pkg, 'peerDependencies', name, 'dependencies') + } else if (saveType === 'dev') { + // a dev dependency may co-exist as peer, or optional, but not production + deleteSubKey(pkg, 'dependencies', name, 'devDependencies') + } else if (saveType === 'optional') { + // an optional dependency may co-exist as dev (rpj ensures it doesn't + // coexist w/ prod) + deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies') + } else { // peer or peerOptional is all that's left + // a peer dependency may coexist as dev + deleteSubKey(pkg, 'dependencies', name, 'peerDependencies') + deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies') + } + + const depType = saveTypeMap.get(saveType) + + pkg[depType] = pkg[depType] || {} + if (rawSpec !== '' || pkg[depType][name] === undefined) { + pkg[depType][name] = rawSpec || '*' + } + if (saveType === 'optional') { + // Affordance for previous npm versions that require this behaviour + pkg.dependencies = pkg.dependencies || {} + pkg.dependencies[name] = pkg.optionalDependencies[name] + } + + if (saveType === 'peer' || saveType === 'peerOptional') { + const pdm = pkg.peerDependenciesMeta || {} + if (saveType === 'peer' && pdm[name] && pdm[name].optional) { + pdm[name].optional = false + } else if (saveType === 'peerOptional') { + pdm[name] = pdm[name] || {} + pdm[name].optional = true + pkg.peerDependenciesMeta = pdm + } + // peerDeps are often also a devDep, so that they can be tested when + // using package managers that don't auto-install peer deps + if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) { + pkg.devDependencies[name] = pkg.peerDependencies[name] + } + } + + if (saveBundle && saveType !== 'peer' && saveType !== 'peerOptional') { + // keep it sorted, keep it unique + const bd = new Set(pkg.bundleDependencies || []) + bd.add(name) + pkg.bundleDependencies = [...bd].sort(localeCompare) + } } return pkg @@ -21,71 +80,6 @@ const saveTypeMap = new Map([ ['peer', 'peerDependencies'], ]) -const addSingle = ({ pkg, spec, saveBundle, saveType }) => { - const { name, rawSpec } = spec - - // if the user does not give us a type, we infer which type(s) - // to keep based on the same order of priority we do when - // building the tree as defined in the _loadDeps method of - // the node class. - if (!saveType) { - saveType = inferSaveType(pkg, spec.name) - } - - if (saveType === 'prod') { - // a production dependency can only exist as production (rpj ensures it - // doesn't coexist w/ optional) - deleteSubKey(pkg, 'devDependencies', name, 'dependencies') - deleteSubKey(pkg, 'peerDependencies', name, 'dependencies') - } else if (saveType === 'dev') { - // a dev dependency may co-exist as peer, or optional, but not production - deleteSubKey(pkg, 'dependencies', name, 'devDependencies') - } else if (saveType === 'optional') { - // an optional dependency may co-exist as dev (rpj ensures it doesn't - // coexist w/ prod) - deleteSubKey(pkg, 'peerDependencies', name, 'optionalDependencies') - } else { // peer or peerOptional is all that's left - // a peer dependency may coexist as dev - deleteSubKey(pkg, 'dependencies', name, 'peerDependencies') - deleteSubKey(pkg, 'optionalDependencies', name, 'peerDependencies') - } - - const depType = saveTypeMap.get(saveType) - - pkg[depType] = pkg[depType] || {} - if (rawSpec !== '' || pkg[depType][name] === undefined) { - pkg[depType][name] = rawSpec || '*' - } - if (saveType === 'optional') { - // Affordance for previous npm versions that require this behaviour - pkg.dependencies = pkg.dependencies || {} - pkg.dependencies[name] = pkg.optionalDependencies[name] - } - - if (saveType === 'peer' || saveType === 'peerOptional') { - const pdm = pkg.peerDependenciesMeta || {} - if (saveType === 'peer' && pdm[name] && pdm[name].optional) { - pdm[name].optional = false - } else if (saveType === 'peerOptional') { - pdm[name] = pdm[name] || {} - pdm[name].optional = true - pkg.peerDependenciesMeta = pdm - } - // peerDeps are often also a devDep, so that they can be tested when - // using package managers that don't auto-install peer deps - if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) { - pkg.devDependencies[name] = pkg.peerDependencies[name] - } - } - - if (saveBundle && saveType !== 'peer' && saveType !== 'peerOptional') { - // keep it sorted, keep it unique - const bd = new Set(pkg.bundleDependencies || []) - bd.add(spec.name) - pkg.bundleDependencies = [...bd].sort(localeCompare) - } -} - // Finds where the package is already in the spec and infers saveType from that const inferSaveType = (pkg, name) => { for (const saveType of saveTypeMap.keys()) { @@ -103,9 +97,8 @@ const inferSaveType = (pkg, name) => { return 'prod' } -const { hasOwnProperty } = Object.prototype const hasSubKey = (pkg, depType, name) => { - return pkg[depType] && hasOwnProperty.call(pkg[depType], name) + return pkg[depType] && Object.prototype.hasOwnProperty.call(pkg[depType], name) } // Removes a subkey and warns about it if it's being replaced diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 31a4e8c821a8c..64d72bedacb1c 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -81,18 +81,11 @@ const _linkNodes = Symbol('linkNodes') const _follow = Symbol('follow') const _globalStyle = Symbol('globalStyle') const _globalRootNode = Symbol('globalRootNode') -const _isVulnerable = Symbol.for('isVulnerable') const _usePackageLock = Symbol.for('usePackageLock') const _rpcache = Symbol.for('realpathCache') const _stcache = Symbol.for('statCache') -const _updateFilePath = Symbol('updateFilePath') -const _followSymlinkPath = Symbol('followSymlinkPath') -const _getRelpathSpec = Symbol('getRelpathSpec') -const _retrieveSpecName = Symbol('retrieveSpecName') const _strictPeerDeps = Symbol('strictPeerDeps') const _checkEngineAndPlatform = Symbol('checkEngineAndPlatform') -const _checkEngine = Symbol('checkEngine') -const _checkPlatform = Symbol('checkPlatform') const _virtualRoots = Symbol('virtualRoots') const _virtualRoot = Symbol('virtualRoot') const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') @@ -228,34 +221,22 @@ module.exports = cls => class IdealTreeBuilder extends cls { } async [_checkEngineAndPlatform] () { + const { engineStrict, npmVersion, nodeVersion } = this.options for (const node of this.idealTree.inventory.values()) { if (!node.optional) { - this[_checkEngine](node) - this[_checkPlatform](node) - } - } - } - - [_checkPlatform] (node) { - checkPlatform(node.package, this[_force]) - } - - [_checkEngine] (node) { - const { engineStrict, npmVersion, nodeVersion } = this.options - const c = () => - checkEngine(node.package, npmVersion, nodeVersion, this[_force]) - - if (engineStrict) { - c() - } else { - try { - c() - } catch (er) { - log.warn(er.code, er.message, { - package: er.pkgid, - required: er.required, - current: er.current, - }) + try { + checkEngine(node.package, npmVersion, nodeVersion, this[_force]) + } catch (err) { + if (engineStrict) { + throw err + } + log.warn(err.code, err.message, { + package: err.pkgid, + required: err.required, + current: err.current, + }) + } + checkPlatform(node.package, this[_force]) } } } @@ -533,82 +514,57 @@ Try using the package name instead, e.g: // This returns a promise because we might not have the name yet, // and need to call pacote.manifest to find the name. async [_add] (tree, { add, saveType = null, saveBundle = false }) { + const path = this.idealTree.target.path // get the name for each of the specs in the list. // ie, doing `foo@bar` we just return foo // but if it's a url or git, we don't know the name until we // fetch it and look in its manifest. - const resolvedAdd = await Promise.all(add.map(async rawSpec => { + await Promise.all(add.map(async rawSpec => { // We do NOT provide the path to npa here, because user-additions // need to be resolved relative to the CWD the user is in. - const spec = await this[_retrieveSpecName](npa(rawSpec)) - .then(spec => this[_updateFilePath](spec)) - .then(spec => this[_followSymlinkPath](spec)) + let spec = npa(rawSpec) + + // if it's just @'' then we reload whatever's there, or get latest + // if it's an explicit tag, we need to install that specific tag version + const isTag = spec.rawSpec && spec.type === 'tag' + + // look up the names of file/directory/git specs + if (!spec.name || isTag) { + const mani = await pacote.manifest(spec, { ...this.options }) + if (isTag) { + // translate tag to a version + spec = npa(`${mani.name}@${mani.version}`) + } + spec.name = mani.name + } + + const { name } = spec + if (spec.type === 'file') { + spec = npa(`file:${relpath(path, spec.fetchSpec).replace(/#/g, '%23')}`, path) + spec.name = name + } else if (spec.type === 'directory') { + try { + const real = await realpath(spec.fetchSpec, this[_rpcache], this[_stcache]) + spec = npa(`file:${relpath(path, real).replace(/#/g, '%23')}`, path) + spec.name = name + } catch { + // TODO: create synthetic test case to simulate realpath failure + } + } spec.tree = tree - return spec + this[_resolvedAdd].push(spec) })) - this[_resolvedAdd].push(...resolvedAdd) - // now resolvedAdd is a list of spec objects with names. + + // now this._resolvedAdd is a list of spec objects with names. // find a home for each of them! addRmPkgDeps.add({ pkg: tree.package, - add: resolvedAdd, + add: this[_resolvedAdd], saveBundle, saveType, - path: this.path, }) } - async [_retrieveSpecName] (spec) { - // if it's just @'' then we reload whatever's there, or get latest - // if it's an explicit tag, we need to install that specific tag version - const isTag = spec.rawSpec && spec.type === 'tag' - - if (spec.name && !isTag) { - return spec - } - - const mani = await pacote.manifest(spec, { ...this.options }) - // if it's a tag type, then we need to run it down to an actual version - if (isTag) { - return npa(`${mani.name}@${mani.version}`) - } - - spec.name = mani.name - return spec - } - - async [_updateFilePath] (spec) { - if (spec.type === 'file') { - return this[_getRelpathSpec](spec, spec.fetchSpec) - } - - return spec - } - - async [_followSymlinkPath] (spec) { - if (spec.type === 'directory') { - const real = await ( - realpath(spec.fetchSpec, this[_rpcache], this[_stcache]) - // TODO: create synthetic test case to simulate realpath failure - .catch(/* istanbul ignore next */() => null) - ) - - return this[_getRelpathSpec](spec, real) - } - return spec - } - - [_getRelpathSpec] (spec, filepath) { - /* istanbul ignore else - should also be covered by realpath failure */ - if (filepath) { - const { name } = spec - const tree = this.idealTree.target - spec = npa(`file:${relpath(tree.path, filepath).replace(/#/g, '%23')}`, tree.path) - spec.name = name - } - return spec - } - // TODO: provide a way to fix bundled deps by exposing metadata about // what's in the bundle at each published manifest. Without that, we // can't possibly fix bundled deps without breaking a ton of other stuff, @@ -686,10 +642,6 @@ Try using the package name instead, e.g: } } - [_isVulnerable] (node) { - return this.auditReport && this.auditReport.isVulnerable(node) - } - [_avoidRange] (name) { if (!this.auditReport) { return null @@ -1234,7 +1186,7 @@ This is a one-time fix-up, please be patient... } // fixing a security vulnerability with this package, problem - if (this[_isVulnerable](edge.to)) { + if (this.auditReport && this.auditReport.isVulnerable(edge.to)) { return true } From 1e841029917817556207c39d25be1ea91e2959e7 Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 24 Aug 2022 07:19:31 -0700 Subject: [PATCH 090/175] fix: create links relative to the target Added link deps need to be relative to the package they're being added to, not the project root. In the past the project root was the only place you could add things but workspaces changed this. --- .../arborist/lib/arborist/build-ideal-tree.js | 17 +- .../arborist/build-ideal-tree.js.test.cjs | 201 ++++++++++++++++++ .../test/arborist/build-ideal-tree.js | 13 ++ 3 files changed, 223 insertions(+), 8 deletions(-) diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 64d72bedacb1c..e9a8720d7322d 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -511,17 +511,18 @@ Try using the package name instead, e.g: this[_depsQueue].push(tree) } - // This returns a promise because we might not have the name yet, - // and need to call pacote.manifest to find the name. + // This returns a promise because we might not have the name yet, and need to + // call pacote.manifest to find the name. async [_add] (tree, { add, saveType = null, saveBundle = false }) { - const path = this.idealTree.target.path + // If we have a link it will need to be added relative to the target's path + const path = tree.target.path + // get the name for each of the specs in the list. - // ie, doing `foo@bar` we just return foo - // but if it's a url or git, we don't know the name until we - // fetch it and look in its manifest. + // ie, doing `foo@bar` we just return foo but if it's a url or git, we + // don't know the name until we fetch it and look in its manifest. await Promise.all(add.map(async rawSpec => { - // We do NOT provide the path to npa here, because user-additions - // need to be resolved relative to the CWD the user is in. + // We do NOT provide the path to npa here, because user-additions need to + // be resolved relative to the tree being added to. let spec = npa(rawSpec) // if it's just @'' then we reload whatever's there, or get latest diff --git a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs index 1b1e2d55da5de..42327a9db1924 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs @@ -1470,6 +1470,207 @@ ArboristNode { } ` +exports[`test/arborist/build-ideal-tree.js TAP add one workspace to another > tree with workspace a added to workspace c 1`] = ` +ArboristNode { + "children": Map { + "a" => ArboristLink { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "a", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/a", + "type": "workspace", + }, + EdgeIn { + "from": "packages/c", + "name": "a", + "spec": "file:../a", + "type": "prod", + }, + }, + "isWorkspace": true, + "location": "node_modules/a", + "name": "a", + "path": "{CWD}/test/fixtures/workspaces-not-root/node_modules/a", + "realpath": "{CWD}/test/fixtures/workspaces-not-root/packages/a", + "resolved": "file:../packages/a", + "target": ArboristNode { + "location": "packages/a", + }, + "version": "1.2.3", + }, + "abbrev" => ArboristNode { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "abbrev", + "spec": "*", + "type": "prod", + }, + EdgeIn { + "from": "packages/b", + "name": "abbrev", + "spec": "*", + "type": "prod", + }, + EdgeIn { + "from": "packages/c", + "name": "abbrev", + "spec": "*", + "type": "prod", + }, + }, + "location": "node_modules/abbrev", + "name": "abbrev", + "path": "{CWD}/test/fixtures/workspaces-not-root/node_modules/abbrev", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "version": "1.1.1", + }, + "b" => ArboristLink { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "b", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/b", + "type": "workspace", + }, + }, + "isWorkspace": true, + "location": "node_modules/b", + "name": "b", + "path": "{CWD}/test/fixtures/workspaces-not-root/node_modules/b", + "realpath": "{CWD}/test/fixtures/workspaces-not-root/packages/b", + "resolved": "file:../packages/b", + "target": ArboristNode { + "location": "packages/b", + }, + "version": "1.2.3", + }, + "c" => ArboristLink { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "c", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/c", + "type": "workspace", + }, + }, + "isWorkspace": true, + "location": "node_modules/c", + "name": "c", + "path": "{CWD}/test/fixtures/workspaces-not-root/node_modules/c", + "realpath": "{CWD}/test/fixtures/workspaces-not-root/packages/c", + "resolved": "file:../packages/c", + "target": ArboristNode { + "location": "packages/c", + }, + "version": "1.2.3", + }, + "wrappy" => ArboristNode { + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "wrappy", + "spec": "1.0.0", + "type": "prod", + }, + }, + "location": "node_modules/wrappy", + "name": "wrappy", + "path": "{CWD}/test/fixtures/workspaces-not-root/node_modules/wrappy", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.0.tgz", + "version": "1.0.0", + }, + }, + "edgesOut": Map { + "a" => EdgeOut { + "name": "a", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/a", + "to": "node_modules/a", + "type": "workspace", + }, + "abbrev" => EdgeOut { + "name": "abbrev", + "spec": "*", + "to": "node_modules/abbrev", + "type": "prod", + }, + "b" => EdgeOut { + "name": "b", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/b", + "to": "node_modules/b", + "type": "workspace", + }, + "c" => EdgeOut { + "name": "c", + "spec": "file:{CWD}/test/fixtures/workspaces-not-root/packages/c", + "to": "node_modules/c", + "type": "workspace", + }, + "wrappy" => EdgeOut { + "name": "wrappy", + "spec": "1.0.0", + "to": "node_modules/wrappy", + "type": "prod", + }, + }, + "fsChildren": Set { + ArboristNode { + "isWorkspace": true, + "location": "packages/a", + "name": "a", + "path": "{CWD}/test/fixtures/workspaces-not-root/packages/a", + "version": "1.2.3", + }, + ArboristNode { + "edgesOut": Map { + "abbrev" => EdgeOut { + "name": "abbrev", + "spec": "*", + "to": "node_modules/abbrev", + "type": "prod", + }, + }, + "isWorkspace": true, + "location": "packages/b", + "name": "b", + "path": "{CWD}/test/fixtures/workspaces-not-root/packages/b", + "version": "1.2.3", + }, + ArboristNode { + "edgesOut": Map { + "a" => EdgeOut { + "name": "a", + "spec": "file:../a", + "to": "node_modules/a", + "type": "prod", + }, + "abbrev" => EdgeOut { + "name": "abbrev", + "spec": "*", + "to": "node_modules/abbrev", + "type": "prod", + }, + }, + "isWorkspace": true, + "location": "packages/c", + "name": "c", + "path": "{CWD}/test/fixtures/workspaces-not-root/packages/c", + "version": "1.2.3", + }, + }, + "isProjectRoot": true, + "location": "", + "name": "workspaces-not-root", + "path": "{CWD}/test/fixtures/workspaces-not-root", + "workspaces": Map { + "a" => "packages/a", + "b" => "packages/b", + "c" => "packages/c", + }, +} +` + exports[`test/arborist/build-ideal-tree.js TAP add packages to workspaces, not root > tree with abbrev removed from a and b 1`] = ` ArboristNode { "children": Map { diff --git a/workspaces/arborist/test/arborist/build-ideal-tree.js b/workspaces/arborist/test/arborist/build-ideal-tree.js index 87783086b65c3..0f7c5fecf4fd9 100644 --- a/workspaces/arborist/test/arborist/build-ideal-tree.js +++ b/workspaces/arborist/test/arborist/build-ideal-tree.js @@ -2674,6 +2674,19 @@ t.test('add packages to workspaces, not root', async t => { t.matchSnapshot(printTree(rmTree), 'tree with abbrev removed from a and b') }) +t.test('add one workspace to another', async t => { + const path = resolve(__dirname, '../fixtures/workspaces-not-root') + const packageA = resolve(path, 'packages/a') + + const addTree = await buildIdeal(path, { + add: [packageA], + workspaces: ['c'], + }) + const c = addTree.children.get('c').target + t.match(c.edgesOut.get('a'), { spec: 'file:../a' }) + t.matchSnapshot(printTree(addTree), 'tree with workspace a added to workspace c') +}) + t.test('workspace error handling', async t => { const path = t.testdir({ 'package.json': JSON.stringify({ From 53037b30d9657a378fb750f8c51bdb65f224fad0 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 25 Aug 2022 10:41:27 -0700 Subject: [PATCH 091/175] chore(docs): add npmrc docs about scoping auth related config --- docs/content/configuring-npm/npmrc.md | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/content/configuring-npm/npmrc.md b/docs/content/configuring-npm/npmrc.md index 83310ffa9c7f2..d252f09b81a68 100644 --- a/docs/content/configuring-npm/npmrc.md +++ b/docs/content/configuring-npm/npmrc.md @@ -91,6 +91,34 @@ consistent across updates. Set fields in here using the `./configure` script that comes with npm. This is primarily for distribution maintainers to override default configs in a standard and consistent manner. +### Auth related configuration + +The settings `_auth`, `_authToken`, `username` and `_password` must all be +scoped to a specific registry. This ensures that `npm` will never send +credentials to the wrong host. + +In order to scope these values, they must be prefixed by a URI fragment. +If the credential is meant for any request to a registry on a single host, +the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a +specific path on the host that path may also be provided, such as +`//my-custom-registry.org/unique/path:`. + +``` +; bad config +_authToken=MYTOKEN + +; good config +@myorg:registry=https://somewhere-else.com/myorg +@another:registry=https://somewhere-else.com/another +//registry.npmjs.org/:_authToken=MYTOKEN +; would apply to both @myorg and @another +; //somewhere-else.com/:_authToken=MYTOKEN +; would apply only to @myorg +//somewhere-else.com/myorg/:_authToken=MYTOKEN1 +; would apply only to @another +//somewhere-else.com/another/:_authToken=MYTOKEN2 +``` + ### See also * [npm folders](/configuring-npm/folders) From 25618229b7698aa8abbfcd2ef32024809f05a1a1 Mon Sep 17 00:00:00 2001 From: nlf Date: Thu, 25 Aug 2022 11:33:21 -0700 Subject: [PATCH 092/175] deps: @npmcli/config@4.2.2 --- node_modules/@npmcli/config/lib/index.js | 14 ++++++++++++-- node_modules/@npmcli/config/package.json | 6 +++--- package-lock.json | 6 +++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/node_modules/@npmcli/config/lib/index.js b/node_modules/@npmcli/config/lib/index.js index 93fbcad72bc79..fe5cfd2aa9ed5 100644 --- a/node_modules/@npmcli/config/lib/index.js +++ b/node_modules/@npmcli/config/lib/index.js @@ -767,6 +767,11 @@ class Config { const nerfed = nerfDart(uri) const creds = {} + const deprecatedAuthWarning = [ + '`_auth`, `_authToken`, `username` and `_password` must be scoped to a registry.', + 'see `npm help npmrc` for more information.', + ].join(' ') + const email = this.get(`${nerfed}:email`) || this.get('email') if (email) { creds.email = email @@ -780,10 +785,13 @@ class Config { // cert/key may be used in conjunction with other credentials, thus no `return` } - const tokenReg = this.get(`${nerfed}:_authToken`) || - nerfed === nerfDart(this.get('registry')) && this.get('_authToken') + const defaultToken = nerfDart(this.get('registry')) && this.get('_authToken') + const tokenReg = this.get(`${nerfed}:_authToken`) || defaultToken if (tokenReg) { + if (tokenReg === defaultToken) { + log.warn('config', deprecatedAuthWarning) + } creds.token = tokenReg return creds } @@ -818,6 +826,7 @@ class Config { const userDef = this.get('username') const passDef = this.get('_password') if (userDef && passDef) { + log.warn('config', deprecatedAuthWarning) creds.username = userDef creds.password = Buffer.from(passDef, 'base64').toString('utf8') const auth = `${creds.username}:${creds.password}` @@ -832,6 +841,7 @@ class Config { return creds } + log.warn('config', deprecatedAuthWarning) const authDecode = Buffer.from(auth, 'base64').toString('utf8') const authSplit = authDecode.split(':') creds.username = authSplit.shift() diff --git a/node_modules/@npmcli/config/package.json b/node_modules/@npmcli/config/package.json index 275044e4ae48e..81c36228c6b4a 100644 --- a/node_modules/@npmcli/config/package.json +++ b/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "4.2.1", + "version": "4.2.2", "files": [ "bin/", "lib/" @@ -31,7 +31,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.6.0", "tap": "^16.0.1" }, "dependencies": { @@ -49,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.6.0" } } diff --git a/package-lock.json b/package-lock.json index ce443bce578ac..f34578380f20b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -878,9 +878,9 @@ } }, "node_modules/@npmcli/config": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.1.tgz", - "integrity": "sha512-iJEnXNAGGr7sGUcoKmeJNrc943vFiWrDWq6DNK/t+SuqoObmozMb3tN3G5T9yo3uBf5Cw4h+SWgoqSaiwczl0Q==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.2.2.tgz", + "integrity": "sha512-5GNcLd+0c4bYBnFop53+26CO5GQP0R9YcxlernohpHDWdIgzUg9I0+GEMk3sNHnLntATVU39d283A4OO+W402w==", "inBundle": true, "dependencies": { "@npmcli/map-workspaces": "^2.0.2", From d94a9f56cce1de32bfd87f841d7678e8394d8ea6 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 25 Aug 2022 09:46:12 -0700 Subject: [PATCH 093/175] feat: add deprecation warnings to access commands --- docs/content/commands/npm-access.md | 13 ++++++------- lib/commands/access.js | 16 ++++++++++++++- test/lib/commands/access.js | 30 ++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/docs/content/commands/npm-access.md b/docs/content/commands/npm-access.md index 162e94f1fec02..f7a98af654714 100644 --- a/docs/content/commands/npm-access.md +++ b/docs/content/commands/npm-access.md @@ -35,29 +35,28 @@ For all of the subcommands, `npm access` will perform actions on the packages in the current working directory if no package name is passed to the subcommand. -* public / restricted: +* public / restricted (deprecated): Set a package to be either publicly accessible or restricted. -* grant / revoke: +* grant / revoke (deprecated): Add or remove the ability of users and teams to have read-only or read-write access to a package. -* 2fa-required / 2fa-not-required: +* 2fa-required / 2fa-not-required (deprecated): Configure whether a package requires that anyone publishing it have two-factor authentication enabled on their account. -* ls-packages: +* ls-packages (deprecated): Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole registry listing) -* ls-collaborators: +* ls-collaborators (deprecated): Show all of the access privileges for a package. Will only show permissions for packages to which you have at least read access. If `` is passed in, the list is filtered only to teams _that_ user happens to belong to. -* edit: - Set the access privileges for a package at once using `$EDITOR`. +* edit (not implemented) ### Details diff --git a/lib/commands/access.js b/lib/commands/access.js index 0a80da8ddd006..3621861537171 100644 --- a/lib/commands/access.js +++ b/lib/commands/access.js @@ -5,6 +5,7 @@ const readPackageJson = require('read-package-json-fast') const otplease = require('../utils/otplease.js') const getIdentity = require('../utils/get-identity.js') +const log = require('../utils/log-shim.js') const BaseCommand = require('../base-command.js') const subcommands = [ @@ -19,6 +20,15 @@ const subcommands = [ '2fa-not-required', ] +const deprecated = [ + '2fa-not-required', + '2fa-required', + 'ls-collaborators', + 'ls-packages', + 'public', + 'restricted', +] + class Access extends BaseCommand { static description = 'Set access level on published packages' static name = 'access' @@ -78,6 +88,10 @@ class Access extends BaseCommand { throw this.usageError(`${cmd} is not a recognized subcommand.`) } + if (deprecated.includes(cmd)) { + log.warn('access', `${cmd} subcommand will be removed in the next version of npm`) + } + return this[cmd](args, { ...this.npm.flatOptions, }) @@ -175,7 +189,7 @@ class Access extends BaseCommand { } async edit () { - throw new Error('edit subcommand is not implemented yet') + throw new Error('edit subcommand is not implemented') } modifyPackage (pkg, opts, fn, requireScope = true) { diff --git a/test/lib/commands/access.js b/test/lib/commands/access.js index 130522b3be3e4..aa748b10681df 100644 --- a/test/lib/commands/access.js +++ b/test/lib/commands/access.js @@ -57,7 +57,7 @@ t.test('edit', async t => { const { npm } = await loadMockNpm(t) await t.rejects( npm.exec('access', ['edit', '@scoped/another']), - /edit subcommand is not implemented yet/, + /edit subcommand is not implemented/, 'should throw not implemented yet error' ) }) @@ -79,7 +79,7 @@ t.test('access public on unscoped package', async t => { t.test('access public on scoped package', async t => { const name = '@scoped/npm-access-public-pkg' - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -94,6 +94,7 @@ t.test('access public on scoped package', async t => { }) registry.access({ spec: name, access: 'public' }) await npm.exec('access', ['public']) + t.match(logs.warn[0], ['access', 'public subcommand will be removed in the next version of npm']) t.equal(joinedOutput(), '') }) @@ -137,7 +138,7 @@ t.test('access restricted on unscoped package', async t => { t.test('access restricted on scoped package', async t => { const name = '@scoped/npm-access-restricted-pkg' - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -152,6 +153,9 @@ t.test('access restricted on scoped package', async t => { }) registry.access({ spec: name, access: 'restricted' }) await npm.exec('access', ['restricted']) + t.match(logs.warn[0], + ['access', 'restricted subcommand will be removed in the next version of npm'] + ) t.equal(joinedOutput(), '') }) @@ -274,7 +278,7 @@ t.test('access grant malformed team arg', async t => { }) t.test('access 2fa-required', async t => { - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -286,11 +290,14 @@ t.test('access 2fa-required', async t => { }) registry.access({ spec: '@scope/pkg', publishRequires2fa: true }) await npm.exec('access', ['2fa-required', '@scope/pkg']) + t.match(logs.warn[0], + ['access', '2fa-required subcommand will be removed in the next version of npm'] + ) t.equal(joinedOutput(), '') }) t.test('access 2fa-not-required', async t => { - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -302,6 +309,9 @@ t.test('access 2fa-not-required', async t => { }) registry.access({ spec: '@scope/pkg', publishRequires2fa: false }) await npm.exec('access', ['2fa-not-required', '@scope/pkg']) + t.match(logs.warn[0], + ['access', '2fa-not-required subcommand will be removed in the next version of npm'] + ) t.equal(joinedOutput(), '') }) @@ -348,7 +358,7 @@ t.test('access revoke malformed team arg', async t => { }) t.test('npm access ls-packages with no team', async t => { - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -363,6 +373,9 @@ t.test('npm access ls-packages with no team', async t => { registry.whoami({ username: team }) registry.lsPackages({ team, packages }) await npm.exec('access', ['ls-packages']) + t.match(logs.warn[0], + ['access', 'ls-packages subcommand will be removed in the next version of npm'] + ) t.match(JSON.parse(joinedOutput()), packages) }) @@ -385,7 +398,7 @@ t.test('access ls-packages on team', async t => { }) t.test('access ls-collaborators on current', async t => { - const { npm, joinedOutput } = await loadMockNpm(t, { + const { npm, joinedOutput, logs } = await loadMockNpm(t, { config: { ...auth, }, @@ -403,6 +416,9 @@ t.test('access ls-collaborators on current', async t => { const collaborators = { 'test-user': 'read-write' } registry.lsCollaborators({ spec: 'yargs', collaborators }) await npm.exec('access', ['ls-collaborators']) + t.match(logs.warn[0], + ['access', 'ls-collaborators subcommand will be removed in the next version of npm'] + ) t.match(JSON.parse(joinedOutput()), collaborators) }) From a79ee00b530b765ed219e81de77c37057c373adf Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:18:20 -0700 Subject: [PATCH 094/175] deps: cacache@16.1.3 --- node_modules/cacache/package.json | 4 +- .../coverage/__root__/index.html | 73 ------- .../coverage/__root__/index.js.html | 69 ------- .../unique-filename/coverage/base.css | 182 ------------------ .../unique-filename/coverage/index.html | 73 ------- .../unique-filename/coverage/prettify.css | 1 - .../unique-filename/coverage/prettify.js | 1 - .../coverage/sort-arrow-sprite.png | Bin 209 -> 0 bytes .../unique-filename/coverage/sorter.js | 156 --------------- .../unique-filename/{ => lib}/index.js | 1 - node_modules/unique-filename/package.json | 37 +++- node_modules/unique-filename/test/index.js | 23 --- package-lock.json | 25 ++- package.json | 2 +- workspaces/arborist/package.json | 2 +- 15 files changed, 48 insertions(+), 601 deletions(-) delete mode 100644 node_modules/unique-filename/coverage/__root__/index.html delete mode 100644 node_modules/unique-filename/coverage/__root__/index.js.html delete mode 100644 node_modules/unique-filename/coverage/base.css delete mode 100644 node_modules/unique-filename/coverage/index.html delete mode 100644 node_modules/unique-filename/coverage/prettify.css delete mode 100644 node_modules/unique-filename/coverage/prettify.js delete mode 100644 node_modules/unique-filename/coverage/sort-arrow-sprite.png delete mode 100644 node_modules/unique-filename/coverage/sorter.js rename node_modules/unique-filename/{ => lib}/index.js (93%) delete mode 100644 node_modules/unique-filename/test/index.js diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index 3f19d07d44166..7dbd407d8fccf 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "16.1.2", + "version": "16.1.3", "cache-version": { "content": "2", "index": "5" @@ -65,7 +65,7 @@ "rimraf": "^3.0.2", "ssri": "^9.0.0", "tar": "^6.1.11", - "unique-filename": "^1.1.1" + "unique-filename": "^2.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", diff --git a/node_modules/unique-filename/coverage/__root__/index.html b/node_modules/unique-filename/coverage/__root__/index.html deleted file mode 100644 index cd55391a67a4c..0000000000000 --- a/node_modules/unique-filename/coverage/__root__/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - Code coverage report for __root__/ - - - - - - -
-

Code coverage report for __root__/

-

- Statements: 100% (4 / 4)      - Branches: 100% (2 / 2)      - Functions: 100% (1 / 1)      - Lines: 100% (4 / 4)      - Ignored: none      -

-
All files » __root__/
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.js100%(4 / 4)100%(2 / 2)100%(1 / 1)100%(4 / 4)
-
-
- - - - - - diff --git a/node_modules/unique-filename/coverage/__root__/index.js.html b/node_modules/unique-filename/coverage/__root__/index.js.html deleted file mode 100644 index 02e5768d3fb64..0000000000000 --- a/node_modules/unique-filename/coverage/__root__/index.js.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - Code coverage report for index.js - - - - - - -
-

Code coverage report for index.js

-

- Statements: 100% (4 / 4)      - Branches: 100% (2 / 2)      - Functions: 100% (1 / 1)      - Lines: 100% (4 / 4)      - Ignored: none      -

-
All files » __root__/ » index.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9  -1 -  -1 -  -1 -6 -  - 
'use strict'
-var path = require('path')
- 
-var uniqueSlug = require('unique-slug')
- 
-module.exports = function (filepath, prefix, uniq) {
-  return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq))
-}
- 
- -
- - - - - - diff --git a/node_modules/unique-filename/coverage/base.css b/node_modules/unique-filename/coverage/base.css deleted file mode 100644 index a6a2f3284d022..0000000000000 --- a/node_modules/unique-filename/coverage/base.css +++ /dev/null @@ -1,182 +0,0 @@ -body, html { - margin:0; padding: 0; -} -body { - font-family: Helvetica Neue, Helvetica,Arial; - font-size: 10pt; -} -div.header, div.footer { - background: #eee; - padding: 1em; -} -div.header { - z-index: 100; - position: fixed; - top: 0; - border-bottom: 1px solid #666; - width: 100%; -} -div.footer { - border-top: 1px solid #666; -} -div.body { - margin-top: 10em; -} -div.meta { - font-size: 90%; - text-align: center; -} -h1, h2, h3 { - font-weight: normal; -} -h1 { - font-size: 12pt; -} -h2 { - font-size: 10pt; -} -pre { - font-family: Consolas, Menlo, Monaco, monospace; - margin: 0; - padding: 0; - line-height: 1.3; - font-size: 14px; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} - -div.path { font-size: 110%; } -div.path a:link, div.path a:visited { color: #000; } -table.coverage { border-collapse: collapse; margin:0; padding: 0 } - -table.coverage td { - margin: 0; - padding: 0; - color: #111; - vertical-align: top; -} -table.coverage td.line-count { - width: 50px; - text-align: right; - padding-right: 5px; -} -table.coverage td.line-coverage { - color: #777 !important; - text-align: right; - border-left: 1px solid #666; - border-right: 1px solid #666; -} - -table.coverage td.text { -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 40px; -} -table.coverage td span.cline-neutral { - background: #eee; -} -table.coverage td span.cline-yes { - background: #b5d592; - color: #999; -} -table.coverage td span.cline-no { - background: #fc8c84; -} - -.cstat-yes { color: #111; } -.cstat-no { background: #fc8c84; color: #111; } -.fstat-no { background: #ffc520; color: #111 !important; } -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -.missing-if-branch { - display: inline-block; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: black; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} - -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} - -.entity, .metric { font-weight: bold; } -.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } -.metric small { font-size: 80%; font-weight: normal; color: #666; } - -div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } -div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } -div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } -div.coverage-summary th.file { border-right: none !important; } -div.coverage-summary th.pic { border-left: none !important; text-align: right; } -div.coverage-summary th.pct { border-right: none !important; } -div.coverage-summary th.abs { border-left: none !important; text-align: right; } -div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } -div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } -div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; } -div.coverage-summary td.pic { min-width: 120px !important; } -div.coverage-summary a:link { text-decoration: none; color: #000; } -div.coverage-summary a:visited { text-decoration: none; color: #777; } -div.coverage-summary a:hover { text-decoration: underline; } -div.coverage-summary tfoot td { border-top: 1px solid #666; } - -div.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -div.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -div.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} - -.high { background: #b5d592 !important; } -.medium { background: #ffe87c !important; } -.low { background: #fc8c84 !important; } - -span.cover-fill, span.cover-empty { - display:inline-block; - border:1px solid #444; - background: white; - height: 12px; -} -span.cover-fill { - background: #ccc; - border-right: 1px solid #444; -} -span.cover-empty { - background: white; - border-left: none; -} -span.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } diff --git a/node_modules/unique-filename/coverage/index.html b/node_modules/unique-filename/coverage/index.html deleted file mode 100644 index b10d186cc3978..0000000000000 --- a/node_modules/unique-filename/coverage/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - Code coverage report for All files - - - - - - -
-

Code coverage report for All files

-

- Statements: 100% (4 / 4)      - Branches: 100% (2 / 2)      - Functions: 100% (1 / 1)      - Lines: 100% (4 / 4)      - Ignored: none      -

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
__root__/100%(4 / 4)100%(2 / 2)100%(1 / 1)100%(4 / 4)
-
-
- - - - - - diff --git a/node_modules/unique-filename/coverage/prettify.css b/node_modules/unique-filename/coverage/prettify.css deleted file mode 100644 index b317a7cda31a4..0000000000000 --- a/node_modules/unique-filename/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/node_modules/unique-filename/coverage/prettify.js b/node_modules/unique-filename/coverage/prettify.js deleted file mode 100644 index ef51e03866898..0000000000000 --- a/node_modules/unique-filename/coverage/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/node_modules/unique-filename/coverage/sort-arrow-sprite.png b/node_modules/unique-filename/coverage/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - el = getNthColumn(i).querySelector('.sorter'); - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/node_modules/unique-filename/index.js b/node_modules/unique-filename/lib/index.js similarity index 93% rename from node_modules/unique-filename/index.js rename to node_modules/unique-filename/lib/index.js index 02bf1e273143c..d067d2e709809 100644 --- a/node_modules/unique-filename/index.js +++ b/node_modules/unique-filename/lib/index.js @@ -1,4 +1,3 @@ -'use strict' var path = require('path') var uniqueSlug = require('unique-slug') diff --git a/node_modules/unique-filename/package.json b/node_modules/unique-filename/package.json index bc429aa44b079..0d4ddb45ef11d 100644 --- a/node_modules/unique-filename/package.json +++ b/node_modules/unique-filename/package.json @@ -1,27 +1,48 @@ { "name": "unique-filename", - "version": "1.1.1", + "version": "2.0.0", "description": "Generate a unique filename for use in temporary directories or caches.", - "main": "index.js", + "main": "lib/index.js", "scripts": { - "test": "standard && tap test" + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "repository": { "type": "git", - "url": "https://github.com/iarna/unique-filename.git" + "url": "https://github.com/npm/unique-filename.git" }, "keywords": [], - "author": "Rebecca Turner (http://re-becca.org/)", + "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/iarna/unique-filename/issues" }, "homepage": "https://github.com/iarna/unique-filename", "devDependencies": { - "standard": "^5.4.1", - "tap": "^2.3.1" + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" }, "dependencies": { - "unique-slug": "^2.0.0" + "unique-slug": "^2.0.2" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" } } diff --git a/node_modules/unique-filename/test/index.js b/node_modules/unique-filename/test/index.js deleted file mode 100644 index 105b4e52e8b40..0000000000000 --- a/node_modules/unique-filename/test/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'sue strict' -var t = require('tap') -var uniqueFilename = require('../index.js') - -t.plan(6) - -var randomTmpfile = uniqueFilename('tmp') -t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file') - -var randomAgain = uniqueFilename('tmp') -t.notEqual(randomAgain, randomTmpfile, 'random tmp files are not the same') - -var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test') -t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file') - -var randomPrefixedAgain = uniqueFilename('tmp', 'my-test') -t.notEqual(randomPrefixedAgain, randomPrefixedTmpfile, 'random prefixed tmp files are not the same') - -var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') -t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename') - -var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') -t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename') diff --git a/package-lock.json b/package-lock.json index f34578380f20b..cb98120ca6803 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,7 +100,7 @@ "@npmcli/run-script": "^4.2.1", "abbrev": "~1.1.1", "archy": "~1.0.0", - "cacache": "^16.1.1", + "cacache": "^16.1.3", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -1656,9 +1656,9 @@ } }, "node_modules/cacache": { - "version": "16.1.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.2.tgz", - "integrity": "sha512-Xx+xPlfCZIUHagysjjOAje9nRo8pRDczQCcXb4J2O0BLtH+xeVue6ba4y1kfJfQMAnM2mkcoMIAyOctlaRGWYA==", + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", + "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", "inBundle": true, "dependencies": { "@npmcli/fs": "^2.1.0", @@ -1678,7 +1678,7 @@ "rimraf": "^3.0.2", "ssri": "^9.0.0", "tar": "^6.1.11", - "unique-filename": "^1.1.1" + "unique-filename": "^2.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9857,17 +9857,22 @@ } }, "node_modules/unique-filename": { - "version": "1.1.1", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.0.tgz", + "integrity": "sha512-tpzoz2RpZ//6Zt4GPpOFTyrnfZuSvjIfe8lvx6Thp4yTQwJtAFwPlssEBE62VhGA2We5/COyNpcIu+OABu3/Yg==", "inBundle": true, - "license": "ISC", "dependencies": { - "unique-slug": "^2.0.0" + "unique-slug": "^2.0.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unique-slug": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", "inBundle": true, - "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4" } @@ -10497,7 +10502,7 @@ "@npmcli/query": "^1.1.1", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", - "cacache": "^16.0.6", + "cacache": "^16.1.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", diff --git a/package.json b/package.json index e86e488926e04..f78ec8feef3bf 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@npmcli/run-script": "^4.2.1", "abbrev": "~1.1.1", "archy": "~1.0.0", - "cacache": "^16.1.1", + "cacache": "^16.1.3", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 124cb6650ce00..a7a6b6e9bd5da 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -14,7 +14,7 @@ "@npmcli/query": "^1.1.1", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", - "cacache": "^16.0.6", + "cacache": "^16.1.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", "json-stringify-nice": "^1.1.4", From 26d2e551b250972caa550d56127810648a1663a1 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:19:06 -0700 Subject: [PATCH 095/175] deps: @npmcli/query@1.2.0 --- node_modules/@npmcli/query/lib/index.js | 32 ++++++++++++++++++++++++- node_modules/@npmcli/query/package.json | 2 +- package-lock.json | 8 +++---- workspaces/arborist/package.json | 2 +- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/node_modules/@npmcli/query/lib/index.js b/node_modules/@npmcli/query/lib/index.js index 36a8c700caae1..44f539ee0a125 100644 --- a/node_modules/@npmcli/query/lib/index.js +++ b/node_modules/@npmcli/query/lib/index.js @@ -118,10 +118,40 @@ const fixupNestedPseudo = astNode => { transformAst(newRootNode) } +// :semver(, [selector], [function]) const fixupSemverSpecs = astNode => { - const children = astNode.nodes[0].nodes + // the first child node contains the version or range, most likely as a tag and a series of + // classes. we combine them into a single string here. this is the only required input. + const children = astNode.nodes.shift().nodes const value = children.reduce((res, i) => `${res}${String(i)}`, '') + // next, if we have 2 nodes left then the user called us with a total of 3. that means the + // last one tells us what specific semver function the user is requesting, so we pull that out + let semverFunc + if (astNode.nodes.length === 2) { + const funcNode = astNode.nodes.pop().nodes[0] + if (funcNode.type === 'tag') { + semverFunc = funcNode.value + } + } + + // now if there's a node left, that node is our selector. since that is the last remaining + // child node, we call fixupAttr on ourselves so that the attribute selectors get parsed + if (astNode.nodes.length === 1) { + fixupAttr(astNode) + } else { + // we weren't provided a selector, so we default to `[version]`. note, there's no default + // operator here. that's because we don't know yet if the user has provided us a version + // or range to assert against + astNode.attributeMatcher = { + insensitive: false, + attribute: 'version', + qualifiedAttribute: 'version', + } + astNode.lookupProperties = [] + } + + astNode.semverFunc = semverFunc astNode.semverValue = value astNode.nodes.length = 0 } diff --git a/node_modules/@npmcli/query/package.json b/node_modules/@npmcli/query/package.json index 0c9247e0bb23b..610d0b7189182 100644 --- a/node_modules/@npmcli/query/package.json +++ b/node_modules/@npmcli/query/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/query", - "version": "1.1.1", + "version": "1.2.0", "description": "npm query parser and tools", "main": "lib/index.js", "scripts": { diff --git a/package-lock.json b/package-lock.json index cb98120ca6803..73e6f86df695b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1057,9 +1057,9 @@ } }, "node_modules/@npmcli/query": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.1.1.tgz", - "integrity": "sha512-UF3I0fD94wzQ84vojMO2jDB8ibjRSTqhi8oz2mzVKiJ9gZHbeGlu9kzPvgHuGDK0Hf2cARhWtTfCDHNEwlL9hg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-1.2.0.tgz", + "integrity": "sha512-uWglsUM3PjBLgTSmZ3/vygeGdvWEIZ3wTUnzGFbprC/RtvQSaT+GAXu1DXmSFj2bD3oOZdcRm1xdzsV2z1YWdw==", "dependencies": { "npm-package-arg": "^9.1.0", "postcss-selector-parser": "^6.0.10", @@ -10499,7 +10499,7 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", - "@npmcli/query": "^1.1.1", + "@npmcli/query": "^1.2.0", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.1.3", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index a7a6b6e9bd5da..77a7c71b99d26 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -11,7 +11,7 @@ "@npmcli/name-from-folder": "^1.0.1", "@npmcli/node-gyp": "^2.0.0", "@npmcli/package-json": "^2.0.0", - "@npmcli/query": "^1.1.1", + "@npmcli/query": "^1.2.0", "@npmcli/run-script": "^4.1.3", "bin-links": "^3.0.0", "cacache": "^16.1.3", From 7c7f65629c3dd4fe7fd8254ac38914cf52ad31c2 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:23:52 -0700 Subject: [PATCH 096/175] deps: read-package-json@5.0.2 --- .../npm-normalize-package-bin/LICENSE | 15 +++++ .../npm-normalize-package-bin/lib/index.js | 64 +++++++++++++++++++ .../npm-normalize-package-bin/package.json | 41 ++++++++++++ node_modules/read-package-json/package.json | 8 +-- package-lock.json | 19 ++++-- package.json | 2 +- 6 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 node_modules/read-package-json/node_modules/npm-normalize-package-bin/LICENSE create mode 100644 node_modules/read-package-json/node_modules/npm-normalize-package-bin/lib/index.js create mode 100644 node_modules/read-package-json/node_modules/npm-normalize-package-bin/package.json diff --git a/node_modules/read-package-json/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000..19cec97b18468 --- /dev/null +++ b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 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 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/read-package-json/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/lib/index.js new file mode 100644 index 0000000000000..d6f0a581b9e66 --- /dev/null +++ b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/lib/index.js @@ -0,0 +1,64 @@ +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const { join, basename } = require('path') + +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) + +const normalizeString = pkg => { + if (!pkg.name) { + return removeBin(pkg) + } + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} + +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} + +const removeBin = pkg => { + delete pkg.bin + return pkg +} + +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) + + if (typeof orig[binKey] !== 'string' || !base) { + return + } + + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').slice(1) + + if (!binTarget) { + return + } + + clean[base] = binTarget + hasBins = true + }) + + if (hasBins) { + pkg.bin = clean + } else { + delete pkg.bin + } + + return pkg +} + +module.exports = normalize diff --git a/node_modules/read-package-json/node_modules/npm-normalize-package-bin/package.json b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000..02de808d9b702 --- /dev/null +++ b/node_modules/read-package-json/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,41 @@ +{ + "name": "npm-normalize-package-bin", + "version": "2.0.0", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-normalize-package-bin.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/node_modules/read-package-json/package.json b/node_modules/read-package-json/package.json index 8bb77ca01f653..82d0b72965109 100644 --- a/node_modules/read-package-json/package.json +++ b/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "5.0.1", + "version": "5.0.2", "author": "GitHub Inc.", "description": "The thing npm uses to read package.json files with semantics and defaults and validation", "repository": { @@ -29,11 +29,11 @@ "glob": "^8.0.1", "json-parse-even-better-errors": "^2.3.1", "normalize-package-data": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1" + "npm-normalize-package-bin": "^2.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.4.1", + "@npmcli/template-oss": "3.6.0", "tap": "^16.0.1" }, "license": "ISC", @@ -52,6 +52,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.4.1" + "version": "3.6.0" } } diff --git a/package-lock.json b/package-lock.json index 73e6f86df695b..20a69b3956902 100644 --- a/package-lock.json +++ b/package-lock.json @@ -148,7 +148,7 @@ "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^5.0.1", + "read-package-json": "^5.0.2", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", @@ -6453,15 +6453,15 @@ } }, "node_modules/read-package-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.1.tgz", - "integrity": "sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-5.0.2.tgz", + "integrity": "sha512-BSzugrt4kQ/Z0krro8zhTwV1Kd79ue25IhNN/VtHFy1mG/6Tluyi+msc0UpwaoQzxSHa28mntAjIZY6kEgfR9Q==", "inBundle": true, "dependencies": { "glob": "^8.0.1", "json-parse-even-better-errors": "^2.3.1", "normalize-package-data": "^4.0.0", - "npm-normalize-package-bin": "^1.0.1" + "npm-normalize-package-bin": "^2.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -6479,6 +6479,15 @@ "node": ">=10" } }, + "node_modules/read-package-json/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/read-package-tree": { "version": "5.3.1", "dev": true, diff --git a/package.json b/package.json index f78ec8feef3bf..38873d0de9237 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^5.0.1", + "read-package-json": "^5.0.2", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", From 7fbf6f7825f76906ecdec79ab15595f9e2f7b784 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:45:11 -0700 Subject: [PATCH 097/175] deps: bin-links@3.0.3 --- .../npm-normalize-package-bin/LICENSE | 15 +++++ .../npm-normalize-package-bin/lib/index.js | 64 +++++++++++++++++++ .../npm-normalize-package-bin/package.json | 41 ++++++++++++ node_modules/bin-links/package.json | 4 +- package-lock.json | 20 ++++-- workspaces/arborist/package.json | 2 +- workspaces/libnpmexec/package.json | 2 +- 7 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 node_modules/bin-links/node_modules/npm-normalize-package-bin/LICENSE create mode 100644 node_modules/bin-links/node_modules/npm-normalize-package-bin/lib/index.js create mode 100644 node_modules/bin-links/node_modules/npm-normalize-package-bin/package.json diff --git a/node_modules/bin-links/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/bin-links/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000..19cec97b18468 --- /dev/null +++ b/node_modules/bin-links/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 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 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/bin-links/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/bin-links/node_modules/npm-normalize-package-bin/lib/index.js new file mode 100644 index 0000000000000..d6f0a581b9e66 --- /dev/null +++ b/node_modules/bin-links/node_modules/npm-normalize-package-bin/lib/index.js @@ -0,0 +1,64 @@ +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const { join, basename } = require('path') + +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) + +const normalizeString = pkg => { + if (!pkg.name) { + return removeBin(pkg) + } + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} + +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} + +const removeBin = pkg => { + delete pkg.bin + return pkg +} + +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) + + if (typeof orig[binKey] !== 'string' || !base) { + return + } + + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').slice(1) + + if (!binTarget) { + return + } + + clean[base] = binTarget + hasBins = true + }) + + if (hasBins) { + pkg.bin = clean + } else { + delete pkg.bin + } + + return pkg +} + +module.exports = normalize diff --git a/node_modules/bin-links/node_modules/npm-normalize-package-bin/package.json b/node_modules/bin-links/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000..02de808d9b702 --- /dev/null +++ b/node_modules/bin-links/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,41 @@ +{ + "name": "npm-normalize-package-bin", + "version": "2.0.0", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-normalize-package-bin.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/node_modules/bin-links/package.json b/node_modules/bin-links/package.json index aba3d8f6c0908..ff240c227622d 100644 --- a/node_modules/bin-links/package.json +++ b/node_modules/bin-links/package.json @@ -1,6 +1,6 @@ { "name": "bin-links", - "version": "3.0.2", + "version": "3.0.3", "description": "JavaScript package binary linker", "main": "./lib/index.js", "scripts": { @@ -28,7 +28,7 @@ "dependencies": { "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0", + "npm-normalize-package-bin": "^2.0.0", "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" diff --git a/package-lock.json b/package-lock.json index 20a69b3956902..4046930c930e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1544,13 +1544,13 @@ } }, "node_modules/bin-links": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.2.tgz", - "integrity": "sha512-+oSWBdbCUK6X4LOCSrU36fWRzZNaK7/evX7GozR9xwl2dyiVi3UOUwTyyOVYI1FstgugfsM9QESRrWo7gjCYbg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.3.tgz", + "integrity": "sha512-zKdnMPWEdh4F5INR07/eBrodC7QrF5JKvqskjz/ZZRXg5YSAZIbn8zGhbhUrElzHBZ2fvEQdOU59RHcTG3GiwA==", "dependencies": { "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0", + "npm-normalize-package-bin": "^2.0.0", "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" @@ -1559,6 +1559,14 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/bin-links/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "license": "MIT", @@ -10510,7 +10518,7 @@ "@npmcli/package-json": "^2.0.0", "@npmcli/query": "^1.2.0", "@npmcli/run-script": "^4.1.3", - "bin-links": "^3.0.0", + "bin-links": "^3.0.3", "cacache": "^16.1.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", @@ -10617,7 +10625,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", - "bin-links": "^3.0.0", + "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", "tap": "^16.0.1" diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 77a7c71b99d26..db997e1fa3f8d 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -13,7 +13,7 @@ "@npmcli/package-json": "^2.0.0", "@npmcli/query": "^1.2.0", "@npmcli/run-script": "^4.1.3", - "bin-links": "^3.0.0", + "bin-links": "^3.0.3", "cacache": "^16.1.3", "common-ancestor-path": "^1.0.1", "json-parse-even-better-errors": "^2.3.1", diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index e7640d66f0999..f9ccd7d3bff1e 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -51,7 +51,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.5.0", - "bin-links": "^3.0.0", + "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", "tap": "^16.0.1" From b12ac013226b7d86b5b1847d58eabbac2846b153 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:46:33 -0700 Subject: [PATCH 098/175] deps: npm-pick-manifest@7.0.2 --- .../npm-normalize-package-bin/LICENSE | 15 +++++ .../npm-normalize-package-bin/lib/index.js | 64 +++++++++++++++++++ .../npm-normalize-package-bin/package.json | 41 ++++++++++++ node_modules/npm-pick-manifest/package.json | 4 +- package-lock.json | 21 ++++-- package.json | 2 +- workspaces/arborist/package.json | 2 +- 7 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE create mode 100644 node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js create mode 100644 node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json diff --git a/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000..19cec97b18468 --- /dev/null +++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 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 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/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js new file mode 100644 index 0000000000000..d6f0a581b9e66 --- /dev/null +++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js @@ -0,0 +1,64 @@ +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const { join, basename } = require('path') + +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) + +const normalizeString = pkg => { + if (!pkg.name) { + return removeBin(pkg) + } + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} + +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} + +const removeBin = pkg => { + delete pkg.bin + return pkg +} + +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) + + if (typeof orig[binKey] !== 'string' || !base) { + return + } + + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').slice(1) + + if (!binTarget) { + return + } + + clean[base] = binTarget + hasBins = true + }) + + if (hasBins) { + pkg.bin = clean + } else { + delete pkg.bin + } + + return pkg +} + +module.exports = normalize diff --git a/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000..02de808d9b702 --- /dev/null +++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,41 @@ +{ + "name": "npm-normalize-package-bin", + "version": "2.0.0", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-normalize-package-bin.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/node_modules/npm-pick-manifest/package.json b/node_modules/npm-pick-manifest/package.json index 79867d9cebaf2..b3ebc9f8de62e 100644 --- a/node_modules/npm-pick-manifest/package.json +++ b/node_modules/npm-pick-manifest/package.json @@ -1,6 +1,6 @@ { "name": "npm-pick-manifest", - "version": "7.0.1", + "version": "7.0.2", "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", "main": "./lib", "files": [ @@ -33,7 +33,7 @@ "license": "ISC", "dependencies": { "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^1.0.1", + "npm-normalize-package-bin": "^2.0.0", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, diff --git a/package-lock.json b/package-lock.json index 4046930c930e5..63159b716e7f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -136,7 +136,7 @@ "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.1.0", - "npm-pick-manifest": "^7.0.1", + "npm-pick-manifest": "^7.0.2", "npm-profile": "^6.2.0", "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", @@ -5516,13 +5516,13 @@ } }, "node_modules/npm-pick-manifest": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", - "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", + "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==", "inBundle": true, "dependencies": { "npm-install-checks": "^5.0.0", - "npm-normalize-package-bin": "^1.0.1", + "npm-normalize-package-bin": "^2.0.0", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, @@ -5530,6 +5530,15 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/npm-profile": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.2.1.tgz", @@ -10529,7 +10538,7 @@ "nopt": "^6.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", - "npm-pick-manifest": "^7.0.0", + "npm-pick-manifest": "^7.0.2", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.2", "pacote": "^13.6.1", diff --git a/package.json b/package.json index 38873d0de9237..03984d9067063 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "npm-audit-report": "^3.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.1.0", - "npm-pick-manifest": "^7.0.1", + "npm-pick-manifest": "^7.0.2", "npm-profile": "^6.2.0", "npm-registry-fetch": "^13.3.1", "npm-user-validate": "^1.0.1", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index db997e1fa3f8d..0b9638771c939 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -24,7 +24,7 @@ "nopt": "^6.0.0", "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", - "npm-pick-manifest": "^7.0.0", + "npm-pick-manifest": "^7.0.2", "npm-registry-fetch": "^13.0.0", "npmlog": "^6.0.2", "pacote": "^13.6.1", From 8f7abbe4c3ceba451eb422c6328d623e7c8eeed5 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 12:50:48 -0700 Subject: [PATCH 099/175] deps: npm-packlist@5.1.3 --- DEPENDENCIES.md | 2 + .../node_modules/npm-bundled/LICENSE | 15 ++ .../node_modules/npm-bundled/lib/index.js | 254 ++++++++++++++++++ .../npm-normalize-package-bin/LICENSE | 15 ++ .../npm-normalize-package-bin/index.js | 60 +++++ .../npm-normalize-package-bin/package.json | 21 ++ .../npm-normalize-package-bin/test/array.js | 37 +++ .../npm-normalize-package-bin/test/nobin.js | 35 +++ .../npm-normalize-package-bin/test/object.js | 141 ++++++++++ .../npm-normalize-package-bin/test/string.js | 37 +++ .../node_modules/npm-bundled/package.json | 47 ++++ .../npm-normalize-package-bin/LICENSE | 15 ++ .../npm-normalize-package-bin/lib/index.js | 64 +++++ .../npm-normalize-package-bin/package.json | 41 +++ node_modules/npm-packlist/package.json | 10 +- package-lock.json | 37 ++- 16 files changed, 821 insertions(+), 10 deletions(-) create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/LICENSE create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/lib/index.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js create mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/package.json create mode 100644 node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE create mode 100644 node_modules/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js create mode 100644 node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 1ddd85b3d411d..4a38c6f488714 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -106,6 +106,7 @@ graph LR; npm-->npm-audit-report; npm-->npm-install-checks; npm-->npm-package-arg; + npm-->npm-packlist; npm-->npm-profile; npm-->npm-registry-fetch; npm-->npm-user-validate; @@ -510,6 +511,7 @@ graph LR; npm-->npm-audit-report; npm-->npm-install-checks; npm-->npm-package-arg; + npm-->npm-packlist; npm-->npm-pick-manifest; npm-->npm-profile; npm-->npm-registry-fetch; diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/LICENSE b/node_modules/npm-packlist/node_modules/npm-bundled/LICENSE new file mode 100644 index 0000000000000..20a4762540923 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. 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/npm-packlist/node_modules/npm-bundled/lib/index.js b/node_modules/npm-packlist/node_modules/npm-bundled/lib/index.js new file mode 100644 index 0000000000000..4f54ca647c087 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/lib/index.js @@ -0,0 +1,254 @@ +'use strict' + +// walk the tree of deps starting from the top level list of bundled deps +// Any deps at the top level that are depended on by a bundled dep that +// does not have that dep in its own node_modules folder are considered +// bundled deps as well. This list of names can be passed to npm-packlist +// as the "bundled" argument. Additionally, packageJsonCache is shared so +// packlist doesn't have to re-read files already consumed in this pass + +const fs = require('fs') +const path = require('path') +const EE = require('events').EventEmitter +// we don't care about the package bins, but we share a pj cache +// with other modules that DO care about it, so keep it nice. +const normalizePackageBin = require('npm-normalize-package-bin') + +class BundleWalker extends EE { + constructor (opt) { + opt = opt || {} + super(opt) + this.path = path.resolve(opt.path || process.cwd()) + + this.parent = opt.parent || null + if (this.parent) { + this.result = this.parent.result + // only collect results in node_modules folders at the top level + // since the node_modules in a bundled dep is included always + if (!this.parent.parent) { + const base = path.basename(this.path) + const scope = path.basename(path.dirname(this.path)) + this.result.add(/^@/.test(scope) ? scope + '/' + base : base) + } + this.root = this.parent.root + this.packageJsonCache = this.parent.packageJsonCache + } else { + this.result = new Set() + this.root = this.path + this.packageJsonCache = opt.packageJsonCache || new Map() + } + + this.seen = new Set() + this.didDone = false + this.children = 0 + this.node_modules = [] + this.package = null + this.bundle = null + } + + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + const ret = super.on(ev, fn) + if (ev === 'done' && this.didDone) { + this.emit('done', this.result) + } + return ret + } + + done () { + if (!this.didDone) { + this.didDone = true + if (!this.parent) { + const res = Array.from(this.result) + this.result = res + this.emit('done', res) + } else { + this.emit('done') + } + } + } + + start () { + const pj = path.resolve(this.path, 'package.json') + if (this.packageJsonCache.has(pj)) { + this.onPackage(this.packageJsonCache.get(pj)) + } else { + this.readPackageJson(pj) + } + return this + } + + readPackageJson (pj) { + fs.readFile(pj, (er, data) => + er ? this.done() : this.onPackageJson(pj, data)) + } + + onPackageJson (pj, data) { + try { + this.package = normalizePackageBin(JSON.parse(data + '')) + } catch (er) { + return this.done() + } + this.packageJsonCache.set(pj, this.package) + this.onPackage(this.package) + } + + allDepsBundled (pkg) { + return Object.keys(pkg.dependencies || {}).concat( + Object.keys(pkg.optionalDependencies || {})) + } + + onPackage (pkg) { + // all deps are bundled if we got here as a child. + // otherwise, only bundle bundledDeps + // Get a unique-ified array with a short-lived Set + const bdRaw = this.parent ? this.allDepsBundled(pkg) + : pkg.bundleDependencies || pkg.bundledDependencies || [] + + const bd = Array.from(new Set( + Array.isArray(bdRaw) ? bdRaw + : bdRaw === true ? this.allDepsBundled(pkg) + : Object.keys(bdRaw))) + + if (!bd.length) { + return this.done() + } + + this.bundle = bd + this.readModules() + } + + readModules () { + readdirNodeModules(this.path + '/node_modules', (er, nm) => + er ? this.onReaddir([]) : this.onReaddir(nm)) + } + + onReaddir (nm) { + // keep track of what we have, in case children need it + this.node_modules = nm + + this.bundle.forEach(dep => this.childDep(dep)) + if (this.children === 0) { + this.done() + } + } + + childDep (dep) { + if (this.node_modules.indexOf(dep) !== -1) { + if (!this.seen.has(dep)) { + this.seen.add(dep) + this.child(dep) + } + } else if (this.parent) { + this.parent.childDep(dep) + } + } + + child (dep) { + const p = this.path + '/node_modules/' + dep + this.children += 1 + const child = new BundleWalker({ + path: p, + parent: this, + }) + child.on('done', _ => { + if (--this.children === 0) { + this.done() + } + }) + child.start() + } +} + +class BundleWalkerSync extends BundleWalker { + start () { + super.start() + this.done() + return this + } + + readPackageJson (pj) { + try { + this.onPackageJson(pj, fs.readFileSync(pj)) + } catch { + // empty catch + } + return this + } + + readModules () { + try { + this.onReaddir(readdirNodeModulesSync(this.path + '/node_modules')) + } catch { + this.onReaddir([]) + } + } + + child (dep) { + new BundleWalkerSync({ + path: this.path + '/node_modules/' + dep, + parent: this, + }).start() + } +} + +const readdirNodeModules = (nm, cb) => { + fs.readdir(nm, (er, set) => { + if (er) { + cb(er) + } else { + const scopes = set.filter(f => /^@/.test(f)) + if (!scopes.length) { + cb(null, set) + } else { + const unscoped = set.filter(f => !/^@/.test(f)) + let count = scopes.length + scopes.forEach(scope => { + fs.readdir(nm + '/' + scope, (readdirEr, pkgs) => { + if (readdirEr || !pkgs.length) { + unscoped.push(scope) + } else { + unscoped.push.apply(unscoped, pkgs.map(p => scope + '/' + p)) + } + if (--count === 0) { + cb(null, unscoped) + } + }) + }) + } + } + }) +} + +const readdirNodeModulesSync = nm => { + const set = fs.readdirSync(nm) + const unscoped = set.filter(f => !/^@/.test(f)) + const scopes = set.filter(f => /^@/.test(f)).map(scope => { + try { + const pkgs = fs.readdirSync(nm + '/' + scope) + return pkgs.length ? pkgs.map(p => scope + '/' + p) : [scope] + } catch (er) { + return [scope] + } + }).reduce((a, b) => a.concat(b), []) + return unscoped.concat(scopes) +} + +const walk = (options, callback) => { + const p = new Promise((resolve, reject) => { + new BundleWalker(options).on('done', resolve).on('error', reject).start() + }) + return callback ? p.then(res => callback(null, res), callback) : p +} + +const walkSync = options => { + return new BundleWalkerSync(options).start().result +} + +module.exports = walk +walk.sync = walkSync +walk.BundleWalker = BundleWalker +walk.BundleWalkerSync = BundleWalkerSync diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000..19cec97b18468 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 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 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/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js new file mode 100644 index 0000000000000..5a738ff82e1e3 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js @@ -0,0 +1,60 @@ +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const {join, basename} = require('path') + +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) + +const normalizeString = pkg => { + if (!pkg.name) + return removeBin(pkg) + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} + +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} + +const removeBin = pkg => { + delete pkg.bin + return pkg +} + +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1) + + if (typeof orig[binKey] !== 'string' || !base) + return + + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').substr(1) + + if (!binTarget) + return + + clean[base] = binTarget + hasBins = true + }) + + if (hasBins) + pkg.bin = clean + else + delete pkg.bin + + return pkg +} + +module.exports = normalize diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000..a331a682e74e0 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,21 @@ +{ + "name": "npm-normalize-package-bin", + "version": "1.0.1", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "repository": "git+https://github.com/npm/npm-normalize-package-bin", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.2" + } +} diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js new file mode 100644 index 0000000000000..63dafa8913741 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js @@ -0,0 +1,37 @@ +const normalize = require('../') +const t = require('tap') + +t.test('benign array', async t => { + const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'y/z', './a'] } + const expect = { name: 'hello', version: 'world', bin: { + y: 'x/y', + z: 'y/z', + a: 'a', + } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('conflicting array', async t => { + const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'z/y', './a'] } + const expect = { name: 'hello', version: 'world', bin: { + y: 'z/y', + a: 'a', + } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('slashy array', async t => { + const pkg = { name: 'hello', version: 'world', bin: [ '/etc/passwd' ] } + const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('dotty array', async t => { + const pkg = { name: 'hello', version: 'world', bin: ['../../../../etc/passwd'] } + const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js new file mode 100644 index 0000000000000..536d7eb22f68a --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js @@ -0,0 +1,35 @@ +const normalize = require('../') +const t = require('tap') + +// all of these just delete the bins, so expect the same value +const expect = { name: 'hello', version: 'world' } + +t.test('no bin in object', async t => { + const pkg = { name: 'hello', version: 'world' } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('empty string bin in object', async t => { + const pkg = { name: 'hello', version: 'world', bin: '' } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('false bin in object', async t => { + const pkg = { name: 'hello', version: 'world', bin: false } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('null bin in object', async t => { + const pkg = { name: 'hello', version: 'world', bin: null } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('number bin', async t => { + const pkg = { name: 'hello', version: 'world', bin: 42069 } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js new file mode 100644 index 0000000000000..00d23684fb75b --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js @@ -0,0 +1,141 @@ +const normalize = require('../') +const t = require('tap') + +t.test('benign object', async t => { + // just clean up the ./ in the targets and remove anything weird + const pkg = { name: 'hello', version: 'world', bin: { + y: './x/y', + z: './y/z', + a: './a', + } } + const expect = { name: 'hello', version: 'world', bin: { + y: 'x/y', + z: 'y/z', + a: 'a', + } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('empty and non-string targets', async t => { + // just clean up the ./ in the targets and remove anything weird + const pkg = { name: 'hello', version: 'world', bin: { + z: './././', + y: '', + './x': 'x.js', + re: /asdf/, + foo: { bar: 'baz' }, + false: false, + null: null, + array: [1,2,3], + func: function () {}, + } } + const expect = { name: 'hello', version: 'world', bin: { + x: 'x.js', + } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('slashy object', async t => { + const pkg = { name: 'hello', version: 'world', bin: { + '/path/foo': '/etc/passwd', + 'bar': '/etc/passwd', + '/etc/glorb/baz': '/etc/passwd', + '/etc/passwd:/bin/usr/exec': '/etc/passwd', + } } + const expect = { + name: 'hello', + version: 'world', + bin: { + foo: 'etc/passwd', + bar: 'etc/passwd', + baz: 'etc/passwd', + exec: 'etc/passwd', + } + } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('dotty object', async t => { + const pkg = { + name: 'hello', + version: 'world', + bin: { + 'nodots': '../../../../etc/passwd', + '../../../../../../dots': '../../../../etc/passwd', + '.././../\\./..//C:\\./': 'this is removed', + '.././../\\./..//C:\\/': 'super safe programming language', + '.././../\\./..//C:\\x\\y\\z/': 'xyz', + } } + const expect = { name: 'hello', version: 'world', bin: { + nodots: 'etc/passwd', + dots: 'etc/passwd', + C: 'super safe programming language', + z: 'xyz', + } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('weird object', async t => { + const pkg = { name: 'hello', version: 'world', bin: /asdf/ } + const expect = { name: 'hello', version: 'world' } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('oddball keys', async t => { + const pkg = { + bin: { + '~': 'target', + '£': 'target', + 'ζ': 'target', + 'ぎ': 'target', + '操': 'target', + '🎱': 'target', + '💎': 'target', + '💸': 'target', + '🦉': 'target', + 'сheck-dom': 'target', + 'Ωpm': 'target', + 'ζλ': 'target', + 'мга': 'target', + 'пше': 'target', + 'тзч': 'target', + 'тзь': 'target', + 'нфкт': 'target', + 'ссср': 'target', + '君の名は': 'target', + '君の名は': 'target', + } + } + + const expect = { + bin: { + '~': 'target', + '£': 'target', + 'ζ': 'target', + 'ぎ': 'target', + '操': 'target', + '🎱': 'target', + '💎': 'target', + '💸': 'target', + '🦉': 'target', + 'сheck-dom': 'target', + 'Ωpm': 'target', + 'ζλ': 'target', + 'мга': 'target', + 'пше': 'target', + 'тзч': 'target', + 'тзь': 'target', + 'нфкт': 'target', + 'ссср': 'target', + '君の名は': 'target', + }, + } + + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js new file mode 100644 index 0000000000000..b6de8f8f589b5 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js @@ -0,0 +1,37 @@ +const normalize = require('../') +const t = require('tap') + +t.test('benign string', async t => { + const pkg = { name: 'hello', version: 'world', bin: 'hello.js' } + const expect = { name: 'hello', version: 'world', bin: { hello: 'hello.js' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('slashy string', async t => { + const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd' } + const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('dotty string', async t => { + const pkg = { name: 'hello', version: 'world', bin: '../../../../etc/passwd' } + const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('double path', async t => { + const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd:/bin/usr/exec' } + const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd:/bin/usr/exec' } } + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) + +t.test('string with no name', async t => { + const pkg = { bin: 'foobar.js' } + const expect = {} + t.strictSame(normalize(pkg), expect) + t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') +}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/package.json b/node_modules/npm-packlist/node_modules/npm-bundled/package.json new file mode 100644 index 0000000000000..36b63fbdda77d --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-bundled/package.json @@ -0,0 +1,47 @@ +{ + "name": "npm-bundled", + "version": "2.0.0", + "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-bundled.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "mkdirp": "^1.0.4", + "mutate-fs": "^2.1.1", + "rimraf": "^3.0.2", + "tap": "^16.3.0" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" + }, + "files": [ + "bin/", + "lib/" + ], + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE new file mode 100644 index 0000000000000..19cec97b18468 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 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 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/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js new file mode 100644 index 0000000000000..d6f0a581b9e66 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js @@ -0,0 +1,64 @@ +// pass in a manifest with a 'bin' field here, and it'll turn it +// into a properly santized bin object +const { join, basename } = require('path') + +const normalize = pkg => + !pkg.bin ? removeBin(pkg) + : typeof pkg.bin === 'string' ? normalizeString(pkg) + : Array.isArray(pkg.bin) ? normalizeArray(pkg) + : typeof pkg.bin === 'object' ? normalizeObject(pkg) + : removeBin(pkg) + +const normalizeString = pkg => { + if (!pkg.name) { + return removeBin(pkg) + } + pkg.bin = { [pkg.name]: pkg.bin } + return normalizeObject(pkg) +} + +const normalizeArray = pkg => { + pkg.bin = pkg.bin.reduce((acc, k) => { + acc[basename(k)] = k + return acc + }, {}) + return normalizeObject(pkg) +} + +const removeBin = pkg => { + delete pkg.bin + return pkg +} + +const normalizeObject = pkg => { + const orig = pkg.bin + const clean = {} + let hasBins = false + Object.keys(orig).forEach(binKey => { + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) + + if (typeof orig[binKey] !== 'string' || !base) { + return + } + + const binTarget = join('/', orig[binKey]) + .replace(/\\/g, '/').slice(1) + + if (!binTarget) { + return + } + + clean[base] = binTarget + hasBins = true + }) + + if (hasBins) { + pkg.bin = clean + } else { + delete pkg.bin + } + + return pkg +} + +module.exports = normalize diff --git a/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json new file mode 100644 index 0000000000000..02de808d9b702 --- /dev/null +++ b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json @@ -0,0 +1,41 @@ +{ + "name": "npm-normalize-package-bin", + "version": "2.0.0", + "description": "Turn any flavor of allowable package.json bin into a normalized object", + "main": "lib/index.js", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-normalize-package-bin.git" + }, + "author": "GitHub Inc.", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" + } +} diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index 4c63caf21e810..c3c8817202a39 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "5.1.1", + "version": "5.1.3", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" @@ -9,8 +9,8 @@ "dependencies": { "glob": "^8.0.1", "ignore-walk": "^5.0.1", - "npm-bundled": "^1.1.2", - "npm-normalize-package-bin": "^1.0.1" + "npm-bundled": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "author": "GitHub Inc.", "license": "ISC", @@ -20,7 +20,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.6.0", "mutate-fs": "^2.1.1", "tap": "^16.0.1" }, @@ -56,6 +56,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.6.0" } } diff --git a/package-lock.json b/package-lock.json index 63159b716e7f1..0b9b5bad640dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5498,15 +5498,15 @@ } }, "node_modules/npm-packlist": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.1.tgz", - "integrity": "sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.3.tgz", + "integrity": "sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==", "inBundle": true, "dependencies": { "glob": "^8.0.1", "ignore-walk": "^5.0.1", - "npm-bundled": "^1.1.2", - "npm-normalize-package-bin": "^1.0.1" + "npm-bundled": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0" }, "bin": { "npm-packlist": "bin/index.js" @@ -5515,6 +5515,33 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-packlist/node_modules/npm-bundled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-2.0.0.tgz", + "integrity": "sha512-ZnkDgpakv39F6w9D6uZNmmXohXEHW5EC1MDziHvXeLeyBmJ/FpfM1n+v8PkQ2Y1TcNHzuAVTZQIgabkgskR77A==", + "inBundle": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "inBundle": true + }, + "node_modules/npm-packlist/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/npm-pick-manifest": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz", From f4205e57d6c4ee5f2ff7d21ffc116ffc420d191e Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:18:23 -0700 Subject: [PATCH 100/175] deps: diff@5.1.0 --- DEPENDENCIES.md | 2 - node_modules/diff/dist/diff.js | 53 +++++++++++++++++++++++++-- node_modules/diff/dist/diff.min.js | 38 +++++++++++++++++++ node_modules/diff/lib/diff/base.js | 13 ++++--- node_modules/diff/lib/index.es6.js | 16 ++++++-- node_modules/diff/lib/index.mjs | 16 ++++++-- node_modules/diff/lib/patch/create.js | 7 +++- node_modules/diff/package.json | 2 +- node_modules/diff/release-notes.md | 6 +++ package-lock.json | 7 ++-- workspaces/libnpmdiff/package.json | 2 +- 11 files changed, 137 insertions(+), 25 deletions(-) create mode 100644 node_modules/diff/dist/diff.min.js diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 4a38c6f488714..1ddd85b3d411d 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -106,7 +106,6 @@ graph LR; npm-->npm-audit-report; npm-->npm-install-checks; npm-->npm-package-arg; - npm-->npm-packlist; npm-->npm-profile; npm-->npm-registry-fetch; npm-->npm-user-validate; @@ -511,7 +510,6 @@ graph LR; npm-->npm-audit-report; npm-->npm-install-checks; npm-->npm-package-arg; - npm-->npm-packlist; npm-->npm-pick-manifest; npm-->npm-profile; npm-->npm-registry-fetch; diff --git a/node_modules/diff/dist/diff.js b/node_modules/diff/dist/diff.js index bba91954f4b23..7fa3a556c4200 100644 --- a/node_modules/diff/dist/diff.js +++ b/node_modules/diff/dist/diff.js @@ -1,3 +1,40 @@ +/*! + + diff v5.1.0 + +Software License Agreement (BSD License) + +Copyright (c) 2009-2015, Kevin Decker + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@license +*/ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -38,6 +75,11 @@ oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; + + if (options.maxEditLength) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var bestPath = [{ newPos: -1, components: [] @@ -102,15 +144,13 @@ editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. if (callback) { (function exec() { setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } @@ -928,6 +968,11 @@ } var diff = diffLines(oldStr, newStr, options); + + if (!diff) { + return; + } + diff.push({ value: '', lines: [] diff --git a/node_modules/diff/dist/diff.min.js b/node_modules/diff/dist/diff.min.js new file mode 100644 index 0000000000000..80c20de5b757d --- /dev/null +++ b/node_modules/diff/dist/diff.min.js @@ -0,0 +1,38 @@ +/*! + + diff v5.1.0 + +Software License Agreement (BSD License) + +Copyright (c) 2009-2015, Kevin Decker + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@license +*/ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Diff={})}(this,function(e){"use strict";function t(){}t.prototype={diff:function(u,a,e){var n=2=c&&h<=i+1)return d([{value:this.join(a),count:a.length}]);function o(){for(var e,n=-1*p;n<=p;n+=2){var t=void 0,r=v[n-1],i=v[n+1],o=(i?i.newPos:0)-n;r&&(v[n-1]=void 0);var l=r&&r.newPos+1=c&&h<=o+1)return d(function(e,n,t,r,i){for(var o=0,l=n.length,s=0,u=0;oe.length?t:e}),d.value=e.join(f)):d.value=e.join(t.slice(s,s+d.count)),s+=d.count,d.added||(u+=d.count))}var c=n[l-1];1e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=c.length-2&&u.length<=d.context&&(i=/\n$/.test(a),o=/\n$/.test(f),l=0==u.length&&g.length>r.oldLines,!i&&l&&0e.length)return!1;for(var t=0;t"):i.removed&&t.push(""),t.push((n=i.value,n.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""))),i.added?t.push(""):i.removed&&t.push("")}return t.join("")},e.createPatch=function(e,n,t,r,i,o){return y(e,e,n,t,r,i,o)},e.createTwoFilesPatch=y,e.diffArrays=function(e,n,t){return g.diff(e,n,t)},e.diffChars=function(e,n,t){return r.diff(e,n,t)},e.diffCss=function(e,n,t){return f.diff(e,n,t)},e.diffJson=function(e,n,t){return p.diff(e,n,t)},e.diffLines=L,e.diffSentences=function(e,n,t){return a.diff(e,n,t)},e.diffTrimmedLines=function(e,n,t){var r=i(t,{ignoreWhitespace:!0});return u.diff(e,n,r)},e.diffWords=function(e,n,t){return t=i(t,{ignoreWhitespace:!0}),s.diff(e,n,t)},e.diffWordsWithSpace=function(e,n,t){return s.diff(e,n,t)},e.merge=function(e,n,t){e=b(e,t),n=b(n,t);var r={};(e.index||n.index)&&(r.index=e.index||n.index),(e.newFileName||n.newFileName)&&(F(e)?F(n)?(r.oldFileName=N(r,e.oldFileName,n.oldFileName),r.newFileName=N(r,e.newFileName,n.newFileName),r.oldHeader=N(r,e.oldHeader,n.oldHeader),r.newHeader=N(r,e.newHeader,n.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=n.oldFileName||e.oldFileName,r.newFileName=n.newFileName||e.newFileName,r.oldHeader=n.oldHeader||e.oldHeader,r.newHeader=n.newHeader||e.newHeader)),r.hunks=[];for(var i=0,o=0,l=0,s=0;i maxEditLength) { return callback(); } @@ -301,4 +304,4 @@ function clonePath(path) { components: path.components.slice(0) }; } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSIsInZhbHVlIiwic2V0VGltZW91dCIsInVuZGVmaW5lZCIsImNhc3RJbnB1dCIsInJlbW92ZUVtcHR5IiwidG9rZW5pemUiLCJuZXdMZW4iLCJsZW5ndGgiLCJvbGRMZW4iLCJlZGl0TGVuZ3RoIiwibWF4RWRpdExlbmd0aCIsImJlc3RQYXRoIiwibmV3UG9zIiwiY29tcG9uZW50cyIsIm9sZFBvcyIsImV4dHJhY3RDb21tb24iLCJqb2luIiwiY291bnQiLCJleGVjRWRpdExlbmd0aCIsImRpYWdvbmFsUGF0aCIsImJhc2VQYXRoIiwiYWRkUGF0aCIsInJlbW92ZVBhdGgiLCJjYW5BZGQiLCJjYW5SZW1vdmUiLCJjbG9uZVBhdGgi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ICAgY29tcG9uZW50cy5wb3AoKTtcbiAgfVxuXG4gIHJldHVybiBjb21wb25lbnRzO1xufVxuXG5mdW5jdGlvbiBjbG9uZVBhdGgocGF0aCkge1xuICByZXR1cm4geyBuZXdQb3M6IHBhdGgubmV3UG9zLCBjb21wb25lbnRzOiBwYXRoLmNvbXBvbmVudHMuc2xpY2UoMCkgfTtcbn1cbiJdfQ== diff --git a/node_modules/diff/lib/index.es6.js b/node_modules/diff/lib/index.es6.js index ca0e5917c44a4..c2a00135a4e24 100644 --- a/node_modules/diff/lib/index.es6.js +++ b/node_modules/diff/lib/index.es6.js @@ -32,6 +32,11 @@ Diff.prototype = { oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; + + if (options.maxEditLength) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var bestPath = [{ newPos: -1, components: [] @@ -96,15 +101,13 @@ Diff.prototype = { editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. if (callback) { (function exec() { setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } @@ -922,6 +925,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne } var diff = diffLines(oldStr, newStr, options); + + if (!diff) { + return; + } + diff.push({ value: '', lines: [] diff --git a/node_modules/diff/lib/index.mjs b/node_modules/diff/lib/index.mjs index ca0e5917c44a4..c2a00135a4e24 100644 --- a/node_modules/diff/lib/index.mjs +++ b/node_modules/diff/lib/index.mjs @@ -32,6 +32,11 @@ Diff.prototype = { oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; + + if (options.maxEditLength) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var bestPath = [{ newPos: -1, components: [] @@ -96,15 +101,13 @@ Diff.prototype = { editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. if (callback) { (function exec() { setTimeout(function () { - // This should not happen, but we want to be safe. - - /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } @@ -922,6 +925,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne } var diff = diffLines(oldStr, newStr, options); + + if (!diff) { + return; + } + diff.push({ value: '', lines: [] diff --git a/node_modules/diff/lib/patch/create.js b/node_modules/diff/lib/patch/create.js index 48bb4668442a9..1d3b4c303ce4b 100644 --- a/node_modules/diff/lib/patch/create.js +++ b/node_modules/diff/lib/patch/create.js @@ -51,6 +51,11 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne diffLines) /*istanbul ignore end*/ (oldStr, newStr, options); + + if (!diff) { + return; + } + diff.push({ value: '', lines: [] @@ -264,4 +269,4 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOlsic3RydWN0dXJlZFBhdGNoIiwib2xkRmlsZU5hbWUiLCJuZXdGaWxlTmFtZSIsIm9sZFN0ciIsIm5ld1N0ciIsIm9sZEhlYWRlciIsIm5ld0hlYWRlciIsIm9wdGlvbnMiLCJjb250ZXh0IiwiZGlmZiIsImRpZmZMaW5lcyIsInB1c2giLCJ2YWx1ZSIsImxpbmVzIiwiY29udGV4dExpbmVzIiwibWFwIiwiZW50cnkiLCJodW5rcyIsIm9sZFJhbmdlU3RhcnQiLCJuZXdSYW5nZVN0YXJ0IiwiY3VyUmFuZ2UiLCJvbGRMaW5lI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gZW5kIHRoZSByYW5nZSBhbmQgb3V0cHV0XG4gICAgICAgICAgbGV0IGNvbnRleHRTaXplID0gTWF0aC5taW4obGluZXMubGVuZ3RoLCBvcHRpb25zLmNvbnRleHQpO1xuICAgICAgICAgIGN1clJhbmdlLnB1c2goLi4uIGNvbnRleHRMaW5lcyhsaW5lcy5zbGljZSgwLCBjb250ZXh0U2l6ZSkpKTtcblxuICAgICAgICAgIGxldCBodW5rID0ge1xuICAgICAgICAgICAgb2xkU3RhcnQ6IG9sZFJhbmdlU3RhcnQsXG4gICAgICAgICAgICBvbGRMaW5lczogKG9sZExpbmUgLSBvbGRSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbmV3U3RhcnQ6IG5ld1JhbmdlU3RhcnQsXG4gICAgICAgICAgICBuZXdMaW5lczogKG5ld0xpbmUgLSBuZXdSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbGluZXM6IGN1clJhbmdlXG4gICAgICAgICAgfTtcbiAgICAgICAgICBpZiAoaSA+PSBkaWZmLmxlbmd0aCAtIDIgJiYgbGluZXMubGVuZ3RoIDw9IG9wdGlvbnMuY29udGV4dCkge1xuICAgICAgICAgICAgLy8gRU9GIGlzIGluc2lkZSB0aGlzIGh1bmtcbiAgICAgICAgICAgIGxldCBvbGRFT0ZOZXdsaW5lID0gKCgvXFxuJC8pLnRlc3Qob2xkU3RyKSk7XG4gICAgICAgICAgICBsZXQgbmV3RU9GTmV3bGluZSA9ICgoL1xcbiQvKS50ZXN0KG5ld1N0cikpO1xuICAgICAgICAgICAgbGV0IG5vTmxCZWZvcmVBZGRzID0gbGluZXMubGVuZ3RoID09IDAgJiYgY3VyUmFuZ2UubGVuZ3RoID4gaHVuay5vbGRMaW5lcztcbiAgICAgICAgICAgIGlmICghb2xkRU9GTmV3bGluZSAmJiBub05sQmVmb3JlQWRkcyAmJiBvbGRTdHIubGVuZ3RoID4gMCkge1xuICAgICAgICAgICA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c1BhdGNoKGZpbGVOYW1lLCBmaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKTtcbn1cbiJdfQ== diff --git a/node_modules/diff/package.json b/node_modules/diff/package.json index 2b6eea7f1cbff..a2fc30c581218 100644 --- a/node_modules/diff/package.json +++ b/node_modules/diff/package.json @@ -1,6 +1,6 @@ { "name": "diff", - "version": "5.0.0", + "version": "5.1.0", "description": "A javascript text diff implementation.", "keywords": [ "diff", diff --git a/node_modules/diff/release-notes.md b/node_modules/diff/release-notes.md index acc75aa83d88e..b7bc9c803b902 100644 --- a/node_modules/diff/release-notes.md +++ b/node_modules/diff/release-notes.md @@ -4,6 +4,12 @@ [Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...master) +## v5.1.0 + +- [#365](https://github.com/kpdecker/jsdiff/issues/365) Allow early termination to limit execution time with degenerate cases + +[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...v5.0.1) + ## v5.0.0 - Breaking: UMD export renamed from `JsDiff` to `Diff`. diff --git a/package-lock.json b/package-lock.json index 0b9b5bad640dc..3b3e57262fd9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2317,8 +2317,9 @@ } }, "node_modules/diff": { - "version": "5.0.0", - "license": "BSD-3-Clause", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", "engines": { "node": ">=0.3.1" } @@ -10624,7 +10625,7 @@ "@npmcli/disparity-colors": "^2.0.0", "@npmcli/installed-package-contents": "^1.0.7", "binary-extensions": "^2.2.0", - "diff": "^5.0.0", + "diff": "^5.1.0", "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", "pacote": "^13.6.1", diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index d0e92f42c94f2..8c8b6b23b7b48 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -53,7 +53,7 @@ "@npmcli/disparity-colors": "^2.0.0", "@npmcli/installed-package-contents": "^1.0.7", "binary-extensions": "^2.2.0", - "diff": "^5.0.0", + "diff": "^5.1.0", "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", "pacote": "^13.6.1", From 6e2d6b45150793141f8aa1676cf08f41b149c003 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:43:51 -0700 Subject: [PATCH 101/175] chore: run dep graph during reset --- scripts/resetdeps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/resetdeps.sh b/scripts/resetdeps.sh index 2362c2092a635..d73ce845888c7 100755 --- a/scripts/resetdeps.sh +++ b/scripts/resetdeps.sh @@ -8,4 +8,4 @@ rm -rf "workspaces/*/node_modules" git checkout node_modules node . i --ignore-scripts --no-audit --no-fund node . rebuild --ignore-scripts -node scripts/bundle-and-gitignore-deps.js +node . run dependencies --ignore-scripts From e401a81c784556393bad57283337283a46bd57c5 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:44:10 -0700 Subject: [PATCH 102/175] deps: npm-bundled@2.0.1 --- .../node_modules/npm-bundled/LICENSE | 0 .../node_modules}/npm-bundled/index.js | 0 .../node_modules/npm-bundled/package.json | 30 ++++ .../npm-bundled/lib/index.js | 0 .../npm-normalize-package-bin/LICENSE | 0 .../npm-normalize-package-bin/lib}/index.js | 20 ++- .../npm-normalize-package-bin}/package.json | 26 ++-- node_modules/npm-bundled/package.json | 41 +++-- .../npm-normalize-package-bin/package.json | 21 --- .../npm-normalize-package-bin/test/array.js | 37 ----- .../npm-normalize-package-bin/test/nobin.js | 35 ----- .../npm-normalize-package-bin/test/object.js | 141 ------------------ .../npm-normalize-package-bin/test/string.js | 37 ----- package-lock.json | 46 +++--- 14 files changed, 106 insertions(+), 328 deletions(-) rename node_modules/{npm-packlist => @npmcli/installed-package-contents}/node_modules/npm-bundled/LICENSE (100%) rename node_modules/{ => @npmcli/installed-package-contents/node_modules}/npm-bundled/index.js (100%) create mode 100644 node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/package.json rename node_modules/{npm-packlist/node_modules => }/npm-bundled/lib/index.js (100%) rename node_modules/{npm-packlist/node_modules => }/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE (100%) rename node_modules/{npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin => npm-bundled/node_modules/npm-normalize-package-bin/lib}/index.js (82%) rename node_modules/{npm-packlist/node_modules/npm-bundled => npm-bundled/node_modules/npm-normalize-package-bin}/package.json (69%) delete mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json delete mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js delete mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js delete mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js delete mode 100644 node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/LICENSE b/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/LICENSE similarity index 100% rename from node_modules/npm-packlist/node_modules/npm-bundled/LICENSE rename to node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/LICENSE diff --git a/node_modules/npm-bundled/index.js b/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/index.js similarity index 100% rename from node_modules/npm-bundled/index.js rename to node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/index.js diff --git a/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/package.json b/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/package.json new file mode 100644 index 0000000000000..cf20e297b0b63 --- /dev/null +++ b/node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled/package.json @@ -0,0 +1,30 @@ +{ + "name": "npm-bundled", + "version": "1.1.2", + "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-bundled.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "devDependencies": { + "mkdirp": "^0.5.1", + "mutate-fs": "^1.1.0", + "rimraf": "^2.6.1", + "tap": "^12.0.1" + }, + "scripts": { + "test": "tap test/*.js -J --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "files": [ + "index.js" + ], + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } +} diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/lib/index.js b/node_modules/npm-bundled/lib/index.js similarity index 100% rename from node_modules/npm-packlist/node_modules/npm-bundled/lib/index.js rename to node_modules/npm-bundled/lib/index.js diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE similarity index 100% rename from node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE rename to node_modules/npm-bundled/node_modules/npm-normalize-package-bin/LICENSE diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js b/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/lib/index.js similarity index 82% rename from node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js rename to node_modules/npm-bundled/node_modules/npm-normalize-package-bin/lib/index.js index 5a738ff82e1e3..d6f0a581b9e66 100644 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/index.js +++ b/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/lib/index.js @@ -1,6 +1,6 @@ // pass in a manifest with a 'bin' field here, and it'll turn it // into a properly santized bin object -const {join, basename} = require('path') +const { join, basename } = require('path') const normalize = pkg => !pkg.bin ? removeBin(pkg) @@ -10,8 +10,9 @@ const normalize = pkg => : removeBin(pkg) const normalizeString = pkg => { - if (!pkg.name) + if (!pkg.name) { return removeBin(pkg) + } pkg.bin = { [pkg.name]: pkg.bin } return normalizeObject(pkg) } @@ -34,25 +35,28 @@ const normalizeObject = pkg => { const clean = {} let hasBins = false Object.keys(orig).forEach(binKey => { - const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).substr(1) + const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1) - if (typeof orig[binKey] !== 'string' || !base) + if (typeof orig[binKey] !== 'string' || !base) { return + } const binTarget = join('/', orig[binKey]) - .replace(/\\/g, '/').substr(1) + .replace(/\\/g, '/').slice(1) - if (!binTarget) + if (!binTarget) { return + } clean[base] = binTarget hasBins = true }) - if (hasBins) + if (hasBins) { pkg.bin = clean - else + } else { delete pkg.bin + } return pkg } diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/package.json b/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json similarity index 69% rename from node_modules/npm-packlist/node_modules/npm-bundled/package.json rename to node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json index 36b63fbdda77d..02de808d9b702 100644 --- a/node_modules/npm-packlist/node_modules/npm-bundled/package.json +++ b/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json @@ -1,42 +1,36 @@ { - "name": "npm-bundled", + "name": "npm-normalize-package-bin", "version": "2.0.0", - "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", + "description": "Turn any flavor of allowable package.json bin into a normalized object", "main": "lib/index.js", "repository": { "type": "git", - "url": "https://github.com/npm/npm-bundled.git" + "url": "https://github.com/npm/npm-normalize-package-bin.git" }, "author": "GitHub Inc.", "license": "ISC", - "devDependencies": { - "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", - "mkdirp": "^1.0.4", - "mutate-fs": "^2.1.1", - "rimraf": "^3.0.2", - "tap": "^16.3.0" - }, "scripts": { "test": "tap", + "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags", + "postpublish": "git push origin --follow-tags", "lint": "eslint \"**/*.js\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "npm run lint -- --fix", "prepublishOnly": "git push origin --follow-tags", - "snap": "tap", "posttest": "npm run lint" }, + "devDependencies": { + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" + }, "files": [ "bin/", "lib/" ], - "dependencies": { - "npm-normalize-package-bin": "^1.0.1" - }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, diff --git a/node_modules/npm-bundled/package.json b/node_modules/npm-bundled/package.json index cf20e297b0b63..e4c0106c2d504 100644 --- a/node_modules/npm-bundled/package.json +++ b/node_modules/npm-bundled/package.json @@ -1,30 +1,47 @@ { "name": "npm-bundled", - "version": "1.1.2", + "version": "2.0.1", "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", - "main": "index.js", + "main": "lib/index.js", "repository": { "type": "git", - "url": "git+https://github.com/npm/npm-bundled.git" + "url": "https://github.com/npm/npm-bundled.git" }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "author": "GitHub Inc.", "license": "ISC", "devDependencies": { - "mkdirp": "^0.5.1", - "mutate-fs": "^1.1.0", - "rimraf": "^2.6.1", - "tap": "^12.0.1" + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "mkdirp": "^1.0.4", + "mutate-fs": "^2.1.1", + "rimraf": "^3.0.2", + "tap": "^16.3.0" }, "scripts": { - "test": "tap test/*.js -J --100", + "test": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "postpublish": "git push origin --all; git push origin --tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "files": [ - "index.js" + "bin/", + "lib/" ], "dependencies": { - "npm-normalize-package-bin": "^1.0.1" + "npm-normalize-package-bin": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" } } diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json deleted file mode 100644 index a331a682e74e0..0000000000000 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "npm-normalize-package-bin", - "version": "1.0.1", - "description": "Turn any flavor of allowable package.json bin into a normalized object", - "repository": "git+https://github.com/npm/npm-normalize-package-bin", - "author": "Isaac Z. Schlueter (https://izs.me)", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" - }, - "tap": { - "check-coverage": true - }, - "devDependencies": { - "tap": "^14.10.2" - } -} diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js deleted file mode 100644 index 63dafa8913741..0000000000000 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/array.js +++ /dev/null @@ -1,37 +0,0 @@ -const normalize = require('../') -const t = require('tap') - -t.test('benign array', async t => { - const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'y/z', './a'] } - const expect = { name: 'hello', version: 'world', bin: { - y: 'x/y', - z: 'y/z', - a: 'a', - } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('conflicting array', async t => { - const pkg = { name: 'hello', version: 'world', bin: ['./x/y', 'z/y', './a'] } - const expect = { name: 'hello', version: 'world', bin: { - y: 'z/y', - a: 'a', - } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('slashy array', async t => { - const pkg = { name: 'hello', version: 'world', bin: [ '/etc/passwd' ] } - const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('dotty array', async t => { - const pkg = { name: 'hello', version: 'world', bin: ['../../../../etc/passwd'] } - const expect = { name: 'hello', version: 'world', bin: { passwd: 'etc/passwd' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js deleted file mode 100644 index 536d7eb22f68a..0000000000000 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/nobin.js +++ /dev/null @@ -1,35 +0,0 @@ -const normalize = require('../') -const t = require('tap') - -// all of these just delete the bins, so expect the same value -const expect = { name: 'hello', version: 'world' } - -t.test('no bin in object', async t => { - const pkg = { name: 'hello', version: 'world' } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('empty string bin in object', async t => { - const pkg = { name: 'hello', version: 'world', bin: '' } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('false bin in object', async t => { - const pkg = { name: 'hello', version: 'world', bin: false } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('null bin in object', async t => { - const pkg = { name: 'hello', version: 'world', bin: null } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('number bin', async t => { - const pkg = { name: 'hello', version: 'world', bin: 42069 } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js deleted file mode 100644 index 00d23684fb75b..0000000000000 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/object.js +++ /dev/null @@ -1,141 +0,0 @@ -const normalize = require('../') -const t = require('tap') - -t.test('benign object', async t => { - // just clean up the ./ in the targets and remove anything weird - const pkg = { name: 'hello', version: 'world', bin: { - y: './x/y', - z: './y/z', - a: './a', - } } - const expect = { name: 'hello', version: 'world', bin: { - y: 'x/y', - z: 'y/z', - a: 'a', - } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('empty and non-string targets', async t => { - // just clean up the ./ in the targets and remove anything weird - const pkg = { name: 'hello', version: 'world', bin: { - z: './././', - y: '', - './x': 'x.js', - re: /asdf/, - foo: { bar: 'baz' }, - false: false, - null: null, - array: [1,2,3], - func: function () {}, - } } - const expect = { name: 'hello', version: 'world', bin: { - x: 'x.js', - } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('slashy object', async t => { - const pkg = { name: 'hello', version: 'world', bin: { - '/path/foo': '/etc/passwd', - 'bar': '/etc/passwd', - '/etc/glorb/baz': '/etc/passwd', - '/etc/passwd:/bin/usr/exec': '/etc/passwd', - } } - const expect = { - name: 'hello', - version: 'world', - bin: { - foo: 'etc/passwd', - bar: 'etc/passwd', - baz: 'etc/passwd', - exec: 'etc/passwd', - } - } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('dotty object', async t => { - const pkg = { - name: 'hello', - version: 'world', - bin: { - 'nodots': '../../../../etc/passwd', - '../../../../../../dots': '../../../../etc/passwd', - '.././../\\./..//C:\\./': 'this is removed', - '.././../\\./..//C:\\/': 'super safe programming language', - '.././../\\./..//C:\\x\\y\\z/': 'xyz', - } } - const expect = { name: 'hello', version: 'world', bin: { - nodots: 'etc/passwd', - dots: 'etc/passwd', - C: 'super safe programming language', - z: 'xyz', - } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('weird object', async t => { - const pkg = { name: 'hello', version: 'world', bin: /asdf/ } - const expect = { name: 'hello', version: 'world' } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('oddball keys', async t => { - const pkg = { - bin: { - '~': 'target', - '£': 'target', - 'ζ': 'target', - 'ぎ': 'target', - '操': 'target', - '🎱': 'target', - '💎': 'target', - '💸': 'target', - '🦉': 'target', - 'сheck-dom': 'target', - 'Ωpm': 'target', - 'ζλ': 'target', - 'мга': 'target', - 'пше': 'target', - 'тзч': 'target', - 'тзь': 'target', - 'нфкт': 'target', - 'ссср': 'target', - '君の名は': 'target', - '君の名は': 'target', - } - } - - const expect = { - bin: { - '~': 'target', - '£': 'target', - 'ζ': 'target', - 'ぎ': 'target', - '操': 'target', - '🎱': 'target', - '💎': 'target', - '💸': 'target', - '🦉': 'target', - 'сheck-dom': 'target', - 'Ωpm': 'target', - 'ζλ': 'target', - 'мга': 'target', - 'пше': 'target', - 'тзч': 'target', - 'тзь': 'target', - 'нфкт': 'target', - 'ссср': 'target', - '君の名は': 'target', - }, - } - - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) diff --git a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js b/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js deleted file mode 100644 index b6de8f8f589b5..0000000000000 --- a/node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/test/string.js +++ /dev/null @@ -1,37 +0,0 @@ -const normalize = require('../') -const t = require('tap') - -t.test('benign string', async t => { - const pkg = { name: 'hello', version: 'world', bin: 'hello.js' } - const expect = { name: 'hello', version: 'world', bin: { hello: 'hello.js' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('slashy string', async t => { - const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd' } - const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('dotty string', async t => { - const pkg = { name: 'hello', version: 'world', bin: '../../../../etc/passwd' } - const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('double path', async t => { - const pkg = { name: 'hello', version: 'world', bin: '/etc/passwd:/bin/usr/exec' } - const expect = { name: 'hello', version: 'world', bin: { hello: 'etc/passwd:/bin/usr/exec' } } - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) - -t.test('string with no name', async t => { - const pkg = { bin: 'foobar.js' } - const expect = {} - t.strictSame(normalize(pkg), expect) - t.strictSame(normalize(normalize(pkg)), expect, 'double sanitize ok') -}) diff --git a/package-lock.json b/package-lock.json index 3b3e57262fd9e..555c08987ceef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -976,6 +976,15 @@ "node": ">= 10" } }, + "node_modules/@npmcli/installed-package-contents/node_modules/npm-bundled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz", + "integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==", + "inBundle": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, "node_modules/@npmcli/map-workspaces": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-2.0.4.tgz", @@ -5454,11 +5463,24 @@ } }, "node_modules/npm-bundled": { - "version": "1.1.2", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-2.0.1.tgz", + "integrity": "sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==", "inBundle": true, - "license": "ISC", "dependencies": { - "npm-normalize-package-bin": "^1.0.1" + "npm-normalize-package-bin": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-bundled/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-install-checks": { @@ -5516,24 +5538,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm-packlist/node_modules/npm-bundled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-2.0.0.tgz", - "integrity": "sha512-ZnkDgpakv39F6w9D6uZNmmXohXEHW5EC1MDziHvXeLeyBmJ/FpfM1n+v8PkQ2Y1TcNHzuAVTZQIgabkgskR77A==", - "inBundle": true, - "dependencies": { - "npm-normalize-package-bin": "^1.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/npm-packlist/node_modules/npm-bundled/node_modules/npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "inBundle": true - }, "node_modules/npm-packlist/node_modules/npm-normalize-package-bin": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", From 2c4e38728f25fd32624df2eb5bbf61c2c40c8ad5 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:56:32 -0700 Subject: [PATCH 103/175] deps: hosted-git-info@5.1.0 --- .../hosted-git-info/lib/git-host-info.js | 7 +++++ node_modules/hosted-git-info/lib/git-host.js | 4 +++ node_modules/hosted-git-info/lib/index.js | 12 ++++++--- node_modules/hosted-git-info/package.json | 26 ++++++++++--------- package-lock.json | 9 ++++--- package.json | 2 +- .../test/spec-from-lock.js.test.cjs | 2 ++ 7 files changed, 41 insertions(+), 21 deletions(-) diff --git a/node_modules/hosted-git-info/lib/git-host-info.js b/node_modules/hosted-git-info/lib/git-host-info.js index 9a9720fa3c339..cdc1e4601acff 100644 --- a/node_modules/hosted-git-info/lib/git-host-info.js +++ b/node_modules/hosted-git-info/lib/git-host-info.js @@ -6,6 +6,7 @@ const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' const defaults = { sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`, sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, + edittemplate: ({ domain, user, project, committish, editpath, path }) => `https://${domain}/${user}/${project}${maybeJoin('/', editpath, '/', maybeEncode(committish || 'master'), '/', path)}`, browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`, browsefiletemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'master')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`, @@ -24,6 +25,7 @@ gitHosts.github = Object.assign({}, defaults, { protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], domain: 'github.com', treepath: 'tree', + editpath: 'edit', filetemplate: ({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish) || 'master'}/${path}`, gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish) || 'master'}`, @@ -53,6 +55,8 @@ gitHosts.bitbucket = Object.assign({}, defaults, { protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], domain: 'bitbucket.org', treepath: 'src', + editpath: '?mode=edit', + edittemplate: ({ domain, user, project, committish, treepath, path, editpath }) => `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish || 'master'), '/', path, editpath)}`, tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish) || 'master'}.tar.gz`, extract: (url) => { let [, user, project, aux] = url.pathname.split('/', 4) @@ -76,6 +80,7 @@ gitHosts.gitlab = Object.assign({}, defaults, { protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], domain: 'gitlab.com', treepath: 'tree', + editpath: '-/edit', httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish) || 'master'}`, extract: (url) => { @@ -102,8 +107,10 @@ gitHosts.gitlab = Object.assign({}, defaults, { gitHosts.gist = Object.assign({}, defaults, { protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], domain: 'gist.github.com', + editpath: 'edit', sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin('#', committish)}`, sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`, + edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin('/', maybeEncode(committish))}/${editpath}`, browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, browsefiletemplate: ({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, diff --git a/node_modules/hosted-git-info/lib/git-host.js b/node_modules/hosted-git-info/lib/git-host.js index 8a975e92e58bb..bb65d4d992aa7 100644 --- a/node_modules/hosted-git-info/lib/git-host.js +++ b/node_modules/hosted-git-info/lib/git-host.js @@ -95,6 +95,10 @@ class GitHost { return this._fill(this.filetemplate, { ...opts, path }) } + edit (path, opts) { + return this._fill(this.edittemplate, { ...opts, path }) + } + getDefaultRepresentation () { return this.default } diff --git a/node_modules/hosted-git-info/lib/index.js b/node_modules/hosted-git-info/lib/index.js index 8bce6b3c28d51..d5d63c66839b0 100644 --- a/node_modules/hosted-git-info/lib/index.js +++ b/node_modules/hosted-git-info/lib/index.js @@ -46,8 +46,8 @@ function fromUrl (giturl, opts) { return } - const url = isGitHubShorthand(giturl) ? 'github:' + giturl : correctProtocol(giturl) - const parsed = parseGitUrl(url) + const correctedUrl = isGitHubShorthand(giturl) ? 'github:' + giturl : correctProtocol(giturl) + const parsed = parseGitUrl(correctedUrl) if (!parsed) { return parsed } @@ -229,7 +229,9 @@ const parseGitUrl = (giturl) => { let result try { result = new url.URL(giturl) - } catch (err) {} + } catch { + // this fn should never throw + } if (result) { return result @@ -238,7 +240,9 @@ const parseGitUrl = (giturl) => { const correctedUrl = correctUrl(giturl) try { result = new url.URL(correctedUrl) - } catch (err) {} + } catch { + // this fn should never throw + } return result } diff --git a/node_modules/hosted-git-info/package.json b/node_modules/hosted-git-info/package.json index 0153b0852cbf4..07a5587ca76ef 100644 --- a/node_modules/hosted-git-info/package.json +++ b/node_modules/hosted-git-info/package.json @@ -1,11 +1,11 @@ { "name": "hosted-git-info", - "version": "5.0.0", + "version": "5.1.0", "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", "main": "./lib/index.js", "repository": { "type": "git", - "url": "git+https://github.com/npm/hosted-git-info.git" + "url": "https://github.com/npm/hosted-git-info.git" }, "keywords": [ "git", @@ -27,30 +27,32 @@ "snap": "tap", "test": "tap", "test:coverage": "tap --coverage-report=html", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", - "lintfix": "npm run lint -- --fix" + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "template-oss-apply": "template-oss-apply --force" }, "dependencies": { "lru-cache": "^7.5.1" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", - "tap": "^15.1.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "tap": { "color": 1, "coverage": true }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 555c08987ceef..264a43bbacae6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,7 +109,7 @@ "fastest-levenshtein": "^1.0.12", "glob": "^8.0.1", "graceful-fs": "^4.2.10", - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^5.1.0", "ini": "^3.0.0", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", @@ -3820,14 +3820,15 @@ } }, "node_modules/hosted-git-info": { - "version": "5.0.0", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.1.0.tgz", + "integrity": "sha512-Ek+QmMEqZF8XrbFdwoDjSbm7rT23pCgEMOJmz6GPk/s4yH//RQfNPArhIxbguNxROq/+5lNBwCDHMhA903Kx1Q==", "inBundle": true, - "license": "ISC", "dependencies": { "lru-cache": "^7.5.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/html-encoding-sniffer": { diff --git a/package.json b/package.json index 03984d9067063..e4a0458576728 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "fastest-levenshtein": "^1.0.12", "glob": "^8.0.1", "graceful-fs": "^4.2.10", - "hosted-git-info": "^5.0.0", + "hosted-git-info": "^5.1.0", "ini": "^3.0.0", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", diff --git a/workspaces/arborist/tap-snapshots/test/spec-from-lock.js.test.cjs b/workspaces/arborist/tap-snapshots/test/spec-from-lock.js.test.cjs index c67ddf275ccb5..86a774fffb9ff 100644 --- a/workspaces/arborist/tap-snapshots/test/spec-from-lock.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/spec-from-lock.js.test.cjs @@ -101,6 +101,8 @@ Result { "default": "sshurl", "docstemplate": "function docstemplate", "domain": "github.com", + "editpath": "edit", + "edittemplate": "function edittemplate", "extract": "function extract", "filetemplate": "function filetemplate", "gittemplate": "function gittemplate", From d7e9a8ed5b7c1f9ca8d34e86388a134b2f48fc15 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:57:11 -0700 Subject: [PATCH 104/175] deps: ini@3.0.1 --- node_modules/ini/lib/ini.js | 4 +++- node_modules/ini/package.json | 6 +++--- package-lock.json | 8 ++++---- package.json | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/node_modules/ini/lib/ini.js b/node_modules/ini/lib/ini.js index 965e702493b1d..d05682b606bc2 100644 --- a/node_modules/ini/lib/ini.js +++ b/node_modules/ini/lib/ini.js @@ -186,7 +186,9 @@ const unsafe = (val, doUnesc) => { } try { val = JSON.parse(val) - } catch (_) {} + } catch { + // ignore errors + } } else { // walk the val to find the first not-escaped ; character let esc = false diff --git a/node_modules/ini/package.json b/node_modules/ini/package.json index 1fe32c8f162a3..e41c0f0f3dcc5 100644 --- a/node_modules/ini/package.json +++ b/node_modules/ini/package.json @@ -2,7 +2,7 @@ "author": "GitHub Inc.", "name": "ini", "description": "An ini encoder/decoder for node", - "version": "3.0.0", + "version": "3.0.1", "repository": { "type": "git", "url": "https://github.com/npm/ini.git" @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.5.0", "tap": "^16.0.1" }, "license": "ISC", @@ -36,6 +36,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.5.0" } } diff --git a/package-lock.json b/package-lock.json index 264a43bbacae6..326eb73194f4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -110,7 +110,7 @@ "glob": "^8.0.1", "graceful-fs": "^4.2.10", "hosted-git-info": "^5.1.0", - "ini": "^3.0.0", + "ini": "^3.0.1", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", @@ -4017,9 +4017,9 @@ "license": "ISC" }, "node_modules/ini": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.0.tgz", - "integrity": "sha512-TxYQaeNW/N8ymDvwAxPyRbhMBtnEwuvaTYpOQkFx1nSeusgezHniEc/l35Vo4iCq/mMiTJbpD7oYxN98hFlfmw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.1.tgz", + "integrity": "sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ==", "inBundle": true, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" diff --git a/package.json b/package.json index e4a0458576728..ccb60f8aa659e 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "glob": "^8.0.1", "graceful-fs": "^4.2.10", "hosted-git-info": "^5.1.0", - "ini": "^3.0.0", + "ini": "^3.0.1", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", From 1286f03fe73dee9a447b13b662f0c5622ab6ec9e Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 13:59:23 -0700 Subject: [PATCH 105/175] deps: unique-filename@2.0.1 --- node_modules/unique-filename/package.json | 4 +-- node_modules/unique-slug/{ => lib}/index.js | 4 +-- node_modules/unique-slug/package.json | 35 ++++++++++++++++----- node_modules/unique-slug/test/index.js | 13 -------- package-lock.json | 17 +++++----- 5 files changed, 42 insertions(+), 31 deletions(-) rename node_modules/unique-slug/{ => lib}/index.js (55%) delete mode 100644 node_modules/unique-slug/test/index.js diff --git a/node_modules/unique-filename/package.json b/node_modules/unique-filename/package.json index 0d4ddb45ef11d..bfdec2c3722a0 100644 --- a/node_modules/unique-filename/package.json +++ b/node_modules/unique-filename/package.json @@ -1,6 +1,6 @@ { "name": "unique-filename", - "version": "2.0.0", + "version": "2.0.1", "description": "Generate a unique filename for use in temporary directories or caches.", "main": "lib/index.js", "scripts": { @@ -32,7 +32,7 @@ "tap": "^16.3.0" }, "dependencies": { - "unique-slug": "^2.0.2" + "unique-slug": "^3.0.0" }, "files": [ "bin/", diff --git a/node_modules/unique-slug/index.js b/node_modules/unique-slug/lib/index.js similarity index 55% rename from node_modules/unique-slug/index.js rename to node_modules/unique-slug/lib/index.js index fa4761ad2e258..1bac84d95d730 100644 --- a/node_modules/unique-slug/index.js +++ b/node_modules/unique-slug/lib/index.js @@ -4,8 +4,8 @@ var MurmurHash3 = require('imurmurhash') module.exports = function (uniq) { if (uniq) { var hash = new MurmurHash3(uniq) - return ('00000000' + hash.result().toString(16)).substr(-8) + return ('00000000' + hash.result().toString(16)).slice(-8) } else { - return (Math.random().toString(16) + '0000000').substr(2, 8) + return (Math.random().toString(16) + '0000000').slice(2, 10) } } diff --git a/node_modules/unique-slug/package.json b/node_modules/unique-slug/package.json index 2142e68561f5d..3194408f27fda 100644 --- a/node_modules/unique-slug/package.json +++ b/node_modules/unique-slug/package.json @@ -1,23 +1,44 @@ { "name": "unique-slug", - "version": "2.0.2", + "version": "3.0.0", "description": "Generate a unique character string suitible for use in files and URLs.", - "main": "index.js", + "main": "lib/index.js", "scripts": { - "test": "standard && tap --coverage test" + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "keywords": [], - "author": "Rebecca Turner (http://re-becca.org)", + "author": "GitHub Inc.", "license": "ISC", "devDependencies": { - "standard": "^12.0.1", - "tap": "^12.7.0" + "@npmcli/eslint-config": "^3.1.0", + "@npmcli/template-oss": "3.5.0", + "tap": "^16.3.0" }, "repository": { "type": "git", - "url": "git://github.com/iarna/unique-slug.git" + "url": "https://github.com/npm/unique-slug.git" }, "dependencies": { "imurmurhash": "^0.1.4" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.5.0" } } diff --git a/node_modules/unique-slug/test/index.js b/node_modules/unique-slug/test/index.js deleted file mode 100644 index 0f4ccad04af6f..0000000000000 --- a/node_modules/unique-slug/test/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -var t = require('tap') -var uniqueSlug = require('../index.js') - -t.plan(5) -var slugA = uniqueSlug() -t.is(slugA.length, 8, 'random slugs are 8 chars') -t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same") -var base = '/path/to/thingy' -var slugB = uniqueSlug(base) -t.is(slugB.length, 8, 'string based slugs are 8 chars') -t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same') -t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different') diff --git a/package-lock.json b/package-lock.json index 326eb73194f4b..33939ece8b8e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9916,24 +9916,27 @@ } }, "node_modules/unique-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.0.tgz", - "integrity": "sha512-tpzoz2RpZ//6Zt4GPpOFTyrnfZuSvjIfe8lvx6Thp4yTQwJtAFwPlssEBE62VhGA2We5/COyNpcIu+OABu3/Yg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", + "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", "inBundle": true, "dependencies": { - "unique-slug": "^2.0.2" + "unique-slug": "^3.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", + "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", "inBundle": true, "dependencies": { "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/unist-builder": { From 02541a079d0cb88a5c16cf0d2fefb8bdf93233f0 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 15:03:57 -0700 Subject: [PATCH 106/175] chore: @npmcli/template-oss@3.7.0 --- .github/workflows/ci-docs.yml | 6 +- .github/workflows/ci-libnpmaccess.yml | 6 +- .github/workflows/ci-libnpmdiff.yml | 6 +- .github/workflows/ci-libnpmexec.yml | 6 +- .github/workflows/ci-libnpmfund.yml | 6 +- .github/workflows/ci-libnpmhook.yml | 6 +- .github/workflows/ci-libnpmorg.yml | 6 +- .github/workflows/ci-libnpmpack.yml | 6 +- .github/workflows/ci-libnpmpublish.yml | 6 +- .github/workflows/ci-libnpmsearch.yml | 6 +- .github/workflows/ci-libnpmteam.yml | 6 +- .github/workflows/ci-libnpmversion.yml | 6 +- .github/workflows/ci-npmcli-arborist.yml | 6 +- .../workflows/release-please-libnpmaccess.yml | 60 ------------------- .../workflows/release-please-libnpmdiff.yml | 60 ------------------- .../workflows/release-please-libnpmexec.yml | 60 ------------------- .../workflows/release-please-libnpmfund.yml | 60 ------------------- .../workflows/release-please-libnpmhook.yml | 60 ------------------- .../workflows/release-please-libnpmorg.yml | 60 ------------------- .../workflows/release-please-libnpmpack.yml | 60 ------------------- .../release-please-libnpmpublish.yml | 60 ------------------- .../workflows/release-please-libnpmsearch.yml | 60 ------------------- .../workflows/release-please-libnpmteam.yml | 60 ------------------- .../release-please-libnpmversion.yml | 60 ------------------- .../release-please-npmcli-arborist.yml | 60 ------------------- .github/workflows/release-please.yml | 57 ++++++++++++++++++ .gitignore | 2 + .release-please-manifest.json | 14 +++++ docs/package.json | 4 +- package-lock.json | 38 ++++++------ package.json | 4 +- release-please-config.json | 43 +++++++++++++ smoke-tests/package.json | 4 +- workspaces/arborist/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 +- 45 files changed, 217 insertions(+), 795 deletions(-) delete mode 100644 .github/workflows/release-please-libnpmaccess.yml delete mode 100644 .github/workflows/release-please-libnpmdiff.yml delete mode 100644 .github/workflows/release-please-libnpmexec.yml delete mode 100644 .github/workflows/release-please-libnpmfund.yml delete mode 100644 .github/workflows/release-please-libnpmhook.yml delete mode 100644 .github/workflows/release-please-libnpmorg.yml delete mode 100644 .github/workflows/release-please-libnpmpack.yml delete mode 100644 .github/workflows/release-please-libnpmpublish.yml delete mode 100644 .github/workflows/release-please-libnpmsearch.yml delete mode 100644 .github/workflows/release-please-libnpmteam.yml delete mode 100644 .github/workflows/release-please-libnpmversion.yml delete mode 100644 .github/workflows/release-please-npmcli-arborist.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index f5543605a9d9f..82d9dcf674651 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -16,8 +16,8 @@ on: paths: - docs/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -81,5 +81,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w docs diff --git a/.github/workflows/ci-libnpmaccess.yml b/.github/workflows/ci-libnpmaccess.yml index eda4741583bb9..7456d60e7ad90 100644 --- a/.github/workflows/ci-libnpmaccess.yml +++ b/.github/workflows/ci-libnpmaccess.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmaccess/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmaccess diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml index e2347877d0243..1335b58eac890 100644 --- a/.github/workflows/ci-libnpmdiff.yml +++ b/.github/workflows/ci-libnpmdiff.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmdiff/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmdiff diff --git a/.github/workflows/ci-libnpmexec.yml b/.github/workflows/ci-libnpmexec.yml index 645eada5c0618..c0ae794304c8c 100644 --- a/.github/workflows/ci-libnpmexec.yml +++ b/.github/workflows/ci-libnpmexec.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmexec/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmexec diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 3ec70cf103584..74dd784f24924 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmfund/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmfund diff --git a/.github/workflows/ci-libnpmhook.yml b/.github/workflows/ci-libnpmhook.yml index 1e29eb84d7688..e424fe7e79633 100644 --- a/.github/workflows/ci-libnpmhook.yml +++ b/.github/workflows/ci-libnpmhook.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmhook/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmhook diff --git a/.github/workflows/ci-libnpmorg.yml b/.github/workflows/ci-libnpmorg.yml index 48fc1e794eb17..81f9291386f87 100644 --- a/.github/workflows/ci-libnpmorg.yml +++ b/.github/workflows/ci-libnpmorg.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmorg/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmorg diff --git a/.github/workflows/ci-libnpmpack.yml b/.github/workflows/ci-libnpmpack.yml index 765e1eb472ca5..7d6c3c4ce4d76 100644 --- a/.github/workflows/ci-libnpmpack.yml +++ b/.github/workflows/ci-libnpmpack.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmpack/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpack diff --git a/.github/workflows/ci-libnpmpublish.yml b/.github/workflows/ci-libnpmpublish.yml index 4aaba116e5b51..08e40e70c24fa 100644 --- a/.github/workflows/ci-libnpmpublish.yml +++ b/.github/workflows/ci-libnpmpublish.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmpublish/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpublish diff --git a/.github/workflows/ci-libnpmsearch.yml b/.github/workflows/ci-libnpmsearch.yml index 5d6ac4e798396..31f4c673cd75e 100644 --- a/.github/workflows/ci-libnpmsearch.yml +++ b/.github/workflows/ci-libnpmsearch.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmsearch/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmsearch diff --git a/.github/workflows/ci-libnpmteam.yml b/.github/workflows/ci-libnpmteam.yml index 4e2636d936060..438a16716d720 100644 --- a/.github/workflows/ci-libnpmteam.yml +++ b/.github/workflows/ci-libnpmteam.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmteam/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmteam diff --git a/.github/workflows/ci-libnpmversion.yml b/.github/workflows/ci-libnpmversion.yml index 2a86e6b825e0e..7dfc6e1671fb5 100644 --- a/.github/workflows/ci-libnpmversion.yml +++ b/.github/workflows/ci-libnpmversion.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/libnpmversion/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmversion diff --git a/.github/workflows/ci-npmcli-arborist.yml b/.github/workflows/ci-npmcli-arborist.yml index 1dbe0184a0f01..4dc131d396a35 100644 --- a/.github/workflows/ci-npmcli-arborist.yml +++ b/.github/workflows/ci-npmcli-arborist.yml @@ -16,8 +16,8 @@ on: paths: - workspaces/arborist/** schedule: - # "At 02:00 on Monday" https://crontab.guru/#0_2_*_*_1 - - cron: "0 2 * * 1" + # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 + - cron: "0 9 * * 1" jobs: lint: @@ -86,5 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - name: add tap problem matcher + run: echo "::add-matcher::.github/matchers/tap.json" - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w @npmcli/arborist diff --git a/.github/workflows/release-please-libnpmaccess.yml b/.github/workflows/release-please-libnpmaccess.yml deleted file mode 100644 index ce479107923ff..0000000000000 --- a/.github/workflows/release-please-libnpmaccess.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmaccess - -on: - push: - paths: - - workspaces/libnpmaccess/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmaccess - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmaccess" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmaccess@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmdiff.yml b/.github/workflows/release-please-libnpmdiff.yml deleted file mode 100644 index e2913fc56c251..0000000000000 --- a/.github/workflows/release-please-libnpmdiff.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmdiff - -on: - push: - paths: - - workspaces/libnpmdiff/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmdiff - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmdiff" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmdiff@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmexec.yml b/.github/workflows/release-please-libnpmexec.yml deleted file mode 100644 index 2b264d6ae8425..0000000000000 --- a/.github/workflows/release-please-libnpmexec.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmexec - -on: - push: - paths: - - workspaces/libnpmexec/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmexec - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmexec" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmexec@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmfund.yml b/.github/workflows/release-please-libnpmfund.yml deleted file mode 100644 index 5e9fe6d4fcbf9..0000000000000 --- a/.github/workflows/release-please-libnpmfund.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmfund - -on: - push: - paths: - - workspaces/libnpmfund/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmfund - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmfund" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmfund@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmhook.yml b/.github/workflows/release-please-libnpmhook.yml deleted file mode 100644 index 6325c37ff5404..0000000000000 --- a/.github/workflows/release-please-libnpmhook.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmhook - -on: - push: - paths: - - workspaces/libnpmhook/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmhook - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmhook" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmhook@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmorg.yml b/.github/workflows/release-please-libnpmorg.yml deleted file mode 100644 index a3ba63ca1b21e..0000000000000 --- a/.github/workflows/release-please-libnpmorg.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmorg - -on: - push: - paths: - - workspaces/libnpmorg/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmorg - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmorg" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmorg@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmpack.yml b/.github/workflows/release-please-libnpmpack.yml deleted file mode 100644 index 3bfaf8d413118..0000000000000 --- a/.github/workflows/release-please-libnpmpack.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmpack - -on: - push: - paths: - - workspaces/libnpmpack/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmpack - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmpack" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmpack@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmpublish.yml b/.github/workflows/release-please-libnpmpublish.yml deleted file mode 100644 index 78cd2b77e4211..0000000000000 --- a/.github/workflows/release-please-libnpmpublish.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmpublish - -on: - push: - paths: - - workspaces/libnpmpublish/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmpublish - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmpublish" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmpublish@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmsearch.yml b/.github/workflows/release-please-libnpmsearch.yml deleted file mode 100644 index a093f3ffcd537..0000000000000 --- a/.github/workflows/release-please-libnpmsearch.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmsearch - -on: - push: - paths: - - workspaces/libnpmsearch/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmsearch - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmsearch" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmsearch@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmteam.yml b/.github/workflows/release-please-libnpmteam.yml deleted file mode 100644 index 14158e253ed4a..0000000000000 --- a/.github/workflows/release-please-libnpmteam.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmteam - -on: - push: - paths: - - workspaces/libnpmteam/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmteam - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmteam" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmteam@${title##* }" - git push diff --git a/.github/workflows/release-please-libnpmversion.yml b/.github/workflows/release-please-libnpmversion.yml deleted file mode 100644 index 6a67bccbc46ec..0000000000000 --- a/.github/workflows/release-please-libnpmversion.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - libnpmversion - -on: - push: - paths: - - workspaces/libnpmversion/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/libnpmversion - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "libnpmversion" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: libnpmversion@${title##* }" - git push diff --git a/.github/workflows/release-please-npmcli-arborist.yml b/.github/workflows/release-please-npmcli-arborist.yml deleted file mode 100644 index 9e6886695f9e3..0000000000000 --- a/.github/workflows/release-please-npmcli-arborist.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -name: Release Please - @npmcli/arborist - -on: - push: - paths: - - workspaces/arborist/** - branches: - - main - - latest - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: node - monorepo-tags: true - path: workspaces/arborist - # name can be removed after this is merged - # https://github.com/google-github-actions/release-please-action/pull/459 - package-name: "@npmcli/arborist" - changelog-types: > - [ - {"type":"feat","section":"Features","hidden":false}, - {"type":"fix","section":"Bug Fixes","hidden":false}, - {"type":"docs","section":"Documentation","hidden":false}, - {"type":"deps","section":"Dependencies","hidden":false}, - {"type":"chore","hidden":true} - ] - - 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" - - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Update npm to latest - run: npm i --prefer-online --no-fund --no-audit -g npm@latest - - run: npm -v - - name: Update package-lock.json and commit - if: steps.release.outputs.pr - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} - npm run resetdeps - title="${{ fromJSON(steps.release.outputs.pr).title }}" - # get the version from the pr title - # get everything after the last space - git commit -am "deps: @npmcli/arborist@${title##* }" - git push diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000000000..3ec963f57eff2 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,57 @@ +# This file is automatically added by @npmcli/template-oss. Do not edit. + +name: Release Please + +on: + push: + branches: + - main + - latest + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + prs: ${{ steps.release.outputs.prs }} + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + command: manifest + + update-prs: + needs: release-please + if: needs.release-please.outputs.prs + runs-on: ubuntu-latest + strategy: + matrix: + pr: ${{ fromJSON(needs.release-please.outputs.prs) }} + steps: + - 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" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update PR ${{ matrix.pr.number }} dependencies and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ matrix.pr.number }} + npm run resetdeps + title="${{ matrix.pr.title }}" + # get the dependency spec from the pr title + # get everything after ': release ' + replace space with @ + dep_spec=$(echo "${title##*: release }" | tr ' ' @) + git commit -am "deps: $dep_spec" + git push diff --git a/.gitignore b/.gitignore index 8f054d246da48..94f6b413c7636 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ !/test/ !/workspaces/ +!/.release-please-manifest.json +!/release-please-config.json !/.eslintrc.js !/.eslintrc.local.json !/.gitattributes diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000000000..5e7ceccce79d8 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,14 @@ +{ + "workspaces/arborist": "5.6.0", + "workspaces/libnpmaccess": "6.0.3", + "workspaces/libnpmdiff": "4.0.4", + "workspaces/libnpmexec": "4.0.11", + "workspaces/libnpmfund": "3.0.2", + "workspaces/libnpmhook": "8.0.3", + "workspaces/libnpmorg": "4.0.3", + "workspaces/libnpmpack": "4.1.2", + "workspaces/libnpmpublish": "6.0.4", + "workspaces/libnpmsearch": "5.0.3", + "workspaces/libnpmteam": "4.0.3", + "workspaces/libnpmversion": "3.0.6" +} diff --git a/docs/package.json b/docs/package.json index 98fe8becd8318..8913b255eb831 100644 --- a/docs/package.json +++ b/docs/package.json @@ -24,7 +24,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -60,6 +60,6 @@ "ciVersions": [ "16" ], - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/package-lock.json b/package-lock.json index 33939ece8b8e3..d52c2266cfb03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -169,7 +169,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -189,7 +189,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -1095,9 +1095,9 @@ } }, "node_modules/@npmcli/template-oss": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.5.0.tgz", - "integrity": "sha512-cminCPl0see5fxCSQabmHhfUisgxIlq1xG9J815OzeJIyLVgB0DEGDwldKuknw1Xd5Od83ke6sxf90O7OxIlfA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.7.0.tgz", + "integrity": "sha512-bdGFcNZQGlHZvMMebd4DmhpWgu2NfDnG0go47Mhw/jwwSQu6hh4EGUdI5E0wx2FeWzoujY8gqPL7vvGXrTehDA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -1115,7 +1115,7 @@ "npm-package-arg": "^9.0.1", "proc-log": "^2.0.0", "semver": "^7.3.5", - "yaml": "^2.0.0-11" + "yaml": "2.0.0-11" }, "bin": { "template-oss-apply": "bin/apply.js", @@ -10538,7 +10538,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.1", @@ -10595,7 +10595,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -10618,7 +10618,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10641,7 +10641,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "tap": "^16.0.1" }, "engines": { @@ -10669,7 +10669,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -10687,7 +10687,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "tap": "^16.0.1" }, "engines": { @@ -10703,7 +10703,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10720,7 +10720,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10739,7 +10739,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -10759,7 +10759,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -10777,7 +10777,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10794,7 +10794,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10814,7 +10814,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "require-inject": "^1.4.4", "tap": "^16.0.1" }, diff --git a/package.json b/package.json index ccb60f8aa659e..b8d84595abfea 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -250,7 +250,7 @@ "templateOSS": { "rootRepo": false, "rootModule": false, - "version": "3.5.0" + "version": "3.7.0" }, "license": "Artistic-2.0", "engines": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000000000..12995e545b8af --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,43 @@ +{ + "separate-pull-requests": true, + "changelog-sections": [ + { + "type": "feat", + "section": "Features", + "hidden": false + }, + { + "type": "fix", + "section": "Bug Fixes", + "hidden": false + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "deps", + "section": "Dependencies", + "hidden": false + }, + { + "type": "chore", + "hidden": true + } + ], + "packages": { + "workspaces/arborist": {}, + "workspaces/libnpmaccess": {}, + "workspaces/libnpmdiff": {}, + "workspaces/libnpmexec": {}, + "workspaces/libnpmfund": {}, + "workspaces/libnpmhook": {}, + "workspaces/libnpmorg": {}, + "workspaces/libnpmpack": {}, + "workspaces/libnpmpublish": {}, + "workspaces/libnpmsearch": {}, + "workspaces/libnpmteam": {}, + "workspaces/libnpmversion": {} + } +} diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 40e794e82e03c..0a30d078ebb8a 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.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": "3.5.0", + "version": "3.7.0", "workspaceRepo": false }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 0b9638771c939..3adbfafe333e0 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -103,6 +103,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index ca1ee7055b3ab..72db585fef7df 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -46,6 +46,6 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 8c8b6b23b7b48..c40ab8588d2b9 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "tap": "^16.0.1" }, "dependencies": { @@ -61,6 +61,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index f9ccd7d3bff1e..85c7af1a1e37c 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -74,6 +74,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index aa2186148e353..c1e1507d13acb 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -45,7 +45,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "tap": "^16.0.1" }, "dependencies": { @@ -56,6 +56,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index a26338262e96b..b58a9e4b7befc 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -49,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 852aa69e3a3f3..f1c14ca6b3146 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -31,7 +31,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -52,6 +52,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index c1303e37eb8aa..9844c928f5588 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index c561b86b9ea71..86a2921e0a855 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -53,6 +53,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 12b62afc91a14..e537e3cbd0716 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -48,6 +48,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 54fdab0a6c9b8..63eb2728e8d1a 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -42,6 +42,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index bf24cc3878ffe..0cac4b923c4f8 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.5.0", + "@npmcli/template-oss": "3.7.0", "require-inject": "^1.4.4", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.5.0" + "version": "3.7.0" } } From f628431c8a79d7cf00987ca6372dc34d4fbadfcf Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 25 Aug 2022 15:30:18 -0700 Subject: [PATCH 107/175] chore: @npmcli/template-oss@3.7.1 --- .github/matchers/tap.json | 32 ++++++++++++++++++++++++ .github/workflows/release-please.yml | 1 - docs/package.json | 4 +-- package-lock.json | 36 +++++++++++++-------------- package.json | 4 +-- smoke-tests/package.json | 4 +-- workspaces/arborist/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 +-- 18 files changed, 80 insertions(+), 49 deletions(-) create mode 100644 .github/matchers/tap.json diff --git a/.github/matchers/tap.json b/.github/matchers/tap.json new file mode 100644 index 0000000000000..2c81ea9803fbc --- /dev/null +++ b/.github/matchers/tap.json @@ -0,0 +1,32 @@ +{ + "//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.", + "problemMatcher": [ + { + "owner": "tap", + "pattern": [ + { + "regexp": "^\\s*not ok \\d+ - (.*)", + "message": 1 + }, + { + "regexp": "^\\s*---" + }, + { + "regexp": "^\\s*at:" + }, + { + "regexp": "^\\s*line:\\s*(\\d+)", + "line": 1 + }, + { + "regexp": "^\\s*column:\\s*(\\d+)", + "column": 1 + }, + { + "regexp": "^\\s*file:\\s*(.*)", + "file": 1 + } + ] + } + ] +} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3ec963f57eff2..1935e6b893a73 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -43,7 +43,6 @@ jobs: run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - name: Update PR ${{ matrix.pr.number }} dependencies and commit - if: steps.release.outputs.pr env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/docs/package.json b/docs/package.json index 8913b255eb831..eb36d5ffb743a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -24,7 +24,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -60,6 +60,6 @@ "ciVersions": [ "16" ], - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/package-lock.json b/package-lock.json index d52c2266cfb03..600981fc334af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -169,7 +169,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -189,7 +189,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -1095,9 +1095,9 @@ } }, "node_modules/@npmcli/template-oss": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.7.0.tgz", - "integrity": "sha512-bdGFcNZQGlHZvMMebd4DmhpWgu2NfDnG0go47Mhw/jwwSQu6hh4EGUdI5E0wx2FeWzoujY8gqPL7vvGXrTehDA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.7.1.tgz", + "integrity": "sha512-fnaWKI6O27cnv8cE0xiuAk/EYxEy3hj2EDgAd3FfGyP2WsUPrWyrn8C4Z6xcU3C3delTlAhFI/t20D6yiDsevg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -10538,7 +10538,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.1", @@ -10595,7 +10595,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -10618,7 +10618,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10641,7 +10641,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "tap": "^16.0.1" }, "engines": { @@ -10669,7 +10669,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -10687,7 +10687,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "tap": "^16.0.1" }, "engines": { @@ -10703,7 +10703,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10720,7 +10720,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10739,7 +10739,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -10759,7 +10759,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -10777,7 +10777,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10794,7 +10794,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10814,7 +10814,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "require-inject": "^1.4.4", "tap": "^16.0.1" }, diff --git a/package.json b/package.json index b8d84595abfea..658d2508799dd 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -250,7 +250,7 @@ "templateOSS": { "rootRepo": false, "rootModule": false, - "version": "3.7.0" + "version": "3.7.1" }, "license": "Artistic-2.0", "engines": { diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 0a30d078ebb8a..7bde0038f722f 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.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": "3.7.0", + "version": "3.7.1", "workspaceRepo": false }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 3adbfafe333e0..c6e2bd25cc1d5 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -103,6 +103,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 72db585fef7df..a56e6b44a00ea 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -46,6 +46,6 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index c40ab8588d2b9..6e2f920ef5d05 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "tap": "^16.0.1" }, "dependencies": { @@ -61,6 +61,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 85c7af1a1e37c..6340035e9f192 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -74,6 +74,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index c1e1507d13acb..75eed3c0cdbc7 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -45,7 +45,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "tap": "^16.0.1" }, "dependencies": { @@ -56,6 +56,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index b58a9e4b7befc..f686c13ad889b 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -49,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index f1c14ca6b3146..4fd55d7045ce6 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -31,7 +31,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -52,6 +52,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 9844c928f5588..b5b42dd1a85d6 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 86a2921e0a855..2ad578edee9d5 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -53,6 +53,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index e537e3cbd0716..4b76e082f44e3 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -48,6 +48,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 63eb2728e8d1a..2279caec9750c 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -42,6 +42,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 0cac4b923c4f8..73c089b5e6f67 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.0", + "@npmcli/template-oss": "3.7.1", "require-inject": "^1.4.4", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.0" + "version": "3.7.1" } } From 6f08157d49d9df141351c78342920df2ef12920b Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 31 Aug 2022 13:04:09 -0700 Subject: [PATCH 108/175] chore: use release please --- .github/workflows/ci-docs.yml | 2 +- .github/workflows/ci-libnpmaccess.yml | 2 +- .github/workflows/ci-libnpmdiff.yml | 2 +- .github/workflows/ci-libnpmexec.yml | 2 +- .github/workflows/ci-libnpmfund.yml | 2 +- .github/workflows/ci-libnpmhook.yml | 2 +- .github/workflows/ci-libnpmorg.yml | 2 +- .github/workflows/ci-libnpmpack.yml | 2 +- .github/workflows/ci-libnpmpublish.yml | 2 +- .github/workflows/ci-libnpmsearch.yml | 2 +- .github/workflows/ci-libnpmteam.yml | 2 +- .github/workflows/ci-libnpmversion.yml | 2 +- .github/workflows/ci-npmcli-arborist.yml | 2 +- .github/workflows/release-please.yml | 78 +- .github/workflows/release.yml | 55 +- .release-please-manifest.json | 1 + docs/package.json | 4 +- node_modules/.gitignore | 160 + package-lock.json | 3483 +++++++++++++++++++++- package.json | 10 +- release-please-config.json | 14 +- scripts/changelog.js | 434 --- scripts/dependency-graph.js | 2 +- scripts/npm-cli-repos.txt | 6 + scripts/release-manager.js | 248 -- smoke-tests/package.json | 4 +- workspaces/arborist/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 +- 38 files changed, 3706 insertions(+), 867 deletions(-) delete mode 100644 scripts/changelog.js delete mode 100644 scripts/release-manager.js diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 82d9dcf674651..dd8a43192ddd0 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -81,7 +81,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w docs diff --git a/.github/workflows/ci-libnpmaccess.yml b/.github/workflows/ci-libnpmaccess.yml index 7456d60e7ad90..1aa37ba121623 100644 --- a/.github/workflows/ci-libnpmaccess.yml +++ b/.github/workflows/ci-libnpmaccess.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmaccess diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml index 1335b58eac890..e02318aa5bae3 100644 --- a/.github/workflows/ci-libnpmdiff.yml +++ b/.github/workflows/ci-libnpmdiff.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmdiff diff --git a/.github/workflows/ci-libnpmexec.yml b/.github/workflows/ci-libnpmexec.yml index c0ae794304c8c..1cc71e7b62113 100644 --- a/.github/workflows/ci-libnpmexec.yml +++ b/.github/workflows/ci-libnpmexec.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmexec diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 74dd784f24924..cf8ed0b1512cd 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmfund diff --git a/.github/workflows/ci-libnpmhook.yml b/.github/workflows/ci-libnpmhook.yml index e424fe7e79633..e924aba6d65fc 100644 --- a/.github/workflows/ci-libnpmhook.yml +++ b/.github/workflows/ci-libnpmhook.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmhook diff --git a/.github/workflows/ci-libnpmorg.yml b/.github/workflows/ci-libnpmorg.yml index 81f9291386f87..bdfec9eb64004 100644 --- a/.github/workflows/ci-libnpmorg.yml +++ b/.github/workflows/ci-libnpmorg.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmorg diff --git a/.github/workflows/ci-libnpmpack.yml b/.github/workflows/ci-libnpmpack.yml index 7d6c3c4ce4d76..108a5fd1dc795 100644 --- a/.github/workflows/ci-libnpmpack.yml +++ b/.github/workflows/ci-libnpmpack.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpack diff --git a/.github/workflows/ci-libnpmpublish.yml b/.github/workflows/ci-libnpmpublish.yml index 08e40e70c24fa..d5a744b4b2424 100644 --- a/.github/workflows/ci-libnpmpublish.yml +++ b/.github/workflows/ci-libnpmpublish.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpublish diff --git a/.github/workflows/ci-libnpmsearch.yml b/.github/workflows/ci-libnpmsearch.yml index 31f4c673cd75e..98cd4a1fdea05 100644 --- a/.github/workflows/ci-libnpmsearch.yml +++ b/.github/workflows/ci-libnpmsearch.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmsearch diff --git a/.github/workflows/ci-libnpmteam.yml b/.github/workflows/ci-libnpmteam.yml index 438a16716d720..59252e88bb8ac 100644 --- a/.github/workflows/ci-libnpmteam.yml +++ b/.github/workflows/ci-libnpmteam.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmteam diff --git a/.github/workflows/ci-libnpmversion.yml b/.github/workflows/ci-libnpmversion.yml index 7dfc6e1671fb5..1ec3564650265 100644 --- a/.github/workflows/ci-libnpmversion.yml +++ b/.github/workflows/ci-libnpmversion.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmversion diff --git a/.github/workflows/ci-npmcli-arborist.yml b/.github/workflows/ci-npmcli-arborist.yml index 4dc131d396a35..7b92a0da4bfb3 100644 --- a/.github/workflows/ci-npmcli-arborist.yml +++ b/.github/workflows/ci-npmcli-arborist.yml @@ -86,7 +86,7 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund - name: add tap problem matcher run: echo "::add-matcher::.github/matchers/tap.json" - - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w @npmcli/arborist diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1935e6b893a73..6e0604199b90a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -16,22 +16,40 @@ jobs: release-please: runs-on: ubuntu-latest outputs: - prs: ${{ steps.release.outputs.prs }} + pr: ${{ steps.release.outputs.pr }} + release: ${{ steps.release.outputs.release }} steps: - - uses: google-github-actions/release-please-action@v3 - id: release + - 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" + - uses: actions/setup-node@v3 with: - command: manifest + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund + - name: Release Please + id: release + run: npx --offline template-oss-release-please + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - update-prs: + post-pr: needs: release-please - if: needs.release-please.outputs.prs + if: needs.release-please.outputs.pr runs-on: ubuntu-latest - strategy: - matrix: - pr: ${{ fromJSON(needs.release-please.outputs.prs) }} + outputs: + ref: ${{ steps.ref.outputs.branch }} steps: + - name: Output ref + id: ref + run: echo "::set-output name=branch::${{ fromJSON(needs.release-please.outputs.pr).headBranchName }}" - uses: actions/checkout@v3 + with: + ref: ${{ steps.ref.outputs.branch }} - name: Setup git user run: | git config --global user.email "npm-cli+bot@github.com" @@ -42,15 +60,41 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - name: Update PR ${{ matrix.pr.number }} dependencies and commit + - run: npm i --ignore-scripts --no-audit --no-fund + - name: Post pull request actions env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr checkout ${{ matrix.pr.number }} - npm run resetdeps - title="${{ matrix.pr.title }}" - # get the dependency spec from the pr title - # get everything after ': release ' + replace space with @ - dep_spec=$(echo "${title##*: release }" | tr ' ' @) - git commit -am "deps: $dep_spec" + npm run rp-pull-request --ignore-scripts --if-present -ws -iwr + git commit -am "chore: post pull request" || true git push + + release-test: + needs: post-pr + if: needs.post-pr.outputs.ref + uses: ./.github/workflows/release.yml + with: + ref: ${{ needs.post-pr.outputs.ref }} + + post-release: + needs: release-please + if: needs.release-please.outputs.release + runs-on: ubuntu-latest + steps: + - 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" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - run: npm i --ignore-scripts --no-audit --no-fund + - name: Post release actions + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npm run rp-release --ignore-scripts --if-present -ws -iwr diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84c40e7745106..4f1ea45e1f478 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,19 @@ name: Release - cli on: - workflow_dispatch: - pull_request: - schedule: - # 08:00am UTC everyday: https://crontab.guru/#0_8_*_*_* - # https://dateful.com/convert/utc?t=8am - - cron: "0 8 * * *" + workflow_call: + inputs: + ref: + required: true + type: string jobs: lint-all: - if: | - github.event_name == 'schedule' || - github.event_name == 'workflow_dispatch' || - startsWith(github.head_ref, 'release/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref }} - name: Use Node.js 16.x uses: actions/setup-node@v3 with: @@ -26,10 +23,6 @@ jobs: - run: node bin/npm-cli.js run lint-all --ignore-scripts smoke-publish: - if: | - github.event_name == 'schedule' || - github.event_name == 'workflow_dispatch' || - startsWith(github.head_ref, 'release/') strategy: fail-fast: false matrix: @@ -53,6 +46,8 @@ jobs: shell: ${{ matrix.platform.shell }} steps: - uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref }} - name: Setup git user run: | git config --global user.email "ops+npm-cli@npmjs.com" @@ -76,12 +71,8 @@ jobs: node bin/npm-cli.js install -w smoke-tests --ignore-scripts --no-audit --no-fund rm -rf {lib,bin,index.js} SMOKE_PUBLISH_NPM=1 npm test -w smoke-tests --ignore-scripts - + test-all: - if: | - github.event_name == 'schedule' || - github.event_name == 'workflow_dispatch' || - startsWith(github.head_ref, 'release/') strategy: fail-fast: false matrix: @@ -104,15 +95,17 @@ jobs: run: shell: ${{ matrix.platform.shell }} steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: npm - - run: node bin/npm-cli.js run resetdeps - - run: node bin/npm-cli.js link -f --ignore-scripts - - run: node bin/npm-cli.js run test-all --ignore-scripts - - name: git status - if: matrix.platform.os != 'windows-latest' - run: node scripts/git-dirty.js + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.ref }} + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - run: node bin/npm-cli.js run resetdeps + - run: node bin/npm-cli.js link -f --ignore-scripts + - run: node bin/npm-cli.js run test-all --ignore-scripts + - name: git status + if: matrix.platform.os != 'windows-latest' + run: node scripts/git-dirty.js diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5e7ceccce79d8..ddf5c9d9f9153 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,5 @@ { + ".": "8.18.0", "workspaces/arborist": "5.6.0", "workspaces/libnpmaccess": "6.0.3", "workspaces/libnpmdiff": "4.0.4", diff --git a/docs/package.json b/docs/package.json index eb36d5ffb743a..c7f02a7ae6fa9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -24,7 +24,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -60,6 +60,6 @@ "ciVersions": [ "16" ], - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/node_modules/.gitignore b/node_modules/.gitignore index bf2a67651159b..ce939861b6519 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -25,6 +25,8 @@ __pycache__ .nyc_output .gitkeep +/@actions/core +/@actions/http-client /@babel/code-frame /@babel/core /@babel/generator @@ -49,20 +51,77 @@ __pycache__ /@babel/traverse /@babel/types /@blueoak/list +/@commitlint/cli +/@commitlint/config-conventional +/@commitlint/config-validator +/@commitlint/ensure +/@commitlint/execute-rule +/@commitlint/format +/@commitlint/is-ignored +/@commitlint/lint +/@commitlint/load +/@commitlint/message +/@commitlint/parse +/@commitlint/read +/@commitlint/resolve-extends +/@commitlint/rules +/@commitlint/to-lines +/@commitlint/top-level +/@commitlint/types +/@conventional-commits/parser +/@cspotcode/source-map-support /@eslint/eslintrc +/@google-automations/git-file-utils /@humanwhocodes/config-array /@humanwhocodes/object-schema +/@iarna/toml /@istanbuljs/load-nyc-config /@istanbuljs/schema +/@jridgewell/resolve-uri +/@jridgewell/sourcemap-codec +/@jridgewell/trace-mapping +/@lerna/child-process +/@lerna/collect-updates +/@lerna/describe-ref +/@lerna/package +/@lerna/package-graph +/@lerna/prerelease-id-from-version +/@lerna/query-graph +/@lerna/run-topologically +/@lerna/validation-error /@mdx-js/mdx /@mdx-js/util /@npmcli/eslint-config /@npmcli/template-oss +/@octokit/auth-token +/@octokit/core +/@octokit/endpoint +/@octokit/graphql +/@octokit/openapi-types +/@octokit/plugin-paginate-rest +/@octokit/plugin-request-log +/@octokit/plugin-rest-endpoint-methods +/@octokit/request +/@octokit/request-error +/@octokit/rest +/@octokit/types +/@tsconfig/node10 +/@tsconfig/node12 +/@tsconfig/node14 +/@tsconfig/node16 /@types/hast /@types/json5 /@types/mdast +/@types/minimist +/@types/node +/@types/normalize-package-data +/@types/npm-package-arg +/@types/parse-json /@types/parse5 /@types/unist +/@types/yargs +/@types/yargs-parser +/@xmldom/xmldom /abab /acorn /acorn-globals @@ -74,11 +133,14 @@ __pycache__ /arg /argparse /array-find-index +/array-ify /array-includes /array.prototype.flat +/arrify /asn1 /assert-plus /async-hook-domain +/async-retry /asynckit /aws-sign2 /aws4 @@ -87,10 +149,12 @@ __pycache__ /bail /base64-js /bcrypt-pbkdf +/before-after-hook /benchmark /bind-obj-methods /bindings /bl +/boolbase /braces /browser-process-hrtime /buffer @@ -101,6 +165,7 @@ __pycache__ /callsites /camelcase /camelcase-css +/camelcase-keys /caseless /ccount /character-entities @@ -110,20 +175,35 @@ __pycache__ /cliui /cmark-gfm /code-point-at +/code-suggester /collapse-white-space /combined-stream /comma-separated-tokens /commondir +/compare-func +/conventional-changelog-angular +/conventional-changelog-conventionalcommits +/conventional-changelog-writer +/conventional-commits-filter +/conventional-commits-parser /convert-source-map /core-util-is /correct-license-metadata +/cosmiconfig +/cosmiconfig-typescript-loader /coveralls +/create-require /cross-spawn +/css-select +/css-what /cssom /cssstyle +/dargs /dashdash /data-urls +/dateformat /decamelize +/decamelize-keys /decimal.js /decompress-response /deep-extend @@ -131,18 +211,29 @@ __pycache__ /default-require-extensions /define-properties /delayed-stream +/deprecation /detab +/detect-indent /detect-libc /docopt /docs /doctrine +/dom-serializer +/domelementtype /domexception +/domhandler +/domutils +/dot-prop +/duplexer /ecc-jsbn /end-of-stream +/entities +/error-ex /es-abstract /es-shim-unscopables /es-to-primitive /es6-error +/escalade /escape-string-regexp /escodegen /eslint @@ -161,13 +252,16 @@ __pycache__ /esrecurse /estraverse /esutils +/eventemitter3 /events-to-array +/execa /expand-template /extend /extsprintf /fast-deep-equal /fast-json-stable-stringify /fast-levenshtein +/figures /file-entry-cache /file-uri-to-path /fill-range @@ -185,6 +279,7 @@ __pycache__ /fs-access /fs-constants /fs-exists-cached +/fs-extra /fsevents /function-loop /function.prototype.name @@ -194,14 +289,18 @@ __pycache__ /get-caller-file /get-intrinsic /get-package-type +/get-stream /get-symbol-description /getpass +/git-raw-commits /github-from-package /glob-parent +/global-dirs /globals /handlebars /har-schema /har-validator +/hard-rejection /has-bigints /has-property-descriptors /has-symbols @@ -213,10 +312,12 @@ __pycache__ /hast-util-raw /hast-util-to-parse5 /hastscript +/he /html-encoding-sniffer /html-escaper /html-void-elements /http-signature +/human-signals /ieee754 /ignore /import-fresh @@ -224,6 +325,7 @@ __pycache__ /internal-slot /is-alphabetical /is-alphanumerical +/is-arrayish /is-bigint /is-binary-path /is-boolean-object @@ -237,13 +339,16 @@ __pycache__ /is-negative-zero /is-number /is-number-object +/is-obj /is-plain-obj +/is-plain-object /is-potential-custom-element-name /is-regex /is-shared-array-buffer /is-stream /is-string /is-symbol +/is-text-path /is-typedarray /is-weakref /is-whitespace-character @@ -270,20 +375,28 @@ __pycache__ /json-stable-stringify-without-jsonify /json-stringify-safe /json5 +/jsonfile +/jsonpath +/JSONStream /jsprim +/kind-of /lcov-parse /levn /libtap /licensee +/lines-and-columns +/load-json-file /locate-path /lodash /lodash.clonedeep /lodash.flattendeep +/lodash.ismatch /lodash.merge /lodash.uniq /log-driver /make-dir /make-error +/map-obj /markdown-escapes /marked /marked-man @@ -291,22 +404,32 @@ __pycache__ /mdast-util-definitions /mdast-util-to-hast /mdurl +/meow +/merge-stream /mime-db /mime-types +/mimic-fn /mimic-response +/min-indent /minify-registry-metadata /minimist +/minimist-options /mkdirp-classic +/modify-values /napi-build-utils /natural-compare /neo-async /nock /node-abi /node-addon-api +/node-fetch +/node-html-parser /node-modules-regexp /node-preload /normalize-path /npm-license-corrections +/npm-run-path +/nth-check /null-check /number-is-nan /nwsapi @@ -318,21 +441,30 @@ __pycache__ /object.assign /object.getownpropertydescriptors /object.values +/onetime /optionator /own-or /own-or-env +/p-finally /p-limit /p-locate +/p-queue +/p-timeout /p-try /package-hash /parent-module +/parse-diff /parse-entities +/parse-github-repo-url +/parse-json /parse5 /path-exists /path-key /path-parse +/path-type /performance-now /picomatch +/pify /pirates /platform /prebuild-install @@ -344,13 +476,19 @@ __pycache__ /psl /pump /punycode +/q /qs /queue-microtask +/quick-lru /rc /read-package-tree +/read-pkg +/read-pkg-up /readdirp +/redent /regexp.prototype.flags /regexpp +/release-please /release-zalgo /remark-footnotes /remark-mdx @@ -359,10 +497,12 @@ __pycache__ /repeat-string /request /require-directory +/require-from-string /require-inject /require-main-filename /resolve /resolve-from +/resolve-global /run-parallel /saxes /shebang-command @@ -370,7 +510,9 @@ __pycache__ /side-channel /simple-concat /simple-get +/slash /smoke-tests +/sort-keys /source-map /source-map-support /space-separated-tokens @@ -381,14 +523,20 @@ __pycache__ /spdx-osi /spdx-ranges /spdx-whitelisted +/split +/split2 /sprintf-js /sshpk /stack-utils /state-toggle +/static-eval /string.prototype.trimend /string.prototype.trimstart /strip-bom +/strip-final-newline +/strip-indent /strip-json-comments +/strong-log-transformer /style-to-object /supports-preserve-symlinks-flag /symbol-tree @@ -400,16 +548,21 @@ __pycache__ /tar-stream /tcompare /test-exclude +/text-extensions +/through +/through2 /to-fast-properties /to-regex-range /tough-cookie /tr46 /trim +/trim-newlines /trim-trailing-lines /trivial-deferred /trough /ts-node /tsconfig-paths +/tunnel /tunnel-agent /tweetnacl /type-check @@ -417,6 +570,7 @@ __pycache__ /typescript /uglify-js /unbox-primitive +/underscore /unherit /unicode-length /unified @@ -429,11 +583,13 @@ __pycache__ /unist-util-stringify-position /unist-util-visit /unist-util-visit-parents +/universal-user-agent /universalify /uri-js /util-promisify /uuid /v8-compile-cache +/v8-compile-cache-lib /verror /vfile /vfile-location @@ -451,13 +607,17 @@ __pycache__ /word-wrap /wordwrap /wrap-ansi +/write-json-file +/write-pkg /ws /xml-name-validator /xmlchars +/xpath /xtend /y18n /yaml /yargs /yargs-parser /yn +/yocto-queue /zwitch diff --git a/package-lock.json b/package-lock.json index 600981fc334af..794ce8f151fcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -169,7 +169,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -189,7 +189,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -201,6 +201,34 @@ "node": ">=16.0.0" } }, + "node_modules/@actions/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", + "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", + "dev": true, + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/core/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@actions/http-client": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "dev": true, + "dependencies": { + "tunnel": "^0.0.6" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.7", "dev": true, @@ -583,6 +611,423 @@ "node": ">=0.1.90" } }, + "node_modules/@commitlint/cli": { + "version": "17.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.1.2.tgz", + "integrity": "sha512-h/4Hlka3bvCLbnxf0Er2ri5A44VMlbMSkdTRp8Adv2tRiklSTRIoPGs7OEXDv3EoDs2AAzILiPookgM4Gi7LOw==", + "dev": true, + "dependencies": { + "@commitlint/format": "^17.0.0", + "@commitlint/lint": "^17.1.0", + "@commitlint/load": "^17.1.2", + "@commitlint/read": "^17.1.0", + "@commitlint/types": "^17.0.0", + "execa": "^5.0.0", + "lodash": "^4.17.19", + "resolve-from": "5.0.0", + "resolve-global": "1.0.0", + "yargs": "^17.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/cli/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/cli/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@commitlint/cli/node_modules/yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@commitlint/cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@commitlint/config-conventional": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.1.0.tgz", + "integrity": "sha512-WU2p0c9/jLi8k2q2YrDV96Y8XVswQOceIQ/wyJvQxawJSCasLdRB3kUIYdNjOCJsxkpoUlV/b90ZPxp1MYZDiA==", + "dev": true, + "dependencies": { + "conventional-changelog-conventionalcommits": "^5.0.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/config-validator": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.1.0.tgz", + "integrity": "sha512-Q1rRRSU09ngrTgeTXHq6ePJs2KrI+axPTgkNYDWSJIuS1Op4w3J30vUfSXjwn5YEJHklK3fSqWNHmBhmTR7Vdg==", + "dev": true, + "dependencies": { + "@commitlint/types": "^17.0.0", + "ajv": "^8.11.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/config-validator/node_modules/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@commitlint/config-validator/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/@commitlint/ensure": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-17.0.0.tgz", + "integrity": "sha512-M2hkJnNXvEni59S0QPOnqCKIK52G1XyXBGw51mvh7OXDudCmZ9tZiIPpU882p475Mhx48Ien1MbWjCP1zlyC0A==", + "dev": true, + "dependencies": { + "@commitlint/types": "^17.0.0", + "lodash": "^4.17.19" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/execute-rule": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-17.0.0.tgz", + "integrity": "sha512-nVjL/w/zuqjCqSJm8UfpNaw66V9WzuJtQvEnCrK4jDw6qKTmZB+1JQ8m6BQVZbNBcwfYdDNKnhIhqI0Rk7lgpQ==", + "dev": true, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/format": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-17.0.0.tgz", + "integrity": "sha512-MZzJv7rBp/r6ZQJDEodoZvdRM0vXu1PfQvMTNWFb8jFraxnISMTnPBWMMjr2G/puoMashwaNM//fl7j8gGV5lA==", + "dev": true, + "dependencies": { + "@commitlint/types": "^17.0.0", + "chalk": "^4.1.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/is-ignored": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.1.0.tgz", + "integrity": "sha512-JITWKDMHhIh8IpdIbcbuH9rEQJty1ZWelgjleTFrVRAcEwN/sPzk1aVUXRIZNXMJWbZj8vtXRJnFihrml8uECQ==", + "dev": true, + "dependencies": { + "@commitlint/types": "^17.0.0", + "semver": "7.3.7" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/lint": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.1.0.tgz", + "integrity": "sha512-ltpqM2ogt/+SDhUaScFo0MdscncEF96lvQTPMM/VTTWlw7sTGLLWkOOppsee2MN/uLNNWjQ7kqkd4h6JqoM9AQ==", + "dev": true, + "dependencies": { + "@commitlint/is-ignored": "^17.1.0", + "@commitlint/parse": "^17.0.0", + "@commitlint/rules": "^17.0.0", + "@commitlint/types": "^17.0.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/load": { + "version": "17.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.1.2.tgz", + "integrity": "sha512-sk2p/jFYAWLChIfOIp/MGSIn/WzZ0vkc3afw+l4X8hGEYkvDe4gQUUAVxjl/6xMRn0HgnSLMZ04xXh5pkTsmgg==", + "dev": true, + "dependencies": { + "@commitlint/config-validator": "^17.1.0", + "@commitlint/execute-rule": "^17.0.0", + "@commitlint/resolve-extends": "^17.1.0", + "@commitlint/types": "^17.0.0", + "@types/node": "^14.0.0", + "chalk": "^4.1.0", + "cosmiconfig": "^7.0.0", + "cosmiconfig-typescript-loader": "^4.0.0", + "lodash": "^4.17.19", + "resolve-from": "^5.0.0", + "ts-node": "^10.8.1", + "typescript": "^4.6.4" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/load/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/message": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.0.0.tgz", + "integrity": "sha512-LpcwYtN+lBlfZijHUdVr8aNFTVpHjuHI52BnfoV01TF7iSLnia0jttzpLkrLmI8HNQz6Vhr9UrxDWtKZiMGsBw==", + "dev": true, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/parse": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.0.0.tgz", + "integrity": "sha512-cKcpfTIQYDG1ywTIr5AG0RAiLBr1gudqEsmAGCTtj8ffDChbBRxm6xXs2nv7GvmJN7msOt7vOKleLvcMmRa1+A==", + "dev": true, + "dependencies": { + "@commitlint/types": "^17.0.0", + "conventional-changelog-angular": "^5.0.11", + "conventional-commits-parser": "^3.2.2" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/read": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.1.0.tgz", + "integrity": "sha512-73BoFNBA/3Ozo2JQvGsE0J8SdrJAWGfZQRSHqvKaqgmY042Su4gXQLqvAzgr55S9DI1l9TiU/5WDuh8IE86d/g==", + "dev": true, + "dependencies": { + "@commitlint/top-level": "^17.0.0", + "@commitlint/types": "^17.0.0", + "fs-extra": "^10.0.0", + "git-raw-commits": "^2.0.0", + "minimist": "^1.2.6" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/resolve-extends": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-17.1.0.tgz", + "integrity": "sha512-jqKm00LJ59T0O8O4bH4oMa4XyJVEOK4GzH8Qye9XKji+Q1FxhZznxMV/bDLyYkzbTodBt9sL0WLql8wMtRTbqQ==", + "dev": true, + "dependencies": { + "@commitlint/config-validator": "^17.1.0", + "@commitlint/types": "^17.0.0", + "import-fresh": "^3.0.0", + "lodash": "^4.17.19", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/resolve-extends/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/rules": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.0.0.tgz", + "integrity": "sha512-45nIy3dERKXWpnwX9HeBzK5SepHwlDxdGBfmedXhL30fmFCkJOdxHyOJsh0+B0RaVsLGT01NELpfzJUmtpDwdQ==", + "dev": true, + "dependencies": { + "@commitlint/ensure": "^17.0.0", + "@commitlint/message": "^17.0.0", + "@commitlint/to-lines": "^17.0.0", + "@commitlint/types": "^17.0.0", + "execa": "^5.0.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/to-lines": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-17.0.0.tgz", + "integrity": "sha512-nEi4YEz04Rf2upFbpnEorG8iymyH7o9jYIVFBG1QdzebbIFET3ir+8kQvCZuBE5pKCtViE4XBUsRZz139uFrRQ==", + "dev": true, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/top-level": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-17.0.0.tgz", + "integrity": "sha512-dZrEP1PBJvodNWYPOYiLWf6XZergdksKQaT6i1KSROLdjf5Ai0brLOv5/P+CPxBeoj3vBxK4Ax8H1Pg9t7sHIQ==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/top-level/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@commitlint/top-level/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/types": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.0.0.tgz", + "integrity": "sha512-hBAw6U+SkAT5h47zDMeOu3HSiD0SODw4Aq7rRNh1ceUmL7GyLKYhPbUvlRWqZ65XjBLPHZhFyQlRaPNz8qvUyQ==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@conventional-commits/parser": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@conventional-commits/parser/-/parser-0.4.1.tgz", + "integrity": "sha512-H2ZmUVt6q+KBccXfMBhbBF14NlANeqHTXL4qCL6QGbMzrc4HDXyzWuxPxPNbz71f/5UkR5DrycP5VO9u7crahg==", + "dev": true, + "dependencies": { + "unist-util-visit": "^2.0.3", + "unist-util-visit-parents": "^3.1.1" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -682,29 +1127,86 @@ "inBundle": true, "license": "MIT" }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", + "node_modules/@google-automations/git-file-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@google-automations/git-file-utils/-/git-file-utils-1.1.0.tgz", + "integrity": "sha512-MfrDlDLWbisVRdVCqn3Vy5uaJWZCB3v1zyWwTIYXWmHp1WSDUX4vP+T8d/mULvegDOnp/hLFOeOJC1jQObd2xw==", "dev": true, - "license": "Apache-2.0", - "peer": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@octokit/rest": "19.0.3" }, "engines": { - "node": ">=10.10.0" + "node": ">= 14" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@google-automations/git-file-utils/node_modules/@octokit/openapi-types": { + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.11.0.tgz", + "integrity": "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==", + "dev": true + }, + "node_modules/@google-automations/git-file-utils/node_modules/@octokit/plugin-paginate-rest": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.1.0.tgz", + "integrity": "sha512-+cfc40pMzWcLkoDcLb1KXqjX0jTGYXjKuQdFQDc6UAknISJHnZTiBqld6HDwRJvD4DsouDKrWXNbNV0lE/3AXA==", "dev": true, - "peer": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@octokit/types": "^6.41.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/@google-automations/git-file-utils/node_modules/@octokit/rest": { + "version": "19.0.3", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.3.tgz", + "integrity": "sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ==", + "dev": true, + "dependencies": { + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^3.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@google-automations/git-file-utils/node_modules/@octokit/types": { + "version": "6.41.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.41.0.tgz", + "integrity": "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^12.11.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { @@ -726,6 +1228,12 @@ "license": "BSD-3-Clause", "peer": true }, + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, "node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", "inBundle": true, @@ -794,36 +1302,795 @@ "node": ">=8" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { - "version": "2.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@lerna/child-process": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-4.0.0.tgz", + "integrity": "sha512-XtCnmCT9eyVsUUHx6y/CTBYdV9g2Cr/VxyseTWBgfIur92/YKClfEtJTbOh94jRT62hlKLqSvux/UhxXVh613Q==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "execa": "^5.0.0", + "strong-log-transformer": "^2.1.0" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/collect-updates": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-4.0.0.tgz", + "integrity": "sha512-bnNGpaj4zuxsEkyaCZLka9s7nMs58uZoxrRIPJ+nrmrZYp1V5rrd+7/NYTuunOhY2ug1sTBvTAxj3NZQ+JKnOw==", + "dev": true, + "dependencies": { + "@lerna/child-process": "4.0.0", + "@lerna/describe-ref": "4.0.0", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "slash": "^3.0.0" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/@lerna/collect-updates/node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/@lerna/collect-updates/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@lerna/collect-updates/node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@lerna/collect-updates/node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@lerna/collect-updates/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/@lerna/collect-updates/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/collect-updates/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/describe-ref": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-4.0.0.tgz", + "integrity": "sha512-eTU5+xC4C5Gcgz+Ey4Qiw9nV2B4JJbMulsYJMW8QjGcGh8zudib7Sduj6urgZXUYNyhYpRs+teci9M2J8u+UvQ==", + "dev": true, + "dependencies": { + "@lerna/child-process": "4.0.0", + "npmlog": "^4.1.2" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/@lerna/describe-ref/node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/@lerna/describe-ref/node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@lerna/describe-ref/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/@lerna/describe-ref/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/describe-ref/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/package": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/package/-/package-4.0.0.tgz", + "integrity": "sha512-l0M/izok6FlyyitxiQKr+gZLVFnvxRQdNhzmQ6nRnN9dvBJWn+IxxpM+cLqGACatTnyo9LDzNTOj2Db3+s0s8Q==", + "dev": true, + "dependencies": { + "load-json-file": "^6.2.0", + "npm-package-arg": "^8.1.0", + "write-pkg": "^4.0.0" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/package-graph": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-4.0.0.tgz", + "integrity": "sha512-QED2ZCTkfXMKFoTGoccwUzjHtZMSf3UKX14A4/kYyBms9xfFsesCZ6SLI5YeySEgcul8iuIWfQFZqRw+Qrjraw==", + "dev": true, + "dependencies": { + "@lerna/prerelease-id-from-version": "4.0.0", + "@lerna/validation-error": "4.0.0", + "npm-package-arg": "^8.1.0", + "npmlog": "^4.1.2", + "semver": "^7.3.4" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/@lerna/package-graph/node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/@lerna/package-graph/node_modules/builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", + "dev": true + }, + "node_modules/@lerna/package-graph/node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package-graph/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package-graph/node_modules/npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package-graph/node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@lerna/package-graph/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/@lerna/package-graph/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "dev": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/package-graph/node_modules/validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "dev": true, + "dependencies": { + "builtins": "^1.0.3" + } + }, + "node_modules/@lerna/package/node_modules/builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", + "dev": true + }, + "node_modules/@lerna/package/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package/node_modules/npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@lerna/package/node_modules/validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "dev": true, + "dependencies": { + "builtins": "^1.0.3" + } + }, + "node_modules/@lerna/prerelease-id-from-version": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-4.0.0.tgz", + "integrity": "sha512-GQqguzETdsYRxOSmdFZ6zDBXDErIETWOqomLERRY54f4p+tk4aJjoVdd9xKwehC9TBfIFvlRbL1V9uQGHh1opg==", + "dev": true, + "dependencies": { + "semver": "^7.3.4" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/query-graph": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-4.0.0.tgz", + "integrity": "sha512-YlP6yI3tM4WbBmL9GCmNDoeQyzcyg1e4W96y/PKMZa5GbyUvkS2+Jc2kwPD+5KcXou3wQZxSPzR3Te5OenaDdg==", + "dev": true, + "dependencies": { + "@lerna/package-graph": "4.0.0" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/run-topologically": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-4.0.0.tgz", + "integrity": "sha512-EVZw9hGwo+5yp+VL94+NXRYisqgAlj0jWKWtAIynDCpghRxCE5GMO3xrQLmQgqkpUl9ZxQFpICgYv5DW4DksQA==", + "dev": true, + "dependencies": { + "@lerna/query-graph": "4.0.0", + "p-queue": "^6.6.2" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/validation-error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-4.0.0.tgz", + "integrity": "sha512-1rBOM5/koiVWlRi3V6dB863E1YzJS8v41UtsHgMr6gB2ncJ2LsQtMKlJpi3voqcgh41H8UsPXR58RrrpPpufyw==", + "dev": true, + "dependencies": { + "npmlog": "^4.1.2" + }, + "engines": { + "node": ">= 10.18.0" + } + }, + "node_modules/@lerna/validation-error/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/validation-error/node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/@lerna/validation-error/node_modules/are-we-there-yet": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/@lerna/validation-error/node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/@lerna/validation-error/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@lerna/validation-error/node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/@lerna/validation-error/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@lerna/validation-error/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { - "version": "4.0.0", + "node_modules/@lerna/validation-error/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", + "node_modules/@lerna/validation-error/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "dev": true, - "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", + "node_modules/@lerna/validation-error/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, - "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, "node_modules/@mdx-js/mdx": { @@ -1095,12 +2362,15 @@ } }, "node_modules/@npmcli/template-oss": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.7.1.tgz", - "integrity": "sha512-fnaWKI6O27cnv8cE0xiuAk/EYxEy3hj2EDgAd3FfGyP2WsUPrWyrn8C4Z6xcU3C3delTlAhFI/t20D6yiDsevg==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.8.0.tgz", + "integrity": "sha512-jpvuS/ZrLTIsHm19Wh8PQx6tJSvhWyto/5Bb16StMUGjM8/eyL+nPQQ+/oREtqI2nTtXOMhIorRjtwATUP8IFg==", "dev": true, "hasInstallScript": true, "dependencies": { + "@actions/core": "^1.9.1", + "@commitlint/cli": "^17.1.1", + "@commitlint/config-conventional": "^17.1.0", "@npmcli/fs": "^2.0.1", "@npmcli/git": "^3.0.0", "@npmcli/map-workspaces": "^2.0.2", @@ -1114,12 +2384,14 @@ "lodash": "^4.17.21", "npm-package-arg": "^9.0.1", "proc-log": "^2.0.0", + "release-please": "npm:@npmcli/release-please@^14.2.4", "semver": "^7.3.5", "yaml": "2.0.0-11" }, "bin": { "template-oss-apply": "bin/apply.js", - "template-oss-check": "bin/check.js" + "template-oss-check": "bin/check.js", + "template-oss-release-please": "bin/release-please.js" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -1134,6 +2406,165 @@ "node": ">= 12" } }, + "node_modules/@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/core": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.5.tgz", + "integrity": "sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA==", + "dev": true, + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/endpoint": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.1.tgz", + "integrity": "sha512-/wTXAJwt0HzJ2IeE4kQXO+mBScfzyCkI0hMtkIaqyXd9zg76OpOfNQfHL9FlaxAV2RsNiOXZibVWloy8EexENg==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/graphql": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "dev": true, + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^7.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.6.0.tgz", + "integrity": "sha512-bxftLwoZ2J6zsU1rzRvk0O32j7lVB0NWWn+P5CDHn9zPzytasR3hdAeXlTngRDkqv1LyEeuy5psVnDkmOSwrcQ==", + "dev": true + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.2.0.tgz", + "integrity": "sha512-8otLCIK9esfmOCY14CBnG/xPqv0paf14rc+s9tHpbOpeFwrv5CnECKW1qdqMAT60ngAa9eB1bKQ+l2YCpi0HPQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.2.0" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" + } + }, + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.4.0.tgz", + "integrity": "sha512-YP4eUqZ6vORy/eZOTdil1ZSrMt0kv7i/CVw+HhC2C0yJN+IqTc/rot957JQ7JfyeJD6HZOjLg6Jp1o9cPhI9KA==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.2.0", + "deprecation": "^2.3.1" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "dev": true, + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "dev": true, + "dependencies": { + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/rest": { + "version": "19.0.4", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", + "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", + "dev": true, + "dependencies": { + "@octokit/core": "^4.0.0", + "@octokit/plugin-paginate-rest": "^4.0.0", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.2.0.tgz", + "integrity": "sha512-pYQ/a1U6mHptwhGyp6SvsiM4bWP2s3V95olUeTxas85D/2kN78yN5C8cGN+P4LwJSWUqIEyvq0Qn2WUn6NQRjw==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^13.6.0" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "inBundle": true, @@ -1142,6 +2573,30 @@ "node": ">= 10" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, "node_modules/@types/hast": { "version": "2.3.4", "dev": true, @@ -1165,6 +2620,36 @@ "@types/unist": "*" } }, + "node_modules/@types/minimist": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.18.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz", + "integrity": "sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "dev": true + }, + "node_modules/@types/npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-452/1Kp9IdM/oR10AyqAgZOxUt7eLbm+EMJ194L6oarMYdZNiFIFAOJ7IIr0OrZXTySgfHjJezh2oiyk2kc3ag==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "node_modules/@types/parse5": { "version": "5.0.3", "dev": true, @@ -1175,6 +2660,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@xmldom/xmldom": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.2.tgz", + "integrity": "sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/abab": { "version": "2.0.5", "dev": true, @@ -1346,9 +2855,7 @@ "node_modules/arg": { "version": "4.1.3", "dev": true, - "license": "MIT", - "optional": true, - "peer": true + "license": "MIT" }, "node_modules/argparse": { "version": "1.0.10", @@ -1366,6 +2873,12 @@ "node": ">=0.10.0" } }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true + }, "node_modules/array-includes": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", @@ -1405,6 +2918,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/asap": { "version": "2.0.6", "inBundle": true, @@ -1439,6 +2961,24 @@ "node": ">=10" } }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "dev": true, + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/async-retry/node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "dev": true, @@ -1543,6 +3083,12 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "dev": true + }, "node_modules/benchmark": { "version": "2.1.4", "dev": true, @@ -1610,6 +3156,12 @@ "readable-stream": "^3.4.0" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1756,7 +3308,6 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "peer": true, "engines": { "node": ">=6" } @@ -1777,6 +3328,23 @@ "node": ">= 6" } }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/caseless": { "version": "0.12.0", "dev": true, @@ -1960,6 +3528,105 @@ "node": ">=0.10.0" } }, + "node_modules/code-suggester": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/code-suggester/-/code-suggester-4.1.0.tgz", + "integrity": "sha512-l3V0QvXL//d78Kxuanlb89r6AT6G3ZM+qmwvHw3NyP7SjKkt+6LZcgEC6yH5T8hwZGSfz/9dXSek0cMn9tMqpw==", + "dev": true, + "dependencies": { + "@octokit/rest": "^19.0.0", + "@types/yargs": "^16.0.0", + "async-retry": "^1.3.1", + "diff": "^5.0.0", + "glob": "^7.1.6", + "parse-diff": "^0.9.0", + "yargs": "^16.0.0" + }, + "bin": { + "code-suggester": "build/src/bin/code-suggester.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/code-suggester/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/code-suggester/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/code-suggester/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/code-suggester/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/code-suggester/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/code-suggester/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/collapse-white-space": { "version": "1.0.6", "dev": true, @@ -2034,6 +3701,16 @@ "dev": true, "license": "MIT" }, + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2045,6 +3722,98 @@ "inBundle": true, "license": "ISC" }, + "node_modules/conventional-changelog-angular": { + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", + "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0", + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-5.0.0.tgz", + "integrity": "sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-writer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", + "dev": true, + "dependencies": { + "conventional-commits-filter": "^2.0.7", + "dateformat": "^3.0.0", + "handlebars": "^4.7.7", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^4.0.0" + }, + "bin": { + "conventional-changelog-writer": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-changelog-writer/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/conventional-commits-filter": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", + "dev": true, + "dependencies": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/conventional-commits-parser": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", + "dev": true, + "dependencies": { + "is-text-path": "^1.0.1", + "JSONStream": "^1.0.4", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "conventional-commits-parser": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/convert-source-map": { "version": "1.8.0", "dev": true, @@ -2071,6 +3840,38 @@ "spdx-expression-validate": "^2.0.0" } }, + "node_modules/cosmiconfig": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cosmiconfig-typescript-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.0.0.tgz", + "integrity": "sha512-cVpucSc2Tf+VPwCCR7SZzmQTQkPbkk4O01yXsYqXBIbjE1bhwqSyAgYQkRK1un4i0OPziTleqFhdkmOc4RQ/9g==", + "dev": true, + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@types/node": "*", + "cosmiconfig": ">=7", + "ts-node": ">=10", + "typescript": ">=3" + } + }, "node_modules/coveralls": { "version": "3.1.1", "dev": true, @@ -2091,6 +3892,12 @@ "node": ">=6" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "dev": true, @@ -2104,6 +3911,34 @@ "node": ">= 8" } }, + "node_modules/css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -2136,6 +3971,15 @@ "dev": true, "license": "MIT" }, + "node_modules/dargs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/dashdash": { "version": "1.14.1", "dev": true, @@ -2162,6 +4006,15 @@ "node": ">=12" } }, + "node_modules/dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/debug": { "version": "4.3.4", "inBundle": true, @@ -2199,6 +4052,28 @@ "node": ">=0.10.0" } }, + "node_modules/decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/decimal.js": { "version": "10.3.1", "dev": true, @@ -2292,6 +4167,12 @@ "node": ">= 0.6" } }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, "node_modules/detab": { "version": "2.0.4", "dev": true, @@ -2304,6 +4185,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/detect-libc": { "version": "1.0.3", "dev": true, @@ -2356,6 +4246,32 @@ "node": ">=6.0.0" } }, + "node_modules/dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, "node_modules/domexception": { "version": "4.0.0", "dev": true, @@ -2367,6 +4283,53 @@ "node": ">=12" } }, + "node_modules/domhandler": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, + "dependencies": { + "domelementtype": "^2.2.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "dev": true, @@ -2400,6 +4363,15 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "inBundle": true, @@ -2413,6 +4385,15 @@ "inBundle": true, "license": "MIT" }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, "node_modules/es-abstract": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", @@ -2481,6 +4462,15 @@ "dev": true, "license": "MIT" }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "dev": true, @@ -3071,11 +5061,40 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, "node_modules/events-to-array": { "version": "1.1.2", "dev": true, "license": "ISC" }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/expand-template": { "version": "2.0.3", "dev": true, @@ -3102,8 +5121,7 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", @@ -3121,6 +5139,30 @@ "inBundle": true, "license": "MIT" }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "dev": true, @@ -3381,6 +5423,29 @@ "dev": true, "license": "ISC" }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -3509,6 +5574,18 @@ "node": ">=8.0.0" } }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.0.0", "dev": true, @@ -3534,6 +5611,25 @@ "assert-plus": "^1.0.0" } }, + "node_modules/git-raw-commits": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", + "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", + "dev": true, + "dependencies": { + "dargs": "^7.0.0", + "lodash": "^4.17.15", + "meow": "^8.0.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "git-raw-commits": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/github-from-package": { "version": "0.0.0", "dev": true, @@ -3569,6 +5665,24 @@ "node": ">= 6" } }, + "node_modules/global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", + "dev": true, + "dependencies": { + "ini": "^1.3.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/global-dirs/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/globals": { "version": "11.12.0", "dev": true, @@ -3637,6 +5751,15 @@ "node": ">=6" } }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/has": { "version": "1.0.3", "inBundle": true, @@ -3819,6 +5942,15 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/hosted-git-info": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-5.1.0.tgz", @@ -3903,6 +6035,15 @@ "node": ">= 6" } }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, "node_modules/humanize-ms": { "version": "1.2.1", "inBundle": true, @@ -3969,7 +6110,6 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4097,6 +6237,12 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -4290,6 +6436,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "2.1.0", "dev": true, @@ -4298,6 +6453,15 @@ "node": ">=8" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "dev": true, @@ -4369,6 +6533,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", + "dev": true, + "dependencies": { + "text-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-typedarray": { "version": "1.0.0", "dev": true, @@ -4697,6 +6873,27 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonfile/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "engines": [ @@ -4705,6 +6902,46 @@ "inBundle": true, "license": "MIT" }, + "node_modules/jsonpath": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", + "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", + "dev": true, + "dependencies": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.12.1" + } + }, + "node_modules/jsonpath/node_modules/esprima": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/jsprim": { "version": "1.4.2", "dev": true, @@ -4733,6 +6970,15 @@ "integrity": "sha512-AAV5Jw7tsniWwih8Ly3fXxEZ06y+6p5TwQMsw0dzZ/wPKilzyDgdAnL0Ug4NNIquPUOh1vfFWEHbmXUqM5+o8g==", "inBundle": true }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/lcov-parse": { "version": "1.0.0", "dev": true, @@ -4869,6 +7115,45 @@ "semver": "bin/semver.js" } }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/load-json-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz", + "integrity": "sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "parse-json": "^5.0.0", + "strip-bom": "^4.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/load-json-file/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -4898,6 +7183,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "dev": true, @@ -4953,9 +7244,7 @@ "node_modules/make-error": { "version": "1.3.6", "dev": true, - "license": "ISC", - "optional": true, - "peer": true + "license": "ISC" }, "node_modules/make-fetch-happen": { "version": "10.2.1", @@ -4984,6 +7273,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/markdown-escapes": { "version": "1.0.4", "dev": true, @@ -5064,6 +7365,97 @@ "dev": true, "license": "MIT" }, + "node_modules/meow": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", + "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/mime-db": { "version": "1.52.0", "dev": true, @@ -5083,6 +7475,15 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/mimic-response": { "version": "2.1.0", "dev": true, @@ -5094,6 +7495,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/minify-registry-metadata": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/minify-registry-metadata/-/minify-registry-metadata-2.2.0.tgz", @@ -5117,6 +7527,29 @@ "dev": true, "license": "MIT" }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/minipass": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", @@ -5241,6 +7674,15 @@ "node": ">=10" } }, + "node_modules/modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ms": { "version": "2.1.3", "inBundle": true, @@ -5312,6 +7754,48 @@ "dev": true, "license": "MIT" }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-gyp": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.1.0.tgz", @@ -5393,6 +7877,16 @@ "node": ">=6" } }, + "node_modules/node-html-parser": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/node-html-parser/-/node-html-parser-5.4.2.tgz", + "integrity": "sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==", + "dev": true, + "dependencies": { + "css-select": "^4.2.1", + "he": "1.2.0" + } + }, "node_modules/node-modules-regexp": { "version": "1.0.0", "dev": true, @@ -5603,6 +8097,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/npm-user-validate": { "version": "1.0.1", "inBundle": true, @@ -5623,6 +8129,18 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/null-check": { "version": "1.0.0", "dev": true, @@ -5902,6 +8420,21 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/opener": { "version": "1.5.2", "inBundle": true, @@ -5942,6 +8475,15 @@ "own-or": "^1.0.0" } }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -5983,6 +8525,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-queue": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", + "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", @@ -6047,7 +8617,6 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -6068,6 +8637,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/parse-diff": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/parse-diff/-/parse-diff-0.9.0.tgz", + "integrity": "sha512-Jn+VZORAezkfOXR6B40EZcXxdJBamtgBpfeoFH6hxD+p0e74nVaCL9SWlQj1ggc8b6AexgPKlDiiE0CMMZDSbQ==", + "dev": true + }, "node_modules/parse-entities": { "version": "2.0.0", "dev": true, @@ -6085,6 +8660,30 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha512-bSWyzBKqcSL4RrncTpGsEKoJ7H8a4L3++ifTAbTFeMHyq2wRV+42DGmQcHIrJIvdcacjIOxEuKH/w4tthF17gg==", + "dev": true + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parse5": { "version": "6.0.1", "dev": true, @@ -6121,6 +8720,15 @@ "dev": true, "license": "MIT" }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/performance-now": { "version": "2.1.0", "dev": true, @@ -6139,6 +8747,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pirates": { "version": "3.0.2", "dev": true, @@ -6420,6 +9037,16 @@ "node": ">=6" } }, + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "dev": true, + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, "node_modules/qrcode-terminal": { "version": "0.12.0", "inBundle": true, @@ -6456,6 +9083,15 @@ ], "license": "MIT" }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/rc": { "version": "1.2.8", "dev": true, @@ -6625,6 +9261,144 @@ "semver": "bin/semver" } }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "inBundle": true, @@ -6660,6 +9434,19 @@ "node": ">=8.10.0" } }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -6689,6 +9476,119 @@ "url": "https://github.com/sponsors/mysticatea" } }, + "node_modules/release-please": { + "name": "@npmcli/release-please", + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/@npmcli/release-please/-/release-please-14.2.4.tgz", + "integrity": "sha512-G09V96BVGDRZNz8GIIvtUiQ0ay2kJ7IbWqkE6+lxWZkEov1H3f+SxJp16F3LxUY5j2ILxOUBfn1oOElg5vo4Dg==", + "dev": true, + "dependencies": { + "@conventional-commits/parser": "^0.4.1", + "@google-automations/git-file-utils": "^1.1.0", + "@iarna/toml": "^2.2.5", + "@lerna/collect-updates": "^4.0.0", + "@lerna/package": "^4.0.0", + "@lerna/package-graph": "^4.0.0", + "@lerna/run-topologically": "^4.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/rest": "^19.0.0", + "@types/npm-package-arg": "^6.1.0", + "@xmldom/xmldom": "^0.8.2", + "chalk": "^4.0.0", + "code-suggester": "^4.1.0", + "conventional-changelog-conventionalcommits": "^5.0.0", + "conventional-changelog-writer": "^5.0.0", + "conventional-commits-filter": "^2.0.2", + "detect-indent": "^6.1.0", + "diff": "^5.0.0", + "figures": "^3.0.0", + "js-yaml": "^4.0.0", + "jsonpath": "^1.1.1", + "node-html-parser": "^5.0.0", + "parse-github-repo-url": "^1.4.1", + "semver": "^7.0.0", + "type-fest": "^2.0.0", + "typescript": "^4.6.4", + "unist-util-visit": "^2.0.3", + "unist-util-visit-parents": "^3.1.1", + "xpath": "^0.0.32", + "yargs": "^17.0.0" + }, + "bin": { + "release-please": "build/src/bin/release-please.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/release-please/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/release-please/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/release-please/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-please/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/release-please/node_modules/yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/release-please/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/release-zalgo": { "version": "1.0.0", "dev": true, @@ -6849,6 +9749,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-inject": { "version": "1.4.4", "dev": true, @@ -6883,11 +9792,22 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "peer": true, "engines": { "node": ">=4" } }, + "node_modules/resolve-global": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", + "dev": true, + "dependencies": { + "global-dirs": "^0.1.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/retry": { "version": "0.12.0", "inBundle": true, @@ -7109,6 +10029,15 @@ "simple-concat": "^1.0.0" } }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -7143,12 +10072,33 @@ "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", "inBundle": true, "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", + "dev": true, + "dependencies": { + "is-plain-obj": "^1.0.0" }, "engines": { - "node": ">= 10" + "node": ">=4" + } + }, + "node_modules/sort-keys/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/source-map": { @@ -7274,6 +10224,27 @@ "spdx-ranges": "^2.0.0" } }, + "node_modules/split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "dependencies": { + "readable-stream": "^3.0.0" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "dev": true, @@ -7347,6 +10318,107 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "dev": true, + "dependencies": { + "escodegen": "^1.8.1" + } + }, + "node_modules/static-eval/node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/static-eval/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/static-eval/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/static-eval/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-eval/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "inBundle": true, @@ -7417,6 +10489,27 @@ "node": ">=4" } }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -7430,6 +10523,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strong-log-transformer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", + "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", + "dev": true, + "dependencies": { + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" + }, + "bin": { + "sl-log-transformer": "bin/sl-log-transformer.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/style-to-object": { "version": "0.3.0", "dev": true, @@ -9625,11 +12735,35 @@ "node": "*" } }, + "node_modules/text-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/text-table": { "version": "0.2.0", "inBundle": true, "license": "MIT" }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "dependencies": { + "readable-stream": "3" + } + }, "node_modules/tiny-relative-date": { "version": "1.3.0", "inBundle": true, @@ -9691,6 +12825,15 @@ "version": "0.0.1", "dev": true }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/trim-trailing-lines": { "version": "1.1.4", "dev": true, @@ -9716,37 +12859,73 @@ } }, "node_modules/ts-node": { - "version": "8.10.2", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=6.0.0" - }, "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", + "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" } }, "node_modules/ts-node/node_modules/diff": { "version": "4.0.2", "dev": true, "license": "BSD-3-Clause", - "optional": true, - "peer": true, "engines": { "node": ">=0.3.1" } @@ -9777,6 +12956,15 @@ "json5": "lib/cli.js" } }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "dev": true, @@ -9816,11 +13004,10 @@ } }, "node_modules/typescript": { - "version": "3.9.10", + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", + "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", "dev": true, - "license": "Apache-2.0", - "optional": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9857,6 +13044,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", + "dev": true + }, "node_modules/unherit": { "version": "1.1.3", "dev": true, @@ -10038,6 +13231,12 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + }, "node_modules/universalify": { "version": "0.1.2", "dev": true, @@ -10050,7 +13249,6 @@ "version": "4.4.1", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -10082,6 +13280,12 @@ "license": "MIT", "peer": true }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "inBundle": true, @@ -10334,6 +13538,88 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/write-json-file": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", + "dev": true, + "dependencies": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-json-file/node_modules/detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/write-json-file/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/write-json-file/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/write-json-file/node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/write-pkg": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-4.0.0.tgz", + "integrity": "sha512-v2UQ+50TNf2rNHJ8NyWttfm/EJUBWMJcx6ZTYZr6Qp52uuegWw/lBkCtCbnYZEmPRNL61m+u67dAmGxo+HTULA==", + "dev": true, + "dependencies": { + "sort-keys": "^2.0.0", + "type-fest": "^0.4.1", + "write-json-file": "^3.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/write-pkg/node_modules/type-fest": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", + "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/ws": { "version": "8.5.0", "dev": true, @@ -10367,6 +13653,15 @@ "dev": true, "license": "MIT" }, + "node_modules/xpath": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.32.tgz", + "integrity": "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==", + "dev": true, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "dev": true, @@ -10517,12 +13812,22 @@ "version": "3.1.1", "dev": true, "license": "MIT", - "optional": true, - "peer": true, "engines": { "node": ">=6" } }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zwitch": { "version": "1.0.5", "dev": true, @@ -10538,7 +13843,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.1", @@ -10595,7 +13900,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -10618,7 +13923,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10641,7 +13946,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "tap": "^16.0.1" }, "engines": { @@ -10669,7 +13974,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -10687,7 +13992,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "tap": "^16.0.1" }, "engines": { @@ -10703,7 +14008,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10720,7 +14025,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -10739,7 +14044,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -10759,7 +14064,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -10777,7 +14082,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10794,7 +14099,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -10814,7 +14119,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "require-inject": "^1.4.4", "tap": "^16.0.1" }, diff --git a/package.json b/package.json index 658d2508799dd..6b2db7d8b1407 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -217,7 +217,7 @@ "scripts": { "dependencies": "node scripts/bundle-and-gitignore-deps.js && node scripts/dependency-graph.js", "dumpconf": "env | grep npm | sort | uniq", - "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"chore: update AUTHORS\" || true", + "authors": "bash scripts/update-authors.sh", "licenses": "licensee --production --errors-only", "test": "tap", "test-all": "npm run test --if-present --workspaces --include-workspace-root", @@ -231,7 +231,8 @@ "lintfix": "npm run lint -- --fix", "lint-all": "npm run lint --if-present --workspaces --include-workspace-root", "prelint": "rimraf test/npm_cache*", - "resetdeps": "bash scripts/resetdeps.sh" + "resetdeps": "bash scripts/resetdeps.sh", + "rp-pull-request": "npm run resetdeps && npm run authors" }, "tap": { "test-env": [ @@ -250,7 +251,8 @@ "templateOSS": { "rootRepo": false, "rootModule": false, - "version": "3.7.1" + "version": "3.8.0", + "releaseTest": "release.yml" }, "license": "Artistic-2.0", "engines": { diff --git a/release-please-config.json b/release-please-config.json index 12995e545b8af..8f82980337956 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,9 @@ { - "separate-pull-requests": true, + "bootstrap-sha": "141faf0c19eae382d0e19833129f5545fc2355c8", + "plugins": [ + "node-workspace", + "workspace-deps" + ], "changelog-sections": [ { "type": "feat", @@ -27,6 +31,9 @@ } ], "packages": { + ".": { + "package-name": "" + }, "workspaces/arborist": {}, "workspaces/libnpmaccess": {}, "workspaces/libnpmdiff": {}, @@ -39,5 +46,8 @@ "workspaces/libnpmsearch": {}, "workspaces/libnpmteam": {}, "workspaces/libnpmversion": {} - } + }, + "exclude-packages-from-root": true, + "group-pull-request-title-pattern": "chore: release ${version}", + "pull-request-title-pattern": "chore: release${component} ${version}" } diff --git a/scripts/changelog.js b/scripts/changelog.js deleted file mode 100644 index c32e094ff612a..0000000000000 --- a/scripts/changelog.js +++ /dev/null @@ -1,434 +0,0 @@ -/* eslint no-shadow:2 */ -'use strict' - -const { execSync } = require('child_process') -const semver = require('semver') -const fs = require('fs') -const config = require('@npmcli/template-oss') -const { resolve, relative } = require('path') - -const exec = (...args) => execSync(...args).toString().trim() -const today = () => { - const d = new Date() - const pad = s => s.toString().padStart(2, '0') - return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}` -} - -const usage = () => ` - node ${relative(process.cwd(), __filename)} [--read|-r] [--write|-w] [tag] - - Generates changelog entries in our format starting from the most recent tag. - By default this script will print the release notes to stdout. - - [tag] (defaults to most recent tag) - A tag to generate release notes for. Helpful for testing this script against - old releases. Leave this empty to look for the most recent tag. - - [--write|-w] (default: false) - When set it will update the changelog with the new release. - If a release with the same version already exists it will replace it, otherwise - it will prepend it to the file directly after the top level changelog title. - - [--read|-r] (default: false) - When set it will read the release notes for the [tag] from the CHANGELOG.md, - instead of fetching it. This is useful after release notes have been manually - edited and need to be pasted somewhere else. -` - -// this script assumes that the tags it looks for all start with this prefix -const TAG_PREFIX = 'v' - -// a naive implementation of console.log/group for indenting console -// output but keeping it in a buffer to be output to a file or console -const logger = (init) => { - let indent = 0 - const step = 2 - const buffer = [init] - return { - toString () { - return buffer.join('\n').trim() - }, - group (s) { - this.log(s) - indent += step - }, - groupEnd () { - indent -= step - }, - log (s) { - if (!s) { - buffer.push('') - } else { - buffer.push(s.split('\n').map((l) => ' '.repeat(indent) + l).join('\n')) - } - }, - } -} - -// some helpers for generating common parts -// of our markdown release notes -const RELEASE = { - sep: '\n\n', - heading: '## ', - // versions in titles must be prefixed with a v - versionRe: semver.src[11].replace(TAG_PREFIX + '?', TAG_PREFIX), - get h1 () { - return '# Changelog' + this.sep - }, - version (s) { - return s.startsWith(TAG_PREFIX) ? s : TAG_PREFIX + s - }, - date (d) { - return `(${d})` - }, - title (v, d) { - return `${this.heading}${this.version(v)} ${this.date(d)}` - }, -} - -// a map of all our changelog types that go into the release notes to be -// looked up by commit type and return the section title -const CHANGELOG = new Map( - config.changelogTypes.filter(c => !c.hidden).map((c) => [c.type, c.section])) - -const assertArgs = (args) => { - if (args.help) { - console.log(usage()) - return process.exit(0) - } - - if (args.force) { - // just to make manual testing easier - return args - } - - // we dont need to be up to date to read from our local changelog - if (!args.read) { - exec(`git fetch ${args.remote}`) - const remoteBranch = `${args.remote}/${args.branch}` - const current = exec(`git rev-parse --abbrev-ref HEAD`) - - if (current !== args.branch) { - throw new Error(`Must be on branch "${args.branch}", rerun with --force to override`) - } - - const localLog = exec(`git log ${remoteBranch}..HEAD`).length > 0 - const remoteLog = exec(`git log HEAD..${remoteBranch}`).length > 0 - - if (current !== args.branch || localLog || remoteLog) { - throw new Error(`Must be in sync with "${remoteBranch}"`) - } - } - - return args -} - -const parseArgs = (argv) => { - const result = { - tag: null, - file: resolve(__dirname, '..', 'CHANGELOG.md'), - branch: 'latest', - remote: 'origin', - type: 'md', // or 'gh' - format: 'short', // or 'long' - write: false, - read: false, - help: false, - force: false, - } - - for (const arg of argv) { - if (arg.startsWith('--')) { - // dash to camel case. no value means boolean true - const [key, value = true] = arg.slice(2).split('=') - result[key.replace(/-([a-z])/g, (a) => a[1].toUpperCase())] = value - } else if (arg.startsWith('-')) { - // shorthands for read and write - const short = arg.slice(1) - const key = short === 'w' ? 'write' : short === 'r' ? 'read' : null - result[key] = true - } else { - // anything else without a -- or - is the tag - // force tag to start with a "v" - result.tag = arg.startsWith(TAG_PREFIX) ? arg : TAG_PREFIX + arg - } - } - - // previous tag to requested tag OR most recent tag and everything after - // only matches tags prefixed with "v" since only the cli is prefixed with v - const getTag = (t = '') => exec(['git', 'describe', '--tags', '--abbrev=0', - `--match="${TAG_PREFIX}*" ${t}`].join(' ')) - - return assertArgs({ - ...result, - // if a tag is passed in get the previous tag to make a range between the two - // this is mostly for testing to generate release notes from old releases - startTag: result.tag ? getTag(`${result.tag}~1`) : getTag(), - endTag: result.tag || '', - }) -} - -// find an entire section of a release from the changelog from a version -const findRelease = (args, version) => { - const changelog = fs.readFileSync(args.file, 'utf-8') - const escRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - - const titleSrc = (v) => [ - '^', - RELEASE.heading, - v ? escRegExp(v) : RELEASE.versionRe, - ' ', - escRegExp(RELEASE.date(today())).replace(/\d/g, '\\d'), - '$', - ].join('') - - const releaseSrc = [ - '(', - titleSrc(version && RELEASE.version(version)), - '[\\s\\S]*?', - RELEASE.sep, - ')', - titleSrc(), - ].join('') - - const [, release = ''] = changelog.match(new RegExp(releaseSrc, 'm')) || [] - return { - release: release.trim(), - changelog, - } -} - -const generateRelease = async (args) => { - const range = `${args.startTag}...${args.endTag}` - - const log = exec(`git log --reverse --pretty='format:%h' ${range}`) - .split('\n') - .filter(Boolean) - // prefix with underscore so its always a valid identifier - .map((sha) => `_${sha}: object (expression: "${sha}") { ...commitCredit }`) - - if (!log.length) { - throw new Error(`No commits found for "${range}"`) - } - - const query = ` - fragment commitCredit on GitObject { - ... on Commit { - message - url - abbreviatedOid - authors (first:10) { - nodes { - user { - login - url - } - email - name - } - } - associatedPullRequests (first:10) { - nodes { - number - url - merged - } - } - } - } - - query { - repository (owner:"npm", name:"cli") { - ${log} - } - } - ` - - const res = JSON.parse(exec(`gh api graphql -f query='${query}'`)) - - // collect commits by valid changelog type - const commits = [...CHANGELOG.values()].reduce((acc, c) => { - acc[c] = [] - return acc - }, {}) - - const allCommits = Object.values(res.data.repository) - - for (const commit of allCommits) { - // get changelog type of commit or bail if there is not a valid one - const [, type] = /(^\w+)[\s(:]?/.exec(commit.message) || [] - const changelogType = CHANGELOG.get(type) - if (!changelogType) { - continue - } - - const message = commit.message - .trim() // remove leading/trailing spaces - .replace(/(\r?\n)+/gm, '\n') // replace multiple newlines with one - .replace(/([^\s]+@\d+\.\d+\.\d+.*)/gm, '`$1`') // wrap package@version in backticks - - // the title is the first line of the commit, 'let' because we change it later - let [title, ...body] = message.split('\n') - - const prs = commit.associatedPullRequests.nodes.filter((pull) => pull.merged) - - // external squashed PRs dont get the associated pr node set - // so we try to grab it from the end of the commit title - // since thats where it goes by default - const [, titleNumber] = title.match(/\s+\(#(\d+)\)$/) || [] - if (titleNumber && !prs.find((pr) => pr.number === +titleNumber)) { - try { - // it could also reference an issue so we do one extra check - // to make sure it is really a pr that has been merged - const realPr = JSON.parse(exec(`gh pr view ${titleNumber} --json url,number,state`, { - stdio: 'pipe', - })) - if (realPr.state === 'MERGED') { - prs.push(realPr) - } - } catch { - // maybe an issue or something else went wrong - // not super important so keep going - } - } - - for (const pr of prs) { - title = title.replace(new RegExp(`\\s*\\(#${pr.number}\\)`, 'g'), '') - } - - body = body - .map((line) => line.trim()) // remove artificial line breaks - .filter(Boolean) // remove blank lines - .join('\n') // rejoin on new lines - .split(/^[*-]/gm) // split on lines starting with bullets - .map((line) => line.trim()) // remove spaces around bullets - .filter((line) => !title.includes(line)) // rm lines that exist in the title - // replace new lines for this bullet with spaces and re-bullet it - .map((line) => `* ${line.trim().replace(/\n/gm, ' ')}`) - .join('\n') // re-join with new lines - - commits[changelogType].push({ - hash: commit.abbreviatedOid, - url: commit.url, - title, - type: changelogType, - body, - prs, - credit: commit.authors.nodes.map((author) => { - if (author.user && author.user.login) { - return { - name: `@${author.user.login}`, - url: author.user.url, - } - } - // if the commit used an email that's not associated with a github account - // then the user field will be empty, so we fall back to using the committer's - // name and email as specified by git - return { - name: author.name, - url: `mailto:${author.email}`, - } - }), - }) - } - - if (!Object.values(commits).flat().length) { - const messages = allCommits.map((c) => c.message.trim().split('\n')[0]) - throw new Error(`No changelog commits found for "${range}":\n${messages.join('\n')}`) - } - - // this doesnt work with majors but we dont do those very often - const semverBump = commits.Features.length ? 'minor' : 'patch' - const version = TAG_PREFIX + semver.parse(args.startTag).inc(semverBump).version - const date = args.endTag ? exec(`git log -1 --date=short --format=%ad ${args.endTag}`) : today() - - const output = logger(RELEASE.title(version, date) + '\n') - - for (const key of Object.keys(commits)) { - if (commits[key].length > 0) { - output.group(`### ${key}\n`) - - for (const commit of commits[key]) { - let groupCommit = `* [\`${commit.hash}\`](${commit.url})` - for (const pr of commit.prs) { - groupCommit += ` [#${pr.number}](${pr.url})` - } - groupCommit += ` ${commit.title}` - if (key !== 'Dependencies') { - for (const user of commit.credit) { - if (args.type === 'gh') { - groupCommit += ` (${user.name})` - } else { - groupCommit += ` ([${user.name}](${user.url}))` - } - } - } - - output.group(groupCommit) - // only optionally add full commit bodies to changelog - if (commit.body && commit.body.length && args.format === 'long') { - output.log(commit.body) - } - output.groupEnd() - } - - output.log() - output.groupEnd() - } - } - - return { - date, - version, - release: output.toString(), - } -} - -const main = async (argv) => { - const args = parseArgs(argv) - - if (args.read) { - // this reads the release notes for that version - let { release } = findRelease(args, args.tag) - if (args.type === 'gh') { - // changelog was written in markdown so convert user links to gh release style - // XXX: this needs to be changed if the `generateRelease` format changes - release = release.replace(/\(\[(@[a-z\d-]+)\]\(https:\/\/github.com\/[a-z\d-]+\)\)/gi, '($1)') - } - return console.log(release) - } - - // otherwise fetch the requested release from github - const { release, version, date } = await generateRelease(args) - - if (args.write) { - // only try and run release manager issue update on write since that signals - // the first time we know the version of the release - try { - exec( - `node scripts/release-manager.js --update --version=${version.slice(1)} --date=${date}`, { - stdio: 'pipe', - }) - } catch (e) { - console.error(`Updating release manager issue failed: ${e.stderr}`) - } - - const { release: existing, changelog } = findRelease(args, version) - fs.writeFileSync( - args.file, - existing - // replace existing release with the newly generated one - ? changelog.replace(existing, release) - // otherwise prepend a new release at the start of the changelog - : changelog.replace(RELEASE.h1, RELEASE.h1 + release + RELEASE.sep), - 'utf-8' - ) - return console.log( - `Release notes for ${version} written to "./${relative(process.cwd(), args.file)}".` - ) - } - - console.log(release) -} - -main(process.argv.slice(2)) diff --git a/scripts/dependency-graph.js b/scripts/dependency-graph.js index 1f18307582fd0..6d84b88ee735c 100644 --- a/scripts/dependency-graph.js +++ b/scripts/dependency-graph.js @@ -7,7 +7,7 @@ const fs = require('fs') // To re-create npm-cli-repos.txt run: /* eslint-disable-next-line max-len */ -// gh api "/graphql" -F query='query { search (query: "org:npm topic:npm-cli", type: REPOSITORY, first:100) { nodes { ... on Repository { name } } } }' --jq '.data.search.nodes[].name'|sort +// npx --package=@npmcli/stafftools@latest gh repos --json | json -a name | sort > scripts/npm-cli-repos.txt const repos = fs.readFileSync('./scripts/npm-cli-repos.txt', 'utf8').trim().split('\n') // these have a different package name than the repo name, and are ours. diff --git a/scripts/npm-cli-repos.txt b/scripts/npm-cli-repos.txt index bbbf2e31c4923..83b6a8b5ebae5 100644 --- a/scripts/npm-cli-repos.txt +++ b/scripts/npm-cli-repos.txt @@ -1,4 +1,5 @@ abbrev-js +agent arborist are-we-there-yet benchmarks @@ -60,6 +61,7 @@ npm-package-arg npm-packlist npm-profile npm-registry-fetch +npm-registry-mock npm-user-validate npmlog package-json @@ -69,6 +71,8 @@ proc-log proggy promise-spawn promzard +pull +query read read-cmd-shim read-package-json @@ -77,8 +81,10 @@ readdir-scoped-modules rfcs run-script ssri +stafftools statusboard stringify-package +tap-nock template-oss treeverse unique-filename diff --git a/scripts/release-manager.js b/scripts/release-manager.js deleted file mode 100644 index 8313692adfdc4..0000000000000 --- a/scripts/release-manager.js +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env node - -const { basename, relative } = require('path') -const cp = require('child_process') - -const usage = () => ` - node ${relative(process.cwd(), __filename)} [flags] - - Copies the release process checklist to a GitHub issue, optionally updating the - version and date of the instructions. - - Flags: [--create] [--update[=]] [--date=] [--version=X.Y.Z] - - [--create] (default: true) - By default this will create a new issue in the repo. - - [--update[=]] - Update a specific issue number, or if set without a value it will update the most - recent issue created with the default tag. - - [--tag=] (default: "release-manager") - Issues will be created and looked up with this tag. - - [--version=X.Y.Z] - This script can be run before the next version number is known and then rerun - with this flag to update the checklist with the correct version number. - - [--date=] (default: ${date()}) - Set the date of the release in the release process checklist. -` - -const spawnSync = (cmd, args, options) => { - const res = cp.spawnSync(cmd, args, { ...options, encoding: 'utf-8' }) - if (res.status !== 0) { - throw new Error(res.stderr) - } - return res.stdout.trim() -} - -const get = url => - new Promise((resolve, reject) => { - require('https') - .get(url, resp => { - let d = '' - resp.on('data', c => (d += c)) - resp.on('end', () => resolve(d)) - }) - .on('error', reject) - }) - -const date = () => { - const d = new Date() - const pad = s => s.toString().padStart(2, '0') - return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}` -} - -const replaceAll = (str, rep) => - Object.entries(rep).reduce( - (a, [k, v]) => a.replace(new RegExp(k, 'g'), v), - str - ) - -const ghIssue = args => { - const label = ['-l', args.label] - const assignee = ['-a', args.assignee] - const title = ['-t', args.title] - const json = ['--json', 'body,title,number'] - const body = ['--body-file', '-'] - - const issue = (cmd, a, options) => - spawnSync('gh', ['issue', cmd, '-R', args.repo, ...a.flat()], options) - - const listIssues = () => { - const issues = JSON.parse(issue('list', [label, json])) - const ids = issues.map(i => '#' + i.number) - const msg = `Found existing label:${args.label} issues: ${ids.join(', ')}.` - return { issues, msg } - } - - switch (args.command) { - case 'list': { - // get the first matching issue - const { issues, msg } = listIssues() - if (issues.length > 1) { - throw new Error(`${msg} Rerun with --update= to target a specific issue.`) - } - return issues[0] - } - case 'view': - // get an issue by id - return JSON.parse(issue('view', [args.number, json])) - case 'create': { - const { issues, msg } = listIssues() - if (issues.length) { - throw new Error(`${msg} Close before creating a new one.`) - } - // create an issue - return issue('create', [assignee, label, title, body], { input: args.body }) - } - case 'edit': - // edit title and body of an issue - return issue('edit', [args.number, title, body], { input: args.body }) - default: - throw new Error(`Unknown command: ${JSON.stringify(args.command)}`) - } -} - -const getSection = (content, args) => { - const [, heading, section] = args.section.match(/^(#+)\s(.*)/) - - // remove the title since we are making a new one - const [title, ...lines] = content - .split(`${heading} `) - .find(s => s.split('\n')[0].match(new RegExp(section, 'i'))) - .trim() - .split('\n') - - // first task is to run this script, so thats done - const body = lines.join('\n').replace('- [ ] **0', '- [x] **0') - const created = `${basename(args.release)}${heading}${title}` - - return { - title: `Release Manager: v${args.version} (${args.date})`, - body: [ - `**Target Version**: v${args.version}`, - `**Target Date**: ${args.date}`, - // github markdown: 2x backticks + space will escape backticks within title - `**Created From:** [\`\` ${created} \`\`](${args.release})`, - body, - ] - .join('\n') - .trim(), - } -} - -const main = async args => { - const replace = s => replaceAll(s, args.replacements) - - const { body, title, number } = args.create - // get a section of the release process wiki doc - ? getSection(await get(args.release), args) - // get the contents of an existing gh issue by id - // or it will default to the most recent one by label - // this is so it will preserve state of checked todo items - : await ghIssue({ - ...args, - command: typeof args.update === 'string' ? 'view' : 'list', - number: args.update, - }) - - return ghIssue({ - ...args, - command: number ? 'edit' : 'create', - number, - body: replace(body), - title: replace(title), - }) -} - -const parseArgs = raw => { - const result = { - create: false, - update: null, - repo: 'npm/cli', - label: 'release: manager', - assignee: '@me', - date: date(), - version: 'X.Y.Z', - // look for that heading level with a match for the portion after - section: '### .*cli.*', - release: - 'https://raw.githubusercontent.com/wiki/npm/cli/Release-Process-(v8).md', - } - - const replacements = {} - - const clean = { - // this script will not work correctly with the tag style - // of the version (prefixed with a v) so strip it out - version: v => v.replace(/^v/g, ''), - } - - const shorts = { - R: 'repo', - l: 'label', - a: 'assignee', - d: 'date', - v: 'version', - c: 'create', - u: 'update', - } - - const camel = k => k.replace(/-([a-z])/g, a => a[1].toUpperCase()) - - // parse argv into array of [k,v] pairs - // works with --x=1 --x 1 --x -x - const argv = raw - .join(' ') // join to a string - .split(/(?:^|\s+)-/g) // split on starting dashses - .map(x => x.trim().replace(/\s+/g, ' ')) // collapse spaces - .filter(Boolean) // remove empties - .map(x => x.split(/[=\s]/)) // split on equal or space - .map(([k, v]) => [ - // we split on the initial dash previously so now - // 1 dash means 2 and 0 means 1 - ...(k.startsWith('-') ? ['--', k.slice(1)] : ['-', k]), - v ?? true, // default to true for no value - ]) - .map(([dash, key, value]) => ({ dash, key: camel(key), value })) - - for (const { dash, key, value } of argv) { - const k = dash.length < 2 ? shorts[key] : key - if (Object.hasOwn(result, k)) { - result[k] = clean[k] ? clean[k](value) : value - } else { - // any unknown arg is a replacement value - replacements[k] = value - } - } - - if (!result.create && !result.update) { - // set default to create if no command is specified - result.create = true - } else if (result.create && result.update) { - throw new Error('Cannot set both create and update') - } - - if (result.help) { - console.error(usage()) - return process.exit(0) - } - - return { - ...result, - replacements: { - '(\\d+\\.\\d+\\.\\d+|X\\.Y\\.Z)': result.version, - '(\\d{4}-\\d{2}-\\d{2}|YYYY-MM-DD)': result.date, - ...replacements, - }, - } -} - -main(parseArgs(process.argv.slice(2))) - .then(d => console.log(d)) - .catch(err => { - console.error(err) - process.exitCode = 1 - }) diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 7bde0038f722f..12342862c8aaa 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.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": "3.7.1", + "version": "3.8.0", "workspaceRepo": false }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index c6e2bd25cc1d5..a27ede272d1c7 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -103,6 +103,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index a56e6b44a00ea..bb74d1b31d669 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -46,6 +46,6 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 6e2f920ef5d05..7ad6aa29d12d9 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "tap": "^16.0.1" }, "dependencies": { @@ -61,6 +61,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 6340035e9f192..a7ab0a2f325b1 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -50,7 +50,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -74,6 +74,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 75eed3c0cdbc7..53d1b1aace450 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -45,7 +45,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "tap": "^16.0.1" }, "dependencies": { @@ -56,6 +56,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index f686c13ad889b..45f09b0d521ae 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -40,7 +40,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -49,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 4fd55d7045ce6..1f5cbb0705d47 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -31,7 +31,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -52,6 +52,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index b5b42dd1a85d6..7e5aafbb5ee68 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 2ad578edee9d5..e758b4bfef6ca 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -53,6 +53,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 4b76e082f44e3..3810f99734898 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -29,7 +29,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -48,6 +48,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 2279caec9750c..c32390107b877 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -19,7 +19,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -42,6 +42,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 73c089b5e6f67..06a77fe1dc5d1 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.7.1", + "@npmcli/template-oss": "3.8.0", "require-inject": "^1.4.4", "tap": "^16.0.1" }, @@ -47,6 +47,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.7.1" + "version": "3.8.0" } } From 44bfedc22ee11de461eeffa030d30bea921bb0ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 20:38:49 +0000 Subject: [PATCH 109/175] chore: release 8.19.0 --- .release-please-manifest.json | 26 ++++++++-------- CHANGELOG.md | 43 +++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 26 ++++++++-------- workspaces/arborist/CHANGELOG.md | 19 ++++++++++++ workspaces/arborist/package.json | 2 +- workspaces/libnpmaccess/CHANGELOG.md | 6 ++++ workspaces/libnpmaccess/package.json | 2 +- workspaces/libnpmdiff/CHANGELOG.md | 8 +++++ workspaces/libnpmdiff/package.json | 2 +- workspaces/libnpmexec/CHANGELOG.md | 11 +++++++ workspaces/libnpmexec/package.json | 4 +-- workspaces/libnpmfund/CHANGELOG.md | 9 ++++++ workspaces/libnpmfund/package.json | 4 +-- workspaces/libnpmhook/CHANGELOG.md | 6 ++++ workspaces/libnpmhook/package.json | 2 +- workspaces/libnpmorg/CHANGELOG.md | 6 ++++ workspaces/libnpmorg/package.json | 2 +- workspaces/libnpmpack/CHANGELOG.md | 6 ++++ workspaces/libnpmpack/package.json | 2 +- workspaces/libnpmpublish/CHANGELOG.md | 9 ++++++ workspaces/libnpmpublish/package.json | 4 +-- workspaces/libnpmsearch/CHANGELOG.md | 6 ++++ workspaces/libnpmsearch/package.json | 2 +- workspaces/libnpmteam/CHANGELOG.md | 6 ++++ workspaces/libnpmteam/package.json | 2 +- workspaces/libnpmversion/CHANGELOG.md | 10 +++++++ workspaces/libnpmversion/package.json | 2 +- 28 files changed, 187 insertions(+), 42 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ddf5c9d9f9153..86f229c516555 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,15 +1,15 @@ { - ".": "8.18.0", - "workspaces/arborist": "5.6.0", - "workspaces/libnpmaccess": "6.0.3", - "workspaces/libnpmdiff": "4.0.4", - "workspaces/libnpmexec": "4.0.11", - "workspaces/libnpmfund": "3.0.2", - "workspaces/libnpmhook": "8.0.3", - "workspaces/libnpmorg": "4.0.3", - "workspaces/libnpmpack": "4.1.2", - "workspaces/libnpmpublish": "6.0.4", - "workspaces/libnpmsearch": "5.0.3", - "workspaces/libnpmteam": "4.0.3", - "workspaces/libnpmversion": "3.0.6" + ".": "8.19.0", + "workspaces/arborist": "5.6.1", + "workspaces/libnpmaccess": "6.0.4", + "workspaces/libnpmdiff": "4.0.5", + "workspaces/libnpmexec": "4.0.12", + "workspaces/libnpmfund": "3.0.3", + "workspaces/libnpmhook": "8.0.4", + "workspaces/libnpmorg": "4.0.4", + "workspaces/libnpmpack": "4.1.3", + "workspaces/libnpmpublish": "6.0.5", + "workspaces/libnpmsearch": "5.0.4", + "workspaces/libnpmteam": "4.0.4", + "workspaces/libnpmversion": "3.0.7" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a476fd2ba775a..86669095767cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## [8.19.0](https://github.com/npm/cli/compare/v8.18.0...v8.19.0) (2022-08-31) + +### Features + + * [`d94a9f5`](https://github.com/npm/cli/commit/d94a9f56cce1de32bfd87f841d7678e8394d8ea6) [#5347](https://github.com/npm/cli/pull/5347) feat: add deprecation warnings to access commands (@wraithgar) + +### Bug Fixes + + * [`bd2ae5d`](https://github.com/npm/cli/commit/bd2ae5d79eb8807bfca6075e98432c545a9ededa) [#5323](https://github.com/npm/cli/pull/5323) fix: linting (@wraithgar) + +### Documentation + + * [`3569094`](https://github.com/npm/cli/commit/356909424f60a26d90faf25594085e79e93f09d5) [#5321](https://github.com/npm/cli/pull/5321) docs: fix link to dependency selectors page (@hghmn) + * [`414667a`](https://github.com/npm/cli/commit/414667a1e6d7d7a3ab0cb64704c3aa696eae8715) [#5328](https://github.com/npm/cli/pull/5328) docs(dependency-selectors): fix Arborist example in docs (@kyle-west) + +### Dependencies + + * [`1286f03`](https://github.com/npm/cli/commit/1286f03fe73dee9a447b13b662f0c5622ab6ec9e) [#5381](https://github.com/npm/cli/pull/5381) deps: `unique-filename@2.0.1` + * [`d7e9a8e`](https://github.com/npm/cli/commit/d7e9a8ed5b7c1f9ca8d34e86388a134b2f48fc15) [#5381](https://github.com/npm/cli/pull/5381) deps: `ini@3.0.1` + * [`2c4e387`](https://github.com/npm/cli/commit/2c4e38728f25fd32624df2eb5bbf61c2c40c8ad5) [#5381](https://github.com/npm/cli/pull/5381) deps: `hosted-git-info@5.1.0` + * [`e401a81`](https://github.com/npm/cli/commit/e401a81c784556393bad57283337283a46bd57c5) [#5381](https://github.com/npm/cli/pull/5381) deps: `npm-bundled@2.0.1` + * [`f4205e5`](https://github.com/npm/cli/commit/f4205e57d6c4ee5f2ff7d21ffc116ffc420d191e) [#5381](https://github.com/npm/cli/pull/5381) deps: `diff@5.1.0` + * [`8f7abbe`](https://github.com/npm/cli/commit/8f7abbe4c3ceba451eb422c6328d623e7c8eeed5) [#5381](https://github.com/npm/cli/pull/5381) deps: `npm-packlist@5.1.3` + * [`b12ac01`](https://github.com/npm/cli/commit/b12ac013226b7d86b5b1847d58eabbac2846b153) [#5381](https://github.com/npm/cli/pull/5381) deps: `npm-pick-manifest@7.0.2` + * [`7fbf6f7`](https://github.com/npm/cli/commit/7fbf6f7825f76906ecdec79ab15595f9e2f7b784) [#5381](https://github.com/npm/cli/pull/5381) deps: `bin-links@3.0.3` + * [`7c7f656`](https://github.com/npm/cli/commit/7c7f65629c3dd4fe7fd8254ac38914cf52ad31c2) [#5381](https://github.com/npm/cli/pull/5381) deps: `read-package-json@5.0.2` + * [`26d2e55`](https://github.com/npm/cli/commit/26d2e551b250972caa550d56127810648a1663a1) [#5381](https://github.com/npm/cli/pull/5381) deps: `@npmcli/query@1.2.0` + * [`a79ee00`](https://github.com/npm/cli/commit/a79ee00b530b765ed219e81de77c37057c373adf) [#5381](https://github.com/npm/cli/pull/5381) deps: `cacache@16.1.3` + * [`2561822`](https://github.com/npm/cli/commit/25618229b7698aa8abbfcd2ef32024809f05a1a1) [#5378](https://github.com/npm/cli/pull/5378) deps: `@npmcli/config@4.2.2` + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + * `@npmcli/arborist@^5.6.1` + * [`libnpmaccess@^6.0.4`](https://github.com/npm/cli/compare/libnpmaccess-v6.0.3...libnpmaccess-v6.0.4) + * [`libnpmdiff@^4.0.5`](https://github.com/npm/cli/compare/libnpmdiff-v4.0.4...libnpmdiff-v4.0.5) + * [`libnpmexec@^4.0.12`](https://github.com/npm/cli/compare/libnpmexec-v4.0.11...libnpmexec-v4.0.12) + * [`libnpmfund@^3.0.3`](https://github.com/npm/cli/compare/libnpmfund-v3.0.2...libnpmfund-v3.0.3) + * [`libnpmhook@^8.0.4`](https://github.com/npm/cli/compare/libnpmhook-v8.0.3...libnpmhook-v8.0.4) + * [`libnpmorg@^4.0.4`](https://github.com/npm/cli/compare/libnpmorg-v4.0.3...libnpmorg-v4.0.4) + * [`libnpmpack@^4.1.3`](https://github.com/npm/cli/compare/libnpmpack-v4.1.2...libnpmpack-v4.1.3) + * [`libnpmpublish@^6.0.5`](https://github.com/npm/cli/compare/libnpmpublish-v6.0.4...libnpmpublish-v6.0.5) + * [`libnpmsearch@^5.0.4`](https://github.com/npm/cli/compare/libnpmsearch-v5.0.3...libnpmsearch-v5.0.4) + * [`libnpmteam@^4.0.4`](https://github.com/npm/cli/compare/libnpmteam-v4.0.3...libnpmteam-v4.0.4) + * [`libnpmversion@^3.0.7`](https://github.com/npm/cli/compare/libnpmversion-v3.0.6...libnpmversion-v3.0.7) + ## v8.18.0 (2022-08-17) ### Features diff --git a/package-lock.json b/package-lock.json index 794ce8f151fcd..2238c133a7216 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "8.18.0", + "version": "8.19.0", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 6b2db7d8b1407..f280f1a3732c5 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.18.0", + "version": "8.19.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -56,7 +56,7 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^5.0.4", + "@npmcli/arborist": "^5.6.1", "@npmcli/ci-detect": "^2.0.0", "@npmcli/config": "^4.2.1", "@npmcli/fs": "^2.1.0", @@ -79,17 +79,17 @@ "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", - "libnpmaccess": "^6.0.2", - "libnpmdiff": "^4.0.2", - "libnpmexec": "^4.0.2", - "libnpmfund": "^3.0.1", - "libnpmhook": "^8.0.2", - "libnpmorg": "^4.0.2", - "libnpmpack": "^4.0.2", - "libnpmpublish": "^6.0.2", - "libnpmsearch": "^5.0.2", - "libnpmteam": "^4.0.2", - "libnpmversion": "^3.0.1", + "libnpmaccess": "^6.0.4", + "libnpmdiff": "^4.0.5", + "libnpmexec": "^4.0.12", + "libnpmfund": "^3.0.3", + "libnpmhook": "^8.0.4", + "libnpmorg": "^4.0.4", + "libnpmpack": "^4.1.3", + "libnpmpublish": "^6.0.5", + "libnpmsearch": "^5.0.4", + "libnpmteam": "^4.0.4", + "libnpmversion": "^3.0.7", "make-fetch-happen": "^10.2.0", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index f1132c9e67457..eb3c924c12180 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [5.6.1](https://github.com/npm/cli/compare/arborist-v5.6.0...arborist-v5.6.1) (2022-08-31) + +### Bug Fixes + + * [`1e84102`](https://github.com/npm/cli/commit/1e841029917817556207c39d25be1ea91e2959e7) [#5350](https://github.com/npm/cli/pull/5350) fix: create links relative to the target (@wraithgar) + * [`ea5e3a3`](https://github.com/npm/cli/commit/ea5e3a319a7c1b5f7f2a66284227a34b79b2c831) [#5350](https://github.com/npm/cli/pull/5350) fix: inline single-use functions (@wraithgar) + * [`645c680`](https://github.com/npm/cli/commit/645c6804c09014b96c2d1eff191b174d12a2b7c0) [#5329](https://github.com/npm/cli/pull/5329) fix: update `index.js` spelling error in comment (@KevinBrother) + * [`bd2ae5d`](https://github.com/npm/cli/commit/bd2ae5d79eb8807bfca6075e98432c545a9ededa) [#5323](https://github.com/npm/cli/pull/5323) fix: linting (@wraithgar) + +### Dependencies + + * [`1286f03`](https://github.com/npm/cli/commit/1286f03fe73dee9a447b13b662f0c5622ab6ec9e) [#5381](https://github.com/npm/cli/pull/5381) deps: `unique-filename@2.0.1` + * [`2c4e387`](https://github.com/npm/cli/commit/2c4e38728f25fd32624df2eb5bbf61c2c40c8ad5) [#5381](https://github.com/npm/cli/pull/5381) deps: `hosted-git-info@5.1.0` + * [`b12ac01`](https://github.com/npm/cli/commit/b12ac013226b7d86b5b1847d58eabbac2846b153) [#5381](https://github.com/npm/cli/pull/5381) deps: `npm-pick-manifest@7.0.2` + * [`7fbf6f7`](https://github.com/npm/cli/commit/7fbf6f7825f76906ecdec79ab15595f9e2f7b784) [#5381](https://github.com/npm/cli/pull/5381) deps: `bin-links@3.0.3` + * [`26d2e55`](https://github.com/npm/cli/commit/26d2e551b250972caa550d56127810648a1663a1) [#5381](https://github.com/npm/cli/pull/5381) deps: `@npmcli/query@1.2.0` + * [`a79ee00`](https://github.com/npm/cli/commit/a79ee00b530b765ed219e81de77c37057c373adf) [#5381](https://github.com/npm/cli/pull/5381) deps: `cacache@16.1.3` + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ## [5.6.0](https://github.com/npm/cli/compare/arborist-v5.5.0...arborist-v5.6.0) (2022-08-17) diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index a27ede272d1c7..206d444514377 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "5.6.0", + "version": "5.6.1", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", diff --git a/workspaces/libnpmaccess/CHANGELOG.md b/workspaces/libnpmaccess/CHANGELOG.md index 5776901e50b5f..e229d4716817d 100644 --- a/workspaces/libnpmaccess/CHANGELOG.md +++ b/workspaces/libnpmaccess/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [6.0.4](https://github.com/npm/cli/compare/libnpmaccess-v6.0.3...libnpmaccess-v6.0.4) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ### [6.0.3](https://github.com/npm/cli/compare/libnpmaccess-v6.0.2...libnpmaccess-v6.0.3) (2022-04-06) diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index bb74d1b31d669..ca21f9de96031 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -1,6 +1,6 @@ { "name": "libnpmaccess", - "version": "6.0.3", + "version": "6.0.4", "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 3732ee78d8be2..903a4a01852e2 100644 --- a/workspaces/libnpmdiff/CHANGELOG.md +++ b/workspaces/libnpmdiff/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [4.0.5](https://github.com/npm/cli/compare/libnpmdiff-v4.0.4...libnpmdiff-v4.0.5) (2022-08-31) + +### Dependencies + + * [`1286f03`](https://github.com/npm/cli/commit/1286f03fe73dee9a447b13b662f0c5622ab6ec9e) [#5381](https://github.com/npm/cli/pull/5381) deps: `unique-filename@2.0.1` + * [`f4205e5`](https://github.com/npm/cli/commit/f4205e57d6c4ee5f2ff7d21ffc116ffc420d191e) [#5381](https://github.com/npm/cli/pull/5381) deps: `diff@5.1.0` + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ## [4.0.4](https://github.com/npm/cli/compare/libnpmdiff-v4.0.3...libnpmdiff-v4.0.4) (2022-06-22) diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 7ad6aa29d12d9..d672eada1e270 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "4.0.4", + "version": "4.0.5", "description": "The registry diff", "repository": { "type": "git", diff --git a/workspaces/libnpmexec/CHANGELOG.md b/workspaces/libnpmexec/CHANGELOG.md index cad3767839277..b847a0538e9e4 100644 --- a/workspaces/libnpmexec/CHANGELOG.md +++ b/workspaces/libnpmexec/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [4.0.12](https://github.com/npm/cli/compare/libnpmexec-v4.0.11...libnpmexec-v4.0.12) (2022-08-31) + +### Dependencies + + * [`1286f03`](https://github.com/npm/cli/commit/1286f03fe73dee9a447b13b662f0c5622ab6ec9e) [#5381](https://github.com/npm/cli/pull/5381) deps: `unique-filename@2.0.1` + * [`7fbf6f7`](https://github.com/npm/cli/commit/7fbf6f7825f76906ecdec79ab15595f9e2f7b784) [#5381](https://github.com/npm/cli/pull/5381) deps: `bin-links@3.0.3` + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` +* The following workspace dependencies were updated + * dependencies + * @npmcli/arborist bumped from ^5.0.0 to ^5.6.1 + ## [4.0.11](https://github.com/npm/cli/compare/libnpmexec-v4.0.10...libnpmexec-v4.0.11) (2022-08-17) diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index a7ab0a2f325b1..16439d854368e 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "4.0.11", + "version": "4.0.12", "files": [ "bin/", "lib/" @@ -57,7 +57,7 @@ "tap": "^16.0.1" }, "dependencies": { - "@npmcli/arborist": "^5.0.0", + "@npmcli/arborist": "^5.6.1", "@npmcli/ci-detect": "^2.0.0", "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.2.0", diff --git a/workspaces/libnpmfund/CHANGELOG.md b/workspaces/libnpmfund/CHANGELOG.md index 2e6fce8a8d890..f07ad6b414f7e 100644 --- a/workspaces/libnpmfund/CHANGELOG.md +++ b/workspaces/libnpmfund/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [3.0.3](https://github.com/npm/cli/compare/libnpmfund-v3.0.2...libnpmfund-v3.0.3) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` +* The following workspace dependencies were updated + * dependencies + * @npmcli/arborist bumped from ^5.0.0 to ^5.6.1 + ### [3.0.2](https://github.com/npm/cli/compare/libnpmfund-v3.0.1...libnpmfund-v3.0.2) (2022-04-06) diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 53d1b1aace450..0398463078a16 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "3.0.2", + "version": "3.0.3", "main": "lib/index.js", "files": [ "bin/", @@ -49,7 +49,7 @@ "tap": "^16.0.1" }, "dependencies": { - "@npmcli/arborist": "^5.0.0" + "@npmcli/arborist": "^5.6.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" diff --git a/workspaces/libnpmhook/CHANGELOG.md b/workspaces/libnpmhook/CHANGELOG.md index f344283b35ef5..d582d282e9c21 100644 --- a/workspaces/libnpmhook/CHANGELOG.md +++ b/workspaces/libnpmhook/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [8.0.4](https://github.com/npm/cli/compare/libnpmhook-v8.0.3...libnpmhook-v8.0.4) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ### [8.0.3](https://github.com/npm/cli/compare/libnpmhook-v8.0.2...libnpmhook-v8.0.3) (2022-04-06) diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 45f09b0d521ae..88eb3bc7f8b2c 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -1,6 +1,6 @@ { "name": "libnpmhook", - "version": "8.0.3", + "version": "8.0.4", "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 da03f0833615e..7f45d2ef95e11 100644 --- a/workspaces/libnpmorg/CHANGELOG.md +++ b/workspaces/libnpmorg/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.0.4](https://github.com/npm/cli/compare/libnpmorg-v4.0.3...libnpmorg-v4.0.4) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ### [4.0.3](https://github.com/npm/cli/compare/libnpmorg-v4.0.2...libnpmorg-v4.0.3) (2022-04-06) diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 1f5cbb0705d47..7aef13f1a058d 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -1,6 +1,6 @@ { "name": "libnpmorg", - "version": "4.0.3", + "version": "4.0.4", "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 85e6a5aa1dfe3..f147dbda93ada 100644 --- a/workspaces/libnpmpack/CHANGELOG.md +++ b/workspaces/libnpmpack/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.1.3](https://github.com/npm/cli/compare/libnpmpack-v4.1.2...libnpmpack-v4.1.3) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ## [4.1.2](https://github.com/npm/cli/compare/libnpmpack-v4.1.1...libnpmpack-v4.1.2) (2022-06-23) diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 7e5aafbb5ee68..f1bb29dfc0f3f 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "4.1.2", + "version": "4.1.3", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", diff --git a/workspaces/libnpmpublish/CHANGELOG.md b/workspaces/libnpmpublish/CHANGELOG.md index 5cda1cb947023..e3435c7ea6f05 100644 --- a/workspaces/libnpmpublish/CHANGELOG.md +++ b/workspaces/libnpmpublish/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [6.0.5](https://github.com/npm/cli/compare/libnpmpublish-v6.0.4...libnpmpublish-v6.0.5) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` +* The following workspace dependencies were updated + * devDependencies + * libnpmpack bumped from ^4.0.0 to ^4.1.3 + ### [6.0.4](https://github.com/npm/cli/compare/libnpmpublish-v6.0.3...libnpmpublish-v6.0.4) (2022-04-26) diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index e758b4bfef6ca..4083976aa5ed7 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "6.0.4", + "version": "6.0.5", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.8.0", - "libnpmpack": "^4.0.0", + "libnpmpack": "^4.1.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.0.1" diff --git a/workspaces/libnpmsearch/CHANGELOG.md b/workspaces/libnpmsearch/CHANGELOG.md index ec86dbf623e57..7a75df9ee5800 100644 --- a/workspaces/libnpmsearch/CHANGELOG.md +++ b/workspaces/libnpmsearch/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.4](https://github.com/npm/cli/compare/libnpmsearch-v5.0.3...libnpmsearch-v5.0.4) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ### [5.0.3](https://github.com/npm/cli/compare/libnpmsearch-v5.0.2...libnpmsearch-v5.0.3) (2022-04-06) diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 3810f99734898..cc3c582ae903b 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "5.0.3", + "version": "5.0.4", "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 b203fe7d6dea7..708799fb41f79 100644 --- a/workspaces/libnpmteam/CHANGELOG.md +++ b/workspaces/libnpmteam/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.0.4](https://github.com/npm/cli/compare/libnpmteam-v4.0.3...libnpmteam-v4.0.4) (2022-08-31) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ### [4.0.3](https://github.com/npm/cli/compare/libnpmteam-v4.0.2...libnpmteam-v4.0.3) (2022-04-06) diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index c32390107b877..8f53bf5fd33dd 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -1,7 +1,7 @@ { "name": "libnpmteam", "description": "npm Team management APIs", - "version": "4.0.3", + "version": "4.0.4", "author": "GitHub Inc.", "license": "ISC", "main": "lib/index.js", diff --git a/workspaces/libnpmversion/CHANGELOG.md b/workspaces/libnpmversion/CHANGELOG.md index 9e44d395e630e..8774ac01b5bae 100644 --- a/workspaces/libnpmversion/CHANGELOG.md +++ b/workspaces/libnpmversion/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [3.0.7](https://github.com/npm/cli/compare/libnpmversion-v3.0.6...libnpmversion-v3.0.7) (2022-08-31) + +### Bug Fixes + + * [`bd2ae5d`](https://github.com/npm/cli/commit/bd2ae5d79eb8807bfca6075e98432c545a9ededa) [#5323](https://github.com/npm/cli/pull/5323) fix: linting (@wraithgar) + +### Dependencies + + * [`8ab12dc`](https://github.com/npm/cli/commit/8ab12dc32b26db770b868cf694cedab38f4e7460) [#5323](https://github.com/npm/cli/pull/5323) deps: `@npmcli/eslint-config@3.1.0` + ## [3.0.6](https://github.com/npm/cli/compare/libnpmversion-v3.0.5...libnpmversion-v3.0.6) (2022-06-23) diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 06a77fe1dc5d1..ee18df9366c25 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -1,6 +1,6 @@ { "name": "libnpmversion", - "version": "3.0.6", + "version": "3.0.7", "main": "lib/index.js", "files": [ "bin/", From 00a2158bc5ab0cc46c7b68bf8963af6ae2b67f80 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Wed, 31 Aug 2022 20:39:50 +0000 Subject: [PATCH 110/175] chore: post pull request --- AUTHORS | 3 +++ package-lock.json | 56 +++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/AUTHORS b/AUTHORS index c8c2d12543d7e..e5b44bb9792c6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -848,3 +848,6 @@ Takuya N Neel Dani Anton Rieder <1301152+aried3r@users.noreply.github.com> William Marlow +KevinBrother <1301239018@qq.com> +Kyle West +Nathan Hughes diff --git a/package-lock.json b/package-lock.json index 2238c133a7216..83d293f6a8668 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "npm", - "version": "8.18.0", + "version": "8.19.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -91,7 +91,7 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^5.0.4", + "@npmcli/arborist": "^5.6.1", "@npmcli/ci-detect": "^2.0.0", "@npmcli/config": "^4.2.1", "@npmcli/fs": "^2.1.0", @@ -114,17 +114,17 @@ "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", - "libnpmaccess": "^6.0.2", - "libnpmdiff": "^4.0.2", - "libnpmexec": "^4.0.2", - "libnpmfund": "^3.0.1", - "libnpmhook": "^8.0.2", - "libnpmorg": "^4.0.2", - "libnpmpack": "^4.0.2", - "libnpmpublish": "^6.0.2", - "libnpmsearch": "^5.0.2", - "libnpmteam": "^4.0.2", - "libnpmversion": "^3.0.1", + "libnpmaccess": "^6.0.4", + "libnpmdiff": "^4.0.5", + "libnpmexec": "^4.0.12", + "libnpmfund": "^3.0.3", + "libnpmhook": "^8.0.4", + "libnpmorg": "^4.0.4", + "libnpmpack": "^4.1.3", + "libnpmpublish": "^6.0.5", + "libnpmsearch": "^5.0.4", + "libnpmteam": "^4.0.4", + "libnpmversion": "^3.0.7", "make-fetch-happen": "^10.2.0", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", @@ -13855,7 +13855,7 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "5.6.0", + "version": "5.6.1", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -13913,7 +13913,7 @@ } }, "workspaces/libnpmaccess": { - "version": "6.0.3", + "version": "6.0.4", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -13932,7 +13932,7 @@ } }, "workspaces/libnpmdiff": { - "version": "4.0.4", + "version": "4.0.5", "license": "ISC", "dependencies": { "@npmcli/disparity-colors": "^2.0.0", @@ -13954,10 +13954,10 @@ } }, "workspaces/libnpmexec": { - "version": "4.0.11", + "version": "4.0.12", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^5.0.0", + "@npmcli/arborist": "^5.6.1", "@npmcli/ci-detect": "^2.0.0", "@npmcli/fs": "^2.1.1", "@npmcli/run-script": "^4.2.0", @@ -13985,10 +13985,10 @@ } }, "workspaces/libnpmfund": { - "version": "3.0.2", + "version": "3.0.3", "license": "ISC", "dependencies": { - "@npmcli/arborist": "^5.0.0" + "@npmcli/arborist": "^5.6.1" }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", @@ -14000,7 +14000,7 @@ } }, "workspaces/libnpmhook": { - "version": "8.0.3", + "version": "8.0.4", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14017,7 +14017,7 @@ } }, "workspaces/libnpmorg": { - "version": "4.0.3", + "version": "4.0.4", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14035,7 +14035,7 @@ } }, "workspaces/libnpmpack": { - "version": "4.1.2", + "version": "4.1.3", "license": "ISC", "dependencies": { "@npmcli/run-script": "^4.1.3", @@ -14053,7 +14053,7 @@ } }, "workspaces/libnpmpublish": { - "version": "6.0.4", + "version": "6.0.5", "license": "ISC", "dependencies": { "normalize-package-data": "^4.0.0", @@ -14065,7 +14065,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/template-oss": "3.8.0", - "libnpmpack": "^4.0.0", + "libnpmpack": "^4.1.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", "tap": "^16.0.1" @@ -14075,7 +14075,7 @@ } }, "workspaces/libnpmsearch": { - "version": "5.0.3", + "version": "5.0.4", "license": "ISC", "dependencies": { "npm-registry-fetch": "^13.0.0" @@ -14091,7 +14091,7 @@ } }, "workspaces/libnpmteam": { - "version": "4.0.3", + "version": "4.0.4", "license": "ISC", "dependencies": { "aproba": "^2.0.0", @@ -14108,7 +14108,7 @@ } }, "workspaces/libnpmversion": { - "version": "3.0.6", + "version": "3.0.7", "license": "ISC", "dependencies": { "@npmcli/git": "^3.0.0", From d2712d1eb097ab93b9c2d3f80d67826b4cdf3733 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 31 Aug 2022 16:11:56 -0700 Subject: [PATCH 111/175] chore: set prerelease flag --- release-please-config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index 8f82980337956..6c5b275e84740 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -32,7 +32,8 @@ ], "packages": { ".": { - "package-name": "" + "package-name": "", + "prerelease": true }, "workspaces/arborist": {}, "workspaces/libnpmaccess": {}, From dcc376534212e13fcd5813db9eb067be8179d04f Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 31 Aug 2022 16:24:37 -0700 Subject: [PATCH 112/175] chore: remove some outdated release steps Also increase docs tests so they dont timeout when rebuilding cmark-gfm --- Makefile | 3 --- docs/package.json | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 72b285359e776..5c153511e31af 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ SHELL = bash PUBLISHTAG = $(shell node scripts/publish-tag.js) -BRANCH = $(shell git rev-parse --abbrev-ref HEAD) # these docs have the @VERSION@ tag in them, so they have to be rebuilt # whenever the package.json is touched, in case the version changed. @@ -112,8 +111,6 @@ prune: deps node scripts/git-dirty.js publish: gitclean ls-ok link test-all docs prune - git push origin $(BRANCH) &&\ - git push origin --tags &&\ node bin/npm-cli.js publish --tag=$(PUBLISHTAG) release: gitclean ls-ok docs prune diff --git a/docs/package.json b/docs/package.json index c7f02a7ae6fa9..7d96037e597ff 100644 --- a/docs/package.json +++ b/docs/package.json @@ -47,7 +47,8 @@ "statements": 81, "branches": 72, "functions": 75, - "lines": 81 + "lines": 81, + "timeout": 600 }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", From 68e1677483d34d0b4662fb93455a2d024163c2d2 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 1 Sep 2022 07:45:17 -0700 Subject: [PATCH 113/175] chore: revert prerelease mode for now Using #5452 instead --- release-please-config.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index 6c5b275e84740..8f82980337956 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -32,8 +32,7 @@ ], "packages": { ".": { - "package-name": "", - "prerelease": true + "package-name": "" }, "workspaces/arborist": {}, "workspaces/libnpmaccess": {}, From 4bc702912487117e5c5316b0052917950464f278 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 1 Sep 2022 14:16:12 -0700 Subject: [PATCH 114/175] chore: @npmcli/template-oss@3.8.1 (#5461) --- .github/workflows/release-please.yml | 1 + docs/package.json | 6 ++--- package-lock.json | 36 +++++++++++++-------------- package.json | 4 +-- smoke-tests/package.json | 6 ++--- workspaces/arborist/package.json | 7 ++---- workspaces/libnpmaccess/package.json | 7 ++---- workspaces/libnpmdiff/package.json | 7 ++---- workspaces/libnpmexec/package.json | 7 ++---- workspaces/libnpmfund/package.json | 7 ++---- workspaces/libnpmhook/package.json | 7 ++---- workspaces/libnpmorg/package.json | 7 ++---- workspaces/libnpmpack/package.json | 7 ++---- workspaces/libnpmpublish/package.json | 7 ++---- workspaces/libnpmsearch/package.json | 7 ++---- workspaces/libnpmteam/package.json | 7 ++---- workspaces/libnpmversion/package.json | 7 ++---- 17 files changed, 49 insertions(+), 88 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6e0604199b90a..42c9972811795 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -49,6 +49,7 @@ jobs: run: echo "::set-output name=branch::${{ fromJSON(needs.release-please.outputs.pr).headBranchName }}" - uses: actions/checkout@v3 with: + fetch-depth: 0 ref: ${{ steps.ref.outputs.branch }} - name: Setup git user run: | diff --git a/docs/package.json b/docs/package.json index 7d96037e597ff..46297b934a996 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,8 +8,6 @@ "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "git push origin --follow-tags", "snap": "tap", "test": "tap", "posttest": "npm run lint" @@ -24,7 +22,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -61,6 +59,6 @@ "ciVersions": [ "16" ], - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/package-lock.json b/package-lock.json index 83d293f6a8668..abf787c57f10e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -169,7 +169,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -189,7 +189,7 @@ "@npmcli/eslint-config": "^3.1.0", "@npmcli/fs": "^2.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", @@ -2362,9 +2362,9 @@ } }, "node_modules/@npmcli/template-oss": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.8.0.tgz", - "integrity": "sha512-jpvuS/ZrLTIsHm19Wh8PQx6tJSvhWyto/5Bb16StMUGjM8/eyL+nPQQ+/oREtqI2nTtXOMhIorRjtwATUP8IFg==", + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.8.1.tgz", + "integrity": "sha512-YfOCIVYK7F0EoepXYUrKuD7LEOWEtWxAyxziSTZWJbjIslX/IYgaKrOqJGWl7eXSMW2LJizK31JBcHEyBNtNnQ==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -13843,7 +13843,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.1", @@ -13900,7 +13900,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -13923,7 +13923,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -13946,7 +13946,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "tap": "^16.0.1" }, "engines": { @@ -13974,7 +13974,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -13992,7 +13992,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "tap": "^16.0.1" }, "engines": { @@ -14008,7 +14008,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -14025,7 +14025,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -14044,7 +14044,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -14064,7 +14064,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "libnpmpack": "^4.1.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -14082,7 +14082,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -14099,7 +14099,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -14119,7 +14119,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "require-inject": "^1.4.4", "tap": "^16.0.1" }, diff --git a/package.json b/package.json index f280f1a3732c5..b612ff1f4a53a 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "fs-minipass": "^2.1.0", "licensee": "^8.2.0", "minimatch": "^5.1.0", @@ -251,7 +251,7 @@ "templateOSS": { "rootRepo": false, "rootModule": false, - "version": "3.8.0", + "version": "3.8.1", "releaseTest": "release.yml" }, "license": "Artistic-2.0", diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 12342862c8aaa..f7c83fb8fd65f 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -8,8 +8,6 @@ "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "git push origin --follow-tags", "snap": "tap", "test": "tap", "posttest": "npm run lint" @@ -22,7 +20,7 @@ "devDependencies": { "@npmcli/eslint-config": "^3.1.0", "@npmcli/promise-spawn": "^3.0.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "minify-registry-metadata": "^2.2.0", "rimraf": "^3.0.2", "tap": "^16.0.1", @@ -32,7 +30,7 @@ "license": "ISC", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0", + "version": "3.8.1", "workspaceRepo": false }, "tap": { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 206d444514377..b7cd92ba4cb11 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", @@ -56,9 +56,6 @@ "snap": "tap", "postsnap": "npm run lintfix", "test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "eslint": "eslint", "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", @@ -103,6 +100,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index ca21f9de96031..94c688e07e58e 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -6,21 +6,18 @@ "license": "ISC", "main": "lib/index.js", "scripts": { - "preversion": "npm test", - "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "lint": "eslint \"**/*.js\"", "test": "tap", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", - "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "posttest": "npm run lint", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -46,6 +43,6 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index d672eada1e270..9f61ee8f55cc6 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -38,15 +38,12 @@ "test": "tap", "posttest": "npm run lint", "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "tap": "^16.0.1" }, "dependencies": { @@ -61,6 +58,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 16439d854368e..7f7b8eac456b9 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -37,9 +37,6 @@ "posttest": "npm run lint", "test": "tap", "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" @@ -50,7 +47,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "bin-links": "^3.0.3", "minify-registry-metadata": "^2.2.0", "mkdirp": "^1.0.4", @@ -74,6 +71,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 0398463078a16..68db1d647326a 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -37,15 +37,12 @@ "posttest": "npm run lint", "test": "tap", "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "tap": "^16.0.1" }, "dependencies": { @@ -56,6 +53,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 88eb3bc7f8b2c..446170777ff26 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -14,9 +14,6 @@ "lint": "eslint \"**/*.js\"", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "posttest": "npm run lint", "template-oss-apply": "template-oss-apply --force" @@ -40,7 +37,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -49,6 +46,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 7aef13f1a058d..b5ecf40cbf378 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -14,9 +14,6 @@ ], "license": "ISC", "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "lint": "eslint \"**/*.js\"", "test": "tap", "posttest": "npm run lint", @@ -31,7 +28,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "minipass": "^3.1.1", "nock": "^13.2.4", "tap": "^16.0.1" @@ -52,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index f1bb29dfc0f3f..e808c7b8e3b6b 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -13,9 +13,6 @@ ], "license": "ISC", "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "lint": "eslint \"**/*.js\"", "test": "tap", "posttest": "npm run lint", @@ -26,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.0.7", "tap": "^16.0.1" }, @@ -47,6 +44,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 4083976aa5ed7..dd88dd5460dbe 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -17,9 +17,6 @@ "eslint": "eslint", "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "test": "tap", "posttest": "npm run lint", "postlint": "template-oss-check", @@ -28,7 +25,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "libnpmpack": "^4.1.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -53,6 +50,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index cc3c582ae903b..f9b8cdded0c10 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -16,9 +16,6 @@ ], "license": "ISC", "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "posttest": "npm run lint", "test": "tap", "lint": "eslint \"**/*.js\"", @@ -29,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -48,6 +45,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 8f53bf5fd33dd..2d5a91b5e57c7 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -6,9 +6,6 @@ "license": "ISC", "main": "lib/index.js", "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "lint": "eslint \"**/*.js\"", "test": "tap", "posttest": "npm run lint", @@ -19,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "nock": "^13.2.4", "tap": "^16.0.1" }, @@ -42,6 +39,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index ee18df9366c25..ff6415afc862b 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -19,9 +19,6 @@ "test": "tap", "posttest": "npm run lint", "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" @@ -31,7 +28,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.1.0", - "@npmcli/template-oss": "3.8.0", + "@npmcli/template-oss": "3.8.1", "require-inject": "^1.4.4", "tap": "^16.0.1" }, @@ -47,6 +44,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.8.0" + "version": "3.8.1" } } From d60b43f3825452dd8b9b5879c287df232c9a8dc8 Mon Sep 17 00:00:00 2001 From: Sandeep Meduru <73886592+sandeepmeduru@users.noreply.github.com> Date: Fri, 2 Sep 2022 02:46:33 +0530 Subject: [PATCH 115/175] fix: Turn off progress bar when using web based authorization (#5438) --- lib/utils/otplease.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/otplease.js b/lib/utils/otplease.js index 0e20e7a797ae0..e40ef57730c30 100644 --- a/lib/utils/otplease.js +++ b/lib/utils/otplease.js @@ -1,3 +1,4 @@ +const log = require('./log-shim') async function otplease (npm, opts, fn) { try { return await fn(opts) @@ -7,6 +8,7 @@ async function otplease (npm, opts, fn) { } if (isWebOTP(err)) { + log.disableProgress() const webAuth = require('./web-auth') const openUrlPrompt = require('./open-url-prompt') From 155b714f8e9fb16e997635f51cce174f13e43981 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:21:08 +0000 Subject: [PATCH 116/175] chore: release 8.19.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 86f229c516555..1fcd6a2fedf0c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "8.19.0", + ".": "8.19.1", "workspaces/arborist": "5.6.1", "workspaces/libnpmaccess": "6.0.4", "workspaces/libnpmdiff": "4.0.5", diff --git a/CHANGELOG.md b/CHANGELOG.md index 86669095767cd..f864a61f9d8b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [8.19.1](https://github.com/npm/cli/compare/v8.19.0...v8.19.1) (2022-09-01) + +### Bug Fixes + + * [`d60b43f`](https://github.com/npm/cli/commit/d60b43f3825452dd8b9b5879c287df232c9a8dc8) [#5438](https://github.com/npm/cli/pull/5438) fix: Turn off progress bar when using web based authorization (@sandeepmeduru) + ## [8.19.0](https://github.com/npm/cli/compare/v8.18.0...v8.19.0) (2022-08-31) ### Features diff --git a/package-lock.json b/package-lock.json index abf787c57f10e..5877fbbd9c414 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "npm", - "version": "8.19.0", + "version": "8.19.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index b612ff1f4a53a..458952142ff2b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.19.0", + "version": "8.19.1", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ From 63186c8f65cad80a02c48cda3f001a628a05cb61 Mon Sep 17 00:00:00 2001 From: npm CLI robot Date: Thu, 1 Sep 2022 21:22:38 +0000 Subject: [PATCH 117/175] chore: post pull request --- AUTHORS | 1 + package-lock.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index e5b44bb9792c6..4632f50e98a6d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -851,3 +851,4 @@ William Marlow KevinBrother <1301239018@qq.com> Kyle West Nathan Hughes +Sandeep Meduru <73886592+sandeepmeduru@users.noreply.github.com> diff --git a/package-lock.json b/package-lock.json index 5877fbbd9c414..46e6331583770 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "npm", - "version": "8.19.0", + "version": "8.19.1", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", From eb1998a1664decc4aa064a4eb66966f64ae92d39 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 1 Sep 2022 15:46:15 -0700 Subject: [PATCH 118/175] chore: make all workspaces prerelease (#5452) --- release-please-config.json | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index 8f82980337956..3e43348c7a588 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -30,22 +30,47 @@ "hidden": true } ], + "packages": { ".": { "package-name": "" }, - "workspaces/arborist": {}, - "workspaces/libnpmaccess": {}, - "workspaces/libnpmdiff": {}, - "workspaces/libnpmexec": {}, - "workspaces/libnpmfund": {}, - "workspaces/libnpmhook": {}, - "workspaces/libnpmorg": {}, - "workspaces/libnpmpack": {}, - "workspaces/libnpmpublish": {}, - "workspaces/libnpmsearch": {}, - "workspaces/libnpmteam": {}, - "workspaces/libnpmversion": {} + "workspaces/arborist": { + "prerelease": true + }, + "workspaces/libnpmaccess": { + "prerelease": true + }, + "workspaces/libnpmdiff": { + "prerelease": true + }, + "workspaces/libnpmexec": { + "prerelease": true + }, + "workspaces/libnpmfund": { + "prerelease": true + }, + "workspaces/libnpmhook": { + "prerelease": true + }, + "workspaces/libnpmorg": { + "prerelease": true + }, + "workspaces/libnpmpack": { + "prerelease": true + }, + "workspaces/libnpmpublish": { + "prerelease": true + }, + "workspaces/libnpmsearch": { + "prerelease": true + }, + "workspaces/libnpmteam": { + "prerelease": true + }, + "workspaces/libnpmversion": { + "prerelease": true + } }, "exclude-packages-from-root": true, "group-pull-request-title-pattern": "chore: release ${version}", From 457d388c9a70b4bc6c2421f576c79fb7524ff259 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:06:34 -0700 Subject: [PATCH 119/175] feat: update supported node engines in package.json This also replaces the previous check for known broken versions of node with an exception handler for syntax errors in order to try and give a nicer error message when attempting to run npm on older node versions. BREAKING CHANGE: `npm` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0` Ref: npm/statusboard#519 --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 16 ++++++++-------- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67dcfb4d1d69a..8914fa041cc28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,12 +66,12 @@ jobs: fail-fast: false matrix: node-version: - - 12.13.0 - - 12.x - - 14.15.0 + - 14.17.0 - 14.x - - 16.0.0 + - 16.13.0 - 16.x + - 18.0.0 + - 18.x platform: - os: ubuntu-latest shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f1ea45e1f478..5035e26519272 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,12 +27,12 @@ jobs: fail-fast: false matrix: node-version: - - 12.13.0 - - 12.x - - 14.15.0 + - 14.17.0 - 14.x - - 16.0.0 + - 16.13.0 - 16.x + - 18.0.0 + - 18.x platform: - os: ubuntu-latest shell: bash @@ -77,12 +77,12 @@ jobs: fail-fast: false matrix: node-version: - - 12.13.0 - - 12.x - - 14.15.0 + - 14.17.0 - 14.x - - 16.0.0 + - 16.13.0 - 16.x + - 18.0.0 + - 18.x platform: - os: ubuntu-latest shell: bash diff --git a/package-lock.json b/package-lock.json index 46e6331583770..6adac81ec4b27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -178,7 +178,7 @@ "tap": "^16.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "docs": { diff --git a/package.json b/package.json index 458952142ff2b..1311b1c3216c3 100644 --- a/package.json +++ b/package.json @@ -256,6 +256,6 @@ }, "license": "Artistic-2.0", "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } } From 41481f8bc1de0fb92a2d6aab3d4a43292d1a1db7 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:07:05 -0700 Subject: [PATCH 120/175] fix: attempt more graceful failure in older node versions --- lib/cli.js | 119 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 87 insertions(+), 32 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 7b87b94452ead..9aaf6c593675a 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -1,57 +1,112 @@ +// This is separate to indicate that it should contain code we expect to work in +// all conceivably runnable versions of node. This is a best effort to catch +// syntax errors to give users a good error message if they are using a node +// version that doesn't allow syntax we are using such as private properties, etc +const createEnginesValidation = () => { + const node = process.version.replace(/-.*$/, '') + const pkg = require('../package.json') + const engines = pkg.engines.node + const npm = `v${pkg.version}` + + const cols = Math.min(Math.max(20, process.stdout.columns) || 80, 80) + const wrap = (lines) => lines + .join(' ') + .split(/[ \n]+/) + .reduce((left, right) => { + const last = left.split('\n').pop() + const join = last.length && last.length + right.length > cols ? '\n' : ' ' + return left + join + right + }) + .trim() + + const unsupportedMessage = wrap([ + `npm ${npm} does not support Node.js ${node}.`, + `You should probably upgrade to a newer version of node as we can't make any`, + `promises that npm will work with this version.`, + `This version of npm supports the following node versions: \`${engines}\`.`, + 'You can find the latest version at https://nodejs.org/.', + ]) + + const brokenMessage = wrap([ + `ERROR: npm ${npm} is known not to run on Node.js ${node}.`, + `You'll need to upgrade to a newer Node.js version in order to use this version of npm.`, + `This version of npm supports the following node versions: \`${engines}\`.`, + 'You can find the latest version at https://nodejs.org/.', + ]) + + // coverage ignored because this is only hit in very unsupported node versions + // and it's a best effort attempt to show something nice in those cases + /* istanbul ignore next */ + const syntaxErrorHandler = (err) => { + if (err instanceof SyntaxError) { + // eslint-disable-next-line no-console + console.error(`${brokenMessage}\n\nERROR:`) + // eslint-disable-next-line no-console + console.error(err) + return process.exit(1) + } + throw err + } + + process.on('uncaughtException', syntaxErrorHandler) + process.on('unhandledRejection', syntaxErrorHandler) + + return { + node, + engines, + unsupportedMessage, + off: () => { + process.off('uncaughtException', syntaxErrorHandler) + process.off('unhandledRejection', syntaxErrorHandler) + }, + } +} + // Separated out for easier unit testing module.exports = async process => { // set it here so that regardless of what happens later, we don't // leak any private CLI configs to other programs process.title = 'npm' - // We used to differentiate between known broken and unsupported - // versions of node and attempt to only log unsupported but still run. - // After we dropped node 10 support, we can use new features - // (like static, private, etc) which will only give vague syntax errors, - // so now both broken and unsupported use console, but only broken - // will process.exit. It is important to now perform *both* of these - // checks as early as possible so the user gets the error message. - const semver = require('semver') - const supported = require('../package.json').engines.node - const knownBroken = '<12.5.0' - - const nodejsVersion = process.version.replace(/-.*$/, '') - /* eslint-disable no-console */ - if (semver.satisfies(nodejsVersion, knownBroken)) { - console.error('ERROR: npm is known not to run on Node.js ' + process.version) - console.error("You'll need to upgrade to a newer Node.js version in order to use this") - console.error('version of npm. You can find the latest version at https://nodejs.org/') - process.exit(1) - } - if (!semver.satisfies(nodejsVersion, supported)) { - console.error('npm does not support Node.js ' + process.version) - console.error('You should probably upgrade to a newer version of node as we') - console.error("can't make any promises that npm will work with this version.") - console.error('You can find the latest version at https://nodejs.org/') - } - /* eslint-enable no-console */ + // Nothing should happen before this line if we can't guarantee it will + // not have syntax errors in some version of node + const validateEngines = createEnginesValidation() + const satisfies = require('semver/functions/satisfies') const exitHandler = require('./utils/exit-handler.js') - process.on('uncaughtException', exitHandler) - process.on('unhandledRejection', exitHandler) - const Npm = require('./npm.js') const npm = new Npm() exitHandler.setNpm(npm) - // if npm is called as "npmg" or "npm_g", then - // run in global mode. + // if npm is called as "npmg" or "npm_g", then run in global mode. if (process.argv[1][process.argv[1].length - 1] === 'g') { process.argv.splice(1, 1, 'npm', '-g') } - const log = require('./utils/log-shim.js') // only log node and npm paths in argv initially since argv can contain // sensitive info. a cleaned version will be logged later + const log = require('./utils/log-shim.js') log.verbose('cli', process.argv.slice(0, 2).join(' ')) log.info('using', 'npm@%s', npm.version) log.info('using', 'node@%s', process.version) + // At this point we've required a few files and can be pretty sure + // we dont contain invalid syntax for this version of node. It's + // possible a lazy require would, but that's unlikely enough that + // it's not worth catching anymore and we attach the more important + // exit handlers. + validateEngines.off() + process.on('uncaughtException', exitHandler) + process.on('unhandledRejection', exitHandler) + + // It is now safe to log a warning if they are using a version of node + // that is not going to fail on syntax errors but is still unsupported + // and untested and might not work reliably. This is safe to use the logger + // now which we want since this will show up in the error log too. + if (!satisfies(validateEngines.node, validateEngines.engines)) { + log.warn('cli', validateEngines.unsupportedMessage) + } + let cmd // now actually fire up npm and run the command. // this is how to use npm programmatically: From c927afe743e5e59c5335cfc0acdeec6afbb130c4 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 7 Sep 2022 14:21:09 -0700 Subject: [PATCH 121/175] chore: fix failing tests in windows + node 18 Some of our tests were failing in windows after testing on node 18. The reason was the inability to clean up the logs dir. This changes forces a few tests to run in order and also cleans up any use of multiple `t.testdir` calls in a single child test which can cause problems. --- test/fixtures/mock-npm.js | 3 + test/lib/cli.js | 32 +-- test/lib/commands/install.js | 461 +++++++++++++++++------------------ test/lib/npm.js | 26 +- 4 files changed, 247 insertions(+), 275 deletions(-) diff --git a/test/fixtures/mock-npm.js b/test/fixtures/mock-npm.js index adf6c7432a561..330c341474da3 100644 --- a/test/fixtures/mock-npm.js +++ b/test/fixtures/mock-npm.js @@ -66,6 +66,7 @@ const LoadMockNpm = async (t, { globalPrefixDir = { lib: {} }, config = {}, mocks = {}, + otherDirs = {}, globals = null, } = {}) => { // Mock some globals with their original values so they get torn down @@ -107,6 +108,7 @@ const LoadMockNpm = async (t, { prefix: prefixDir, cache: cacheDir, global: globalPrefixDir, + other: otherDirs, }) const dirs = { testdir: dir, @@ -114,6 +116,7 @@ const LoadMockNpm = async (t, { cache: path.join(dir, 'cache'), globalPrefix: path.join(dir, 'global'), home: path.join(dir, 'home'), + other: path.join(dir, 'other'), } // Set cache to testdir via env var so it is available when load is run diff --git a/test/lib/cli.js b/test/lib/cli.js index d36048cd918c6..5a75aa7fa121b 100644 --- a/test/lib/cli.js +++ b/test/lib/cli.js @@ -172,37 +172,15 @@ t.test('load error calls error handler', async t => { t.strictSame(exitHandlerCalled(), [err]) }) -t.test('known broken node version', async t => { - const errors = [] - let exitCode - const { cli } = await cliMock(t, { - globals: { - 'console.error': (msg) => errors.push(msg), - 'process.version': '6.0.0', - 'process.exit': e => exitCode = e, - }, - }) - await cli(process) - t.match(errors, [ - 'ERROR: npm is known not to run on Node.js 6.0.0', - 'You\'ll need to upgrade to a newer Node.js version in order to use this', - 'version of npm. You can find the latest version at https://nodejs.org/', - ]) - t.match(exitCode, 1) -}) - t.test('unsupported node version', async t => { - const errors = [] - const { cli } = await cliMock(t, { + const { cli, logs } = await cliMock(t, { globals: { - 'console.error': (msg) => errors.push(msg), 'process.version': '12.6.0', }, }) await cli(process) - t.match(errors, [ - 'npm does not support Node.js 12.6.0', - 'You should probably upgrade to a newer version of node as we', - 'can\'t make any promises that npm will work with this version.', - ]) + t.match( + logs.warn[0][1], + /npm v.* does not support Node\.js 12\.6\.0\./ + ) }) diff --git a/test/lib/commands/install.js b/test/lib/commands/install.js index 9b2d52f6edd21..632ca22be9e71 100644 --- a/test/lib/commands/install.js +++ b/test/lib/commands/install.js @@ -1,273 +1,262 @@ const t = require('tap') -const path = require('path') const { load: _loadMockNpm } = require('../../fixtures/mock-npm') // Make less churn in the test to pass in mocks only signature const loadMockNpm = (t, mocks) => _loadMockNpm(t, { mocks }) -t.test('with args, dev=true', async t => { - const SCRIPTS = [] - let ARB_ARGS = null - let REIFY_CALLED = false - let ARB_OBJ = null +t.test('exec commands', async t => { + await t.test('with args, dev=true', async t => { + const SCRIPTS = [] + let ARB_ARGS = null + let REIFY_CALLED = false + let ARB_OBJ = null - const { npm } = await loadMockNpm(t, { - '@npmcli/run-script': ({ event }) => { - SCRIPTS.push(event) - }, - '@npmcli/arborist': function (args) { - ARB_ARGS = args - ARB_OBJ = this - this.reify = () => { - REIFY_CALLED = true - } - }, - '../../lib/utils/reify-finish.js': (npm, arb) => { - if (arb !== ARB_OBJ) { - throw new Error('got wrong object passed to reify-finish') - } - }, - }) - - // This is here because CI calls tests with `--ignore-scripts`, which config - // picks up from argv - npm.config.set('ignore-scripts', false) - npm.config.set('audit-level', 'low') - npm.config.set('dev', true) - // tap sets this to - // D:\\a\\cli\\cli\\test\\lib\\commands/tap-testdir-install-should-install-globally-using-Arborist - // which gets normalized elsewhere so comparative tests fail - npm.prefix = path.resolve(t.testdir({})) - - await npm.exec('install', ['fizzbuzz']) + const { npm } = await loadMockNpm(t, { + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '@npmcli/arborist': function (args) { + ARB_ARGS = args + ARB_OBJ = this + this.reify = () => { + REIFY_CALLED = true + } + }, + '../../lib/utils/reify-finish.js': (npm, arb) => { + if (arb !== ARB_OBJ) { + throw new Error('got wrong object passed to reify-finish') + } + }, + }) - t.match( - ARB_ARGS, - { global: false, path: npm.prefix, auditLevel: null }, - 'Arborist gets correct args and ignores auditLevel' - ) - t.equal(REIFY_CALLED, true, 'called reify') - t.strictSame(SCRIPTS, [], 'no scripts when adding dep') -}) + // This is here because CI calls tests with `--ignore-scripts`, which config + // picks up from argv + npm.config.set('ignore-scripts', false) + npm.config.set('audit-level', 'low') + npm.config.set('dev', true) -t.test('without args', async t => { - const SCRIPTS = [] - let ARB_ARGS = null - let REIFY_CALLED = false - let ARB_OBJ = null + await npm.exec('install', ['fizzbuzz']) - const { npm } = await loadMockNpm(t, { - '@npmcli/run-script': ({ event }) => { - SCRIPTS.push(event) - }, - '@npmcli/arborist': function (args) { - ARB_ARGS = args - ARB_OBJ = this - this.reify = () => { - REIFY_CALLED = true - } - }, - '../../lib/utils/reify-finish.js': (npm, arb) => { - if (arb !== ARB_OBJ) { - throw new Error('got wrong object passed to reify-finish') - } - }, + t.match( + ARB_ARGS, + { global: false, path: npm.prefix, auditLevel: null }, + 'Arborist gets correct args and ignores auditLevel' + ) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when adding dep') }) - npm.prefix = path.resolve(t.testdir({})) - npm.config.set('ignore-scripts', false) - await npm.exec('install', []) - t.match(ARB_ARGS, { global: false, path: npm.prefix }) - t.equal(REIFY_CALLED, true, 'called reify') - t.strictSame(SCRIPTS, [ - 'preinstall', - 'install', - 'postinstall', - 'prepublish', - 'preprepare', - 'prepare', - 'postprepare', - ], 'exec scripts when doing local build') -}) + await t.test('without args', async t => { + const SCRIPTS = [] + let ARB_ARGS = null + let REIFY_CALLED = false + let ARB_OBJ = null -t.test('should ignore scripts with --ignore-scripts', async t => { - const SCRIPTS = [] - let REIFY_CALLED = false - const { npm } = await loadMockNpm(t, { - '../../lib/utils/reify-finish.js': async () => {}, - '@npmcli/run-script': ({ event }) => { - SCRIPTS.push(event) - }, - '@npmcli/arborist': function () { - this.reify = () => { - REIFY_CALLED = true - } - }, - }) - npm.config.set('ignore-scripts', true) - npm.prefix = path.resolve(t.testdir({})) - await npm.exec('install', []) - t.equal(REIFY_CALLED, true, 'called reify') - t.strictSame(SCRIPTS, [], 'no scripts when adding dep') -}) + const { npm } = await loadMockNpm(t, { + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '@npmcli/arborist': function (args) { + ARB_ARGS = args + ARB_OBJ = this + this.reify = () => { + REIFY_CALLED = true + } + }, + '../../lib/utils/reify-finish.js': (npm, arb) => { + if (arb !== ARB_OBJ) { + throw new Error('got wrong object passed to reify-finish') + } + }, + }) -t.test('should install globally using Arborist', async t => { - const SCRIPTS = [] - let ARB_ARGS = null - let REIFY_CALLED - const { npm } = await loadMockNpm(t, { - '@npmcli/run-script': ({ event }) => { - SCRIPTS.push(event) - }, - '../../lib/utils/reify-finish.js': async () => {}, - '@npmcli/arborist': function (args) { - ARB_ARGS = args - this.reify = () => { - REIFY_CALLED = true - } - }, + npm.config.set('ignore-scripts', false) + await npm.exec('install', []) + t.match(ARB_ARGS, { global: false, path: npm.prefix }) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', + 'preprepare', + 'prepare', + 'postprepare', + ], 'exec scripts when doing local build') }) - npm.config.set('global', true) - npm.globalPrefix = path.resolve(t.testdir({})) - await npm.exec('install', []) - t.match( - ARB_ARGS, - { global: true, path: npm.globalPrefix } - ) - t.equal(REIFY_CALLED, true, 'called reify') - t.strictSame(SCRIPTS, [], 'no scripts when installing globally') -}) -t.test('should not install invalid global package name', async t => { - const { npm } = await loadMockNpm(t, { - '@npmcli/run-script': () => {}, - '../../lib/utils/reify-finish.js': async () => {}, - '@npmcli/arborist': function (args) { - throw new Error('should not reify') - }, + await t.test('should ignore scripts with --ignore-scripts', async t => { + const SCRIPTS = [] + let REIFY_CALLED = false + const { npm } = await loadMockNpm(t, { + '../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '@npmcli/arborist': function () { + this.reify = () => { + REIFY_CALLED = true + } + }, + }) + npm.config.set('ignore-scripts', true) + await npm.exec('install', []) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when adding dep') }) - npm.config.set('global', true) - npm.globalPrefix = path.resolve(t.testdir({})) - await t.rejects( - npm.exec('install', ['']), - /Usage:/, - 'should not install invalid package name' - ) -}) -t.test('npm i -g npm engines check success', async t => { - const { npm } = await loadMockNpm(t, { - '../../lib/utils/reify-finish.js': async () => {}, - '@npmcli/arborist': function () { - this.reify = () => {} - }, - pacote: { - manifest: () => { - return { - version: '100.100.100', - engines: { - node: '>1', - }, + await t.test('should install globally using Arborist', async t => { + const SCRIPTS = [] + let ARB_ARGS = null + let REIFY_CALLED + const { npm } = await loadMockNpm(t, { + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + '../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/arborist': function (args) { + ARB_ARGS = args + this.reify = () => { + REIFY_CALLED = true } }, - }, + }) + npm.config.set('global', true) + await npm.exec('install', []) + t.match( + ARB_ARGS, + { global: true, path: npm.globalPrefix } + ) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when installing globally') }) - npm.globalDir = t.testdir({}) - npm.config.set('global', true) - await npm.exec('install', ['npm']) - t.ok('No exceptions happen') -}) -t.test('npm i -g npm engines check failure', async t => { - const { npm } = await loadMockNpm(t, { - pacote: { - manifest: () => { - return { - _id: 'npm@1.2.3', - version: '100.100.100', - engines: { - node: '>1000', - }, - } + await t.test('should not install invalid global package name', async t => { + const { npm } = await loadMockNpm(t, { + '@npmcli/run-script': () => {}, + '../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/arborist': function (args) { + throw new Error('should not reify') }, - }, + }) + npm.config.set('global', true) + await t.rejects( + npm.exec('install', ['']), + /Usage:/, + 'should not install invalid package name' + ) }) - npm.globalDir = t.testdir({}) - npm.config.set('global', true) - await t.rejects( - npm.exec('install', ['npm']), - { - message: 'Unsupported engine', - pkgid: 'npm@1.2.3', - current: { - node: process.version, - npm: '100.100.100', + + await t.test('npm i -g npm engines check success', async t => { + const { npm } = await loadMockNpm(t, { + '../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/arborist': function () { + this.reify = () => {} }, - required: { - node: '>1000', + pacote: { + manifest: () => { + return { + version: '100.100.100', + engines: { + node: '>1', + }, + } + }, }, - code: 'EBADENGINE', - } - ) -}) + }) + npm.config.set('global', true) + await npm.exec('install', ['npm']) + t.ok('No exceptions happen') + }) -t.test('npm i -g npm engines check failure forced override', async t => { - const { npm } = await loadMockNpm(t, { - '../../lib/utils/reify-finish.js': async () => {}, - '@npmcli/arborist': function () { - this.reify = () => {} - }, - pacote: { - manifest: () => { - return { - _id: 'npm@1.2.3', - version: '100.100.100', - engines: { - node: '>1000', - }, - } + await t.test('npm i -g npm engines check failure', async t => { + const { npm } = await loadMockNpm(t, { + pacote: { + manifest: () => { + return { + _id: 'npm@1.2.3', + version: '100.100.100', + engines: { + node: '>1000', + }, + } + }, }, - }, + }) + npm.config.set('global', true) + await t.rejects( + npm.exec('install', ['npm']), + { + message: 'Unsupported engine', + pkgid: 'npm@1.2.3', + current: { + node: process.version, + npm: '100.100.100', + }, + required: { + node: '>1000', + }, + code: 'EBADENGINE', + } + ) }) - npm.globalDir = t.testdir({}) - npm.config.set('global', true) - npm.config.set('force', true) - await npm.exec('install', ['npm']) - t.ok('Does not throw') -}) -t.test('npm i -g npm@version engines check failure', async t => { - const { npm } = await loadMockNpm(t, { - pacote: { - manifest: () => { - return { - _id: 'npm@1.2.3', - version: '100.100.100', - engines: { - node: '>1000', - }, - } + await t.test('npm i -g npm engines check failure forced override', async t => { + const { npm } = await loadMockNpm(t, { + '../../lib/utils/reify-finish.js': async () => {}, + '@npmcli/arborist': function () { + this.reify = () => {} }, - }, - }) - npm.globalDir = t.testdir({}) - npm.config.set('global', true) - await t.rejects( - npm.exec('install', ['npm@100']), - { - message: 'Unsupported engine', - pkgid: 'npm@1.2.3', - current: { - node: process.version, - npm: '100.100.100', + pacote: { + manifest: () => { + return { + _id: 'npm@1.2.3', + version: '100.100.100', + engines: { + node: '>1000', + }, + } + }, }, - required: { - node: '>1000', + }) + npm.config.set('global', true) + npm.config.set('force', true) + await npm.exec('install', ['npm']) + t.ok('Does not throw') + }) + + await t.test('npm i -g npm@version engines check failure', async t => { + const { npm } = await loadMockNpm(t, { + pacote: { + manifest: () => { + return { + _id: 'npm@1.2.3', + version: '100.100.100', + engines: { + node: '>1000', + }, + } + }, }, - code: 'EBADENGINE', - } - ) + }) + npm.config.set('global', true) + await t.rejects( + npm.exec('install', ['npm@100']), + { + message: 'Unsupported engine', + pkgid: 'npm@1.2.3', + current: { + node: process.version, + npm: '100.100.100', + }, + required: { + node: '>1000', + }, + code: 'EBADENGINE', + } + ) + }) }) t.test('completion', async t => { diff --git a/test/lib/npm.js b/test/lib/npm.js index 62e48ce6050db..d9201c8a6aa92 100644 --- a/test/lib/npm.js +++ b/test/lib/npm.js @@ -52,7 +52,7 @@ t.test('not yet loaded', async t => { }) t.test('npm.load', async t => { - t.test('load error', async t => { + await t.test('load error', async t => { const { npm } = await loadMockNpm(t, { load: false }) const loadError = new Error('load error') npm.config.load = async () => { @@ -75,9 +75,12 @@ t.test('npm.load', async t => { t.equal(npm.loadErr, loadError) }) - t.test('basic loading', async t => { - const { npm, logs, prefix: dir, cache } = await loadMockNpm(t, { + await t.test('basic loading', async t => { + const { npm, logs, prefix: dir, cache, other } = await loadMockNpm(t, { prefixDir: { node_modules: {} }, + otherDirs: { + newCache: {}, + }, }) t.equal(npm.loaded, true) @@ -94,10 +97,9 @@ t.test('npm.load', async t => { mockGlobals(t, { process: { platform: 'posix' } }) t.equal(resolve(npm.cache), resolve(cache), 'cache is cache') - const newCache = t.testdir() - npm.cache = newCache - t.equal(npm.config.get('cache'), newCache, 'cache setter sets config') - t.equal(npm.cache, newCache, 'cache getter gets new config') + npm.cache = other.newCache + t.equal(npm.config.get('cache'), other.newCache, 'cache setter sets config') + t.equal(npm.cache, other.newCache, 'cache getter gets new config') t.equal(npm.lockfileVersion, 2, 'lockfileVersion getter') t.equal(npm.prefix, npm.localPrefix, 'prefix is local prefix') t.not(npm.prefix, npm.globalPrefix, 'prefix is not global prefix') @@ -138,7 +140,7 @@ t.test('npm.load', async t => { t.equal(tmp, npm.tmp, 'getter only generates it once') }) - t.test('forceful loading', async t => { + await t.test('forceful loading', async t => { const { logs } = await loadMockNpm(t, { globals: { 'process.argv': [...process.argv, '--force', '--color', 'always'], @@ -152,7 +154,7 @@ t.test('npm.load', async t => { ]) }) - t.test('node is a symlink', async t => { + await t.test('node is a symlink', async t => { const node = process.platform === 'win32' ? 'node.exe' : 'node' const { npm, logs, outputs, prefix } = await loadMockNpm(t, { prefixDir: { @@ -227,7 +229,7 @@ t.test('npm.load', async t => { t.same(outputs, [['scope=@foo\n\u2010not-a-dash=undefined']]) }) - t.test('--no-workspaces with --workspace', async t => { + await t.test('--no-workspaces with --workspace', async t => { const { npm } = await loadMockNpm(t, { load: false, prefixDir: { @@ -262,7 +264,7 @@ t.test('npm.load', async t => { ) }) - t.test('workspace-aware configs and commands', async t => { + await t.test('workspace-aware configs and commands', async t => { const { npm, outputs } = await loadMockNpm(t, { prefixDir: { packages: { @@ -318,7 +320,7 @@ t.test('npm.load', async t => { ) }) - t.test('workspaces in global mode', async t => { + await t.test('workspaces in global mode', async t => { const { npm } = await loadMockNpm(t, { prefixDir: { packages: { From 412cbabc64f8a94a8bd85c562b12c908295264db Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:30:11 -0700 Subject: [PATCH 122/175] chore: make npm a prerelease --- release-please-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index 3e43348c7a588..d3daf7bff46e6 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -30,10 +30,10 @@ "hidden": true } ], - "packages": { ".": { - "package-name": "" + "package-name": "", + "prerelease": true }, "workspaces/arborist": { "prerelease": true From 2e9280072f9852466fa0944d3a0fdb0c8af156a9 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:50:33 -0700 Subject: [PATCH 123/175] feat: remove `npm bin` (#5459) BREAKING CHANGE: this removes the `npm bin` command The output of this command is misleading and incomplete. The `.bin` resolution of npm is much more nuanced than this command implies, and the output of `npm bin` is not something end users should be dealing with. `npm` itself is responsible for running the `bin` entries of modules, with the exception of global bins, which end up in the same folder as `node` itself, presumably already in a user's path since they can run node. Closes https://github.com/npm/statusboard/issues/537 --- lib/commands/bin.js | 23 ------------- lib/utils/cmd-list.js | 1 - .../tap-snapshots/test/index.js.test.cjs | 2 +- .../test/lib/commands/completion.js.test.cjs | 1 - .../test/lib/load-all-commands.js.test.cjs | 12 ------- tap-snapshots/test/lib/npm.js.test.cjs | 18 +++-------- .../test/lib/utils/cmd-list.js.test.cjs | 4 +-- test/lib/commands/bin.js | 32 ------------------- 8 files changed, 6 insertions(+), 87 deletions(-) delete mode 100644 lib/commands/bin.js delete mode 100644 test/lib/commands/bin.js diff --git a/lib/commands/bin.js b/lib/commands/bin.js deleted file mode 100644 index 9ba3cb4003241..0000000000000 --- a/lib/commands/bin.js +++ /dev/null @@ -1,23 +0,0 @@ -const log = require('../utils/log-shim.js') -const BaseCommand = require('../base-command.js') -// TODO this may not be needed at all. Ignoring because our tests normalize -// process.env.path already -/* istanbul ignore next */ -const path = process.env.path || process.env.Path || process.env.PATH -const { delimiter } = require('path') - -class Bin extends BaseCommand { - static description = 'Display npm bin folder' - static name = 'bin' - static params = ['global'] - static ignoreImplicitWorkspace = true - - async exec (args) { - const b = this.npm.bin - this.npm.output(b) - if (this.npm.global && !path.split(delimiter).includes(b)) { - log.error('bin', '(not in PATH env variable)') - } - } -} -module.exports = Bin diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js index 38439542a21f9..4dca7df2d304b 100644 --- a/lib/utils/cmd-list.js +++ b/lib/utils/cmd-list.js @@ -74,7 +74,6 @@ const cmdList = [ 'access', 'adduser', 'audit', - 'bin', 'bugs', 'cache', 'ci', diff --git a/smoke-tests/tap-snapshots/test/index.js.test.cjs b/smoke-tests/tap-snapshots/test/index.js.test.cjs index 68145ce52b12e..6b0b7b3940605 100644 --- a/smoke-tests/tap-snapshots/test/index.js.test.cjs +++ b/smoke-tests/tap-snapshots/test/index.js.test.cjs @@ -21,7 +21,7 @@ npm help npm more involved overview All commands: - access, adduser, audit, bin, bugs, cache, ci, completion, + access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, diff --git a/tap-snapshots/test/lib/commands/completion.js.test.cjs b/tap-snapshots/test/lib/commands/completion.js.test.cjs index f08ef0f37c360..6bd7901e205fb 100644 --- a/tap-snapshots/test/lib/commands/completion.js.test.cjs +++ b/tap-snapshots/test/lib/commands/completion.js.test.cjs @@ -47,7 +47,6 @@ Array [ access adduser audit - bin bugs cache ci diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index eac037f4b2708..6ea63931ce874 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -57,18 +57,6 @@ Options: Run "npm help audit" for more info ` -exports[`test/lib/load-all-commands.js TAP load each command bin > must match snapshot 1`] = ` -Display npm bin folder - -Usage: -npm bin - -Options: -[-g|--global] - -Run "npm help bin" for more info -` - exports[`test/lib/load-all-commands.js TAP load each command birthday > must match snapshot 1`] = ` Birthday, deprecated diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs index 094792afd5620..fcd167742b442 100644 --- a/tap-snapshots/test/lib/npm.js.test.cjs +++ b/tap-snapshots/test/lib/npm.js.test.cjs @@ -21,7 +21,7 @@ npm help npm more involved overview All commands: - access, adduser, audit, bin, bugs, cache, ci, completion, + access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, @@ -57,7 +57,7 @@ npm help npm more involved overview All commands: - access, adduser, audit, bin, bugs, cache, ci, completion, + access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, @@ -93,7 +93,7 @@ npm help npm more involved overview All commands: - access, adduser, audit, bin, bugs, cache, ci, completion, + access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, @@ -129,7 +129,7 @@ npm help npm more involved overview (in a browser) All commands: - access, adduser, audit, bin, bugs, cache, ci, completion, + access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, @@ -211,16 +211,6 @@ All commands: Run "npm help audit" for more info - bin Display npm bin folder - - Usage: - npm bin - - Options: - [-g|--global] - - Run "npm help bin" for more info - bugs Report bugs for a package in a web browser Usage: diff --git a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs index dd0df9b868c7a..e88cf67fa54e7 100644 --- a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs +++ b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs @@ -30,8 +30,7 @@ Object { "auth": "author", "autho": "author", "author": "author", - "bi": "bin", - "bin": "bin", + "b": "bugs", "bu": "bugs", "bug": "bugs", "bugs": "bugs", @@ -418,7 +417,6 @@ Object { "access", "adduser", "audit", - "bin", "bugs", "cache", "ci", diff --git a/test/lib/commands/bin.js b/test/lib/commands/bin.js deleted file mode 100644 index 46170e765de82..0000000000000 --- a/test/lib/commands/bin.js +++ /dev/null @@ -1,32 +0,0 @@ -const t = require('tap') -const { load: loadMockNpm } = require('../../fixtures/mock-npm') -const mockGlobals = require('../../fixtures/mock-globals') - -t.test('bin not global', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.localBin) - t.match(logs.error, []) -}) - -t.test('bin global in env.path', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t, { - config: { global: true }, - }) - - mockGlobals(t, { - 'process.env': { path: npm.globalBin }, - }) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.globalBin) - t.match(logs.error, []) -}) - -t.test('bin not in path', async t => { - const { npm, joinedOutput, logs } = await loadMockNpm(t, { - config: { global: true }, - }) - await npm.exec('bin', []) - t.match(joinedOutput(), npm.globalBin) - t.match(logs.error, [['bin', '(not in PATH env variable)']]) -}) From 2a8c2fcd124ce7d4b23a6c26552d097c6501ac74 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:51:08 -0700 Subject: [PATCH 124/175] feat: default `install-links` to true (#5458) BREAKING CHANGE: this changes the default value of `install-links` to true Closes https://github.com/npm/statusboard/issues/510 --- docs/content/commands/npm-audit.md | 2 +- docs/content/commands/npm-ci.md | 2 +- docs/content/commands/npm-dedupe.md | 2 +- docs/content/commands/npm-find-dupes.md | 2 +- docs/content/commands/npm-install-ci-test.md | 2 +- docs/content/commands/npm-install-test.md | 2 +- docs/content/commands/npm-install.md | 2 +- docs/content/commands/npm-link.md | 2 +- docs/content/commands/npm-ls.md | 2 +- docs/content/commands/npm-prune.md | 2 +- docs/content/commands/npm-rebuild.md | 2 +- docs/content/commands/npm-uninstall.md | 2 +- docs/content/commands/npm-update.md | 2 +- docs/content/using-npm/config.md | 2 +- lib/utils/config/definitions.js | 2 +- .../tap-snapshots/test/index.js.test.cjs | 2 +- .../test/lib/commands/config.js.test.cjs | 4 +-- .../test/lib/load-all-commands.js.test.cjs | 28 +++++++++---------- tap-snapshots/test/lib/npm.js.test.cjs | 28 +++++++++---------- .../lib/utils/config/definitions.js.test.cjs | 2 +- .../lib/utils/config/describe-all.js.test.cjs | 2 +- 21 files changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/content/commands/npm-audit.md b/docs/content/commands/npm-audit.md index 48e0a3161e8f2..6a5c3e6be676e 100644 --- a/docs/content/commands/npm-audit.md +++ b/docs/content/commands/npm-audit.md @@ -453,7 +453,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-ci.md b/docs/content/commands/npm-ci.md index 3ecd7c6efb095..af6fc7fcc94e8 100644 --- a/docs/content/commands/npm-ci.md +++ b/docs/content/commands/npm-ci.md @@ -361,7 +361,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-dedupe.md b/docs/content/commands/npm-dedupe.md index 570e018342f27..da9f406d57024 100644 --- a/docs/content/commands/npm-dedupe.md +++ b/docs/content/commands/npm-dedupe.md @@ -308,7 +308,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-find-dupes.md b/docs/content/commands/npm-find-dupes.md index 4da6c296c6bf6..590c7e2cbd438 100644 --- a/docs/content/commands/npm-find-dupes.md +++ b/docs/content/commands/npm-find-dupes.md @@ -232,7 +232,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-install-ci-test.md b/docs/content/commands/npm-install-ci-test.md index b886f8ab9599a..784efdcf46e95 100644 --- a/docs/content/commands/npm-install-ci-test.md +++ b/docs/content/commands/npm-install-ci-test.md @@ -307,7 +307,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-install-test.md b/docs/content/commands/npm-install-test.md index d27686e731ce1..ec69e081f9dee 100644 --- a/docs/content/commands/npm-install-test.md +++ b/docs/content/commands/npm-install-test.md @@ -308,7 +308,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-install.md b/docs/content/commands/npm-install.md index d6ae4324ecefc..0cf2eea83edb9 100644 --- a/docs/content/commands/npm-install.md +++ b/docs/content/commands/npm-install.md @@ -698,7 +698,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md index 8c1b422493bd5..fd6eb69e9b03c 100644 --- a/docs/content/commands/npm-link.md +++ b/docs/content/commands/npm-link.md @@ -384,7 +384,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md index a7936fafc72a2..bb7fd5cc06f79 100644 --- a/docs/content/commands/npm-ls.md +++ b/docs/content/commands/npm-ls.md @@ -287,7 +287,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-prune.md b/docs/content/commands/npm-prune.md index 28f02f6add190..064b0e07e4e7a 100644 --- a/docs/content/commands/npm-prune.md +++ b/docs/content/commands/npm-prune.md @@ -193,7 +193,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-rebuild.md b/docs/content/commands/npm-rebuild.md index 6a396421213d3..89fbd763555a0 100644 --- a/docs/content/commands/npm-rebuild.md +++ b/docs/content/commands/npm-rebuild.md @@ -163,7 +163,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-uninstall.md b/docs/content/commands/npm-uninstall.md index e39c7e328b20a..bea7112ae5719 100644 --- a/docs/content/commands/npm-uninstall.md +++ b/docs/content/commands/npm-uninstall.md @@ -147,7 +147,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/commands/npm-update.md b/docs/content/commands/npm-update.md index 421d04ca3dc58..cd77b7baddf19 100644 --- a/docs/content/commands/npm-update.md +++ b/docs/content/commands/npm-update.md @@ -435,7 +435,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index cd13237f34dd3..e6a7231861ba0 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -910,7 +910,7 @@ number, if not already set in package.json. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index a132c8456b0fa..a76484b5228f5 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -1083,7 +1083,7 @@ define('init.version', { }) define('install-links', { - default: false, + default: true, type: Boolean, description: ` When set file: protocol dependencies that exist outside of the project root diff --git a/smoke-tests/tap-snapshots/test/index.js.test.cjs b/smoke-tests/tap-snapshots/test/index.js.test.cjs index 6b0b7b3940605..f7e49ed91e1d2 100644 --- a/smoke-tests/tap-snapshots/test/index.js.test.cjs +++ b/smoke-tests/tap-snapshots/test/index.js.test.cjs @@ -61,7 +61,7 @@ npm ERR! [--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 ...]] -npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links] +npm ERR! [-ws|--workspaces] [--include-workspace-root] [--no-install-links] npm ERR! npm ERR! aliases: clean-install, ic, install-clean, isntall-clean npm ERR! diff --git a/tap-snapshots/test/lib/commands/config.js.test.cjs b/tap-snapshots/test/lib/commands/config.js.test.cjs index 5c3f86415dfff..6ed14ae5b2546 100644 --- a/tap-snapshots/test/lib/commands/config.js.test.cjs +++ b/tap-snapshots/test/lib/commands/config.js.test.cjs @@ -81,7 +81,7 @@ exports[`test/lib/commands/config.js TAP config list --json > output matches sna "init.license": "ISC", "init.module": "{HOME}/.npm-init.js", "init.version": "1.0.0", - "install-links": false, + "install-links": true, "key": null, "legacy-bundling": false, "legacy-peer-deps": false, @@ -237,7 +237,7 @@ init.author.url = "" init.license = "ISC" init.module = "{HOME}/.npm-init.js" init.version = "1.0.0" -install-links = false +install-links = true json = false key = null legacy-bundling = false diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 6ea63931ce874..ad7acd359b984 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -52,7 +52,7 @@ Options: [--omit [--omit ...]] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help audit" for more info ` @@ -110,7 +110,7 @@ Options: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: clean-install, ic, install-clean, isntall-clean @@ -156,7 +156,7 @@ Options: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: ddp @@ -305,7 +305,7 @@ Options: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help find-dupes" for more info ` @@ -404,7 +404,7 @@ Options: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall @@ -424,7 +424,7 @@ Options: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: cit @@ -444,7 +444,7 @@ Options: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: it @@ -464,7 +464,7 @@ Options: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: ln @@ -482,7 +482,7 @@ Options: [--omit [--omit ...]] [--link] [--package-lock-only] [--unicode] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: la @@ -527,7 +527,7 @@ Options: [--omit [--omit ...]] [--link] [--package-lock-only] [--unicode] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: list @@ -662,7 +662,7 @@ Options: [--omit [--omit ...]] [--dry-run] [--json] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help prune" for more info ` @@ -704,7 +704,7 @@ npm rebuild [] ...] Options: [-g|--global] [--no-bin-links] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: rb @@ -914,7 +914,7 @@ npm uninstall [<@scope>/]... Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: unlink, remove, rm, r, un @@ -960,7 +960,7 @@ Options: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] -[-ws|--workspaces] [--include-workspace-root] [--install-links] +[-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: up, upgrade, udpate diff --git a/tap-snapshots/test/lib/npm.js.test.cjs b/tap-snapshots/test/lib/npm.js.test.cjs index fcd167742b442..a728654a51d43 100644 --- a/tap-snapshots/test/lib/npm.js.test.cjs +++ b/tap-snapshots/test/lib/npm.js.test.cjs @@ -207,7 +207,7 @@ All commands: [--omit [--omit ...]] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help audit" for more info @@ -250,7 +250,7 @@ All commands: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: clean-install, ic, install-clean, isntall-clean @@ -290,7 +290,7 @@ All commands: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: ddp @@ -419,7 +419,7 @@ All commands: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help find-dupes" for more info @@ -494,7 +494,7 @@ All commands: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall @@ -512,7 +512,7 @@ All commands: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: cit @@ -530,7 +530,7 @@ All commands: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: it @@ -548,7 +548,7 @@ All commands: [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: ln @@ -564,7 +564,7 @@ All commands: [--omit [--omit ...]] [--link] [--package-lock-only] [--unicode] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: la @@ -603,7 +603,7 @@ All commands: [--omit [--omit ...]] [--link] [--package-lock-only] [--unicode] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: list @@ -720,7 +720,7 @@ All commands: [--omit [--omit ...]] [--dry-run] [--json] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] Run "npm help prune" for more info @@ -756,7 +756,7 @@ All commands: Options: [-g|--global] [--no-bin-links] [--foreground-scripts] [--ignore-scripts] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] alias: rb @@ -934,7 +934,7 @@ All commands: Options: [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: unlink, remove, rm, r, un @@ -974,7 +974,7 @@ All commands: [--strict-peer-deps] [--no-package-lock] [--foreground-scripts] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] - [-ws|--workspaces] [--include-workspace-root] [--install-links] + [-ws|--workspaces] [--include-workspace-root] [--no-install-links] aliases: up, upgrade, udpate diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index 024ad345a5d32..6eac545b2ce2d 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -983,7 +983,7 @@ Alias for \`--init-version\` exports[`test/lib/utils/config/definitions.js TAP > config description for install-links 1`] = ` #### \`install-links\` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index a03d22e5e6305..46910d1282e03 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -783,7 +783,7 @@ number, if not already set in package.json. #### \`install-links\` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root From 926f0adbd71949c905932a241a245b78c85ef643 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Sep 2022 09:51:57 -0700 Subject: [PATCH 125/175] feat: remove `npm set-script` (#5456) BREAKING CHANGE: this removes `npm set-script` Folks should use `npm pkg set` to set the `scripts` field in their `package.json` Closes https://github.com/npm/statusboard/issues/449 --- lib/commands/set-script.js | 96 --------- lib/utils/cmd-list.js | 1 - .../tap-snapshots/test/index.js.test.cjs | 38 ++-- smoke-tests/test/index.js | 4 +- .../test/lib/commands/completion.js.test.cjs | 1 - .../test/lib/load-all-commands.js.test.cjs | 13 -- tap-snapshots/test/lib/npm.js.test.cjs | 35 ++-- .../test/lib/utils/cmd-list.js.test.cjs | 8 - test/lib/commands/set-script.js | 188 ------------------ 9 files changed, 33 insertions(+), 351 deletions(-) delete mode 100644 lib/commands/set-script.js delete mode 100644 test/lib/commands/set-script.js diff --git a/lib/commands/set-script.js b/lib/commands/set-script.js deleted file mode 100644 index a085f72a31428..0000000000000 --- a/lib/commands/set-script.js +++ /dev/null @@ -1,96 +0,0 @@ -const { resolve } = require('path') -const rpj = require('read-package-json-fast') -const PackageJson = require('@npmcli/package-json') -const log = require('../utils/log-shim') - -const BaseCommand = require('../base-command.js') -class SetScript extends BaseCommand { - static description = 'Set tasks in the scripts section of package.json, deprecated' - static params = ['workspace', 'workspaces', 'include-workspace-root'] - static name = 'set-script' - static usage = ['[