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 63e3c2b80873b..d953aeea71397 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 @@ -278,7 +278,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl "devDependencies": { "turbo": "latest" }, - "packageManager": "yarn@1.22.19" + "packageManager": "yarn@1.22.19", + "workspaces": ["apps/*", "packages/*"] } ``` @@ -297,7 +298,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl "devDependencies": { "turbo": "latest" }, - "packageManager": "npm@10.0.0" + "packageManager": "npm@10.0.0", + "workspaces": ["apps/*", "packages/*"] } ``` @@ -316,7 +318,8 @@ The root `package.json` is the base for your workspace. Below is a common exampl "devDependencies": { "turbo": "latest" }, - "packageManager": "bun@1.2.0" + "packageManager": "bun@1.2.0", + "workspaces": ["apps/*", "packages/*"] } ``` 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 4674df7a7760d..2f36e4e051955 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 @@ -43,14 +43,15 @@ familiar with Turborepo. We recommend you install `turbo` both globally and into your repository's root for the best developer experience. - - + + + Ensure you have created a `pnpm-workspace.yaml` file before you begin the installation. Failure to have this file will result in an error that says: ` --workspace-root may only be used inside a workspace`. ```bash title="Terminal" # Global install - npm install turbo --global + pnpm add turbo --global # Install in repository - npm install turbo --save-dev + pnpm add turbo --save-dev --workspace-root ``` @@ -64,18 +65,27 @@ We recommend you install `turbo` both globally and into your repository's root f ``` - - Ensure you have created a `pnpm-workspace.yaml` file before you begin the installation. Failure to have this file will result in an error that says: ` --workspace-root may only be used inside a workspace`. + ```bash title="Terminal" # Global install - pnpm add turbo --global + npm install turbo --global # Install in repository - pnpm add turbo --save-dev --workspace-root + npm install turbo --save-dev ``` - + + + ```bash title="Terminal" + # Global install + bun install turbo --global + # Install in repository + bun install turbo --dev + ``` + + + To learn more about why we recommend both installations, visit the [Installation page](/docs/getting-started/installation). @@ -185,12 +195,50 @@ Add `.turbo` to your `.gitignore` file. The `turbo` CLI uses these folders for p Turborepo optimizes your repository using information from your package manager. To declare which package manager you're using, add a [`packageManager`](https://nodejs.org/api/packages.html#packagemanager) field to your root `package.json` if you don't have one already. + + + + +```diff title="package.json" +{ ++ "packageManager": "pnpm@10.0.0" +} +``` + + + + + +```diff title="package.json" +{ ++ "packageManager": "yarn@1.22.19" +} +``` + + + + + ```diff title="package.json" { + "packageManager": "npm@8.5.0" } ``` + + + + +```diff title="package.json" +{ ++ "packageManager": "bun@1.2.0" +} +``` + + + + + Depending on your repository, you may need to use the [`dangerouslyDisablePackageManagerCheck`](/docs/reference/configuration#dangerouslydisablepackagemanagercheck)