Skip to content

Commit

Permalink
feat: use [email protected]
Browse files Browse the repository at this point in the history
BREAKING CHANGE: [email protected] is rewritten and so is this module. No backward compatibility. Checkout the docs for more info.

Closes #43
Closes #50
  • Loading branch information
stevemao committed Jul 20, 2015
1 parent 4c6f3a0 commit c1a6ede
Show file tree
Hide file tree
Showing 11 changed files with 348 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/node_modules/
npm-debug.log
tmp
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ node_js:
- 'iojs'
- '0.12'
- '0.10'
before_script:
- git config --global user.name 'Travis-CI'
- git config --global user.email '[email protected]'
after_script: NODE_ENV=test grunt sendCoverallsInfo
146 changes: 135 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
test: 'tmp',
coverage: 'coverage'
},
jshint: {
options: {
jshintrc: '.jshintrc'
Expand All @@ -22,15 +26,123 @@ module.exports = function(grunt) {
'tasks/*.js'
]
},
copy: {
noDestSingle: {
src: 'test/fixtures/_CHANGELOG.md',
dest: 'tmp/no-dest-single/_CHANGELOG.md'
},
noDestMultiple: {
expand: true,
flatten: true,
src: 'test/fixtures/*.md',
dest: 'tmp/no-dest-multiple/'
}
},
nodeunit: {
tests: ['test/*.js']
},
changelog: {
conventionalChangelog: {
options: {
changelogOpts: {
preset: 'angular'
}
},
append: {
options: {
changelogOpts: {
preset: 'angular',
append: true
}
},
src: 'test/fixtures/_CHANGELOG.md',
dest: 'tmp/append.md'
},
prepend: {
src: 'test/fixtures/_CHANGELOG.md',
dest: 'tmp/prepend.md'
},
allBlocks: {
options: {
changelogOpts: {
preset: 'angular',
allBlocks: true
}
},
src: 'test/fixtures/_CHANGELOG.md',
dest: 'tmp/all-blocks.md'
},
multiFiles: {
expand: true,
flatten: true,
src: 'test/fixtures/*.md',
dest: 'tmp/multiple-files/'
},
multipleSrcToOneDest: {
src: 'test/fixtures/*.md',
dest: 'tmp/multiple-src-to-one-dest.md'
},
noDestSingle: {
src: 'tmp/no-dest-single/_CHANGELOG.md'
},
noDestMultiple: {
src: 'tmp/no-dest-multiple/*.md'
},
noSrcAllBlocks: {
options: {
changelogOpts: {
preset: 'angular',
allBlocks: true
}
},
dest: 'tmp/no-src-all-blocks.md'
},
// This task should fail
// noSrc: {
// dest: 'tmp/no-src.md'
// },
noFiles: {},
release: {
src: 'CHANGELOG.md'
},
},
instrument: {
files: 'tasks/**/*.js',
options: {
lazy: true,
basePath: 'coverage/instrument/'
}
},
reloadTasks : {
rootPath : 'coverage/instrument/tasks'
},
storeCoverage: {
options: {
dir: 'coverage/reports'
}
},
makeReport: {
src: 'coverage/reports/**/*.json',
options: {
type: 'lcov',
dir: 'coverage',
print: 'detail'
}
},
coveralls: {
// Options relevant to all targets
options: {
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
},
all: {
// LCOV coverage file (can be string, glob or array)
src: 'coverage/lcov.info',
options: {
file: 'CHANGELOG.md'
// Any options for just this target
}
}
},
},
bump: {
options: {
Expand All @@ -41,19 +153,31 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-npm');
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-istanbul');
grunt.loadTasks('tasks');

grunt.registerTask('test', ['jshint', 'jscs', 'nodeunit']);
grunt.registerTask('default', ['test']);
grunt.registerTask('lint', ['jshint', 'jscs']);
grunt.registerTask('conventionalChangelog:test', [
'conventionalChangelog:append',
'conventionalChangelog:prepend',
'conventionalChangelog:allBlocks',
'conventionalChangelog:multiFiles',
'conventionalChangelog:multipleSrcToOneDest',
'conventionalChangelog:noDestSingle',
'conventionalChangelog:noDestMultiple',
'conventionalChangelog:noSrcAllBlocks',
// 'conventionalChangelog:noSrc',
'conventionalChangelog:noFiles'
]);
grunt.registerTask('test', ['lint', 'clean:test', 'copy', 'conventionalChangelog:test', 'nodeunit']);
grunt.registerTask('coverage', ['clean', 'instrument', 'reloadTasks', 'copy', 'conventionalChangelog:test', 'storeCoverage', 'makeReport']);
grunt.registerTask('sendCoverallsInfo', ['coverage', 'coveralls', 'clean']);
grunt.registerTask('default', ['lint', 'coverage', 'clean']);
grunt.registerTask('release', 'bump, changelog and publish to npm.', function(type) {
grunt.task.run([
'bump:' + (type || 'patch') + ':bump-only',
'changelog:release',
'conventionalChangelog:release',
'bump-commit',
'npm-publish'
]);
Expand Down
65 changes: 31 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,55 @@
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]

> Generate a changelog using [conventional-changelog](https://github.com/ajoslin/conventional-changelog)
*Issues with the output should be reported on the `conventional-changelog` [issue tracker](https://github.com/ajoslin/conventional-changelog/issues).*

Uses git metadata, based on [these commit conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/).

View [conventional-changelog/CONVENTIONS.md](https://github.com/ajoslin/conventional-changelog/blob/v0.0.17/CONVENTIONS.md) for a synopsis of the conventions with commit examples.


## Example output

- https://github.com/btford/grunt-conventional-changelog/blob/master/CHANGELOG.md
- https://github.com/karma-runner/karma/blob/master/CHANGELOG.md


## Getting Started

If 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:
## Install

```
$ npm install --save-dev grunt-conventional-changelog
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

## Usage

```js
grunt.loadNpmTasks('grunt-conventional-changelog');
```


## Overview

In your project's Gruntfile, add a section named `changelog` to the data object passed into `grunt.initConfig()`.


```js
grunt.initConfig({
changelog: {
conventionalChangelog: {
options: {
// Task-specific options go here.
changelogOpts: {
// conventional-changelog options go here
preset: 'angular'
},
context: {
// context goes here
},
gitRawCommitsOpts: {
// git-raw-commits options go here
},
parserOpts: {
// conventional-commits-parser options go here
},
writerOpts: {
// conventional-changelog-writer options go here
}
},
release: {
src: 'CHANGELOG.md'
}
}
});
```


## Options

Supports all options from [conventional-changelog](https://github.com/ajoslin/conventional-changelog#documentation), with the following additions:
grunt.registerTask('default', ['conventionalChangelog']);
```

### dest

Type: `string` Default: `CHANGELOG.md`.
## API

This is an alias of `options.file`.
See the [conventional-changelog](https://github.com/ajoslin/conventional-changelog) docs.


## Edit your changelog manually
Expand Down Expand Up @@ -102,7 +97,7 @@ grunt.registerTask('publish', ['changelog', 'spawn:changelog', 'release']);

## License

BSD
MIT


[npm-image]: https://badge.fury.io/js/grunt-conventional-changelog.svg
Expand All @@ -111,3 +106,5 @@ BSD
[travis-url]: https://travis-ci.org/btford/grunt-conventional-changelog
[daviddm-image]: https://david-dm.org/btford/grunt-conventional-changelog.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/btford/grunt-conventional-changelog
[coveralls-image]: https://coveralls.io/repos/github/btford/grunt-conventional-changelog/badge.svg
[coveralls-url]: https://coveralls.io/r/btford/grunt-conventional-changelog
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,27 @@
"name": "Vojta Jína"
}
],
"license": "BSD",
"license": "MIT",
"dependencies": {
"conventional-changelog": "0.0.17"
"chalk": "^1.1.0",
"concat-stream": "^1.5.0",
"conventional-changelog": "0.1.0",
"plur": "^2.0.0",
"q": "^1.4.1"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bump": "^0.3.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jshint": "^0.11.1",
"grunt-contrib-nodeunit": "^0.4.1",
"grunt-coveralls": "^1.0.0",
"grunt-istanbul": "^0.6.1",
"grunt-jscs": "^1.8.0",
"grunt-npm": "0.0.2"
"grunt-npm": "0.0.2",
"load-grunt-tasks": "^3.2.0"
},
"files": [
"tasks"
Expand Down
33 changes: 0 additions & 33 deletions tasks/changelog.js

This file was deleted.

Loading

0 comments on commit c1a6ede

Please sign in to comment.