From d211a973bf482731958ee899aece6a6ef9048544 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Mon, 4 Nov 2024 16:00:56 -0700 Subject: [PATCH 1/2] 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. From 1ba19be7bda4c0e3c7977c8aa7e2e8526441599d Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Tue, 5 Nov 2024 15:14:00 -0700 Subject: [PATCH 2/2] WIP --- .../getting-started/add-to-existing-repository.mdx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 725e60452fd28..f240aa936ece0 100644 --- a/docs/repo-docs/getting-started/add-to-existing-repository.mdx +++ b/docs/repo-docs/getting-started/add-to-existing-repository.mdx @@ -189,6 +189,13 @@ Turborepo optimizes your repository using information from your package manager. } ``` + + Depending on your repository, you may need to use the + [dangerouslyDisablePackageManagerCheck](`/repo/docs/reference/configuration#dangerouslydisablepackagemanagercheck`) + while migrating or in situations where you can't use the `packageManager` key + yet. + + ### Run tasks with `turbo` @@ -199,7 +206,7 @@ You can now run the tasks you added to `turbo.json` earlier using Turborepo. Usi turbo build check-types ``` -This runs the `build` and `check-types` tasks at the same time, respecting the dependency graph of your project. +This runs the `build` and `check-types` tasks at the same time. The dependency graph of your [Workspace](/repo/docs/crafting-your-repository/structuring-a-repository#anatomy-of-a-workspace) will be used to run tasks in the right order.