@npmcli/arborist 6.2.2 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1243,7 +1243,7 @@ This is a one-time fix-up, please be patient...
1243
1243
  if (isWorkspace) {
1244
1244
  const existingNode = this.idealTree.edgesOut.get(spec.name).to
1245
1245
  if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) {
1246
- return edge.to
1246
+ return existingNode
1247
1247
  }
1248
1248
  }
1249
1249
 
@@ -89,7 +89,6 @@ module.exports = cls => class Builder extends cls {
89
89
  const {
90
90
  depNodes,
91
91
  linkNodes,
92
- storeNodes,
93
92
  } = this[_retrieveNodesByType](nodes)
94
93
 
95
94
  // build regular deps
@@ -100,10 +99,6 @@ module.exports = cls => class Builder extends cls {
100
99
  this[_resetQueues]()
101
100
  await this[_build](linkNodes, { type: 'links' })
102
101
  }
103
- if (storeNodes.size) {
104
- this[_resetQueues]()
105
- await this[_build](storeNodes, { type: 'storelinks' })
106
- }
107
102
 
108
103
  process.emit('timeEnd', 'build')
109
104
  }
@@ -146,6 +141,12 @@ module.exports = cls => class Builder extends cls {
146
141
  depNodes.add(node)
147
142
  }
148
143
  }
144
+ // Make sure that store linked nodes are processed last.
145
+ // We can't process store links separately or else lifecycle scripts on
146
+ // standard nodes might not have bin links yet.
147
+ for (const node of storeNodes) {
148
+ depNodes.add(node)
149
+ }
149
150
 
150
151
  // deduplicates link nodes and their targets, avoids
151
152
  // calling lifecycle scripts twice when running `npm rebuild`
@@ -162,7 +163,6 @@ module.exports = cls => class Builder extends cls {
162
163
  return {
163
164
  depNodes,
164
165
  linkNodes,
165
- storeNodes,
166
166
  }
167
167
  }
168
168
 
@@ -330,10 +330,12 @@ module.exports = cls => class Builder extends cls {
330
330
  devOptional,
331
331
  package: pkg,
332
332
  location,
333
+ isStoreLink,
333
334
  } = node.target
334
335
 
335
336
  // skip any that we know we'll be deleting
336
- if (this[_trashList].has(path)) {
337
+ // or storeLinks
338
+ if (this[_trashList].has(path) || isStoreLink) {
337
339
  return
338
340
  }
339
341
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "6.2.2",
3
+ "version": "6.2.4",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@isaacs/string-locale-compare": "^1.1.0",
7
7
  "@npmcli/fs": "^3.1.0",
8
- "@npmcli/installed-package-contents": "^2.0.0",
8
+ "@npmcli/installed-package-contents": "^2.0.2",
9
9
  "@npmcli/map-workspaces": "^3.0.2",
10
10
  "@npmcli/metavuln-calculator": "^5.0.0",
11
11
  "@npmcli/name-from-folder": "^2.0.0",