-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Chore: improve auto changelog configuration
Resolved #434
- Loading branch information
Showing
6 changed files
with
122 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"output": "CHANGELOG.md", | ||
"template": ".auto-changelog/template.hbs", | ||
"handlebarsSetup": ".auto-changelog/setup.js", | ||
"sortCommits": "relevance", | ||
"package": true, | ||
"unreleased": true, | ||
"commitLimit": false, | ||
"unreleasedOnly": true, | ||
"replaceText": { | ||
"#(\\d+)": "[#$1](https://github.com/hugo-fixit/FixIt/issues/$1)", | ||
"^(Feat|feat):": ":sparkles: Feat:", | ||
"^(Fix|fix):": ":bug: Fix:", | ||
"^(Build|build):": ":hammer: Build:", | ||
"^(Refactor|refactor):": ":recycle: Refactor:", | ||
"^(Style|style):": ":lipstick: Style:", | ||
"^(Perf|perf):": ":zap: Perf:", | ||
"^(Test|test):": ":white_check_mark: Test:", | ||
"^(Docs|docs):": ":memo: Docs:", | ||
"^(Chore|chore):": ":wrench: Chore:" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Custom Handlebars helpers | ||
module.exports = function (Handlebars) { | ||
/** | ||
* Handlebars helper to replace a string with another string | ||
* @param {String} context the string to replace | ||
* @param {Object} options | ||
* @param {String} options.hash.from the string to replace | ||
* @param {String} options.hash.to the string to replace with | ||
* @example {{replace "foo bar" from="foo" to="baz"}} => "baz bar" | ||
*/ | ||
Handlebars.registerHelper('replace', function (context, options) { | ||
return context.replace(options.hash.from, options.hash.to) | ||
}) | ||
/** | ||
* Handlebars helper to convert a name to a GitHub username | ||
* @param {String} context name to convert | ||
* @param {Object} options | ||
* @param {Boolean} [options.hash.linked=true] whether to return a linked username | ||
* @example {{githubUser "Cell"}} => "Lruihao" | ||
*/ | ||
Handlebars.registerHelper('githubUser', function (context, { hash: { linked = true }}) { | ||
const map = { | ||
'Cell': "Lruihao", | ||
} | ||
const username = map[context] || context | ||
if (linked) { | ||
return `[@${username}](https://github.com/${username})` | ||
} | ||
return `@${username}` | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
{{#each releases}} | ||
{{#if href}} | ||
## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}} | ||
{{else}} | ||
## {{title}}{{#if tag}} - {{isoDate}}{{/if}} | ||
{{/if}} | ||
|
||
{{#if summary}} | ||
{{summary}} | ||
{{/if}} | ||
|
||
{{!-- List commits with `Breaking change: ` somewhere in the message --}} | ||
{{#commit-list commits heading='### :boom: Breaking Changes' message='^(Breaking change|BREAKING CHANGE):'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
{{!-- List commits that add new features, but exclude those that have `:sparkles:` in the message --}} | ||
{{#commit-list commits heading='### :tada: New Features' message='(:tada:|Feat:|feat:)' exclude='^:sparkles:'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
{{!-- List commits that enhance existing features, but exclude those that have `:tada:` in the message --}} | ||
{{#commit-list commits heading='### :sparkles: Enhancements' message='(:sparkles:|Feat:|feat:|Perf:|perf:)' exclude='^:tada:'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
{{!-- List commits that bug fixes --}} | ||
{{#commit-list commits heading='### :bug: Bug Fixes' message='(:bug:|Fix:|fix:)'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
{{!-- List commits that improve the documentation --}} | ||
{{#commit-list commits heading='### :memo: Documentation' message='(:memo:|Docs:|docs:)'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
{{!-- List other changes commits --}} | ||
{{#commit-list commits heading='### :wrench: Other Changes' message='(Refactor:|refactor:|Style:|style:|Test:|test:|Chore:|chore:|Build:|build:)'}} | ||
- {{subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}} | ||
{{/commit-list}} | ||
|
||
- **Full Changelog**: {{href}} | ||
|
||
--- | ||
|
||
### Uncategorized | ||
|
||
{{#if merges}} | ||
#### Merged pull requests | ||
|
||
{{#each merges}} | ||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{message}} {{#if href}}[`#{{id}}`]({{href}}){{/if}} | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{#if fixes}} | ||
#### Closed issues | ||
|
||
{{#each fixes}} | ||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}}{{#each fixes}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}{{/each}} | ||
{{/each}} | ||
{{/if}} | ||
|
||
{{/each}} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters