This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
oRPC β typesafe API framework. pnpm monorepo (Node 22+, pnpm workspaces) with packages in packages/*, docs/website in apps/content (Blume), example apps in playgrounds/*, root-level e2e tests in tests/, and benchmarks in benches/.
pnpm install # setup
pnpm test # all tests: per-package tests + root vitest
pnpm vitest run <path> # single test file (from repo root), e.g. pnpm vitest run packages/server/src/builder.test.ts
pnpm type:check # tsc across all packages β this is also what runs the *.test-d.ts type tests
pnpm lint # eslint (also the formatter β @antfu/eslint-config)
pnpm lint:fix
pnpm bench # vitest bench
pnpm --filter @orpc/server prepack # build one package (unbuild, runs automatically on pack/publish); builds are NOT needed for dev/tests- Root vitest config (
vitest.config.ts) runs all*.test.tswithglobals: true, plus a jsdom project for*.test.tsxinpackages/nextandpackages/tanstack-query. - Exceptions:
packages/bunruns withbun test,packages/cloudflarewith its own vitest (workerd) β both are excluded from the root vitest and root tsconfig. Run their tests viapnpm --filter <pkg> test.packages/nestis excluded only from the root tsconfig (type-check it withpnpm --filter @orpc/nest type:check); its tests run in the root vitest. - Docs site (Blume):
cd apps/content && pnpm dev(blume dev);pnpm buildrunsblume build. Content lives in.mdxfiles; custom pages inapps/content/pages/. The dev server caches content-collection frontmatter for custom pages β restart it after editing blog-post frontmatter.pnpm docs:validate(root) runs the JSDoc backlink checker plusblume validate --strict(links, anchors, assets); CI runs it too. - PR titles follow Conventional Commits. Scope rules:
- Use the package name (e.g.
feat(server): ...), orrpc/openapifor changes tied to a protocol rather than a single package, such as its serializers, handlers, links, or dedicated plugins. - Use
contentonly for the docs site itself (styles, Blume config, ...), and only with thechoretype β neverfeat/fix/perf/docs, since these changes do not affect library users. Documentation about a package or protocol uses that package/protocol scope instead (e.g.docs(openapi): ...). - Omit the scope when the change is too broad for a single one.
- Use the package name (e.g.