๐ vx-version
Advanced Version Management for the vx Universal Tool Manager
Intelligent version parsing, fetching, and management with semantic version support
๐ฏ Overview
vx-version provides comprehensive version management capabilities for the vx universal tool manager. It handles version parsing, fetching from external sources, semantic version comparison, and constraint resolution across different tool ecosystems.
โจ Features
๐ Version Parsing & Comparison
- Semantic Version Support: Full semver parsing with major.minor.patch support
- Prerelease Handling: Intelligent detection and handling of alpha, beta, rc versions
- Version Comparison: Advanced comparison algorithms for sorting and constraint matching
- Format Flexibility: Support for various version formats (v1.0.0, go1.21.0, etc.)
๐ External Version Fetching
- GitHub Releases: Fetch versions from GitHub releases API
- Node.js Official: Direct integration with Node.js distribution API
- Go Releases: Support for Go version fetching
- Extensible: Easy to add new version sources
๐ฏ Smart Version Management
- LTS Detection: Automatic detection of Long Term Support versions
- Stability Filtering: Filter stable vs prerelease versions
- Version Constraints: Support for version ranges and constraints
- Caching: Intelligent caching of version information
โก Performance & Reliability
- Async-First: Non-blocking operations with concurrent fetching
- Error Handling: Comprehensive error types with recovery suggestions
- Retry Logic: Built-in retry mechanisms for network operations
- Rate Limiting: Respectful API usage with proper rate limiting
๐ Quick Start
Add vx-version to your Cargo.toml:
[]
= "0.2"
Basic Usage
use ;
async
๐ก Advanced Usage
Version Fetching
use ;
// GitHub releases
let uv_fetcher = new;
let uv_versions = uv_fetcher.fetch_versions.await?; // Include prereleases
// Node.js official API
let node_fetcher = new;
let node_versions = node_fetcher.fetch_versions.await?; // Stable only
// Get latest version
let latest_uv = uv_fetcher.get_latest_version.await?;
if let Some = latest_uv
Version Parsing & Comparison
use ;
// Parse semantic versions
let v1 = parse?;
let v2 = parse?;
println!;
println!;
// Compare versions
assert!; // Semantic comparison
// Utility functions
assert!;
assert!;
assert_eq!;
Version Information
use VersionInfo;
let version = new
.with_release_date
.with_download_url
.with_metadata
.with_metadata;
println!; // "18.17.0 (LTS: Hydrogen)"
println!;
println!;
Custom Version Fetchers
use ;
use async_trait;
๐๏ธ Architecture
Core Components
vx-version/
โโโ error.rs # Error types and handling
โโโ fetcher.rs # Version fetching traits and implementations
โโโ info.rs # VersionInfo type and utilities
โโโ manager.rs # Version management and comparison
โโโ parser.rs # Version parsing for different tools
โโโ utils.rs # Utility functions and helpers
Version Sources
| Source | Tool Support | Features |
|---|---|---|
| GitHub Releases | UV, Rust, Go, etc. | Releases API, prerelease detection |
| Node.js Official | Node.js | LTS detection, release metadata |
| Custom APIs | Extensible | Plugin-based architecture |
Version Formats
| Format | Example | Tools |
|---|---|---|
| Semantic | 1.2.3 |
Most tools |
| Prefixed | v1.2.3 |
GitHub releases |
| Tool-specific | go1.21.0 |
Go releases |
| Prerelease | 1.0.0-alpha.1 |
Development versions |
๐งช Testing
# Run all tests
# Run specific test modules
# Run with network tests (requires internet)
# Test with coverage
Test Coverage
- Unit Tests: 95%+ coverage of core functionality
- Integration Tests: Real API testing with mocked responses
- Property Tests: Fuzz testing for version parsing
- Performance Tests: Benchmarks for comparison algorithms
๐ Related Crates
vx-installer- Universal installation enginevx-core- Core functionality and utilitiesvx-cli- Command-line interfacevx-config- Configuration managementvx-plugin- Plugin system and trait definitions
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Intelligent version management for the modern developer