forked from onepiecejs/nodejs-cantas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
218 lines (208 loc) · 8.3 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
concat: {
options: {
stripBanners: true,
// define a string to put between each file in the concatenated output
separator: ';',
banner: '<%= meta.banner %>'
},
'cantas': {
src: [
'public/javascripts/vendor/jquery-2.0.0.js',
'public/javascripts/vendor/jquery.slug.js',
'public/javascripts/vendor/async.js',
'public/javascripts/vendor/markdown.js',
'public/javascripts/vendor/jquery-ui.js',
'public/javascripts/vendor/underscore.js',
'public/javascripts/vendor/backbone.js',
'public/javascripts/vendor/backbone.iobind.js',
'public/javascripts/vendor/backbone.iosync.js',
'public/javascripts/vendor/moment.js',
'public/javascripts/vendor/bootstrap.min.js',
'public/javascripts/vendor/modernizr.custom.79639.js',
'public/javascripts/vendor/jquery.ba-cond.js',
'public/javascripts/vendor/jquery.slitslider.js',
'public/javascripts/vendor/load-image.min.js',
'public/javascripts/vendor/jquery.iframe-transport.js',
'public/javascripts/vendor/jquery.fileupload.js',
'public/javascripts/vendor/jquery.fileupload-process.js',
'public/javascripts/vendor/jquery.fileupload-image.js',
'public/javascripts/vendor/jquery.fileupload-validate.js',
'public/javascripts/vendor/jquery-ui-timepicker-addon.js'
],
dest: 'public/javascripts/dist/vendor.js'
},
'cantas-app': {
src: [
'public/javascripts/constants.js',
'public/javascripts/sortable.js',
'public/javascripts/utils/utils.js',
'public/javascripts/utils/safe_string.js',
'public/javascripts/application.js',
'public/javascripts/models/base.js',
'public/javascripts/views/base.js',
'public/javascripts/views/app.js',
'public/javascripts/views/search.js',
'public/javascripts/views/quickSearch.js',
'public/javascripts/models/activity.js',
'public/javascripts/views/activity.js',
'public/javascripts/models/notification.js',
'public/javascripts/views/notification.js',
'public/javascripts/models/boardMember.js',
'public/javascripts/views/boardMembers.js',
'public/javascripts/models/label.js',
'public/javascripts/models/syncConfig.js',
'public/javascripts/views/syncConfig.js',
'public/javascripts/models/board.js',
'public/javascripts/views/board.js',
'public/javascripts/models/list.js',
'public/javascripts/views/list.js',
'public/javascripts/models/checklist.js',
'public/javascripts/views/checklist.js',
'public/javascripts/models/card.js',
'public/javascripts/views/card.js',
'public/javascripts/models/comment.js',
'public/javascripts/views/comment.js',
'public/javascripts/models/attachment.js',
'public/javascripts/views/attachment.js',
'public/javascripts/models/vote.js',
'public/javascripts/views/boardlist.js',
'public/javascripts/views/cardList.js',
'public/javascripts/views/help.js',
'public/javascripts/views/welcome.js',
'public/javascripts/views/dashboard.js',
'public/javascripts/views/dashboard-navigation.js',
'public/javascripts/views/confirmDialog.js',
'public/javascripts/models/visitor.js',
'public/javascripts/views/boardActiveUsers.js',
'public/javascripts/views/adminConfig.js',
'public/javascripts/views/voteConfig.js',
'public/javascripts/views/commentConfig.js',
'public/javascripts/views/sidebar.js',
'public/javascripts/router.js'
],
dest: 'public/javascripts/dist/cantas-app.js'
}
},
uglify: {
options: {
banner: '<%= meta.banner %>',
mangle: {toplevel: true},
squeeze: {dead_code: false},
codegen: {quote_keys: true}
},
'cantas': {
src: 'public/javascripts/dist/vendor.js',
dest: 'public/javascripts/dist/vendor.min.js'
},
'cantas-app': {
src: 'public/javascripts/dist/cantas-app.js',
dest: 'public/javascripts/dist/cantas-app.min.js'
}
},
cssmin: {
minify: {
expand: true,
cwd: 'public/stylesheets/',
src: ['*.css', '!*.min.css'],
dest: 'public/stylesheets/',
ext: '.min.css'
}
},
jasmine: {
'cantas': {
src : [
'public/javascripts/constants.js',
'public/javascripts/sortable.js',
'public/javascripts/utils/utils.js',
'public/javascripts/utils/safe_string.js',
'public/javascripts/application.js',
'public/javascripts/models/base.js',
'public/javascripts/views/base.js',
'public/javascripts/views/app.js',
'public/javascripts/views/search.js',
'public/javascripts/views/quickSearch.js',
'public/javascripts/models/activity.js',
'public/javascripts/views/activity.js',
'public/javascripts/models/notification.js',
'public/javascripts/views/notification.js',
'public/javascripts/models/boardMember.js',
'public/javascripts/views/boardMembers.js',
'public/javascripts/models/label.js',
'public/javascripts/models/syncConfig.js',
'public/javascripts/views/syncConfig.js',
'public/javascripts/models/board.js',
'public/javascripts/views/board.js',
'public/javascripts/models/list.js',
'public/javascripts/views/list.js',
'public/javascripts/models/checklist.js',
'public/javascripts/views/checklist.js',
'public/javascripts/models/card.js',
'public/javascripts/views/card.js',
'public/javascripts/models/comment.js',
'public/javascripts/views/comment.js',
'public/javascripts/models/attachment.js',
'public/javascripts/views/attachment.js',
'public/javascripts/models/vote.js',
'public/javascripts/views/boardlist.js',
'public/javascripts/views/cardList.js',
'public/javascripts/views/help.js',
'public/javascripts/views/welcome.js',
'public/javascripts/views/dashboard.js',
'public/javascripts/views/dashboard-navigation.js',
'public/javascripts/views/confirmDialog.js',
'public/javascripts/models/visitor.js',
'public/javascripts/views/boardActiveUsers.js',
'public/javascripts/views/adminConfig.js',
'public/javascripts/views/voteConfig.js',
'public/javascripts/views/commentConfig.js',
'public/javascripts/views/sidebar.js',
'public/javascripts/router.js'
],
options: {
specs : ['spec/javascripts/**/*.spec.js'],
helpers : 'spec/helpers/*.js',
vendor: ['node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.js',
'public/javascripts/dist/vendor.js']
}
}
},
simplemocha: {
options: {
timeout: 100000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
},
all: ['spec/node/**/*-test.js']
},
watch: {
scripts: {
files: ['spec/javascripts/**/*.spec.js'
],
tasks: ['jasmine:cantas'],
options: {
nospawn: true
}
}
}
});
// concat&& uglify js/css task
grunt.registerTask('default', ['concat:cantas', 'uglify:cantas', 'concat:cantas-app',
'uglify:cantas-app', 'cssmin'
]);
//backend and frontend javascript test
grunt.registerTask('test', ['jasmine:cantas', 'simplemocha']);
};