Expand description
Shared Workers-build plumbing for bynk dev and bynk deploy.
Both commands do the same four things before they diverge: prepare a managed
build directory, compile the project into it, discover the worker directories
that came out, and shell wrangler. That machinery grew up inside dev.rs
and deploy.rs reached across for it, which left dev reading as deploy’s
utility library. It lives here instead — a sibling of both, owned by neither.
Enums§
- Select
Error - Why context selection failed — rendered to the user with the next step.
Functions§
- compile_
once - One compile of the project into
build_dir, on the same rooting rule asbynkc compile <project_root>(#524, via [bynk_driver::project_options]). Default: in-process. Escape hatch: aBYNK_BYNKCoverride shells that binary instead — the only path on which a second, skewable compiler enters (doctor reports its skew only here). Returnsfalseon failure with the diagnostics already rendered. - discover_
workers - The worker directories under
<build>/workers/that carry awrangler.toml(the unitwrangler devcan serve), sorted for deterministic messages. - prepare_
build_ dir - Ensure
.bynk/is gitignored on first build (cargo’starget/.gitignoreprecedent — adevrun never dirtiesgit status), then clear theworkers/tree so selection only ever sees this build’s contexts (D1). - select_
contexts - Pick the workers
devwill serve together (#552). No--contextserves every context in the project — the whole point of the increment, since a cross-context call only resolves when its callee is up too.--contextis repeatable and narrows to a subset, inavailable’s deterministic order rather than the order they were typed, and duplicates collapse. - wrangler_
command - Build the
wrangler devinvocation for a resolved provenance: an installed binary is run directly; an npx-provisionable one goes throughnpx --yes.Nonewhen wrangler is genuinely missing.