YeetCode

Turborepo

Build orchestration, task pipeline, and caching with Turborepo.

YeetCode uses Turborepo v2.8.1 for build orchestration. It handles dependency-aware parallel execution, output caching, and task pipelines across all workspaces.

Task Pipeline

The pipeline is defined in turbo.json:

{
  "tasks": {
    "topo": {
      "dependsOn": ["^topo"]
    },
    "build": {
      "inputs": ["$TURBO_DEFAULT$", ".env"],
      "dependsOn": ["^build"],
      "outputs": [".next/**", "!.next/cache/**", "next-env.d.ts", "dist/**"]
    },
    "dev": {
      "inputs": ["$TURBO_DEFAULT$", ".env"],
      "persistent": true,
      "cache": false
    },
    "lint": {
      "dependsOn": ["^topo"]
    },
    "typecheck": {
      "dependsOn": ["^topo"],
      "outputs": ["node_modules/.cache/tsbuildinfo.json"]
    }
  }
}

How Tasks Work

TaskDepends OnCachedNotes
topo^topo (topological)YesEnsures correct build order
build^buildYesOutputs: .next/**, dist/**
devNoPersistent (long-running), runs in parallel
lint^topoYesRuns after dependency graph is resolved
typecheck^topoYesOutputs: .tsbuildinfo
startNoStarts production servers
testNoRuns tests
cleanNoCleans build artifacts

Key Concepts

  • ^ prefix means "run this task in dependencies first." ^build means "build my dependencies before building me."
  • $TURBO_DEFAULT$ uses Turbo's default file hashing for cache invalidation.
  • Persistent tasks like dev are long-running processes that Turbo won't try to cache.

Global Dependencies

{
  "globalDependencies": ["**/.env"]
}

Any .env file change invalidates all task caches. This ensures environment variable changes always trigger fresh builds.

UI Mode

Turborepo is configured with "ui": "stream" for streaming task output in the terminal.

On this page