mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-12 10:11:42 -04:00
* fix: sync packageManager and devEngines.packageManager on self-update When `package.json` declares both `packageManager` and `devEngines.packageManager`, `pnpm self-update` previously bumped only the latter — leaving Corepack (which reads `packageManager`) pinned to the old version until a manual edit. Now, when `packageManager` pins pnpm, both fields are rewritten to the new exact version on update: `packageManager` to `pnpm@<version>` (without an integrity hash) and `devEngines.packageManager.version` to the same exact `<version>` (dropping any range operator). When only `devEngines.packageManager` is declared, the existing range-preserving behavior is unchanged. Closes #11388 * refactor: export and reuse parsePackageManager from @pnpm/config.reader Drop the inline duplicate in self-updater and use the existing parser from config.reader. Same parsing rules (strips integrity hash, rejects URL-style refs). * refactor: collapse devEngines.packageManager array/object branches Resolve to the underlying pnpm entry first (whether the field is an array or an object) and run the version-update logic once, instead of duplicating it across both branches.