Skip to content

Commit

Permalink
Move both auto-changelog recipes to the /conf directory (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap authored and webpro committed Jan 16, 2020
1 parent da075e6 commit b90831a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
File renamed without changes.
24 changes: 24 additions & 0 deletions conf/keepachangelog.hbs
@@ -0,0 +1,24 @@
# Changelog

{{#each releases}}
{{#if href}}
## [{{title}}]({{href}}){{#if tag}} ({{isoDate}}){{/if}}
{{else}}
## {{title}}{{#if tag}} ({{isoDate}}){{/if}}
{{/if}}

{{#if summary}}
{{summary}}
{{/if}}

{{#each merges}}
- {{message}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}
{{/each}}
{{#each fixes}}
- {{commit.subject}}{{#each fixes}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}{{/each}}
{{/each}}
{{#each commits}}
- {{#if breaking}}**Breaking change:** {{/if}}{{subject}} {{#if href}}[`{{shorthash}}`]({{href}}){{/if}}
{{/each}}

{{/each}}
7 changes: 4 additions & 3 deletions docs/changelog.md
Expand Up @@ -21,16 +21,17 @@ A tool like [auto-changelog](https://github.com/CookPete/auto-changelog) is a gr
```json
{
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template ./changelog.hbs"
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/conf/changelog-compact.hbs"
},
"hooks": {
"after:bump": "npx auto-changelog -p"
}
}
```

With this `git.changelog`, the changelog preview is based on the `changelog.hbs` template file. This would be used for
[GitHub](./github-releases.md) or [GitLab releases](./gitlab-releases.md) as well.
With this `git.changelog`, the changelog preview is based on the `changelog-compact.hbs`
template file. This would be used for [GitHub](./github-releases.md)
or [GitLab releases](./gitlab-releases.md) as well.

Additionally, `hooks.after:bump` will update the `CHANGELOG.md` with each release to get included with the release
commit. This can be omitted if the project does not keep a `CHANGELOG.md` or similar.
Expand Down
21 changes: 18 additions & 3 deletions docs/recipes/auto-changelog.md
Expand Up @@ -18,7 +18,7 @@ Example configuration in the release-it config:
"before:release": "npx auto-changelog -p"
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template ./preview.hbs"
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/conf/changelog-compact.hbs"
}
}
```
Expand Down Expand Up @@ -46,7 +46,7 @@ unreleased tag:
{{/each}}
```

You can also use the template above [changelog-compact-template.hbs](./changelog-compact-template.hbs)
You can also use the template above [changelog-compact.hbs](../../conf/changelog-compact.hbs)
directly from the URL:

```json
Expand All @@ -55,7 +55,22 @@ directly from the URL:
"before:release": "npx auto-changelog -p"
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/docs/recipes/changelog-compact-template.hbs"
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/conf/changelog-compact.hbs"
}
}
```

In case you are not using the `package.json` and you just want to simply
generate `CHANGELOG.md` compatible with [https://keepachangelog.com/](https://keepachangelog.com/)
you can use this example:

```json
{
"hooks": {
"before:release": "npx auto-changelog --commit-limit false https://raw.githubusercontent.com/release-it/release-it/master/conf/keepachangelog.hbs"
},
"git": {
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/conf/changelog-compact.hbs"
}
}
```

0 comments on commit b90831a

Please sign in to comment.