1
1
'use strict' ;
2
2
3
3
module . exports = function ( grunt ) {
4
- var _ = require ( 'lodash' ) ;
5
4
var path = require ( 'path' ) ;
6
5
var os = require ( 'os' ) ;
7
6
var through = require ( 'through2' ) ;
@@ -14,7 +13,7 @@ module.exports = function(grunt) {
14
13
15
14
var plugins = grunt . option ( 'plugins' ) ;
16
15
// Create plugin paths and verify they exist
17
- plugins = _ . map ( plugins ? plugins . split ( ',' ) : [ ] , function ( plugin ) {
16
+ plugins = ( plugins ? plugins . split ( ',' ) : [ ] ) . map ( function ( plugin ) {
18
17
var p = 'plugins/' + plugin + '.js' ;
19
18
20
19
if ( ! grunt . file . exists ( p ) )
@@ -51,12 +50,12 @@ module.exports = function(grunt) {
51
50
}
52
51
} ;
53
52
54
- var excluded = _ . map ( excludedPlugins , function ( plugin ) {
53
+ var excluded = excludedPlugins . map ( function ( plugin ) {
55
54
return 'plugins/' + plugin + '.js' ;
56
55
} ) ;
57
56
58
57
// Remove the plugins that we don't want to build
59
- a = _ . filter ( a , function ( n ) {
58
+ a = a . filter ( function ( n ) {
60
59
return excluded . indexOf ( n ) === - 1 ;
61
60
} ) ;
62
61
@@ -88,21 +87,17 @@ module.exports = function(grunt) {
88
87
} ) ;
89
88
90
89
var pluginCombinations = combine ( plugins ) ;
91
- var pluginConcatFiles = _ . reduce (
92
- pluginCombinations ,
93
- function ( dict , comb ) {
94
- var key = _ . map ( comb , function ( plugin ) {
95
- return path . basename ( plugin , '.js' ) ;
96
- } ) ;
97
- key . sort ( ) ;
90
+ var pluginConcatFiles = pluginCombinations . reduce ( function ( dict , comb ) {
91
+ var key = comb . map ( function ( plugin ) {
92
+ return path . basename ( plugin , '.js' ) ;
93
+ } ) ;
94
+ key . sort ( ) ;
98
95
99
- var dest = path . join ( 'build/' , key . join ( ',' ) , '/raven.js' ) ;
100
- dict [ dest ] = [ 'src/singleton.js' ] . concat ( comb ) ;
96
+ var dest = path . join ( 'build/' , key . join ( ',' ) , '/raven.js' ) ;
97
+ dict [ dest ] = [ 'src/singleton.js' ] . concat ( comb ) ;
101
98
102
- return dict ;
103
- } ,
104
- { }
105
- ) ;
99
+ return dict ;
100
+ } , { } ) ;
106
101
107
102
var browserifyConfig = {
108
103
options : {
@@ -202,30 +197,6 @@ module.exports = function(grunt) {
202
197
}
203
198
} ,
204
199
205
- eslint : {
206
- target : [ '.' ]
207
- } ,
208
-
209
- mocha : {
210
- options : {
211
- mocha : {
212
- ignoreLeaks : true ,
213
- grep : grunt . option ( 'grep' )
214
- } ,
215
- log : true ,
216
- reporter : 'Dot' ,
217
- run : true
218
- } ,
219
- unit : {
220
- src : [ 'test/index.html' ] ,
221
- nonull : true
222
- } ,
223
- integration : {
224
- src : [ 'test/integration/index.html' ] ,
225
- nonull : true
226
- }
227
- } ,
228
-
229
200
release : {
230
201
options : {
231
202
npm : false ,
@@ -338,12 +309,10 @@ module.exports = function(grunt) {
338
309
339
310
// 3rd party Grunt tasks
340
311
grunt . loadNpmTasks ( 'grunt-browserify' ) ;
341
- grunt . loadNpmTasks ( 'grunt-mocha' ) ;
342
312
grunt . loadNpmTasks ( 'grunt-release' ) ;
343
313
grunt . loadNpmTasks ( 'grunt-s3' ) ;
344
314
grunt . loadNpmTasks ( 'grunt-gitinfo' ) ;
345
315
grunt . loadNpmTasks ( 'grunt-sri' ) ;
346
- grunt . loadNpmTasks ( 'grunt-eslint' ) ;
347
316
348
317
// Build tasks
349
318
grunt . registerTask ( '_prep' , [ 'clean' , 'gitinfo' , 'version' ] ) ;
@@ -355,7 +324,7 @@ module.exports = function(grunt) {
355
324
'_prep' ,
356
325
'browserify:plugins-combined'
357
326
] ) ;
358
- grunt . registerTask ( 'build.test' , [ '_prep' , 'browserify:test' ] ) ;
327
+ grunt . registerTask ( 'build.test' , [ '_prep' , 'browserify.core' , 'browserify :test'] ) ;
359
328
grunt . registerTask ( 'build.core' , [ 'browserify.core' , 'uglify' , 'sri:dist' ] ) ;
360
329
grunt . registerTask ( 'build.plugins-combined' , [
361
330
'browserify.plugins-combined' ,
@@ -366,13 +335,9 @@ module.exports = function(grunt) {
366
335
grunt . registerTask ( 'build' , [ 'build.plugins-combined' ] ) ;
367
336
grunt . registerTask ( 'dist' , [ 'build.core' , 'copy:dist' ] ) ;
368
337
369
- // Test task
370
- grunt . registerTask ( 'test' , [ 'eslint' , 'browserify.core' , 'browserify:test' , 'mocha' ] ) ;
371
-
372
338
// Webserver tasks
373
339
grunt . registerTask ( 'run:test' , [ 'connect:test' ] ) ;
374
340
grunt . registerTask ( 'run:docs' , [ 'connect:docs' ] ) ;
375
341
376
- grunt . registerTask ( 'publish' , [ 'test' , 'build.plugins-combined' , 's3' ] ) ;
377
- grunt . registerTask ( 'default' , [ 'test' ] ) ;
342
+ grunt . registerTask ( 'publish' , [ 'build.plugins-combined' , 's3' ] ) ;
378
343
} ;
0 commit comments