Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
conventional-changelog
Advanced tools
The conventional-changelog npm package automates the generation of changelogs based on commit messages that follow the Conventional Commits specification. This tool is widely used to maintain a clear, readable history of project changes which can be easily communicated to other developers and users.
Generate changelog
This code demonstrates how to generate a changelog using the Angular preset. The changelog will be written to a file named 'CHANGELOG.md'.
const conventionalChangelog = require('conventional-changelog');
const fs = require('fs');
const changelogStream = conventionalChangelog({ preset: 'angular' });
changelogStream.pipe(fs.createWriteStream('CHANGELOG.md'));
Create a release
This code snippet shows how to automatically determine the semantic version bump based on commit messages. It uses the Angular preset to recommend a bump and then uses npm to update the project version accordingly.
const conventionalRecommendedBump = require('conventional-recommended-bump');
const exec = require('child_process').exec;
conventionalRecommendedBump({ preset: 'angular' }, (error, recommendation) => {
exec(`npm version ${recommendation.releaseType}`, (error, stdout, stderr) => {
console.log('Version bumped to', stdout);
});
});
standard-version is a utility for versioning using semver and CHANGELOG generation powered by Conventional Commits. It automates versioning and changelog generation but with a simpler setup compared to conventional-changelog, integrating these steps into a single command.
semantic-release automates the whole package release workflow including determining the next version number, generating the release notes, and publishing the package. This tool provides a more comprehensive solution compared to conventional-changelog by handling the entire release process in a CI/CD environment.
Lerna is a tool for managing JavaScript projects with multiple packages, known as monorepos. While it includes functionality for generating changelogs similar to conventional-changelog, its primary focus is on managing dependencies and publishing multiple packages from the same repository.
Generate a changelog from git metadata
$ npm install conventional-changelog
Adapted from code originally written by @vojtajina and @btford in grunt-conventional-changelog.
Note: As 0.1.x this module is rewritten and so the API is not backward compatible. If you are still using 0.0.x please checkout the README in your downloaded package or dig through the old tags.
var conventionalChangelog = require('conventional-changelog');
conventionalChangelog({
preset: 'angular'
})
.pipe(process.stdout);
Returns a readable stream.
Type: string
Possible values: 'angular'
, 'jquery'
A set of options of a popular project.
Type: string
Default: 'package.json'
The location of your "package.json".
Type: boolean
Default: false
Should the log be appended.
Type: boolean
Default: false
Set to true
if you want to generate all blocks of the log. false
if you just want to generate the current one.
Type: function
Default: function() {}
A warn function. EG: grunt.verbose.writeln
Type: object
Default: through.obj()
A transform stream that applies after the parser and before the writer.
See the conventional-commits-writer docs.
See the git-raw-commits docs.
See the conventional-commits-parser docs.
See the conventional-commits-writer docs.
$ npm install -g conventional-changelog
$ conventional-changelog --help
Generate a changelog from git metadata
Usage
conventional-changelog
Example
conventional-changelog -i CHANGELOG.md --overwrite
Options
-i, --infile Read the CHANGELOG from this file.
-o, --outfile Write the CHANGELOG to this file. If unspecified, it prints to stdout
-w, --overwrite Overwrite the infile
-p, --preset Name of the preset you want to use
-k, --pkg A filepath of where your package.json is located
-a, --append Should the generated block be appended
-b, --all-blocks Generate all blocks
-v, --verbose Verbose output
-c, --context A filepath of a javascript that is used to define template variables
--git-raw-commits-opts A filepath of a javascript that is used to define git-raw-commits options
--parser-opts A filepath of a javascript that is used to define conventional-commits-parser options
--writer-opts A filepath of a javascript that is used to define conventional-commits-writer options
BSD
FAQs
Generate a changelog from git metadata.
We found that conventional-changelog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.