{"_id":"grunt-templated-changelog","_rev":"33-c83eeba446353431f67c94281547f2ac","name":"grunt-templated-changelog","time":{"modified":"2022-06-18T16:07:56.388Z","created":"2014-03-03T02:17:01.193Z","0.1.0":"2014-03-03T02:17:02.189Z","0.1.1":"2014-03-03T03:03:01.171Z","0.1.2":"2014-03-13T19:09:08.650Z","0.1.3":"2014-03-19T16:29:42.039Z"},"description":"Generates customized changelog file from git logs.","readme":"# grunt-templated-changelog\n\n> Generates customized changelog file from git logs.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.2`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-templated-changelog --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-templated-changelog');\n```\n\n## The \"changelog\" task\n\n### Overview\n\nThis plugin is inspired by [conventional-changelog](https://github.com/ajoslin/conventional-changelog) the goal was to allow custom commit conventions and output formatting. \n\nThe bare minimum needed to get task running is to define options as following\n\n```\nchagelog: {\n  release: {\n    options: {\n      version: '0.1.0'\n    }\n  }\r}\n```\n\nwhich would prepend generated changelog to your `CHANGES.md` by default\n\n```\n# 0.1.0\n\n- Fixing Something somehow `021e25c`\n- Another fix `fade3f6`\n- Added tweaks and tricks `2ead19e`\n- Another commit `6048f34`\n- multiline comment `dddc845`\n- One line comment with no label `bf4394b`\n```\n\nTask 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.\n\n### Usage Examples\n\nSimple use not requirung any commit format conventions\n\n```\nchagelog: {\n  release: {\n    options: {\n      version: '0.1.0'\n    }\n  }\r}\n```\n\nCompact 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\n\n```\nchagelog: {\n  release: {\n    options: {\n      version: '0.1.0',\n      labels: ['feature', 'bugfix'],\n      template: 'labeled'\n    }\n  }\r}\n```\n\nIf you have many people using your code and want to expose maximum of information try this\n\n```\nchagelog: {\n  release: {\n    options: {\n      version: '0.1.0',\n      labels: ['feature', 'bugfix'],\n      template: 'grouped'\n    }\n  }\r}\n```\n\nAnd you always can use your own format convention and handle it with custom `options.matchers` and `optoins.template`.\n\n\n### Options\n\n#### options.version\nType: `String`\nDefault value: `next`\n\nA string value defining the version headline\n\n#### options.changelog\nType: `String`\nDefault value: `CHANGES.md`\n\nPath to the changelog file\n\n#### options.write\nType: `Boolean`\nDefault value: `true`\n\nTells 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.\n\n#### options.branch\nType: `String`\nDefault value: `null`\n\nRequires the task to be ran in specific branch if needed.\n\n#### options.labels\nType: `String[]`\nDefault value: `[]`\n\nTells 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](https://github.com/ajoslin/conventional-changelog) makes a good suggestion on label names to be used\n\n* `feat` A new feature\n* `fix` A bug fix\n* `docs` Documentation only changes\n* `style` Changes that do not affect the meaning of the code (white-space, formatting, missing\n  semi-colons, etc)\n* `refactor` A code change that neither fixes a bug or adds a feature\n* `test` Adding missing tests\n* `chore` Changes to the build process or auxiliary tools and libraries such as documentation\n  generation\n\nThis list is just illustratin approach, it's up to you how to label commits. \n\n`target` should point you to the component changes relates to.\n\nCommit marker can be omited or customized with `options.matchers`\n\n#### options.template\nType: `String|Object`\nDefault value: `simple`\n\nThere is few predefined templates you can refer by name `simple`, `labeled`, `grouped`. They are different by how much information they render. \n\n`simple` template\n\n```\n# next\n\n- Fixing Something somehow `021e25c`\n- Another fix `fade3f6`\n- Added tweaks and tricks `2ead19e`\n- Another commit `6048f34`\n- multiline comment `dddc845`\n- One line comment with no label `bf4394b`\n```\n\n`labeled` template\n\n```\n# next\n\n- `bugfix` Fixing Something somehow `021e25c`\n- `bugfix` Another fix `fade3f6`\n- `feature` Added tweaks and tricks `2ead19e`\n- `refactor` multiline comment `dddc845`\n- `style` Another commit `6048f34`\n- One line comment with no label `bf4394b`\n```\n\n`grouped` template\n\n```\n# next\n\n## feature\n### Something\n- Added tweaks and tricks `2ead19e`\n\n## bugfix\n### Component\n- Another fix `fade3f6`\n\n### Something\n- Fixing Something somehow `021e25c`\n\n## style\n### Component\n- Another commit `6048f34`\n\n\n## Breaking changes\n\n- breaks the build\n- causes headaches\n\nUse `options.b` instead of `options.a`\n```\n\nAlso you can use custom template by setting `options.template` to file path relative to `Gruntfile`.\n\nIn case you want to pass more data to the template or change existing you can do following:\n\n```\ntemplate: {\n  file: 'path/to/file',\n  data: {\n    var1: value,\n    var2: value\r  }\r}\n```\n\nor\n\n```\ntemplate: {\n  file: 'path/to/file',\n  data: function(data) {\n    data.var1 = value;\n    data.var2 = value;\n    return data;\r  }\r}\n```\n\n#### options.matchers\nType: `String`\nDefault value: `{}`\n\nUse 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\n\n```\nmatchers: {\n  marker: /@marker:(\\w+)/\r}\n```\n\nfirst memorized group in RegExp is becoming a value. For more advannced logic you can use function values\n\n```\nmatchers: {\n  marker: function(body) {\n\treturn body.match(/@marker:(\\w+)/)[1];\n  }\r}\n```\n\nThere some some predefine matchers which you can override if needed: `subject`, `label`, `target`, `breaking_changes`.\n\n\n## Contributing\nIn 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](http://gruntjs.com/).\n\n## Release History\nSee `CHANGES.md`\n","maintainers":[{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"}],"versions":{"0.1.1":{"name":"grunt-templated-changelog","description":"Generates customized changelog file from git logs.","version":"0.1.1","homepage":"https://github.com/yavorskiy/grunt-templated-changelog","author":{"name":"Sergii Iavorskyi","email":"yavorskiy.s@gmail.com"},"repository":{"type":"git","url":"https://github.com/yavorskiy/grunt-templated-changelog"},"licenses":[{"type":"MIT","url":"/blob/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"dependencies":{"lodash":"~2.4.0"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2","sinon":"~1.8.2","chai":"~1.9.0","grunt-mocha-test":"~0.9.3"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","grunt","changelog","release notes"],"_id":"grunt-templated-changelog@0.1.1","dist":{"shasum":"5967d0f52e27ab4e3d26c9bdf7d99dbc8abc482b","tarball":"https://registry.npmjs.org/grunt-templated-changelog/-/grunt-templated-changelog-0.1.1.tgz","integrity":"sha512-HWh8ytcwLx6eMS+xTrNJBZywVpl2wMfENyUiiPC6SxE6oHidk3hnh5JzLH7GnlL3lcd0C7YdjL5WyxzzLNvi1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8ujQFXgD7eowJ+7Bt9ugoMlpKOY6/IDyPmZ4hf/JRpAiEAtqLxZ0SCnWFgLtLa/xC32O+itQJXIgv/xN3CHeiCS+g="}]},"_from":"./","_npmVersion":"1.3.14","_npmUser":{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"},"maintainers":[{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"}]},"0.1.2":{"name":"grunt-templated-changelog","description":"Generates customized changelog file from git logs.","version":"0.1.2","homepage":"https://github.com/yavorskiy/grunt-templated-changelog","author":{"name":"Sergii Iavorskyi","email":"yavorskiy.s@gmail.com"},"repository":{"type":"git","url":"https://github.com/yavorskiy/grunt-templated-changelog"},"licenses":[{"type":"MIT","url":"/blob/master/LICENSE-MIT"}],"engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"dependencies":{"lodash":"~2.4.0"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2","sinon":"~1.8.2","chai":"~1.9.0","grunt-mocha-test":"~0.9.3"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","grunt","changelog","release notes"],"_id":"grunt-templated-changelog@0.1.2","dist":{"shasum":"5507eeee9993940502d2f29be3559bd33f3a1a61","tarball":"https://registry.npmjs.org/grunt-templated-changelog/-/grunt-templated-changelog-0.1.2.tgz","integrity":"sha512-sZBq8cv8hWI96JQfhWwwcZMAQgQgUYF7Vaa3j27Hlw81aCXziZF7bujrX5SUSosFOCJJr1mmk60qlPT5HCiDxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqqCX2faSVzeKWnzJUaGWLMMmvsl0eetcO5mKm8aEWiAiA+k2M/Kl7nBlWKsalKkiRd5AcJM+qUVjbcEpVO/10l2w=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"},"maintainers":[{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"}]},"0.1.3":{"name":"grunt-templated-changelog","description":"Generates customized changelog file from git logs.","version":"0.1.3","homepage":"https://github.com/yavorskiy/grunt-templated-changelog","author":{"name":"Sergii Iavorskyi","email":"yavorskiy.s@gmail.com"},"repository":{"type":"git","url":"https://github.com/yavorskiy/grunt-templated-changelog"},"licenses":[{"type":"MIT","url":"/blob/master/LICENSE-MIT"}],"main":"tasks/changelog.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt test"},"dependencies":{"lodash":"~2.4.0"},"devDependencies":{"grunt-contrib-jshint":"~0.6.0","grunt-contrib-clean":"~0.4.0","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.2","sinon":"~1.8.2","chai":"~1.9.0","grunt-mocha-test":"~0.9.3"},"peerDependencies":{"grunt":"~0.4.2"},"keywords":["gruntplugin","grunt","changelog","release notes"],"_id":"grunt-templated-changelog@0.1.3","dist":{"shasum":"f641d92285362519f4404fa890277ca2fc6c17ad","tarball":"https://registry.npmjs.org/grunt-templated-changelog/-/grunt-templated-changelog-0.1.3.tgz","integrity":"sha512-kUQWsNRi+r4RMLQnLrWJQAmL3AGD2yMCQ1FVPcq7Tumgy/HWzsScSbrCAKMmlCz/hrPLIkk9Uc4LVA+NteGlKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPNcNDv0OkoR46f8rSF6TuAX/Hd7dDCLSafjY1NjLwrAiBmpEDE069IaRhifQfmRuP96kMAI9XzdKggAbKumur1hg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"},"maintainers":[{"name":"yavorskiys","email":"yavorskiy.s@gmail.com"}]}},"dist-tags":{"latest":"0.1.3"},"readmeFilename":"README.md","homepage":"https://github.com/yavorskiy/grunt-templated-changelog","keywords":["gruntplugin","grunt","changelog","release notes"],"repository":{"type":"git","url":"https://github.com/yavorskiy/grunt-templated-changelog"},"author":{"name":"Sergii Iavorskyi","email":"yavorskiy.s@gmail.com"}}