vx_version/
lib.rs

1//! # vx-version
2//!
3//! Version management and parsing utilities for the vx universal tool manager.
4//!
5//! This crate provides comprehensive version management capabilities including:
6//! - Semantic version parsing and comparison
7//! - Version fetching from various sources (GitHub, npm, PyPI, etc.)
8//! - Version constraint resolution
9//! - Tool-specific version parsing
10//!
11//! ## Features
12//!
13//! - **Version Parsing**: Parse and compare semantic versions
14//! - **Version Fetching**: Fetch available versions from external sources
15//! - **Version Constraints**: Support for version ranges and constraints
16//! - **Tool Integration**: Specialized parsers for different tools
17//! - **Async Support**: Async-first design for network operations
18//!
19//! ## Example
20//!
21//! ```rust
22//! use vx_version::{VersionInfo, VersionFetcher, GitHubVersionFetcher};
23//!
24//! #[tokio::main]
25//! async fn main() -> anyhow::Result<()> {
26//!     // Create a version fetcher for a GitHub repository
27//!     let fetcher = GitHubVersionFetcher::new("astral-sh", "uv");
28//!     
29//!     // Fetch available versions
30//!     let versions = fetcher.fetch_versions(false).await?;
31//!     
32//!     // Get the latest version
33//!     if let Some(latest) = versions.first() {
34//!         println!("Latest version: {}", latest.version);
35//!     }
36//!     
37//!     Ok(())
38//! }
39//! ```
40
41pub mod error;
42pub mod fetcher;
43pub mod manager;
44pub mod parser;
45pub mod utils;
46
47// Re-export main types for convenience
48pub use error::{Result, VersionError};
49pub use fetcher::{GitHubVersionFetcher, NodeVersionFetcher, VersionFetcher};
50pub use manager::VersionManager;
51pub use parser::{GitHubVersionParser, GoVersionParser, NodeVersionParser, VersionParser};
52pub use utils::VersionUtils;
53
54// Re-export VersionInfo from vx-plugin to avoid duplication
55pub use vx_plugin::types::VersionInfo;
56
57/// Version of this crate
58pub const VERSION: &str = env!("CARGO_PKG_VERSION");