MCPcopy Index your code
hub / github.com/alilleybrinker/semver-explain

github.com/alilleybrinker/semver-explain @v0.2.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.3 ↗ · + Follow
13 symbols 26 edges 1 files 0 documented · 0% updated 2y agov0.2.3 · 2024-01-26★ 337 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

semver-explain

Convert SemVer requirements to their most-obvious equivalents.

semver-explain is a CLI tool to explain Semantic Versioning requirements by converting them to a form with only less-than, greater-than and/or equal-to comparators, where the major, minor, and patch versions are all specified.

The exact interpretation of SemVer requirements' meaning comes from Cargo. In particular, it does not handle hyphen ranges or x-ranges from the node-semver library for JavaScript.

Why?

It's easy to forget the exact meaning of SemVer comparators like ~, ^, and *. Rather than looking up documentation to confirm what's meant by a requirement, you can plug it into semver-explain and get a set of more-obvious equivalent requirements!

Examples

$ semver-explain "^1.4.0"
>=1.4.0, <2.0.0
$ semver-explain "~0.5.3"
>=0.5.3, <0.6.0
$ semver-explain "5.6.*"
>=5.6.0, <5.7.0

Installation

semver-explain is written in Rust, so you'll need to install Rust first.

# To install from Crates.io
$ cargo install semver-explain
# To install from source (after cloning or downloading)
$ cargo install --path "<path to download>"

How to Use

Just give it a SemVer requirement as a string! The CLI is purposefully simple.

semver-explain 0.2.0

USAGE:
    semver-explain <VERSION_REQ>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <VERSION_REQ>    semantic versioning requirement to explain

License

semver-explain is MIT licensed. The full license text can be found in LICENSE.md.

Thanks

This tool uses the excellent Rust semver library, without which it would have been much more tedious to build.

Core symbols most depended-on inside this repo

fail
called by 4
src/main.rs
explain_comparator
called by 1
src/main.rs
explain_exact
called by 1
src/main.rs
explain_greater
called by 1
src/main.rs
explain_greater_eq
called by 1
src/main.rs
explain_less
called by 1
src/main.rs
explain_less_eq
called by 1
src/main.rs
explain_tilde
called by 1
src/main.rs

Shape

Function 12
Class 1

Languages

Rust100%

Modules by API surface

src/main.rs13 symbols

For agents

$ claude mcp add semver-explain \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact