@npmcli/arborist 2.7.1 → 2.8.0

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.
package/lib/printable.js CHANGED
@@ -31,6 +31,10 @@ class ArboristNode {
31
31
  this.bundled = true
32
32
  if (tree.inDepBundle)
33
33
  this.bundler = tree.getBundler().location
34
+ if (tree.isProjectRoot)
35
+ this.isProjectRoot = true
36
+ if (tree.isWorkspace)
37
+ this.isWorkspace = true
34
38
  const bd = tree.package && tree.package.bundleDependencies
35
39
  if (bd && bd.length)
36
40
  this.bundleDependencies = bd
@@ -107,6 +111,8 @@ class Edge {
107
111
  this.spec = edge.spec || '*'
108
112
  if (edge.error)
109
113
  this.error = edge.error
114
+ if (edge.overridden)
115
+ this.overridden = edge.overridden
110
116
  }
111
117
  }
112
118
 
@@ -122,6 +128,8 @@ class EdgeOut extends Edge {
122
128
  this.to ? ' -> ' + this.to : ''
123
129
  }${
124
130
  this.error ? ' ' + this.error : ''
131
+ }${
132
+ this.overridden ? ' overridden' : ''
125
133
  } }`
126
134
  }
127
135
  }
@@ -136,6 +144,8 @@ class EdgeIn extends Edge {
136
144
  [util.inspect.custom] () {
137
145
  return `{ ${this.from || '""'} ${this.type} ${this.name}@${this.spec}${
138
146
  this.error ? ' ' + this.error : ''
147
+ }${
148
+ this.overridden ? ' overridden' : ''
139
149
  } }`
140
150
  }
141
151
  }
package/lib/shrinkwrap.js CHANGED
@@ -183,8 +183,10 @@ const assertNoNewer = async (path, data, lockTime, dir = path, seen = null) => {
183
183
  await assertNoNewer(path, data, lockTime, child, seen)
184
184
  else if (ent.isSymbolicLink()) {
185
185
  const target = resolve(parent, await readlink(child))
186
- const tstat = await stat(target).catch(() => null)
186
+ const tstat = await stat(target).catch(
187
+ /* istanbul ignore next - windows */ () => null)
187
188
  seen.add(relpath(path, child))
189
+ /* istanbul ignore next - windows cannot do this */
188
190
  if (tstat && tstat.isDirectory() && !seen.has(relpath(path, target)))
189
191
  await assertNoNewer(path, data, lockTime, target, seen)
190
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@npmcli/installed-package-contents": "^1.0.7",
@@ -19,10 +19,10 @@
19
19
  "mkdirp": "^1.0.4",
20
20
  "mkdirp-infer-owner": "^2.0.0",
21
21
  "npm-install-checks": "^4.0.0",
22
- "npm-package-arg": "^8.1.0",
22
+ "npm-package-arg": "^8.1.5",
23
23
  "npm-pick-manifest": "^6.1.0",
24
24
  "npm-registry-fetch": "^11.0.0",
25
- "pacote": "^11.2.6",
25
+ "pacote": "^11.3.5",
26
26
  "parse-conflict-json": "^1.1.1",
27
27
  "proc-log": "^1.0.0",
28
28
  "promise-all-reject-late": "^1.0.0",
@@ -53,7 +53,7 @@
53
53
  "test-only": "tap",
54
54
  "posttest": "npm run lint",
55
55
  "snap": "tap",
56
- "postsnap": "npm run lint",
56
+ "postsnap": "npm run lintfix",
57
57
  "test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
58
58
  "preversion": "npm test",
59
59
  "postversion": "npm publish",
package/lib/peer-set.js DELETED
@@ -1,25 +0,0 @@
1
- // when we have to dupe a set of peer dependencies deeper into the tree in
2
- // order to make room for a dep that would otherwise conflict, we use
3
- // this to get the set of all deps that have to be checked to ensure
4
- // nothing is locking them into the current location.
5
- //
6
- // this is different in its semantics from an "optional set" (ie, the nodes
7
- // that should be removed if an optional dep fails), because in this case,
8
- // we specifically intend to include deps in the peer set that have
9
- // dependants outside the set.
10
- const peerSet = node => {
11
- const set = new Set([node])
12
- for (const node of set) {
13
- for (const edge of node.edgesOut.values()) {
14
- if (edge.valid && edge.peer && edge.to)
15
- set.add(edge.to)
16
- }
17
- for (const edge of node.edgesIn) {
18
- if (edge.valid && edge.peer)
19
- set.add(edge.from)
20
- }
21
- }
22
- return set
23
- }
24
-
25
- module.exports = peerSet