From cf2b39d8d8e5fd1f81366e7dfb70911bad003d2c Mon Sep 17 00:00:00 2001 From: Adnaan Badr Date: Sat, 1 Aug 2026 17:05:57 +0000 Subject: [PATCH] docs: pin the README CDN snippets, and make the release own them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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@", 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) Claude-Session: https://claude.ai/code/session_01QzC2djPjPHkNJgPzFpMX7v --- README.md | 4 ++-- scripts/release.sh | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14f49f4..fbe11ed 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ npm install @livetemplate/client ### CDN ```html - + ``` ## Quick Start @@ -42,7 +42,7 @@ npm install @livetemplate/client - +
diff --git a/scripts/release.sh b/scripts/release.sh index 0b2c91b..1a76d68 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -172,7 +172,7 @@ restore_release_files() { # git's stderr is left visible; a generic "couldn't restore" would send the # next person down the wrong trail. local f - for f in VERSION package.json package-lock.json CHANGELOG.md; do + for f in VERSION package.json package-lock.json CHANGELOG.md README.md; do if git cat-file -e "HEAD:$f" 2>/dev/null; then git checkout HEAD -- "$f" || \ log_warn "Could not restore $f; revert it by hand before retrying" @@ -202,6 +202,19 @@ update_versions() { log_step "Updating package.json to $new_version" npm version "$new_version" --no-git-tag-version --allow-same-version > /dev/null 2>&1 + # The README's CDN snippets carry a literal version, and nothing was + # updating them: they advertised 0.1.0 for nineteen minor releases, and the + # docs site mirrors this file verbatim to /client/, so every reader there + # was told to load a bundle from 2024. A literal that no release step owns + # will always drift, so the release owns it now. + if [ -f README.md ]; then + log_step "Updating README CDN pins to $new_version" + sed -i.bak -E \ + "s#(@livetemplate/client@)[0-9]+\.[0-9]+\.[0-9]+#\1${new_version}#g" \ + README.md + rm -f README.md.bak + fi + log_info "All version files updated to $new_version" }