Repository navigation
fix(apply): hold packages with a version-pinned pnpm patch - #176
Merged
Merged
Conversation
A pnpm patch keyed to an exact version (`patchedDependencies: next@16.3.5`) stops matching once the package is bumped, and pnpm refuses to install with an unused patch (ERR_PNPM_UNUSED_PATCH). `--apply` wrote the bump anyway, so the install failed and took every other upgrade in the run with it. The detector now reads the pinned patches of each project and `--apply` skips a package whose target version none of its patches cover. The hold is reported rather than silent: a warning on stderr, `heldByPatch` on the `--json` entry, and a "Held by pnpm patch" table in the Action's PR body. Name-only patches and ranges that still cover the target hold nothing.
) Selecting a package whose pnpm patch is pinned to the installed version fails the install after the manifests are already written. The picker now shows a `[PATCH]` badge on such a row, names the patch in the info modal, and leaves it out of the `m` / `l` bulk selections. It can still be picked by hand. The check is per option, so a range patch that covers the in-range bump only blocks the major.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running the GitHub Action (or
inup --apply) on a pnpm project that patches a dependency at an exact version fails the whole run:A patch keyed
next@16.3.5applies to that version only.--applybumped the package anyway, the patch stopped matching, and pnpm refuses to install with an unused patch. Every other upgrade in the run was lost with it, and no PR was opened.Fix
--applynow leaves such a package alone and upgrades the rest.patchedDependencies(frompnpm-workspace.yamland thepnpmfield of the rootpackage.json) and stamps the pinned version selectors on each package.next) and ranges that still cover the target (next@^16.0.0) hold nothing.The hold is never silent:
heldByPatchon the entry in the--jsonreport (additive, no schema bump)Testing
ERR_PNPM_UNUSED_PATCH; this branch exits 0, upgrades the other package, and reports the held one.pnpm test:coverage: 1930 tests pass, 100% coverage. Biome andtscclean.Notes
inup@latestfrom npm, so users get this with the next release.