Overview
pub_semver is a Dart package that implements versioning and version constraint logic according to Pub's versioning policy. It extends standard semantic versioning (SemVer) with additional rules for pre-release and build metadata, ensuring compatibility with Dart's package ecosystem. The package provides robust parsing, comparison, and constraint evaluation for version strings, making it ideal for managing dependency versions in Flutter and Dart projects. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.
Use cases
- Managing package version constraints
- Validating version compatibility
- Parsing and comparing version strings
- Resolving dependency conflicts
- Automating version checks in CI/CD
- Supporting pre-release and build metadata
Key features
- Pub-specific versioning rules
- Robust version parsing and comparison
- Support for pre-release and build identifiers
- Constraint evaluation with operators like >=, <, ^
- Cross-platform compatibility
- Lightweight and dependency-free
Suitable for
- Dart and Flutter developers
- Package maintainers
- Build and CI/CD systems
- Tools requiring version validation
- Dependency managers
Considerations
- Not fully compatible with generic SemVer libraries
- Requires understanding of Pub's versioning policy
- Limited to Dart ecosystem use cases
- No support for non-Pub version formats
- May need careful handling of pre-release versions