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
14mod collector;
15mod hooks;
16mod hub;
17mod inject;
18mod middleware;
19mod plugin;
20mod redact;
21mod routes;
22
23pub use collector::{DevToolsBag, HttpLine, LogLine, QueryLine, RequestSnapshot};
24pub use hub::{CustomEvent, DevToolsHub, MemorySample, MemorySummary};
25pub use inject::{inject_body, DEVTOOLS_MARKER};
26pub use plugin::DevTools;
27
28pub(crate) static APP_CSS: &str = include_str!("../assets/app.css");
29pub(crate) static APP_JS: &str = include_str!("../assets/app.js");
30pub(crate) static BRIDGE_JS: &str = include_str!("../assets/bridge.js");
31pub(crate) static SHELL_HTML: &str = include_str!("../assets/index.html");