[package]
name = "tears"
version = "0.8.0"
edition = "2024"
authors = ["Akiomi Kamakura <akiomik@gmail.com>"]
description = "A simple and elegant framework for building TUI applications using The Elm Architecture (TEA)"
documentation = "https://docs.rs/tears"
homepage = "https://github.com/akiomik/tears"
repository = "https://github.com/akiomik/tears"
license = "Apache-2.0"
readme = "README.md"
keywords = ["tui", "tea", "elm-architecture", "ratatui", "framework"]
categories = ["command-line-interface", "asynchronous"]
rust-version = "1.86.0"
exclude = [
    ".github/",
    "scripts/",
    ".gitignore",
    ".*.md",
    "Cargo.lock",
    "clippy.toml",
    "flamegraph*.svg",
    "justfile",
    "tmp*",
    "typos.toml",
]

[features]
default = []

http = ["dashmap", "thiserror"]
ws = ["tokio-tungstenite/connect", "tokio-tungstenite/handshake"]
native-tls = ["tokio-tungstenite?/native-tls"]
rustls = ["dep:rustls", "tokio-tungstenite?/rustls-tls-native-roots"]
rustls-tls-webpki-roots = ["dep:rustls", "tokio-tungstenite?/rustls-tls-webpki-roots"]

[dependencies]
color-eyre = "0.6"
crossterm = { version = "0.29", features = ["serde", "event-stream"] }
dashmap = { version = "6", default-features = false, optional = true }
futures = "0.3"
ratatui = { version = "0.30", features = ["serde", "macros"] }
rustls = { version = "0.23", default-features = false, features = ["ring"], optional = true }
thiserror = { version = "2", default-features = false, optional = true }
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-tungstenite = { version = "0.28", default-features = false, optional = true }
tokio-util = "0.7"

[dev-dependencies]
reqwest = { version = "0.13", features = ["json", "query"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[[example]]
name = "websocket"
required-features = ["ws", "rustls"]

[[example]]
name = "http_todo"
required-features = ["http"]

[lints.clippy]
cargo = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
correctness = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }

# Allow some cargo lints
multiple_crate_versions = "allow"

# Allow some pedantic lints that are too strict for a library
module_name_repetitions = "allow"

# Enforce important correctness lints
unwrap_used = "warn"
expect_used = "allow"
panic = "warn"

# Allow similar names in tests (e.g., id_i32, id_u64)
similar_names = "allow"
