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

[package]
name = "schemaui"
authors = ["unic <yuniqueunic@gmail.com>"]
version = "0.2.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"

[features]
default = ["tui", "json"]
full = ["all_formats", "tui", "web"]
tui = []
web = []

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.33.0"
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"

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


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

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


[package.metadata.release]
pre-release-replacements = [
    { file = "README.md", search = "schemaui = \"[0-9]+\\.[0-9]+\\.[0-9]+[^\"]*\"", replace = "schemaui = \"{{version}}\"" },
]
