Chasm.SemanticVersioning
2.1.0
See the version list below for details.
dotnet add package Chasm.SemanticVersioning --version 2.1.0
NuGet\Install-Package Chasm.SemanticVersioning -Version 2.1.0
<PackageReference Include="Chasm.SemanticVersioning" Version="2.1.0" />
paket add Chasm.SemanticVersioning --version 2.1.0
#r "nuget: Chasm.SemanticVersioning, 2.1.0"
// Install Chasm.SemanticVersioning as a Cake Addin #addin nuget:?package=Chasm.SemanticVersioning&version=2.1.0 // Install Chasm.SemanticVersioning as a Cake Tool #tool nuget:?package=Chasm.SemanticVersioning&version=2.1.0
Chasm.SemanticVersioning
You're probably wondering "Why should I use this library instead of any other more popular alternatives?". Well, here's a quick overview...
Focus on functionality and performance. I will make sure to implement any common manipulations with semantic versions, and I will microoptimize the hell out of everything! (not as much as diving into assembly code though) I'll whip up some benchmarks later to show you the difference.
Nice concise naming.
SemanticVersion
,SemverPreRelease
,SemverOptions
. It's a bit inconsistent withSemanticVersion
compared to other types, but calling itSemverVersion
would sound redundant..NET-style documentation. Written in the style of
System
namespace docs. I don't know if it's worth advertising, but I really like how descriptive and consistent it is, so I thought I should mention that.In active development, lots of plans. See the to-do list below.
To-do List
Extra functionality
- Use more efficient formatting (Chasm.Formatting);
- Advanced
SemanticVersion
formatting (M.m.p-rrr+ddd
); -
SemanticVersionBuilder
class; -
BuildMetadataComparer
class; - Advanced
SemverPreRelease
formatting, maybe?; -
SemverPreRelease.ParseMultiple/Many
method; - Option to ignore empty pre-releases/build metadata during parsing;
- Option to allow an older version syntax, like
1.2.3beta5
;
node-semver
version ranges
- Classes
PartialVersion
,VersionRange
,ComparatorSet
,Comparator
; - Primitive version comparators;
- Advanced version comparators;
-
PartialVersion
parsing and formatting; - Parsing of version ranges and its components;
SemanticVersion
SemanticVersion
represents a valid semantic version as per the SemVer 2.0.0 specification.
var a = SemanticVersion.Parse("1.0.0-alpha.8");
var b = SemanticVersion.Parse("=v 1.2-pre ", SemverOptions.Loose);
Console.WriteLine($"{a} < {b} = {a < b}");
// 1.0.0-alpha.8 < 1.2-pre = true
Note that the default comparison doesn't account for build metadata! For build metadata-sensitive comparison, use BuildMetadataComparer
.
var a = SemanticVersion.Parse("1.2.3-4");
var b = SemanticVersion.Parse("1.2.3-4+BUILD");
Console.WriteLine($"{a} == {b} = {a == b}");
// 1.2.3-4 == 1.2.3-4+BUILD = true
var cmp = BuildMetadataComparer.Instance;
Console.WriteLine($"{a} === {b} = {cmp.Equals(a, b)}");
// 1.2.3-4 === 1.2.3-4+BUILD = false
SemverPreRelease
SemverPreRelease
is a pre-release identifier. Can be implicitly created from strings and ints.
var pre = new SemverPreRelease[] { "alpha", 0 };
var version = new SemanticVersion(1, 2, 3, pre);
SemverOptions
SemverOptions
specifies a bunch of different semantic version parsing options.
var options = SemverOptions.AllowVersionPrefix | SemverOptions.AllowInnerWhite
| SemverOptions.OptionalMinor | SemverOptions.RemoveEmptyPreReleases;
var version = SemanticVersion.Parse("v2 -. .alpha.", options);
// Parsed as "2.0.0-alpha"
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 2.1
- Chasm.Collections (>= 2.2.2)
- Chasm.Formatting (>= 2.0.2)
- Chasm.Utilities (>= 2.3.3)
-
.NETStandard 2.1
- Chasm.Collections (>= 2.2.2)
- Chasm.Formatting (>= 2.0.2)
- Chasm.Utilities (>= 2.3.3)
-
net6.0
- Chasm.Collections (>= 2.2.2)
- Chasm.Formatting (>= 2.0.2)
- Chasm.Utilities (>= 2.3.3)
-
net7.0
- Chasm.Collections (>= 2.2.2)
- Chasm.Formatting (>= 2.0.2)
- Chasm.Utilities (>= 2.3.3)
-
net8.0
- Chasm.Collections (>= 2.2.2)
- Chasm.Formatting (>= 2.0.2)
- Chasm.Utilities (>= 2.3.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.8.0 | 96 | 9/23/2024 |
2.7.5 | 129 | 9/15/2024 |
2.7.4 | 109 | 9/14/2024 |
2.7.3 | 125 | 9/14/2024 |
2.7.2 | 141 | 8/25/2024 |
2.7.1 | 131 | 8/22/2024 |
2.7.0 | 129 | 8/19/2024 |
2.6.1 | 69 | 7/30/2024 |
2.6.0 | 81 | 7/30/2024 |
2.5.2 | 100 | 6/12/2024 |
2.5.1 | 106 | 6/10/2024 |
2.4.1 | 114 | 6/8/2024 |
2.4.0 | 110 | 6/7/2024 |
2.3.0 | 157 | 1/23/2024 |
2.2.0 | 169 | 1/3/2024 |
2.1.0 | 138 | 1/3/2024 |
2.0.0 | 128 | 1/2/2024 |