@npmcli/arborist 6.2.0 → 6.2.2
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/reify.js +37 -49
- package/package.json +11 -15
package/lib/arborist/reify.js
CHANGED
|
@@ -82,7 +82,6 @@ const _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes')
|
|
|
82
82
|
const _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree')
|
|
83
83
|
const _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged')
|
|
84
84
|
const _saveIdealTree = Symbol.for('saveIdealTree')
|
|
85
|
-
const _saveLockFile = Symbol('saveLockFile')
|
|
86
85
|
const _copyIdealToActual = Symbol('copyIdealToActual')
|
|
87
86
|
const _addOmitsToTrashList = Symbol('addOmitsToTrashList')
|
|
88
87
|
const _packageLockOnly = Symbol('packageLockOnly')
|
|
@@ -1404,64 +1403,53 @@ module.exports = cls => class Reifier extends cls {
|
|
|
1404
1403
|
}
|
|
1405
1404
|
}
|
|
1406
1405
|
|
|
1407
|
-
// preserve indentation, if possible
|
|
1408
|
-
const {
|
|
1409
|
-
[Symbol.for('indent')]: indent,
|
|
1410
|
-
} = this.idealTree.package
|
|
1411
|
-
const format = indent === undefined ? ' ' : indent
|
|
1412
|
-
|
|
1413
|
-
const saveOpt = {
|
|
1414
|
-
format: (this[_formatPackageLock] && format) ? format
|
|
1415
|
-
: this[_formatPackageLock],
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
const promises = [this[_saveLockFile](saveOpt)]
|
|
1419
|
-
|
|
1420
|
-
const updatePackageJson = async (tree) => {
|
|
1421
|
-
const pkgJson = await PackageJson.load(tree.path)
|
|
1422
|
-
.catch(() => new PackageJson(tree.path))
|
|
1423
|
-
const {
|
|
1424
|
-
dependencies = {},
|
|
1425
|
-
devDependencies = {},
|
|
1426
|
-
optionalDependencies = {},
|
|
1427
|
-
peerDependencies = {},
|
|
1428
|
-
// bundleDependencies is not required by PackageJson like the other fields here
|
|
1429
|
-
// PackageJson also doesn't omit an empty array for this field so defaulting this
|
|
1430
|
-
// to an empty array would add that field to every package.json file.
|
|
1431
|
-
bundleDependencies,
|
|
1432
|
-
} = tree.package
|
|
1433
|
-
|
|
1434
|
-
pkgJson.update({
|
|
1435
|
-
dependencies,
|
|
1436
|
-
devDependencies,
|
|
1437
|
-
optionalDependencies,
|
|
1438
|
-
peerDependencies,
|
|
1439
|
-
bundleDependencies,
|
|
1440
|
-
})
|
|
1441
|
-
await pkgJson.save()
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
1406
|
if (save) {
|
|
1445
1407
|
for (const tree of updatedTrees) {
|
|
1446
1408
|
// refresh the edges so they have the correct specs
|
|
1447
1409
|
tree.package = tree.package
|
|
1448
|
-
|
|
1410
|
+
const pkgJson = await PackageJson.load(tree.path)
|
|
1411
|
+
.catch(() => new PackageJson(tree.path))
|
|
1412
|
+
const {
|
|
1413
|
+
dependencies = {},
|
|
1414
|
+
devDependencies = {},
|
|
1415
|
+
optionalDependencies = {},
|
|
1416
|
+
peerDependencies = {},
|
|
1417
|
+
// bundleDependencies is not required by PackageJson like the other
|
|
1418
|
+
// fields here PackageJson also doesn't omit an empty array for this
|
|
1419
|
+
// field so defaulting this to an empty array would add that field to
|
|
1420
|
+
// every package.json file.
|
|
1421
|
+
bundleDependencies,
|
|
1422
|
+
} = tree.package
|
|
1423
|
+
|
|
1424
|
+
pkgJson.update({
|
|
1425
|
+
dependencies,
|
|
1426
|
+
devDependencies,
|
|
1427
|
+
optionalDependencies,
|
|
1428
|
+
peerDependencies,
|
|
1429
|
+
bundleDependencies,
|
|
1430
|
+
})
|
|
1431
|
+
await pkgJson.save()
|
|
1449
1432
|
}
|
|
1450
1433
|
}
|
|
1451
1434
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1435
|
+
// before now edge specs could be changing, affecting the `requires` field
|
|
1436
|
+
// in the package lock, so we hold off saving to the very last action
|
|
1437
|
+
if (this[_usePackageLock]) {
|
|
1438
|
+
// preserve indentation, if possible
|
|
1439
|
+
let format = this.idealTree.package[Symbol.for('indent')]
|
|
1440
|
+
if (format === undefined) {
|
|
1441
|
+
format = ' '
|
|
1442
|
+
}
|
|
1456
1443
|
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1444
|
+
// TODO this ignores options.save
|
|
1445
|
+
await this.idealTree.meta.save({
|
|
1446
|
+
format: (this[_formatPackageLock] && format) ? format
|
|
1447
|
+
: this[_formatPackageLock],
|
|
1448
|
+
})
|
|
1460
1449
|
}
|
|
1461
1450
|
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
return meta.save(saveOpt)
|
|
1451
|
+
process.emit('timeEnd', 'reify:save')
|
|
1452
|
+
return true
|
|
1465
1453
|
}
|
|
1466
1454
|
|
|
1467
1455
|
async [_copyIdealToActual] () {
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npmcli/arborist",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
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
8
|
"@npmcli/installed-package-contents": "^2.0.0",
|
|
9
|
-
"@npmcli/map-workspaces": "^3.0.
|
|
9
|
+
"@npmcli/map-workspaces": "^3.0.2",
|
|
10
10
|
"@npmcli/metavuln-calculator": "^5.0.0",
|
|
11
|
-
"@npmcli/name-from-folder": "^
|
|
11
|
+
"@npmcli/name-from-folder": "^2.0.0",
|
|
12
12
|
"@npmcli/node-gyp": "^3.0.0",
|
|
13
13
|
"@npmcli/package-json": "^3.0.0",
|
|
14
14
|
"@npmcli/query": "^3.0.0",
|
|
15
15
|
"@npmcli/run-script": "^6.0.0",
|
|
16
16
|
"bin-links": "^4.0.1",
|
|
17
|
-
"cacache": "^17.0.
|
|
17
|
+
"cacache": "^17.0.4",
|
|
18
18
|
"common-ancestor-path": "^1.0.1",
|
|
19
19
|
"hosted-git-info": "^6.1.1",
|
|
20
20
|
"json-parse-even-better-errors": "^3.0.0",
|
|
21
21
|
"json-stringify-nice": "^1.1.4",
|
|
22
|
-
"minimatch": "^
|
|
22
|
+
"minimatch": "^6.1.6",
|
|
23
23
|
"nopt": "^7.0.0",
|
|
24
24
|
"npm-install-checks": "^6.0.0",
|
|
25
25
|
"npm-package-arg": "^10.1.0",
|
|
26
26
|
"npm-pick-manifest": "^8.0.1",
|
|
27
27
|
"npm-registry-fetch": "^14.0.3",
|
|
28
28
|
"npmlog": "^7.0.1",
|
|
29
|
-
"pacote": "^15.0.
|
|
29
|
+
"pacote": "^15.0.8",
|
|
30
30
|
"parse-conflict-json": "^3.0.0",
|
|
31
31
|
"proc-log": "^3.0.0",
|
|
32
32
|
"promise-all-reject-late": "^1.0.0",
|
|
33
33
|
"promise-call-limit": "^1.0.1",
|
|
34
|
-
"read-package-json-fast": "^3.0.
|
|
34
|
+
"read-package-json-fast": "^3.0.2",
|
|
35
35
|
"semver": "^7.3.7",
|
|
36
36
|
"ssri": "^10.0.1",
|
|
37
37
|
"treeverse": "^3.0.0",
|
|
@@ -39,28 +39,24 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@npmcli/eslint-config": "^4.0.0",
|
|
42
|
-
"@npmcli/template-oss": "4.11.
|
|
42
|
+
"@npmcli/template-oss": "4.11.4",
|
|
43
43
|
"benchmark": "^2.1.4",
|
|
44
44
|
"chalk": "^4.1.0",
|
|
45
45
|
"minify-registry-metadata": "^3.0.0",
|
|
46
|
-
"nock": "^13.
|
|
47
|
-
"tap": "^16.3.
|
|
46
|
+
"nock": "^13.3.0",
|
|
47
|
+
"tap": "^16.3.4",
|
|
48
48
|
"tar-stream": "^3.0.0",
|
|
49
49
|
"tcompare": "^5.0.6"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"test": "tap",
|
|
53
|
-
"test-only": "tap --only",
|
|
54
53
|
"posttest": "node ../.. run lint",
|
|
55
54
|
"snap": "tap",
|
|
56
|
-
"postsnap": "npm run lintfix",
|
|
57
55
|
"test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
|
|
58
|
-
"eslint": "eslint",
|
|
59
56
|
"lint": "eslint \"**/*.js\"",
|
|
60
57
|
"lintfix": "node ../.. run lint -- --fix",
|
|
61
58
|
"benchmark": "node scripts/benchmark.js",
|
|
62
59
|
"benchclean": "rm -rf scripts/benchmark/*/",
|
|
63
|
-
"npmclilint": "npmcli-lint",
|
|
64
60
|
"postlint": "template-oss-check",
|
|
65
61
|
"template-oss-apply": "template-oss-apply --force"
|
|
66
62
|
},
|
|
@@ -102,7 +98,7 @@
|
|
|
102
98
|
},
|
|
103
99
|
"templateOSS": {
|
|
104
100
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
105
|
-
"version": "4.11.
|
|
101
|
+
"version": "4.11.4",
|
|
106
102
|
"content": "../../scripts/template-oss/index.js"
|
|
107
103
|
}
|
|
108
104
|
}
|