Skip to content

feat: site: real-time /changelog page fed by GitHub Releases (edge function + build fallback + feed) - #127

Merged
mvilacad merged 2 commits into
mainfrom
feat/126-site-real-time-changelog-page-fed
Oct 15, 2026
Merged

mvilacad merged 2 commits into
mainfrom
feat/126-site-real-time-changelog-page-fed

Conversation

@mvilacad

@mvilacad mvilacad commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #126

A real-time /changelog/ on ui.codeatlas.com.br, ported from ../atlas/site and adapted: the source is the GitHub Releases of codeatlasdev/ui (tags @codeatlasdev/ui@*), so a release shows up within about a minute with no redeploy.

packages/ui (core)

  • prose.css: .ca-prose now styles release lists (.ca-release, .ca-release__meta, .ca-release-jump, .ca-release-thanks). The changelog needs no site-local CSS; classes only, so build-time and edge-rendered HTML share them. Anchored releases clear the sticky DocsShell header, meta links and pills keep 44px targets.
  • Test: Docs/Releases.svelte.test.ts (+ harness) in real Chromium: axe, rule between releases, scroll-margin-top, flex-wrap meta row, 44px targets.
    • fail-before: Tests 1 failed | 1 passed on .ca-release border/scroll-margin (no CSS yet).
    • pass-after: Tests 5 passed (5).
  • .changeset/release-list-prose.md (minor), docs/css-api.md lists the new classes.

site

  • functions/_lib/changelog.ts: parse GitHub payload and CHANGELOG.md, SemVer ordering, channel (latest/beta/...), special-thanks split, sanitized Markdown (raw HTML escaped; only http(s)/mailto/anchor/site links, control chars stripped from schemes; images become links; tables scroll in a wrapper), Atom feed.
  • functions/_lib/edge.ts: one api.github.com/.../releases call cached 60 s in the Cache API, last good copy kept 7 days (flagged stale), optional GITHUB_TOKEN secret lifts the 60/h API limit.
  • functions/changelog/index.ts swaps the build body (between <!--CHANGELOG--> markers) for live releases; if GitHub is down and nothing is cached, the static build body is served untouched. functions/changelog.json.ts, functions/changelog/feed.xml.ts.
  • src/pages/changelog/index.astro: SiteDocsShell + ca-prose, build fallback rendered from packages/ui/CHANGELOG.md plus the Special thanks text from scripts/release-meta.ts; Seo canonical, og card through the brand pipeline, BreadcrumbList JSON-LD, Atom <link rel=alternate>; "Changelog" in the header nav (SECTIONS); sitemap picks it up.
  • Tests: functions/**/*.test.ts (40, on bun test, chained into bun run test:unit so validate gates them) and tests/changelog.spec.ts. Functions typecheck as their own projects (tsconfig.json with workers types, tsconfig.test.json) inside site's check.
  • .gitignore: .wrangler/.

Verification

  • bun run validate: ok (19.9 s), also on pre-push.
  • bun run test:e2e -- tests/changelog.spec.ts tests/routes.a11y.spec.ts tests/layout.spec.ts -g changelog: 16 passed, 3 skipped (the layout spec's desktop-only viewports on the mobile project). Covers 3.0.0 and 2.3.2 with anchors, a11y dark/light/forced-colors, layout.
  • wrangler pages dev dist against live GitHub:
    • GET /changelog.json 200, x-changelog-source: github-releases, 11 releases [3.0.0 2026-10-15 latest, 2.3.2, 2.3.1, 2.3.0, ...]
    • GET /changelog/feed.xml 200 application/atom+xml, newest entry 3.0.0
    • GET /changelog/ 200, x-changelog-latest: 3.0.0, <section id="v3-0-0">, v2-3-2, ..., Special thanks footer; second call 7 ms (cache hit); HEAD 200
  • Outage path (GitHub down: last good copy flagged stale; nothing cached: build body untouched) is covered by changelog/index.test.ts and _lib/edge.test.ts; workerd ignores proxy env vars, so it could not be faked in wrangler.

Notes: the GitHub API only lists 11 releases (older tags predate Releases); the build fallback fills that history. The page is not in pages.visual.spec.ts on purpose (its content changes every release).

@mvilacad
mvilacad marked this pull request as ready for review October 15, 2026 04:09
@mvilacad
mvilacad force-pushed the feat/126-site-real-time-changelog-page-fed branch from c00a7a8 to 9b1a4ff Compare October 15, 2026 04:09
@mvilacad
mvilacad merged commit 0579bb3 into main Oct 15, 2026
@mvilacad
mvilacad deleted the feat/126-site-real-time-changelog-page-fed branch October 15, 2026 04:09
@github-actions

Copy link
Copy Markdown
Contributor

Site preview: https://pr-127.codeatlas-ui.pages.dev

Sign up for free to 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.

site: real-time /changelog page fed by GitHub Releases (edge function + build fallback + feed)

1 participant