pnpm-settings-migrator 0.12.0 → 0.13.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/README.md +71 -4
- package/dist/cli.mjs +220 -119
- package/dist/index.d.mts +27 -2
- package/dist/index.mjs +219 -118
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,6 +15,9 @@ Run in your workspace root:
|
|
|
15
15
|
pnpm dlx pnpm-settings-migrator
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
<details>
|
|
19
|
+
<summary>CLI output and migration outcomes</summary>
|
|
20
|
+
|
|
18
21
|
After migration, the CLI reports how many root settings changed and shows a
|
|
19
22
|
GitHub-style YAML diff. Removed lines are red and added lines are green:
|
|
20
23
|
|
|
@@ -49,6 +52,8 @@ Other outcomes are reported according to the files actually changed:
|
|
|
49
52
|
- File formatting changes with no settings diff: `✔ Migration completed. Configuration files updated.`
|
|
50
53
|
- Failure: one error report and exit code `1`.
|
|
51
54
|
|
|
55
|
+
</details>
|
|
56
|
+
|
|
52
57
|
## Library usage
|
|
53
58
|
|
|
54
59
|
```ts
|
|
@@ -57,6 +62,9 @@ import { migratePnpmSettings } from 'pnpm-settings-migrator'
|
|
|
57
62
|
const result = await migratePnpmSettings({ cwd: '/path/to/workspace' })
|
|
58
63
|
```
|
|
59
64
|
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Library results and error handling</summary>
|
|
67
|
+
|
|
60
68
|
Library calls now return a `MigrationResult` and do not print logs. The result
|
|
61
69
|
contains `settingsChanges` (before/after root workspace settings), `changedFiles`
|
|
62
70
|
(absolute paths, including created or removed files), `sourceSettingsCleaned`,
|
|
@@ -64,6 +72,8 @@ contains `settingsChanges` (before/after root workspace settings), `changedFiles
|
|
|
64
72
|
thrown to the caller. Consumers that relied on console output should render the
|
|
65
73
|
returned changes and warnings themselves.
|
|
66
74
|
|
|
75
|
+
</details>
|
|
76
|
+
|
|
67
77
|
## CLI Options
|
|
68
78
|
|
|
69
79
|
### `--cwd`
|
|
@@ -95,6 +105,9 @@ Compatibility major for migrated settings:
|
|
|
95
105
|
- `v12`: use the v12 schema, including `globalShims`, and enable additional
|
|
96
106
|
fields according to the confirmed target version.
|
|
97
107
|
|
|
108
|
+
<details>
|
|
109
|
+
<summary>Compatibility resolution and validation</summary>
|
|
110
|
+
|
|
98
111
|
An explicit major still uses a matching version from the project declarations.
|
|
99
112
|
For example, `--compatibility v12` with `packageManager: "pnpm@12.4.0"` enables
|
|
100
113
|
12.4 capabilities. A pin to another major supplies no minor capabilities for
|
|
@@ -104,6 +117,8 @@ In `v11` and `v12` modes, the migrator validates existing workspace keys,
|
|
|
104
117
|
filters incoming settings against the resolved capabilities, and applies
|
|
105
118
|
required normalization to legacy files and `pnpm-workspace.yaml`.
|
|
106
119
|
|
|
120
|
+
</details>
|
|
121
|
+
|
|
107
122
|
### `--target-version`
|
|
108
123
|
|
|
109
124
|
- **Type**: `string` (an exact version such as `'12.4.0'`)
|
|
@@ -120,12 +135,20 @@ await migratePnpmSettings({ compatibility: 'v12' }) // Infer a matching minor
|
|
|
120
135
|
await migratePnpmSettings({ targetVersion: '12.4.0' }) // Target this exact release
|
|
121
136
|
```
|
|
122
137
|
|
|
138
|
+
<details>
|
|
139
|
+
<summary>Version inference and supported version formats</summary>
|
|
140
|
+
|
|
123
141
|
Version ranges are not accepted by `targetVersion`. Project ranges, conflicting
|
|
124
142
|
`devEngines` entries, prereleases, and declarations without a confirmed matching
|
|
125
143
|
version retain the base major schema. Build metadata on exact stable versions
|
|
126
144
|
is accepted. Later stable minors automatically inherit known capabilities;
|
|
127
145
|
there are no minor-specific compatibility options.
|
|
128
146
|
|
|
147
|
+
</details>
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary>Version-specific settings and requirements</summary>
|
|
151
|
+
|
|
129
152
|
For pnpm 12.4.0 and later stable v12 releases, the migrator additionally accepts
|
|
130
153
|
`trustPolicyExcludePrune`, `python`, `cargo`, `pipelines`, `pipelineBase`, and
|
|
131
154
|
`packageConfigs`, plus task fields `outputs`, `inputs`, `env`, `cache`, and
|
|
@@ -150,6 +173,18 @@ never migrated into the project workspace.
|
|
|
150
173
|
On the v11 line, `trustPolicyExcludePrune` requires a confirmed stable version
|
|
151
174
|
from 11.27.0 onward; v12 support still starts at 12.4.0.
|
|
152
175
|
|
|
176
|
+
For pnpm 12.6.0 and later stable v12 releases, the migrator accepts `autoDedupe`,
|
|
177
|
+
`saveTypes`, `tagVersionPrefix`, and signed 32-bit `tasks.*.priority` values.
|
|
178
|
+
`progress` and `loglevel` also require 12.6.0 for v12 targets, when pnpm first
|
|
179
|
+
consumes them from workspace configuration; their v11 support is unchanged.
|
|
180
|
+
Invalid values and fields unsupported by the target remain in their sources.
|
|
181
|
+
The global-only `macosBackup` setting is preserved with a project-refused warning.
|
|
182
|
+
|
|
183
|
+
</details>
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary>Automated v10 to v11 conversions</summary>
|
|
187
|
+
|
|
153
188
|
Automated v10 to v11 conversions include:
|
|
154
189
|
|
|
155
190
|
- `managePackageManagerVersions`, `packageManagerStrict`, and
|
|
@@ -164,6 +199,11 @@ Automated v10 to v11 conversions include:
|
|
|
164
199
|
- removal of `ignoreDepScripts` and `ignorePatchFailures`, which have no v11
|
|
165
200
|
equivalent
|
|
166
201
|
|
|
202
|
+
</details>
|
|
203
|
+
|
|
204
|
+
<details>
|
|
205
|
+
<summary>Migration rules, limitations, and compatibility coverage</summary>
|
|
206
|
+
|
|
167
207
|
Notes:
|
|
168
208
|
|
|
169
209
|
- `.npmrc` migration is aligned with the target pnpm workspace schema. Unknown
|
|
@@ -214,13 +254,19 @@ Notes:
|
|
|
214
254
|
- The migrator does not update the `packageManager` version, CI environment variables,
|
|
215
255
|
shell setup, or pnpm commands in scripts. When `packageManager` still pins pnpm 10,
|
|
216
256
|
pass `--compatibility v11` explicitly and update the pin separately.
|
|
217
|
-
- Compatibility checks cover pnpm 11.27.1 and 12.
|
|
218
|
-
11.26.0, 12.2.1, 12.3.4, 12.4.0, 12.4.2, and 12.5.
|
|
219
|
-
As audited on 2026-09-
|
|
220
|
-
the
|
|
257
|
+
- Compatibility checks cover pnpm 11.27.1 and 12.6.0, retaining 11.25.0,
|
|
258
|
+
11.26.0, 12.2.1, 12.3.4, 12.4.0, 12.4.2, 12.5.0, and 12.5.1 regressions.
|
|
259
|
+
As [audited on 2026-09-24](docs/research/pnpm-settings-bump-2026-09-24.md),
|
|
260
|
+
npm `latest` and the highest stable release are 12.6.0; `latest-11` is 11.27.1.
|
|
261
|
+
The project is pinned to 12.6.0. The removed `pnpm install --resolution-only` CLI
|
|
221
262
|
flag is outside this settings migrator's scope; replace it with
|
|
222
263
|
`pnpm peers check` in scripts before upgrading.
|
|
223
264
|
|
|
265
|
+
</details>
|
|
266
|
+
|
|
267
|
+
<details>
|
|
268
|
+
<summary>Target version migration example</summary>
|
|
269
|
+
|
|
224
270
|
For example, `--target-version 12.4.0` migrates this legacy configuration:
|
|
225
271
|
|
|
226
272
|
```json
|
|
@@ -239,6 +285,8 @@ With `--target-version 12.3.4`, these settings remain in `package.json` with an
|
|
|
239
285
|
incompatibility warning. See the [version audit](docs/research/pnpm-recent-settings-audit-2026-09-10.md)
|
|
240
286
|
for the upstream release and schema references.
|
|
241
287
|
|
|
288
|
+
</details>
|
|
289
|
+
|
|
242
290
|
### `--replace-deprecated`
|
|
243
291
|
|
|
244
292
|
- **Type**: `boolean`
|
|
@@ -246,6 +294,9 @@ for the upstream release and schema references.
|
|
|
246
294
|
|
|
247
295
|
Force replacing deprecated pnpm settings with new keys and remove old keys during migration.
|
|
248
296
|
|
|
297
|
+
<details>
|
|
298
|
+
<summary>Deprecated setting conversion examples</summary>
|
|
299
|
+
|
|
249
300
|
Example conversions:
|
|
250
301
|
|
|
251
302
|
- `allowNonAppliedPatches` -> `allowUnusedPatches`
|
|
@@ -258,6 +309,8 @@ Example conversions:
|
|
|
258
309
|
`sideEffectsCache`
|
|
259
310
|
- non-conflicting `namedRegistries` aliases -> URL-keyed `registries`
|
|
260
311
|
|
|
312
|
+
</details>
|
|
313
|
+
|
|
261
314
|
### `--strategy`
|
|
262
315
|
|
|
263
316
|
- **Type**: `'discard' | 'merge' | 'overwrite'`
|
|
@@ -269,6 +322,10 @@ Strategy to handle conflicts when merging settings with existing `pnpm-workspace
|
|
|
269
322
|
- `merge`: Deep merge with array deduplication. Arrays are combined and deduplicated, objects are recursively merged, primitives keep existing values.
|
|
270
323
|
- `overwrite`: Use incoming values, only keep existing keys not present in incoming settings. For nested objects, merges keys from both.
|
|
271
324
|
|
|
325
|
+
`packageConfigs` matcher arrays preserve order and repeated entries because the
|
|
326
|
+
last matching entry wins. With `merge`, incoming matchers follow existing ones;
|
|
327
|
+
an overlapping end/start sequence is reused to keep repeated migrations stable.
|
|
328
|
+
|
|
272
329
|
### `--no-yarn-resolutions`
|
|
273
330
|
|
|
274
331
|
- **Type**: `boolean`
|
|
@@ -276,6 +333,9 @@ Strategy to handle conflicts when merging settings with existing `pnpm-workspace
|
|
|
276
333
|
|
|
277
334
|
Disable migrating `resolutions` field in `package.json`.
|
|
278
335
|
|
|
336
|
+
<details>
|
|
337
|
+
<summary>Yarn selector translation and warnings</summary>
|
|
338
|
+
|
|
279
339
|
By default, plain package names are copied to pnpm overrides and global Yarn
|
|
280
340
|
selectors are translated: `**/foo` becomes `foo`, and `**/@scope/foo` becomes
|
|
281
341
|
`@scope/foo`. Path-specific selectors such as `parent/child` and
|
|
@@ -292,6 +352,8 @@ WARN Kept Yarn resolution "parent/**/child" in package.json: its selector cannot
|
|
|
292
352
|
ℹ No changes needed.
|
|
293
353
|
```
|
|
294
354
|
|
|
355
|
+
</details>
|
|
356
|
+
|
|
295
357
|
### `--no-show-changes`
|
|
296
358
|
|
|
297
359
|
- **Type**: `boolean`
|
|
@@ -325,6 +387,9 @@ Disable adding newlines between each root keys.
|
|
|
325
387
|
|
|
326
388
|
This document demonstrates how different merge strategies work when migrating pnpm settings.
|
|
327
389
|
|
|
390
|
+
<details>
|
|
391
|
+
<summary>Compare merge strategies with configuration examples</summary>
|
|
392
|
+
|
|
328
393
|
### Scenario
|
|
329
394
|
|
|
330
395
|
Existing `pnpm-workspace.yaml`:
|
|
@@ -459,6 +524,8 @@ peerDependencyRules:
|
|
|
459
524
|
- vue-router # Arrays merged and deduplicated
|
|
460
525
|
```
|
|
461
526
|
|
|
527
|
+
</details>
|
|
528
|
+
|
|
462
529
|
## Context
|
|
463
530
|
|
|
464
531
|
- [Moving settings to pnpm-workspace.yaml](https://github.com/orgs/pnpm/discussions/9037)
|