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 TSnnnnrecord fromtsc’s output.
Constants§
Functions§
- check_
emit bynk check --emitfor one project (#3068): generate the Workers output into a temporary directory and type-check it, reporting atscfailure asbynk.codegen.tsc_failed. Run after the ordinary check has passed.truewhen the generated TypeScript type-checks.- check_
emit_ all check_emitover a project or, at a workspace root, every member.- diagnose
- Build the diagnostics for a failed
tscrun, orNonewhen its output holds noerror TSrecord (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 falseoutput into its error records. Lines that are not records (theFound N errorsfooter, blanks) are ignored; an indented line continues the previous record’s message.