[workspace]
members = ["revue-macros"]
resolver = "2"

[package]
name = "revue"
version = "2.41.1"
edition = "2021"
rust-version = "1.87"
description = "A Vue-style TUI framework for Rust with CSS styling"
license = "MIT"
repository = "https://github.com/hawk90/revue"
homepage = "https://hawk90.github.io/revue"
documentation = "https://docs.rs/revue"
readme = "README.md"
keywords = ["tui", "terminal", "css", "reactive", "ui"]
categories = ["command-line-interface", "gui"]
include = [
    "build.rs",
    "src/**/*.rs",
    "src/style/themes/*.css",
    "Cargo.toml",
    "LICENSE*",
    "README.md",
    "benches/**/*.rs",
    "examples/**/*.rs",
    "tests/**/*.rs",
]
exclude = [
    "revue-cli/",
    "references/",
    "playground/",
    "extensions/",
    "tools/",
    "docs/",
    "tree-sitter-revue-css/",
    ".claude/",
    ".github/",
    "CONTRIBUTING.md",
    "cliff.toml",
    "deny.toml",
    "lefthook.yml",
    "*.rlib",
    "badge",
    "spinner",
    "tabs",
]

[dependencies]
# ═══════════════════════════════════════════
# Terminal
# ═══════════════════════════════════════════
crossterm = "0.29"

# ═══════════════════════════════════════════
# Text & Unicode
# ═══════════════════════════════════════════
unicode-width = "0.2"
unicode-segmentation = "1.10"
unic-emoji-char = "0.9"
textwrap = "0.16"

# ═══════════════════════════════════════════
# Markdown & Syntax (optional)
# ═══════════════════════════════════════════
pulldown-cmark = { version = "0.13", optional = true }

# Tree-sitter for syntax highlighting
tree-sitter-highlight = { version = "0.26", optional = true }
tree-sitter-rust = { version = "0.24", optional = true }
tree-sitter-python = { version = "0.25", optional = true }
tree-sitter-javascript = { version = "0.25", optional = true }
tree-sitter-json = { version = "0.24", optional = true }
tree-sitter-go = { version = "0.25", optional = true }
tree-sitter-bash = { version = "0.25", optional = true }
tree-sitter-html = { version = "0.23", optional = true }
tree-sitter-css = { version = "0.25", optional = true }
tree-sitter-toml-ng = { version = "0.7", optional = true }
tree-sitter-yaml = { version = "0.7", optional = true }
tree-sitter-sequel = { version = "0.3", optional = true }
tree-sitter-md = { version = "0.5", optional = true }

# ═══════════════════════════════════════════
# Image (Kitty Protocol, optional)
# ═══════════════════════════════════════════
image = { version = "0.25", optional = true }
base64 = { version = "0.22", optional = true }

# ═══════════════════════════════════════════
# Serialization & Config (optional)
# ═══════════════════════════════════════════
serde = { version = "1.0", features = ["derive"], optional = true }
toml = { version = "0.9", optional = true }
dirs = { version = "6.0", optional = true }

# ═══════════════════════════════════════════
# Utilities
# ═══════════════════════════════════════════
bitflags = "2.6"
arboard = { version = "3.4", optional = true }
notify = { version = "8.2", optional = true }
tracing = { version = "0.1", optional = true }
tracing-subscriber = { version = "0.3", optional = true }

# ═══════════════════════════════════════════
# QR Code & HTTP & System (optional)
# ═══════════════════════════════════════════
qrcode = { version = "0.14", optional = true }
sysinfo = { version = "0.38", optional = true }
reqwest = { version = "0.13", features = ["json", "blocking"], optional = true }
similar = { version = "2.6", optional = true }

# ═══════════════════════════════════════════
# Error Handling
# ═══════════════════════════════════════════
thiserror = "2.0"

# ═══════════════════════════════════════════
# Internal Macros
# ═══════════════════════════════════════════
revue-macros = { path = "revue-macros", version = "2.41.1" }

[dev-dependencies]
insta = "1.34"
tokio-test = "0.4"
pretty_assertions = "1.4"
criterion = { version = "0.8", features = ["html_reports"] }
proptest = "1.4"
tempfile = "3.10"
serial_test = "3.1"

[[bench]]
name = "render"
harness = false

[[bench]]
name = "layout"
harness = false

[[bench]]
name = "css"
harness = false

[[bench]]
name = "dom"
harness = false

[features]
# Default features - essential for most apps
default = [
    "async",
    "config",
]
# All features enabled (for examples/tests)
full = [
    "devtools",
    "async",
    "config",
    "tracing",
    "markdown",
    "syntax-highlighting",
    "image",
    "qrcode",
    "sysinfo",
    "diff",
    "clipboard",
    "hot-reload",
]
devtools = []

# Preset feature groups
std = ["async", "config", "tracing"]
gui = ["async", "config", "markdown", "image"]
all-gui = ["std", "syntax-highlighting", "qrcode", "sysinfo", "diff", "clipboard", "hot-reload"]

# Core optional features
async = ["dep:tokio"]
config = ["dep:serde", "dep:toml", "dep:dirs"]
tracing = ["dep:tracing", "dep:tracing-subscriber"]

# Heavy optional features
markdown = ["dep:pulldown-cmark"]
syntax-highlighting = [
    "dep:tree-sitter-highlight",
    "dep:tree-sitter-rust",
    "dep:tree-sitter-python",
    "dep:tree-sitter-javascript",
    "dep:tree-sitter-json",
    "dep:tree-sitter-go",
    "dep:tree-sitter-bash",
    "dep:tree-sitter-html",
    "dep:tree-sitter-css",
    "dep:tree-sitter-toml-ng",
    "dep:tree-sitter-yaml",
    "dep:tree-sitter-sequel",
    "dep:tree-sitter-md",
]
image = ["dep:image", "dep:base64"]
qrcode = ["dep:qrcode"]
sysinfo = ["dep:sysinfo"]
diff = ["dep:similar"]
clipboard = ["dep:arboard"]
hot-reload = ["dep:notify"]
http = ["dep:reqwest"]

# Examples with required features
[[example]]
name = "slideshow"
required-features = ["markdown"]

[dependencies.tokio]
version = "1"
features = ["rt-multi-thread", "macros", "time", "sync"]
optional = true

# Optimize for runtime speed (default release profile)
[profile.release]
strip = true              # Remove debug symbols
lto = true                  # Link-time optimization
codegen-units = 1         # Better optimization at cost of compile time
opt-level = 3              # Optimize for speed (was "z" for size)
panic = "abort"            # Reduce binary size

# Profile for size optimization (use with: cargo build --profile release-min-size)
[profile.release-min-size]
inherits = "release"
opt-level = "z"            # Optimize for size
strip = true

# Maintain debug info for profiling
[profile.release-debug]
inherits = "release"
debug = true
strip = false
