Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move both auto-changelog recipes to the /conf directory #587

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
24 changes: 24 additions & 0 deletions conf/keepachangelog.hbs
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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"
}
}
```