This repository has been archived by the owner on Feb 28, 2021. It is now read-only.
/
Gruntfile.js
90 lines (81 loc) · 2.3 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsdoc2md: {
oneOutputFile: {
src: ['index.js'],
dest: 'README.md'
}
},
jscs: {
src: ['index.js'],
options: {
config: '.jscs.json'
}
},
simplemocha: {
options: {
ui: 'bdd',
reporter: 'tap'
},
all: {src: ['test/**/*.js']}
},
mocha_istanbul: {
coverage: {
src: 'test',
options: {
mask: '*.js',
coverageFolder: 'coverage',
check: {
statements: 20,
branches: 70,
functions: 10,
lines: 20
}
}
}
},
coveralls: {
options: {
force: false
},
default: {
src: 'coverage/*.info',
options: {
}
}
},
bump: {
options: {
push: true,
pushTo: 'origin',
commitFiles: ['-a']
}
},
shell: {
publish: {
command: 'npm publish'
}
}
});
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-coveralls');
grunt.registerTask('patch', 'patch', function() {
grunt.task.run('bump:patch');
});
grunt.registerTask('commit', 'commit', function() {
grunt.task.run('bump:patch');
});
grunt.registerTask('doc', 'doc', function() {
grunt.task.run('jsdoc2md:oneOutputFile');
});
grunt.registerTask('release', 'Release a new version, push it and publish it', function() {
grunt.task.run('jscs', 'simplemocha:all', 'mocha_istanbul:coverage', 'jsdoc2md:oneOutputFile', 'bump:patch', 'shell:publish');
});
};