From e6f3ff3c1e3cf1f50f2173ba69e0524760531409 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Thu, 4 Sep 2025 12:44:51 -0400 Subject: [PATCH] Setting bard to have a server mode. This is so that the database using code that doesn't compile to WASM can be used by the dioxus frontend. --- bard/Cargo.toml | 8 ++++++-- bard/src/lib.rs | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bard/Cargo.toml b/bard/Cargo.toml index 734a949..4b5b885 100644 --- a/bard/Cargo.toml +++ b/bard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bard" -version = "0.0.1" +version = "0.0.2" edition = "2024" description = "Dioxus components that will display a Tavern blogging system Blog." repository = "/CyberMages/tavern" @@ -10,4 +10,8 @@ readme = "README.md" license = "Apache-2.0" [dependencies] -tavern = { version = "0.2.4", path = "../tavern", registry = "cybermages" } +tavern = { version = "0.2.4", path = "../tavern", registry = "cybermages", optional = true} + +[features] +default = ["tavern"] +server = ["tavern/database"] diff --git a/bard/src/lib.rs b/bard/src/lib.rs index 2a171fe..96a050a 100644 --- a/bard/src/lib.rs +++ b/bard/src/lib.rs @@ -4,12 +4,14 @@ mod info; +#[cfg(feature = "server")] use tavern::Database; pub use crate::info::{get_name, get_version}; +#[cfg(feature = "server")] pub async fn init_database

(path: P) -> Result, Box> where P: AsRef