1.3.0 • Published 4 years ago

mr-sv v1.3.0

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
4 years ago

Monorepo SemVer

Simple tool for semantic versioning in monorepository

npm version pipeline status

Idea

Say you have a repo with several projects, each with it's own version. All the projects share same CI pipeline, and you want to generate packages, but don't want to manually update versions.

The tool is intended to:

  • compute version for each component using commit history,
    • get repo commit log
    • convert it to several logs, each corresponding to individual component
    • calculate version
  • invoke build command for each component

It's mostly mimics SemVer functionality considering repository with several projects

Installation

npm install mr-sv

Fresh version is available on npm

Usage

The tool can:

  • create sample config: node mr-sv init
  • process current repository: node mr-sv run

Help is shown using node mr-sv help

Usage in git repository

As with semver, this tool assumes that every commit in history is marked with specific string, used to determine version:

[<vspec>|<pspec>]

where:

  • <vspec> is version specifier: one of specified in mr-sv config
  • <pspec> is project specifier: on of following:
    • project's folder name
    • * to bump version for all projects
    • ** to bump version for all touched projects

Example:

Considering following config:

{
    // ...
    "versionSpecifiers": {
        "major": [
            "new"
        ],
        "minor": [
            "feat"
        ],
        "patch": [
            "fix"
        ],
        "override": [
            "ovr"
        ]
    }
}

Initial version: 1.0.0

mr-sv markertouched filesnew version for project p1
[newp1]p1/a.js2.0.0.0
[featp1]p1/a.js1.1.0.0
[fixp1]p1/a.js1.0.1.0
[fix**]p1/a.js1.0.1.0
[fix*]p2/a.js1.0.1.0
[ovrp1:3.0.0]p1/a.js3.0.0.0
<none given>p1/a.js1.0.0.1
1.3.0

4 years ago

1.2.8

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago