CURRENT_STATE.md has gone stale after three consecutive releases (0.4.3,
0.4.4, and the earlier 0.3.2), each needing a manual catch-up PR (#146, #150).
The cause is structural: the changesets release PR bumps package.json and
CHANGELOG.md but never touches CURRENT_STATE.md, so the version there drifts
every cycle.
Fix
Fold a CURRENT_STATE.md update into the changesets version step, so it rides
the existing "version packages" PR. That PR already gets CI and a human merge, so
there is no direct push to protected main and no separate PR.
Concretely:
- A small dependency-free Node script,
scripts/update-current-state.mjs, run
right after changeset version. It reads the freshly bumped version from
packages/toolkit/package.json and the top entry of
packages/toolkit/CHANGELOG.md, then updates two machine-maintained spots in
CURRENT_STATE.md: the package status table version, and an auto-managed
release-log block delimited by HTML-comment markers.
- The script is idempotent: running it twice for the same version does not
duplicate the entry.
- Wire it via a root script,
version:packages, and point the workflow's
version: command at it.
Editorial prose (the "Current Version" narrative) stays hand-written, since a
per-release sentence is human commentary, not a fact to automate. Only the two
factual fields are machined.
Acceptance
- Merging a "version packages" PR lands the release-log entry and the table
version in the same commit, with no manual step.
- A unit test covers the parse-and-update logic against a fixture.
- No new runtime dependency; the script uses only Node built-ins.
CURRENT_STATE.mdhas gone stale after three consecutive releases (0.4.3,0.4.4, and the earlier0.3.2), each needing a manual catch-up PR (#146, #150).The cause is structural: the changesets release PR bumps
package.jsonandCHANGELOG.mdbut never touchesCURRENT_STATE.md, so the version there driftsevery cycle.
Fix
Fold a
CURRENT_STATE.mdupdate into the changesetsversionstep, so it ridesthe existing "version packages" PR. That PR already gets CI and a human merge, so
there is no direct push to protected
mainand no separate PR.Concretely:
scripts/update-current-state.mjs, runright after
changeset version. It reads the freshly bumped version frompackages/toolkit/package.jsonand the top entry ofpackages/toolkit/CHANGELOG.md, then updates two machine-maintained spots inCURRENT_STATE.md: the package status table version, and an auto-managedrelease-log block delimited by HTML-comment markers.
duplicate the entry.
version:packages, and point the workflow'sversion:command at it.Editorial prose (the "Current Version" narrative) stays hand-written, since a
per-release sentence is human commentary, not a fact to automate. Only the two
factual fields are machined.
Acceptance
version in the same commit, with no manual step.