### Quickstart with bun Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Create a new Turborepo project with the with-vite example using bun ```bash bunx create-turbo@latest -e with-vite ``` -------------------------------- ### Quickstart with npm Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Create a new Turborepo project with the with-vite example using npm ```bash npx create-turbo@latest -e with-vite ``` -------------------------------- ### Quickstart with yarn Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Create a new Turborepo project with the with-vite example using yarn ```bash yarn dlx create-turbo@latest -e with-vite ``` -------------------------------- ### Quickstart with pnpm Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Create a new Turborepo project with the with-vite example using pnpm ```bash pnpm dlx create-turbo@latest -e with-vite ``` -------------------------------- ### Bootstrap Turborepo example with create-turbo (pnpm, yarn, npm, bun) Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/getting-started/examples.mdx This set of commands demonstrates how to initialize a new Turborepo project using the `create-turbo` CLI tool. It allows users to bootstrap a monorepo from either a predefined example name or a community-maintained GitHub repository URL, supporting various package managers like pnpm, yarn, npm, and bun. ```bash # Use an example listed below pnpm dlx create-turbo@latest --example [example-name] # Use a GitHub repository from the community pnpm dlx create-turbo@latest --example [github-url] ``` ```bash # Use an example listed below yarn dlx create-turbo@latest --example [example-name] # Use a GitHub repository from the community yarn dlx create-turbo@latest --example [github-url] ``` ```bash # Use an example listed below npx create-turbo@latest --example [example-name] # Use a GitHub repository from the community npx create-turbo@latest --example [github-url] ``` ```bash # Use an example listed below bunx create-turbo@latest --example [example-name] # Use a GitHub repository from the community bunx create-turbo@latest --example [github-url] ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/vercel/turborepo/blob/main/examples/kitchen-sink/apps/blog/README.md Install all local dependencies required for the Remix project. This must be executed before running the development server to ensure all packages are available. ```shell npm install ``` -------------------------------- ### Create Turborepo project with OpenTelemetry example Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/blog/2-9.mdx Bootstrap a new Turborepo project with a pre-configured OpenTelemetry setup including Docker Compose and example dashboards. ```bash npx create-turbo@latest -e with-otel ``` -------------------------------- ### Start PostgreSQL database with Docker Compose Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Launch a PostgreSQL server in a Docker container using the included docker-compose.yml file. This creates a local database named 'turborepo' that Prisma can connect to for development. ```bash docker-compose up -d ``` -------------------------------- ### Navigate to project directory Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Change into the newly created Turborepo project directory to access the monorepo structure and configuration files. ```bash cd ./my-turborepo ``` -------------------------------- ### Start a SolidStart development server with npm Source: https://github.com/vercel/turborepo/blob/main/examples/with-solid/apps/docs/README.md After installing dependencies, use these commands to start the development server for your SolidStart project. The second command includes an option to automatically open the application in a new browser tab upon startup. ```bash npm run dev # or start the server and open the app in a new browser tab npm run dev -- --open ``` -------------------------------- ### Show Sandbox Setup and Context Source: https://github.com/vercel/turborepo/blob/main/packages/tbx/README.md Ensures the repo-pinned Sandbox CLI dependency is installed and prints current authentication and project context. ```bash pnpm tbx setup ``` -------------------------------- ### Build all apps and packages with yarn, pnpm, or bun Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Build all monorepo applications and packages using alternative package managers. ```bash # Using yarn yarn run build # Using pnpm pnpm run build # Using bun bun run build ``` -------------------------------- ### Install Vercel CLI and Deploy Source: https://github.com/vercel/turborepo/blob/main/examples/kitchen-sink/apps/blog/README.md Install the Vercel CLI globally and deploy your Remix application to Vercel. The vercel command initiates the deployment process with automatic configuration detection. ```shell npm i -g vercel vercel ``` -------------------------------- ### Initialize Turborepo Project with Berry Starter using npx Source: https://github.com/vercel/turborepo/blob/main/examples/with-berry/README.md This command initializes a new Turborepo project from the `with-berry` example template. It uses `npx` to execute the `create-turbo` package, setting up a monorepo pre-configured with Yarn v2+ (Berry) for package management. This is the first step to get started with the example. ```sh npx create-turbo@latest -e with-berry ``` -------------------------------- ### Initialize Turborepo with SvelteKit example using various package managers Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/sveltekit.mdx This command quickly sets up a new Turborepo monorepo pre-configured with a SvelteKit application by using the `with-svelte` example. It leverages `create-turbo` to scaffold the project, providing a ready-to-use starting point for SvelteKit development within a Turborepo. ```bash pnpm dlx create-turbo@latest -e with-svelte ``` ```bash yarn dlx create-turbo@latest -e with-svelte ``` ```bash npx create-turbo@latest -e with-svelte ``` ```bash bunx create-turbo@latest -e with-svelte ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/vercel/turborepo/blob/main/examples/with-react-native-web/apps/web/README.md Initializes the local development environment using Yarn. This command starts the Next.js server with hot-reloading enabled, allowing developers to view changes in real-time at http://localhost:3000. ```bash yarn dev ``` -------------------------------- ### Install Dependencies and Build Vitest Config Package Source: https://github.com/vercel/turborepo/blob/main/examples/with-vitest/README.md Initialize the Turborepo project by installing dependencies and building the shared @repo/vitest-config package. This setup is required before running tests and establishes the foundation for package-level caching. ```bash pnpm install pnpm build --filter=@repo/vitest-config ``` -------------------------------- ### Start Turborepo Application with Package Managers Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Commands to start a Turborepo application using yarn, pnpm, or bun package managers. The application will be accessible at http://localhost:3000. Choose the appropriate command based on your project's package manager configuration. ```bash yarn run dev ``` ```bash pnpm run dev ``` ```bash bun run dev ``` -------------------------------- ### Start development server for a specific Turborepo package using package managers and filter Source: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md Use your package manager's `dlx` or `exec` command to run `turbo dev` with the `--filter` option. This starts the development server for a single, specified package (e.g., `web`) without requiring a global Turborepo installation. ```sh npx turbo dev --filter=web ``` ```sh yarn exec turbo dev --filter=web ``` ```sh pnpm exec turbo dev --filter=web ``` -------------------------------- ### Run Next.js Development Server with npm, yarn, pnpm, or bun Source: https://github.com/vercel/turborepo/blob/main/examples/basic/apps/docs/README.md This snippet provides commands to start the development server for a Next.js application. It supports various package managers including npm, yarn, pnpm, and bun. Executing any of these commands will typically launch the application, making it accessible in a web browser at `http://localhost:3000`. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Start development server for all Turborepo apps and packages using package managers Source: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md Navigate into your Turborepo directory and execute `turbo dev` using your preferred package manager's `dlx` or `exec` command. This initiates development servers for all monorepo components without a global Turborepo installation. ```sh cd my-turborepo npx turbo dev ``` ```sh cd my-turborepo yarn exec turbo dev ``` ```sh cd my-turborepo pnpm exec turbo dev ``` -------------------------------- ### Seed database with yarn, pnpm, or bun Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Execute the database seeding script using alternative package managers to populate the database with initial data. ```bash # Using yarn yarn run db:seed # Using pnpm pnpm run db:seed # Using bun bun run db:seed ``` -------------------------------- ### Copy environment configuration files Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Copy the .env.example template to both the database and web packages as .env files. This ensures Prisma has access to the DATABASE_URL environment variable required for database connectivity. ```bash cp .env.example ./packages/database/.env cp .env.example ./apps/web/.env ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/vercel/turborepo/blob/main/examples/with-otel/apps/docs/README.md Start the development server for a Next.js application using various package managers. The server runs on http://localhost:3000 and supports hot-reloading for automatic page updates during development. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` ```bash bun dev ``` -------------------------------- ### Docker Network and Compose Build Setup Source: https://github.com/vercel/turborepo/blob/main/examples/with-docker/README.md Install dependencies, create a Docker network for inter-container communication, and build all applications using Docker Compose with BuildKit engine. This enables containers to communicate using container names as hostnames. ```shell # Install dependencies yarn install # Create a network, which allows containers to communicate # with each other, by using their container name as a hostname docker network create app_network # Build prod using new BuildKit engine COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml build # Start prod in detached mode docker-compose -f docker-compose.yml up -d ``` -------------------------------- ### Develop all apps and packages Source: https://github.com/vercel/turborepo/blob/main/examples/with-vite-module-federation/README.md Commands to start development servers for all applications and packages, with and without global `turbo` installation. ```sh # With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended) turbo dev # Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager npx turbo dev yarn exec turbo dev pnpm exec turbo dev ``` -------------------------------- ### Build all apps and packages with npm Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Compile and build all applications and packages in the Turborepo monorepo. This command orchestrates builds across the entire workspace. ```bash npm run build ``` -------------------------------- ### Bootstrap Turborepo with example template Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/reference/create-turbo.mdx Create a new Turborepo monorepo using a predefined example template. The --example flag accepts either an example name from the official Turborepo repository or a GitHub URL for community-maintained examples. ```bash pnpm dlx create-turbo@latest --example [example-name] ``` ```bash yarn dlx create-turbo@latest --example [example-name] ``` ```bash npx create-turbo@latest --example [example-name] ``` ```bash bunx create-turbo@latest --example [example-name] ``` -------------------------------- ### Develop a specific package Source: https://github.com/vercel/turborepo/blob/main/examples/with-vite-module-federation/README.md Commands to start a development server for a single package (e.g., `react-host`) using a filter, with and without global `turbo` installation. ```sh # With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended) turbo dev --filter=react-host # Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager npx turbo dev --filter=react-host yarn exec turbo dev --filter=react-host pnpm exec turbo dev --filter=react-host ``` -------------------------------- ### Initialize Turborepo with Vue/Nuxt Example using npx Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/blog/turbo-1-11-0.mdx This command initializes a new Turborepo monorepo project, specifically using the `with-vue-nuxt` example template. It leverages `npx` to execute the `create-turbo` package without global installation, providing a quick way to set up a monorepo with pre-configured Vue and Nuxt environments and best practices. ```bash npx create-turbo@latest -e with-vue-nuxt ``` -------------------------------- ### Initialize Storybook Application (Bash) Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/tools/storybook.mdx Run `create storybook@latest` within the `apps/storybook` directory to scaffold a new Storybook project. This command interactively sets up Storybook's configuration, dependencies, and example files, preparing it for component development and documentation. It assumes React and TypeScript for the rest of the guide. ```bash pnpm create storybook@latest ``` ```bash yarn create storybook@latest ``` ```bash npm create storybook@latest ``` ```bash bun create storybook@latest ``` -------------------------------- ### Run database migrations with npm Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Execute Prisma migrations to create and apply database schema changes. This command uses Prisma Migrate to set up necessary tables and prompts for a migration name. ```bash npm run db:migrate:dev ``` -------------------------------- ### Start development servers for all Turborepo applications and packages Source: https://github.com/vercel/turborepo/blob/main/examples/with-biome/README.md These commands initiate the development process for all applications and packages in the Turborepo. They use the `turbo dev` command, providing options for both global `turbo` installations and execution through `npx`, `yarn exec`, or `pnpm exec`. This is ideal for simultaneous development across the entire monorepo. ```sh cd my-turborepo # With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended) turbo dev # Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager npx turbo dev yarn exec turbo dev pnpm exec turbo dev ``` -------------------------------- ### Test Turborepo Example with create-turbo Source: https://github.com/vercel/turborepo/blob/main/CONTRIBUTING.md Use this command to test a new Turborepo example as a user would, by pointing `create-turbo` to the example's source code URL. ```bash npx create-turbo@latest --example https://github.com/your-org/your-repo/tree/your-branch/... ``` -------------------------------- ### Initialize Turborepo project with Vite starter (Shell) Source: https://github.com/vercel/turborepo/blob/main/examples/with-vite/README.md This command initializes a new Turborepo project using the `create-turbo` CLI tool. It specifically uses the `with-vite` example template to set up a monorepo structure with pre-configured Vite applications and shared packages, providing a quick start for development. ```sh npx create-turbo@latest -e with-vite ``` -------------------------------- ### Create API Route Handler - TypeScript Source: https://github.com/vercel/turborepo/blob/main/examples/with-yarn/apps/docs/README.md Demonstrates the file structure for creating Next.js API routes using the App Router. Create a route.ts file in api subdirectories to define endpoint handlers. Example shows api/hello/route.ts mapping to http://localhost:3001/api/hello endpoint. ```typescript api/hello/route.ts ``` -------------------------------- ### Initialize a Solid project Source: https://github.com/vercel/turborepo/blob/main/examples/with-solid/apps/web/README.md Use the Solid CLI to bootstrap a new project in the current directory or a specific folder. ```bash # create a new project in the current directory npm init solid@latest # create a new project in my-app npm init solid@latest my-app ``` -------------------------------- ### Start development environment Source: https://github.com/vercel/turborepo/blob/main/examples/with-ultracite/README.md Navigates to the project directory and starts the development server for all workspace members. ```sh cd my-turborepo turbo dev ``` -------------------------------- ### Start Remix Development Server Source: https://github.com/vercel/turborepo/blob/main/examples/kitchen-sink/apps/blog/README.md Start the Remix development server locally. The server runs on http://localhost:5173 and provides hot module reloading for development. ```shell npm run dev ``` -------------------------------- ### Start development server Source: https://github.com/vercel/turborepo/blob/main/examples/with-nextjs-elysia/README.md Run the development server for all apps and packages with the supported dev script. ```bash bun run dev ``` -------------------------------- ### Run the development server Source: https://github.com/vercel/turborepo/blob/main/examples/basic/apps/web/README.md Start the local development environment using various package managers. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Install Turborepo globally via package managers Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/getting-started/index.mdx Installs the turbo CLI globally on your system to enable running turbo commands from any directory. This snippet provides the necessary commands for npm, yarn, and pnpm users. ```npm npm install turbo --global ``` ```yarn yarn global add turbo ``` ```pnpm pnpm add turbo --global ``` -------------------------------- ### Initialize projects from examples or custom repositories using bash Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/blog/turbo-1-9-0.mdx The -e flag allows bootstrapping projects from official Turborepo templates or external Git repositories. ```bash npx create-turbo@latest -e kitchen-sink ``` ```bash npx create-turbo -e https://github.com/your-org/turbo-starter ``` -------------------------------- ### Install ESLint and eslint-config-turbo via npm Source: https://github.com/vercel/turborepo/blob/main/packages/eslint-config-turbo/README.md Install ESLint as a development dependency, then install the eslint-config-turbo package. These are prerequisite steps before configuring ESLint for Turborepo projects. ```shell npm install eslint --save-dev npm install eslint-config-turbo --save-dev ``` -------------------------------- ### Create API Route Endpoint - TypeScript Source: https://github.com/vercel/turborepo/blob/main/examples/with-tailwind/apps/web/README.md Creates a Next.js API route handler by adding a route.ts file in the api directory structure. The file path api/hello/route.ts automatically maps to the HTTP endpoint /api/hello, allowing you to define request handlers for specific API endpoints. ```typescript // File: src/app/api/hello/route.ts // Create this file to map to http://localhost:3001/api/hello ``` -------------------------------- ### Run a build task for the first time Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/crafting-your-repository/caching.mdx Execute the build script defined in `package.json` using your preferred package manager. This initial run will result in a cache miss. ```bash pnpm run build ``` ```bash yarn build ``` ```bash npm run build ``` ```bash bun run build ``` -------------------------------- ### Build all applications and packages in Turborepo Source: https://github.com/vercel/turborepo/blob/main/examples/with-solid/README.md Navigate into the `with-solid` directory and execute the `pnpm run build` command to compile all applications and packages within the Turborepo monorepo. ```sh cd with-solid pnpm run build ``` -------------------------------- ### Configure dev task with setup dependencies in turbo.json Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/crafting-your-repository/developing-applications.mdx Set up a development task that depends on setup scripts using the dependsOn property. This ensures setup tasks run before the dev task starts, useful for environment setup or pre-building packages. ```json { "tasks": { "dev": { "cache": false, "persistent": true, "dependsOn": ["//#dev:setup"] }, "//#dev:setup": { "outputs": [".codegen/**"] } } } ``` -------------------------------- ### Upgrade or Initialize Turborepo Project using Various Package Managers Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/blog/turbo-2-6.mdx These commands demonstrate how to upgrade an existing Turborepo project to version 2.6 using the automated codemod CLI, or how to start a new Turborepo project from scratch. Examples are provided for pnpm, yarn, npm, and bun package managers. Ensure you have the respective package manager installed before running these commands. ```bash # Use the automated upgrade CLI pnpm dlx @turbo/codemod migrate # Start a new repository pnpm dlx create-turbo@latest ``` ```bash # Use the automated upgrade CLI yarn dlx @turbo/codemod migrate # Start a new repository yarn dlx create-turbo@latest ``` ```bash # Use the automated upgrade CLI npx @turbo/codemod migrate # Start a new repository npx create-turbo@latest ``` ```bash # Use the automated upgrade CLI bunx @turbo/codemod migrate # Start a new repository bunx create-turbo@latest ``` -------------------------------- ### Install optional dependencies on Windows Source: https://github.com/vercel/turborepo/blob/main/CONTRIBUTING.md Install jq and zstandard on Windows using Chocolatey, required for running tests locally. ```bash choco install jq zstandard ``` -------------------------------- ### Terminal Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Commands to create a new Turborepo project using the 'with-vite-module-federation' example. ```bash pnpm dlx create-turbo@latest -e with-vite-module-federation ``` ```bash yarn dlx create-turbo@latest -e with-vite-module-federation ``` ```bash npx create-turbo@latest -e with-vite-module-federation ``` ```bash bunx create-turbo@latest -e with-vite-module-federation ``` -------------------------------- ### Install development dependency in specific workspaces Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/crafting-your-repository/managing-dependencies.mdx These examples demonstrate how to install a development dependency, such as 'jest', into specific packages within a Turborepo monorepo using various package managers. This practice ensures dependencies are declared where they are used. ```bash pnpm add jest --save-dev --recursive --filter=web --filter=@repo/ui --filter=docs ``` ```bash yarn workspace web add jest --dev yarn workspace @repo/ui add jest --dev ``` ```bash yarn workspaces foreach -R --from '{web,@repo/ui}' add jest --dev ``` ```bash npm install jest --workspace=web --workspace=@repo/ui --save-dev ``` ```bash cd apps/web && bun install jest --dev cd packages/ui && bun install jest --dev ``` -------------------------------- ### Create Turborepo with Docker Example Source: https://github.com/vercel/turborepo/blob/main/examples/with-docker/README.md Initialize a new Turborepo project using the with-docker example template. This command scaffolds a complete monorepo structure with Docker configuration pre-configured. ```shell npx create-turbo@latest -e with-docker ``` -------------------------------- ### Vite configuration for microfrontends Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/frameworks/vite.mdx Configure the base property in vite.config.ts for child applications in a microfrontends setup ```typescript import { defineConfig } from "vite"; export default defineConfig({ base: "/admin", }); ``` -------------------------------- ### Create a new SolidStart project using npm Source: https://github.com/vercel/turborepo/blob/main/examples/with-solid/apps/docs/README.md These commands initialize a new SolidStart project. The first command creates the project in the current directory, while the second command creates it in a specified subdirectory named 'my-app'. ```bash # create a new project in the current directory npm init solid@latest # create a new project in my-app npm init solid@latest my-app ``` -------------------------------- ### Conventional Commit PR Title Examples Source: https://github.com/vercel/turborepo/blob/main/AGENTS.md These examples illustrate the required format for pull request titles, adhering to Conventional Commits specifications. Titles must start with a type, followed by a description beginning with an uppercase letter, and scopes are not permitted. ```text feat: Add new cache configuration option fix: Resolve race condition in task scheduling docs: Update installation instructions ``` -------------------------------- ### Create Turborepo Project with Yarn Source: https://github.com/vercel/turborepo/blob/main/examples/with-yarn/README.md Initialize a new Turborepo project using the create-turbo CLI with the yarn-based example template. This command scaffolds a complete monorepo structure with pre-configured apps and packages. ```shell npx create-turbo@latest -e with-yarn ``` -------------------------------- ### Get turbo binary path - Bash Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/reference/bin.mdx Outputs the file system path to the turbo binary executable. For global installations, returns the path to the global package manager directory. For local installations, returns the path within node_modules. ```bash turbo bin ``` -------------------------------- ### create-turbo-config turbo.json creation example Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/reference/turbo-codemod.mdx Shows the new turbo.json file created with extracted pipeline configuration from package.json. ```json + { + "$schema": "https://turborepo.dev/schema.json", + "pipeline": { + ... + } + } ``` -------------------------------- ### Start development server for all Turborepo apps and packages using global turbo Source: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md Navigate into your Turborepo directory and run `turbo dev`. This command starts the development servers for all applications and packages in the monorepo, enabling concurrent development across the project. ```sh cd my-turborepo turbo dev ``` -------------------------------- ### Create a new Turborepo project Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/crafting-your-repository/caching.mdx Use `npx create-turbo@latest` to initialize a new Turborepo project by following the interactive prompts. ```bash npx create-turbo@latest ``` -------------------------------- ### Initialize a Turborepo Project with Next.js and Remix Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/blog/turbo-1-11-0.mdx This command initializes a new Turborepo project using the create-turbo CLI with the 'kitchen-sink' example. This example typically includes a monorepo setup featuring both Next.js and Remix applications, demonstrating a more diverse project structure and integration capabilities. ```bash # Next.js and Remix npx create-turbo@latest -e kitchen-sink ``` -------------------------------- ### Initialize Turborepo Svelte Starter Source: https://github.com/vercel/turborepo/blob/main/examples/with-svelte/README.md Use this command to create a new Turborepo project pre-configured with the Svelte starter template. ```sh npx create-turbo@latest -e with-svelte ``` -------------------------------- ### Build all Turborepo apps and packages using package managers Source: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md Navigate into your Turborepo directory and execute the `turbo build` command using your preferred package manager's `dlx` or `exec` command. This approach allows building all applications and packages without a global Turborepo installation. ```sh cd my-turborepo npx turbo build ``` ```sh cd my-turborepo yarn dlx turbo build ``` ```sh cd my-turborepo pnpm exec turbo build ``` -------------------------------- ### Develop all applications and packages in Turborepo Source: https://github.com/vercel/turborepo/blob/main/examples/with-solid/README.md Navigate into the `with-solid` directory and execute the `pnpm run dev` command to start the development servers for all applications and packages within the Turborepo monorepo. ```sh cd with-solid pnpm run dev ``` -------------------------------- ### Package.json with External Dependencies Source: https://github.com/vercel/turborepo/blob/main/skills/turborepo/references/best-practices/dependencies.md Example package.json showing external npm registry dependencies with semantic versioning. These are standard third-party packages installed from npm. ```json // packages/ui/package.json { "dependencies": { "react": "^18.0.0", "class-variance-authority": "^0.7.0" } } ``` -------------------------------- ### Root Package.json with Repository-Level Tools Source: https://github.com/vercel/turborepo/blob/main/skills/turborepo/references/best-practices/dependencies.md Example root package.json showing only repository-level development tools like Turborepo, Husky, and lint-staged. Application dependencies should not be installed here. ```json // Root package.json { "devDependencies": { "turbo": "latest", "husky": "^8.0.0", "lint-staged": "^15.0.0" } } ``` -------------------------------- ### Run Next.js Development Server Source: https://github.com/vercel/turborepo/blob/main/examples/with-ultracite/apps/web/README.md Start the development server using npm, yarn, pnpm, or bun. The server runs on http://localhost:3000 and supports hot-reload as you edit files. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### create-turbo-config package.json migration example Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/reference/turbo-codemod.mdx Shows removal of turbo key from package.json after configuration extraction. ```json // After, package.json { "name": "@acme/workspace", "private": true, - "turbo": { - "pipeline": { - ... - } - }, } ``` -------------------------------- ### Initialize Turborepo Gatsby.js Starter Project Source: https://github.com/vercel/turborepo/blob/main/examples/with-gatsby/README.md This command initializes a new Turborepo project using the latest version of `create-turbo` and specifically selects the `with-gatsby` example template. It sets up the project structure with pre-configured Gatsby.js and other components, ready for development. ```sh npx create-turbo@latest -e with-gatsby ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/vercel/turborepo/blob/main/examples/with-otel/apps/web/README.md Run one of these commands to start the Next.js development server locally. The application will be accessible at http://localhost:3000. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` ```bash bun dev ``` -------------------------------- ### Configure ESLint rules with legacy eslintrc format Source: https://github.com/vercel/turborepo/blob/main/packages/eslint-config-turbo/README.md Customize ESLint rules in legacy eslintrc format by adding a rules object to the configuration. This example shows how to configure the turbo/no-undeclared-env-vars rule with an allowList pattern. ```json { "extends": ["turbo"], "rules": { "turbo/no-undeclared-env-vars": [ "error", { "allowList": ["^ENV_[A-Z]+$"] } ] } } ``` -------------------------------- ### Seed database with npm Source: https://github.com/vercel/turborepo/blob/main/examples/with-prisma/README.md Populate the database with initial or fake data using Prisma's seeding functionality. The seed script is located at packages/database/src/seed.ts and can be customized with additional data. ```bash npm run db:seed ``` -------------------------------- ### Complete `microfrontends.json` Configuration Example for Turborepo Source: https://github.com/vercel/turborepo/blob/main/apps/docs/content/docs/guides/microfrontends.mdx This JSON configuration provides a full example of setting up microfrontends within a Turborepo project. It defines a `localProxyPort`, and configures multiple applications (`web`, `docs`, `blog`, `shop`) with their respective `packageName`, `development` ports, and `routing` rules. This setup allows different applications to manage distinct URL paths, enabling a modular e-commerce platform architecture. ```json { "$schema": "https://turborepo.dev/microfrontends/schema.json", "options": { "localProxyPort": 3024 }, "applications": { "web": { "packageName": "web", "development": { "local": { "port": 3000 } } }, "docs": { "packageName": "documentation", "development": { "local": { "port": 3001 } }, "routing": [ { "group": "documentation", "paths": [ "/docs", "/docs/:path*", "/api-reference", "/api-reference/:path*" ] } ] }, "blog": { "development": { "local": { "port": 3002 } }, "routing": [ { "group": "content", "paths": [ "/blog", "/blog/:slug", "/blog/category/:category", "/authors/:author" ] } ] }, "shop": { "development": { "local": { "port": 3003 } }, "routing": [ { "group": "commerce", "paths": [ "/products", "/products/:id", "/cart", "/checkout", "/orders/:orderId" ] } ] } } } ```