# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.85"
name = "opaline"
version = "0.4.0"
authors = ["Stefanie Jane <stef@hyperbliss.tech>"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A token-based theme engine for Rust applications"
homepage = "https://github.com/hyperb1iss/opaline"
readme = "README.md"
keywords = [
    "theme",
    "color",
    "tui",
    "terminal",
    "egui",
]
categories = [
    "command-line-interface",
    "config",
    "gui",
]
license = "MIT"
repository = "https://github.com/hyperb1iss/opaline"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
builtin-themes = []
cli = ["dep:colored"]
crossterm = ["dep:crossterm"]
css = []
default = [
    "builtin-themes",
    "gradients",
    "ratatui",
]
discovery = ["dep:dirs"]
egui = ["dep:egui"]
global-state = ["dep:parking_lot"]
gradients = ["dep:unicode-segmentation"]
owo-colors = ["dep:owo-colors"]
ratatui = ["dep:ratatui-core"]
syntect = ["dep:syntect"]
widgets = [
    "dep:ratatui",
    "dep:crossterm",
    "dep:unicode-width",
    "ratatui",
    "global-state",
    "builtin-themes",
]

[lib]
name = "opaline"
path = "src/lib.rs"

[[example]]
name = "theme-showcase"
path = "examples/theme_showcase.rs"
required-features = [
    "builtin-themes",
    "gradients",
    "ratatui",
]

[[test]]
name = "adapter_tests"
path = "tests/adapter_tests.rs"

[[test]]
name = "builtins_tests"
path = "tests/builtins_tests.rs"

[[test]]
name = "color_tests"
path = "tests/color_tests.rs"

[[test]]
name = "crossterm_tests"
path = "tests/crossterm_tests.rs"

[[test]]
name = "css_tests"
path = "tests/css_tests.rs"

[[test]]
name = "egui_tests"
path = "tests/egui_tests.rs"

[[test]]
name = "gradient_tests"
path = "tests/gradient_tests.rs"

[[test]]
name = "loader_tests"
path = "tests/loader_tests.rs"

[[test]]
name = "owo_colors_tests"
path = "tests/owo_colors_tests.rs"

[[test]]
name = "resolver_tests"
path = "tests/resolver_tests.rs"

[[test]]
name = "style_tests"
path = "tests/style_tests.rs"

[[test]]
name = "syntect_tests"
path = "tests/syntect_tests.rs"

[[test]]
name = "theme_selector_tests"
path = "tests/theme_selector_tests.rs"

[[test]]
name = "theme_tests"
path = "tests/theme_tests.rs"

[dependencies.colored]
version = "3"
optional = true

[dependencies.crossterm]
version = "0.29"
optional = true

[dependencies.dirs]
version = "6"
optional = true

[dependencies.egui]
version = "0.33"
optional = true
default-features = false

[dependencies.owo-colors]
version = "4"
optional = true

[dependencies.parking_lot]
version = "0.12"
optional = true

[dependencies.ratatui]
version = "0.30"
features = ["crossterm"]
optional = true
default-features = false

[dependencies.ratatui-core]
version = "0.1"
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.syntect]
version = "5"
optional = true
default-features = false

[dependencies.thiserror]
version = "2.0"

[dependencies.toml]
version = "0.8"

[dependencies.unicode-segmentation]
version = "1.12"
optional = true

[dependencies.unicode-width]
version = "0.2.2"
optional = true

[dev-dependencies.crossterm]
version = "0.29"

[dev-dependencies.pretty_assertions]
version = "1"

[dev-dependencies.ratatui]
version = "0.30"

[dev-dependencies.serde_json]
version = "1.0.149"

[lints.clippy.all]
level = "deny"
priority = 0

[lints.clippy.as_conversions]
level = "warn"
priority = 22

[lints.clippy.async_yields_async]
level = "warn"
priority = 32

[lints.clippy.cast_possible_truncation]
level = "warn"
priority = 22

[lints.clippy.cast_precision_loss]
level = "warn"
priority = 22

[lints.clippy.cast_sign_loss]
level = "warn"
priority = 22

[lints.clippy.cloned_instead_of_copied]
level = "warn"
priority = 36

[lints.clippy.cognitive_complexity]
level = "warn"
priority = 34

[lints.clippy.dbg_macro]
level = "warn"
priority = 31

[lints.clippy.enum_glob_use]
level = "deny"
priority = 30

[lints.clippy.flat_map_option]
level = "warn"
priority = 36

[lints.clippy.from_iter_instead_of_collect]
level = "warn"
priority = 36

[lints.clippy.future_not_send]
level = "warn"
priority = 32

[lints.clippy.if_not_else]
level = "warn"
priority = 36

[lints.clippy.implicit_clone]
level = "warn"
priority = 33

[lints.clippy.inefficient_to_string]
level = "warn"
priority = 33

[lints.clippy.manual_let_else]
level = "warn"
priority = 36

[lints.clippy.match_same_arms]
level = "warn"
priority = 36

[lints.clippy.missing_errors_doc]
level = "allow"
priority = 20

[lints.clippy.missing_panics_doc]
level = "allow"
priority = 20

[lints.clippy.missing_safety_doc]
level = "allow"
priority = 20

[lints.clippy.module_name_repetitions]
level = "allow"
priority = 21

[lints.clippy.multiple_crate_versions]
level = "allow"
priority = 40

[lints.clippy.must_use_candidate]
level = "allow"
priority = 21

[lints.clippy.needless_continue]
level = "warn"
priority = 36

[lints.clippy.needless_pass_by_value]
level = "warn"
priority = 36

[lints.clippy.out_of_bounds_indexing]
level = "deny"
priority = 30

[lints.clippy.pedantic]
level = "deny"
priority = 10

[lints.clippy.perf]
level = "deny"
priority = 1

[lints.clippy.redundant_else]
level = "warn"
priority = 36

[lints.clippy.result_large_err]
level = "warn"
priority = 35

[lints.clippy.semicolon_if_nothing_returned]
level = "warn"
priority = 36

[lints.clippy.significant_drop_tightening]
level = "allow"
priority = 21

[lints.clippy.string_lit_as_bytes]
level = "warn"
priority = 33

[lints.clippy.style]
level = "warn"
priority = 1

[lints.clippy.todo]
level = "warn"
priority = 31

[lints.clippy.too_many_lines]
level = "warn"
priority = 34

[lints.clippy.trivially_copy_pass_by_ref]
level = "warn"
priority = 36

[lints.clippy.undocumented_unsafe_blocks]
level = "deny"
priority = 30

[lints.clippy.unwrap_used]
level = "deny"
priority = 30

[lints.rust]
unsafe_code = "forbid"

[lints.rust.missing_docs]
level = "allow"
priority = 1

[profile.release]
lto = true
codegen-units = 1
strip = true
