Repository navigation
chore(release): bump from package.json instead of npm - #2136
Merged
Merged
Conversation
prepare.ts reads the version every packages/*/package.json shares, fails when they differ, and bumps from it. It no longer asks npm and git tags for the next version, so a package that is not on npm yet no longer makes the release repeat the previous candidate.
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.
scripts/release/prepare.tsnow takes the release version frompackage.jsoninstead of npm. This is the same change as alchemy-run/distilled#836.Why
prepare.tsworked out the next prerelease from npm: the highest2.0.0-<channel>.Nacross packages, plus whether thev2.0.0-<channel>.Ngit tag existed. If any package was missing that N, it treated the release as unfinished and published N again.A package added after the last release never has that version on npm. So the first release after adding one repeats the previous candidate instead of bumping. Distilled hit this with
@distilled.cloud/iceberg.patch/minor/majoralso bumped from the latest stable version on npm, not from the repository.What changes
prepare.tsreads the version everypackages/*/package.jsonshares, fails if they differ, and bumps from it. It never asks npm or git tags.2.0.0-beta.81beta(default)2.0.0-beta.82rc2.0.0-rc.1beta.N,rc.N,alpha.Npatch/minor/majormajorgives2.0.0)x.y.z[-beta.N]0.0.0-<name>, published but not committedalphafrom a beta,beta.81, or a lowerx.y.z.found 2.0.0-beta.81: 6 packages; 2.0.0-beta.80: @alchemy.run/pkg.sharedVersion) moves intoscripts/package-manifest.ts, sovalidate-publish-packages.tsandprepare.tsuse the same code.publishablePackagesnow skips stray files like.DS_Storeinpackages/. Before, it crashed on them.publish.tsis unchanged: it still skips tarballs whose version is already on npm, so a publish job that fails partway can be re-run.Testing
prepare.tswith each spec above against the current packages, plus a deliberate version mismatch, and reverted each run's changes.pnpm validate:publish-packagespasses.tsc -b tsconfig.scripts.json,pnpm format:checkand oxlint pass.