Skip to main content

Module tsc_report

Module tsc_report 

Source
Expand description

#3068: report a tsc failure on generated TypeScript as a Bynk diagnostic, bynk.codegen.tsc_failed, at the Bynk source the failing line came from.

A program that passed the checker never should produce TypeScript that tsc rejects, so such a failure is a compiler bug, and a raw out/workers/room/handlers.ts(120,74): error TS2345 line is no use to the person who hit it. This module parses tsc’s output, maps each error’s line back through the emitted .ts.map (ADR 0103: line-level, each generated line mapped to its nearest enclosing statement), and builds a ProjectFailure so the usual renderers print it like any other diagnostic.

Mapping is line-level only (the maps carry no useful column), so the Bynk span is the whole mapped source line; the TS column stays in the attached note. An error that cannot be mapped is still reported, at the project level.

Structs§

TscError
One error TSnnnn record from tsc’s output.

Constants§

CODE

Functions§

check_emit
bynk check --emit for one project (#3068): generate the Workers output into a temporary directory and type-check it, reporting a tsc failure as bynk.codegen.tsc_failed. Run after the ordinary check has passed. true when the generated TypeScript type-checks.
check_emit_all
check_emit over a project or, at a workspace root, every member.
diagnose
Build the diagnostics for a failed tsc run, or None when its output holds no error TS record (a crash, an out-of-memory, a missing install): that is a toolchain failure, not evidence of a compiler bug, and the caller reports the raw output as it always did.
parse_tsc_output
Parse tsc --pretty false output into its error records. Lines that are not records (the Found N errors footer, blanks) are ignored; an indented line continues the previous record’s message.