turbo 2.11.5 → 2.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/crafting-your-repository/constructing-ci.mdx +23 -1
- package/docs/getting-started/add-to-existing-repository.mdx +25 -20
- package/docs/getting-started/index.mdx +1 -24
- package/docs/getting-started/installation.mdx +22 -53
- package/docs/guides/migrating-from-nx.mdx +11 -47
- package/docs/guides/tools/docker.mdx +23 -3
- package/docs/reference/bin.mdx +1 -1
- package/docs/reference/configuration.mdx +37 -2
- package/docs/reference/package-configurations.mdx +4 -2
- package/docs/reference/query.mdx +47 -0
- package/docs/reference/run.mdx +42 -0
- package/docs/reference/system-environment-variables.mdx +37 -0
- package/package.json +7 -7
- package/schema.json +8 -1
|
@@ -181,7 +181,29 @@ Using global `turbo` is convenient in CI workflows, allowing you to easily run c
|
|
|
181
181
|
|
|
182
182
|
However, in some cases, you may be running `turbo` commands or scripts that use `turbo` **before installing packages with your package manager**. One example of this is [using `turbo prune` to create a Docker image](/docs/guides/tools/docker#example). In this situation, global `turbo` will not be able to use the version from `package.json` because the binary for that version hasn't been installed yet.
|
|
183
183
|
|
|
184
|
-
For
|
|
184
|
+
For CI steps before dependencies are installed, pin the standalone binary to an exact version compatible with your repository's `turbo` dependency. Set `TURBO_VERSION` when running the [installer](/docs/getting-started/installation#global-installation):
|
|
185
|
+
|
|
186
|
+
<Tabs items={["macOS and Linux", "Windows x64"]}>
|
|
187
|
+
<Tab value="macOS and Linux">
|
|
188
|
+
|
|
189
|
+
```sh title="Terminal"
|
|
190
|
+
curl -fsSL https://turborepo.dev/install | TURBO_VERSION=2.11.5 sh
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
</Tab>
|
|
194
|
+
<Tab value="Windows x64">
|
|
195
|
+
|
|
196
|
+
```powershell title="PowerShell"
|
|
197
|
+
$env:TURBO_VERSION = '2.11.5'
|
|
198
|
+
irm https://turborepo.dev/install.ps1 | iex
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
</Tab>
|
|
202
|
+
</Tabs>
|
|
203
|
+
|
|
204
|
+
<Callout type="info">
|
|
205
|
+
Standalone releases start at 2.11.5. To use an older version, install it with your package manager instead.
|
|
206
|
+
</Callout>
|
|
185
207
|
|
|
186
208
|
### Use `turbo run` in CI
|
|
187
209
|
|
|
@@ -46,16 +46,36 @@ familiar with Turborepo.
|
|
|
46
46
|
<Step>
|
|
47
47
|
### Install `turbo`
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Install `turbo` globally.
|
|
50
|
+
|
|
51
|
+
<Tabs items={["macOS and Linux", "Windows x64"]}>
|
|
52
|
+
<Tab value="macOS and Linux">
|
|
53
|
+
|
|
54
|
+
```sh title="Terminal"
|
|
55
|
+
curl -fsSL https://turborepo.dev/install | sh
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
</Tab>
|
|
59
|
+
<Tab value="Windows x64">
|
|
60
|
+
|
|
61
|
+
```powershell title="PowerShell"
|
|
62
|
+
irm https://turborepo.dev/install.ps1 | iex
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
</Tab>
|
|
66
|
+
</Tabs>
|
|
67
|
+
|
|
68
|
+
<Callout type="info">
|
|
69
|
+
The binaries are also available in the [GitHub release assets](https://github.com/vercel/turborepo/releases).
|
|
70
|
+
</Callout>
|
|
71
|
+
|
|
72
|
+
Then pin `turbo` in your repository's root:
|
|
50
73
|
|
|
51
74
|
<PackageManagerTabs>
|
|
52
75
|
<Tab value="pnpm">
|
|
53
76
|
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`.
|
|
54
77
|
|
|
55
78
|
```bash title="Terminal"
|
|
56
|
-
# Global install
|
|
57
|
-
pnpm add turbo --global
|
|
58
|
-
# Install in repository
|
|
59
79
|
pnpm add turbo --save-dev --workspace-root
|
|
60
80
|
```
|
|
61
81
|
|
|
@@ -63,9 +83,6 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
63
83
|
<Tab value="yarn">
|
|
64
84
|
|
|
65
85
|
```bash title="Terminal"
|
|
66
|
-
# Global install
|
|
67
|
-
yarn global add turbo
|
|
68
|
-
# Install in repository
|
|
69
86
|
yarn add turbo --dev
|
|
70
87
|
```
|
|
71
88
|
|
|
@@ -73,9 +90,6 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
73
90
|
<Tab value="npm">
|
|
74
91
|
|
|
75
92
|
```bash title="Terminal"
|
|
76
|
-
# Global install
|
|
77
|
-
npm install turbo --global
|
|
78
|
-
# Install in repository
|
|
79
93
|
npm install turbo --save-dev
|
|
80
94
|
```
|
|
81
95
|
|
|
@@ -83,9 +97,6 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
83
97
|
<Tab value="bun">
|
|
84
98
|
|
|
85
99
|
```bash title="Terminal"
|
|
86
|
-
# Global install
|
|
87
|
-
bun install turbo --global
|
|
88
|
-
# Install in repository
|
|
89
100
|
bun install turbo --dev
|
|
90
101
|
```
|
|
91
102
|
|
|
@@ -94,9 +105,6 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
94
105
|
<Tab value="nub">
|
|
95
106
|
|
|
96
107
|
```bash title="Terminal"
|
|
97
|
-
# Global install
|
|
98
|
-
nub add turbo --global
|
|
99
|
-
# Install in repository
|
|
100
108
|
nub add turbo --save-dev
|
|
101
109
|
```
|
|
102
110
|
|
|
@@ -105,9 +113,6 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
105
113
|
<Tab value="aube">
|
|
106
114
|
|
|
107
115
|
```bash title="Terminal"
|
|
108
|
-
# Global install
|
|
109
|
-
aube add turbo --global
|
|
110
|
-
# Install in repository
|
|
111
116
|
aube add turbo --save-dev
|
|
112
117
|
```
|
|
113
118
|
|
|
@@ -115,7 +120,7 @@ We recommend you install `turbo` both globally and into your repository's root f
|
|
|
115
120
|
|
|
116
121
|
</PackageManagerTabs>
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
The installed local version takes precedence when you run the global binary in your repository. See [Installation](/docs/getting-started/installation#repository-installation) for details.
|
|
119
124
|
|
|
120
125
|
</Step>
|
|
121
126
|
<Step>
|
|
@@ -16,30 +16,7 @@ If you're new to Turborepo, you can follow these steps to get started.
|
|
|
16
16
|
<Step>
|
|
17
17
|
## Install Turborepo
|
|
18
18
|
|
|
19
|
-
Install `turbo`
|
|
20
|
-
|
|
21
|
-
<Tabs items={["npm", "yarn", "pnpm"]} storageKey="selected-pkg-manager">
|
|
22
|
-
<Tab value="npm">
|
|
23
|
-
```bash title="Terminal"
|
|
24
|
-
npm install turbo --global
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
</Tab>
|
|
28
|
-
<Tab value="yarn">
|
|
29
|
-
```bash title="Terminal"
|
|
30
|
-
yarn global add turbo
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</Tab>
|
|
34
|
-
<Tab value="pnpm">
|
|
35
|
-
```bash title="Terminal"
|
|
36
|
-
pnpm add turbo --global
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
</Tab>
|
|
40
|
-
</Tabs>
|
|
41
|
-
|
|
42
|
-
To learn more about installing `turbo`, see the [installation guide](/docs/getting-started/installation).
|
|
19
|
+
Install the standalone `turbo` binary to run commands from your terminal. See the [installation guide](/docs/getting-started/installation#global-installation) for supported platforms and instructions.
|
|
43
20
|
|
|
44
21
|
</Step>
|
|
45
22
|
<Step>
|
|
@@ -3,7 +3,7 @@ title: Installation
|
|
|
3
3
|
description: Learn how to get started with Turborepo.
|
|
4
4
|
product: turborepo
|
|
5
5
|
type: guide
|
|
6
|
-
summary: Install Turborepo globally and in your repository
|
|
6
|
+
summary: Install Turborepo globally and in your repository.
|
|
7
7
|
prerequisites:
|
|
8
8
|
- /docs/getting-started
|
|
9
9
|
related:
|
|
@@ -69,60 +69,38 @@ For more details on the starter, [visit the README for the basic starter on GitH
|
|
|
69
69
|
|
|
70
70
|
## Installing `turbo`
|
|
71
71
|
|
|
72
|
-
`turbo`
|
|
72
|
+
You can install `turbo` globally and pin a version in your repository. When a local binary is installed, the global binary defers to it.
|
|
73
73
|
|
|
74
74
|
### Global installation
|
|
75
75
|
|
|
76
76
|
A global install of `turbo` brings flexibility and speed to your local workflows.
|
|
77
77
|
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
<Tab value="pnpm">
|
|
81
|
-
```bash title="Terminal"
|
|
82
|
-
pnpm add turbo --global
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
</Tab>
|
|
86
|
-
|
|
87
|
-
<Tab value="yarn">
|
|
88
|
-
```bash title="Terminal"
|
|
89
|
-
yarn global add turbo
|
|
90
|
-
```
|
|
78
|
+
<Tabs items={["macOS and Linux", "Windows x64"]}>
|
|
79
|
+
<Tab value="macOS and Linux">
|
|
91
80
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
```bash title="Terminal"
|
|
96
|
-
npm install turbo --global
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
</Tab>
|
|
100
|
-
|
|
101
|
-
<Tab value="bun">
|
|
102
|
-
```bash title="Terminal"
|
|
103
|
-
bun install turbo --global
|
|
104
|
-
```
|
|
81
|
+
```sh title="Terminal"
|
|
82
|
+
curl -fsSL https://turborepo.dev/install | sh
|
|
83
|
+
```
|
|
105
84
|
|
|
106
85
|
</Tab>
|
|
86
|
+
<Tab value="Windows x64">
|
|
107
87
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
nub add turbo --global
|
|
112
|
-
```
|
|
88
|
+
```powershell title="PowerShell"
|
|
89
|
+
irm https://turborepo.dev/install.ps1 | iex
|
|
90
|
+
```
|
|
113
91
|
|
|
114
92
|
</Tab>
|
|
93
|
+
</Tabs>
|
|
115
94
|
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
</Tab>
|
|
95
|
+
<Callout type="info">
|
|
96
|
+
See the [support policy](/docs/support-policy#platforms) for supported platforms.
|
|
97
|
+
</Callout>
|
|
122
98
|
|
|
123
|
-
|
|
99
|
+
<Callout type="info">
|
|
100
|
+
The binaries are also available directly in the [GitHub release assets](https://github.com/vercel/turborepo/releases), starting with 2.11.5. To install an older version, use your package manager.
|
|
101
|
+
</Callout>
|
|
124
102
|
|
|
125
|
-
|
|
103
|
+
After installing `turbo`, you can run commands from your terminal. For example:
|
|
126
104
|
|
|
127
105
|
- `turbo build`: Run `build` scripts following your repository's dependency graph
|
|
128
106
|
- `turbo build --filter=docs --dry`: Quickly print an outline of the `build` task for your `docs` package (without running it)
|
|
@@ -134,20 +112,13 @@ Once installed globally, you can run your scripts through `turbo` from your term
|
|
|
134
112
|
`turbo build` and `turbo run build` will both run your `build` task.
|
|
135
113
|
</Callout>
|
|
136
114
|
|
|
137
|
-
<Callout type="error" title="Avoid multiple global installations">
|
|
138
|
-
If you've installed global `turbo` before, make sure you use the same package
|
|
139
|
-
manager as your existing installation to avoid unexpected behaviors. You can
|
|
140
|
-
quickly check which package manager you previously used with [`turbo
|
|
141
|
-
bin`](/docs/reference/bin).
|
|
142
|
-
</Callout>
|
|
143
|
-
|
|
144
115
|
#### Using global `turbo` in CI
|
|
145
116
|
|
|
146
|
-
|
|
117
|
+
To use the global binary in CI, see [Constructing CI](/docs/crafting-your-repository/constructing-ci#global-turbo-in-ci).
|
|
147
118
|
|
|
148
119
|
### Repository installation
|
|
149
120
|
|
|
150
|
-
|
|
121
|
+
To pin the `turbo` version used in a repository, add it as a `devDependency` at the root:
|
|
151
122
|
|
|
152
123
|
<PackageManagerTabs>
|
|
153
124
|
|
|
@@ -196,6 +167,4 @@ When collaborating with other developers in a repository, it's a good idea to pi
|
|
|
196
167
|
|
|
197
168
|
</PackageManagerTabs>
|
|
198
169
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
This lets you to get the best of both installations: easily run commands in your terminal while maintaining a pinned version for consistent usage for all developers in the repository.
|
|
170
|
+
When you invoke the global binary from this repository, it uses the installed local version instead.
|
|
@@ -471,60 +471,24 @@ aube add turbo --save-dev
|
|
|
471
471
|
|
|
472
472
|
</PackageManagerTabs>
|
|
473
473
|
|
|
474
|
-
|
|
474
|
+
To run `turbo` directly from your terminal, install the global binary:
|
|
475
475
|
|
|
476
|
-
<
|
|
477
|
-
|
|
478
|
-
<Tab value="pnpm">
|
|
476
|
+
<Tabs items={["macOS and Linux", "Windows x64"]}>
|
|
477
|
+
<Tab value="macOS and Linux">
|
|
479
478
|
|
|
480
|
-
```
|
|
481
|
-
|
|
479
|
+
```sh title="Terminal"
|
|
480
|
+
curl -fsSL https://turborepo.dev/install | sh
|
|
482
481
|
```
|
|
483
482
|
|
|
484
|
-
</Tab>
|
|
483
|
+
</Tab>
|
|
484
|
+
<Tab value="Windows x64">
|
|
485
485
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
```bash title="Terminal"
|
|
489
|
-
yarn global add turbo
|
|
486
|
+
```powershell title="PowerShell"
|
|
487
|
+
irm https://turborepo.dev/install.ps1 | iex
|
|
490
488
|
```
|
|
491
489
|
|
|
492
|
-
</Tab>
|
|
493
|
-
|
|
494
|
-
<Tab value="npm">
|
|
495
|
-
|
|
496
|
-
```bash title="Terminal"
|
|
497
|
-
npm install turbo --global
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
</Tab>
|
|
501
|
-
|
|
502
|
-
<Tab value="bun">
|
|
503
|
-
|
|
504
|
-
```bash title="Terminal"
|
|
505
|
-
bun install turbo --global
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
</Tab>
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
<Tab value="nub">
|
|
512
|
-
|
|
513
|
-
```bash title="Terminal"
|
|
514
|
-
nub add turbo --global
|
|
515
|
-
```
|
|
516
|
-
|
|
517
|
-
</Tab>
|
|
518
|
-
|
|
519
|
-
<Tab value="aube">
|
|
520
|
-
|
|
521
|
-
```bash title="Terminal"
|
|
522
|
-
aube add turbo --global
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
</Tab>
|
|
526
|
-
|
|
527
|
-
</PackageManagerTabs>
|
|
490
|
+
</Tab>
|
|
491
|
+
</Tabs>
|
|
528
492
|
|
|
529
493
|
### Step 8: Add a `turbo.json`
|
|
530
494
|
|
|
@@ -144,6 +144,8 @@ docker build -f apps/web/Dockerfile .
|
|
|
144
144
|
mode](https://nextjs.org/docs/pages/api-reference/next-config-js/output).
|
|
145
145
|
</Callout>
|
|
146
146
|
|
|
147
|
+
Standalone release archives start at 2.11.5. To use an older `turbo` version, install it with your package manager in the `prepare` stage instead of downloading an archive (for example, `RUN yarn global add turbo@2.11.4`).
|
|
148
|
+
|
|
147
149
|
```docker title="./apps/web/Dockerfile"
|
|
148
150
|
FROM node:18-alpine AS base
|
|
149
151
|
RUN apk update
|
|
@@ -153,9 +155,27 @@ WORKDIR /app
|
|
|
153
155
|
|
|
154
156
|
# ---
|
|
155
157
|
FROM base AS prepare
|
|
156
|
-
|
|
157
|
-
#
|
|
158
|
-
|
|
158
|
+
RUN apk add --no-cache curl
|
|
159
|
+
# Pin a release compatible with the turbo version in your repository.
|
|
160
|
+
ARG TURBO_VERSION=2.11.5
|
|
161
|
+
RUN set -eu; \
|
|
162
|
+
case "$(uname -m)" in \
|
|
163
|
+
x86_64) target=x86_64-unknown-linux-musl ;; \
|
|
164
|
+
aarch64) target=aarch64-unknown-linux-musl ;; \
|
|
165
|
+
*) echo 'Unsupported architecture' >&2; exit 1 ;; \
|
|
166
|
+
esac; \
|
|
167
|
+
archive="turbo-$TURBO_VERSION-$target.tar.gz"; \
|
|
168
|
+
release="https://github.com/vercel/turborepo/releases/download/v$TURBO_VERSION"; \
|
|
169
|
+
cd /tmp; \
|
|
170
|
+
curl -fsSL "$release/SHA256SUMS" -o SHA256SUMS; \
|
|
171
|
+
curl -fsSL "$release/$archive" -o "$archive"; \
|
|
172
|
+
awk -v name="$archive" '$2 == name && NF == 2 { print }' SHA256SUMS > turbo-checksum; \
|
|
173
|
+
[ "$(wc -l < turbo-checksum)" -eq 1 ]; \
|
|
174
|
+
sha256sum -c turbo-checksum; \
|
|
175
|
+
[ "$(tar -tzf "$archive")" = turbo ]; \
|
|
176
|
+
tar -xzf "$archive" -C /usr/local/bin turbo; \
|
|
177
|
+
chmod 755 /usr/local/bin/turbo; \
|
|
178
|
+
rm SHA256SUMS turbo-checksum "$archive"
|
|
159
179
|
COPY . .
|
|
160
180
|
# Add lockfile and package.json's of isolated subworkspace
|
|
161
181
|
# Generate a partial monorepo with a pruned lockfile for a target workspace.
|
package/docs/reference/bin.mdx
CHANGED
|
@@ -12,6 +12,6 @@ Get the path to the `turbo` binary.
|
|
|
12
12
|
turbo bin
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
When using [**global `turbo`**](/docs/getting-started/installation#global-installation), this will be the path to the global
|
|
15
|
+
When using [**global `turbo`**](/docs/getting-started/installation#global-installation), this will be the path to the global binary, such as `~/.local/bin/turbo` on macOS/Linux or `%LOCALAPPDATA%\Programs\Turborepo\bin\turbo.exe` on Windows.
|
|
16
16
|
|
|
17
17
|
When using [**local `turbo`**](/docs/getting-started/installation#repository-installation), this will be the path to the local `turbo` binary. When `turbo` is installed in your repository, it is likely to be a path to `node_modules`.
|
|
@@ -582,9 +582,9 @@ When enabled, Turborepo will honor the `experimentalObservability.otel` configur
|
|
|
582
582
|
}
|
|
583
583
|
```
|
|
584
584
|
|
|
585
|
-
Adds
|
|
585
|
+
Adds arbitrary string labels to a package. Labels do not need to be registered in `boundaries.tags`. Package tags can still be used with [Boundaries](/docs/reference/boundaries); existing boundary rules are unchanged.
|
|
586
586
|
|
|
587
|
-
|
|
587
|
+
Top-level tags label the package containing the configuration. Root `turbo.json` tags label the root package, not every package in the repository. Package tags are separate from task tags and are not inherited through task configuration.
|
|
588
588
|
|
|
589
589
|
### `global`
|
|
590
590
|
|
|
@@ -665,6 +665,40 @@ In the example below, we've defined three tasks under the `tasks` key: `build`,
|
|
|
665
665
|
|
|
666
666
|
Using the options available in the tasks you define in `tasks`, you can describe how `turbo` will run your tasks.
|
|
667
667
|
|
|
668
|
+
### Task tags
|
|
669
|
+
|
|
670
|
+
Add `tags` to a task definition in the root `turbo.json` or a [Package Configuration](/docs/reference/package-configurations):
|
|
671
|
+
|
|
672
|
+
```jsonc title="./turbo.json"
|
|
673
|
+
{
|
|
674
|
+
"tasks": {
|
|
675
|
+
"test": {
|
|
676
|
+
"tags": ["ci", "slow"],
|
|
677
|
+
},
|
|
678
|
+
},
|
|
679
|
+
}
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
Task tags are arbitrary string labels. Their configured order and duplicates are preserved. They do not change task dependencies, commands, or boundary rules.
|
|
683
|
+
|
|
684
|
+
If a Package Configuration omits task `tags`, it inherits them. An explicit array replaces inherited task tags, and `"tags": []` clears them. To append labels instead of replacing them, use [`$TURBO_EXTENDS$`](#turbo_extends), just like other task array fields:
|
|
685
|
+
|
|
686
|
+
```jsonc title="./apps/web/turbo.json"
|
|
687
|
+
{
|
|
688
|
+
"extends": ["//"],
|
|
689
|
+
"tasks": {
|
|
690
|
+
"test": {
|
|
691
|
+
// Inherits "ci" and "slow", then adds "frontend"
|
|
692
|
+
"tags": ["$TURBO_EXTENDS$", "frontend"],
|
|
693
|
+
},
|
|
694
|
+
},
|
|
695
|
+
}
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
The marker is removed from resolved task tags, yielding `["ci", "slow", "frontend"]`. The same inheritance and composition rules apply when extending task configuration from other packages. A task with `"extends": false` starts with fresh configuration rather than inherited tags. Clearing task tags does not remove package tags.
|
|
699
|
+
|
|
700
|
+
Tags are not included in the resolved task hash data. However, changing tags in a package's `turbo.json` can still invalidate its cache when that file is included in the task's file inputs.
|
|
701
|
+
|
|
668
702
|
### `extends` (task-level)
|
|
669
703
|
|
|
670
704
|
Controls whether a task inherits configuration from the extends chain. This option is only available in [Package Configurations](/docs/reference/package-configurations), not in the root `turbo.json`.
|
|
@@ -1022,6 +1056,7 @@ This microsyntax can be used in the following array fields:
|
|
|
1022
1056
|
- `inputs`
|
|
1023
1057
|
- `outputs`
|
|
1024
1058
|
- `passThroughEnv`
|
|
1059
|
+
- Task `tags`
|
|
1025
1060
|
- `with`
|
|
1026
1061
|
|
|
1027
1062
|
For example, if your root `turbo.json` defines:
|
|
@@ -53,7 +53,9 @@ For example, if your root `turbo.json` sets `"outputLogs": "hash-only"` for a ta
|
|
|
53
53
|
|
|
54
54
|
### Array fields replace by default
|
|
55
55
|
|
|
56
|
-
Array fields like `outputs`, `env`, `inputs`, `dependsOn`, and `
|
|
56
|
+
Array fields like `outputs`, `env`, `inputs`, `dependsOn`, `passThroughEnv`, and task `tags` **completely replace** the root configuration's values by default.
|
|
57
|
+
|
|
58
|
+
For task `tags`, omission inherits the labels, an explicit array replaces them, and `[]` clears them. Use `"tags": ["$TURBO_EXTENDS$", "frontend"]` to append to inherited labels instead. Top-level package tags remain separate: they label the current package rather than being inherited as task configuration.
|
|
57
59
|
|
|
58
60
|
```jsonc title="./turbo.json"
|
|
59
61
|
{
|
|
@@ -94,7 +96,7 @@ To **add** to inherited array values instead of replacing them, use the [`$TURBO
|
|
|
94
96
|
}
|
|
95
97
|
```
|
|
96
98
|
|
|
97
|
-
The `$TURBO_EXTENDS$` marker must be the first element in the array. It works with `outputs`, `env`, `inputs`, `dependsOn`, `passThroughEnv`, and `with`.
|
|
99
|
+
The `$TURBO_EXTENDS$` marker must be the first element in the array. It works with `outputs`, `env`, `inputs`, `dependsOn`, `passThroughEnv`, task `tags`, and `with`.
|
|
98
100
|
|
|
99
101
|
### Extending from other packages
|
|
100
102
|
|
package/docs/reference/query.mdx
CHANGED
|
@@ -114,6 +114,53 @@ expanded names, framework-inferred variables, or a complete process environment.
|
|
|
114
114
|
The query does not execute tasks or report cache hits. Unlike dry-run summaries,
|
|
115
115
|
this selection does not include file-hash inventories.
|
|
116
116
|
|
|
117
|
+
## Package task catalogue
|
|
118
|
+
|
|
119
|
+
`package.tasks` lists the package's native scripts and resolved Task Graph entries,
|
|
120
|
+
including configured tasks without a script and tasks with an explicit command.
|
|
121
|
+
Scriptless tasks can be entrypoints that depend on runnable tasks. Their `script`
|
|
122
|
+
is `null`, and their `command` is `null` unless a command is configured. Inherited
|
|
123
|
+
and shared configurations are resolved before listing tasks; scriptless tasks
|
|
124
|
+
excluded by `extends: false` are not included. Task names are deduplicated and sorted.
|
|
125
|
+
Task filters apply to this full catalogue, not only tasks with native scripts.
|
|
126
|
+
|
|
127
|
+
## Tags
|
|
128
|
+
|
|
129
|
+
Packages and tasks expose a `tags` array, returning `[]` when no labels are configured. Package tags come from the package's loaded `turbo.json` and do not include task labels or inherit root package labels.
|
|
130
|
+
|
|
131
|
+
A task's `tags` contains its resolved task labels only, after configuration inheritance and `$TURBO_EXTENDS$` composition. Order and duplicate labels are preserved, and the inheritance marker is not exposed. Select `package { tags }` to read its package labels separately.
|
|
132
|
+
|
|
133
|
+
Use `has: { field: TAG, value: "label" }` to filter by exact, case-sensitive membership. Package predicates match package labels only. Task predicates match either resolved task labels or package labels.
|
|
134
|
+
|
|
135
|
+
```bash title="Terminal"
|
|
136
|
+
turbo query '
|
|
137
|
+
query {
|
|
138
|
+
packages(filter: {has: {field: TAG, value: "frontend"}}) {
|
|
139
|
+
items { name tags }
|
|
140
|
+
}
|
|
141
|
+
package(name: "web") {
|
|
142
|
+
tasks(filter: {has: {field: TAG, value: "ci"}}) {
|
|
143
|
+
items { fullName tags package { tags } }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
'
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Task predicates support `and`, `or`, and `not`, as well as `equal` and `notEqual` on `NAME`, `FULL_NAME`, and `EXPERIMENTAL_CI`. `EXPERIMENTAL_CI` compares the resolved `experimentalCI` metadata as JSON: a boolean, an object, or `null` when unset. Objects use structural equality, not partial matching. An omitted predicate `value` is equivalent to explicit `null`. `NAME` and `FULL_NAME` equality still only matches strings, and `TAG` membership still only matches string labels. To select configured values other than `false`, combine `notEqual: {field: EXPERIMENTAL_CI, value: null}` and `notEqual: {field: EXPERIMENTAL_CI, value: false}` with `and`. This comparison does not interpret metadata contents or assign meaning to tags. The optional task `filter` is available on package task lists, task dependency/dependent lists, and `withDependencies`.
|
|
151
|
+
|
|
152
|
+
For affected tasks, pass `taskFilter` alongside the existing package `filter` or task-name `tasks` arguments:
|
|
153
|
+
|
|
154
|
+
```graphql title="ci-plan.gql"
|
|
155
|
+
query {
|
|
156
|
+
affectedTasks(base: "origin/main", head: "HEAD", taskFilter: {has: {field: TAG, value: "ci"}}) {
|
|
157
|
+
items { fullName tags package { tags } }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Affected-task filters intersect before required prerequisites are added, so prerequisites may not carry the selected tag. Filters on dependency/dependent lists and `withDependencies` apply after traversal; they narrow the returned list without pruning traversal through non-matching tasks.
|
|
163
|
+
|
|
117
164
|
## Shorthands
|
|
118
165
|
|
|
119
166
|
Shorthands generate GraphQL queries for common operations so you don't need to write them by hand. The JSON output is identical to what you'd get from a raw query.
|
package/docs/reference/run.mdx
CHANGED
|
@@ -117,6 +117,16 @@ turbo run build --cache=local:rw
|
|
|
117
117
|
turbo run build --cache=local:,remote:r
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
+
### `--cache-workers <number>`
|
|
121
|
+
|
|
122
|
+
Default: `10`
|
|
123
|
+
|
|
124
|
+
Set the number of concurrent cache operations.
|
|
125
|
+
|
|
126
|
+
```bash title="Terminal"
|
|
127
|
+
turbo run build --cache-workers=4
|
|
128
|
+
```
|
|
129
|
+
|
|
120
130
|
### `--cache-dir <path>`
|
|
121
131
|
|
|
122
132
|
Default: `.turbo/cache`
|
|
@@ -279,6 +289,30 @@ Filters can be combined to create combinations of packages, directories, and git
|
|
|
279
289
|
|
|
280
290
|
For in-depth discussion and practical use cases of filtering, visit [the Running Tasks page](/docs/crafting-your-repository/running-tasks).
|
|
281
291
|
|
|
292
|
+
#### Filtering by tag
|
|
293
|
+
|
|
294
|
+
Use `tag:<label>` to select tasks with a matching [task or package tag](/docs/reference/configuration#task-tags). A package tag matches every requested task in that package; a task tag matches only tasks carrying that label. No future flag is required.
|
|
295
|
+
|
|
296
|
+
```bash title="Terminal"
|
|
297
|
+
turbo run test --filter=tag:ci
|
|
298
|
+
turbo run test --filter=tag:ci --filter='!tag:slow'
|
|
299
|
+
turbo run test --affected --filter=tag:ci
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Labels match exactly and case-sensitively, not as globs. Multiple include filters form a union; exclusions remove selected tasks. Required dependencies and co-scheduled `with` tasks are still retained, even if they do not match the tag.
|
|
303
|
+
|
|
304
|
+
The `...` and `^` modifiers on tag selectors traverse the Task Graph: `...tag:ci` includes dependents and `tag:ci...` includes dependencies. Directory and Git qualifiers can further narrow a tag selector, for example `tag:ci{./apps/*}[HEAD^1]`. Git-qualified tag selectors match changed files against task inputs.
|
|
305
|
+
|
|
306
|
+
For labels containing selector syntax, use a JSON string after `tag:` and preserve the double quotes with shell quoting:
|
|
307
|
+
|
|
308
|
+
```bash title="Terminal"
|
|
309
|
+
# Match the literal label "ci...", rather than expanding dependencies
|
|
310
|
+
turbo run test --filter='tag:"ci..."'
|
|
311
|
+
|
|
312
|
+
# Match the literal label "ci[main]{dir}"
|
|
313
|
+
turbo run test --filter='tag:"ci[main]{dir}"'
|
|
314
|
+
```
|
|
315
|
+
|
|
282
316
|
#### Using a task identifier
|
|
283
317
|
|
|
284
318
|
You can also run a specific task for a specific package in the format of `package-name#task-name`.
|
|
@@ -647,6 +681,14 @@ Ignore the local filesystem cache for all tasks, using Remote Cache for reading
|
|
|
647
681
|
turbo run build --remote-only
|
|
648
682
|
```
|
|
649
683
|
|
|
684
|
+
### `--single-package`
|
|
685
|
+
|
|
686
|
+
Run `turbo` in [single-package workspace](/docs/guides/single-package-workspaces) mode, treating the repository as one package instead of discovering workspace packages.
|
|
687
|
+
|
|
688
|
+
```bash title="Terminal"
|
|
689
|
+
turbo run build --single-package
|
|
690
|
+
```
|
|
691
|
+
|
|
650
692
|
### `--summarize`
|
|
651
693
|
|
|
652
694
|
Generates a JSON file in `.turbo/runs` containing metadata about the run, including:
|
|
@@ -122,6 +122,16 @@ System environment variables are always overridden by flag values provided direc
|
|
|
122
122
|
if one is not found.
|
|
123
123
|
</td>
|
|
124
124
|
</tr>
|
|
125
|
+
<tr id="turbo_env_mode">
|
|
126
|
+
<td>
|
|
127
|
+
<code>TURBO_ENV_MODE</code>
|
|
128
|
+
</td>
|
|
129
|
+
<td>
|
|
130
|
+
<span>Sets the environment mode, similar to using the</span>{" "}
|
|
131
|
+
<code>[--env-mode](/docs/reference/run#--env-mode-option)</code>
|
|
132
|
+
<span> flag.</span>
|
|
133
|
+
</td>
|
|
134
|
+
</tr>
|
|
125
135
|
<tr id="turbo_force">
|
|
126
136
|
<td>
|
|
127
137
|
<code>TURBO_FORCE</code>
|
|
@@ -274,6 +284,15 @@ System environment variables are always overridden by flag values provided direc
|
|
|
274
284
|
</td>
|
|
275
285
|
<td>Always ignore the local filesystem cache for all tasks.</td>
|
|
276
286
|
</tr>
|
|
287
|
+
<tr id="turbo_root_turbo_json">
|
|
288
|
+
<td>
|
|
289
|
+
<code>TURBO_ROOT_TURBO_JSON</code>
|
|
290
|
+
</td>
|
|
291
|
+
<td>
|
|
292
|
+
Use the <code>turbo.json</code> located at the provided path instead of
|
|
293
|
+
the one at the root of the repository.
|
|
294
|
+
</td>
|
|
295
|
+
</tr>
|
|
277
296
|
<tr id="turbo_run_summary">
|
|
278
297
|
<td>
|
|
279
298
|
<code>TURBO_RUN_SUMMARY</code>
|
|
@@ -338,6 +357,15 @@ System environment variables are always overridden by flag values provided direc
|
|
|
338
357
|
<a href="/docs/core-concepts/remote-caching">Remote Cache</a>.
|
|
339
358
|
</td>
|
|
340
359
|
</tr>
|
|
360
|
+
<tr id="turbo_tui_scrollback_length">
|
|
361
|
+
<td>
|
|
362
|
+
<code>TURBO_TUI_SCROLLBACK_LENGTH</code>
|
|
363
|
+
</td>
|
|
364
|
+
<td>
|
|
365
|
+
Number of lines to keep in scrollback for each task in the terminal
|
|
366
|
+
UI. Defaults to <code>2048</code>.
|
|
367
|
+
</td>
|
|
368
|
+
</tr>
|
|
341
369
|
<tr id="turbo_ui">
|
|
342
370
|
<td>
|
|
343
371
|
<code>TURBO_UI</code>
|
|
@@ -346,6 +374,15 @@ System environment variables are always overridden by flag values provided direc
|
|
|
346
374
|
Enables TUI when passed true or 1, disables when passed false or 0.
|
|
347
375
|
</td>
|
|
348
376
|
</tr>
|
|
377
|
+
<tr id="turbo_watch_startup_timeout">
|
|
378
|
+
<td>
|
|
379
|
+
<code>TURBO_WATCH_STARTUP_TIMEOUT</code>
|
|
380
|
+
</td>
|
|
381
|
+
<td>
|
|
382
|
+
Number of seconds <code>turbo watch</code> waits for the file watcher
|
|
383
|
+
to become ready before failing. Defaults to <code>120</code>.
|
|
384
|
+
</td>
|
|
385
|
+
</tr>
|
|
349
386
|
<tr id="turbo_concurrency">
|
|
350
387
|
<td>
|
|
351
388
|
<code>TURBO_CONCURRENCY</code>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turbo",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.7",
|
|
4
4
|
"description": "Turborepo is the build system for coding agents.",
|
|
5
5
|
"homepage": "https://turborepo.dev",
|
|
6
6
|
"bugs": "https://github.com/vercel/turborepo/issues",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
],
|
|
20
20
|
"main": "./bin/turbo",
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@turbo/darwin-64": "2.11.
|
|
23
|
-
"@turbo/darwin-arm64": "2.11.
|
|
24
|
-
"@turbo/linux-64": "2.11.
|
|
25
|
-
"@turbo/linux-arm64": "2.11.
|
|
26
|
-
"@turbo/windows-64": "2.11.
|
|
27
|
-
"@turbo/windows-arm64": "2.11.
|
|
22
|
+
"@turbo/darwin-64": "2.11.7",
|
|
23
|
+
"@turbo/darwin-arm64": "2.11.7",
|
|
24
|
+
"@turbo/linux-64": "2.11.7",
|
|
25
|
+
"@turbo/linux-arm64": "2.11.7",
|
|
26
|
+
"@turbo/windows-64": "2.11.7",
|
|
27
|
+
"@turbo/windows-arm64": "2.11.7"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"postversion": "node bump-version.js"
|
package/schema.json
CHANGED
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
193
|
"tags": {
|
|
194
|
-
"description": "
|
|
194
|
+
"description": "Arbitrary string labels for this package. In the root configuration, these labels apply to the root package.",
|
|
195
195
|
"anyOf": [
|
|
196
196
|
{
|
|
197
197
|
"$ref": "#/definitions/Array_of_String"
|
|
@@ -678,6 +678,13 @@
|
|
|
678
678
|
}
|
|
679
679
|
]
|
|
680
680
|
},
|
|
681
|
+
"tags": {
|
|
682
|
+
"description": "Arbitrary string labels for this task. Package configurations replace inherited tags by default; an empty array clears them. Include `$TURBO_EXTENDS$` to append labels to inherited tags.",
|
|
683
|
+
"type": ["array", "null"],
|
|
684
|
+
"items": {
|
|
685
|
+
"$ref": "#/definitions/String"
|
|
686
|
+
}
|
|
687
|
+
},
|
|
681
688
|
"with": {
|
|
682
689
|
"description": "A list of tasks that will run alongside this task.\n\nTasks in this list will not be run until completion before this task starts execution.\n\nDocumentation: https://turborepo.dev/docs/reference/configuration#with",
|
|
683
690
|
"type": ["array", "null"],
|