Skip to content

Commit

Permalink
chore(docs): tweak getting started docs (#6597)
Browse files Browse the repository at this point in the history
- Assume existing project in the Add to Existing Project page
- Re-order Getting Started pages
  • Loading branch information
mehulkar authored Nov 28, 2023
1 parent ce1104f commit 114e8ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/pages/repo/docs/getting-started/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"add-to-project": "Add to Existing Project",
"from-example": "Start from an Example",
"create-new": "Create a New Monorepo",
"add-to-project": "Add to Existing Project",
"existing-monorepo": "Add to Existing Monorepo"
}
42 changes: 15 additions & 27 deletions docs/pages/repo/docs/getting-started/add-to-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,18 @@ import { Tabs, Tab } from '../../../../components/Tabs'

# Add Turborepo to your existing project

Turborepo can be used in **any project** to speed up the execution of scripts in your `package.json`.
Turborepo can be used in any project to speed up the execution of scripts in
your `package.json`.

After you install `turbo`, you'll be able to run all your `package.json` tasks from `turbo` instead of your package manager.
After you install `turbo`, you'll be able to run all your `package.json` tasks
from `turbo` instead of your package manager.

By configuring your `turbo.json` correctly, you'll notice how [caching](/repo/docs/core-concepts/caching) helps your tasks run a lot faster.
By configuring your `turbo.json` correctly, you'll notice how
[caching](/repo/docs/core-concepts/caching) helps your tasks run a lot faster.

## Quickstart

0. **If you don't have one already, create a new application:**

<Tabs items={['Next.js', 'Vite']} storageKey="selected-framework">
<Tab>
```bash
npx create-next-app@latest
```
</Tab>
<Tab>
```bash
npm create vite@latest
```
</Tab>
</Tabs>

1. **Install `turbo` globally:**
1. **Install `turbo` globally**

<Tabs items={['npm', 'yarn', 'pnpm']} storageKey="selected-pkg-manager">
<Tab>
Expand All @@ -47,7 +35,7 @@ npm create vite@latest

For more details about installation, see [Installing Turborepo](../installing)

2. **Add a `turbo.json` file at the base of your new repository:**
2. **Add a `turbo.json` file at the base of your repository:**

For more information on configuring your `turbo.json`, see the [Configuration Options](/repo/docs/reference/configuration) documentation.

Expand All @@ -60,7 +48,7 @@ For more information on configuring your `turbo.json`, see the [Configuration Op
"build": {
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {}
"type-check": {}
}
}
```
Expand All @@ -73,7 +61,7 @@ For more information on configuring your `turbo.json`, see the [Configuration Op
"build": {
"outputs": ["dist/**"]
},
"lint": {}
"type-check": {}
}
}
```
Expand All @@ -88,13 +76,13 @@ Some Vite starters ship with a `package.json` that looks like this:
}
```

We recommend splitting these into a `lint` and `build` script.
We recommend splitting these into a `type-check` and `build` script.

```json filename="package.json"
{
"scripts": {
"build": "vite build",
"lint": "tsc"
"type-check": "tsc"
}
}
```
Expand All @@ -112,18 +100,18 @@ Add `.turbo` to your `.gitignore` file. The CLI uses these folders for logs and
+ .turbo
```

4. **Try running `build` and `lint` with `turbo`:**
4. **Run the `build` and `lint` tasks with `turbo`:**

```bash
turbo build lint
turbo type-check build
```

This runs `build` and `lint` at the same time.

5. **Without making any changes to the code, try running `build` and `lint` again:**

```bash
turbo build lint
turbo type-check build
```

You should see terminal output like this:
Expand Down

1 comment on commit 114e8ed

@vercel
Copy link

@vercel vercel bot commented on 114e8ed Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.