Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@julianlam/generate-changelog
Advanced tools
You probably want this original repo: https://github.com/lob/generate-changelog
This is a fork of JasonCust/generate-changelog, which contains fixes outlined here: https://github.com/lob/generate-changelog/pull/42
The fork further customizes the plugin by integrating the semver dependency instead of incrementing the version number on its own.
Generate a changelog from git commits. This is meant to be used so that for every patch, minor, or major version, you update the changelog prior to running npm version
so that the git tag contains the commit that updated both the changelog and version.
You can either install it as a dev dependency to be referenced in your npm scripts, or you can install this module globally to be used for all of your repos on your local machine.
$ npm i generate-changelog -D # install it as a dev dependency
# OR
$ npm i generate-changelog -g # install it globally
To use this module, your commit messages have to be in this format:
type(category): description [flags]
Where type
is one of the following:
breaking
build
ci
chore
docs
feat
fix
other
perf
refactor
revert
style
test
Where flags
is an optional comma-separated list of one or more of the following (must be surrounded in square brackets):
breaking
: alters type
to be a breaking changeAnd category
can be anything of your choice. If you use a type not found in the list (but it still follows the same format of the message), it'll be grouped under other
.
You can either run this module as a CLI app that prepends the new logs to a file (recommended):
$ changelog -h
Usage: generate [options]
Generate a changelog from git commits.
Options:
-h, --help output usage information
-V, --version output the version number
-p, --patch create a patch changelog
-m, --minor create a minor changelog
-M, --major create a major changelog
-s, --semver [value] the version value (e.g. v1.2.3)
-t, --tag <range> generate from specific tag or range (e.g. v1.2.3 or v1.2.3..v1.2.4)
-x, --exclude <types> exclude selected commit types (comma separated)
-f, --file [file] file to write to, defaults to ./CHANGELOG.md, use - for stdout
-u, --repo-url [url] specify the repo URL for commit links, defaults to checking the package.json
Or you can write a script that calls the generate
function and does whatever you want with the new logs:
var Changelog = require('generate-changelog');
var Fs = require('fs');
return Changelog.generate({ patch: true, repoUrl: 'https://github.com/lob/generate-changelog' })
.then(function (changelog) {
Fs.writeFileSync('./CHANGELOG.md', changelog);
});
The way that I would recommend using this module would be the way it's being used in this module: as npm scripts. You should install it as a dev dependency and then add the following to the scripts
object in your package.json
:
"release:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags",
"release:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags",
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags",
To use a specific version rather than a generated value, you can use -s VERSION
or --semver VERSION
rather than the major, minor or patch argument switches. For example, using npm's version scripts
object in your package.json
the previous release
scripts could be condensed to:
"version": "changelog -s $npm_package_version && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md"
"postversion": "git push origin && git push origin --tags"
To run the test suite, just clone the repository and run the following:
$ npm i
$ npm test
To contribute, please see the CONTRIBUTING.md file.
This project is released under the MIT license, which can be found in LICENSE.txt
.
FAQs
Generate a changelog from git commits.
The npm package @julianlam/generate-changelog receives a total of 1 weekly downloads. As such, @julianlam/generate-changelog popularity was classified as not popular.
We found that @julianlam/generate-changelog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.