Contributing
Local Setup
Clone the repo, install dependencies, and run the monorepo locally.
Scrivr is a pnpm monorepo managed by Turbo. Here's how to get your local environment running.
Prerequisites
- Node.js ≥ 20 (LTS recommended —
node --version) - pnpm ≥ 10 —
npm install -g pnpm - Git
Clone and Install
git clone https://github.com/your-org/scrivr.git
cd scrivr
pnpm installRunning the Dev Servers
# Start all apps and watch packages simultaneously
pnpm dev
# Or target specific apps:
pnpm --filter @scrivr/demo dev # demo editor at http://localhost:5173
pnpm --filter @scrivr/docs dev # documentation at http://localhost:3000For multiplayer features you will need a Hocuspocus server running locally. See the Collaboration example for setup instructions.
Environment Variables
Create a .env file in apps/demo/ (copy from apps/demo/.env.example if present):
VITE_WS_URL=ws://localhost:1234 # Hocuspocus WebSocket server
ANTHROPIC_API_KEY=sk-ant-... # Required for AI featuresRunning Tests
# All packages
turbo test
# Watch mode (re-runs on file changes)
turbo test:watch
# With coverage
turbo test -- --coverageTests live co-located with source files as *.test.ts. New code should include tests.
Linting and Type Checking
pnpm lint # ESLint + TypeScript — must pass with zero errors/warnings before opening a PR
pnpm tsc # Full monorepo type checkBuilding Packages
# Build all packages (required before running apps in production mode)
turbo build
# Build a specific package
pnpm --filter @scrivr/core buildPackages are built with tsup into each package's dist/ directory. App builds use Vite.