All checks were successful
default / dotnet-default-workflow (push) Successful in 58s
Add a value type wrapping the dot-separated prerelease and build-metadata identifiers, replacing the previous nullable string properties on SemanticVersion. Implements IReadOnlyList<string>, zero-alloc ReadOnlySpan<char> enumeration, Ordinal equality with implicit string conversions, a JSON converter, and ISpanParsable/IParsable parsing validated via IdentifierListFormatInfo. Closes #1
1.8 KiB
1.8 KiB
Changelog
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
1.0.0 - 2026-05-21
Added
- This is the initial release of the library.
Unreleased
Added
SemanticVersionandSemanticVersionRangecan now be used asSystem.Text.Jsondictionary keys. The custom converters overrideReadAsPropertyName/WriteAsPropertyNamesoDictionary<TKey, TValue>round-trips correctly.- New
IdentifierListvalue type for prerelease/build-metadata identifiers.
Changed
- Breaking:
SemanticVersion.PrereleaseandSemanticVersion.Metadataare nowIdentifierListinstead ofstring?. Implicitstringconversions keep most call sites compiling, but the property type change is breaking and requires a recompile. Constructors additionally acceptIdentifierList. SemanticVersion==/Equals/GetHashCodenow ignore build metadata, matching precedence comparison rules.SemanticVersionRangeequality (==,Equals,GetHashCode) is now structural and based on the constraint sets, so ranges that parse to the same comparators compare as equal (previously it was reference-sensitive on the backing array).SemanticVersionComparernow enumerates theIdentifierListsegments directly instead of re-splitting the joined identifier strings.
Fixed
- Reject invalid SemVer identifiers when parsing versions.
- Range exact and non-equal comparators ignore build metadata when matching versions.
- Avoid infinite recursion when formatting ranges in the short npm (
ns) form.