Expand description
bynk — the Bynk driver.
A thin orchestrator over the bynkc compiler and the Node toolchain:
bynk is to bynkc what cargo is to rustc. The compiler stays pure
(compile / check / fmt / test); environment orchestration — “is wrangler
installed”, “is your machine ready” — lives here (ADR: introduce the bynk
driver).
v0.46 ships the first command, doctor, an upfront environment check. The
crate is deliberately split into single-concern modules (per ADR 0060):
probe— the portable detection primitive (presence + version + provenance), backed by thewhichcrate so it is not Unix-only.compiler— locatebynkc(override → PATH → sibling-of-bynk) and report driver↔compiler version skew.doctor— the capability model, the checks, and the exit-code contract.report— render adoctor::Reportas a human table,--format short, or--format json.new— scaffold a new project (offline file-writing; no toolchain).dev— build a project and serve it locally withwrangler dev.check/fmt— type-check / format in-process (v0.138, #487).test— delegate to the driver-resolvedbynkc(v0.138, #487).diagnostics— shared flatten-then-delegate rendering for in-process compiles;shell— shelling the resolvedbynkc.migrate—bynk migrate statusandsweep(state-migrations S4).sweep— stopping whatbynk dev’s wranglers leave running (#1742).job— on Windows, the job object that stops a wrangler’s whole process tree (#1762).
Modules§
- approve
bynk approve(packaging slice 5, #2296, decision D): review and approve the npm packages that fetched (git or registry) packages’ adapters bring into the build, recording each approval inbynk.lock.- check
bynk check— type-check a.bynkfile or project without writing output.- cli
- The
bynkdriver command-line interface. - compiler
- Locate the
bynkccompiler the driver shells, and report driver↔compiler version skew. - deploy
bynk deploy— provision persistent Cloudflare identity, then publish.- dev
bynk dev— build a project and serve it locally in one step.- diagnostics
- Project-failure rendering for the driver.
- doctor
bynk doctor— the capability model, the checks, and the exit-code contract.- explain
bynk explain <code>— the compiler’s own explanation of a diagnostic code (#853), the analogue ofrustc --explain.- fetch
- Packaging slice 2b (#2240): fetching git dependencies and writing
bynk.lock— the one place the toolchain touches the network (trackdesign/tracks/packaging.md§6.4, decision A). - fmt
bynk fmt— format.bynksource files in place.- migrate
bynk migrate: where each agent class’s stored state stands, and the sweep that migrates every stored instance and raises the class’s floor (state-migrations S4, #2259; the retired track’s summary indesign/archive/retired-tracks.md, §3.3, §3.6).- new
bynk new— scaffold a new project.- probe
- The shared detection probe: presence + version + provenance.
- ready
bynk dev --ready-json <FILE>(#2138, end-to-end testing track §3.5, DECISION F): a machine-readable readiness signal.- registry
- Registries (packaging slice 4a, #2274; track
design/tracks/packaging.md§6.1–§6.2): the clientbynkresolves{ package, version }dependencies with, and the reference tooling for a static registry. - report
- Render a
Reportin one of three shapes. - shell
- Shelling the resolved
bynkc— shared by the commands that delegate to it. - stop
- Stopping
bynk devfrom outside (#1955). - sweep
- Stopping what
bynk dev’s wranglers leave behind (#1742). - test
bynk test— discover and run a project’s test declarations.- workers
- Shared Workers-build plumbing for
bynk devandbynk deploy.
Constants§
- DRIVER_
VERSION - The driver’s own version, from Cargo. Compared against the resolved
bynkc’s version to detect skew (compiler::Skew).