mirror of
https://github.com/jakejarvis/stanza.git
synced 2026-08-30 23:05:33 -04:00
0faa301737b2a4d23e3dd479d27a7e793bd8887f
*.functions.ts/*.server.ts file conventions, and fix palette crash + stale file-tree + theme mismatch
- Delete `apps/web/server/routes/` (standalone Nitro dir) and replace with TanStack Start server routes colocated in `src/routes/`: `og.index.ts` and `og.$slot.$id.ts` use `createFileRoute(...).server.handlers.GET` to serve `@vercel/og` image responses; `sitemap[.]xml.ts` does the same for XML — no separate `serverDir` config or Nitro required
- OG image URLs are extensionless (`/og`, `/og/$slot/$id`) so they aren't swallowed by Vite static-asset handling; crawlers read the `image/png` content-type header
- Adopt `apps/web/src/server/` file-organization convention: `*.functions.ts` for `createServerFn` wrappers safe to import anywhere, `*.server.ts(x)` for server-only modules (Shiki, `@vercel/og` card components, fs registry reads), plain `*.ts` for client-safe types — rename `builder-state.ts` → `builder-state.functions.ts`, `module-detail.ts` → `module-detail.functions.ts`, `registry-index.ts` → `registry-index.functions.ts`, `og-card.tsx` → `og-card.server.tsx`, `registry-base.ts` → `registry-base.server.ts`; extract pure Shiki logic into `highlighter.server.ts`; leave `highlighter.ts` as the client-safe re-export
- Fix CMD+K palette crash: `DialogContent` was rendering children outside any `<Command>` context; move `<DialogHeader>` inside `DialogContent` and wrap children in `<Command>` in `command.tsx`
- Fix stale file-tree on selection change: `useFileTree` builds its model once (lazy `useState` init) and ignores later `paths` prop changes; call `model.resetPaths(filePaths)` in a `useEffect` keyed on `filePaths` so the tree reflects new selections
- Fix file-tree theme mismatch: tree's shadow-DOM palette was auto-detecting via `prefers-color-scheme` and diverging when the user picked a non-OS theme; pass `themeToTreeStyles({ type: resolvedTheme })` as `style` to `<FileTree>` so it tracks the app's ThemeProvider
- Fix Base UI native-`<button>` warning in `header.tsx`: add `nativeButton={false}` to the GitHub link `<Button>` that renders an `<a>` tag
Stanza
Modular monorepo template CLI — shadcn for full-stack TypeScript stacks.
pnpm create stanza my-app
Pick a framework, ORM, database, auth provider, styling — get a clean monorepo with idiomatic code, vendored into your repo. Add modules later with stanza add.
Generated projects keep slot boundaries explicit: auth, db, and orm install into their own internal workspace packages (packages/auth/, packages/db/, named @<your-app>/auth, @<your-app>/db), and your app consumes them via workspace:* deps. Swapping an auth provider replaces the contents of packages/auth/ without touching your app's imports.
What's inside
apps/
cli/ # @stanza/cli — the CLI binary
web/ # https://stanza.tools (TanStack Start)
packages/
registry/ # shared schema, slot/peer/capability resolver
codemods/ # ts-morph helpers for region-aware patching
create-stanza/ # `pnpm create stanza` shim
registry/
modules/ # first-party modules (framework, orm, db, auth, styling)
Status
Work in progress. See CLAUDE.md, TODO.md, and REGISTRY.md for current state.
License
MIT — see LICENSE.
Languages
TypeScript
91.5%
MDX
6.1%
CSS
2.2%
JavaScript
0.2%