# Feature-Gated TUI Integration Template for Cargo.toml # # Copy this template and customize for your tool to add optional TUI support. # Replace {{TOOL_NAME}} with your tool's cargo crate name (e.g., hello-tui, tracking-tui). # # Features are optional: users can compile without TUI support by omitting the 'tui' feature. # This keeps the core library lightweight while providing full TUI capability for those who need it. [package] name = "{{tool_name_kebab}}" # e.g., tracking-manager version = "0.1.0" edition = "2021" [features] # Default features: no TUI required for core functionality default = [] # TUI feature: includes all dependencies for terminal UI # Enable with: cargo build --features tui # Or in dependent crate: tool-name = { path = "...", features = ["tui"] } tui = ["tools-tui-shared", "ratatui", "crossterm"] # Optional: full feature includes TUI + all advanced features full = ["tui"] [dependencies] # === Core Dependencies (always included) === serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1.40", features = ["full"] } thiserror = "1.0" # === Optional TUI Dependencies (feature-gated) === # Only compiled when 'tui' feature is enabled tools-tui-shared = { path = "../../../shared/rust-tui", optional = true } ratatui = { version = "0.30.0-beta.0", features = ["all-widgets", "underline-color"], optional = true } crossterm = { version = "0.29", optional = true } tui-textarea = { version = "0.7", optional = true } # === Optional Feature-Specific Dependencies === # Uncomment as needed for your tool's TUI features # For forms with text areas # tui-textarea = { version = "0.7", optional = true } # For progress bars and advanced widgets # indicatif = { version = "0.17", optional = true } # For color names in theme builder # csscolorparser = { version = "0.1", optional = true } [dev-dependencies] tempfile = "3.12" [lib] # Your library code path = "src/lib.rs" # Optional TUI library (only built when 'tui' feature is enabled) # If your TUI is in a separate crate within the workspace, create: # crates/{{tool_name}}-tui/ [[bin]] # Optional TUI CLI binary (only built when 'tui' feature is enabled) # name = "{{tool_name}}-tui" # path = "src/bin/tui.rs" # required-features = ["tui"] [profile.release] opt-level = 3 lto = true codegen-units = 1 [profile.dev] opt-level = 0