This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
FUNSTACK Static (@funstack/static) is a Vite plugin that provides a React framework with React Server Components (RSC) support — without a runtime server. It generates static HTML + RSC payloads for client-side rendering, suitable for static hosting.
pnpm monorepo with Turbo for build orchestration.
packages/static/— Core framework package (@funstack/static)packages/docs/— Documentation site (built with the framework itself)packages/example/— Example applicationpackages/static/e2e/— E2E test fixtures and tests
All commands run from the repository root unless noted otherwise.
pnpm install # Install dependencies
pnpm build # Build all packages (via Turbo)
pnpm typecheck # Type-check all packages
pnpm lint # Lint with oxlint
pnpm format # Format with Prettier
pnpm format:check # Check formattingpnpm test # Unit tests in watch mode (vitest)
pnpm test:run # Unit tests single run
pnpm test:e2e # E2E tests against production build (Playwright)
pnpm test:e2e:dev # E2E tests against dev server (Playwright)Important: E2E fixtures import from dist/ (via package exports), not src/. You must run pnpm build after changing source code before running e2e tests. Turbo handles this automatically when running from the root.
pnpm --filter docs dev # Start docs dev server
pnpm --filter docs preview # Preview docs production buildThe Vite plugin supports two configuration modes:
- Single-entry:
{ root: "./src/root.tsx", app: "./src/App.tsx" }— one HTML page - Multi-entry:
{ entries: "./src/entries.tsx" }— multiple pages viaEntryDefinition[]
Options: ssr (default: false), publicOutDir (default: "dist/public"), clientInit (client-side init module path).
plugin/— Vite plugin setup (index.ts), dev/preview server middleware (server.ts)rsc/— RSC entry point (entry.tsx), deferred components (defer.tsx), entry resolutionclient/— Client hydration entry (entry.tsx), error boundaryssr/— SSR rendering withreact-dom/static.prerender()build/— Build orchestration, content hashing, dependency graph, entry path validationentries/— Export entry points for different Vite environments (rsc, client, ssr, server)rsc-client/— Client-side RSC wrapperutil/— URL path mapping, base path handling, stream utilities
- Build time: RSC renders server components → RSC payloads written as static files
- SSR (optional): Root and App are server-rendered to HTML
- Client: Hydrates (if SSR) or renders from RSC payloads;
defer()enables lazy-loaded RSC chunks
- TypeScript strict mode with
verbatimModuleSyntax(explicit type imports required) - Unit tests colocated with source (
*.test.ts) - E2E tests separated:
e2e/tests/(build/preview) ande2e/tests-dev/(dev server)
- Use conventional commits format:
type(scope): description
To distinguish what should be included in the changelog, fixes in the docs or example packages should be marked with docs or example scope, respectively. For example:
fix(docs): correct typo in READMEfix(example): update dependencies in example package
Changes to the main static package can be left without a scope or marked with static:
feat: add new API for deferred componentsfeat(static): add new API for deferred components