Skip to content

test(cli): build a frozen v0.3.10 theme with today's packages - #81

Merged
Madraka merged 1 commit into
mainfrom
test/old-theme-compat
Oct 22, 2026
Merged

Madraka merged 1 commit into
mainfrom
test/old-theme-compat

Conversation

@Madraka

@Madraka Madraka commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Guards against the 0.3.12 incident, where cloudhal.com served blank pages.

Why: cloudhal init copies the starter theme into each project, so a site keeps calling @cloudhal/astro-renderer / @cloudhal/core-ts exports as they were then. 0.3.11 changed entryPath's meaning under the same name. Every older theme copy then rendered empty pages (200, no body) until 0.3.13 (#79). CI only ever built the current starter, which was updated in the same PR.

What:

  • packages/cli/test/fixtures/theme-v0.3.10/: the v0.3.10 starter src/, extracted with git archive and byte-identical to the tag, about 360 kB. No fonts and no configs. Its README says it must never be updated; new frozen copies go beside it and into the test's FROZEN list. Biome and the CLI tsconfig ignore it, and it is not in the published package (files: ["dist", "README.md"]).
  • old-theme-compat.test.ts (about 3.5 s): init, swap in the frozen src/, then run the real cloudhal build. It asserts:
    • exit 0 and no errors in the output;
    • the home page, /posts/hello-world and /category/news render with the site title and real content in <main>, with entry links;
    • no built page is empty.
  • Proven:
    • With 0.3.13's one-argument fallback removed, the build fails with TypeError: Cannot read properties of undefined (reading 'collection') from EntryList, the exact 0.3.12 error.
    • With it restored, the test passes. permalinks.ts is not in this diff.
  • Docs:
    • The renderer README gains "Theme-facing API stability": never change an export's meaning under the same name; keep a deprecated fallback; add a frozen copy when theme APIs change.
    • The starter README gets a short note for site owners.

Checks: e2e 8/8; biome, the size ratchet, design lint and the CLI typecheck all pass.

🤖 Generated with Claude Code

Sites copy the starter theme at `cloudhal init`, so its imports from
@cloudhal/astro-renderer and @cloudhal/core-ts are a public API. 0.3.11
changed `entryPath`'s meaning under the same name and every older theme
copy rendered empty pages until 0.3.13; CI only built the current starter.

- packages/cli/test/fixtures/theme-v0.3.10/: the v0.3.10 starter `src/`,
  byte-identical to the tag, never to be updated (README says why);
  biome and the CLI tsconfig leave it alone.
- old-theme-compat.test.ts: init a project, swap in the frozen theme, run
  `cloudhal build`; the home page, an article and an archive render with
  content and entry links, no page is empty, no errors. Without 0.3.13's
  one-argument fallback it fails with the 0.3.12 error; with it, it passes.
- Renderer README: the theme-facing API rule; starter README: a short
  "Upgrading Cloudhal" note for site owners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka
Madraka merged commit b2a3fcb into main Oct 22, 2026
5 checks passed
@Madraka
Madraka deleted the test/old-theme-compat branch October 22, 2026 16:18
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.

1 participant