pub_semver
Versions and version constraints implementing pub's versioning policy. This is very similar to vanilla semver, with a few corner cases.
2.2.0
9.2M downloads/mo
#42 most downloaded on pub.dev
dart-lang/tools
What this package is like to depend on
Last release 1 years ago
07 Mar 2025
Release timing varies
gaps range from 4 weeks to 1.6 years
Nearly every release is documented
notes for 27 of 28 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
29 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
29 releases · Sep 2014 to Mar 2025Releases
latest 29-
2.2.007 Mar 2025Release notes
Open source →- Remove dependency on
package:meta. - Mark
Versionclass asfinalinstead of with@sealed. - Clarify that the lists returned by
the
preReleaseandbuildproperties ofVersionand therangesproperty ofVersionUnionshould not be modified. - Note that
VersionConstraint.anyandVersionConstraint.emptystatic fields shouldn't be reassigned and will be madefinalin a future release.
- Remove dependency on
-
2.1.511 Dec 2024 -
2.1.404 May 2023 -
2.1.312 Nov 2022Release notes
Open source →- Add type parameters to the signatures of the
Version.preReleaseandVersion.buildfields (List==>List<Object>). #74. - Require Dart 2.17.
- Add type parameters to the signatures of the
-
2.1.214 Oct 2022 -
2.1.107 Mar 2022Release notes
Open source →- Fixed the version parsing pattern to only accept dots between version components.
-
2.1.014 Sep 2021Release notes
Open source →- Added
Version.canonicalizedVersionto help scrub leading zeros and highlight thatVersion.toString()preserves leading zeros. - Annotated
Versionwith@sealedto discourage users from implementing the interface.
- Added
-
2.0.005 Feb 2021Release notes
Open source →- Stable null safety release.
Version.primarynow throwsStateErrorif theversionsargument is empty.
-
2.0.0-nullsafety.024 Nov 2020 pre-releaseNothing published for this version
-
1.4.416 Mar 2020Release notes
Open source →- Fix a bug of
VersionRange.unionwhere ranges bounded at infinity would get combined wrongly.
1.4.3
- Update Dart SDK constraint to
>=2.0.0 <3.0.0. - Update
package:collectionconstraint to^1.0.0.
- Fix a bug of
-
1.4.311 Feb 2020Nothing published for this version
-
1.4.219 Jul 2018 -
1.4.102 May 2018Release notes
Open source →- Fix a bug where there upper bound of a version range with a build identifier could accidentally be rewritten.
-
1.4.002 May 2018Release notes
Open source →-
Add a
Version.firstPreReleasegetter that returns the first possible pre-release of a version. -
Add a
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 include2.0.0-dev. -
Add an
alwaysIncludeMaxPreReleaseparameter tonew 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.
-
-
1.3.713 Apr 2018Release notes
Open source →- Fix more bugs with
VersionRange.intersect(),VersionRange.difference(), andVersionRange.union()involving version ranges with pre-release maximums.
- Fix more bugs with
-
1.3.610 Apr 2018Release notes
Open source →- Fix a bug where constraints that only allowed pre-release versions would be parsed as empty constraints.
-
1.3.505 Apr 2018Release notes
Open source →- 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
-
1.3.403 Apr 2018Release notes
Open source →- Fix a bug where
VersionRange.allowsAll(),VersionRange.allowsAny(), andVersionRange.difference()would return incorrect results for pre-release versions with the same base version number as release versions.
- Fix a bug where
-
1.3.330 Mar 2018Release notes
Open source →- Fix a bug where
VersionRange.difference()with a union constraint that covered the entire range would crash.
- Fix a bug where
-
1.3.221 Nov 2016 -
1.3.116 Nov 2016 -
1.3.008 Jun 2016Release notes
Open source →-
Make the
VersionUnionclass public. This was previously used internally to implementnew VersionConstraint.unionOf()andVersionConstraint.union(). Now it's public so you can use it too. -
Added
VersionConstraint.difference(). This returns a constraint matching all versions matched by one constraint but not another. -
Make
VersionRangeimplementComparable<VersionRange>. Ranges are ordered first by lower bound, then by upper bound.
-
-
1.2.401 Apr 2016 -
1.2.302 Nov 2015 -
1.2.221 Sep 2015Release notes
Open source →- 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.
- Make the package analyze under strong mode and compile with the DDC (Dart Dev
Compiler). Fix two issues with a private subclass of
-
1.2.121 May 2015Release notes
Open source →- Allow version ranges like
>=1.2.3-dev.1 <1.2.3to match pre-release versions of1.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.
- Allow version ranges like
-
1.2.006 May 2015Release notes
Open source →-
Add a
VersionConstraint.union()method and anew VersionConstraint.unionOf()constructor. These each return a constraint that matches multiple existing constraints. -
Add a
VersionConstraint.allowsAll()method, which returns whether one constraint is a superset of another. -
Add a
VersionConstraint.allowsAny()method, which returns whether one constraint overlaps another. -
Versionnow implementsVersionRange.
-
-
1.1.029 Oct 2014Release notes
Open source →-
Add support for the
^operator for compatible versions according to pub's notion of compatibility.^1.2.3is equivalent to>=1.2.3 <2.0.0;^0.1.2is equivalent to>=0.1.2 <0.2.0. -
Add
Version.nextBreaking, which returns the next version that introduces breaking changes after a given version. -
Add
new VersionConstraint.compatibleWith(), which returns a range covering all versions compatible with a given version. -
Add a custom
VersionRange.hashCodeto make it properly hashable.
-
-
1.0.026 Sep 2014