@pnpm/installing.deps-restorer 1101.1.10 → 1102.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/index.d.ts +7 -0
- package/lib/index.js +6 -0
- package/lib/lockfileToHoistedDepGraph.js +2 -1
- package/package.json +38 -38
package/lib/index.d.ts
CHANGED
|
@@ -96,6 +96,13 @@ export interface HeadlessOptions {
|
|
|
96
96
|
supportedArchitectures?: SupportedArchitectures;
|
|
97
97
|
hoistWorkspacePackages?: boolean;
|
|
98
98
|
modulesFile?: Modules | null;
|
|
99
|
+
/**
|
|
100
|
+
* Awaited right before dependency lifecycle scripts run. Lets the caller
|
|
101
|
+
* overlap lockfile verification with fetching and linking while still
|
|
102
|
+
* guaranteeing no dependency script executes on an unverified lockfile:
|
|
103
|
+
* the returned promise rejects when verification failed.
|
|
104
|
+
*/
|
|
105
|
+
verifyLockfile?: () => Promise<void>;
|
|
99
106
|
}
|
|
100
107
|
export interface InstallationResultStats {
|
|
101
108
|
added: number;
|
package/lib/index.js
CHANGED
|
@@ -361,6 +361,8 @@ export async function headlessInstall(opts) {
|
|
|
361
361
|
...makeNodeRequireOption(path.join(opts.lockfileDir, '.pnp.cjs')),
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
+
// Dependency lifecycle scripts must not run on an unverified lockfile.
|
|
365
|
+
await opts.verifyLockfile?.();
|
|
364
366
|
ignoredBuilds = (await buildModules(graph, Array.from(directNodes), {
|
|
365
367
|
allowBuild,
|
|
366
368
|
childConcurrency: opts.childConcurrency,
|
|
@@ -485,6 +487,10 @@ export async function headlessInstall(opts) {
|
|
|
485
487
|
}));
|
|
486
488
|
summaryLogger.debug({ prefix: lockfileDir });
|
|
487
489
|
if (!opts.ignoreScripts && !opts.ignorePackageManifest && !skipPostImportLinking) {
|
|
490
|
+
// The projects' own lifecycle scripts import dependency code linked from
|
|
491
|
+
// the lockfile, so they are held to the same gate as dependency builds —
|
|
492
|
+
// also on the `enableModulesDir: false` path that skips buildModules.
|
|
493
|
+
await opts.verifyLockfile?.();
|
|
488
494
|
await runLifecycleHooksConcurrently(['preinstall', 'install', 'postinstall', 'preprepare', 'prepare', 'postprepare'], projectsToBeBuilt, opts.childConcurrency ?? 5, scriptsOpts);
|
|
489
495
|
}
|
|
490
496
|
if ((reporter != null) && typeof reporter === 'function') {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { packageIsInstallable } from '@pnpm/config.package-is-installable';
|
|
3
3
|
import * as dp from '@pnpm/deps.path';
|
|
4
|
+
import { safeJoinModulesDir } from '@pnpm/fs.symlink-dependency';
|
|
4
5
|
import { hoist } from '@pnpm/installing.linking.real-hoist';
|
|
5
6
|
import { nameVerFromPkgSnapshot, packageIdFromSnapshot, pkgSnapshotToResolution, } from '@pnpm/lockfile.utils';
|
|
6
7
|
import { logger } from '@pnpm/logger';
|
|
@@ -134,7 +135,7 @@ async function fetchDeps(opts, modules, deps) {
|
|
|
134
135
|
});
|
|
135
136
|
return;
|
|
136
137
|
}
|
|
137
|
-
const dir =
|
|
138
|
+
const dir = safeJoinModulesDir(modules, dep.name);
|
|
138
139
|
const depLocation = path.relative(opts.lockfileDir, dir);
|
|
139
140
|
const resolution = pkgSnapshotToResolution(depPath, pkgSnapshot, opts.registries);
|
|
140
141
|
let fetchResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/installing.deps-restorer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1102.0.0",
|
|
4
4
|
"description": "Fast installation using only pnpm-lock.yaml",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -38,60 +38,60 @@
|
|
|
38
38
|
"path-exists": "^5.0.0",
|
|
39
39
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
40
40
|
"realpath-missing": "^2.0.0",
|
|
41
|
-
"@pnpm/building.during-install": "
|
|
42
|
-
"@pnpm/building.policy": "1100.0.
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/
|
|
45
|
-
"@pnpm/
|
|
41
|
+
"@pnpm/building.during-install": "1102.0.0",
|
|
42
|
+
"@pnpm/building.policy": "1100.0.10",
|
|
43
|
+
"@pnpm/config.package-is-installable": "1100.0.11",
|
|
44
|
+
"@pnpm/core-loggers": "1100.2.1",
|
|
45
|
+
"@pnpm/deps.graph-hasher": "1100.2.5",
|
|
46
46
|
"@pnpm/constants": "1100.0.0",
|
|
47
|
-
"@pnpm/deps.graph-builder": "1100.0.
|
|
48
|
-
"@pnpm/
|
|
49
|
-
"@pnpm/deps.path": "1100.0.7",
|
|
50
|
-
"@pnpm/exec.lifecycle": "1100.0.16",
|
|
47
|
+
"@pnpm/deps.graph-builder": "1100.0.16",
|
|
48
|
+
"@pnpm/bins.linker": "1100.0.14",
|
|
51
49
|
"@pnpm/error": "1100.0.0",
|
|
52
|
-
"@pnpm/
|
|
53
|
-
"@pnpm/
|
|
54
|
-
"@pnpm/
|
|
55
|
-
"@pnpm/installing.linking.
|
|
56
|
-
"@pnpm/installing.
|
|
57
|
-
"@pnpm/installing.
|
|
58
|
-
"@pnpm/installing.linking.
|
|
59
|
-
"@pnpm/
|
|
60
|
-
"@pnpm/
|
|
61
|
-
"@pnpm/lockfile.to-pnp": "1100.0.
|
|
62
|
-
"@pnpm/lockfile.
|
|
63
|
-
"@pnpm/
|
|
64
|
-
"@pnpm/patching.config": "1100.0.
|
|
65
|
-
"@pnpm/
|
|
66
|
-
"@pnpm/
|
|
67
|
-
"@pnpm/types": "1101.3.
|
|
50
|
+
"@pnpm/deps.path": "1100.0.8",
|
|
51
|
+
"@pnpm/exec.lifecycle": "1100.0.18",
|
|
52
|
+
"@pnpm/fs.symlink-dependency": "1100.0.10",
|
|
53
|
+
"@pnpm/installing.linking.direct-dep-linker": "1100.0.10",
|
|
54
|
+
"@pnpm/installing.linking.hoist": "1100.0.14",
|
|
55
|
+
"@pnpm/installing.linking.modules-cleaner": "1100.1.8",
|
|
56
|
+
"@pnpm/installing.linking.real-hoist": "1100.1.3",
|
|
57
|
+
"@pnpm/installing.modules-yaml": "1100.0.9",
|
|
58
|
+
"@pnpm/installing.package-requester": "1102.0.0",
|
|
59
|
+
"@pnpm/lockfile.to-pnp": "1100.0.14",
|
|
60
|
+
"@pnpm/lockfile.fs": "1100.1.5",
|
|
61
|
+
"@pnpm/lockfile.utils": "1100.0.13",
|
|
62
|
+
"@pnpm/patching.config": "1100.0.8",
|
|
63
|
+
"@pnpm/pkg-manifest.reader": "1100.0.8",
|
|
64
|
+
"@pnpm/store.controller-types": "1100.1.5",
|
|
65
|
+
"@pnpm/types": "1101.3.2",
|
|
66
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.13",
|
|
67
|
+
"@pnpm/lockfile.filtering": "1100.1.7"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@pnpm/logger": "^
|
|
71
|
-
"@pnpm/worker": "^1100.
|
|
70
|
+
"@pnpm/logger": "^1100.0.0",
|
|
71
|
+
"@pnpm/worker": "^1100.2.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@jest/globals": "30.
|
|
74
|
+
"@jest/globals": "30.4.1",
|
|
75
75
|
"@types/fs-extra": "^11.0.4",
|
|
76
76
|
"@types/ramda": "0.31.1",
|
|
77
|
-
"concurrently": "
|
|
77
|
+
"concurrently": "10.0.3",
|
|
78
78
|
"isexe": "4.0.0",
|
|
79
79
|
"load-json-file": "^7.0.1",
|
|
80
80
|
"tempy": "3.0.0",
|
|
81
81
|
"write-json-file": "^7.0.0",
|
|
82
|
-
"@pnpm/
|
|
82
|
+
"@pnpm/installing.deps-restorer": "1102.0.0",
|
|
83
|
+
"@pnpm/assert-project": "1100.0.16",
|
|
83
84
|
"@pnpm/crypto.object-hasher": "1100.0.0",
|
|
84
|
-
"@pnpm/installing.read-projects-context": "1100.0.
|
|
85
|
-
"@pnpm/
|
|
85
|
+
"@pnpm/installing.read-projects-context": "1100.0.15",
|
|
86
|
+
"@pnpm/prepare": "1100.0.16",
|
|
86
87
|
"@pnpm/logger": "1100.0.0",
|
|
87
|
-
"@pnpm/store.cafs": "1100.1.
|
|
88
|
+
"@pnpm/store.cafs": "1100.1.10",
|
|
89
|
+
"@pnpm/store.index": "1100.2.0",
|
|
88
90
|
"@pnpm/store.path": "1100.0.1",
|
|
89
|
-
"@pnpm/prepare": "1100.0.14",
|
|
90
91
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
91
|
-
"@pnpm/store.index": "1100.1.0",
|
|
92
92
|
"@pnpm/test-ipc-server": "1100.0.0",
|
|
93
|
-
"@pnpm/testing.
|
|
94
|
-
"@pnpm/testing.
|
|
93
|
+
"@pnpm/testing.temp-store": "1100.1.9",
|
|
94
|
+
"@pnpm/testing.registry-mock": "1100.0.6"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=22.13"
|