Loading...
Loading...
Provides comprehensive Turborepo monorepo management guidance for TypeScript/JavaScript projects. Use when creating Turborepo workspaces, configuring turbo.json tasks, setting up Next.js/NestJS apps, managing test pipelines (Vitest/Jest), configuring CI/CD, implementing remote caching, or optimizing build performance in monorepos
npx skill4agent add giuseppe-trisciuoglio/developer-kit turborepo-monorepoturbo.json# Using pnpm (recommended)
pnpm create turbo@latest my-workspace
# Using npm
npm create turbo@latest my-workspace
# Using yarn
yarn create turbo my-workspacepnpm add -D -w turbo{
"$schema": "https://turborepo.dev/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"outputs": []
},
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"]
}
}
}{
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"test": "turbo run test",
"clean": "turbo run clean"
}
}{
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"]
},
"lint": {
"outputs": []
}
}
}# Run task for all packages
turbo run build
# Run multiple tasks
turbo run lint test build
# Run for specific package
turbo run build --filter=web{
"pipeline": {
"transit": {
"dependsOn": ["^transit"]
},
"typecheck": {
"dependsOn": ["transit"],
"outputs": []
}
}
}{
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"],
"env": ["NEXT_PUBLIC_*"]
}
}
}{
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"start:dev": {
"cache": false,
"persistent": true
}
}
}{
"pipeline": {
"test": {
"outputs": [],
"inputs": ["$TURBO_DEFAULT$", "vitest.config.ts"]
},
"test:watch": {
"cache": false,
"persistent": true
}
}
}turbo run test --filter=[HEAD^]{
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["$TURBO_EXTENDS$", ".next/**"]
}
}
}- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm run test --filter=[HEAD^]
- name: Build
run: pnpm run build --filter=[HEAD^]# Login to Vercel
npx turbo login
# Link repository
npx turbo link| Property | Description | Example |
|---|---|---|
| Tasks that must complete first | |
| Files/folders to cache | |
| Files for cache hash | |
| Environment variables affecting hash | |
| Enable/disable caching | |
| Long-running task | |
| Log verbosity | |
^tasktaskpackage#task| Filter | Description |
|---|---|
| Only web package |
| web + all dependencies |
| web + all dependents |
| web + deps + dependents |
| Packages changed since last commit |
| All packages in apps/ |
{
"pipeline": {
"build": {
"outputs": ["dist/**"],
"inputs": ["$TURBO_DEFAULT$", "!README.md", "!**/*.md"]
}
}
}dependsOndependsOn: ["^build"]dependsOn: ["build"]cache: false, persistent: truemy-workspace/
├── apps/
│ ├── web/ # Next.js app
│ └── api/ # NestJS backend
├── packages/
│ ├── ui/ # React component library
│ └── config/ # Shared configs
├── turbo.json
├── package.json
└── pnpm-workspace.yamldependsOn{
"build": {
"dependsOn": ["^build"]
}
}globalDependenciesinputs{
"globalDependencies": ["tsconfig.json"],
"pipeline": {
"build": {
"inputs": ["$TURBO_DEFAULT$", "!*.md"]
}
}
}{
"transit": { "dependsOn": ["^transit"] },
"typecheck": { "dependsOn": ["transit"] }
}pnpm create turbo@latest my-workspace
cd my-workspace
# Add Next.js app
pnpm add next react react-dom -F apps/web
# Add NestJS API
pnpm add @nestjs/core @nestjs/common -F apps/api{
"pipeline": {
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"],
"inputs": ["$TURBO_DEFAULT$", "vitest.config.ts"]
},
"test:watch": {
"cache": false,
"persistent": true
}
}
}pnpm run test --filter=[HEAD^]# Dry run to see what would be executed
turbo run build --dry-run --filter=web
# Show hash inputs
turbo run build --force --filter=webpackage.jsonconcurrency| Topic | Reference File |
|---|---|
| turbo.json template | references/turbo.json |
| Next.js integration | references/nextjs-config.md |
| NestJS integration | references/nestjs-config.md |
| Vitest/Jest/Playwright | references/testing-config.md |
| GitHub/CircleCI/GitLab CI | references/ci-cd.md |
| Package configurations | references/package-configs.md |