pnpm-settings-migrator 0.18.0 → 0.20.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
 
@@ -268,6 +268,91 @@ 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
+
336
+ From pnpm 12.16.0, `strictSsl` and `runtime` accept booleans or null,
337
+ `localAddress` and `tag` accept strings or null, and `requiredScripts` accepts
338
+ string arrays or null. These settings remain in their sources for earlier or
339
+ unconfirmed v12 targets. `runtime: false` disables installing declared runtimes;
340
+ `tag: next` selects that distribution tag when adding a package without a version.
341
+ Invalid IP address strings stay unchanged because pnpm treats them as unset.
342
+ String placeholders are preserved without expansion. Invalid types keep the
343
+ complete setting in its source. For example, `required-scripts[]=build` becomes
344
+ `requiredScripts: [build]` at 12.16.0 and stays in `.npmrc` at 12.15.0.
345
+
346
+ From pnpm 11.28.9, v11 registry declarations also accept `serverType: pnpr`.
347
+ Earlier or unconfirmed v11 targets retain the complete registry map. The setting
348
+ does not enable v12-only registry fields such as `networkConcurrency` or `ecosystem`.
349
+
350
+ pnpm 12.16 no longer consumes `scriptsPrependNodePath`, so the migrator keeps
351
+ incoming values in their sources and rejects existing workspace values before
352
+ writes. Project `ci` values and the global-only `symlinkedLockfileTargetDirs`
353
+ also stay in their sources. Configure the latter in trusted global configuration
354
+ or through `PNPM_CONFIG_SYMLINKED_LOCKFILE_TARGET_DIRS`.
355
+
271
356
  pnpm v12 reads `filter` and `filterProd` from CLI arguments or `updateConfig`
272
357
  hooks, not workspace YAML. These settings remain in their source with
273
358
  diagnostics for v12 targets; existing YAML containing them blocks migration.
@@ -320,6 +405,24 @@ Notes:
320
405
  - Invalid registry locations, including relative paths and object property names
321
406
  such as `__proto__`, remain in their sources with diagnostics. Registry
322
407
  conversion never uses inherited object properties as declarations.
408
+ - Registry maps are validated as a whole, including declarations without
409
+ versioned fields. An invalid sibling
410
+ declaration keeps every registry in its source under all merge strategies;
411
+ existing incompatible maps block migration before any writes.
412
+ - A URL key must name a declaration object. String values are accepted only in
413
+ the legacy scope map representation, whose keys cannot look like URLs.
414
+ Invalid registry settings remain intact in `package.json` and `.npmrc`, while
415
+ unrelated valid settings can still migrate and be cleaned from their sources.
416
+ - Legacy `<scope>: <url>` routes and URL-keyed declarations cannot be mixed,
417
+ including when `replaceDeprecated` introduces the mixture. The structure is
418
+ checked independently of versioned registry fields.
419
+ - Registry prefixes must be unique. A scope may be repeated only when it routes
420
+ to the same registry after the target pnpm version's URL normalization. From
421
+ 12.11.1, the exact HTTPS and protocol-relative npm `.com` registry roots are
422
+ equivalent to `.org`; earlier or unconfirmed v12 targets compare them literally.
423
+ Routing conflicts introduced by merging or deprecated-setting conversion stop
424
+ migration before any destination writes
425
+ or source cleanup, including when registries belong to an included YAML file.
323
426
  - Dynamic `${...}` values in `httpProxy`, `httpsProxy`, `noProxy`, `proxy`, and
324
427
  `noproxy` stay in their source for every target. Project YAML does not expand
325
428
  these placeholders; configure them globally in trusted configuration or use
@@ -364,18 +467,29 @@ Notes:
364
467
  - The migrator does not update the `packageManager` version, CI environment variables,
365
468
  shell setup, or pnpm commands in scripts. When `packageManager` still pins pnpm 10,
366
469
  pass `--compatibility v11` explicitly and update the pin separately.
367
- - Compatibility checks cover pnpm 11.28.6 and 12.14.0, including 11.28.0,
368
- 11.28.1, 11.28.2, 11.28.3, 11.28.4, 11.28.5, 12.7.0, 12.8.0, 12.8.1,
369
- 12.8.2, 12.9.0, 12.9.1, 12.10.0, 12.10.1, 12.11.0, 12.11.1, 12.11.2,
370
- 12.12.0, 12.12.1, and 12.13.0.
470
+ - Compatibility checks cover pnpm 11.28.9 and 12.16.1, including 11.28.0,
471
+ 11.28.1, 11.28.2, 11.28.3, 11.28.4, 11.28.5, 11.28.6, 12.7.0, 12.8.0,
472
+ 12.8.1, 12.8.2, 12.9.0, 12.9.1, 12.10.0, 12.10.1, 12.11.0, 12.11.1,
473
+ 12.11.2, 12.12.0, 12.12.1, 12.13.0, 12.14.0, 11.28.7, 11.28.8,
474
+ 12.15.0, and 12.16.0.
371
475
  Earlier regressions remain at 11.25.0,
372
476
  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-17](docs/research/pnpm-settings-bump-2026-10-17.md),
374
- npm `latest` and the highest confirmed stable release are 12.14.0, also on
375
- `latest-12` and `next-12`. The v11 target is 11.28.6 on both `latest-11` and
376
- `next-11`. The project is pinned to 12.14.0. These checks verify the documented
377
- fixtures, not every setting in every release. v10 has unit regressions and
378
- source review through 10.34.7; real v10 consumption remains unverified.
477
+ As [audited on 2026-10-29](docs/research/pnpm-settings-bump-2026-10-29.md),
478
+ npm `latest` and the highest confirmed stable release are 12.16.1, also on
479
+ `latest-12` and `next-12`. The highest stable v11 release, 11.28.9, is on
480
+ `latest-11` and `next-11`. GitHub marks both targets as non-prereleases.
481
+ The project is pinned to 12.16.1. These checks verify the
482
+ documented fixtures, not every setting in every release. Local and config
483
+ dependency `include` consumption is verified on 12.15.0, with 12.14.0 as the
484
+ preceding boundary. v10 has unit regressions and source review
485
+ through 10.34.9; real v10 consumption remains unverified. The 12.16 fixtures
486
+ verify TLS certificate handling against a temporary HTTPS registry, dist-tag
487
+ selection, runtime suppression, required script enforcement, and frozen
488
+ installs. They use OpenSSL to create a disposable certificate.
489
+ Routing fixtures at 11.28.8, 11.28.9, 12.9.0, 12.10.0, 12.11.0, 12.11.1,
490
+ 12.11.2, 12.15.0, and 12.16.1 verify prefix/scope conflicts, mixed registry
491
+ representations after conversion, and rejection before writes under all three
492
+ strategies. They compare native URL normalization across the 12.11.1 boundary.
379
493
  The removed `pnpm install --resolution-only` CLI flag is outside this settings
380
494
  migrator's scope; replace it with `pnpm peers check` in scripts before upgrading.
381
495