bynk/lib.rs
1//! `bynk` — the Bynk driver.
2//!
3//! A thin orchestrator over the `bynkc` compiler and the Node toolchain:
4//! `bynk` is to `bynkc` what `cargo` is to `rustc`. The compiler stays pure
5//! (compile / check / fmt / test); environment orchestration — "is `wrangler`
6//! installed", "is your machine ready" — lives here (ADR: introduce the `bynk`
7//! driver).
8//!
9//! v0.46 ships the first command, [`doctor`], an upfront environment check. The
10//! crate is deliberately split into single-concern modules (per ADR 0060):
11//!
12//! - [`probe`] — the portable detection primitive (presence + version +
13//! provenance), backed by the `which` crate so it is not Unix-only.
14//! - [`compiler`] — locate `bynkc` (override → PATH → sibling-of-`bynk`) and
15//! report driver↔compiler version skew.
16//! - [`doctor`] — the capability model, the checks, and the exit-code contract.
17//! - [`report`] — render a [`doctor::Report`] as a human table, `--format
18//! short`, or `--format json`.
19//! - [`new`] — scaffold a new project (offline file-writing; no toolchain).
20//! - [`dev`] — build a project and serve it locally with `wrangler dev`.
21
22pub mod cli;
23pub mod compiler;
24pub mod dev;
25pub mod doctor;
26pub mod new;
27pub mod probe;
28pub mod report;
29
30/// The driver's own version, from Cargo. Compared against the resolved
31/// `bynkc`'s version to detect skew ([`compiler::Skew`]).
32pub const DRIVER_VERSION: &str = env!("CARGO_PKG_VERSION");