@pnpm/installing.deps-restorer 1101.1.1 → 1101.1.3
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/index.js +10 -1
- package/lib/linkHoistedModules.js +10 -1
- package/package.json +32 -32
package/lib/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createAllowBuildFunction, isBuildExplicitlyDisallowed } from '@pnpm/bui
|
|
|
6
6
|
import { LAYOUT_VERSION, WANTED_LOCKFILE, } from '@pnpm/constants';
|
|
7
7
|
import { packageManifestLogger, progressLogger, stageLogger, statsLogger, summaryLogger, } from '@pnpm/core-loggers';
|
|
8
8
|
import { lockfileToDepGraph, } from '@pnpm/deps.graph-builder';
|
|
9
|
-
import { calcDepState } from '@pnpm/deps.graph-hasher';
|
|
9
|
+
import { calcDepState, findRuntimeNodeVersion } from '@pnpm/deps.graph-hasher';
|
|
10
10
|
import * as dp from '@pnpm/deps.path';
|
|
11
11
|
import { PnpmError } from '@pnpm/error';
|
|
12
12
|
import { makeNodeRequireOption, runLifecycleHooksConcurrently, } from '@pnpm/exec.lifecycle';
|
|
@@ -625,6 +625,14 @@ async function linkAllPkgs(storeController, depNodes, opts) {
|
|
|
625
625
|
needsBuildMarkerSrc = path.join(opts.storeDir, '.pnpm-needs-build-marker');
|
|
626
626
|
await fs.writeFile(needsBuildMarkerSrc, '');
|
|
627
627
|
}
|
|
628
|
+
// Resolved `engines.runtime` Node version (when present) anchors
|
|
629
|
+
// the side-effects-cache key prefix to the script-runner Node, not
|
|
630
|
+
// pnpm's own `process.version`. The restorer's `depGraph` is keyed
|
|
631
|
+
// by install directory, so scanning `Object.keys(opts.depGraph)`
|
|
632
|
+
// would never see a `node@runtime:<version>` entry — pull the
|
|
633
|
+
// depPath off each node instead. Computed once outside the
|
|
634
|
+
// per-node loop.
|
|
635
|
+
const nodeVersion = findRuntimeNodeVersion(depNodes.map((node) => node.depPath));
|
|
628
636
|
await Promise.all(depNodes.map(async (depNode) => {
|
|
629
637
|
if (!depNode.fetching)
|
|
630
638
|
return;
|
|
@@ -645,6 +653,7 @@ async function linkAllPkgs(storeController, depNodes, opts) {
|
|
|
645
653
|
includeDepGraphHash: !opts.ignoreScripts && depNode.requiresBuild, // true when is built
|
|
646
654
|
patchFileHash: depNode.patch?.hash,
|
|
647
655
|
supportedArchitectures: opts.supportedArchitectures,
|
|
656
|
+
nodeVersion,
|
|
648
657
|
});
|
|
649
658
|
}
|
|
650
659
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { linkBins } from '@pnpm/bins.linker';
|
|
3
3
|
import { progressLogger, removalLogger, statsLogger, } from '@pnpm/core-loggers';
|
|
4
|
-
import { calcDepState } from '@pnpm/deps.graph-hasher';
|
|
4
|
+
import { calcDepState, findRuntimeNodeVersion } from '@pnpm/deps.graph-hasher';
|
|
5
5
|
import { logger } from '@pnpm/logger';
|
|
6
6
|
import { rimraf } from '@zkochan/rimraf';
|
|
7
7
|
import pLimit from 'p-limit';
|
|
@@ -17,6 +17,13 @@ export async function linkHoistedModules(storeController, graph, prevGraph, hier
|
|
|
17
17
|
// We should avoid removing unnecessary directories while simultaneously adding new ones.
|
|
18
18
|
// Doing so can sometimes lead to a race condition when linking commands to `node_modules/.bin`.
|
|
19
19
|
await Promise.all(dirsToRemove.map((dir) => tryRemoveDir(dir)));
|
|
20
|
+
// Resolve the project's pinned runtime Node version once, before
|
|
21
|
+
// the recursive walk. The graph is keyed by install directory in
|
|
22
|
+
// this module, so scanning `Object.keys(graph)` would miss every
|
|
23
|
+
// `node@runtime:<version>` entry — pull the depPath off each
|
|
24
|
+
// node instead. Threading it down via `opts` also avoids a
|
|
25
|
+
// re-scan at every recursion level.
|
|
26
|
+
const nodeVersion = findRuntimeNodeVersion(Object.values(graph).map((node) => node.depPath));
|
|
20
27
|
await Promise.all(Object.entries(hierarchy)
|
|
21
28
|
.map(([parentDir, depsHierarchy]) => {
|
|
22
29
|
function warn(message) {
|
|
@@ -27,6 +34,7 @@ export async function linkHoistedModules(storeController, graph, prevGraph, hier
|
|
|
27
34
|
}
|
|
28
35
|
return linkAllPkgsInOrder(storeController, graph, depsHierarchy, parentDir, {
|
|
29
36
|
...opts,
|
|
37
|
+
nodeVersion,
|
|
30
38
|
warn,
|
|
31
39
|
});
|
|
32
40
|
}));
|
|
@@ -67,6 +75,7 @@ async function linkAllPkgsInOrder(storeController, graph, hierarchy, parentDir,
|
|
|
67
75
|
includeDepGraphHash: !opts.ignoreScripts && depNode.requiresBuild, // true when is built
|
|
68
76
|
patchFileHash: depNode.patch?.hash,
|
|
69
77
|
supportedArchitectures: opts.supportedArchitectures,
|
|
78
|
+
nodeVersion: opts.nodeVersion,
|
|
70
79
|
});
|
|
71
80
|
}
|
|
72
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/installing.deps-restorer",
|
|
3
|
-
"version": "1101.1.
|
|
3
|
+
"version": "1101.1.3",
|
|
4
4
|
"description": "Fast installation using only pnpm-lock.yaml",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -35,37 +35,37 @@
|
|
|
35
35
|
"path-exists": "^5.0.0",
|
|
36
36
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
37
37
|
"realpath-missing": "^2.0.0",
|
|
38
|
-
"@pnpm/
|
|
39
|
-
"@pnpm/
|
|
38
|
+
"@pnpm/bins.linker": "1100.0.7",
|
|
39
|
+
"@pnpm/building.during-install": "1101.0.11",
|
|
40
|
+
"@pnpm/building.policy": "1100.0.5",
|
|
41
|
+
"@pnpm/config.package-is-installable": "1100.0.5",
|
|
40
42
|
"@pnpm/constants": "1100.0.0",
|
|
41
|
-
"@pnpm/
|
|
42
|
-
"@pnpm/
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/deps.
|
|
45
|
-
"@pnpm/
|
|
46
|
-
"@pnpm/
|
|
47
|
-
"@pnpm/
|
|
48
|
-
"@pnpm/installing.linking.direct-dep-linker": "1100.0.
|
|
49
|
-
"@pnpm/installing.linking.hoist": "1100.0.
|
|
43
|
+
"@pnpm/deps.graph-builder": "1100.0.10",
|
|
44
|
+
"@pnpm/core-loggers": "1100.1.0",
|
|
45
|
+
"@pnpm/deps.graph-hasher": "1100.2.0",
|
|
46
|
+
"@pnpm/deps.path": "1100.0.3",
|
|
47
|
+
"@pnpm/error": "1100.0.0",
|
|
48
|
+
"@pnpm/fs.symlink-dependency": "1100.0.4",
|
|
49
|
+
"@pnpm/exec.lifecycle": "1100.0.11",
|
|
50
|
+
"@pnpm/installing.linking.direct-dep-linker": "1100.0.4",
|
|
51
|
+
"@pnpm/installing.linking.hoist": "1100.0.7",
|
|
52
|
+
"@pnpm/installing.linking.modules-cleaner": "1100.1.2",
|
|
53
|
+
"@pnpm/installing.linking.real-hoist": "1100.0.8",
|
|
50
54
|
"@pnpm/installing.modules-yaml": "1100.0.4",
|
|
51
|
-
"@pnpm/installing.
|
|
52
|
-
"@pnpm/
|
|
53
|
-
"@pnpm/
|
|
54
|
-
"@pnpm/lockfile.
|
|
55
|
-
"@pnpm/lockfile.fs": "1100.0.7",
|
|
56
|
-
"@pnpm/lockfile.to-pnp": "1100.0.7",
|
|
57
|
-
"@pnpm/lockfile.utils": "1100.0.7",
|
|
55
|
+
"@pnpm/installing.package-requester": "1101.0.7",
|
|
56
|
+
"@pnpm/lockfile.fs": "1100.1.0",
|
|
57
|
+
"@pnpm/lockfile.to-pnp": "1100.0.9",
|
|
58
|
+
"@pnpm/lockfile.utils": "1100.0.8",
|
|
58
59
|
"@pnpm/patching.config": "1100.0.3",
|
|
59
60
|
"@pnpm/pkg-manifest.reader": "1100.0.3",
|
|
60
|
-
"@pnpm/store.controller-types": "1100.0
|
|
61
|
-
"@pnpm/
|
|
61
|
+
"@pnpm/store.controller-types": "1100.1.0",
|
|
62
|
+
"@pnpm/lockfile.filtering": "1100.1.1",
|
|
62
63
|
"@pnpm/types": "1101.1.0",
|
|
63
|
-
"@pnpm/workspace.project-manifest-reader": "1100.0.
|
|
64
|
-
"@pnpm/error": "1100.0.0"
|
|
64
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.6"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0",
|
|
68
|
-
"@pnpm/worker": "^1100.1.
|
|
68
|
+
"@pnpm/worker": "^1100.1.6"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@jest/globals": "30.3.0",
|
|
@@ -77,18 +77,18 @@
|
|
|
77
77
|
"load-json-file": "^7.0.1",
|
|
78
78
|
"tempy": "3.0.0",
|
|
79
79
|
"write-json-file": "^7.0.0",
|
|
80
|
+
"@pnpm/assert-project": "1100.0.9",
|
|
80
81
|
"@pnpm/crypto.object-hasher": "1100.0.0",
|
|
81
|
-
"@pnpm/installing.
|
|
82
|
+
"@pnpm/installing.deps-restorer": "1101.1.3",
|
|
83
|
+
"@pnpm/installing.read-projects-context": "1100.0.10",
|
|
82
84
|
"@pnpm/logger": "1100.0.0",
|
|
83
|
-
"@pnpm/
|
|
84
|
-
"@pnpm/
|
|
85
|
-
"@pnpm/store.cafs": "1100.1.3",
|
|
85
|
+
"@pnpm/prepare": "1100.0.9",
|
|
86
|
+
"@pnpm/store.cafs": "1100.1.5",
|
|
86
87
|
"@pnpm/store.index": "1100.1.0",
|
|
87
|
-
"@pnpm/store.path": "1100.0.1",
|
|
88
88
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
89
|
-
"@pnpm/
|
|
90
|
-
"@pnpm/
|
|
91
|
-
"@pnpm/
|
|
89
|
+
"@pnpm/testing.temp-store": "1100.1.0",
|
|
90
|
+
"@pnpm/store.path": "1100.0.1",
|
|
91
|
+
"@pnpm/test-ipc-server": "1100.0.0"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|
|
94
94
|
"node": ">=22.13"
|