create-turbo 命令行
使用 Turborepo 最简单的方法是使用 create-turbo。使用这个 CLI 工具可以快速开始构建新的单体仓库,一切都为你设置好了。
从示例开始
社区精心策划了一系列示例,展示了使用 Turborepo 与常见工具和库的方法。要使用其中一个示例引导你的单体仓库,请使用 --example 标志:
使用以下任何示例名称:
核心团队维护的示例
以下示例由 Turborepo 核心团队维护。依赖项保持尽可能最新,并接受和处理针对这些示例的 GitHub 问题。
| Name | Description |
|---|---|
| Basic | Basic monorepo example with two Next.js applications |
| Kitchen sink | Multiple frameworks, both frontend and backend |
| Non-monorepo | A standalone application using Turborepo |
| Shell commands | A nearly empty Turborepo - useful for creating reproductions for GitHub Issues |
| SvelteKit | Monorepo with multiple SvelteKit apps sharing a UI Library |
| TailwindCSS | Monorepo with multiple Next.js apps sharing a UI library built with TailwindCSS |
社区维护的示例
社区精心策划了一系列示例,展示了使用 Turborepo 与常见工具和库的方法。要使用其中一个示例引导你的单体仓库,请使用 --example 标志:
| Name | Description |
|---|---|
| Design System | Unify your site's look and feel by sharing a design system across multiple apps |
| Angular | Minimal Turborepo example for learning the fundamentals |
| Yarn Berry | Monorepo example using Yarn Berry (Yarn 3) |
| Changesets | Configured to publish packages via Changesets |
| Docker | Monorepo with an Express API and a Next.js App deployed with Docker utilizing turbo prune |
| Gatsby | Monorepo with a Gatsby.js and a Next.js app both sharing a UI Library |
| Nest.js | Monorepo with Nest.js |
| npm workspaces | Monorepo example using NPM workspaces |
| Prisma | Monorepo with a Next.js App fully configured with Prisma |
| React Native | Simple React Native & Next.js monorepo with a shared UI library |
| Rollup | Monorepo with a single Next.js app sharing a UI library bundled with Rollup |
| Solid.js | Monorepo example with SolidJS applications |
| typeorm | Monorepo with a Next.js App fully configured with typeorm |
| Vite | Monorepo with multiple Vanilla JS apps bundled with Vite, sharing a UI Library |
| Vite + React | Monorepo example with Vite and React |
| Vitest | Monorepo example with Vitest for testing |
| Vue/Nuxt | Monorepo with Vue and Nuxt, sharing a UI Library |
| Yarn | Monorepo example using Yarn workspaces |
使用社区示例
你也可以通过使用 GitHub URL 来使用自定义入门项目或示例。这对于使用你自己的自定义入门项目或来自社区的示例很有用。