pub fn write_output(out: &ProjectOutput, dir: &Path) -> Result<()>Expand description
Write a ProjectOutput’s files under dir, creating parent directories as
needed. The shared writer behind both bynkc’s compile/test paths and
bynk dev’s in-process build (slice 7) — so the on-disk result is identical
however the build was driven.
Reconciles dir against out.files first: a .ts/.js/.map/.json/
.toml file already on disk that no longer corresponds to anything in
out.files (or one of its .map/.bynkdbg.json sidecars) is deleted,
along with any directory that becomes empty as a result — otherwise a
deleted .bynk unit’s emitted .ts lingers on disk, still type-checked by
the emitted tsconfig.json’s include: **/*.ts, so tsc fails against a
module the current project no longer has. node_modules and dotfile
directories (.git, an npm-installed tree under the output root) are
never descended into — this reconciles the compiler’s own output, not
whatever else happens to live alongside it.