pub_semver
2.2.1, released 3 months ago by tools.dart.dev
Versions and version constraints implementing pub's versioning policy.
WASM-readyRock solid
What it does
Implements parsing, comparison, and constraint checking for semantic version numbers according to pub's specific versioning policy. It handles special pub corner cases like build suffix ordering and pre-release prioritization.
AI-written summary of version 2.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to parse and compare semantic version numbers in Dart
- You are building tools that deal with pub-compatible package version constraints
Skip it when
- You are looking for vanilla semver without pub's specific pre-release and build suffix policies
Strengths
- Matches pub's exact versioning and constraint policy
- Handles complex ranges, unions, and pre-release priority rules
Weaknesses
- Not strictly compliant with vanilla SemVer 2.0.0 in certain corner cases due to pub-specific policies
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:pub_semver/pub_semver.aspx';
void main() {
var version = Version.parse('1.4.2');
print(version.major);
}Works with
Packages commonly used together with pub_semver: ones it builds on, ones built on it, and its own family.
- analyzerBuilt on pub_semverPerforms static analysis of Dart code for tool integration and embedding.
- dart_styleBuilt on pub_semverProvides an API and CLI to format Dart source code automatically.
- pubspec_parseBuilt on pub_semverParse pubspec.yaml files with a type‑safe API and detailed error reporting.
- hooksBuilt on pub_semverDart API for the JSON-based protocol for package build and link hooks.
- objective_cBuilt on pub_semverSupport library for accessing Objective C via ffigen in Flutter
- dwdsBuilt on pub_semverProxies between the Chrome debug protocol and the Dart VM service protocol.
- build_runnerBuilt on pub_semverA build system for Dart code generation and modular compilation.
- source_genBuilt on pub_semverSource code generation builders and utilities for the Dart build system.