UNPKG

1.9 kBJavaScriptView Raw
1/*global module:false*/
2module.exports = function (grunt) {
3 require('time-grunt')(grunt);
4 grunt.initConfig({
5 pkg: grunt.file.readJSON('package.json'),
6 lineending: {
7 index: {
8 options: {
9 eol: 'lf'
10 },
11 files: {
12 'index.js': 'index.js'
13 }
14 }
15 },
16 jshint: {
17 options: {
18 jshintrc: '.jshintrc',
19 reporter: require('jshint-stylish')
20 },
21 all: {
22 src: [ '*.js' ]
23 }
24 },
25 jsonlint: {
26 all: {
27 src: ['*.json']
28 }
29 },
30 complexity: {
31 all: grunt.file.readJSON('complexity.json')
32 },
33 'nice-package': {
34 all: {
35 options: {
36 blankLine: true
37 }
38 }
39 },
40
41 // TODO fix help, requires grunt-help fix to
42 // work with optimist
43 help: {
44 options: {
45 destination: 'docs/help.md'
46 },
47 all: {}
48 },
49
50 readme: {
51 options: {
52 readme: './docs/README.tmpl.md',
53 docs: '.',
54 templates: './docs'
55 }
56 },
57 /* to bump version, then run grunt (to update readme), then commit
58 grunt release
59 */
60 bump: {
61 options: {
62 commit: true,
63 commitMessage: 'Release v%VERSION%',
64 commitFiles: ['-a'], // '-a' for all files
65 createTag: true,
66 tagName: '%VERSION%',
67 tagMessage: 'Version %VERSION%',
68 push: true,
69 pushTo: 'origin'
70 }
71 }
72 });
73
74 var plugins = require('matchdep').filterDev('grunt-*');
75 plugins.forEach(grunt.loadNpmTasks);
76
77 grunt.registerTask('pre-check', ['deps-ok', 'jsonlint',
78 'jshint', 'jshint-solid',
79 'nice-package', 'complexity']);
80 grunt.registerTask('default', ['pre-check', 'lineending', 'readme']);
81 grunt.registerTask('release', ['bump-only:patch', 'readme', 'bump-commit']);
82};