sigildocs

(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) "^0.13" → >=0.13.0, <0.14.0 (caret on 2-part = caret on .0) "^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) ">=0.10" → >=0.10.0 (open-ended lower bound) "<1.0" → <1.0.0 (open-ended upper bound, min = 0.0.0) ">=0.10, <1.0" (compound range, comma-separated) "*" → any version

Exports

parse-semverprocedure

Parse 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). Two-part input is accepted and patch is defaulted to 0: "0.13" → (0 13 0). One-part "1" → (1 0 0). This relaxation supports sigil: field values like "^0.13".

Parse 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. Compound ranges separated by commas (>=0.10, <1.0) are intersected to a single interval.

Check if a version satisfies a range.

tag->versionprocedure

Strip "v" prefix from a tag to get a version string.

version->tagprocedure

Add "v" prefix to a version string.

Resolve a version range against a list of git tags. Returns the tag string for the highest matching version, or #f if no match found.

Find the highest semver version from a list of git tags. Returns the tag string for the highest version, or #f if none valid.

Bump 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") → ""

Check if two version ranges can be satisfied by a single version. Returns #t if compatible, #f if conflicting.

Check whether two range strings have any overlapping versions. Convenience wrapper around ranges-compatible? that takes range strings (not parsed records). Returns #t when the ranges share at least one valid version, #f otherwise. Returns #f if either string fails to parse.

Used by the Sigil-version validation path: a host's sigil: range vs. a dependency's sigil: range — if they don't intersect, the dep doesn't support a Sigil version the host requires.

Check if two resolved versions for the same package conflict. Returns #f if they're the same, or a conflict description string.

Verify that a host's Sigil-version range and a dependency's declared range intersect. Returns #t when they do, raises a clean diagnostic error naming both sides of the conflict otherwise.

Provided but NOT wired into transitive-dep validation yet — Step 2 of the 0.14.0 redesign (t-dc5d) folds in extracted-lib sweeps and tightens validation to fire on transitive deps. This helper is the call site that validation will use.

semver-majorvariable

(No description)

semver-minorvariable

(No description)

semver-patchvariable

(No description)

semver<?variable

(No description)

semver>?variable

(No description)

semver=?variable

(No description)

semver<=?variable

(No description)

semver>=?variable

(No description)