semver-extra 0.1.0

Helper functions for the [semver](https://crates.io/crates/semver) crate, complete with a CLI tool.
Documentation

semver-extra

crates.io

Extras to help when working with versions, built on top of the semver crate, complete with a CLI tool.

CLI

This project also publishes a binary application for use on the command line.

Installation

For now, crates.io is the only place this is being distributed.

cargo install semver-extra

Usage

A Rust implementation of the https://semver.org/ specification

Usage: semver [VERSION] [COMMAND]

Commands:
  increment  [aliases: i]
  get        [aliases: g]
  help       Print this message or the help of the given subcommand(s)

Arguments:
  [VERSION]


Options:
  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Example

Development

Prerequisites

How-to

Create the development shell environment. Necessary to run all other commands.

nix develop

Build with cargo.

just build

Check the code with cargo's built-in fast static analysis.

just check

Remove build files.

just clean

Format the code.

just format

Check the code with clippy for better static analysis.

just lint

Run the application.

just run

Run tests with cargo's built-in test runner.

just test

Watch for code changes and rebuild.

just watch

All just commands can accept additional command line arguments after a --.

For example: run the application with a flag to report the version.

just run -- --version

Tips and Recommendations

Open IDE from Development Shell

To get linking to rust binaries in your IDE, you should open the development shell from your terminal and then open your IDE from that shell session. This will carry over the development shell's environment into your IDE.

For example if you work with VSCode.

cd path/to/this/project
nix develop
code .

By doing this, you can install the rust-analyzer VSCode extension and it will work properly since it will be able to point to the correct rust binaries and libraries. You will also have access in VSCode to any packages installed by the nix flake.

To Do

  • Dockerfile
  • Github Action
  • Support #![no-std]
  • Support prerelease version incrementing
  • Support range operations
  • Rip off other features of node-semver if we find they are actually valuable