(sigil deps semver)
(sigil deps semver) - Semantic Versioning
Parses semver version strings and resolves version range constraints against lists of available versions (from git tags).
Range syntax (Cargo-style for pre-1.0): "^0.9.0" → >=0.9.0, <0.10.0 (caret = minor-compatible) "^1.2.3" → >=1.2.3, <2.0.0 (caret = major-compatible for >=1.0) "~0.9.0" → >=0.9.0, <0.9.1 (tilde = patch only) "~1.2.3" → >=1.2.3, <1.3.0 (tilde = minor-compatible for >=1.0) "0.9.0" → =0.9.0 (exact match) "*" → any version
Exports
parse-semverprocedureParse a semver string into a list of three integers. Returns (major minor patch) or #f if invalid. Handles optional "v" prefix: "v1.2.3" → (1 2 3)
parse-version-rangeprocedureParse a version range string into a range record. Returns (min-version . max-version) where both are semver lists, or 'any for wildcard, or #f if invalid. min is inclusive, max is exclusive.
version-in-range?procedureCheck if a version satisfies a range.
tag->versionprocedureStrip "v" prefix from a tag to get a version string.
version->tagprocedureAdd "v" prefix to a version string.
resolve-versionprocedureResolve a version range against a list of git tags. Returns the tag string for the highest matching version, or #f if no match found.
resolve-latest-versionprocedureFind the highest semver version from a list of git tags. Returns the tag string for the highest version, or #f if none valid.
bump-version-rangeprocedureBump a version range string to target a new version. Preserves the range operator (^, ~, or exact). Examples: (bump-version-range "^0.8.0" "0.9.1") → "^0.9.1" (bump-version-range "~1.2.0" "1.3.5") → "~1.3.5" (bump-version-range "0.8.0" "0.9.1") → "0.9.1" (bump-version-range "" "0.9.1") → ""
ranges-compatible?procedureCheck if two version ranges can be satisfied by a single version. Returns #t if compatible, #f if conflicting.
check-version-conflictprocedureCheck if two resolved versions for the same package conflict. Returns #f if they're the same, or a conflict description string.