Skip to main content

sova_devtools/
lib.rs

1//! In-app DevTools for Sova — thin host bridge + SPA panel.
2//!
3//! Enable only in development (`[development.devtools] enabled = true` or
4//! `SOVA_DEVTOOLS=1`). Injects into `text/html` responses only.
5//!
6//! Host pages get a tiny `bridge.js` (bar + dock iframe). The Vue app
7//! is served at `/_devtools/app`. Bar toggles the dock iframe; "New tab"
8//! only opens the SPA in a browser tab (no persisted mode).
9
10//!
11//! Frontend: `ui/` (Vite + Vue + Tailwind + Pinia + Vue Router + TS).
12//! Build: `npm --prefix ui ci && npm --prefix ui run build` → `assets/`.
13
14#[cfg(feature = "console")]
15mod actions;
16mod collector;
17mod console;
18mod hooks;
19mod hub;
20mod inject;
21mod middleware;
22mod plugin;
23mod redact;
24mod routes;
25
26pub use collector::{DevToolsBag, HttpLine, LogLine, QueryLine, RequestSnapshot};
27pub use hub::{CustomEvent, DevToolsHub, MemorySample, MemorySummary};
28pub use inject::{inject_body, DEVTOOLS_MARKER};
29pub use plugin::DevTools;
30
31pub(crate) static APP_CSS: &str = include_str!("../assets/app.css");
32pub(crate) static APP_JS: &str = include_str!("../assets/app.js");
33pub(crate) static BRIDGE_JS: &str = include_str!("../assets/bridge.js");
34pub(crate) static SHELL_HTML: &str = include_str!("../assets/index.html");