turbo
f063969d - fix(turbo_json): avoid workspace validation errors (#10211)

Commit
258 days ago
fix(turbo_json): avoid workspace validation errors (#10211) ### Description #10083 introduced a bug where we swallow validation errors and end up silently ignoring these workspace `turbo.json` files. This PR fixes that by distinguishing a missing `turbo.json` from a failed read. The bug stems from the fact that a missing file and a failed read were both errors so `turbo_json.or(turbo_jsonc)` could choose a missing turbo.json error (which is fine, not all workspaces need `turbo.json`s) over a validation error for the file that is present. We replace `.or` with an extremely explicit `match` that goes through all the possible combinations. ### Testing Instructions Added unit test Quick manual verification ``` [0 olszewski@macbookpro] /Users/olszewski/code/vercel/turborepo $ turbo_dev build WARNING No locally installed `turbo` found. Using version: 2.4.5-canary.6. turbo 2.4.5-canary.6 turbo_json_parse_error × Failed to parse turbo.json. ╰─▶ × Found an unknown key `lol`. ╭─[cli/turbo.json:9:7] 8 │ "rust-src": { 9 │ "lol": true, · ───── 10 │ "env": [ ╰──── ```
Parents
Loading