Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
conventional-recommended-bump
Advanced tools
Get a recommended version bump based on conventional commits.
The conventional-recommended-bump npm package is a tool that analyzes conventional-style commit messages (like those used by AngularJS) to determine the type of version bump (major, minor, or patch) that should be recommended based on the changes made. It is often used in automated versioning and release workflows to ensure semantic versioning practices are followed.
Determining the type of version bump
This feature allows you to determine whether your next release should be a major, minor, or patch version. The code sample shows how to use the package with the Angular preset to get a recommendation.
const conventionalRecommendedBump = require('conventional-recommended-bump');
conventionalRecommendedBump({
preset: 'angular'
}, (error, recommendation) => {
console.log(recommendation.releaseType);
});
Customizable preset options
This feature allows you to customize the preset options for analyzing commit messages. The code sample demonstrates how to specify a custom header pattern and correspondence for the Angular preset.
const conventionalRecommendedBump = require('conventional-recommended-bump');
conventionalRecommendedBump({
preset: 'angular',
config: {
headerPattern: /^\[(.*)\] (.*)$/,
headerCorrespondence: ['type', 'subject']
}
}, (error, recommendation) => {
console.log(recommendation.releaseType);
});
Using a custom parser
This feature allows you to use a custom parser for commit messages. The code sample shows how to pass custom parser options to the package.
const conventionalRecommendedBump = require('conventional-recommended-bump');
const customParserOpts = require('./custom-parser-opts');
conventionalRecommendedBump({
parserOpts: customParserOpts
}, (error, recommendation) => {
console.log(recommendation.releaseType);
});
semantic-release is an npm package that automates the versioning and package publishing process based on semantic versioning and conventional commit messages. It is more comprehensive than conventional-recommended-bump as it includes the entire release workflow, not just the recommendation for version bumps.
standard-version is an automated versioning tool that adheres to Semantic Versioning and uses conventional commit messages to determine version bumps. It is similar to conventional-recommended-bump but also handles the generation of changelogs and tagging of releases.
release-it is a generic CLI tool for automating versioning and package publishing. It supports conventional commits and can determine version bumps, but it also includes a wide range of release-related tasks, making it more versatile than conventional-recommended-bump.
Get a recommended version bump based on conventional commits.
Got the idea from https://github.com/conventional-changelog/conventional-changelog/pull/29
# pnpm
pnpm add conventional-recommended-bump
# yarn
yarn add conventional-recommended-bump
# npm
npm i conventional-recommended-bump
import { Bumper } from 'conventional-recommended-bump'
const bumper = new Bumper(process.cwd()).loadPreset('angular')
const recommendation = await bumper.bump()
console.log(recommendation.releaseType) // 'major'
new Bumper(cwdOrGitClient: string | ConventionalGitClient = process.cwd())
Create a new Bumper instance. cwdOrGitClient
is the current working directory or a ConventionalGitClient
instance.
bumper.tag(paramsOrTag: GetSemverTagsParams & Params | string): this
Set params to get the last semver tag or set the tag directly.
bumper.commits(params: GetCommitsParams & Params, parserOptions?: ParserStreamOptions): this
Set params to get the commits.
bumper.commits(commits: Iterable<Commit> | AsyncIterable<Commit>): this
Set the commits directly.
bumper.loadPreset(preset: PresetParams): this
Load and set necessary params from a preset.
bumper.bump(whatBump?: (commits: Commit[]) => Promise<BumperRecommendation | null | undefined>): Promise<BumperRecommendation>
Get a recommended version bump based on conventional commits. whatBump
function is required if preset is not loaded.
$ conventional-recommended-bump --help
MIT © Steve Mao
FAQs
Get a recommended version bump based on conventional commits.
The npm package conventional-recommended-bump receives a total of 1,628,804 weekly downloads. As such, conventional-recommended-bump popularity was classified as popular.
We found that conventional-recommended-bump demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.