Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): update turbo.json highlighting in docs #3609

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions docs/pages/repo/docs/core-concepts/monorepos/running-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,32 @@ The `build` task inside `shared` completes first, then `web` and `docs` build af

The `pipeline` configuration declares which tasks depend on each other in your monorepo. Here's a kitchen sink example:

```diff
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
+ // A workspace's `build` task depends on that workspace's
+ // topological dependencies' and devDependencies'
+ // `build` tasks being completed first. The `^` symbol
+ // indicates an upstream dependency.
// A workspace's `build` task depends on that workspace's
// topological dependencies' and devDependencies'
// `build` tasks being completed first. The `^` symbol
// indicates an upstream dependency.
"dependsOn": ["^build"]
},
"test": {
+ // A workspace's `test` task depends on that workspace's
+ // own `build` task being completed first.
// A workspace's `test` task depends on that workspace's
// own `build` task being completed first.
"dependsOn": ["build"],
+ // A workspace's `test` task should only be rerun when
+ // either a `.tsx` or `.ts` file has changed.
// A workspace's `test` task should only be rerun when
// either a `.tsx` or `.ts` file has changed.
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"]
},
+ // A workspace's `lint` task has no dependencies and
+ // can be run whenever.
// A workspace's `lint` task has no dependencies and
// can be run whenever.
"lint": {},
"deploy": {
+ // A workspace's `deploy` task depends on the `build`,
+ // `test`, and `lint` tasks of the same workspace
+ // being completed.
// A workspace's `deploy` task depends on the `build`,
// `test`, and `lint` tasks of the same workspace
// being completed.
"dependsOn": ["build", "test", "lint"]
}
}
Expand All @@ -116,7 +116,7 @@ There might be tasks which need to run _before_ other tasks. For instance, `buil

If both tasks are in the same workspace, you can specify the relationship like this:

```json filename="turbo.json"
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
Expand Down Expand Up @@ -155,7 +155,7 @@ The `^` symbol explicitly declares that the task has a dependency on a task in a

An empty dependency list (`dependsOn` is either undefined or `[]`) means that nothing needs to run before this task! After all, it has NO dependencies.

```jsonc
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
Expand All @@ -173,7 +173,7 @@ Sometimes, you may want to create a workspace-task dependency on another workspa
For these cases, you can express these relationships in your `pipeline` configuration using the `<workspace>#<task>` syntax.
The example below describes the `deploy` script of a `frontend` application that depends on the `deploy` and `health-check` scripts of `backend`, as well as the `test` script of a `ui` workspace:

```jsonc
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
Expand Down Expand Up @@ -219,7 +219,7 @@ Conversely, you _do not_ need to define a generic `"my-task": {...}` entry if al

A sample pipeline that defines the root task `format` and opts the root into `test` might look like:

```jsonc
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
Expand Down Expand Up @@ -267,7 +267,7 @@ You've written tests in all three of these workspaces and it's time to run them.

To accomplish this, we can set up a pipeline like so:

```jsonc
```jsonc filename="turbo.json"
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
Expand Down