-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
105 lines (94 loc) · 2.47 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
/*
* Copyright 2014, Digium, Inc.
* All rights reserved.
*
* This source code is licensed under The MIT License found in the
* LICENSE file in the root directory of this source tree.
*
* For all details and documentation: https://www.respoke.io
*/
'use strict';
exports = module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('jsdoxy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-http-server');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.initConfig({
jshint: {
respoke: ['lib/**/*.js', 'index.js'],
options: {
jshintrc: '.jshintrc'
}
},
jsdoxy: {
options: {
jsonOutput: 'docs/jsdoxy-output.json',
outputPrivate: false,
template: './docs.jade'
},
files: {
src: [
'lib/client.js'
],
dest: './docs/'
}
},
copy: {
build: {
files: {
'.tmp/index.html': './docs/respoke.html'
}
}
},
'gh-pages': {
options: {
base: '.tmp',
repo: 'https://github.com/respoke/node-respoke-admin.git'
},
src: ['**']
},
watch: {
docs: {
files: ['lib/**/*.js'],
tasks: ['jsdoxy']
}
},
'http-server': {
docs: {
// the server root directory
root: 'docs',
port: 8283,
host: "localhost",
showDir : true,
autoIndex: true,
// server default file extension
ext: "html",
// run in parallel with other tasks
runInBackground: true
}
},
open: {
docs: {
path: 'http://localhost:8283/respoke.html'
}
}
});
grunt.registerTask('docs', [
'jsdoxy'
]);
grunt.registerTask('docs:serve', [
'docs',
'http-server:docs',
'open:docs',
'watch'
]);
grunt.registerTask('docs:publish', [
'jshint',
'docs',
'copy',
'gh-pages'
]);
};