pub_semver: ^2.0.0 copied to clipboard
Versions and version constraints implementing pub's versioning policy. This is very similar to vanilla semver, with a few corner cases.
- Stable null safety release.
- Migrate to null safety.
versionsargument is empty.
- Fix a bug of
VersionRange.unionwhere ranges bounded at infinity would get combined wrongly.
- Update Dart SDK constraint to
- Set max SDK version to
- Fix a bug where there upper bound of a version range with a build identifier could accidentally be rewritten.
Version.firstPreReleasegetter that returns the first possible pre-release of a version.
Version.isFirstPreReleasegetter that returns whether a version is the first possible pre-release.
new VersionRange()with an exclusive maximum now replaces the maximum with its first pre-release version. This matches the existing semantics, where an exclusive maximum would exclude pre-release versions of that maximum.
Explicitly representing this by changing the maximum version ensures that all operations behave correctly with respect to the special pre-release semantics. In particular, it fixes bugs where, for example,
(>=1.0.0 <2.0.0-dev).union(>=2.0.0-dev <2.0.0)and
(>=1.0.0 <3.0.0).difference(^1.0.0)wouldn't include
new VersionRange(), which disables the replacement described above and allows users to create ranges that do include the pre-release versions of an exclusive max version.
- Fix more bugs with
VersionRange.union()involving version ranges with pre-release maximums.
- Fix a bug where constraints that only allowed pre-release versions would be parsed as empty constraints.
- Fix a bug where
VersionRange.intersect()would return incorrect results for pre-release versions with the same base version number as release versions.
- Fix a bug where
VersionRange.difference()would return incorrect results for pre-release versions with the same base version number as release versions.
- Fix a bug where
VersionRange.difference()with a union constraint that covered the entire range would crash.
- Fix a checked-mode error in
- Fix a new strong mode error.
VersionUnionclass public. This was previously used internally to implement
VersionConstraint.union(). Now it's public so you can use it too.
VersionConstraint.difference(). This returns a constraint matching all versions matched by one constraint but not another.
Comparable<VersionRange>. Ranges are ordered first by lower bound, then by upper bound.
- Fix all remaining strong mode warnings.
- Addressed three strong mode warnings.
- Make the package analyze under strong mode and compile with the DDC (Dart Dev
Compiler). Fix two issues with a private subclass of
VersionConstrainthaving different types for overridden methods.
- Allow version ranges like
>=1.2.3-dev.1 <1.2.3to match pre-release versions of
1.2.3. Previously, these didn't match, since the pre-release versions had the same major, minor, and patch numbers as the max; now an exception has been added if they also have the same major, minor, and patch numbers as the min and the min is also a pre-release version.
VersionConstraint.union()method and a
new VersionConstraint.unionOf()constructor. These each return a constraint that matches multiple existing constraints.
VersionConstraint.allowsAll()method, which returns whether one constraint is a superset of another.
VersionConstraint.allowsAny()method, which returns whether one constraint overlaps another.
Add support for the
^operator for compatible versions according to pub's notion of compatibility.
^1.2.3is equivalent to
^0.1.2is equivalent to
Version.nextBreaking, which returns the next version that introduces breaking changes after a given version.
new VersionConstraint.compatibleWith(), which returns a range covering all versions compatible with a given version.
Add a custom
VersionRange.hashCodeto make it properly hashable.
- Initial release.