fix(upgrade): avoid downgrading older dist-tags#17028
Conversation
🦋 Changeset detectedLatest commit: 9242dcd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b0d81c4 to
21c4963
Compare
21c4963 to
5b7a903
Compare
|
Rebased onto latest The fix is still relevant: main's |
5b7a903 to
9242dcd
Compare
|
Hi @kydecker Thanks for checking in. While #17216 handles stable-version fallbacks, it misses when the current version is a newer prerelease (e.g. 7.0.0-beta.3) and the requested beta tag is older (e.g. 7.0.0-beta.2). On main, this falls back to latest (e.g. ^6.4.5), which still results in a downgrade. This PR has been rebased and updated with a minimal fix and a unit test to prevent this prerelease-to-prerelease downgrade. Let me know what you think! |
Changes
@astrojs/upgradefrom selecting a requested dist-tag when that tag resolves to a version older than the currently installed package.7.0.0-beta.3instead of coercing them to stable versions.astroupgrading to beta while an integration remains on a newer stable release.Why
Running
@astrojs/upgrade betacould downgrade companion packages when theirbetadist-tag pointed to an older prerelease than the currently installed stable version.Fixes #17024
Testing
npx --yes [email protected] -C packages/upgrade buildnpx --yes [email protected] -C packages/upgrade testnpx --yes [email protected] lint