[package]
name = "chattyness-owner"
version.workspace = true
edition.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "chattyness-owner"
path = "src/main.rs"

[dependencies]
chattyness-admin-ui.workspace = true
chattyness-db.workspace = true
chattyness-error.workspace = true
leptos.workspace = true
leptos_meta.workspace = true
leptos_router.workspace = true
leptos_axum = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }
tower-sessions = { workspace = true, optional = true }
tower-sessions-sqlx-store = { workspace = true, optional = true }
sqlx = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
dotenvy = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
serde.workspace = true
uuid.workspace = true

# WASM dependencies
console_error_panic_hook = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }

[features]
default = ["ssr"]
ssr = [
    "leptos/ssr",
    "leptos_axum",
    "axum",
    "tower",
    "tower-http",
    "tower-sessions",
    "tower-sessions-sqlx-store",
    "sqlx",
    "clap",
    "tokio",
    "dotenvy",
    "tracing",
    "tracing-subscriber",
    "chattyness-admin-ui/ssr",
    "chattyness-db/ssr",
    "chattyness-error/ssr",
]
hydrate = [
    "leptos/hydrate",
    "chattyness-admin-ui/hydrate",
    "console_error_panic_hook",
    "wasm-bindgen",
]

[package.metadata.leptos]
# Project name used for output artifacts
output-name = "chattyness-owner"

# Site configuration (paths relative to workspace root)
site-root = "target/site-owner"
site-pkg-dir = "static"
site-addr = "127.0.0.1:3001"
reload-port = 3002

# Tailwind CSS (path relative to this Cargo.toml)
tailwind-input-file = "style/tailwind.css"

# Build settings
bin-features = ["ssr"]
bin-default-features = false
lib-features = ["hydrate"]
lib-default-features = false

# Environment
env = "DEV"
