bynk/lib.rs
1//! `bynk` — the Bynk driver.
2//!
3//! The compiler, linked in, and an orchestrator over the Node toolchain. The
4//! compiler stays pure (compile / check / fmt / test); environment orchestration
5//! — "is `wrangler` installed", "is your machine ready" — lives here (ADR:
6//! introduce the `bynk` driver).
7//!
8//! v0.46 ships the first command, [`doctor`], an upfront environment check. The
9//! crate is deliberately split into single-concern modules (per ADR 0060):
10//!
11//! - [`probe`] — the portable detection primitive (presence + version +
12//! provenance), backed by the `which` crate so it is not Unix-only.
13//! - [`doctor`] — the capability model, the checks, and the exit-code contract.
14//! - [`report`] — render a [`doctor::Report`] as a human table, `--format
15//! short`, or `--format json`.
16//! - [`new`] — scaffold a new project (offline file-writing; no toolchain).
17//! - [`dev`] — build a project and serve it locally with `wrangler dev`.
18//! - [`tail`] — stream a deployed Worker's logs with `.bynk` frames (#2546).
19//! - [`check`] / [`fmt`] / [`compile`] / [`test`](mod@test) — type-check, format,
20//! compile and test in-process (v0.138, #487; #2998).
21//! - [`diagnostics`] — shared flatten-then-delegate rendering for in-process
22//! compiles; [`shell`] — child-process exit statuses.
23//! - [`migrate`] — `bynk migrate status` and `sweep` (state-migrations S4).
24//! - [`sweep`] — stopping what `bynk dev`'s wranglers leave running (#1742).
25//! - `job` — on Windows, the job object that stops a wrangler's whole process
26//! tree (#1762).
27
28pub mod approve;
29pub mod book;
30pub mod check;
31pub mod cli;
32pub(crate) mod cloudflare;
33pub mod compile;
34pub mod deploy;
35pub mod dev;
36mod dev_containers;
37mod dev_hyperdrive;
38pub mod dev_inspect;
39mod dev_vectorize;
40pub mod diagnostics;
41pub mod doctor;
42pub mod eval;
43pub mod explain;
44pub mod fetch;
45pub mod fmt;
46pub mod http_client;
47#[cfg(windows)]
48pub mod job;
49pub mod logs;
50pub mod mcp;
51pub mod migrate;
52pub mod new;
53pub mod openapi;
54pub mod ready;
55pub mod token;
56
57// The shared detection probe (Wave 5 §5.4, findings #40/#72) moved down into
58// `bynk-driver` (it replaced the old `tool_exists`
59// PATH-only check). Re-exported
60// here so every `crate::probe`/`bynk::probe` path in this crate resolves
61// unchanged.
62pub use bynk_driver::probe;
63pub mod registry;
64pub mod report;
65pub mod shell;
66pub mod stop;
67pub mod sweep;
68pub mod tail;
69pub mod test;
70pub mod trace;
71pub mod workers;
72
73/// The driver's own version, from Cargo.
74pub const DRIVER_VERSION: &str = env!("CARGO_PKG_VERSION");