# Changelog

All notable changes to this project will be documented in this file.

{{!--
Introduction
- This template tries to follow conventional commits format https://www.conventionalcommits.org/en/v1.0.0/
- The template uses regex to filter commit types into their own headings (this is more than just fixes and features headings)
- It also uses the replaceText function in config.json to remove the commit type text from the message, because the headers are shown instead.

Commit Types:
- The types feat:, fix:, perf:, refactor:, docs:, test:, style:, chore:, build:, ci:, revert: must be at the beginning of the commit subject with a : at the end (first letter case is ignored)
- They can optionally have a scope set to outline the module or component that is affected eg feat(api):, fix(ui):
- BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
- Emoji can be used with or without the type prefix (eg: :sparkles: feat: xxx, :sparkles: xxx, ✨ feat: xxx, ✨ xxx)

Example Definitions
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- docs: Adding/updating documentation
- test: Adding missing tests or correcting existing tests
- style: Changes that do not affect the meaning of the code (white-space, formatting, spelling mistakes, missing semi-colons, etc)
- chore: Something like updating a library version, or moving files to be in a better location and updating all file refs
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- revert: Reverts a previous commit

Breaking Change Examples
- feat!: allow provided config object to extend other configs
- feat(api)!: send an email to the customer when a product is shipped
- chore!: drop support for Node 6
- BREAKING CHANGE: environment variables now take precedence over config files

Emoji Format Examples
- :sparkles: feat: xxx / ✨ feat: xxx / :sparkles: xxx / ✨ xxx
- :bug: fix: xxx / 🐛 fix: xxx / :bug: xxx / 🐛 xxx
- :zap: perf: xxx / ⚡ perf: xxx / :zap: xxx / ⚡ xxx
- :recycle: refactor: xxx / ♻️ refactor: xxx / :recycle: xxx / ♻️ xxx
- :memo: docs: xxx / 📝 docs: xxx / :memo: xxx / 📝 xxx
- :white_check_mark: test: xxx / ✅ test: xxx / :white_check_mark: xxx / ✅ xxx
- :art: style: xxx / 🎨 style: xxx / :art: xxx / 🎨 xxx
- :wrench: chore: xxx / 🔧 chore: xxx / :wrench: xxx / 🔧 xxx
- :construction: build: xxx / 🚧 build: xxx / :construction: xxx / 🚧 xxx
- :construction_worker: ci: xxx / 👷 ci: xxx / :construction_worker: xxx / 👷 xxx
- :rewind: revert: xxx / ⏪ revert: xxx / :rewind: xxx / ⏪ xxx
--}}

{{!--
Regex reminders
 ^ = starts with
 \( = ( character (otherwise it is interpreted as a regex lookup group)
 * = zero or more of the previous character
 \s = whitespace
 . = any character except newline
 | = or
 [aA] = character a or character A
 ? = zero or one of the previous character
 + = one or more of the previous character
--}}

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

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

  {{#if merges}}
    ### :twisted_rightwards_arrows: Merged PRs

    {{#each merges}}
      - {{#if commit.breaking}}**Breaking change:** {{/if}}{{capitalize message}} by {{githubUser author}} in {{#if id}}#{{id}}{{/if}}
    {{/each}}

    {{#if fixes}}
    {{else}}
      ---
    {{/if}}
  {{/if}}

  {{#if fixes}}
    ### :heavy_check_mark: Closed Issues

    {{#each fixes}}
      - {{#if commit.breaking}}**Breaking change:** {{/if}}{{capitalize commit.subject}}{{#each fixes}} {{#if id}}#{{id}}{{/if}}{{/each}} by {{githubUser commit.author}}
    {{/each}}

    ---
  {{/if}}

  {{!-- List commits with Breaking Changes or type/type(scope)! formats --}}
  {{#commit-list commits heading='### :warning: Breaking Changes' message='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:' }}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{!-- List commits organized under a heading, but not those already listed in the breaking section --}}
  {{#commit-list commits heading='### :tada: New Features' message='^[fF]eat:|[fF]eat\(|^:sparkles:|^:tada:|^✨|^🎉' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :bug: Bug Fixes' message='^[fF]ix:|^[fF]ix\(|^:bug:|^🐛' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :zap: Performance Improvements' message='^[pP]erf:|^[pP]erf\(|^:zap:|^:rocket:|^⚡|^🚀' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :recycle: Refactoring and Updates' message='^[rR]efactor:|^[rR]efactor\(|^:recycle:|^♻️' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :memo: Documentation Changes' message='^[dD]ocs:|^[dD]ocs\(|^:memo:|^:book:|^📝|^📚' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :white_check_mark: Changes to Test Assets' message='^[tT]est:|^[tT]est\(|^:white_check_mark:|^:test_tube:|^✅|^🧪' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :art: Tidying of Code eg Whitespace' message='^[sS]tyle:|^[sS]tyle\(|^:art:|^🎨' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :wrench: Chores And Housekeeping' message='^[cC]hore:|^[cC]hore\(|^:wrench:|^:hammer:|^🔧|^🔨' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :construction: Build Changes' message='^[bB]uild:|^[bB]uild\(|^:construction:|^🚧' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :construction_worker: Continuous Integration' message='^[cC]i:|^[cC]i\(|^:construction_worker:|^👷' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :rewind: Reverts' message='^[rR]evert|^[rR]evert\(|^:rewind:|^⏪' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#commit-list commits heading='### :sparkles: General Changes' exclude='([bB]reaking( [cC]hange)?|BREAKING CHANGE):|^([a-zA-Z]+)(\([^)]+\))?!:|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[pP]erf:|^[pP]erf\(|^[rR]efactor:|^[rR]efactor\(|^[dD]ocs:|^[dD]ocs\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[cC]hore:|^[cC]hore\(|^[bB]uild:|^[bB]uild\(|^[cC]i:|^[cC]i\(|^[rR]evert|^[rR]evert\(|^:sparkles:|^:tada:|^✨|^🎉|^:bug:|^🐛|^:zap:|^:rocket:|^⚡|^🚀|^:recycle:|^♻️|^:memo:|^:book:|^📝|^📚|^:white_check_mark:|^:test_tube:|^✅|^🧪|^:art:|^🎨|^:wrench:|^:hammer:|^🔧|^🔨|^:construction:|^🚧|^:construction_worker:|^👷|^:rewind:|^⏪'}}
    - {{capitalize subject}} [`{{shorthash}}`]({{href}}) by {{githubUser author}}
  {{/commit-list}}

  {{#if href}}
    **Full Changelog**: {{ href}}
  {{/if}}

{{/each}}
