-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
117 lines (105 loc) · 2.34 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = function(grunt) {
'use strict';
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
sync: {
all: {
options: {
sync: ['author', 'name', 'version',
'private', 'license', 'keywords', 'homepage'],
}
}
},
xplain: {
options: {
framework: 'jasmine'
},
api: {
options: {
output: 'docs/use.md',
framework: 'jasmine'
},
src: ['test/unit-tests.js']
}
},
toc: {
api: {
options: {
heading: '* **API**\n'
},
files: {
'./docs/use-toc.md': './docs/use.md'
}
}
},
readme: {
options: {
readme: './docs/README.tmpl.md',
docs: '.',
templates: './docs'
}
},
mochaTest: {
unminified: {
options: {
reporter: 'spec'
},
src: ['test/check-more-types-spec.js']
},
minified: {
options: {
reporter: 'spec'
},
src: ['test/check-more-types-minified-spec.js']
},
syntheticBrowser: {
src: ['test/synthetic-browser-spec.js']
}
},
gt: {
unminified: {
options: {
cover: 'cover',
bdd: true
},
src: ['test/unit-tests.js']
},
minified: {
options: {
cover: 'min-cover',
bdd: true
},
src: ['test/check-more-types-minified-spec.js']
}
},
uglify: {
options: {
maxLineLen: 1000,
banner: '/*! <%= pkg.name %> - v{{ include-version }}\n' +
' homepage: <%= pkg.homepage %>\n' +
' Copyright @ 2014 Kensho license: <%= pkg.license %> */\n\n'
},
minified: {
files: {
'dist/check-more-types.min.js': ['dist/check-more-types.js']
}
}
},
watch: {
options: {
atBegin: true
},
all: {
files: ['*.js', 'test/*.js', 'package.json'],
tasks: ['test']
}
}
});
var plugins = require('matchdep').filterDev('grunt-*');
plugins.forEach(grunt.loadNpmTasks);
grunt.registerTask('test', ['gt']);
grunt.registerTask('doc', ['xplain', 'toc', 'readme']);
grunt.registerTask('default',
['nice-package', 'deps-ok', 'sync', 'uglify', 'doc']);
};