jayver

Crates.iojayver
lib.rsjayver
version1.0.0
created_at2025-05-18 21:06:52.431604+00
updated_at2025-05-18 21:06:52.431604+00
descriptionA calendar versioning scheme for binaries developed by Emmett Jayhart
homepage
repositoryhttps://github.com/EmmettJayhart/jayver
max_upload_size
id1678919
size108,255
Mansoor 'Emmett' Aljneibi (EmmettJayhart)

documentation

README

JayVer

Crate Docs License CI MSRV

A calendar versioning scheme for binaries developed by Emmett Jayhart, built upon ISO 8601 week dates and CalVer.

JayVer follows the format: YY.WW.PATCH

  • YY: ISO week-numbering year minus 2000 (e.g., 25 for 2025)
  • WW: ISO 8601 week number (1-53)
  • PATCH: Incremental number for patches within same week, starting at 0

Features

  • Version requirements with comparison operators
  • ISO 8601 week date validation
  • Optional serialization support via serde

Usage

use jayver::{Version, VersionReq};

// Parse a version
let version = Version::parse("25.16.3").unwrap();
assert_eq!(version.year, 25);  // Year 2025 (25 + 2000)
assert_eq!(version.week, 16);
assert_eq!(version.patch, 3);

// Create a version for today
let today = Version::today();
println!("Today's version: {today}");

// Compare versions
let v1 = Version::parse("25.10.0").unwrap();
let v2 = Version::parse("25.11.0").unwrap();
assert!(v1 < v2);

// Check version requirements
let req = VersionReq::parse(">=25.10.0").unwrap();
assert!(req.matches(&v1));

// Compatible version requirements
let req = VersionReq::parse("~>25.16.0").unwrap();
let v = Version::parse("25.16.5").unwrap();
assert!(req.matches(&v)); // Same week, any patch

Installation

Add JayVer to your Cargo.toml:

[dependencies]
jayver = "1.0"

# Optional: Enable serde support
jayver = { version = "1.0", features = ["serialization"] }

Changelog

See CHANGELOG.md for more information.

[1.0.0] - 2025-05-18

Added

  • Calendar versioning scheme with YY.WW.PATCH format ISO week-numbering year minus 2000)
  • Version requirements system with comparison operators
  • VersionReq and AnyVersionReq types for version matching and constraints
  • Optional serde serialization support via serialization feature flag
  • Utility methods: today(), increment_patch(), next_week()
  • same_week() method for comparing versions from the same week
  • Top-level convenience functions is_valid() and parse()
  • short_year() and full_year() conversion utilities for year format handling
  • Comprehensive test suite including property-based tests and benchmarks
  • Examples demonstrating various use cases
  • nom parsers for year, week, year_week, patch, and version
  • Chronological comparisons and sorting
  • FromStr implementation for easy string parsing
  • Display implementation for string conversion

Minimum Supported Rust Version

This crate requires Rust 1.67.1 or later.

  • Library MSRV: 1.67.1 (required by time)
  • Development MSRV: 1.80 (required by criterion for running benchmarks)

The minimum supported Rust version may be bumped in minor releases.

License

Copyright 2025 Emmett Jayhart

Licensed under either of

at your option.

Contribution

Feel free to submit an issue and/or a pull request.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 1

cargo fmt