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_
document - Write one
Documentunderdir— the real, typed write boundary (P7.6, #1309, Decision C: one place derives the sibling-path relationship instead of two independently-maintained ones). Shared bywrite_outputandbynk-driver::test_runner’s own output loop (bynkc test), so every disk-writing path emits maps uniformly (slice 2 —bynkc test --inspectruns the emitted.tsdirectly and needs the maps on disk). - write_
modules - #2321: write the WebAssembly modules adapter bindings include, byte for byte, beside the bindings that load them.
- write_
modules_ for_ node - #2321: for a run on Node (
bynk test), write the modules and overwrite each one’s Workers loader shim with the Node form (bynk_emit::project::node_wasm_shim), which inlines the module. Call it after every document write, since a later write ofdocsrestores the Workers form. - write_
output - Write a
ProjectOutput’s artefacts 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.