fix: compare prerelease versions against previous stable for size diff#2324
fix: compare prerelease versions against previous stable for size diff#2324joshuaisaact wants to merge 1 commit intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Hello! Thank you for opening your first PR to npmx, @joshuaisaact! 🚀 Here’s what will happen next:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe changes update the prerelease version comparison logic in Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
Resolves #2313
🧭 Context
When viewing an old prerelease version (e.g. oxlint@1.17.0-alpha.0), it compared against the latest version (in oxlint's case this was 1.57.0), not the stable version before the prerelease.
Since the latest version is newer and smaller, this showed a "size increase" warning on the old alpha. The package size of oxlint has decreased in newer versions, but we shouldn't say that the old alpha has 'increased'.
We should be comparing the old alpha against the closest previous stable.
📚 Description
I changed the prerelease comparison logic in
getComparisonVersionto find the previous stable version in semver order, the same approach already used for stable versions.The old code used the latest dist-tag as a shortcut, which broke when viewing prereleases older than latest.
The old prerelease behavior was:
The new behavior is:
Find the highest stable version before this prerelease, in semver order.
Which matches the non-alpha behaviour, removing the (bugged) shortcut.
Also updated the tests while I was there, because I am nice.