From 3793d831e0de00f70ca29c6bdc349a3b925bf7c1 Mon Sep 17 00:00:00 2001 From: Juber Shaikh <40266375+CodeWithJuber@users.noreply.github.com> Date: Sat, 11 Jul 2026 21:43:53 +0400 Subject: [PATCH] fix(pages): don't let an empty Unreleased section blank the status page changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit latestChanges() matched only the first "## [...]" CHANGELOG section, which after a release is the empty "## [Unreleased]" heading — leaving the status page's "Latest changes" list empty and failing test/pages.test.js:43. Now walks sections in order and uses the first one that actually has bullets. Also bumps ROADMAP's stale "Now" version marker to v0.12.0. --- ROADMAP.md | 2 +- scripts/build-pages.mjs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index d0c3990..8cc4028 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7,7 +7,7 @@ every tool. This is where that brain is headed. Direction, not promises — shaped by the two field reports this project is grounded in (the SDLC pain-point map and the ecosystem landscape). Open a Discussion to weigh in. -## Now (`master`, v0.11.0) +## Now (`master`, v0.12.0) The substrate is fully graded — decision math replaces every keyword heuristic: exemplar k-NN routing, entropy secret detection, noisy-OR goal-drift over paths **and** the identifiers a file diff --git a/scripts/build-pages.mjs b/scripts/build-pages.mjs index 50149ef..f4a7387 100644 --- a/scripts/build-pages.mjs +++ b/scripts/build-pages.mjs @@ -27,8 +27,17 @@ function lineMatch(text, re, fallback = "") { return m?.[1]?.trim() ?? fallback; } function latestChanges() { - const section = - changelog.match(/## \[[^\]]+\][\s\S]*?(?=\n## \[|\n\[Unreleased\]:|$)/)?.[0] ?? ""; + // Walk version sections in order and use the first one that actually has bullets — + // an empty "## [Unreleased]" (the normal state right after a release) must not win + // over the dated section below it that has the real content. + const sections = changelog.matchAll(/## \[[^\]]+\][\s\S]*?(?=\n## \[|\n\[Unreleased\]:|$)/g); + let section = ""; + for (const m of sections) { + if (/^- /m.test(m[0])) { + section = m[0]; + break; + } + } // Bullets wrap across several lines in the CHANGELOG; join each "- …" with its indented // continuation lines so the status page shows the whole item, not a truncated fragment. const items = [];