Nx plugin for versioning using SemVer and CHANGELOG generation powered by Conventional Commits.
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.
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.
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.
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]
Release multiple projects at once:
nx run workspace:version [...options]
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
- Retrieve the current version of affected
package.json
projects. - Bump versions based on your commits.
- Generates CHANGELOGs based on your commits (uses conventional-changelog-angular under the hood).
- Creates a new commit including your
package.json
files and updated CHANGELOGs. - Creates new tags with the new versions number.
- Push the releases (if enabled).
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 |
--skip-root-changelog |
boolean |
false |
skip generating root CHANGELOG containing all changes (only with sync mode) |
--skip-project-changelog |
boolean |
false |
skip generating project CHANGELOG (only with sync mode) |
--changelog-header |
string |
null |
custom Markdown header for CHANGELOGs |
--origin |
string |
'origin' |
push against git remote repository |
--base-branch |
string |
'main' |
push against git base branch |
--version |
string |
null |
specify the level of change |
--preid |
string |
null |
prerelease identifier |
For new features or breaking changes see the changelog.
This project follows the all-contributors specification.
Younes Jaaidi ๐ ๐ป ๐ ๐ก ๐ค |
Edouard Bozon ๐ ๐ป ๐ ๐ก ๐ค |
Gleb Mikheev ๐ค |
Richard Lea ๐ป |
Katona ๐ ๐ป |
ntziolis ๐ |
RicardoJBarrios ๐ป ๐ค |
This project is MIT licensed.