[package]
name = "flux9s"

version = "0.9.0"
edition = "2024"
authors = ["Dan Guns <danbguns@gmail.com>"]
description = "A K9s-inspired terminal UI for monitoring Flux GitOps resources"
license = "Apache-2.0"
repository = "https://github.com/dgunzy/flux9s"
homepage = "https://github.com/dgunzy/flux9s"
documentation = "https://docs.rs/flux9s"
keywords = ["kubernetes", "flux", "gitops", "tui", "k9s"]
categories = ["command-line-utilities", "development-tools"]

# Exclude large files and directories from crate package
exclude = [
    # Documentation site (52MB+ with videos and vendor files)
    "docs/",
    # Test resources
    "test-resources/",
    # CI/CD workflows
    ".github/",
    # Large media files
    "*.mp4",
    "*.mov",
    "*.avi",
    "*.png",
    "*.jpg",
    "*.jpeg",
    "*.gif",
    # Build artifacts
    "target/",
    # IDE files
    ".idea/",
    ".vscode/",
    "*.swp",
    "*.swo",
    # OS files
    ".DS_Store",
    "Thumbs.db",
    # Scripts (not needed for crate)
    "scripts/",
    # Example configs (not needed for crate)
    "examples/",
    # Testing kubeconfig
    "testing-kubeconfig",
    # Review documents
    "PLUGIN_REVIEW.md",
    "PR_REVIEW.md",
    # Developer documentation (not needed for crate users)
    "AGENTS.md",
    "CLAUDE.md",
    # Theme files (examples, not needed)
    "navy.yaml",
    "rose-pine.yaml",
    # Build artifacts
    "*.rlib",
    "manifest.json",
    "Cargo.toml.orig",
    # Backup files
    "*.orig",
]

[features]
default = ["tui"]
# Terminal UI (ratatui + crossterm) — disable for headless library usage
tui = ["dep:ratatui", "dep:crossterm"]
# Vendor OpenSSL for static linking (needed for musl targets)
vendored-openssl = ["openssl/vendored"]

[dependencies]
# Kubernetes client with HTTP proxy support - use openssl-tls for better cert support
kube = { version = "2.0.1", default-features = false, features = [
    "client",
    "runtime",
    "derive",
    "http-proxy",
    "socks5",
    "openssl-tls",
] }
# k8s-openapi version feature - must match kube-rs version
k8s-openapi = { version = "0.26.0", default-features = false, features = [
    "v1_31",
] }

# Async runtime
tokio = { version = "1.48", features = ["full"] }
futures = "0.3"

# TUI framework (optional — enable with "tui" feature)
ratatui = { version = "0.29", optional = true }
crossterm = { version = "0.29", optional = true }

# Error handling
anyhow = "1.0"
thiserror = "1.0"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
async-trait = "0.1"

# Helm release decoding
base64 = "0.22"
flate2 = "1.0"

# Utilities
chrono = { version = "0.4", features = ["serde"] }
url = "2.5"
tempfile = "3.10"
directories = "5.0"
csscolorparser = "0.8"

# CLI argument parsing
clap = { version = "4.5", features = ["derive"] }

# OpenSSL - explicit dependency for vendored feature support
openssl = { version = "0.10", optional = true }

# Logging (tracing is already a transitive dependency via kube-rs, but we need it explicitly for macros)
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "ansi"] }
insta = "1.46.0"

# Version update notifications
update-informer = "1.1"

[dev-dependencies]
# Testing
mockall = "0.13"

[package.metadata.binstall]
# cargo-binstall configuration for pre-built binary installation
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }"
bin-dir = "{ bin }{ binary-ext }"
pkg-fmt = "tgz"

[package.metadata.binstall.overrides.x86_64-unknown-linux-gnu]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-linux-x86_64-gnu.{ archive-format }"

[package.metadata.binstall.overrides.x86_64-unknown-linux-musl]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-linux-x86_64-musl.{ archive-format }"

[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-macos-x86_64.{ archive-format }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-windows-x86_64.{ archive-format }"
pkg-fmt = "zip"

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

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

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

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

[[test]]
name = "snapshot_tests"
path = "tests/snapshot_tests.rs"
required-features = ["tui"]

[[test]]
name = "navigation_tests"
path = "tests/navigation_tests.rs"
required-features = ["tui"]
