pub mod fmt;
pub mod fonts;
pub mod inspect;
pub mod library;
pub mod merge;
pub mod new;
pub mod plugin;
pub mod render;
pub mod schema;
pub mod theme;
pub mod tokens;
pub mod tx;
pub mod validate;
pub mod variant;
pub mod workspace;
pub(crate) fn serialize_pretty<T: serde::Serialize>(value: &T) -> String {
serde_json::to_string_pretty(value).unwrap_or_else(|e| e.to_string())
}
pub(crate) fn serialize_compact<T: serde::Serialize>(value: &T) -> String {
serde_json::to_string(value).unwrap_or_else(|e| e.to_string())
}
pub(crate) fn format_diagnostic_line(d: &zenith_core::Diagnostic) -> String {
let sev = crate::json_types::severity_str(&d.severity);
let subject = d
.subject_id
.as_deref()
.map(|s| format!(" ({})", s))
.unwrap_or_default();
format!("{}[{}]{}: {}", sev, d.code, subject, d.message)
}
pub(crate) fn format_error_diag(d: &zenith_core::Diagnostic) -> String {
format!("error[{}]: {}", d.code, d.message)
}