Skip to content

feat: self-building widget shell with single-source theming - #86

Merged
adamstankiewicz merged 2 commits into
mainfrom
chore/shell-selfbuild
Aug 30, 2026
Merged

feat: self-building widget shell with single-source theming#86
adamstankiewicz merged 2 commits into
mainfrom
chore/shell-selfbuild

Conversation

@adamstankiewicz

@adamstankiewicz adamstankiewicz commented Aug 30, 2026

Copy link
Copy Markdown
Owner

What & why

The widget shell builds itself, themed from one source. mcp/shell.css imports the app's own globals.css — a retheme lands in the shell automatically — and defines the few things next/font would have (every --font-* gets a real fallback stack, including the serif #77 needs). build.mjs compiles it with the Tailwind CLI, breaking the circular dependency on a finished next build: the shell runs as predev/prebuild, is gitignored, and cannot go stale because it cannot be forgotten.

Deletes, in one move: the committed 860KB artifact, the manual pnpm mcp:build step, the CI staleness guard (#73, closed as superseded), the @font-face determinism strip, and the hand-written font-override template block that had already drifted.

Type of change

  • Code quality / tests

Breaking or contract changes

None on the wire — the served shell is byte-equivalent in behavior. Contributor-facing: pnpm mcp:build still exists as an alias but nobody needs it; public/widget-shell.html leaves git.

How it was verified

  • Builds in ~90ms with no .next present (independence proven, not claimed)
  • Two consecutive builds byte-identical; zero url() references; tokens, dark block, and focus styles present in compiled CSS
  • rm -rf .next && npx tsc --noEmit, full pnpm build (prebuild → next build) green
  • pnpm test — 29/29 after rebasing onto the merged stack
  • Functional render verified in a real browser (Playwright against the served shell): the demo widget renders fully styled — theme tokens resolve (--card, --primary), utilities apply (card background/radius/padding, textarea border, meter track), fonts land on the intended system stack, zero console errors

Authorship

  • I understand every line of this diff
  • Agent-assisted or agent-authored: authored by Claude working interactively with @adamstankiewicz, who prompted the better-DX direction
  • package.json/pnpm-lock.yaml changes are the feature's own dependency (@tailwindcss/cli) plus the script rewiring

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
interactive-learning-experiences Ready Ready Preview Aug 30, 2026 6:10pm

Request Review

@adamstankiewicz adamstankiewicz changed the title experiment: shell as a post-build product (no committed artifact) feat: self-building widget shell with single-source theming Aug 30, 2026
@adamstankiewicz
adamstankiewicz marked this pull request as ready for review August 30, 2026 18:03
adamstankiewicz and others added 2 commits August 30, 2026 14:09
If the Vercel preview serves /widget-shell.html despite it being absent
from git, output collection happens after the build command — and the
committed artifact, the manual mcp:build step, and the CI staleness
guard can all be deleted in favor of the build building the shell.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mcp/shell.css imports the app's own globals.css and owns the few things
next/font would have provided (every --font-* variable gets a real
fallback stack — including the serif the warm-minimal branch needs — plus
host transparency). build.mjs compiles it with the Tailwind CLI instead
of lifting chunks out of .next, which:

- breaks the circular next-build dependency, so the shell runs as
  predev/prebuild and is never committed (gitignored) or manually rebuilt,
- is deterministic by construction — next/font never runs here, so there
  is no @font-face to strip and nothing environment-dependent to guard,
- single-sources theming: a retheme of globals.css lands in the shell
  automatically,
- and drops 20KB of CSS that was never reachable.

Verified: builds in ~90ms with no .next present; two consecutive builds
byte-identical; zero url() references; theme tokens, dark block, and
focus styles present; full pnpm build green end-to-end.

Supersedes the committed-artifact staleness guard (#73's CI step) once
both merge — a build product can't go stale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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