fix(build): name canaries after the release, not after a prerelease - #3767
Open
armando-navarro wants to merge 2 commits into
Open
armando-navarro wants to merge 2 commits into
armando-navarro wants to merge 2 commits into
Conversation
The root version field held `21.0.0-rc.1`, so every merge to main published `21.0.0-rc.1-canary.<sha>`. Semver ranks that above `21.0.0-rc.1`, and the caret range `ng add` writes into a user's package.json then resolves to the canary instead of the release candidate they asked for. Releases through v20 avoided this by keeping the plain release number in the version field and publishing prereleases from their own git tag, which is what the publish job reads. This restores that: the field returns to `21.0.0`, and build.sh drops any prerelease part when naming a canary, so a prerelease written there again cannot produce a canary that outranks it. The schematics comment and its log line no longer say a prerelease range matches canary builds, which stops being true here.
The sample's lockfile still named `angular-fire-21.0.0-rc.0.tgz`, two releases behind its own package.json, so `npm ci` there failed on the mismatch. Regenerated by building the library and running `npm install ../angular-fire-21.0.0.tgz` in sample/. It also picks up the `^21.2.0` peer ranges the Angular 21.2 raise introduced.
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.
Fixes #3766
These changes take us back to the release candidate pattern this repo used up until #3674, after which
@angular/fire@nextstarted resolving to a canary build instead of the release candidate.Details
package.jsonversion field returns to21.0.0, so a canary published from main is named21.0.0-canary.<sha>, which ranks below every21.0.0-rc.N.tools/build.shtakes a tagged release's version from.tools/build.shalso drops any prerelease part when naming a canary, and says so in the build log, so a prerelease written into that field again cannot produce a canary that outranks it.src/schematics/common.tsno longer say a prerelease range matches canary builds, since it stops being true with this PR.angular-fire-21.0.0.tgz.sample/package-lock.json, which still named the21.0.0-rc.0tarball, two releases behind its ownpackage.json.Verification
Every naming path was run against the real script.
21.0.0, a merge to main and a pull request build:21.0.0-canary.95b3de1on thecanarytag21.0.0-rc.2publishes21.0.0-rc.2onnext21.0.0publishes21.0.0onlatest.21.0.0-canary.95b3de1, logging why.21.0.0-canary.95b3de1is selected by none of^21.0.0-rc.1,~21.0.0-rc.1,^21.0.0-rc.2,^21.0.0or21.x, and ranks below21.0.0-rc.1.npm run test:nodeafter a full build: 331 specs, 0 failures.angular-fire-21.0.0.tgz, andnpm ciinsample/succeeds against the regenerated lockfile, where it previously failed on the mismatch.