next.js
aea417ab - Avoid obsolete pnpm overrides in pack-next (#99199)

Commit
41 days ago
Avoid obsolete pnpm overrides in pack-next (#99199) ### What? Make `pack-next` choose pnpm override locations from the destination workspace root's pinned `packageManager` version. ### Why? pnpm 11+ warns about `pnpm.overrides` in `package.json` and ignores that setting. Conversely, rewriting `pnpm-workspace.yaml` for older pnpm versions creates unnecessary churn. ### How? Use the repository's `semver` package to read the major from a pinned pnpm version. For a pnpm 11+ destination, merge overrides into the existing/detected pnpm workspace file without adding `pnpm.overrides` to `package.json`. For pnpm 10 and older, update only the package.json field. When the pin is missing or unusable, retain the previous dual-write behavior. Existing user overrides and npm/Yarn override behavior are preserved. ### Verification - Passed eleven temporary destination scenarios covering pinned older/newer pnpm, existing overrides and workspace files, nested workspace roots, and unknown versions. - Prettier check, Node syntax check, and `git diff --check` passed. - Repo-wide lint/typecheck not run (root dependencies are not installed in this checkout). <!-- NEXT_JS_LLM --> <!-- fleet e86eb7e1-c05e-4e30-9285-7c5595ccb36f --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
Author
Parents
Loading