From d211a973bf482731958ee899aece6a6ef9048544 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Mon, 4 Nov 2024 16:00:56 -0700 Subject: [PATCH] docs: Updates for accuracy in Add to Existing Repository page. --- .../add-to-existing-repository.mdx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/repo-docs/getting-started/add-to-existing-repository.mdx b/docs/repo-docs/getting-started/add-to-existing-repository.mdx index a561e9c5c9879..725e60452fd28 100644 --- a/docs/repo-docs/getting-started/add-to-existing-repository.mdx +++ b/docs/repo-docs/getting-started/add-to-existing-repository.mdx @@ -179,13 +179,27 @@ Add `.turbo` to your `.gitignore` file. The `turbo` CLI uses these folders for p -### Run the `build` and `check-types` tasks with `turbo` +### Add a `packageManager` field to root `package.json` + +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": "npm@8.5.0" +} +``` + + + +### Run tasks with `turbo` + +You can now run the tasks you added to `turbo.json` earlier using Turborepo. Using the example tasks from above: ```bash title="Terminal" turbo build check-types ``` -This runs `build` and `check-types` at the same time. +This runs the `build` and `check-types` tasks at the same time, respecting the dependency graph of your project.