Turborepo makes your builds 60-90% faster by caching results and running tasks in parallel.
# Install all dependencies (includes Turborepo)
npm installnpm run buildWhat it does: Builds all packages in dependency order (SDK → CLI, indexer, notifications)
npm run testWhat it does: Runs test suites in parallel across all packages
npm run typecheckWhat it does: Validates TypeScript types across all packages
npm run devWhat it does: Starts all services in watch mode
npm run clean
npm run buildWhat it does: Removes all artifacts and rebuilds from scratch
npm run build⠋ @iln/sdk:build [RUNNING] Building...
⠋ @iln/indexer:build [RUNNING] Building...
⠋ @iln/notifications:build [RUNNING] Building...
✓ @iln/sdk:build [DONE] 12.3s
⠋ @iln/cli:build [RUNNING] Building...
✓ @iln/indexer:build [DONE] 8.1s
✓ @iln/notifications:build [DONE] 7.9s
✓ @iln/cli:build [DONE] 5.2s
Total time: 33.5s
npm run build✓ @iln/sdk:build [CACHE HIT] 0.1s
✓ @iln/indexer:build [CACHE HIT] 0.1s
✓ @iln/notifications:build [CACHE HIT] 0.1s
✓ @iln/cli:build [CACHE HIT] 0.1s
Total time: 0.4s (98% faster!)
# Edit SDK
echo "// comment" >> sdk/src/index.ts
npm run build✓ @iln/indexer:build [CACHE HIT] 0.1s
✓ @iln/notifications:build [CACHE HIT] 0.1s
⠋ @iln/sdk:build [RUNNING] Building...
✓ @iln/sdk:build [DONE] 12.1s
⠋ @iln/cli:build [RUNNING] Building...
✓ @iln/cli:build [DONE] 5.3s
Total time: 17.6s (only rebuilt what changed!)
# Build only SDK
npx turbo run build --filter=@iln/sdk
# Test only CLI
npx turbo run test --filter=@iln/cli# Build SDK and CLI
npx turbo run build --filter=@iln/sdk --filter=@iln/cli# Build SDK and everything that depends on it (CLI)
npx turbo run build --filter=...@iln/sdknpx turbo run build --verboserm -rf .turbonpx turbo run build --forceThe CI workflow automatically uses Turborepo caching:
# .github/workflows/ci.yml
- name: Install dependencies
run: npm ci
- name: Setup Turborepo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
- name: Run build
run: npm run build
- name: Run tests
run: npm run test:ci| Scenario | Time Without Turbo | Time With Turbo | Improvement |
|---|---|---|---|
| First build | ~8 min | ~5 min | 37% |
| No changes | ~8 min | ~30 sec | 94% |
| Change 1 package | ~8 min | ~2 min | 75% |
# Check if .turbo directory exists
ls -la .turbo
# Verify outputs configuration
cat turbo.json | grep -A 5 outputs# See execution plan
npx turbo run build --dry-run
# Visualize dependency graph
npx turbo run build --graph# Clean and rebuild
npm run clean
npm run buildShare cache across team and CI:
# Login to Vercel
npx turbo login
# Link repository
npx turbo linkNow your builds will be even faster because CI and teammates share cached results!
- Full documentation:
TURBOREPO_SETUP.md - Turborepo docs: https://turbo.build/repo/docs
- Configuration:
turbo.json
- Check
TURBOREPO_SETUP.mdfor detailed docs - Run with
--verboseto see what's happening - Use
--dry-runto see execution plan - Ask in team chat
Pro Tip: Run npm run build before switching branches to cache the current state. When you switch back, it'll be instant! ⚡