DEV Community

Alex Spinov
Alex Spinov

Posted on

Turborepo Has a Free API — Monorepo Build System That Caches Everything

Turborepo is a build system for JavaScript/TypeScript monorepos. It caches task results, runs tasks in parallel, and makes your CI 10x faster.

Why Turborepo?

  • Caching — never rebuild what hasn't changed
  • Parallel — run independent tasks simultaneously
  • Remote caching — share cache across team/CI
  • Zero config — works with npm, pnpm, yarn workspaces

Quick Start

npx create-turbo@latest
Enter fullscreen mode Exit fullscreen mode

turbo.json

{
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "test": {
      "dependsOn": ["build"]
    },
    "lint": {},
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Commands

turbo build          # Build all packages
turbo test           # Test all packages
turbo lint           # Lint all packages
turbo build --filter=web  # Build only 'web' package
turbo build --filter=./apps/*  # Build all apps
Enter fullscreen mode Exit fullscreen mode

Workspace Structure

my-monorepo/
├── apps/
│   ├── web/          # Next.js app
│   └── api/          # Express server
├── packages/
│   ├── ui/           # Shared React components
│   ├── config/       # Shared ESLint/TS config
│   └── utils/        # Shared utilities
├── turbo.json
└── package.json
Enter fullscreen mode Exit fullscreen mode

Remote Caching

npx turbo login
npx turbo link
# Now CI uses shared cache — builds are instant if nothing changed
Enter fullscreen mode Exit fullscreen mode

Scaling your development workflow? Check out my Apify actors for web scraping, or email spinov001@gmail.com for custom monorepo solutions.

Turborepo, Nx, or Moon — which monorepo tool do you use? Share below!

Top comments (0)