pnpm-settings-migrator 0.12.0 → 0.14.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 +90 -6
- package/dist/cli.mjs +306 -122
- package/dist/index.d.mts +41 -2
- package/dist/index.mjs +305 -121
- package/package.json +6 -6
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,32 @@ 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
|
+
`forceIgnoresPlatform` requires pnpm 11.28.0+ or 12.7.0+. pnpm's defaults differ
|
|
184
|
+
between those majors; the migrator only moves explicit values. For v12,
|
|
185
|
+
`publishWaitTimeout` and `reporter` require 12.7.0+. The timeout is a nonnegative
|
|
186
|
+
safe integer in milliseconds (zero disables waiting); numeric `.npmrc` values
|
|
187
|
+
are converted to YAML numbers. Reporter values are `default`, `append-only`,
|
|
188
|
+
`ndjson`, and `silent`, or preserved environment placeholders.
|
|
189
|
+
|
|
190
|
+
From 11.28.0 / 12.7.0, dynamic `userAgent` values remain in their sources because
|
|
191
|
+
pnpm ignores project values containing environment placeholders. From 11.28.1,
|
|
192
|
+
invalid `patchedDependencies` maps and non-array `packages` values are retained
|
|
193
|
+
with diagnostics. From 12.8.2, `globalShims` belongs in trusted global
|
|
194
|
+
configuration and is retained with an incompatibility warning. Existing
|
|
195
|
+
workspaces containing these incompatible values fail validation before writes.
|
|
196
|
+
|
|
197
|
+
</details>
|
|
198
|
+
|
|
199
|
+
<details>
|
|
200
|
+
<summary>Automated v10 to v11 conversions</summary>
|
|
201
|
+
|
|
153
202
|
Automated v10 to v11 conversions include:
|
|
154
203
|
|
|
155
204
|
- `managePackageManagerVersions`, `packageManagerStrict`, and
|
|
@@ -164,6 +213,11 @@ Automated v10 to v11 conversions include:
|
|
|
164
213
|
- removal of `ignoreDepScripts` and `ignorePatchFailures`, which have no v11
|
|
165
214
|
equivalent
|
|
166
215
|
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary>Migration rules, limitations, and compatibility coverage</summary>
|
|
220
|
+
|
|
167
221
|
Notes:
|
|
168
222
|
|
|
169
223
|
- `.npmrc` migration is aligned with the target pnpm workspace schema. Unknown
|
|
@@ -214,12 +268,21 @@ Notes:
|
|
|
214
268
|
- The migrator does not update the `packageManager` version, CI environment variables,
|
|
215
269
|
shell setup, or pnpm commands in scripts. When `packageManager` still pins pnpm 10,
|
|
216
270
|
pass `--compatibility v11` explicitly and update the pin separately.
|
|
217
|
-
- Compatibility checks cover pnpm 11.
|
|
218
|
-
11.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
`
|
|
271
|
+
- Compatibility checks cover pnpm 11.28.2 and 12.8.2, including 11.28.0,
|
|
272
|
+
11.28.1, 12.7.0, 12.8.0, and 12.8.1. Earlier regressions remain at 11.25.0,
|
|
273
|
+
11.26.0, 11.27.1, 12.2.1, 12.3.4, 12.4.0, 12.4.2, 12.5.0, 12.5.1, and 12.6.0.
|
|
274
|
+
As [audited on 2026-09-30](docs/research/pnpm-settings-bump-2026-09-30.md),
|
|
275
|
+
npm `latest` is 12.8.1; the highest confirmed stable release is 12.8.2 on
|
|
276
|
+
`next-12`. The project is pinned to 12.8.1. These checks verify the documented
|
|
277
|
+
fixtures, not every setting in every release. v10 has unit regressions and
|
|
278
|
+
source review through 10.34.6; real v10 consumption remains unverified.
|
|
279
|
+
The removed `pnpm install --resolution-only` CLI flag is outside this settings
|
|
280
|
+
migrator's scope; replace it with `pnpm peers check` in scripts before upgrading.
|
|
281
|
+
|
|
282
|
+
</details>
|
|
283
|
+
|
|
284
|
+
<details>
|
|
285
|
+
<summary>Target version migration example</summary>
|
|
223
286
|
|
|
224
287
|
For example, `--target-version 12.4.0` migrates this legacy configuration:
|
|
225
288
|
|
|
@@ -239,6 +302,8 @@ With `--target-version 12.3.4`, these settings remain in `package.json` with an
|
|
|
239
302
|
incompatibility warning. See the [version audit](docs/research/pnpm-recent-settings-audit-2026-09-10.md)
|
|
240
303
|
for the upstream release and schema references.
|
|
241
304
|
|
|
305
|
+
</details>
|
|
306
|
+
|
|
242
307
|
### `--replace-deprecated`
|
|
243
308
|
|
|
244
309
|
- **Type**: `boolean`
|
|
@@ -246,6 +311,9 @@ for the upstream release and schema references.
|
|
|
246
311
|
|
|
247
312
|
Force replacing deprecated pnpm settings with new keys and remove old keys during migration.
|
|
248
313
|
|
|
314
|
+
<details>
|
|
315
|
+
<summary>Deprecated setting conversion examples</summary>
|
|
316
|
+
|
|
249
317
|
Example conversions:
|
|
250
318
|
|
|
251
319
|
- `allowNonAppliedPatches` -> `allowUnusedPatches`
|
|
@@ -258,6 +326,8 @@ Example conversions:
|
|
|
258
326
|
`sideEffectsCache`
|
|
259
327
|
- non-conflicting `namedRegistries` aliases -> URL-keyed `registries`
|
|
260
328
|
|
|
329
|
+
</details>
|
|
330
|
+
|
|
261
331
|
### `--strategy`
|
|
262
332
|
|
|
263
333
|
- **Type**: `'discard' | 'merge' | 'overwrite'`
|
|
@@ -269,6 +339,10 @@ Strategy to handle conflicts when merging settings with existing `pnpm-workspace
|
|
|
269
339
|
- `merge`: Deep merge with array deduplication. Arrays are combined and deduplicated, objects are recursively merged, primitives keep existing values.
|
|
270
340
|
- `overwrite`: Use incoming values, only keep existing keys not present in incoming settings. For nested objects, merges keys from both.
|
|
271
341
|
|
|
342
|
+
`packageConfigs` matcher arrays preserve order and repeated entries because the
|
|
343
|
+
last matching entry wins. With `merge`, incoming matchers follow existing ones;
|
|
344
|
+
an overlapping end/start sequence is reused to keep repeated migrations stable.
|
|
345
|
+
|
|
272
346
|
### `--no-yarn-resolutions`
|
|
273
347
|
|
|
274
348
|
- **Type**: `boolean`
|
|
@@ -276,6 +350,9 @@ Strategy to handle conflicts when merging settings with existing `pnpm-workspace
|
|
|
276
350
|
|
|
277
351
|
Disable migrating `resolutions` field in `package.json`.
|
|
278
352
|
|
|
353
|
+
<details>
|
|
354
|
+
<summary>Yarn selector translation and warnings</summary>
|
|
355
|
+
|
|
279
356
|
By default, plain package names are copied to pnpm overrides and global Yarn
|
|
280
357
|
selectors are translated: `**/foo` becomes `foo`, and `**/@scope/foo` becomes
|
|
281
358
|
`@scope/foo`. Path-specific selectors such as `parent/child` and
|
|
@@ -292,6 +369,8 @@ WARN Kept Yarn resolution "parent/**/child" in package.json: its selector cannot
|
|
|
292
369
|
ℹ No changes needed.
|
|
293
370
|
```
|
|
294
371
|
|
|
372
|
+
</details>
|
|
373
|
+
|
|
295
374
|
### `--no-show-changes`
|
|
296
375
|
|
|
297
376
|
- **Type**: `boolean`
|
|
@@ -325,6 +404,9 @@ Disable adding newlines between each root keys.
|
|
|
325
404
|
|
|
326
405
|
This document demonstrates how different merge strategies work when migrating pnpm settings.
|
|
327
406
|
|
|
407
|
+
<details>
|
|
408
|
+
<summary>Compare merge strategies with configuration examples</summary>
|
|
409
|
+
|
|
328
410
|
### Scenario
|
|
329
411
|
|
|
330
412
|
Existing `pnpm-workspace.yaml`:
|
|
@@ -459,6 +541,8 @@ peerDependencyRules:
|
|
|
459
541
|
- vue-router # Arrays merged and deduplicated
|
|
460
542
|
```
|
|
461
543
|
|
|
544
|
+
</details>
|
|
545
|
+
|
|
462
546
|
## Context
|
|
463
547
|
|
|
464
548
|
- [Moving settings to pnpm-workspace.yaml](https://github.com/orgs/pnpm/discussions/9037)
|