A small CLI tool to create a semantic release and git-cliff powered Changelog

Overview

cliff-jumper

A small CLI tool to create a semantic release and git-cliff powered Changelog

GitHub npm

Support Server

Description

When managing a collection of projects you often want to follow a standard CHANGELOG template for all of them, but you also do not want to have to setup the release flow for every package. This is where cliff-jumper comes in.

How this works

cliff-jumper uses a combination of conventional-recommended-bump and git-cliff to bump your package using semantic versioning (following the Angular preset). It will:

  1. Perform preflight checks to verify that the tool can run
  2. Resolve which bump strategy should be used by using conventional-recommended-bump
    • If the CLI tool is ran inside a mono repo then only commits that affect the nested package will be considered!
  3. Bump the version in your package.json using npm version with the resolved strategy
  4. Validate that -t, --skip-tag (CLI flags) weren't provided or skipTag wasn't set to true in the config file
  5. Update the CHANGELOG.md file using git-cliff
  6. Stage the package.json and CHANGELOG.md files
  7. Commit the release
  8. Tag the release

Installation

You can use the following command to install this package, or replace npm install -D with your package manager of choice.

npm install -D @favware/cliff-jumper

Or install it globally:

npm install -g @favware/cliff-jumper

Then call the script with cliff-jumper or cj:

cliff-jumper --name "my-package" --package-path "." # Add any other flags or use --help
cj --name "my-package" --package-path "." # Add any other flags or use --help

Alternatively you can call the CLI directly with npx:

npx @favware/cliff-jumper --name "my-package" --package-path "." # Add any other flags or use --help

Usage

You can provide all options through CLI flags:

Usage: cliff-jumper [options]

Options:
  -V, --version                           output the version number
  -n, --name <string>                     The package name to release
  -p, --package-path <string>             The path to the current package. For non-monorepos this is just "."
  --dry-run                               Whether the package should be bumped or not. When this is set no actions will be taken and only the release strategy will be logged
  --first-release                         Whether this is the first release (skips bumping the version)
  --mono-repo                             Whether the package to be bumped resides in a mono repo,
                                          which enables Lerna-like scanning for what kind of version bump should be applied
                                          Defaults to "true" when "org" is set, false otherwise
  --no-mono-repo                          Whether the package to be bumped resides in a mono repo,
                                          which enables Lerna-like scanning for what kind of version bump should be applied
                                          Defaults to "true" when "org" is set, false otherwise
  -o, --org <string>                      The NPM org scope that should be used WITHOUT "@" sign or trailing "/"
  --preid [string]                        The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver
  -c, --commit-message-template [string]  A custom commit message template to use.
                                          Defaults to "chore({{name}}): release {{full-name}}@{{new-version}}"
                                          You can use "{{new-version}}" in your template which will be dynamically replaced with whatever the new version is that will be
                                          published.
                                          You can use "{{name}}" in your template, this will be replaced with the name provided through "-n", "--name" or the same value set in
                                          your config file.
                                          You can use "{{full-name}}" in your template, this will be replaced "{{name}}" (when "org" is not provided), or "@{{org}}/{{name}}"
                                          (when "org" is provided).
  --skip-changelog                        Whether to skip updating your CHANGELOG.md
                                          default "true" when CI=true, "false" otherwise (default: false)
  -t, --skip-tag                          Whether to skip creating a git tag
                                          default "true" when CI=true, "false" otherwise (default: false)
  -v, --verbose                           Whether to print verbose information (default: false)
  -h, --help                              display help for command

