npm.io
2.2.1 • Published 7 months agoCLI

@justia/releaser

Licence
MIT
Version
2.2.1
Deps
10
Size
54 kB
Vulns
0
Weekly
0

@justia/releaser version 2.2.1

A script to generate releases and changelog

General

This project bundles Release It!, @release-it/conventional-changelog, and custom plugins. It exposes a pre-configured JavaScript object that can be overriden as needed depending on the needs of the project.

How?

Install

Into project: npm install -D @justia/releaser

Globally: npm install -g @justia/releaser

Use

If you have this project installed globally you can use the following commands:

Run a release

jReleaser

Run a with calendar versioning

jReleaser --calver=YYYY.MM.MICRO

The format is optional.

Run a with a custom config

You can extend the configuration using the config parameter.

jReleaser --config='{"github":{"release":false}}'

NPM Scripts

To avoid having to install the global package, you can also add npm scripts to your package.json's npm scripts: {} object.

For example:

    "release": "jReleaser"
Use Config Only

If you want to skip using the tool, and instead use release-it as intended, you can do that too.

Add a file called release-it.js to your project root, with the following contents:

'use strict';

const config = require('@justia/releaser');

module.exports = {
   plugins: config.plugins,
   git: config.git,
   gitHub: config.gitHub,
   npm: config.npm,
};

You can configure the above as necessary to suit your project.

You can now run jReleaser commands, passing our config:

jReleaser --config='release-it.js'

Local Dry Run (No Changelog Writes)

Use this when you want to test release flow locally without publishing, tagging, pushing, or writing CHANGELOG.md.

  1. Complete the setup in the repository README, including login/auth steps and running install from repository root (npm install).

  2. From repository root, create a local dry-run config:

cat >/tmp/releaser-dryrun-no-changelog.json <<'JSON'
{"dryRun":true,"ci":true,"git":{"push":false,"tag":false,"requireUpstream":false,"requireCleanWorkingDir":false,"requireCommits":false,"changelog":false},"github":{"release":false},"npm":false,"justia":{"baseBranch":"master","headBranch":"master","useVersionBranch":false}}
JSON
  1. Run with increment type (from repository root):
GITHUB_TOKEN=dry-run-token node packages/releaser/cli/index.js --debug --increment=minor --config="$(cat /tmp/releaser-dryrun-no-changelog.json)"
  1. Run with exact target version (from repository root):
GITHUB_TOKEN=dry-run-token node packages/releaser/cli/index.js --debug --increment=2.14.0 --config="$(cat /tmp/releaser-dryrun-no-changelog.json)"

Notes:

  • dryRun: true prevents release side effects.
  • git.changelog: false disables changelog generation and avoids writing CHANGELOG.md.
  • Use a dummy token locally (GITHUB_TOKEN=dry-run-token).
  • No additional local dependency install is required if root setup was completed.

Publish new version

The first step to publish a new version it's running the commands specified on CONTRIBUTING.md in the Release section. Once the version it's published on NPM by lerna, the new release should be updated on the ga-releaser repository with the next simple steps:

  1. Update the version in the package.json file.
  2. Update the package-lock.json file.
  3. Merge changes to the release branch.
  4. Wait until the GitHub action updates the node_modules inside that branch and the release it's ready.

Once those steps are done, the GitHub action will be reflected and applied for all the projects.

Keywords