Convert Figma logo to code with AI

vercel logoturborepo

Build system optimized for JavaScript and TypeScript, written in Rust

25,991
1,787
25,991
215

Top Related Projects

23,172

Smart Monorepos · Fast CI

35,643

:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.

Monorepo for tools developed by the Rush Stack community

🦋 A way to manage your versioning and changelogs with a focus on monorepos

29,125

Fast, disk space efficient package manager

7,339

📦🐈 Active development trunk for Yarn ⚒

Quick Overview

Turborepo is a high-performance build system for JavaScript and TypeScript monorepos. It leverages intelligent caching and optimized task scheduling to significantly speed up build and test processes across multiple projects within a single repository.

Pros

  • Extremely fast builds due to intelligent caching and parallel execution
  • Easy integration with existing Node.js and npm-based projects
  • Supports both npm and yarn package managers
  • Provides powerful CLI tools for managing monorepo workflows

Cons

  • Learning curve for developers new to monorepo architectures
  • May require significant setup time for large, existing projects
  • Limited customization options compared to some other build systems
  • Primarily focused on JavaScript/TypeScript ecosystems

Code Examples

  1. Creating a new Turborepo project:
npx create-turbo@latest
  1. Running tasks across all workspaces:
turbo run build
  1. Running tasks with custom filters:
turbo run test --filter=my-app
  1. Defining a pipeline in turbo.json:
{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "test": {
      "dependsOn": ["build"],
      "inputs": ["src/**/*.tsx", "test/**/*.ts"]
    }
  }
}

Getting Started

  1. Create a new Turborepo project:

    npx create-turbo@latest
    
  2. Navigate to the project directory:

    cd my-turborepo
    
  3. Install dependencies:

    npm install
    # or
    yarn install
    
  4. Run a task across all workspaces:

    turbo run build
    
  5. Start developing:

    turbo run dev
    

Competitor Comparisons

23,172

Smart Monorepos · Fast CI

Pros of Nx

  • More comprehensive toolset with built-in code generators and migration tools
  • Supports a wider range of technologies and frameworks out of the box
  • Offers a powerful CLI and VSCode extension for enhanced developer experience

Cons of Nx

  • Steeper learning curve due to its extensive feature set
  • Can be overkill for smaller projects or teams
  • Requires more configuration and setup compared to Turborepo

Code Comparison

Nx workspace configuration:

{
  "name": "my-workspace",
  "projects": {
    "app1": "apps/app1",
    "lib1": "libs/lib1"
  }
}

Turborepo configuration:

{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    }
  }
}

Both Nx and Turborepo aim to improve monorepo management and build performance. Nx offers a more comprehensive solution with additional features like code generation and extensive plugin ecosystem. Turborepo, on the other hand, focuses on simplicity and ease of adoption, making it a good choice for teams looking for a straightforward build orchestration tool. The choice between the two depends on project complexity, team size, and specific requirements.

35,643

:dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.

Pros of Lerna

  • More mature and established project with a larger community
  • Supports both npm and Yarn package managers
  • Offers more granular control over versioning and publishing

Cons of Lerna

  • Slower build times, especially for large monorepos
  • Less focus on caching and optimization
  • Requires more manual configuration for advanced features

Code Comparison

Lerna configuration:

{
  "packages": ["packages/*"],
  "version": "independent",
  "npmClient": "yarn"
}

Turborepo configuration:

{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    }
  }
}

Lerna focuses on package management and versioning, while Turborepo emphasizes build optimization and caching. Turborepo's configuration is more oriented towards defining task dependencies and outputs, whereas Lerna's configuration primarily deals with package locations and versioning strategies.

Turborepo offers better performance for large monorepos due to its intelligent caching and parallel execution capabilities. However, Lerna provides more flexibility in terms of package management and publishing workflows.

Both tools can be valuable depending on the project's specific needs, with Lerna being more suitable for projects requiring fine-grained control over package versioning and publishing, and Turborepo excelling in build performance and optimization for larger monorepos.

Monorepo for tools developed by the Rush Stack community

Pros of Rush Stack

  • More mature and battle-tested, with a longer history of development
  • Offers a wider range of tools and utilities for large-scale monorepo management
  • Provides stronger support for TypeScript projects out of the box

Cons of Rush Stack

  • Steeper learning curve and more complex configuration
  • Less focus on build performance optimization compared to Turborepo
  • Slower adoption of newer features and technologies

