fix(cli): report a syntax error in the recipe file instead of an empty recipe #253

Merged
abiwab merged 1 commit from fix/pipeline-entry-parse-error into main 2026-11-25 17:40:57 +01:00
Owner

Since @use resolution was wired into runPipeline (a221da94), a syntax error in the recipe file itself became a MODULE_PARSE_ERROR diagnostic of the module graph instead of an exception. Every command that reads a recipe (view, export, print, build, plan, shop, scale, cook) then showed an empty recipe and exited 0; only gram check reported the error.

runPipeline now parses the entry file again when the graph reports a parse error for it, and throws the parser's own GramParseError (same as runPipelineFromSource). A syntax error in an imported module stays a diagnostic.

  • Every command now fails with the parser's message and exit code 1.
  • gram check still reports one error, on its line.
  • A multi-file gram build stops at the first invalid file again (as before a221da94) instead of emitting an empty JSON for it.

Tests: tests/pipeline-parse-error.test.ts (entry throws, imported module stays a diagnostic, check unchanged). Patch changeset included.

Since `@use` resolution was wired into `runPipeline` (a221da94), a syntax error in the recipe file itself became a `MODULE_PARSE_ERROR` diagnostic of the module graph instead of an exception. Every command that reads a recipe (`view`, `export`, `print`, `build`, `plan`, `shop`, `scale`, `cook`) then showed an empty recipe and exited 0; only `gram check` reported the error. `runPipeline` now parses the entry file again when the graph reports a parse error for it, and throws the parser's own `GramParseError` (same as `runPipelineFromSource`). A syntax error in an imported module stays a diagnostic. - Every command now fails with the parser's message and exit code 1. - `gram check` still reports one error, on its line. - A multi-file `gram build` stops at the first invalid file again (as before a221da94) instead of emitting an empty JSON for it. Tests: `tests/pipeline-parse-error.test.ts` (entry throws, imported module stays a diagnostic, check unchanged). Patch changeset included.
fix(cli): report a syntax error in the recipe file instead of an empty recipe
All checks were successful
CI / Build & Test (pull_request) Successful in 4m17s
0d23679e60
abiwab merged commit a11708eb76 into main 2026-11-25 17:40:57 +01:00
abiwab deleted branch fix/pipeline-entry-parse-error 2026-11-25 17:40:58 +01:00
Sign in to join this conversation.
No description provided.