Skip to content

fix: generate docs changelog from root CHANGELOG.md (GIT-87) - #24

Merged
nTEG-dev merged 1 commit into
mainfrom
feature/GIT-87-generate-changelog-from-source
Aug 7, 2026
Merged

fix: generate docs changelog from root CHANGELOG.md (GIT-87)#24
nTEG-dev merged 1 commit into
mainfrom
feature/GIT-87-generate-changelog-from-source

Conversation

@nTEG-dev

Copy link
Copy Markdown
Member

What

Derives apps/docs/content/docs/changelog.mdx from the root CHANGELOG.md at docs build time, instead of maintaining it by hand.

  • Newapps/docs/scripts/generate-changelog.ts — parses root CHANGELOG.md, drops the Keep a Changelog preamble and the [Unreleased] section, rewrites ## [1.7.0] - 2026-08-07## v1.7.0 (2026-08-07), strips trailing link-reference definitions, and escapes MDX-hazardous characters outside code spans and fences.
  • apps/docs/package.json — adds generate:changelog and wires it into build. It runs beforegenerate:llms so llms-full.txt also picks up the current changelog.
  • .github/workflows/deploy-docs.yml — adds CHANGELOG.md to the trigger paths.

The generated file stays committed, consistent with how generate:tools output is handled, and carries a do-not-edit notice.

Why

https://gitmem.ai/docs/changelog/ has advertised v1.0.2 (2026-02-15) as the newest release while npm is at 1.7.0 — seven minor versions and roughly six months stale. The public changelog made an actively-developed project look abandoned, directly contradicting the version badge on the homepage.

Two independent failures kept it that way:

  1. Duplicate source of truth. The release process updates root CHANGELOG.md faithfully (1.6.0 → 1.7.0 are all there). Nothing propagated that to the MDX the docs site actually builds from. The two files even used different heading formats, confirming no tooling ever connected them.
  2. The deploy workflow could not see changelog edits. It triggered only on apps/docs/** and src/tools/definitions.ts, so a release commit touching only CHANGELOG.md never fired a docs deploy — meaning even a manually-synced changelog would have sat unpublished.

This makes drift structurally impossible rather than a thing to remember: the changelog regenerates on every docs build, and cutting a release now triggers that build.

How to Test

  1. cd apps/docs && npm ci
  2. npm run generate:changelog — expect ✅ changelog.mdx generated — 37 versions from CHANGELOG.md
  3. git diff --stat apps/docs/content/docs/changelog.mdx — confirm regeneration is idempotent against the committed file
  4. npx next build — must succeed (this is what proves the MDX escaping is sound)
  5. Inspect out/docs/changelog/index.html — v1.7.0 at the top, history intact down to v0.1.0
  6. Add a fake entry to root CHANGELOG.md, rerun step 2, confirm it appears

Verification performed

CheckResult
Versions generated vs. CHANGELOG.md37 / 37 — exact match
[Unreleased] excludedyes
Link-reference definitions strippedyes
next buildsucceeds, /docs/changelog prerenders
Rendered HTML — newest entryv1.7.0
Rendered HTML — oldest entries retainedv1.0.2 and v0.1.0 both present
Escape artifacts (\{, \<) leaking into render0
npm run test:unit1147 passed / 67 files

Checklist

  • npm run test:unit passes — 1147 tests, 67 files
  • npm run test:e2e — not run; this PR touches no tools or CLI code (docs build + workflow only)
  • New tests added for new functionality — none added, see note below
  • No breaking changes
  • Docs updated (if user-facing) — this PR is the docs fix

Note on test coverage

generate-changelog.ts ships without a unit test. The repo has no existing test pattern for apps/docs/scripts/* (neither generate-tool-docs.ts nor generate-llms-txt.ts is covered), so I followed the local convention rather than introducing one unilaterally. The parsing is non-trivial enough to deserve coverage — happy to add a test for the heading rewrite, [Unreleased] exclusion, and MDX escaping if you'd prefer that before merge.

Worth knowing: today's CHANGELOG.md contains zero bare < and a single {, and that one is already inside a code span. The escaping is defensive for future entries, so it is currently unexercised by real content.

Breaking Changes

None. changelog.mdx is now generated — anyone hand-editing it will have their changes overwritten on the next docs build, which is the intent. The do-not-edit notice in the file header calls this out.

Closes GIT-87

🤖 Generated with Claude Code

The docs site rendered apps/docs/content/docs/changelog.mdx, a
hand-written duplicate last touched in February. It showed v1.0.2 as
the newest release while npm was at 1.7.0 — seven minor versions and
six months behind.
Two failures kept it stale. The MDX was a second source of truth that
nobody remembered to update, and deploy-docs.yml only triggered on
apps/docs/** and src/tools/definitions.ts, so a release touching only
CHANGELOG.md never redeployed the docs.
changelog.mdx is now derived from root CHANGELOG.md by a generator
wired into the docs build, matching how generate:tools and
generate:llms already work. It runs before generate:llms so
llms-full.txt picks up the current changelog too. CHANGELOG.md is
added to the workflow's trigger paths so cutting a release deploys
the site.
The generated file stays committed, consistent with generate:tools
output, and carries a do-not-edit notice.
Verified: 37 versions generated (matching CHANGELOG.md exactly),
Unreleased and link-reference definitions excluded, next build
succeeds, /docs/changelog prerenders with v1.7.0 at the top and full
history down to v0.1.0, no escape artifacts in the rendered HTML.
Closes GIT-87
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@nTEG-dev
nTEG-dev merged commit c091a75 into mainAug 7, 2026
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@nTEG-dev