@npmcli/arborist 7.5.3 → 8.0.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/arborist/build-ideal-tree.js +4 -1
- package/lib/calc-dep-flags.js +11 -4
- package/lib/shrinkwrap.js +3 -1
- package/package.json +35 -34
|
@@ -195,7 +195,10 @@ module.exports = cls => class IdealTreeBuilder extends cls {
|
|
|
195
195
|
for (const node of this.idealTree.inventory.values()) {
|
|
196
196
|
if (!node.optional) {
|
|
197
197
|
try {
|
|
198
|
-
|
|
198
|
+
// if devEngines is present in the root node we ignore the engines check
|
|
199
|
+
if (!(node.isRoot && node.package.devEngines)) {
|
|
200
|
+
checkEngine(node.package, npmVersion, nodeVersion, this.options.force)
|
|
201
|
+
}
|
|
199
202
|
} catch (err) {
|
|
200
203
|
if (engineStrict) {
|
|
201
204
|
throw err
|
package/lib/calc-dep-flags.js
CHANGED
|
@@ -31,6 +31,10 @@ const calcDepFlagsStep = (node) => {
|
|
|
31
31
|
|
|
32
32
|
// for links, map their hierarchy appropriately
|
|
33
33
|
if (node.isLink) {
|
|
34
|
+
// node.target can be null, we check to ensure it's not null before proceeding
|
|
35
|
+
if (node.target == null) {
|
|
36
|
+
return node
|
|
37
|
+
}
|
|
34
38
|
node.target.dev = node.dev
|
|
35
39
|
node.target.optional = node.optional
|
|
36
40
|
node.target.devOptional = node.devOptional
|
|
@@ -97,15 +101,18 @@ const unsetFlag = (node, flag) => {
|
|
|
97
101
|
tree: node,
|
|
98
102
|
visit: node => {
|
|
99
103
|
node.extraneous = node[flag] = false
|
|
100
|
-
if (node.isLink) {
|
|
104
|
+
if (node.isLink && node.target) {
|
|
101
105
|
node.target.extraneous = node.target[flag] = false
|
|
102
106
|
}
|
|
103
107
|
},
|
|
104
108
|
getChildren: node => {
|
|
105
109
|
const children = []
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
const targetNode = node.isLink && node.target ? node.target : node
|
|
111
|
+
for (const edge of targetNode.edgesOut.values()) {
|
|
112
|
+
if (
|
|
113
|
+
edge.to &&
|
|
114
|
+
edge.to[flag] &&
|
|
115
|
+
((flag !== 'peer' && edge.type === 'peer') || edge.type === 'prod')
|
|
109
116
|
) {
|
|
110
117
|
children.push(edge.to)
|
|
111
118
|
}
|
package/lib/shrinkwrap.js
CHANGED
|
@@ -50,6 +50,7 @@ const versionFromTgz = require('./version-from-tgz.js')
|
|
|
50
50
|
const npa = require('npm-package-arg')
|
|
51
51
|
const pkgJson = require('@npmcli/package-json')
|
|
52
52
|
const parseJSON = require('parse-conflict-json')
|
|
53
|
+
const nameFromFolder = require('@npmcli/name-from-folder')
|
|
53
54
|
|
|
54
55
|
const stringify = require('json-stringify-nice')
|
|
55
56
|
const swKeyOrder = [
|
|
@@ -233,7 +234,8 @@ class Shrinkwrap {
|
|
|
233
234
|
// root to help prevent churn based on the name of the directory the
|
|
234
235
|
// project is in
|
|
235
236
|
const pname = node.packageName
|
|
236
|
-
|
|
237
|
+
// when Target package name and Target node share the same name, we include the name, target node should have name as per realpath.
|
|
238
|
+
if (pname && (node === node.root || pname !== node.name || nameFromFolder(node.realpath) !== pname)) {
|
|
237
239
|
meta.name = pname
|
|
238
240
|
}
|
|
239
241
|
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/arborist",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Manage node_modules trees",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@isaacs/string-locale-compare": "^1.1.0",
|
|
7
|
-
"@npmcli/fs": "^
|
|
8
|
-
"@npmcli/installed-package-contents": "^
|
|
9
|
-
"@npmcli/map-workspaces": "^
|
|
10
|
-
"@npmcli/metavuln-calculator": "^
|
|
11
|
-
"@npmcli/name-from-folder": "^
|
|
12
|
-
"@npmcli/node-gyp": "^
|
|
13
|
-
"@npmcli/package-json": "^
|
|
14
|
-
"@npmcli/query": "^
|
|
15
|
-
"@npmcli/redact": "^
|
|
16
|
-
"@npmcli/run-script": "^
|
|
17
|
-
"bin-links": "^
|
|
18
|
-
"cacache": "^
|
|
7
|
+
"@npmcli/fs": "^4.0.0",
|
|
8
|
+
"@npmcli/installed-package-contents": "^3.0.0",
|
|
9
|
+
"@npmcli/map-workspaces": "^4.0.1",
|
|
10
|
+
"@npmcli/metavuln-calculator": "^8.0.0",
|
|
11
|
+
"@npmcli/name-from-folder": "^3.0.0",
|
|
12
|
+
"@npmcli/node-gyp": "^4.0.0",
|
|
13
|
+
"@npmcli/package-json": "^6.0.1",
|
|
14
|
+
"@npmcli/query": "^4.0.0",
|
|
15
|
+
"@npmcli/redact": "^3.0.0",
|
|
16
|
+
"@npmcli/run-script": "^9.0.1",
|
|
17
|
+
"bin-links": "^5.0.0",
|
|
18
|
+
"cacache": "^19.0.1",
|
|
19
19
|
"common-ancestor-path": "^1.0.1",
|
|
20
|
-
"hosted-git-info": "^
|
|
21
|
-
"json-parse-even-better-errors": "^
|
|
20
|
+
"hosted-git-info": "^8.0.0",
|
|
21
|
+
"json-parse-even-better-errors": "^4.0.0",
|
|
22
22
|
"json-stringify-nice": "^1.1.4",
|
|
23
23
|
"lru-cache": "^10.2.2",
|
|
24
24
|
"minimatch": "^9.0.4",
|
|
25
|
-
"nopt": "^
|
|
26
|
-
"npm-install-checks": "^
|
|
27
|
-
"npm-package-arg": "^
|
|
28
|
-
"npm-pick-manifest": "^
|
|
29
|
-
"npm-registry-fetch": "^
|
|
30
|
-
"pacote": "^
|
|
31
|
-
"parse-conflict-json": "^
|
|
32
|
-
"proc-log": "^
|
|
33
|
-
"proggy": "^
|
|
25
|
+
"nopt": "^8.0.0",
|
|
26
|
+
"npm-install-checks": "^7.1.0",
|
|
27
|
+
"npm-package-arg": "^12.0.0",
|
|
28
|
+
"npm-pick-manifest": "^10.0.0",
|
|
29
|
+
"npm-registry-fetch": "^18.0.1",
|
|
30
|
+
"pacote": "^19.0.0",
|
|
31
|
+
"parse-conflict-json": "^4.0.0",
|
|
32
|
+
"proc-log": "^5.0.0",
|
|
33
|
+
"proggy": "^3.0.0",
|
|
34
34
|
"promise-all-reject-late": "^1.0.0",
|
|
35
35
|
"promise-call-limit": "^3.0.1",
|
|
36
|
-
"read-package-json-fast": "^
|
|
36
|
+
"read-package-json-fast": "^4.0.0",
|
|
37
37
|
"semver": "^7.3.7",
|
|
38
|
-
"ssri": "^
|
|
38
|
+
"ssri": "^12.0.0",
|
|
39
39
|
"treeverse": "^3.0.0",
|
|
40
40
|
"walk-up-path": "^3.0.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@npmcli/eslint-config": "^
|
|
44
|
-
"@npmcli/template-oss": "4.
|
|
43
|
+
"@npmcli/eslint-config": "^5.0.1",
|
|
44
|
+
"@npmcli/template-oss": "4.23.3",
|
|
45
45
|
"benchmark": "^2.1.4",
|
|
46
|
-
"minify-registry-metadata": "^
|
|
46
|
+
"minify-registry-metadata": "^4.0.0",
|
|
47
47
|
"nock": "^13.3.3",
|
|
48
48
|
"tap": "^16.3.8",
|
|
49
49
|
"tar-stream": "^3.0.0",
|
|
@@ -54,12 +54,13 @@
|
|
|
54
54
|
"posttest": "npm run lint",
|
|
55
55
|
"snap": "tap",
|
|
56
56
|
"test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
|
|
57
|
-
"lint": "eslint
|
|
58
|
-
"lintfix": "npm run
|
|
57
|
+
"lint": "npm run eslint",
|
|
58
|
+
"lintfix": "npm run eslint -- --fix",
|
|
59
59
|
"benchmark": "node scripts/benchmark.js",
|
|
60
60
|
"benchclean": "rm -rf scripts/benchmark/*/",
|
|
61
61
|
"postlint": "template-oss-check",
|
|
62
|
-
"template-oss-apply": "template-oss-apply --force"
|
|
62
|
+
"template-oss-apply": "template-oss-apply --force",
|
|
63
|
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
|
63
64
|
},
|
|
64
65
|
"repository": {
|
|
65
66
|
"type": "git",
|
|
@@ -88,11 +89,11 @@
|
|
|
88
89
|
]
|
|
89
90
|
},
|
|
90
91
|
"engines": {
|
|
91
|
-
"node": "^
|
|
92
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
92
93
|
},
|
|
93
94
|
"templateOSS": {
|
|
94
95
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
95
|
-
"version": "4.
|
|
96
|
+
"version": "4.23.3",
|
|
96
97
|
"content": "../../scripts/template-oss/index.js"
|
|
97
98
|
}
|
|
98
99
|
}
|