pnpm-settings-migrator 0.18.0 → 0.19.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 +80 -12
- package/dist/cli.mjs +931 -48
- package/dist/index.d.mts +74 -12
- package/dist/index.mjs +930 -47
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ const result = await migratePnpmSettings({ cwd: '/path/to/workspace' })
|
|
|
70
70
|
<summary>Library results and error handling</summary>
|
|
71
71
|
|
|
72
72
|
Library calls now return a `MigrationResult` and do not print logs. The result
|
|
73
|
-
contains `settingsChanges` (before/after
|
|
73
|
+
contains `settingsChanges` (before/after effective workspace settings, including includes), `changedFiles`
|
|
74
74
|
(absolute paths, including created or removed files), `sourceSettingsCleaned`,
|
|
75
75
|
`packageJsonRuntimeChanged`, `hasConfigurationFiles`, and `warnings`. Errors are
|
|
76
76
|
thrown to the caller. Consumers that relied on console output should render the
|
|
@@ -92,7 +92,7 @@ Current working directory.
|
|
|
92
92
|
- **Type**: `boolean`
|
|
93
93
|
- **Default**: `false`
|
|
94
94
|
|
|
95
|
-
Sort keys
|
|
95
|
+
Sort keys in written workspace and local include YAML documents.
|
|
96
96
|
|
|
97
97
|
### `--compatibility`
|
|
98
98
|
|
|
@@ -268,6 +268,71 @@ placeholders. On older targets, the complete cache section stays in its source.
|
|
|
268
268
|
Invalid nested values and unknown fields also preserve the complete source
|
|
269
269
|
section; existing incompatible workspace values block writes.
|
|
270
270
|
|
|
271
|
+
For pnpm 12.15.0 and later stable v12 releases, `bootConfig` accepts bootstrap
|
|
272
|
+
release-age and trust-policy settings: `minimumReleaseAge`,
|
|
273
|
+
`minimumReleaseAgeExclude`, `minimumReleaseAgeStrict`,
|
|
274
|
+
`minimumReleaseAgeIgnoreMissingTime`, `trustPolicy`, `trustPolicyExclude`, and
|
|
275
|
+
`trustPolicyIgnoreAfter`. The section and individual fields may be null.
|
|
276
|
+
Bootstrap policy stays separate from normal install policy; neither is copied
|
|
277
|
+
into the other. Unknown nested keys or invalid values preserve the entire section.
|
|
278
|
+
|
|
279
|
+
`maxTarballUnpackedSize` requires 11.28.7+ or 12.15.0+ and accepts a nonnegative
|
|
280
|
+
safe integer in bytes, or null to leave pnpm's default effective. Numeric
|
|
281
|
+
`.npmrc` values become YAML numbers. The migrator does not add pnpm's 4 GiB
|
|
282
|
+
default. From 11.28.7, v11 also accepts `autoInstallPeersFromHighestMatch`
|
|
283
|
+
(boolean or null) and `externalDependencies` (string array or null).
|
|
284
|
+
|
|
285
|
+
From 12.15.0, `lockfile.integrityTarget` accepts `resource`, `tar`, or null,
|
|
286
|
+
and npm `registries` declarations accept `serverType: pnpr` for tar registries.
|
|
287
|
+
Unsupported nested fields keep the complete lockfile or registry section in its
|
|
288
|
+
source. For example, `lockfile: { integrityTarget: tar }` migrates at 12.15.0
|
|
289
|
+
and remains in the source at 12.14.0.
|
|
290
|
+
|
|
291
|
+
pnpm 12.15's `include` delegates settings to local YAML files or declared
|
|
292
|
+
config dependencies. The migrator reads the effective workspace and writes
|
|
293
|
+
settings to their physical owners, preserving the include index, YAML comments,
|
|
294
|
+
and unchanged files. Explicit lists reserve settings even when absent;
|
|
295
|
+
`'*'` is allowed only for local files and owns the settings they already define.
|
|
296
|
+
`catalog` / `catalogs.default` refer to the default catalog, `catalogs.name`
|
|
297
|
+
selects one named catalog, and `catalogs` reserves every catalog.
|
|
298
|
+
|
|
299
|
+
```yaml
|
|
300
|
+
include:
|
|
301
|
+
./config/layout.yaml: [modulesDir, packages]
|
|
302
|
+
./config/catalogs.yaml: [catalogs.frontend]
|
|
303
|
+
'@acme/policy': [minimumReleaseAge, trustPolicy]
|
|
304
|
+
configDependencies:
|
|
305
|
+
'@acme/policy': 1.0.0
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
A legacy `modulesDir: ./node_modules` value is written as
|
|
309
|
+
`modulesDir: ../node_modules` in `config/layout.yaml`, keeping the same location.
|
|
310
|
+
Path settings, package globs, pnpmfiles, patch paths, and local catalog/override
|
|
311
|
+
specifiers use the owning file's directory. New settings without an owner stay
|
|
312
|
+
in the root. `discard`, `merge`, and `overwrite` apply inside local owners.
|
|
313
|
+
YAML merge keys participate in ownership checks and are expanded when removing
|
|
314
|
+
an inherited legacy key is necessary.
|
|
315
|
+
|
|
316
|
+
Config dependencies remain read-only. The migrator reads each installed
|
|
317
|
+
package's `pnpm.config` entry under `node_modules/.pnpm-config`. A source value
|
|
318
|
+
already represented by that policy can be cleaned; conflicting values remain
|
|
319
|
+
with diagnostics under every strategy. If a policy package is not installed or
|
|
320
|
+
its installed version differs from the proposed declaration, its delegated
|
|
321
|
+
source values remain until the matching version is installed and migration is
|
|
322
|
+
run again. Legacy workspace settings are also retained when conversion would
|
|
323
|
+
lose their values behind a read-only replacement. The migrator does not install
|
|
324
|
+
packages. Nested includes, overlapping
|
|
325
|
+
owners, undelegated fields, invalid entries, and paths escaping a config
|
|
326
|
+
dependency's package stop migration before writes. Included local files must
|
|
327
|
+
already exist; installed policy files cannot also be writable destinations,
|
|
328
|
+
including through symlinks or hard links. A merge that would define both
|
|
329
|
+
`catalog` and `catalogs.default` stops before writes; consolidate them into one
|
|
330
|
+
form first. All destinations are
|
|
331
|
+
validated and rendered before writing, and legacy sources are retained if any
|
|
332
|
+
destination write fails. Credentials and trusted global settings keep their
|
|
333
|
+
existing protections. Earlier or unconfirmed targets retain incoming include
|
|
334
|
+
indexes with diagnostics and reject existing included workspaces.
|
|
335
|
+
|
|
271
336
|
pnpm v12 reads `filter` and `filterProd` from CLI arguments or `updateConfig`
|
|
272
337
|
hooks, not workspace YAML. These settings remain in their source with
|
|
273
338
|
diagnostics for v12 targets; existing YAML containing them blocks migration.
|
|
@@ -364,18 +429,21 @@ Notes:
|
|
|
364
429
|
- The migrator does not update the `packageManager` version, CI environment variables,
|
|
365
430
|
shell setup, or pnpm commands in scripts. When `packageManager` still pins pnpm 10,
|
|
366
431
|
pass `--compatibility v11` explicitly and update the pin separately.
|
|
367
|
-
- Compatibility checks cover pnpm 11.28.
|
|
368
|
-
11.28.1, 11.28.2, 11.28.3, 11.28.4, 11.28.5,
|
|
369
|
-
12.8.2, 12.9.0, 12.9.1, 12.10.0, 12.10.1, 12.11.0, 12.11.1,
|
|
370
|
-
12.12.0, 12.12.1, and 12.
|
|
432
|
+
- Compatibility checks cover pnpm 11.28.7 and 12.15.0, including 11.28.0,
|
|
433
|
+
11.28.1, 11.28.2, 11.28.3, 11.28.4, 11.28.5, 11.28.6, 12.7.0, 12.8.0,
|
|
434
|
+
12.8.1, 12.8.2, 12.9.0, 12.9.1, 12.10.0, 12.10.1, 12.11.0, 12.11.1,
|
|
435
|
+
12.11.2, 12.12.0, 12.12.1, 12.13.0, and 12.14.0.
|
|
371
436
|
Earlier regressions remain at 11.25.0,
|
|
372
437
|
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.
|
|
373
|
-
As [audited on 2026-10-
|
|
374
|
-
npm `latest` and the highest confirmed stable release are 12.
|
|
375
|
-
`latest-12` and `next-12`. The v11
|
|
376
|
-
`next-11
|
|
377
|
-
|
|
378
|
-
|
|
438
|
+
As [audited on 2026-10-22](docs/research/pnpm-settings-bump-2026-10-22.md),
|
|
439
|
+
npm `latest` and the highest confirmed stable release are 12.15.0, also on
|
|
440
|
+
`latest-12` and `next-12`. The highest stable v11 release, 11.28.7, is on
|
|
441
|
+
`next-11`; `latest-11` still points to 11.28.6. GitHub marks both targets as
|
|
442
|
+
non-prereleases. The project is pinned to 12.15.0. These checks verify the
|
|
443
|
+
documented fixtures, not every setting in every release. Local and config
|
|
444
|
+
dependency `include` consumption is verified on 12.15.0, with 12.14.0 as the
|
|
445
|
+
preceding boundary. v10 has unit regressions and source review
|
|
446
|
+
through 10.34.7; real v10 consumption remains unverified.
|
|
379
447
|
The removed `pnpm install --resolution-only` CLI flag is outside this settings
|
|
380
448
|
migrator's scope; replace it with `pnpm peers check` in scripts before upgrading.
|
|
381
449
|
|