Repository navigation
Commit 8b08888
authored
build(turbo): scope root-file inputs to the tasks that read them (#50)
## What changes
- `globalDependencies` is gone. flake.nix, flake.lock,
commitlint.config.ts, .lintstagedrc.js, tsconfig.node.json and
scripts/** were global, so a flake bump re-ran every task of every
package. Only `//#typecheck:node` and `//#test:scripts` read them, and
both already list them as inputs.
- `tsconfig.base.json` and `oxlint.shared.ts` are inputs of `apps/site`
and `apps/site-e2e` only, through new package `turbo.json` files. Those
two apps are the only importers (`turbo query 'query { boundaries {
items { message path } } }'` reports their `../../oxlint.shared.ts` and
`../../stryker.shared.ts` imports; their tsconfigs extend
`../../tsconfig.base.json`).
- Package tasks no longer depend on `//#typecheck:node`,
`//#test:scripts`, `//#lint:suppressions` or `//#format:check`. These
edges made every package's `lint` wait on the repo-wide format check and
run whenever any root file changed. The root `lint` and `typecheck`
scripts already name these root tasks.
- `futureFlags.affectedUsingTaskInputs` matches changed files against
each task's `inputs`.
- Root tasks that had no `inputs` and that the apps extend now say
`$TURBO_DEFAULT$` explicitly, so `$TURBO_EXTENDS$` in the app files
keeps the default inputs.
A CI job that runs `turbo run ... --affected` must name the root tasks
it wants (`typecheck:node`, `lint:suppressions`, `test:scripts`), since
package tasks no longer pull them in.
## Evidence
turbo 2.11.7. Each probe appends one line to the file on top of the base
commit, then runs `turbo query 'query { affectedTasks(base: "<base>",
head: "HEAD", tasks: [...]) { length items { fullName reason {
__typename } } } }'` with `typecheck lint attw`, then with `test`.
Before is the default branch, after is this branch.
| Changed file | typecheck/lint/attw before → after | test before →
after | Reasons before | Reasons after |
|---|---|---|---|---|
| `AGENTS.md` | 17 → 0 | 0 → 0 | TaskAllChanged 9,
TaskDependencyTaskChanged 6, TaskFileChanged 2 | none |
| `flake.lock` | 36 → 0 | 12 → 0 | TaskGlobalDepsChanged 36 | none |
| `commitlint.config.ts` | 36 → 0 | 12 → 0 | TaskGlobalDepsChanged 36 |
none |
| `tsconfig.base.json` | 36 → 10 | 12 → 3 | TaskGlobalDepsChanged 36 |
TaskDependencyTaskChanged 2, TaskFileChanged 8 |
| `oxlint.shared.ts` | 36 → 6 | 12 → 0 | TaskGlobalDepsChanged 36 |
TaskAllChanged 3, TaskFileChanged 3 |
| `apps/site/src/api/check-health.workflow.ts` | 21 → 6 | 3 → 2 |
TaskAllChanged 8, TaskDependencyTaskChanged 6, TaskFileChanged 7 |
TaskDependencyTaskChanged 1, TaskFileChanged 5 |
| `packages/atom/effect-atom-react/README.md` | 21 → 0 | 5 → 0 |
TaskAllChanged 13, TaskDependencyTaskChanged 6, TaskFileChanged 2 | none
|
The drops on an app source change are the root-task edges and the
repo-wide format check that every lint used to wait on.
Real ranges from this repository's history, replayed with this change
applied to both ends:
| Range | typecheck/lint/attw before → after | test before → after |
Package reasons before |
|---|---|---|---|
| `b096c94e2d..4bbba74` | 36 → 11 | 12 → 5 | GlobalDepsChanged 7 |
| `364db0c72e..1def24b` | 17 → 0 | 0 → 0 | FileChanged 1 |
| `86b638988a..daaef80` | 30 → 23 | 9 → 8 | FileChanged 5 |
---------
Co-authored-by: systemfsoftware-bot <318394648+systemfsoftware-bot@users.noreply.github.com>1 parent 596177c commit 8b08888
4 files changed
Lines changed: 144 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 7 | | |
16 | 8 | | |
17 | 9 | | |
| |||
67 | 59 | | |
68 | 60 | | |
69 | 61 | | |
70 | | - | |
71 | 62 | | |
72 | 63 | | |
73 | 64 | | |
| |||
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
131 | | - | |
132 | | - | |
| 122 | + | |
133 | 123 | | |
134 | 124 | | |
135 | 125 | | |
| |||
161 | 151 | | |
162 | 152 | | |
163 | 153 | | |
164 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
165 | 158 | | |
166 | 159 | | |
167 | 160 | | |
| |||
225 | 218 | | |
226 | 219 | | |
227 | 220 | | |
228 | | - | |
229 | 221 | | |
230 | 222 | | |
231 | 223 | | |
| |||
235 | 227 | | |
236 | 228 | | |
237 | 229 | | |
238 | | - | |
239 | | - | |
240 | 230 | | |
241 | 231 | | |
242 | 232 | | |
| |||
0 commit comments