fix(ci): exempt a package's first publish from the version contract - #2982
Closed
mfal wants to merge 1 commit into
Closed
fix(ci): exempt a package's first publish from the version contract#2982mfal wants to merge 1 commit into
mfal wants to merge 1 commit into
Conversation
The guard read `private: true` -> public as a tightening: adding `engines.node` where a private package had none reports `(none) -> >=24.0.0` and demands a breaking marker. Both remedies it offers are unavailable for that change. A breaking marker routes the PR to the major line, and the routing job in the same workflow rejects a breaking marker on a standing line — so the two guards contradict each other. And dropping the floor means publishing a CLI without one while its code needs Node 24. There is nothing to break. A private package has never been published, so it has no consumer and no prior contract; its first publish establishes the floor and the peer ranges rather than narrowing them. `collectFindings` already skipped a package with no base file at all for exactly this reason — this extends that to one that existed but was not publishable. The rule is unchanged for anything already on npm. The second added test pins that: `flow-react-components` gaining `engines.node` is still reported as raised. Closes #2980. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
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.
Closes #2980.
The problem
Going
private: true→ public while addingengines.nodefails the version-contract guard:Neither remedy the message offers is available:
structuredCloneandtoSorted. On an older Node that is a bareSyntaxErrorwith no hint why, and all twelve already-published packages declare a floor.Why the guard is wrong here, and only here
A
private: truepackage has never been published. No consumer, no prior contract — its first publish establishes the floor and the peer ranges rather than narrowing them.collectFindingsalready skips a package with no base file at all, for exactly this reason:The gap was the case in between: the package existed at the base but was not publishable. This adds that line.
What is deliberately not changed
The rule for anything already on npm. The second of the two added tests is the one that matters — it pins that
@mittwald/flow-react-componentsgainingengines.nodeis still reported asraised, so this is an exemption for the first publish, not a hole in the guard.I also checked it by hand: with the fix applied, an artificial "already-published package gains a floor" still produces the finding, and the guard goes green on #2978's branch.
Route
fix(ci):→main, from where the forward-merge carries it tonext. #2978 targetsnextand is blocked on this; the cascade unblocks it without that PR needing to carry CI infrastructure.14 guard tests pass (12 existing, 2 added).