Skip to main content

dbgflow_ui/
lib.rs

1//! Dependency-free embedded assets for the dbgflow browser UI.
2//!
3//! The frontend build writes its immutable distribution files into this
4//! crate's `assets` directory. HTTP delivery remains the responsibility of a
5//! server crate, so depending on `dbgflow-ui` does not pull in a web stack.
6
7/// Returns the HTML document for the debugger UI.
8#[must_use]
9pub const fn index_html() -> &'static str {
10    include_str!("../assets/index.html")
11}
12
13/// Returns the bundled JavaScript application.
14#[must_use]
15pub const fn app_js() -> &'static str {
16    include_str!("../assets/app.js")
17}
18
19/// Returns the legacy application stylesheet.
20#[must_use]
21pub const fn app_css() -> &'static str {
22    include_str!("../assets/app.css")
23}
24
25/// Returns the generated global Tailwind stylesheet.
26#[must_use]
27pub const fn globals_css() -> &'static str {
28    include_str!("../assets/globals.css")
29}
30
31#[cfg(test)]
32mod tests {
33    use super::{app_css, app_js, globals_css, index_html};
34
35    #[test]
36    fn embeds_a_self_contained_distribution() {
37        assert!(index_html().contains("/app.js"));
38        assert!(index_html().contains("/globals.css"));
39        assert!(!app_js().is_empty());
40        assert!(!app_css().is_empty());
41        assert!(!globals_css().is_empty());
42    }
43}