Expand description
Writing a compiled project’s output to disk.
Moved down from bynk-emit (#1047, R2.3/T0.7 residue): every caller was
already at driver level (bynkc’s CLI/test paths, bynk dev’s in-process
build) — bynk-emit never called this itself, so relocating it here is a
pure move, not a design change. bynk-emit stays a pure, in-memory
library; disk writes are the driver’s job, as R2.3 says they should be.
Functions§
- write_
compiled_ file - Write a single
CompiledFileunderdir, map-aware: a.bynk-sourced file gets a sibling.ts.mapand a//# sourceMappingURLtrailer (slice 1, ADR 0103); a file with no map is written verbatim. Shared bywrite_outputandbynkc test’s output loops, so every disk-writing path emits maps uniformly (slice 2 —bynkc test --inspectruns the emitted.tsdirectly and needs the maps on disk). The trailer lives only on the on-disk artefact; the in-memoryfile.typescriptstays trailer-free, so golden comparisons are unaffected. The map name appends.mapto the output file name. - write_
output - Write a
ProjectOutput’s files underdir, creating parent directories as needed. The shared writer behind bothbynkc’scompile/testpaths andbynk dev’s in-process build (slice 7) — so the on-disk result is identical however the build was driven.