This repository has been archived by the owner on Aug 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Gruntfile.js
112 lines (98 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
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'nice-package': {
all: {
options: {
blankLine: true
}
}
},
jshint: {
all: [
'src/ng-describe.js'
],
specs: ['test/*-spec.js'],
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-summary')
}
},
jsonlint: {
all: {
src: ['package.json']
}
},
concat: {
dist: {
src: [
'utils/stop-code-coverage.js',
// 3rd party dependencies
'node_modules/es5-shim/es5-shim.js',
'node_modules/check-more-types/check-more-types.js',
'node_modules/lazy-ass/index.js',
'utils/start-code-coverage.js',
// the library itself
'src/ng-describe.js'
],
dest: 'dist/ng-describe.js',
},
},
sync: {
all: {
options: {
sync: ['author', 'name', 'version',
'private', 'license', 'keywords', 'homepage'],
}
}
},
toc: {
api: {
options: {
heading: '\n'
},
files: {
'./docs/toc.md': './README.md'
}
}
},
readme: {
options: {
readme: './docs/README.tmpl.md',
docs: '.',
templates: './docs'
}
},
karma: {
unit: {
configFile: 'test/karma.conf.js'
}
},
watch: {
options: {
atBegin: true
},
all: {
files: ['*.js', 'src/*.js', 'test/*.js', 'package.json'],
tasks: ['jshint', 'concat', 'test']
}
}
});
var plugins = require('matchdep').filterDev('grunt-*');
plugins.forEach(grunt.loadNpmTasks);
grunt.registerTask('test', ['karma']);
grunt.registerTask('modules-used', function () {
var modulesUsed = require('modules-used');
var markdownList = modulesUsed();
var fs = require('fs');
var filename = './docs/modules-used.md';
fs.writeFileSync(filename, markdownList);
grunt.log.writeln('Wrote list of used dependencies into', filename);
});
grunt.registerTask('doc', ['modules-used', 'readme', 'toc', 'readme']);
grunt.registerTask('default', [
'nice-package', 'deps-ok', 'sync', 'jsonlint', 'jshint',
'concat', 'test', 'doc'
]);
};