Code Comparison

Rush Stack configuration (rush.json):

{
  "rushVersion": "5.38.0",
  "pnpmVersion": "6.7.1",
  "projects": [
    {
      "packageName": "my-app",
      "projectFolder": "apps/my-app"
    }
  ]
}

Turborepo configuration (turbo.json):

{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "test": {
      "dependsOn": ["build"]
    }
  }
}

Both Rush Stack and Turborepo aim to improve monorepo management, but they have different approaches. Rush Stack offers a more comprehensive suite of tools for large-scale projects, while Turborepo focuses on simplicity and build performance. The choice between them depends on project size, complexity, and specific requirements.

🦋 A way to manage your versioning and changelogs with a focus on monorepos

Pros of Changesets

  • More flexible and customizable for complex versioning scenarios
  • Better suited for projects with multiple packages and intricate release processes
  • Provides detailed changelogs and release notes automatically

Cons of Changesets

  • Steeper learning curve and more complex setup compared to Turborepo
  • Requires more manual intervention for managing changes and releases
  • May be overkill for smaller projects or monorepos with simpler structures

Code Comparison

Changesets:

// .changeset/config.json
{
  "changelog": "@changesets/cli/changelog",
  "commit": false,
  "linked": [],
  "access": "restricted",
  "baseBranch": "main"
}

Turborepo:

// turbo.json
{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "test": {
      "dependsOn": ["build"],
      "outputs": []
    }
  }
}

Changesets focuses on versioning and changelog generation, while Turborepo emphasizes build optimization and task orchestration in monorepos. Changesets offers more granular control over version management, while Turborepo provides a simpler setup for optimizing builds and managing dependencies across packages.

29,125

Fast, disk space efficient package manager

Pros of pnpm

  • More efficient disk space usage through content-addressable storage
  • Faster installation times, especially for large monorepos
  • Built-in support for monorepos without additional tools

Cons of pnpm

  • Smaller ecosystem and community compared to npm
  • May require additional configuration for certain edge cases
  • Less integrated build and task running capabilities

Code Comparison

pnpm:

{
  "scripts": {
    "dev": "pnpm run --parallel dev",
    "build": "pnpm run --filter=./packages/* build"
  }
}

Turborepo:

{
  "pipeline": {
    "dev": {
      "cache": false
    },
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**"]
    }
  }
}

While pnpm focuses on package management and provides basic monorepo support, Turborepo offers more advanced build orchestration and caching. pnpm excels in efficient package handling and fast installations, making it ideal for large projects. Turborepo, on the other hand, provides powerful task running and caching capabilities, which can significantly speed up builds in complex monorepos. The choice between the two depends on specific project requirements and the desired level of build optimization.

7,339

📦🐈 Active development trunk for Yarn ⚒

Pros of Berry

  • More mature and established package manager with a larger ecosystem
  • Supports Plug'n'Play (PnP) for improved performance and reduced disk usage
  • Offers a wider range of features for package management and workspace handling

Cons of Berry

  • Steeper learning curve, especially when transitioning from npm or Yarn Classic
  • May require more configuration and setup for complex monorepo structures
  • Less focused on build performance optimization compared to Turborepo

Code Comparison

Berry (workspace configuration):

workspaces:
  - packages/*
  - apps/*

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
    spec: "@yarnpkg/plugin-workspace-tools"

Turborepo (turbo.json configuration):

{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    }
  }
}

Berry focuses on package management and workspace organization, while Turborepo emphasizes build pipeline optimization and caching. Berry's configuration typically involves workspace definitions and plugin management, whereas Turborepo's configuration centers around defining build pipelines and dependencies between tasks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Turborepo

Turborepo is a high-performance build system for JavaScript and TypeScript codebases, written in Rust.

Getting Started

Visit https://turbo.build/repo to get started with Turborepo.

Contributing

See CONTRIBUTING.md for more information.

Community

The Turborepo community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.

To chat with other community members, you can join the Turborepo Discord.

Our Code of Conduct applies to all Turborepo community channels.

Who is using Turborepo?

Turborepo is used by the world's leading companies. Check out the Turborepo Showcase to learn more.

Updates

Follow @turborepo on X and for project updates.

Authors

Turborepo

Security

If you believe you have found a security vulnerability in Turborepo, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities.

https://vercel.com/security

NPM DownloadsLast 30 Days