turbo
dd5264f8 - feat(turbo json): make `with` public (#10191)

Commit
334 days ago
feat(turbo json): make `with` public (#10191) ### Description Make public the feature added in #9504 that allows for pulling in extra tasks into the graph without a `dependsOn` relationship. Renamed to `with` as it is better than `sibling` since that indicates a shared parent, which isn't required. ### Testing Instructions Added quick unit test for parsing and error validation. Basic test: ``` [0 olszewski@macbookpro] /tmp/with-test $ git diff diff --git a/turbo.json b/turbo.json index d6a7fe0..35fa9cd 100644 --- a/turbo.json +++ b/turbo.json @@ -15,7 +15,8 @@ }, "dev": { "cache": false, - "persistent": true + "persistent": true, + "with": ["build"] } } } # Verify web#build is in the graph [0 olszewski@macbookpro] /tmp/with-test $ turbo_dev --skip-infer web#dev --graph turbo 2.4.5-canary.4 digraph { compound = "true" newrank = "true" subgraph "root" { "[root] @repo/eslint-config#build" -> "[root] ___ROOT___" "[root] @repo/typescript-config#build" -> "[root] ___ROOT___" "[root] @repo/ui#build" -> "[root] @repo/eslint-config#build" "[root] @repo/ui#build" -> "[root] @repo/typescript-config#build" "[root] web#build" -> "[root] @repo/eslint-config#build" "[root] web#build" -> "[root] @repo/typescript-config#build" "[root] web#build" -> "[root] @repo/ui#build" "[root] web#dev" -> "[root] ___ROOT___" } } ``` Error message for trying to use `^` ``` [0 olszewski@macbookpro] /tmp/with-test $ turbo_dev --skip-infer web#dev turbo 2.4.5-canary.4 × Invalid turbo.json configuration ╰─▶ × `with` cannot use topological dependencies. ╭─[turbo.json:19:16] 18 │ "persistent": true, 19 │ "with": ["^build"] · ────┬─── · ╰── Remove `^` from start of task name. 20 │ } ╰──── ``` --------- Co-authored-by: Anthony Shew <anthony.shew@vercel.com>
Parents
Loading