-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
executable file
·81 lines (73 loc) · 2.1 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
'use strict';
var fs = require( 'fs' );
module.exports = function( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
eslint: {
options: {
fix: true,
ignore: false,
},
target: [
'*.js',
'lib/**/*.js',
'test/**/*.js',
],
},
jsdoc2md: {
README: {
src: [ '*.js', 'lib/**/*.js' ],
dest: "README.md",
options: { template: fs.readFileSync( 'misc/README.hbs', 'utf8' ) },
},
},
replace: {
README: {
src: "README.md",
overwrite: true,
replacements: [
{
from: "$$pkg.version$$",
to: "<%= pkg.version %>",
},
],
},
},
nyc: {
cover: {
options: {
cwd: '.',
exclude: [
'.eslintrc.js',
'Gruntfile.js',
'coverage/**',
'test/**',
],
reporter: [ 'lcov', 'text-summary' ],
reportDir: 'coverage',
all: true,
},
cmd: false,
args: [ 'mocha' ],
},
report: {
options: {
reporter: 'text-summary',
},
},
},
} );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-simple-nyc' );
grunt.registerTask( 'check', [ 'eslint' ] );
grunt.registerTask( 'node', [ 'nyc' ] );
grunt.registerTask( 'test', [
'check',
'node',
'doc',
] );
grunt.loadNpmTasks( 'grunt-jsdoc-to-markdown' );
grunt.loadNpmTasks( 'grunt-text-replace' );
grunt.registerTask( 'doc', [ 'jsdoc2md:README', 'replace:README' ] );
grunt.registerTask( 'default', [ 'check' ] );
};