Or, you can set most of these options through a configuration file. This file should be located at your current working directory (where you're calling this package). It should be named .cliff-jumperrc, optionally suffixed with .json, .yaml, or .yml.

Config file fields

  • --name maps to name
  • --package-path maps to packagePath
  • --dry-run maps to dryRun
  • --first-release maps to firstRelease
  • --mono-repo and --no-mono-repo map to monoRepo
  • --org maps to org
  • --preid maps to preid
  • --commit-message-template maps to commitMessageTemplate
  • --skip-changelog maps to skipChangelog
  • --skip-tag maps to skipTag
  • --verbose maps to verbose

When using .cliff-jumperrc or .cliff-jumperrc.json as your config file you can also use the JSON schema to get schema validation. To do so, add the following to your config file:

{
  "$schema": "https://raw.githubusercontent.com/favware/cliff-jumper/main/assets/cliff-jumper.schema.json"
}

Example JSON file:

{
  "$schema": "https://raw.githubusercontent.com/favware/cliff-jumper/main/assets/cliff-jumper.schema.json",
  "name": "my-package",
  "packagePath": ".",
  "verbose": true
}

Example YAML file:

name: my-package
packagePath: .
verbose: true

Default values

This library has opinionated defaults for its options. These are as follows:

  • --dry-run will default to undefined.
  • --first-release will default to undefined.
  • --org will default to undefined.
  • --preid will default to undefined.
  • --skip-changelog will default to false (true when CI environment variable is 'true').
  • --skip-tag will default to false (true when CI environment variable is 'true').
  • --mono-repo will default to true when org is set, or false when it's not. Alternatively you can force this to false by providing --no-mono-repo.
  • --commit-message-template will default to chore({{name}}): release {{full-name}}@{{new-version}}
    • {{new-version}} will be replaced with the new version that will be published
    • {{name}} will be replaced with the name provided through -n, --name or the same value set in your config file
    • {{full-name}} will be replaced with {{name}} (when org is not provided), or @{{org}}/{{name}} (when org is provided).
  • --verbose will default to false.

Merging of config file, defaults and CLI provided flags

When you have a config file the options in the file are merged with the default options and with any other provided CLI flags. Which source takes highest priority depends on the type of the option. The priority is as follows (lower means it gets lower priority):

  1. CLI flags
  2. Default values
  3. Config file

This means that the CLI flags will always have the highest priority. This way you can have a config file for base options, then overwrite that with CLI flags, such as in a CI environment.

Buy us some doughnuts

Favware projects are and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!

We accept donations through Ko-fi, Paypal, Patreon, GitHub Sponsorships, and various cryptocurrencies. You can use the buttons below to donate through your method of choice.

Donate With Address
Ko-fi Click Here
Patreon Click Here
PayPal Click Here
GitHub Sponsors Click Here
Bitcoin 1E643TNif2MTh75rugepmXuq35Tck4TnE5
Ethereum 0xF653F666903cd8739030D2721bF01095896F5D6E
LiteCoin LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Jeroen Claassens

πŸ’» 🎨 πŸ€” πŸš‡ 🚧 πŸ“¦ πŸ“†

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
Releases(@favware/[email protected])
Owner
Favware
Favware Open Source Projects
Favware
automate your workspace version & publish by using conventional-changelog-commits

Lerna-Lite ?? Lerna-Lite is a super light version of the original Lerna About Lerna-Lite Why create this lib/fork? See it in Action README Badge Insta

Ghislain B. 129 May 8, 2022
A reusable react hook that preserves a components semantic accessibility to create a visual block link.

useAccessibleBlockLink is a reusable react hook that preserves a components semantic accessibility to create a visual block link. This hook supports multiple links within the same block.

Wayfair Tech – Incubator 4 Nov 28, 2022
Grid-tool - Small tool that allows you to integrate a predefined or generated grid into your front-end development environment.

Grid tool Small tool that allows you to integrate a predefined or generated grid into your front-end development environment. Tool installation includ

hmongouachon 2 Jan 4, 2022
Official Semantic UI Integration for Ember

Semantic-UI-Ember This is the official Ember library for the Semantic-UI modules. Support The NodeJS and EmberJS versions respective tags are tested o

Semantic Org 335 Oct 1, 2022
here in this git repo you will get react js basic layout, having in responsive mode.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 3 Feb 23, 2022
A small tool to help you check package duplicates in `yarn.lock`

Yarn Duplicate A small tool to help you check duplicate package and package size in yarn.lock. Usage Change to your project root folder, which have a

Cam Song 14 Aug 11, 2021
βšͺ SVG-Powered component to easily create skeleton loadings.

SVG-Powered component to easily create placeholder loadings (like Facebook's cards loading). Features βš™οΈ Customizable: Feel free to change the colors,

Danilo Woznica 12.7k Jan 4, 2023
Create Sonnat App - Set up a modern web app which is powered by Sonnat.

Create Sonnat App - Set up a modern web app which is powered by Sonnat.

Sonnat 2 Jan 31, 2022
You can use this CLI Tool to clean your iOS and Android projects and keep them updated.

Mobile App Cleaner You can use this CLI Tool to clean your iOS and Android projects and keep them updated. This tool automatizes these items below; Cl

automizer 21 Mar 19, 2022
An interactive CLI automation tool πŸ› οΈ for creating react.js and next.js projects most fast and efficiently. βš›οΈ

An interactive CLI automation tool ??️ for creating react.js and next.js projects most fast and efficiently. βš›οΈ About ℹ️ ReexJs CLI is an interactive

Alexis Guzman 27 Apr 12, 2022
This simple and small react component can check your repository stars and change theme on light/dark

Repository metrics for react This beauty and easy (4KB) react component can help you add metrics to your repositories also you can change component th

Koma Human 2 Jun 25, 2022
A small application to categorize and track your income and expenses.

Expense Tracker App with Typescript A small application to categorize and track your income and expenses. Expense Tracker App Demo Link You can check

Γ–zge Coşkun GΓΌrsucu 22 Jul 1, 2022
A small component based app library composing user interfaces and apps.

See https://vibejs.com for ongoing documentation and info. VibeJS A small component based JavaScript library to build user interfaces and apps. If you

Bret 20 Nov 16, 2022
The JavaScript and API powered WordPress.com

Calypso Calypso is the new WordPress.com front-end – a beautiful redesign of the WordPress dashboard using a single-page web application, powered by t

Automattic 12.2k Dec 30, 2022
A Workspace Web App powered by React and Node Js.

zc_main This is the Zuri Chat frontend built with ExpressJS (Backend) and React (Frontend) Getting Started. Make sure you have nodejs installed by run

Zuri Chat 189 Dec 14, 2022
Chat with an AI that's powered by GPT-j. Talk with it, set parameters, ask questions, and twist words

AI Chat - Open Source | Powered by GPT-j with 6 billion neurons Chat with an AI that's powered by GPT-j. Talk with it, set parameters, ask questions,

Romelianism 3 Dec 29, 2022
An implementation of React v15.x that optimizes for small script size

react-lite Introduction react-lite is an implementation of React that optimizes for small script size. Note: react-lite dose not support React v16.x n

ε·₯业聚 1.7k Dec 10, 2022
Small (0.5 Kb) react hook for getting media breakpoints state info in runtime

tiny-use-media Small (0.5 Kb) react hook for getting media breakpoints state info in runtime Usage npm i tiny-use-media --save Adn in your react code

Valeriy Komlev 51 Dec 13, 2022
FastStore powered by Next.js

A starter powered by FastStore and NextJS Kickoff your store with this boilerplate. This starter ships with the main FastStore configuration files you

VTEX Sites 26 Dec 27, 2022