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
20pub use anyhow::{Result, anyhow};
21
22/// Get the version of cargo-mate
23pub fn version() -> &'static str {
24 env!("CARGO_PKG_VERSION")
25}
26
27/// Get the package name
28pub fn name() -> &'static str {
29 env!("CARGO_PKG_NAME")
30}
31
32/// Check if cargo-mate is properly installed
33pub fn is_installed() -> bool {
34 std::process::Command::new("cm")
35 .arg("--version")
36 .output()
37 .map(|output| output.status.success())
38 .unwrap_or(false)
39}
40
41#[cfg(test)]
42mod tests {
43 use super::*;
44
45 #[test]
46 fn test_version() {
47 assert!(!version().is_empty());
48 }
49
50 #[test]
51 fn test_name() {
52 assert_eq!(name(), "cargo-mate");
53 }
54}