diff options
author | Luke Karrys <luke@lukekarrys.com> | 2021-09-30 23:56:06 +0300 |
---|---|---|
committer | Luke Karrys <luke@lukekarrys.com> | 2021-10-01 00:03:25 +0300 |
commit | 827494cf12921b40cac8614027b7a4388d7ecbda (patch) | |
tree | ae5d6f78c13ed6103e32b95dca2795d0908f3641 /node_modules/@npmcli | |
parent | d7d5dd6aa66251805afd9009e3978f61ea732f05 (diff) |
Revert "deps: arborist@2.10.0"
This reverts commit 8349c3c1557ac52973ad08c10db492e3a5a30204.
PR-URL: https://github.com/npm/cli/pull/3817
Credit: @lukekarrys
Close: #3817
Reviewed-by: @wraithgar
Diffstat (limited to 'node_modules/@npmcli')
6 files changed, 10 insertions, 75 deletions
diff --git a/node_modules/@npmcli/arborist/lib/arborist/audit.js b/node_modules/@npmcli/arborist/lib/arborist/audit.js index eb4a35655..c0cd79bb1 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/audit.js +++ b/node_modules/@npmcli/arborist/lib/arborist/audit.js @@ -5,7 +5,6 @@ const AuditReport = require('../audit-report.js') // shared with reify const _global = Symbol.for('global') const _workspaces = Symbol.for('workspaces') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') module.exports = cls => class Auditor extends cls { async audit (options = {}) { @@ -24,15 +23,7 @@ module.exports = cls => class Auditor extends cls { process.emit('time', 'audit') const tree = await this.loadVirtual() if (this[_workspaces] && this[_workspaces].length) { - options.filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) - } - if (!options.workspacesEnabled) { - options.filterSet = - this.excludeWorkspacesDependencySet(tree) + options.filterSet = this.workspaceDependencySet(tree, this[_workspaces]) } this.auditReport = await AuditReport.load(tree, options) const ret = options.fix ? this.reify(options) : this.auditReport diff --git a/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index 3e6a9838f..b7876b114 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -93,7 +93,6 @@ const _checkEngine = Symbol('checkEngine') const _checkPlatform = Symbol('checkPlatform') const _virtualRoots = Symbol('virtualRoots') const _virtualRoot = Symbol('virtualRoot') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _failPeerConflict = Symbol('failPeerConflict') const _explainPeerConflict = Symbol('explainPeerConflict') @@ -116,13 +115,12 @@ module.exports = cls => class IdealTreeBuilder extends cls { options.registry = this.registry = registry.replace(/\/+$/, '') + '/' const { - follow = false, - force = false, + idealTree = null, global = false, + follow = false, globalStyle = false, - idealTree = null, - includeWorkspaceRoot = false, legacyPeerDeps = false, + force = false, packageLock = true, strictPeerDeps = false, workspaces = [], @@ -164,8 +162,6 @@ module.exports = cls => class IdealTreeBuilder extends cls { // don't hold onto references for nodes that are garbage collected. this[_peerSetSource] = new WeakMap() this[_virtualRoots] = new Map() - - this[_includeWorkspaceRoot] = includeWorkspaceRoot } get explicitRequests () { @@ -398,14 +394,8 @@ module.exports = cls => class IdealTreeBuilder extends cls { if (!this[_workspaces].length) { await this[_applyUserRequestsToNode](tree, options) } else { - const nodes = this.workspaceNodes(tree, this[_workspaces]) - if (this[_includeWorkspaceRoot]) { - nodes.push(tree) - } - const appliedRequests = nodes.map( - node => this[_applyUserRequestsToNode](node, options) - ) - await Promise.all(appliedRequests) + await Promise.all(this.workspaceNodes(tree, this[_workspaces]) + .map(node => this[_applyUserRequestsToNode](node, options))) } process.emit('timeEnd', 'idealTree:userRequests') diff --git a/node_modules/@npmcli/arborist/lib/arborist/index.js b/node_modules/@npmcli/arborist/lib/arborist/index.js index ccfa7cad9..d8ca67faa 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/index.js +++ b/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -58,7 +58,6 @@ class Arborist extends Base { cache: options.cache || `${homedir()}/.npm/_cacache`, packumentCache: options.packumentCache || new Map(), log: options.log || procLog, - workspacesEnabled: options.workspacesEnabled !== false, } if (options.saveType && !saveTypeMap.get(options.saveType)) { throw new Error(`Invalid saveType ${options.saveType}`) @@ -74,15 +73,8 @@ class Arborist extends Base { } // returns a set of workspace nodes and all their deps - workspaceDependencySet (tree, workspaces, includeWorkspaceRoot) { + workspaceDependencySet (tree, workspaces) { const wsNodes = this.workspaceNodes(tree, workspaces) - if (includeWorkspaceRoot) { - for (const edge of tree.edgesOut.values()) { - if (edge.type !== 'workspace' && edge.to) { - wsNodes.push(edge.to) - } - } - } const set = new Set(wsNodes) const extraneous = new Set() for (const node of set) { @@ -104,25 +96,6 @@ class Arborist extends Base { for (const extra of extraneous) { set.add(extra) } - - return set - } - - excludeWorkspacesDependencySet (tree) { - const set = new Set() - for (const edge of tree.edgesOut.values()) { - if (edge.type !== 'workspace' && edge.to) { - set.add(edge.to) - } - } - for (const node of set) { - for (const edge of node.edgesOut.values()) { - if (edge.to) { - set.add(edge.to) - } - } - } - return set } } diff --git a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js index 6fa5c0011..e48bdd76b 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +++ b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -34,7 +34,6 @@ const _addToBuildSet = Symbol('addToBuildSet') const _checkBins = Symbol.for('checkBins') const _queues = Symbol('queues') const _scriptShell = Symbol('scriptShell') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _force = Symbol.for('force') @@ -78,11 +77,7 @@ module.exports = cls => class Builder extends cls { if (!nodes) { const tree = await this.loadActual() if (this[_workspaces] && this[_workspaces].length) { - const filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) + const filterSet = this.workspaceDependencySet(tree, this[_workspaces]) nodes = tree.inventory.filter(node => filterSet.has(node)) } else { nodes = tree.inventory.values() diff --git a/node_modules/@npmcli/arborist/lib/arborist/reify.js b/node_modules/@npmcli/arborist/lib/arborist/reify.js index a279d8956..3a9c47974 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -83,7 +83,6 @@ const _validateNodeModules = Symbol('validateNodeModules') const _nmValidated = Symbol('nmValidated') const _validatePath = Symbol('validatePath') const _reifyPackages = Symbol.for('reifyPackages') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _omitDev = Symbol('omitDev') const _omitOptional = Symbol('omitOptional') @@ -341,15 +340,6 @@ module.exports = cls => class Reifier extends cls { filterNodes.push(actual) } } - if (this[_includeWorkspaceRoot] && (this[_workspaces].length > 0)) { - for (const tree of [this.idealTree, this.actualTree]) { - for (const {type, to} of tree.edgesOut.values()) { - if (type !== 'workspace' && to) { - filterNodes.push(to) - } - } - } - } } // find all the nodes that need to change between the actual @@ -911,11 +901,7 @@ module.exports = cls => class Reifier extends cls { // if we're operating on a workspace, only audit the workspace deps if (this[_workspaces] && this[_workspaces].length) { - options.filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) + options.filterSet = this.workspaceDependencySet(tree, this[_workspaces]) } this.auditReport = AuditReport.load(tree, options) diff --git a/node_modules/@npmcli/arborist/package.json b/node_modules/@npmcli/arborist/package.json index f912d2af1..b39818d48 100644 --- a/node_modules/@npmcli/arborist/package.json +++ b/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "2.10.0", + "version": "2.9.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.0.1", |