Releases: McSherry/McSherry.SemanticVersioning
v1.4.1
v1.4.0
This minor release adds new features, new targets, and corrections.
Features
-
Custom format strings are now supported (#17)
TheSemanticVersion.ToString
method can now be passed a custom format string that enables free-form formatting, comparable to thatDateTime.ToString
permits. Full details are available in documentation but, for example, the standard format for semantic versions uses the format stringM.m.pRRDD
. -
Semantic versions can now be deconstructed (5396527)
A pair of newSemanticVersion.Deconstruct
methods are added to support deconstruction to tuples, which may add convenience when working with instances in aforeach
loop. -
Parser benchmarking now employed (#16)
The project now includes BenchmarkDotNet runners as part of its standard build process, allowing performance tracking between changes. -
New build and test targets
The project now targets .NET Core 2.1 and 3.1 as part of its standard build process. This reflects the 'end of life' status of .NET Core 1.0 and means that the two current long-term support (LTS) releases of .NET Core are specifically tested. End-of-life targets may eventually be removed.
Deprecations
Following the inclusion of support for custom format strings, the 'prefixed' variants of the standard format strings included in previous releases (link) are now deprecated. At present, use will generate only a warning. In future, this may be upgraded to an error. However, to maintain compatibility, support for them will not be removed in this major version stream.
Bug fixes
-
Redundant wildcard support (#21)
The version ranges supported now include those with redundant wildcards (e.g.1.x.x
vs. just1.x
). These were previously excluded but, asnode-semver
supports them, should have been included. -
Deserialisation support corrections (065d1a3)
A failure to mark an internal member withOptionalFieldAttribute
, which may have prevented cross-version deserialisation, has been corrected. -
Documentation fixes
A number of typos and Markdown mis-formattings in the API documentation have been corrected.
Installation
This update can be installed from NuGet by entering the following into the command-line client:
Install-Package McSherry.SemanticVersioning -Version 1.4.0
v1.3.0
This minor update adds new features and corrections.
Features
-
Advanced version range syntax is now supported (#13)
Support fornode-semver
caret, tilde, hyphen, and X-range operators inVersionRange
is added, allowing more complex comparisons to be done simply. -
Semantic versions can now be parsed greedily (#14)
By passing theParseMode.Greedy
flag, theSemanticVersion
parser can now be configured to attempt to return a valid version at the first error it encounters. This is intended to allow including information after a version string that the caller is able to handle. -
Semantic version parser now exposes
IEnumerator<char>
to callers (fd19275)
This enables a caller to pick up where the parser left off. Used in combination with greedy parsing, it makes the job of the caller in processing anything stored after a version string easier. It would, for example, make converting aSystem.Version
of1.0.0.0
to a semantic version easier than it is currently. -
Version range comparisons are no longer transparently memoized (#10)
TheVersionRange
class now exposes an instanceMemoizationAgent
member, which enables caching the results of comparisons and which is disabled by default. This enables consumers to provide their own caching mechanism without potentially causing unexplained high memory usage.
Bug fixes
- Version range comparisons where one
SemanticVersion
has pre-release identifiers and the other doesn't are now performed correctly (581d44e, 27b6b2a). Prior to this, a comparison would be erroneously performed if the right-hand version had identifiers and the left-hand version didn't.
Installation
This update can be installed from NuGet by entering the following into the command-line client:
Install-Package McSherry.SemanticVersioning -Version 1.3.0
v1.2.1
This minor update allows McSherry.SemanticVersioning to target:
- .NET Framework 4.5
- .NET Framework 4.6
- .NET Standard 1.0
- .NET Core 1.0
There are no other user-relevant changes.
This update can be installed from NuGet by entering the following into the command-line client:
Install-Package McSherry.SemanticVersioning -Version 1.2.1
v1.2.0
Release v1.2.0
is another minor release. The most significant changes introduced are:
- Support for Monotonic Versions (#6)
A new namespace,McSherry.SemanticVersioning.Monotonic
, is added to aid and support
the use of Monotonic Versions. Monotonic Versions are mostly compatible with Semantic
versions, and so having support in one library reduces dependencies. See the pull request
for more information. - Memoization of parsed
SemanticVersion
s is adjusted
Memoization as introduced in the previous release could cause high memory usage in certain
situations. Memoization is now optional, off by default, and can be enabled by providing a
class which implementsIDictionary<string, SemanticVersion>
via a new hook introduced as a
static property (SemanticVersion.MemoizationAgent
).
A minor bug with the NuGet package is also corrected (see #4, thanks @niemyjski).
v1.1.0
Release v1.1.0
is a minor release, and brings the following changes:
SemanticVersion
parsing memoized, now up to 20x faster (b9429a6).
Memoization of the results of parsing is enabled so that parsing the same string again will
avoid going through the parser and will instead pull the result from a cache of previously-parsed
instances.- Support for Version Ranges (#1) introduced.
The library now supports using version ranges for complex comparisons against versions. - The
ParseMode.Lenient
value is defined.
This value is the opposite ofParseMode.Strict
, and makes it nicer for code that wants to
enable all parsing flags without having specific knowledge of each flag.
Release v1.0.0
libSemVer.NET
is in a state where I'd consider it stable and feature-complete enough to be usable, so now is as good a time as any to mark the v1.0.0
release.
So, what is it good for?
libSemVer.NET
is intended to be simple to use and "plug and play." Just add it as a NuGet dependency, import the McSherry.SemanticVersioning
namespace, and get started. Right now, the library does the essentials for you. It can:
- Parse a semantic version from a string, optionally accepting prefixes (i.e.
v1.0.0
instead of1.0.0
) and allowing you to omit the third version component (1.0
instead of1.0.0
). To provide a sane default, these options must be enabled by passing a flag to theParse
orTryParse
methods. - Determine the equivalency of two semantic versions as well as the equality. Sometimes you care about whether versions are exactly equal and sometimes you only care about whether they can be treated as equivalents, so this library can do both.
IEquatable<T>
is implemented, too. - Compare semantic versions. Comparison operators (
>
,<
,>=
,<=
) and interfaces (IComparable<T>
) are implemented so that semantic versions can be compared, ordered, and used in ordered collections. - Determine if two versions are compatible. I thought this would be a pretty common use-case and so a desirable feature, so the library has a method to determine whether one semantic version is backwards-compatible with another.
- Format a semantic version.
IFormattable
is implemented, and this version of the library includes four accepted format strings (really, it's more 2+2: two formats, each with "prefixed" and "unprefixed" variants).
How do I get it?
The source is here, and you can install it via NuGet by running this from the package manager console:
Install-Package McSherry.SemanticVersion
1.0.0 - Release Candidate 1
The first release candidate for v1.0.0
. If nothing is found to be wrong, this will probably be the build that is used for release.