โ Back to list

turborepo
by proyecto26
Tame full-stack chaos with Temporal workflows and React wizardry, the ultimate event-driven architecture for your apps ๐งโโ๏ธโจ
โญ 68๐ด 11๐
Jan 23, 2026
SKILL.md
name: turborepo description: Turborepo monorepo management. Use when working with workspaces, build pipelines, caching, or monorepo-wide operations. allowed-tools: Read, Grep, Glob, Edit, Write, Bash(pnpm:), Bash(turbo:)
Turborepo Monorepo Guide
Project Structure
projectx/
โโโ apps/ # Applications
โ โโโ auth/ # NestJS auth service
โ โโโ order/ # NestJS order service
โ โโโ product/ # NestJS product service
โ โโโ storybook/ # Component documentation
โ โโโ web/ # React Router frontend
โโโ packages/ # Shared packages
โ โโโ core/ # @projectx/core - NestJS shared modules
โ โโโ db/ # @projectx/db - Prisma client
โ โโโ email/ # @projectx/email - Email templates
โ โโโ models/ # @projectx/models - TypeScript types
โ โโโ payment/ # @projectx/payment - Stripe
โ โโโ ui/ # @projectx/ui - React components
โ โโโ workflows/ # @projectx/workflows - Temporal
โโโ turbo.json # Turborepo config
โโโ pnpm-workspace.yaml # Workspace definition
โโโ package.json # Root package
Turbo Configuration
// turbo.json
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": [".env"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "build/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"test": {
"dependsOn": ["build"],
"inputs": ["src/**", "test/**"]
},
"lint": {
"dependsOn": ["^build"]
}
}
}
Common Commands
Development
# Run all apps in development
pnpm dev
# Run specific app
pnpm dev:web
pnpm dev:auth
pnpm dev:order
pnpm dev:product
# Run Storybook
pnpm storybook
Building
# Build all packages and apps
pnpm build
# Build specific targets
pnpm build:web
pnpm build:ui
pnpm build:auth
# Build with turbo filter
turbo run build --filter=web
turbo run build --filter=@projectx/ui
Testing
# Run all tests
pnpm test
# Test specific package
pnpm --filter web test
pnpm --filter @projectx/ui test
Filtering
# Build a package and its dependencies
turbo run build --filter=web...
# Build dependents of a package
turbo run build --filter=...@projectx/ui
# Build everything except one package
turbo run build --filter=!storybook
# Build changed packages since main
turbo run build --filter=[main]
Package Dependencies
Internal Package References
In package.json:
{
"dependencies": {
"@projectx/ui": "workspace:*",
"@projectx/db": "workspace:*",
"@projectx/models": "workspace:*"
}
}
Creating a New Package
- Create directory:
mkdir -p packages/new-package/src
- Initialize package.json:
{
"name": "@projectx/new-package",
"version": "0.0.0",
"private": true,
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "tsup src/index.ts --format esm --dts",
"dev": "tsup src/index.ts --format esm --dts --watch"
}
}
- Add to workspace consumer:
{
"dependencies": {
"@projectx/new-package": "workspace:*"
}
}
Creating a New App
- Create directory:
mkdir -p apps/new-app/src
-
Initialize with NestJS or React Router template
-
Add to turbo.json if needed for custom pipelines
Caching
Local Caching
Turbo caches build outputs locally in node_modules/.cache/turbo.
# Clear local cache
turbo run build --force
# View cache status
turbo run build --dry-run
Remote Caching (Optional)
# Login to Vercel for remote caching
turbo login
# Link to project
turbo link
Task Graph
View the task dependency graph:
turbo run build --graph
Environment Variables
Global Environment
// turbo.json
{
"globalEnv": ["DATABASE_URL", "STRIPE_SECRET_KEY"],
"globalDependencies": [".env"]
}
Task-Specific Environment
{
"tasks": {
"build": {
"env": ["NODE_ENV"]
}
}
}
Best Practices
- Use workspace protocol - Always use
workspace:*for internal deps - Keep packages focused - Each package should have a single responsibility
- Minimize dependencies - Don't create unnecessary inter-package dependencies
- Use turbo filters - Run commands only where needed
- Cache outputs - Configure outputs correctly in turbo.json
- Share configs - Use shared tsconfig, eslint configs
- Consistent naming - Use
@projectx/scope for all packages
Troubleshooting
Dependency Issues
# Clean and reinstall (cross-platform)
npx rimraf node_modules pnpm-lock.yaml
pnpm install
Build Order Issues
# See what turbo will build
turbo run build --dry-run
# Force rebuild without cache
turbo run build --force
Type Issues
# Regenerate TypeScript build info
pnpm build:core
pnpm build:ui
pnpm build
Score
Total Score
70/100
Based on repository quality metrics
โSKILL.md
SKILL.mdใใกใคใซใๅซใพใใฆใใ
+20
โLICENSE
ใฉใคใปใณในใ่จญๅฎใใใฆใใ
0/10
โ่ชฌๆๆ
100ๆๅญไปฅไธใฎ่ชฌๆใใใ
+10
โไบบๆฐ
GitHub Stars 100ไปฅไธ
0/15
โๆ่ฟใฎๆดปๅ
1ใถๆไปฅๅ ใซๆดๆฐ
+10
โใใฉใผใฏ
10ๅไปฅไธใใฉใผใฏใใใฆใใ
+5
โIssue็ฎก็
ใชใผใใณIssueใ50ๆชๆบ
+5
โ่จ่ช
ใใญใฐใฉใใณใฐ่จ่ชใ่จญๅฎใใใฆใใ
+5
โใฟใฐ
1ใคไปฅไธใฎใฟใฐใ่จญๅฎใใใฆใใ
+5
Reviews
๐ฌ
Reviews coming soon

