fix: relax workspace dependency pins to caret (versionPrefix) to fix downstream dual-package hazard#528
Merged
Merged
Conversation
Sets release.version.versionPrefix to ^ so nx writes caret ranges (e.g. ^0.2.2) when updateDependents rewrites dependent packages, instead of exact pins. Exact pins force downstream consumers into duplicate copies of a workspace package (dual-package hazard: cross-version instanceof checks fail). The historical reason for exact pins, that ^0.0.0 aborts nx release version, no longer applies now that new packages start from 0.1.0 (verified: a ^0.2.2 ref does not abort nx release on nx 23).
Exact pins force a downstream consumer that wants a newer @lde/distribution-probe into two copies, breaking probeResultToVerdict's instanceof check across the version boundary. Caret ranges let the consumer dedupe to a single version.
Exact pins on workspace dependencies force downstream consumers into duplicate copies (dual-package hazard). Caret ranges allow deduplication to a single version.
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.
What
release.version.versionPrefix: "^"so nx writes caret ranges (e.g.^0.2.2) whenupdateDependentsrewrites a dependent package, instead of exact pins.@lde/*pins indistribution-healthandpipelineto caret.Why
Exact pins on workspace dependencies force any downstream consumer that wants a newer version of a workspace package into two copies of it. That's a dual-package hazard:
@lde/distribution-health'sprobeResultToVerdict()does aninstanceof ProbeResultTypethat silently fails across the two@lde/distribution-probecopies, so the validity rail breaks.This actually bit the Dataset Register: bumping
@lde/distribution-probeto0.2.2(for the newonProgress, #527) whiledistribution-health/pipelinestill pinned0.2.1exact produced a split tree and broke its distribution-validity behaviour.The only documented reason for exact pins was that
^0.0.0abortsnx release version(ef41eee, #496) — a0.0.0bootstrap problem. Since new packages now start from0.1.0(#510), that never occurs. Verified on nx 23: a^0.2.2workspace ref runsnx release versioncleanly (no abort).Effect
@lde/*packages to a single version — no more dual-package hazard.versionPrefix: "^"converts the remaining exact pins across other packages to caret automatically on their next release.Note
The
fix(distribution-health)/fix(pipeline)commits trigger a republish of those two with the caret pins, which is what unblocks the Dataset Register.