forked from tarunc/intercom.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·66 lines (60 loc) · 1.97 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
/*
* Gruntfile.js
*/
'use strict';
// intercom.io uses `[grunt](http://gruntjs.com)` to define and run repetitive tasks
// such as minification, compilation, unit testing, linting, etc.
var path = require('path');
// ## Grunt configuration.
// @export `ConfigureGruntService` a function which configures tasks to be run with
// `grunt`
module.exports = function ConfigureGruntService(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Provide some basic configuration for grunt
grunt.initConfig({
// Read in the package.json to get access to the variables defined in there
pkg: grunt.file.readJSON('package.json'),
// Define the Docker task to generate documentation from our codebase.
docker: {
app: {
expand: true,
src: ['./lib/*.js'],
dest: 'docs',
options: {
onlyUpdated: false,
colourScheme: 'default',
ignoreHidden: false,
sidebarState: false,
exclude: false,
lineNums: true,
js: [],
css: [],
extras: ['fileSearch', 'goToLine']
}
}
},
// Define the various shell tasks
shell: {
// Define a `sweetenDocker` command which sweetens the output from docker
sweetenDocker: {
command: 'bin/sweeten-docker ./docs',
stdout: true,
stderr: true,
failOnError: true
}
}
});
// ## Define the tasks
// ### Default task(s).
// Just running `grunt` will load the default tasks.
// For now, the only default tasks are `jshint:app`
grunt.registerTask('default', ['jshint:app']);
// ### Doc task(s).
// Running `grunt doc` will generate documentation for Quad.
// The documentation will be put into the `./docs` folder in project's root
// folder.
grunt.registerTask('doc', ['docker', 'shell:sweetenDocker']);
// @note `grunt docs` provides an alias for the `grunt doc` task
grunt.registerTask('docs', ['doc']);
};