@pnpm/engine.pm.commands 1101.1.0 → 1101.1.1
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/self-updater/selfUpdate.js +30 -14
- package/package.json +14 -14
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { linkBins } from '@pnpm/bins.linker';
|
|
3
3
|
import { isExecutedByCorepack, packageManager } from '@pnpm/cli.meta';
|
|
4
4
|
import { docsUrl } from '@pnpm/cli.utils';
|
|
5
|
-
import { types as allTypes } from '@pnpm/config.reader';
|
|
5
|
+
import { parsePackageManager, types as allTypes } from '@pnpm/config.reader';
|
|
6
6
|
import { PnpmError } from '@pnpm/error';
|
|
7
7
|
import { createResolver } from '@pnpm/installing.client';
|
|
8
8
|
import { resolvePackageManagerIntegrities } from '@pnpm/installing.env-installer';
|
|
@@ -89,23 +89,39 @@ export async function handler(opts, params) {
|
|
|
89
89
|
if (opts.wantedPackageManager?.version !== resolution.manifest.version) {
|
|
90
90
|
const { manifest, writeProjectManifest } = await readProjectManifest(opts.rootProjectManifestDir);
|
|
91
91
|
if (manifest.devEngines?.packageManager) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
let manifestChanged = false;
|
|
93
|
+
// If "packageManager" pins pnpm, treat both fields as the user's
|
|
94
|
+
// single source of truth for the active pnpm version: rewrite both
|
|
95
|
+
// to the new exact version (dropping any range operator in
|
|
96
|
+
// devEngines and any integrity hash on the legacy field). When only
|
|
97
|
+
// devEngines is set, preserve the user's range style and let the
|
|
98
|
+
// lockfile pin the exact version.
|
|
99
|
+
const legacyPm = manifest.packageManager != null
|
|
100
|
+
? parsePackageManager(manifest.packageManager)
|
|
101
|
+
: undefined;
|
|
102
|
+
const legacyPinsPnpm = legacyPm?.name === 'pnpm' && legacyPm.version != null;
|
|
103
|
+
const devEnginesPm = manifest.devEngines.packageManager;
|
|
104
|
+
const pnpmEntry = Array.isArray(devEnginesPm)
|
|
105
|
+
? devEnginesPm.find((e) => e.name === 'pnpm')
|
|
106
|
+
: devEnginesPm.name === 'pnpm' ? devEnginesPm : undefined;
|
|
107
|
+
if (pnpmEntry) {
|
|
108
|
+
const updated = legacyPinsPnpm
|
|
109
|
+
? resolution.manifest.version
|
|
110
|
+
: updateVersionConstraint(pnpmEntry.version, resolution.manifest.version);
|
|
111
|
+
if (updated !== pnpmEntry.version) {
|
|
112
|
+
pnpmEntry.version = updated;
|
|
113
|
+
manifestChanged = true;
|
|
100
114
|
}
|
|
101
115
|
}
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
manifest.
|
|
106
|
-
|
|
116
|
+
if (legacyPinsPnpm) {
|
|
117
|
+
const newLegacy = `pnpm@${resolution.manifest.version}`;
|
|
118
|
+
if (manifest.packageManager !== newLegacy) {
|
|
119
|
+
manifest.packageManager = newLegacy;
|
|
120
|
+
manifestChanged = true;
|
|
107
121
|
}
|
|
108
122
|
}
|
|
123
|
+
if (manifestChanged)
|
|
124
|
+
await writeProjectManifest(manifest);
|
|
109
125
|
const store = await createStoreController(opts);
|
|
110
126
|
await resolvePackageManagerIntegrities(resolution.manifest.version, {
|
|
111
127
|
registries: opts.registries,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/engine.pm.commands",
|
|
3
|
-
"version": "1101.1.
|
|
3
|
+
"version": "1101.1.1",
|
|
4
4
|
"description": "pnpm commands for self-updating and setting up pnpm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
"@pnpm/bins.linker": "1100.0.2",
|
|
36
36
|
"@pnpm/cli.meta": "1100.0.1",
|
|
37
37
|
"@pnpm/cli.utils": "1101.0.0",
|
|
38
|
-
"@pnpm/config.reader": "1101.1.1",
|
|
39
|
-
"@pnpm/error": "1100.0.0",
|
|
40
|
-
"@pnpm/global.commands": "1100.0.5",
|
|
41
|
-
"@pnpm/building.policy": "1100.0.1",
|
|
42
38
|
"@pnpm/deps.graph-hasher": "1100.1.1",
|
|
39
|
+
"@pnpm/building.policy": "1100.0.1",
|
|
40
|
+
"@pnpm/global.commands": "1100.0.6",
|
|
41
|
+
"@pnpm/config.reader": "1101.1.2",
|
|
43
42
|
"@pnpm/global.packages": "1100.0.1",
|
|
44
|
-
"@pnpm/installing.client": "1100.0.
|
|
45
|
-
"@pnpm/
|
|
46
|
-
"@pnpm/installing.
|
|
47
|
-
"@pnpm/
|
|
43
|
+
"@pnpm/installing.client": "1100.0.6",
|
|
44
|
+
"@pnpm/error": "1100.0.0",
|
|
45
|
+
"@pnpm/installing.deps-restorer": "1101.0.1",
|
|
46
|
+
"@pnpm/installing.env-installer": "1101.0.1",
|
|
48
47
|
"@pnpm/resolving.npm-resolver": "1101.0.0",
|
|
49
|
-
"@pnpm/store.connection-manager": "1100.0.5",
|
|
50
48
|
"@pnpm/shell.path": "1100.0.0",
|
|
49
|
+
"@pnpm/lockfile.types": "1100.0.2",
|
|
51
50
|
"@pnpm/store.controller": "1101.0.0",
|
|
52
51
|
"@pnpm/types": "1101.0.0",
|
|
53
|
-
"@pnpm/workspace.project-manifest-reader": "1100.0.2"
|
|
52
|
+
"@pnpm/workspace.project-manifest-reader": "1100.0.2",
|
|
53
|
+
"@pnpm/store.connection-manager": "1100.0.6"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@types/ramda": "0.31.1",
|
|
62
62
|
"@types/semver": "7.7.1",
|
|
63
63
|
"@pnpm/constants": "1100.0.0",
|
|
64
|
-
"@pnpm/engine.pm.commands": "1101.1.
|
|
64
|
+
"@pnpm/engine.pm.commands": "1101.1.1",
|
|
65
|
+
"@pnpm/logger": "1100.0.0",
|
|
65
66
|
"@pnpm/error": "1100.0.0",
|
|
66
67
|
"@pnpm/prepare": "1100.0.3",
|
|
67
|
-
"@pnpm/testing.mock-agent": "1100.0.1"
|
|
68
|
-
"@pnpm/logger": "1100.0.0"
|
|
68
|
+
"@pnpm/testing.mock-agent": "1100.0.1"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=22.13"
|