Expand description
Bynk’s build orchestration and TypeScript emission — the layer above
bynk-check.
project is the build driver: it conducts discovery, the dependency graph,
consistency, validation, symbols, and paths, and owns compile_project.
emitter lowers a checked program to TypeScript. Read the crate as “build
orchestration + TS emission” — orchestration drives emission.
Extracted from bynkc as slice 4 of the crate-decomposition track over
bynk-syntax + bynk-check. Behaviour is unchanged; bynkc depends on this
crate and re-exports its modules so its public API (compile_project,
ProjectOutput, …) and the binary are untouched.
Modules§
- emitter
- TypeScript emission (spec §7, v0.1 §6, v0.2 §6).
- project
- Multi-file project compilation (v0.3 §3.2 and §3.3, v0.4 §3.5).
Constants§
- NODE_
MAJOR_ FLOOR - Minimum supported Node.js major version for the
nodeplatform binding and for running Bynk’s emitted TypeScript.
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.