@pnpm/installing.deps-installer 1101.5.0 → 1101.6.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/install/index.js +13 -3
- package/lib/install/validateModules.js +17 -10
- package/package.json +35 -36
package/lib/install/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { getContext } from '@pnpm/installing.context';
|
|
|
15
15
|
import { getWantedDependencies, resolveDependencies, } from '@pnpm/installing.deps-resolver';
|
|
16
16
|
import { extendProjectsWithTargetDirs, headlessInstall } from '@pnpm/installing.deps-restorer';
|
|
17
17
|
import { writeModulesManifest } from '@pnpm/installing.modules-yaml';
|
|
18
|
-
import { cleanGitBranchLockfiles, getWantedLockfileName, readWantedLockfile, writeCurrentLockfile, writeLockfiles, writeWantedLockfile, } from '@pnpm/lockfile.fs';
|
|
18
|
+
import { cleanGitBranchLockfiles, getWantedLockfileName, isEmptyLockfile, readWantedLockfile, writeCurrentLockfile, writeLockfiles, writeWantedLockfile, } from '@pnpm/lockfile.fs';
|
|
19
19
|
import { getPreferredVersionsFromLockfileAndManifests } from '@pnpm/lockfile.preferred-versions';
|
|
20
20
|
import { calcPatchHashes, createOverridesMapFromParsed, getOutdatedLockfileSetting, } from '@pnpm/lockfile.settings-checker';
|
|
21
21
|
import { writePnpFile } from '@pnpm/lockfile.to-pnp';
|
|
@@ -631,7 +631,7 @@ export async function mutateModules(projects, maybeOpts) {
|
|
|
631
631
|
!needsFullResolution &&
|
|
632
632
|
opts.preferFrozenLockfile &&
|
|
633
633
|
(!opts.pruneLockfileImporters || Object.keys(ctx.wantedLockfile.importers).length === Object.keys(ctx.projects).length) &&
|
|
634
|
-
ctx.
|
|
634
|
+
!isEmptyLockfile(ctx.wantedLockfile) &&
|
|
635
635
|
ctx.wantedLockfile.lockfileVersion === LOCKFILE_VERSION &&
|
|
636
636
|
await allProjectsAreUpToDate(Object.values(ctx.projects), {
|
|
637
637
|
catalogs: opts.catalogs,
|
|
@@ -655,6 +655,16 @@ Note that in CI environments, this setting is enabled by default.`,
|
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
if (!opts.ignorePackageManifest) {
|
|
658
|
+
// `--frozen-lockfile` (the CI default) means "fail if pnpm-lock.yaml is
|
|
659
|
+
// out of sync." Treat its absence as a sync failure even when the
|
|
660
|
+
// synthesized snapshot from node_modules/.pnpm/lock.yaml would satisfy
|
|
661
|
+
// the manifest — the developer needs to commit the regenerated file.
|
|
662
|
+
if (frozenLockfile && !ctx.existsWantedLockfile &&
|
|
663
|
+
Object.values(ctx.projects).some((project) => pkgHasDependencies(project.manifest))) {
|
|
664
|
+
throw new PnpmError('NO_LOCKFILE', `Cannot install with "frozen-lockfile" because ${WANTED_LOCKFILE} is absent`, {
|
|
665
|
+
hint: 'Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"',
|
|
666
|
+
});
|
|
667
|
+
}
|
|
658
668
|
const _satisfiesPackageManifest = satisfiesPackageManifest.bind(null, {
|
|
659
669
|
autoInstallPeers: opts.autoInstallPeers,
|
|
660
670
|
excludeLinksFromLockfile: opts.excludeLinksFromLockfile,
|
|
@@ -685,7 +695,7 @@ Note that in CI environments, this setting is enabled by default.`,
|
|
|
685
695
|
ignoredBuilds: undefined,
|
|
686
696
|
};
|
|
687
697
|
}
|
|
688
|
-
if (
|
|
698
|
+
if (isEmptyLockfile(ctx.wantedLockfile)) {
|
|
689
699
|
if (Object.values(ctx.projects).some((project) => pkgHasDependencies(project.manifest))) {
|
|
690
700
|
throw new Error(`Headless installation requires a ${WANTED_LOCKFILE} file`);
|
|
691
701
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { confirm } from '@inquirer/prompts';
|
|
3
4
|
import { PnpmError } from '@pnpm/error';
|
|
4
5
|
import { logger } from '@pnpm/logger';
|
|
5
6
|
import { DEPENDENCIES_FIELDS, } from '@pnpm/types';
|
|
6
7
|
import { rimraf } from '@zkochan/rimraf';
|
|
7
|
-
import enquirer from 'enquirer';
|
|
8
8
|
import { pathAbsolute } from 'path-absolute';
|
|
9
9
|
import { equals } from 'ramda';
|
|
10
10
|
import { checkCompatibility } from './checkCompatibility/index.js';
|
|
@@ -87,15 +87,22 @@ async function purgeModulesDirsOfImporters(opts, importers) {
|
|
|
87
87
|
hint: 'If you are running pnpm in CI, set the CI environment variable to "true", or set "confirmModulesPurge" to "false".',
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
let confirmed;
|
|
91
|
+
try {
|
|
92
|
+
confirmed = await confirm({
|
|
93
|
+
message: importers.length === 1
|
|
94
|
+
? `The modules directory at "${importers[0].modulesDir}" will be removed and reinstalled from scratch. Proceed?`
|
|
95
|
+
: 'The modules directories will be removed and reinstalled from scratch. Proceed?',
|
|
96
|
+
default: true,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
if (err instanceof Error && err.name === 'ExitPromptError') {
|
|
101
|
+
throw new PnpmError('ABORTED_REMOVE_MODULES_DIR', 'Aborted removal of modules directory');
|
|
102
|
+
}
|
|
103
|
+
throw err;
|
|
104
|
+
}
|
|
105
|
+
if (!confirmed) {
|
|
99
106
|
throw new PnpmError('ABORTED_REMOVE_MODULES_DIR', 'Aborted removal of modules directory');
|
|
100
107
|
}
|
|
101
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/installing.deps-installer",
|
|
3
|
-
"version": "1101.
|
|
3
|
+
"version": "1101.6.0",
|
|
4
4
|
"description": "Fast, disk space efficient installation engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"test": "test"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
+
"@inquirer/prompts": "^8.4.3",
|
|
50
51
|
"@pnpm/npm-package-arg": "^2.0.0",
|
|
51
52
|
"@pnpm/util.lex-comparator": "^3.0.2",
|
|
52
53
|
"@zkochan/rimraf": "^4.0.0",
|
|
53
|
-
"enquirer": "^2.4.1",
|
|
54
54
|
"is-inner-link": "^5.0.0",
|
|
55
55
|
"is-subdir": "^2.0.0",
|
|
56
56
|
"load-json-file": "^7.0.1",
|
|
@@ -62,56 +62,56 @@
|
|
|
62
62
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
63
63
|
"run-groups": "^5.0.0",
|
|
64
64
|
"semver": "^7.8.1",
|
|
65
|
+
"@pnpm/bins.linker": "1100.0.10",
|
|
66
|
+
"@pnpm/bins.remover": "1100.0.6",
|
|
67
|
+
"@pnpm/building.after-install": "1101.0.18",
|
|
65
68
|
"@pnpm/agent.client": "1.0.8",
|
|
66
|
-
"@pnpm/
|
|
69
|
+
"@pnpm/catalogs.resolver": "1100.0.0",
|
|
67
70
|
"@pnpm/building.policy": "1100.0.7",
|
|
68
|
-
"@pnpm/bins.remover": "1100.0.6",
|
|
69
71
|
"@pnpm/catalogs.protocol-parser": "1100.0.0",
|
|
70
|
-
"@pnpm/building.during-install": "1101.0.14",
|
|
71
72
|
"@pnpm/catalogs.types": "1100.0.0",
|
|
72
|
-
"@pnpm/
|
|
73
|
+
"@pnpm/building.during-install": "1101.0.15",
|
|
73
74
|
"@pnpm/config.normalize-registries": "1100.0.5",
|
|
74
|
-
"@pnpm/catalogs.resolver": "1100.0.0",
|
|
75
75
|
"@pnpm/config.parse-overrides": "1100.0.1",
|
|
76
|
-
"@pnpm/
|
|
76
|
+
"@pnpm/crypto.object-hasher": "1100.0.0",
|
|
77
77
|
"@pnpm/core-loggers": "1100.1.2",
|
|
78
|
-
"@pnpm/crypto.hash": "1100.0.1",
|
|
79
78
|
"@pnpm/deps.graph-hasher": "1100.2.2",
|
|
80
|
-
"@pnpm/crypto.
|
|
81
|
-
"@pnpm/deps.graph-sequencer": "1100.0.0",
|
|
82
|
-
"@pnpm/error": "1100.0.0",
|
|
79
|
+
"@pnpm/crypto.hash": "1100.0.1",
|
|
83
80
|
"@pnpm/deps.path": "1100.0.5",
|
|
81
|
+
"@pnpm/constants": "1100.0.0",
|
|
82
|
+
"@pnpm/config.matcher": "1100.0.1",
|
|
84
83
|
"@pnpm/exec.lifecycle": "1100.0.14",
|
|
85
|
-
"@pnpm/
|
|
84
|
+
"@pnpm/deps.graph-sequencer": "1100.0.0",
|
|
86
85
|
"@pnpm/fs.symlink-dependency": "1100.0.6",
|
|
86
|
+
"@pnpm/installing.context": "1100.0.14",
|
|
87
87
|
"@pnpm/hooks.read-package-hook": "1100.0.5",
|
|
88
|
+
"@pnpm/installing.deps-resolver": "1100.1.5",
|
|
89
|
+
"@pnpm/error": "1100.0.0",
|
|
90
|
+
"@pnpm/installing.deps-restorer": "1101.1.7",
|
|
88
91
|
"@pnpm/hooks.types": "1100.0.9",
|
|
89
|
-
"@pnpm/installing.deps-resolver": "1100.1.4",
|
|
90
|
-
"@pnpm/installing.context": "1100.0.13",
|
|
91
|
-
"@pnpm/installing.linking.direct-dep-linker": "1100.0.6",
|
|
92
|
-
"@pnpm/installing.deps-restorer": "1101.1.6",
|
|
93
92
|
"@pnpm/installing.linking.hoist": "1100.0.10",
|
|
93
|
+
"@pnpm/installing.linking.direct-dep-linker": "1100.0.6",
|
|
94
94
|
"@pnpm/installing.linking.modules-cleaner": "1100.1.4",
|
|
95
|
-
"@pnpm/installing.package-requester": "1101.0.9",
|
|
96
95
|
"@pnpm/installing.modules-yaml": "1100.0.6",
|
|
97
96
|
"@pnpm/lockfile.filtering": "1100.1.3",
|
|
97
|
+
"@pnpm/fs.read-modules-dir": "1100.0.1",
|
|
98
98
|
"@pnpm/lockfile.fs": "1100.1.2",
|
|
99
|
-
"@pnpm/lockfile.settings-checker": "1100.0.13",
|
|
100
99
|
"@pnpm/lockfile.preferred-versions": "1100.0.12",
|
|
101
|
-
"@pnpm/lockfile.
|
|
100
|
+
"@pnpm/lockfile.settings-checker": "1100.0.14",
|
|
102
101
|
"@pnpm/lockfile.to-pnp": "1100.0.11",
|
|
102
|
+
"@pnpm/lockfile.pruner": "1100.0.8",
|
|
103
|
+
"@pnpm/lockfile.utils": "1100.0.10",
|
|
103
104
|
"@pnpm/lockfile.walker": "1100.0.8",
|
|
104
|
-
"@pnpm/bins.linker": "1100.0.10",
|
|
105
105
|
"@pnpm/patching.config": "1100.0.5",
|
|
106
|
-
"@pnpm/resolving.resolver-base": "1100.3.1",
|
|
107
106
|
"@pnpm/pkg-manifest.utils": "1100.2.1",
|
|
107
|
+
"@pnpm/resolving.parse-wanted-dependency": "1100.0.1",
|
|
108
108
|
"@pnpm/store.controller-types": "1100.1.2",
|
|
109
109
|
"@pnpm/types": "1101.2.0",
|
|
110
110
|
"@pnpm/workspace.project-manifest-reader": "1100.0.9",
|
|
111
111
|
"@pnpm/store.index": "1100.1.0",
|
|
112
|
-
"@pnpm/
|
|
113
|
-
"@pnpm/resolving.
|
|
114
|
-
"@pnpm/lockfile.
|
|
112
|
+
"@pnpm/installing.package-requester": "1101.0.10",
|
|
113
|
+
"@pnpm/resolving.resolver-base": "1100.3.1",
|
|
114
|
+
"@pnpm/lockfile.verification": "1100.0.14"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"@pnpm/logger": "^1001.0.1",
|
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@jest/globals": "30.3.0",
|
|
122
|
-
"@pnpm/registry-mock": "6.0.0",
|
|
123
122
|
"@types/fs-extra": "^11.0.4",
|
|
124
123
|
"@types/is-windows": "^1.0.2",
|
|
125
124
|
"@types/normalize-path": "^3.0.2",
|
|
@@ -138,22 +137,22 @@
|
|
|
138
137
|
"symlink-dir": "^10.0.1",
|
|
139
138
|
"write-json-file": "^7.0.0",
|
|
140
139
|
"write-yaml-file": "^6.0.0",
|
|
141
|
-
"@pnpm/assert-project": "1100.0.
|
|
142
|
-
"@pnpm/installing.deps-installer": "1101.5.0",
|
|
143
|
-
"@pnpm/assert-store": "1100.0.11",
|
|
140
|
+
"@pnpm/assert-project": "1100.0.12",
|
|
144
141
|
"@pnpm/lockfile.types": "1100.0.8",
|
|
145
|
-
"@pnpm/
|
|
142
|
+
"@pnpm/installing.deps-installer": "1101.6.0",
|
|
143
|
+
"@pnpm/assert-store": "1100.0.12",
|
|
144
|
+
"@pnpm/prepare": "1100.0.12",
|
|
146
145
|
"@pnpm/network.git-utils": "1100.0.1",
|
|
147
146
|
"@pnpm/pkg-manifest.reader": "1100.0.5",
|
|
148
|
-
"@pnpm/
|
|
149
|
-
"@pnpm/resolving.registry.types": "1100.0.5",
|
|
147
|
+
"@pnpm/logger": "1100.0.0",
|
|
150
148
|
"@pnpm/store.cafs": "1100.1.7",
|
|
149
|
+
"@pnpm/test-ipc-server": "1100.0.0",
|
|
150
|
+
"@pnpm/resolving.registry.types": "1100.1.0",
|
|
151
|
+
"@pnpm/testing.mock-agent": "1100.0.8",
|
|
152
|
+
"@pnpm/testing.temp-store": "1100.1.5",
|
|
151
153
|
"@pnpm/store.path": "1100.0.1",
|
|
152
154
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
153
|
-
"@pnpm/testing.mock
|
|
154
|
-
"@pnpm/test-ipc-server": "1100.0.0",
|
|
155
|
-
"@pnpm/testing.temp-store": "1100.1.4",
|
|
156
|
-
"@pnpm/testing.registry-mock": "1100.0.1"
|
|
155
|
+
"@pnpm/testing.registry-mock": "1100.0.2"
|
|
157
156
|
},
|
|
158
157
|
"engines": {
|
|
159
158
|
"node": ">=22.13"
|