Guidance for AI and human contributors. Keep changes scoped and consistent with this layout.
Monorepo for RSC Boundary: tooling that visualizes the boundary between React Server Components and Client Components in any RSC-capable React framework. Published packages live under packages/; the demo site lives under apps/web; lightweight adapter smoke-tests live under playgrounds/.
| Path | Role |
|---|---|
packages/core |
@rsc-boundary/core — framework-agnostic: fiber walk, highlights, devtools UI, FrameworkAdapter contract. |
packages/next |
@rsc-boundary/next — Next.js App Router adapter + RscBoundaryProvider. |
packages/start |
@rsc-boundary/start — TanStack Start adapter + RscBoundaryProvider. |
apps/web |
Next.js app: marketing, docs snippets, interactive examples. Depends on @rsc-boundary/next via workspace:*. |
playgrounds/next |
Minimal Next.js 16 App Router app that smoke-tests @rsc-boundary/next. Private, not published. |
playgrounds/start |
Minimal TanStack Start app that smoke-tests @rsc-boundary/start. Private, not published. |
config/eslint-config, config/typescript-config |
Shared ESLint and TypeScript configs (@repo/eslint-config, @repo/typescript-config). |
Rule of thumb:
- Framework-agnostic detection / highlight logic →
packages/core. - Next.js-specific adapter changes (internals list, root element) →
packages/next. - TanStack Start-specific adapter changes →
packages/start. - Wiring, copy, and example routes for the public site →
apps/web.
- Package manager:
pnpm(see rootpackageManager). - Monorepo: Turborepo (
turbo.json). - App: Next.js App Router, React 19, TypeScript strict.
pnpm install
pnpm dev # turbo run dev
pnpm build # turbo run build
pnpm lint # turbo run lint
pnpm check-types # turbo run check-typesRun a single workspace with pnpm --filter <name> <script> (e.g. pnpm --filter web dev).
- Server vs client: Be explicit:
"use client"only where needed. Library code that must run on the client should be isolated and documented (entry points, dev-only imports). Avoid pulling client-only modules into RSC entry paths. - Public API: Export a small, stable surface from each package (e.g. main entry in
package.jsonexports). Internals stay unexported or under/internalif you split files. - Dependencies: Prefer peer dependencies for
react,react-dom,next, and@tanstack/react-startin the library with ranges aligned to the app; avoid pinning app-only deps inside the package unless necessary. - Quality: Match existing ESLint and TS configs; no
anywithout justification. Prefer named exports unless the repo already uses a default for a specific entry. - Testing: When tests exist, use Vitest for unit/integration and Playwright for E2E if/when added—follow existing project scripts.
- Read the nearest
package.jsonandtsconfigfor the package you're editing. - After substantive edits, run
pnpm lintandpnpm check-typesfrom the root (or the relevant--filter). - Prefer small PR-sized diffs: one concern per change (e.g. "highlight styles" vs "playground route").
- Do not add unsolicited root-level docs or refactor unrelated packages.
Rewriting the whole monorepo, changing Next/React majors without a tracked task, or adding heavy dependencies to the library without a clear need.