Skip to content

refactor: adopt sitekit as the site model and renderer - #1

Merged
catomean merged 2 commits into
mainfrom
feat/adopt-sitekit
Aug 28, 2026
Merged

refactor: adopt sitekit as the site model and renderer#1
catomean merged 2 commits into
mainfrom
feat/adopt-sitekit

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

Substrata becomes sitekit's reference consumer — Site Factory phase 1, per orangecat ADR-0003 (#799).

What moved out

The section union, the page/chrome model, the helpers, and all 577 lines of renderers now live in sitekit (v0.1.1, installed from github:bitbaum/sitekit). config/site-content.ts keeps re-exports plus the wiring that says which pages this site has; content stays in site-substrata.ts; tokens stay 100% local — the package ships semantic classes only, which is the contract: uniform system, divergent aesthetics.

What the conversion caught

  • sitekit's chrome wasn't RSC-safe — SiteNav was 'use client' and the injected Link (a component function) can't cross the server→client boundary. Fixed upstream in v0.1.1: the nav is a server component and only the scroll-into-view effect is client, taking a string. The first consumer did its job.
  • This repo's test gate had never run. jest --passWithNoTests referenced a jest that was never in devDependencies, so verify's third gate was a no-op on every fresh install (the exact class verify-floor-audit.sh hunts). Replaced with tsx --test and a real test: the entire site content validates against the sitekit schema, so a schema change that would break this site fails here in CI before it ships to any generated site.

Verified

  • type-check ✓ lint ✓ tests 3/3 ✓
  • Full production build: 10 static pages prerendered
  • Emitted CSS contains the package's semantic classes (@source works)
  • Prerendered HTML carries the package nav (data-sitekit-nav)

🤖 Generated with Claude Code

https://claude.ai/code/session_01AZCNYHwjEeqxNpYCUk6Yna

catomean and others added 2 commits August 28, 2026 07:21
…the shared package

Substrata becomes sitekit's reference consumer, per orangecat ADR-0003.

- config/site-content.ts re-exports the types and helpers from sitekit and
  keeps only the wiring that says which pages this site has; the local copy
  of the section union and all of components/ are deleted (-577 lines of
  renderer that now improve every generated site when fixed once).
- The chrome takes next/link through sitekit's Link seam, and the canonical
  host moves into the chrome spec.
- globals.css gains @source for the package dist so Tailwind emits the
  semantic classes the renderers use. Tokens stay 100% local — that is the
  contract: uniform system, divergent aesthetics.
- verify's test gate is real for the first time: 'jest --passWithNoTests'
  referenced a jest that was never installed, so the gate was a no-op on
  every fresh install. Replaced with tsx --test and an actual test that
  validates the ENTIRE site content against the sitekit schema — a schema
  change that would break this site now fails in CI here.

Verified: type-check, lint, 3/3 tests, full production build (10 static
pages), semantic classes present in emitted CSS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZCNYHwjEeqxNpYCUk6Yna
@catomean
catomean merged commit 26ef06e into main Aug 28, 2026
1 check passed
@catomean
catomean deleted the feat/adopt-sitekit branch August 28, 2026 08:21
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