semver

Provide utilities to represent & manipulate versions and version ranges following the Semantic Versioning 2.0 specifications.

Semantic versioning define a syntax and a semantic to represent version numbers, composed of five VersionPart. Each difference in VersionPart represent a different expectation with regards to the scope of the difference between two versions.

VersionPart.MAJOR can differ in any way and are not considered to be compatible with one another. VersionPart.MINOR do not contain breaking changes but can contain new features, hence newer versions are backward compatible but not forward compatible. VersionPart.PATCH are both forward and backward compatible. VersionPart.PRERELEASE are preview versions of their non-prerelease counterpart, while VersionPart.BUILD are metadata without influence on the version matching.

In addition to the SemVer type to represent versions, a SemVerRange type exists to express version constraints.

For more information about SemVer, rules and practice, see the official website.

Members

Enums

VersionPart
enum VersionPart

The different components of a version number.

Functions

maxSatisfying
SemVer maxSatisfying(SemVer[] semVers, SemVerRange semVerRange)

Return the latest $(D_PSYMBOL Semver) from semVers array that satisfies semVerRange $(D_PSYMBOL SemVerRange).

satisfies
bool satisfies(SemVer semVer, SemVerRange semVerRange)

Check if the $(D_PSYMBOL SemVer) semVer satisfies SemVerRange semVerRange.

Structs

SemVer
struct SemVer

Represent a semantic version number

SemVerRange
struct SemVerRange

Represent a semantic version range [~|~>|^|<|<=|=|>=|>]MAJOR[.MINOR.PATCH].

See Also

Meta

Authors

Dragos Carp