-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrunt.js
162 lines (154 loc) · 4.41 KB
/
grunt.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// grunt.js (c) 2012 Loren West and other contributors
// May be freely distributed under the MIT license.
// For all details and documentation:
// http://lorenwest.github.com/node_monitor
var exec = require('child_process').exec;
// This is used in the build automation tasks, and on the server
// when running in dev mode to serve individual files for debugging.
var MODULE_DEF = {
server_js: [
"lib/js/SyncProbe.js",
"lib/js/FileSync.js",
"lib/js/SiteMap.js",
"lib/js/Server.js"
],
client_js: [
"lib/js/MonitorUI.js",
"lib/js/Template.js",
"lib/js/Sync.js",
"lib/js/Site.js",
"lib/js/Component.js",
"lib/js/Page.js",
"lib/js/Tree.js",
"lib/js/IconChooser.js",
"lib/js/DropDownMenu.js",
"lib/js/JsonView.js",
"lib/js/TreeView.js",
"lib/js/MonitorPicker.js",
"lib/js/SettingsView.js",
"lib/js/NewComponentView.js",
"lib/js/ComponentSettingsView.js",
"lib/js/ComponentView.js",
"lib/js/PageSettingsView.js",
"lib/js/PageView.js",
"lib/js/Sidebar.js",
"lib/js/SidebarView.js",
"lib/js/Tour.js",
"lib/js/TourView.js"
],
templates: [
"lib/template/MonitorUI.html",
"lib/template/PageView.html",
"lib/template/PageSettings.html",
"lib/template/PageCopy.html",
"lib/template/SidebarView.html",
"lib/template/TourView.html",
"lib/template/ComponentView.html",
"lib/template/ComponentSettings.html",
"lib/template/NewComponentView.html",
"lib/template/ComponentIcon.html",
"lib/template/About.html"
],
client_css: [
"lib/css/default/bootstrap.min.css",
"lib/css/default/font-awesome.css",
"lib/css/default/MonitorUI.css",
"lib/css/default/MonitorPicker.css",
"lib/css/default/ComponentView.css",
"lib/css/default/ComponentSettings.css",
"lib/css/default/NewComponentView.css",
"lib/css/default/DropDownMenu.css",
"lib/css/default/PageView.css",
"lib/css/default/PageSettings.css",
"lib/css/default/SidebarView.css",
"lib/css/default/TourView.css",
"lib/css/default/JsonView.css",
"lib/css/default/TreeView.css",
"lib/ext/jquery.miniColors.css"
],
client_ext: [
"lib/ext/jquery-1.8.2.min.js",
"lib/node_modules/monitor/dist/monitor-all.js",
"lib/node_modules/backbone-callbacks/backbone-callbacks.js",
"lib/ext/Backbone.ModelBinder.min.js",
"lib/ext/bootstrap.min.js",
"lib/ext/bootstrap-tooltip.js",
"lib/ext/bootstrap-dropdown.js",
"lib/ext/bootstrap-modal.js",
"lib/ext/bootstrap-popover.js",
"lib/ext/bootstrap-alert.js",
"lib/ext/bootstrap-collapse.js",
"lib/ext/mustache-0.7.0-dev.js",
"lib/ext/jquery.miniColors.min.js",
"lib/ext/d3.v2.min.js"
]
};
// Build automation tasks
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: '<json:package.json>',
module: MODULE_DEF,
lint: {
files: ['grunt.js', '<config:module.server_js>', '<config:module.client_js>', 'test/**/*.js']
},
test: {
files: ['test/**/*.js']
},
watch: {
files: ['grunt.js', '<config:module.server_js>', '<config:module.client_js>', 'test/**/*.js'],
tasks: 'default'
},
min: {
ui: {
src: ['<config:monitor.lib>', '<config.monitor.ui>'],
dest: '/tmp/monitor-base-min.js'
},
css: {
src: ['ui/client/css/all.css'],
dest: 'ui/client/css/all.min.css'
}
},
concat: {
ui: {
src: ['<config:monitor.ext>', '/tmp/monitor-base-min.js'],
dest: 'ui/client/src/monitor-min.js'
},
css: {
src: ['<config:monitor.css>'],
dest: 'ui/client/css/all.css'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true
},
globals: {
exports: true
}
}
});
grunt.registerTask('doc', 'Generate documentation files', function() {
var t = this, done = t.async(), child;
child = exec('yuidoc -c ./yuidoc.json', function (error, stdout, stderr) {
console.log(stderr);
console.log(stdout);
done();
});
});
// Default task.
grunt.registerTask('default', 'doc lint test');
grunt.registerTask('dist', 'min:ui concat:ui concat:css');
};
// Expose externally
module.exports.MODULE_DEF = MODULE_DEF;