[workspace]
members = ["schemaui-cli"]

[package]
name = "schemaui"
authors = ["unic <yuniqueunic@gmail.com>"]
version = "0.4.0"
edition = "2024"
keywords = ["tui", "schema", "configuration", "terminal", "cross-platform"]
categories = ["command-line-interface", "config"]
repository = "https://github.com/yuniqueunic/schemaui"
documentation = "https://docs.rs/schemaui"
description = "A Rust library for generating TUI and Web UIs from JSON Schemas for configuration management."
license = "MIT OR Apache-2.0"
readme = "README.md"
exclude = [
    "web/ui/node_modules/**",
    "web/ui/.vite/**",
    "web/ui/.tmp/**",
    "web/ui/.DS_Store",
    "docs/**/*.gif",
    "docs/**/*.mp4",
]
include = [
    "Cargo.toml",
    "keymap/default.keymap.json",
    "src/**",
    "web/dist/**",
    "README.md",
    "README.ZH.md",
    "LICENSE*",
]

[features]
default = ["tui", "web", "json"]
full = ["all_formats", "tui", "web"]
tui = []
web = ["dep:include_dir", "dep:axum", "dep:tokio", "dep:ts-rs"]

all_formats = ["json", "yaml", "toml"]
json = []
yaml = ["dep:serde_yaml"]
toml = ["dep:toml"]

compile_time = []

# use debug features for debugging which is more flexible than debug_assertions
debug = []


[dependencies]
anyhow = "1"
crossterm = "0.29.0"
jsonschema = "0.37"
ratatui = "0.29.0"
schemars = { version = "0.8.22", features = ["preserve_order"] }
serde = { version = "1", features = ["derive"] }
indexmap = "2"
percent-encoding = "2"
unicode-width = "=0.2.0"
textwrap = "0.16"
regex = "1"
include_dir = { version = "0.7", optional = true }
axum = { version = "0.8", features = ["macros", "json"], optional = true }
tokio = { version = "1", features = [
    "macros",
    "rt-multi-thread",
    "signal",
    "net",
    "fs",
], optional = true }
ts-rs = { version = "11", optional = true, features = ["serde-compat"] }

# For serialization formats
serde_json = "1"
serde_yaml = { version = "0.9", optional = true }
toml = { version = "0.9", optional = true }

[[example]]
name = "demo"
path = "examples/demo.rs"


[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = "debuginfo"
