Wire the version-sync hook into the changesets action (main is red without it) - #102
Merged
Conversation
…thout it) #99 added `scripts/sync-versions.mjs` and the package.json `version` script, but not the one input that makes the action run it. `changesets/action@v1` runs `changeset version` ITSELF unless given a `version:` command — and npm lifecycle hooks fire on `npm version`, never on `changeset version`. So the script sat there unexecuted. The next two releases proved it: #100 and #101 bumped `packages/core/package.json` to 0.19.2 while the other eleven version-bearing files stayed at 0.19.0, which is exactly what the new `versions` lane is for — it has been red on `main` since #101. Two changes: - `version: pnpm run version` on the changesets action, so the hook actually runs and the action commits the synced files into the release commit. `pnpm run version`, not `pnpm version` — the latter is pnpm's own builtin and would not run the script. - Sync all eleven files up to 0.19.2, catching main back up. No changeset on purpose. Adding one would bump to 0.19.3 and re-open the drift this commit is closing; the sync is mechanical catch-up, not a behavior change beyond the one #99 already described. From here the hook keeps them in step without anyone remembering to. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC
|
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.
main is red
#99 added
scripts/sync-versions.mjsand thepackage.jsonversionscript — but not the one input that makes the action run it.changesets/action@v1runschangeset versionitself unless you hand it aversion:command, and npm lifecycle hooks fire onnpm version, never onchangeset version. So the script sat there unexecuted.The next two releases proved it: #100 and #101 bumped
packages/core/package.jsonto 0.19.2 while the other eleven version-bearing files stayed at 0.19.0. That is precisely what the newversionslane exists to catch, and it has been red onmainsince #101 — the guard working as designed, on the first real opportunity.Fix
version: pnpm run versionon the changesets action, so the hook runs and the action commits the synced files into the release commit — the whole reason for syncing inversionrather than afterpublish. Notepnpm run version, notpnpm version: the latter is pnpm's own builtin and would not run the script.No changeset, on purpose
Adding one would bump to 0.19.3 and re-open the drift this commit closes. The sync is mechanical catch-up to a behavior change #99 already described in the changelog. From here the hook keeps them in step without anyone having to remember.
🤖 Generated with Claude Code
https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC