Turborepo 启动器

由Turborepo核心团队维护的Monorepo开发工具,支持TypeScript、ESLint和Prettier的集成开发环境。

  • by vibesaraf
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 vibesaraf/expense-mcp

使用说明

Turborepo启动器

这个Turborepo启动器由Turbo回购核心团队维护。

使用此示例

运行以下命令:

npx create-turbo@latest

里面是什么?

此Turborepo包括以下软件包/应用程序:

应用程序和软件包

  • docs一 Next.js 应用
  • web:另一个 Next.js 应用
  • @expense/ui:两者共享的存根React组件库 web 和 docs 应用
  • @expense/eslint-config: eslint 配置(包括 eslint-config-next 和 eslint-config-prettier)
  • @expense/typescript-config: tsconfig.jsons在整个monorepo中使用

每个软件包/应用程序都是100% TypeScript.

公用事业

此Turborepo已经为您设置了一些附加工具:

构建

要构建所有应用程序和软件包,请运行以下命令:

cd my-turborepo

# With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended)
turbo build

# Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager
npx turbo build
yarn dlx turbo build
pnpm exec turbo build

您可以使用 过滤器:

# With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended)
turbo build --filter=docs

# Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager
npx turbo build --filter=docs
yarn exec turbo build --filter=docs
pnpm exec turbo build --filter=docs

开发

要开发所有应用程序和软件包,请运行以下命令:

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

您可以使用 过滤器:

# With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended)
turbo dev --filter=web

# Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager
npx turbo dev --filter=web
yarn exec turbo dev --filter=web
pnpm exec turbo dev --filter=web

远程缓存

[!提示] Vercel Remote Cache对所有计划都是免费的。从今天开始 vercel.com.

Turborepo可以使用一种称为 远程缓存 跨机器共享缓存工件,使您能够与团队和CI/CD管道共享构建缓存。

默认情况下,Turborepo将在本地缓存。要启用远程缓存,您需要一个Vercel帐户。如果你没有账户,你可以 创建一个,然后输入以下命令:

cd my-turborepo

# With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended)
turbo login

# Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager
npx turbo login
yarn exec turbo login
pnpm exec turbo login

这将使用您的身份验证Turborepo CLI Vercel帐户.

接下来,您可以从Turborepo的根目录运行以下命令,将Turborepos链接到远程缓存:

# With [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation) installed (recommended)
turbo link

# Without [global `turbo`](https://turborepo.dev/docs/getting-started/installation#global-installation), use your package manager
npx turbo link
yarn exec turbo link
pnpm exec turbo link

实用链接

深入了解Turborepo的强大功能: