docs: pin the README CDN snippets, and make the release own them - #156
Conversation
README.md advertised @livetemplate/client@0.1.0 in both CDN snippets while the package was on 0.20.0 — nineteen minor versions of drift. The docs site mirrors this file verbatim to /client/, so every reader there was told to load a bundle from long before the current wire format, against a server that would not speak it. Bumped to 0.20.0, but that alone just restarts the clock. Nothing in the release path touched README.md, so the literal was guaranteed to rot again on the next tag. update_version_files() now rewrites the pins alongside VERSION and package.json, and README.md joins the list restored when a release aborts midway — otherwise a failed run would leave the tree dirty and the next attempt would refuse to start, the same trap #151 fixed for the other files. The substitution is anchored to "@livetemplate/client@<semver>", so the unpinned `npm install @livetemplate/client` line and any unrelated scoped package are left alone. Verified against a fixture covering all three cases. Full suite passes: 824 tests across 39 suites. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QzC2djPjPHkNJgPzFpMX7v
ReviewWhat this does: Fixes the stale Bug: the README update never gets committed
git add VERSION package.json package-lock.json CHANGELOG.md
Net effect: every successful release leaves Fix: add Minor
|
README.mdadvertised@livetemplate/client@0.1.0in both CDN snippets while the package was on 0.20.0 — nineteen minor versions of drift.That is not only a stale README. The docs site mirrors this file verbatim to /client/, so every reader there was told to load a bundle from long before the current wire format, against a server that would not speak it. There is no runtime handshake between server and client, so the failure mode is a silently broken app rather than a version warning.
Why the bump alone is not the fix
Nothing in the release path touched
README.md.update_version_files()rewroteVERSIONandpackage.json; the literal in the README was owned by nobody, so it was guaranteed to rot again on the next tag — exactly how it reached 0.1.0-vs-0.20.0 in the first place.So the release owns it now:
update_version_files()rewrites the pins alongsideVERSIONandpackage.json.README.mdjoins the list restored when a release aborts midway. Without that, a failed run leaves the tree dirty and the next attempt refuses to start — the same trap fix(release): run tests before mutating, restore files on abort #151 fixed for the other files.The substitution is anchored to
@livetemplate/client@<semver>, so the unpinnednpm install @livetemplate/clientline and any unrelated scoped package are untouched. Verified against a fixture covering all three cases before wiring it in:sed -i.bakrather than bare-iso it behaves identically on macOS.Verification
npm test: 824 passed across 39 suites, 1 skipped.bash -n scripts/release.shclean. Pre-commit (lint + full suite) green.Found while auditing dead and stale links across the docs site (livetemplate/docs#130), which fixed 118 broken mirrored links but could not fix this one — the docs repo mirrors this README, so the correction has to happen here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QzC2djPjPHkNJgPzFpMX7v