Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
grunt-templated-changelog
Advanced tools
Generates customized changelog file from git logs.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-templated-changelog --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-templated-changelog');
This plugin is inspired by conventional-changelog the goal was to allow custom commit conventions and output formatting.
The bare minimum needed to get task running is to define options as following
chagelog: {
release: {
options: {
version: '0.1.0'
}
}
}
which would prepend generated changelog to your CHANGES.md
by default
# 0.1.0
- Fixing Something somehow `021e25c`
- Another fix `fade3f6`
- Added tweaks and tricks `2ead19e`
- Another commit `6048f34`
- multiline comment `dddc845`
- One line comment with no label `bf4394b`
Task grabs Git log records since the most recent tag or first commit if no tags were made yet. Format and content can be heavily customized by passing different options.
Simple use not requirung any commit format conventions
chagelog: {
release: {
options: {
version: '0.1.0'
}
}
}
Compact changelog including only maeningfull commits. Assuming you add label(target)
marker at the beginning of commit message and separate subject from commit body with empty line
chagelog: {
release: {
options: {
version: '0.1.0',
labels: ['feature', 'bugfix'],
template: 'labeled'
}
}
}
If you have many people using your code and want to expose maximum of information try this
chagelog: {
release: {
options: {
version: '0.1.0',
labels: ['feature', 'bugfix'],
template: 'grouped'
}
}
}
And you always can use your own format convention and handle it with custom options.matchers
and optoins.template
.
Type: String
Default value: next
A string value defining the version headline
Type: String
Default value: CHANGES.md
Path to the changelog file
Type: Boolean
Default value: true
Tells either generated log should be written to the file. You may set it to false
or run the task with --no-write
to preview the content.
Type: String
Default value: null
Requires the task to be ran in specific branch if needed.
Type: String[]
Default value: []
Tells the task to only grab commits with specific labels and list them in corresponding order. This helps to keep only meaningful information in the changelog. By default Commits are labeled by adding label[target]
string at the beginning of the commit message. conventional-changelog makes a good suggestion on label names to be used
feat
A new featurefix
A bug fixdocs
Documentation only changesstyle
Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)refactor
A code change that neither fixes a bug or adds a featuretest
Adding missing testschore
Changes to the build process or auxiliary tools and libraries such as documentation
generationThis list is just illustratin approach, it's up to you how to label commits.
target
should point you to the component changes relates to.
Commit marker can be omited or customized with options.matchers
Type: String|Object
Default value: simple
There is few predefined templates you can refer by name simple
, labeled
, grouped
. They are different by how much information they render.
simple
template
# next
- Fixing Something somehow `021e25c`
- Another fix `fade3f6`
- Added tweaks and tricks `2ead19e`
- Another commit `6048f34`
- multiline comment `dddc845`
- One line comment with no label `bf4394b`
labeled
template
# next
- `bugfix` Fixing Something somehow `021e25c`
- `bugfix` Another fix `fade3f6`
- `feature` Added tweaks and tricks `2ead19e`
- `refactor` multiline comment `dddc845`
- `style` Another commit `6048f34`
- One line comment with no label `bf4394b`
grouped
template
# next
## feature
### Something
- Added tweaks and tricks `2ead19e`
## bugfix
### Component
- Another fix `fade3f6`
### Something
- Fixing Something somehow `021e25c`
## style
### Component
- Another commit `6048f34`
## Breaking changes
- breaks the build
- causes headaches
Use `options.b` instead of `options.a`
Also you can use custom template by setting options.template
to file path relative to Gruntfile
.
In case you want to pass more data to the template or change existing you can do following:
template: {
file: 'path/to/file',
data: {
var1: value,
var2: value
}
}
or
template: {
file: 'path/to/file',
data: function(data) {
data.var1 = value;
data.var2 = value;
return data;
}
}
Type: String
Default value: {}
Use this option if you need to grab bits of data from commit message. Lets say you have following in commits @marker:value
. To make commit.marker
available in templates you need
matchers: {
marker: /@marker:(\w+)/
}
first memorized group in RegExp is becoming a value. For more advannced logic you can use function values
matchers: {
marker: function(body) {
return body.match(/@marker:(\w+)/)[1];
}
}
There some some predefine matchers which you can override if needed: subject
, label
, target
, breaking_changes
.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
See CHANGES.md
0.1.1
bugfix
fix subject parsing for one line commits 82adc9b
chore
Read release version from package.json
d6c551e
chore
npm package meta updated 81a9b63
FAQs
Generates customized changelog file from git logs.
The npm package grunt-templated-changelog receives a total of 1 weekly downloads. As such, grunt-templated-changelog popularity was classified as not popular.
We found that grunt-templated-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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.