Code Monkey home page Code Monkey logo

semver's Introduction

@jscutlery/semver NPM package @jscutlery/semver coverage status

@jscutlery/semver

Nx plugin for versioning using SemVer and CHANGELOG generation powered by Conventional Commits.

Setup

Install

Without Angular:

npm install -D @jscutlery/semver
nx g @jscutlery/semver:install

or if you are using Angular:

ng add @jscutlery/semver

This package allows you to manage your monorepo using one of two modes: Synced or Independent.

Independent mode (default)

Allow multiple projects to be versioned independently. This way you release only what you want and consumers don't get updates they don't need. This allows small, rapid and incremental adoption of your packages.

Synced mode

Allow multiple projects to be versioned in a synced/locked mode. Use this if you want to automatically tie all package versions together. This mode is useful when you are working with only one product.

One issue with this approach is that a major change in any project will result in all projects having a new major version.

Usage

Release

Independent mode

Release project independently by running:

nx run my-project:version [...options]

You can leverage the built-in affected command to only version changed packages:

nx affected --target version [...options]

Synced mode

Release multiple projects at once:

nx run workspace:version [...options]

Specified Level Change

Release a project with a version that is incremented by a specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease:

nx run workspace:version --version=major
nx run workspace:version --version=minor
nx run workspace:version --version=patch
nx run workspace:version --version=prerelease --preid=alpha
nx run workspace:version --version=prerelease --preid=beta

When run, this command does the following:

  1. Retrieve the current version of affected package.json projects.
  2. Bump versions based on your commits.
  3. Generates CHANGELOGs based on your commits (uses conventional-changelog-angular under the hood).
  4. Creates a new commit including your package.json files and updated CHANGELOGs.
  5. Creates new tags with the new versions number.
  6. Push the releases (if enabled).

Available options:

name type default description
--dry-run boolean false run with dry mode
--no-verify boolean false skip git hooks
--push boolean false push the release
--sync-versions boolean false lock/sync versions between projects
--root-changelog boolean true generate root CHANGELOG containing all changes
--origin string 'origin' push against git remote repository
--base-branch string 'main' push against git base branch
--version string null The level of change
--preid string null Prerelease identifier

Changelog

For new features or breaking changes see the changelog.

Contributors

This project follows the all-contributors specification.


Younes Jaaidi

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค”

Edouard Bozon

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค”

Gleb Mikheev

๐Ÿค”

Richard Lea

๐Ÿ’ป

License

This project is MIT licensed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.