diff --git a/docs/site/content/docs/crafting-your-repository/structuring-a-repository.mdx b/docs/site/content/docs/crafting-your-repository/structuring-a-repository.mdx index d636b19cd3759..63e3c2b80873b 100644 --- a/docs/site/content/docs/crafting-your-repository/structuring-a-repository.mdx +++ b/docs/site/content/docs/crafting-your-repository/structuring-a-repository.mdx @@ -216,7 +216,7 @@ First, your package manager needs to describe the locations of your packages. We } ``` - npm workspace documentation + bun workspace documentation diff --git a/docs/site/content/docs/getting-started/add-to-existing-repository.mdx b/docs/site/content/docs/getting-started/add-to-existing-repository.mdx index 4a1a5b1d3c19e..4674df7a7760d 100644 --- a/docs/site/content/docs/getting-started/add-to-existing-repository.mdx +++ b/docs/site/content/docs/getting-started/add-to-existing-repository.mdx @@ -3,9 +3,10 @@ title: Add to an existing repository description: Using Turborepo with your existing repository --- -import { Tabs, Tab } from '#components/tabs'; +import { PackageManagerTabs, Tabs, Tab } from '#components/tabs'; import { Callout } from '#components/callout'; import { Step, Steps } from '#components/steps'; +import { LinkToDocumentation } from '#components/link-to-documentation'; Turborepo can be incrementally adopted in **any repository, single or multi-package**, to speed up the developer and CI workflows of the repository. @@ -197,6 +198,74 @@ Turborepo optimizes your repository using information from your package manager. yet. + + +### Set up package manager workspaces + +For [multi-package workspaces](https://vercel.com/docs/glossary#multi-package-workspace), you'll need to configure your package manager to recognize your workspace structure. + +The `workspaces` field tells your package manager which directories contain your packages. Common patterns include `apps/*` for applications and `packages/*` for shared libraries. + + + If you're working with a single-package repository, you can skip this step as + workspaces aren't needed. + + + + + + ```json title="pnpm-workspace.yaml" + packages: + - "apps/*" + - "packages/*" + ``` + pnpm workspace documentation + + + + + ```json title="./package.json" + { + "workspaces": [ + "apps/*", + "packages/*" + ] + } + ``` + + yarn workspace documentation + + + + ```json title="./package.json" + { + "workspaces": [ + "apps/*", + "packages/*" + ] + } + ``` + + npm workspace documentation + + + + ```json title="./package.json" + { + "workspaces": [ + "apps/*", + "packages/*" + ] + } + ``` + + bun workspace documentation + + + + +For more details on how to structure your repository, see [Structuring a Repository](/docs/crafting-your-repository/structuring-a-repository#declaring-directories-for-packages). + ### Run tasks with `turbo`