在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:lob/generate-changelog开源软件地址:https://github.com/lob/generate-changelog开源编程语言:JavaScript 100.0%开源软件介绍:Generate ChangelogGenerate 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 InstallationYou 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 UsageTo use this module, your commit messages have to be in this format:
Where
Where
And CLIYou can 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
-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
-a, --allow-unknown allow unknown commit types It's possible to create a generate-changelog 420c945...2a83752 Git tags are supported too: generate-changelog release/3.1.2822...release/3.1.2858 CodeYou can write a script that calls the 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);
}); RecommendedThe 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 "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", GitHub ActionsYou can run this module in a GitHub Actions workflow using the generate-changelog-action Action. TestingTo run the test suite, just clone the repository and run the following: $ npm i
$ npm test ContributingTo contribute, please see the CONTRIBUTING.md file. LicenseThis project is released under the MIT license, which can be found in |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论