Skip to content

cleanup jun 1 - #4

Open
samiskin wants to merge 2 commits into
mainfrom
cleanup-jun-1
Open

cleanup jun 1#4
samiskin wants to merge 2 commits into
mainfrom
cleanup-jun-1

Conversation

@samiskin

@samiskin samiskin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Cleanup pass on the Havn tutorial/demo workspace: collapse to a single root package.json/node_modules, fix stale config & docs, restructure every canvas to the correct Tempo registry convention, and strip a pile of editor/render cruft.

Two commits, described below.


1. Single package.json (move to a single package json)

Goal: one root package.json + node_modules. The Tempo sidecar devserver runs directly from it instead of maintaining its own duplicate manifest/tree.

  • Deleted tempo/package.json + tempo/package-lock.json; folded the Tempo-only devDeps (tempo-sdk, vite-tsconfig-paths, @tailwindcss/vite) into the root package.json. Kept vite 6 / @vitejs/plugin-react 4 / React types 18 — tempo-sdk supports vite ^5 || ^6 || ^7, and the app's React runtime is 18.
  • tempo/tempo.config.json: installcd .. && npm install; start../node_modules/.bin/vite. This runs the Tempo vite config directly with no npm-script indirection. (A previous attempt kept start: "npm run dev", which broke once tempo/package.json was gone — npm walked up to the root and ran the main app's dev server.)
  • tempo/vite.config.ts: removed the React/framer-motion resolve aliases + dedupe. They only existed to merge two node_modules trees into one React copy; with a single tree Vite dedupes on its own (verified the host resolves one React copy).
  • Repo/docs cleanup:
    • Removed stale pnpm-lock.yaml (the repo installs via npm everywhere), dead .tempo/types.ts, and a leftover pasted PNG asset.
    • Rewrote the README — it pointed at a nonexistent demo-assets/ tree, the wrong canvas count/path, and pnpm; now describes the real structure and uses npm.
    • Dropped the unused Fraunces Google-Fonts <link> from both index.html files (the design is Geist-only).
    • Added the missing public/favicon.svg (the root index.html referenced /favicon.svg → 404).

2. Canvas + React cleanup (react fixes)

Canvas registry convention. Every tempo/designs/canvases/*/index.canvas.tsx was a 300–870-line file implementing all of its storyboards inline. Each is now a pure registry — the TempoPage default export plus one export const X: TempoStoryboard = { render: () => <XBoard/>, name, layout } per storyboard. Each storyboard's JSX moved into its own sibling *Board.tsx, and helpers shared across a canvas moved into a per-canvas shared.tsx.

  • 13 canvases, 64 storyboards — all export names, name literals, and layout literals preserved exactly.
  • Longest index.canvas.tsx dropped from 873 → ~60 lines.

Removed contentEditable cruft from the canvas JSX:

  • 40 contentEditable / suppressContentEditableWarning attribute pairs.
  • 39 outline: "none" focus-ring leftovers that paired with the removed contentEditable.
  • 2 empty <p> placeholder subtitles.

Fixed the shared src/design-system/canvas-chrome/index.tsx:

  • CanvasCover now renders its description prop (every cover was showing the same hardcoded blurb); removed the dead slug prop and its 8 call sites.
  • Eyebrow, DarkSheet's caption, and TitleSpread's meta now render their content (all were stubbed to <></>); fixed DarkSheet double-rendering its title.
  • Removed 4 entirely-unused exports: Annotation, DarkRow, DarkSwatch, DarkPanel.
  • Fixed the lucide icon prop typing in 03-colors / 06-icons (used LucideIcon instead of a hand-rolled ComponentType<…>), clearing 44 pre-existing type errors.

Verification

  • Type-check: no new errors — only 3 pre-existing import.meta.hot warnings in generated .tempo/* files; the 44 canvas type errors are fixed.
  • Bundler: all 89 canvas modules + canvas-chrome transform 200 through the Tempo host with no errors.
  • No content drift: storyboard names/counts preserved and JSX moved verbatim — every original string literal is accounted for; the only removal was one dead, never-rendered helper.
  • Visual: rendered the changed canvas-chrome components in a throwaway harness — covers, eyebrows, captions, and meta all display correctly.

Note / follow-up

Running Tempo's canvas_init on this sidecar layout re-scaffolds tempo/package.json + tempo/node_modules (the default sidecar expectation). Deleting them restores the single-package setup, but it will recur on re-init unless Tempo's sidecar init respects a parent-delegating config, or the project switches to the root layout.

🤖 Generated with Claude Code

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