Contributing
Set up the monorepo, run packages locally, and submit changes
Prerequisites
- Node.js 22+
- pnpm 10+
Setup
git clone https://github.com/rbbydotdev/spac.git
cd spac
pnpm installMonorepo structure
packages/
spac/ — Core library (@spec-spac/spac)
from-openapi/ — CLI + library for reverse-generating spac from OpenAPI
playground/ — Interactive playground (Vite + React + CodeMirror)
website/ — Documentation site (Next.js + Fumadocs)
theme/ — Shared Shiki syntax themes
spac-vscode/ — VS Code extension
examples/ — Example projects (petstore, plantstore, serpapi, etc.)Build and test
Build and test the core library:
pnpm --filter @spec-spac/spac build
pnpm --filter @spec-spac/spac testBuild and test the from-openapi package:
pnpm --filter @spec-spac/from-openapi build
pnpm --filter @spec-spac/from-openapi testRunning locally
Docs site
The documentation site uses Next.js with Fumadocs:
pnpm --filter website devThis starts the dev server at http://localhost:3000 with hot reload.
Playground
The playground is a Vite + React app with CodeMirror editors and a TypeScript language service running in a web worker:
# Generate fixtures first (required once, or after changing examples/spac source)
pnpm --filter spac-playground generate
# Start dev server
pnpm --filter spac-playground devThe generate step:
- Runs the
from-openapicodegen on example specs - Builds source maps and fixture data
- Bundles type declarations (
.d.tsfiles) for the in-browser TypeScript language service - Validates all fixtures
Re-run generate after modifying example specs or the spac package source.
Playground e2e tests
The playground has Playwright end-to-end tests that verify loading, navigation, hover tooltips, and source mapping:
# Install browser (first time only)
npx playwright install chromium
# Run tests
pnpm --filter spac-playground test:e2eThese tests also run in CI on every push.
Formatting
The repo uses Biome for formatting:
pnpm format # auto-fix
pnpm format:check # check only (used in CI)CI
The GitHub Actions CI workflow runs on every push and PR to master:
- Builds and tests
@spec-spac/spac - Builds and tests
@spec-spac/from-openapi - Generates playground fixtures
- Builds the playground
- Runs Playwright e2e tests
A separate deploy workflow builds and publishes the docs site and playground to GitHub Pages.