Do not follow this link

~eidolon/meager-calver

CalVer implementation for Scala 3
Scala + SBT Version Updates
Move from BigInteger to BigInt
Removed Developer section

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~eidolon/meager-calver
read/write
git@git.sr.ht:~eidolon/meager-calver

You can also use your local clone with git send-email.

#meager-calver

Dependency-free Calendar Versioning (CalVer) implementation for Scala 3.

#Usage

This library is not yet published.

val CalVer: ModuleID =
  "io.meager" %% "calver-v0" % "0.1.0"

#Defining a Version Scheme

CalVer schemes may include date-derived parts and fixed version values, optionally separated by delimiters.

import io.meager.calver.v0.CalVer
import io.meager.calver.v0.InvalidCalVer
import io.meager.calver.v0.CalVerPart.YYYY
import io.meager.calver.v0.CalVerPart.MM
import io.meager.calver.v0.CalVerPart.Patch
import io.meager.calver.v0.CalVerPart.Dot

val patchVersion: Int = 1
val version: Either[InvalidCalVer, CalVer] =
  CalVer.validate(List(YYYY, Dot, MM, Dot, Patch(patchVersion)))

All available parts of a scheme are documented in CalVerPart.

#Rendering a Version Scheme

CalVer schemes must be provided a java.time.LocalDate instance to render. Carrying on from the previous example:

import java.time.LocalDate

val date = LocalDate.of(2022, 12, 11)
version.map(_.render(date)) // Right("2022.12.1")

#Validation Rules

  • Schemes must not be empty.
  • Schemes must not begin with a delimiter.
  • Schemes must not end with a delimiter.
  • Schemes must only include non-negative major/minor/patch versions.
  • Schemes which specify a modifier must adhere to the SemVer definition of pre-release versions.
#SemVer Pre-Release Version Rules
  • Modifiers consist of a series of dot-separated identifiers.
  • Each identifier may contain ASCII alphanumeric characters and hyphens (-).
  • Identifiers must not be empty.
  • Numeric identifiers must not include leading zeroes.

#Contributing

Please review the Meager Contributors Guide.

#License

meager-calver is released under the MIT License.

Do not follow this link