Packages
create-turbo
快速创建新的 Turborepo monorepo 的 CLI 工具
开始使用 Turborepo 最简单的方法是使用 create-turbo。使用这个 CLI 工具可以快速开始构建一个新的 monorepo,一切都为您设置好了。
pnpm dlx create-turbo@latest
yarn dlx create-turbo@latest
npx create-turbo@latest
bunx create-turbo@latest
从示例开始
社区策划了一系列示例来展示如何在 Turborepo 中使用常见工具和库。要使用其中一个示例来引导您的 monorepo,请使用 --example 标志:
pnpm dlx create-turbo@latest --example [example-name]
yarn dlx create-turbo@latest --example [example-name]
npx create-turbo@latest --example [example-name]
bunx create-turbo@latest --example [example-name]
使用下面任何一个示例的名称:
核心维护的示例
以下示例由 Turborepo 核心团队维护。依赖项保持尽可能最新,并且接受和处理这些示例的 GitHub Issues。
请访问 Turborepo 示例仓库 查看所有可用的核心维护示例。
社区维护的示例
社区策划了一系列示例来展示如何在 Turborepo 中使用常见工具和库。要使用其中一个示例来引导您的 monorepo,请使用 --example 标志。
请访问 Turborepo 示例仓库 查看所有可用的社区维护示例。
使用社区示例
您也可以通过使用 GitHub URL 来使用自定义启动器或示例。这对于使用您自己的自定义启动器或来自社区的示例很有用。
pnpm dlx create-turbo@latest --example [github-url]
yarn dlx create-turbo@latest --example [github-url]
npx create-turbo@latest --example [github-url]
bunx create-turbo@latest --example [github-url]
选项
-m, --package-manager 要使用的包管理器 (选择: "npm", "yarn", "pnpm", "bun")
--skip-install: 创建项目后不运行包管理器安装 (默认: false)
--skip-transforms: 创建项目后不运行任何代码转换 (默认: false)
--turbo-version <version>: 使用特定版本的 turbo (默认: latest)
-e, --example [name]|[github-url]: 用于引导应用程序的示例。您可以使用官方 Turborepo 仓库中的示例名称或 GitHub URL。URL 可以使用任何分支和/或子目录
-p, --example-path <path-to-example>: 在极少数情况下,您的 GitHub URL 可能包含带有斜杠的分支名称(例如 bug/fix-1)和示例路径(例如 foo/bar)。在这种情况下,您必须单独指定示例路径:--example-path foo/bar
-v, --version: 输出当前版本
-h, --help: 显示命令帮助