pnpm-settings-migrator 0.17.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 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 root workspace settings), `changedFiles`
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 when write `pnpm-workspace.yaml`.
95
+ Sort keys in written workspace and local include YAML documents.
96
96
 
97
97
  ### `--compatibility`
98
98
 
@@ -202,7 +202,8 @@ From 11.28.3, non-null `allowBuilds` values must be maps of booleans or strings.
202
202
  From 11.28.4, non-null `allowUnusedPatches` must be boolean, and non-null
203
203
  `ignoredOptionalDependencies` / `requiredScripts` must be string arrays.
204
204
  From 11.28.5, `httpProxy` and `httpsProxy` must be strings, including when empty;
205
- null is incompatible. Invalid values remain in their sources with diagnostics.
205
+ null is incompatible in 11.28.5. From 11.28.6, null is accepted again and leaves
206
+ the proxy unset. Invalid values remain in their sources with diagnostics.
206
207
 
207
208
  For pnpm 12.9.0 and later stable v12 releases, URL-keyed `registries` entries
208
209
  can set `networkConcurrency` to a positive safe integer, or null to leave it
@@ -250,6 +251,88 @@ and URL-keyed `registries` using that exact prefix remain in their sources;
250
251
  existing workspace declarations block migration. This restriction is
251
252
  case-sensitive (`ToOl` remains valid), unlike the existing `pkg` restriction.
252
253
 
254
+ For pnpm 12.13.0 and later stable v12 releases, `nodePackageMap` accepts
255
+ `mode: off | write-only | load` and `type: standard | loose`. The section and
256
+ its fields may be null to leave them unset. New and legacy
257
+ `nodeExperimentalPackageMap` / `nodePackageMapType` values are preserved so pnpm
258
+ applies the new section's field-level precedence. `storeIndexFormat` accepts
259
+ `sqlite`, `files`, or null; `files` supports stores shared over network filesystems.
260
+ Enum values may use environment placeholders, which are preserved without expansion.
261
+ Older or unconfirmed targets retain these settings in their source.
262
+
263
+ For pnpm 12.14.0 and later stable v12 releases, `sideEffectsCache.exclude`
264
+ accepts package patterns such as `['java', '@native/*', 'example@1']`, an empty
265
+ array, or null. Excluded builds are neither restored nor saved in local or remote
266
+ caches. Cache `read` and `write` values may also use preserved environment
267
+ placeholders. On older targets, the complete cache section stays in its source.
268
+ Invalid nested values and unknown fields also preserve the complete source
269
+ section; existing incompatible workspace values block writes.
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
+
253
336
  pnpm v12 reads `filter` and `filterProd` from CLI arguments or `updateConfig`
254
337
  hooks, not workspace YAML. These settings remain in their source with
255
338
  diagnostics for v12 targets; existing YAML containing them blocks migration.
@@ -346,17 +429,21 @@ Notes:
346
429
  - The migrator does not update the `packageManager` version, CI environment variables,
347
430
  shell setup, or pnpm commands in scripts. When `packageManager` still pins pnpm 10,
348
431
  pass `--compatibility v11` explicitly and update the pin separately.
349
- - Compatibility checks cover pnpm 11.28.5 and 12.12.1, including 11.28.0,
350
- 11.28.1, 11.28.2, 11.28.3, 11.28.4, 12.7.0, 12.8.0, 12.8.1, 12.8.2,
351
- 12.9.0, 12.9.1, 12.10.0, 12.10.1, 12.11.0, 12.11.1, 12.11.2, and 12.12.0.
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.
352
436
  Earlier regressions remain at 11.25.0,
353
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.
354
- As [audited on 2026-10-13](docs/research/pnpm-settings-bump-2026-10-13.md),
355
- npm `latest` is 12.11.2; the highest confirmed stable release is 12.12.1 on
356
- `next-12`. The v11 target is 11.28.5 on `next-11`, while `latest-11` is
357
- 11.28.2. The project is pinned to 12.11.2. These checks verify the documented
358
- fixtures, not every setting in every release. v10 has unit regressions and
359
- source review through 10.34.7; real v10 consumption remains unverified.
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.
360
447
  The removed `pnpm install --resolution-only` CLI flag is outside this settings
361
448
  migrator's scope; replace it with `pnpm peers check` in scripts before upgrading.
362
449