UNPKG

1.52 kBtext/coffeescriptView Raw
1module.exports = (grunt) ->
2
3 # Project configuration.
4 grunt.initConfig
5 pkgFile: 'package.json'
6
7 'npm-contributors':
8 options:
9 commitMessage: 'chore: update contributors'
10
11 bump:
12 options:
13 commitMessage: 'chore: release v%VERSION%'
14 pushTo: 'origin'
15
16 'auto-release':
17 options:
18 checkTravisBuild: false
19
20 jshint:
21 options:
22 # Expected an assignment or function call and instead saw an expression.
23 '-W030': true,
24 globals:
25 node: true,
26 console: true,
27 module: true,
28 require: true
29 all:
30 src: ['*.js']
31
32 coffeelint:
33 options:
34 no_tabs: {level: 'ignore'}
35 indentation: {level: 'ignore'}
36 dev: ['*.coffee', 'lib/*.coffee', 'test/*.coffee']
37
38 simplemocha:
39 options:
40 ui: 'bdd'
41 reporter: 'spec'
42 all: src: ['test/*.coffee']
43
44 coffee:
45 compile:
46 files:
47 'dist/parse-diff.js': 'parse.coffee'
48
49 grunt.loadNpmTasks 'grunt-contrib-coffee'
50 grunt.loadNpmTasks 'grunt-contrib-jshint'
51 grunt.loadNpmTasks 'grunt-coffeelint'
52 grunt.loadNpmTasks 'grunt-simple-mocha'
53 grunt.loadNpmTasks 'grunt-npm'
54 grunt.loadNpmTasks 'grunt-bump'
55 grunt.loadNpmTasks 'grunt-auto-release'
56
57 grunt.registerTask 'release', 'Bump the version and publish to NPM.',
58 (type) -> grunt.task.run [
59 'npm-contributors',
60 "bump:#{type||'patch'}",
61 'npm-publish'
62 ]
63
64 grunt.registerTask 'lint', ['coffeelint', 'jshint']
65 grunt.registerTask 'build', ['coffee']
66 grunt.registerTask 'test', ['lint', 'simplemocha', 'build']
67 grunt.registerTask 'default', ['test']