cargo_mate/lib.rs
1//! # 🚢 Cargo Mate - Source Protected Distribution
2//!
3//! A Rust development companion that enhances cargo with intelligent workflows,
4//! state management, performance optimization, and comprehensive project monitoring.
5//!
6//! ## Features
7//!
8//! - **Journey Recording**: Record and replay complex development workflows
9//! - **Anchor Points**: Save and restore complete project states with auto-update
10//! - **Captain's Log**: Natural language build notes with automatic tagging
11//! - **Tide Charts**: Interactive performance tracking and build analytics
12//! - **Treasure Maps**: Visual dependency tree analysis
13//! - **Mutiny Mode**: Override cargo restrictions when you know what you're doing
14//! - **Auto-Versioning**: Automatic semantic versioning with policy support
15//! - **Build Optimization**: Intelligent Cargo.toml optimization
16//! - **Smart Error Parsing**: Actionable checklists from cargo errors
17//!
18
19
20// Simple error handling without external dependencies
21pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
22
23/// Get the version of cargo-mate
24pub fn version() -> &'static str {
25 env!("CARGO_PKG_VERSION")
26}
27
28/// Get the package name
29pub fn name() -> &'static str {
30 env!("CARGO_PKG_NAME")
31}
32
33/// Check if cargo-mate is properly installed
34pub fn is_installed() -> bool {
35 std::process::Command::new("cm")
36 .arg("--version")
37 .output()
38 .map(|output| output.status.success())
39 .unwrap_or(false)
40}
41
42#[cfg(test)]
43mod tests {
44 use super::*;
45
46 #[test]
47 fn test_version() {
48 assert!(!version().is_empty());
49 }
50
51 #[test]
52 fn test_name() {
53 assert_eq!(name(), "cargo-mate");
54 }
55}