Monorepo Setup Recipe
SkillsStep-by-step recipe for setting up a TypeScript monorepo with Turborepo, pnpm workspaces, and shared configs.
1703/23/2026
markdown1 file
SKILL.md1.0 KB
Monorepo Setup Recipe
Stack
- pnpm workspaces for package management
- Turborepo for build orchestration
- TypeScript project references
- Shared ESLint and tsconfig
Structure
my-monorepo/
├── apps/
│ ├── web/ # Next.js app
│ └── api/ # Express/Fastify API
├── packages/
│ ├── ui/ # Shared React components
│ ├── config/ # Shared configs (eslint, tsconfig)
│ └── utils/ # Shared utilities
├── pnpm-workspace.yaml
├── turbo.json
└── package.json
Steps
pnpm initat root- Create pnpm-workspace.yaml with apps/* and packages/*
npx create-turbo@latestor manual turbo.json- Create shared tsconfig in packages/config
- Each app/package extends the shared config
- Add Turborepo pipeline for build, lint, test
Key Commands
pnpm -r build— build all packagesturbo run build— build with cachingturbo run dev --filter=web— dev single apppnpm add -w <pkg>— add to root