11'use strict' ; 
22
33module . exports  =  function ( grunt )  { 
4-   var  _  =  require ( 'lodash' ) ; 
54  var  path  =  require ( 'path' ) ; 
65  var  os  =  require ( 'os' ) ; 
76  var  through  =  require ( 'through2' ) ; 
@@ -14,7 +13,7 @@ module.exports = function(grunt) {
1413
1514  var  plugins  =  grunt . option ( 'plugins' ) ; 
1615  // Create plugin paths and verify they exist 
17-   plugins  =  _ . map ( plugins  ? plugins . split ( ',' )  : [ ] ,   function ( plugin )  { 
16+   plugins  =  ( plugins  ? plugins . split ( ',' )  : [ ] ) . map ( function ( plugin )  { 
1817    var  p  =  'plugins/'  +  plugin  +  '.js' ; 
1918
2019    if  ( ! grunt . file . exists ( p ) ) 
@@ -51,12 +50,12 @@ module.exports = function(grunt) {
5150      } 
5251    } ; 
5352
54-     var  excluded  =  _ . map ( excludedPlugins ,   function ( plugin )  { 
53+     var  excluded  =  excludedPlugins . map ( function ( plugin )  { 
5554      return  'plugins/'  +  plugin  +  '.js' ; 
5655    } ) ; 
5756
5857    // Remove the plugins that we don't want to build 
59-     a  =  _ . filter ( a ,   function ( n )  { 
58+     a  =  a . filter ( function ( n )  { 
6059      return  excluded . indexOf ( n )  ===  - 1 ; 
6160    } ) ; 
6261
@@ -88,21 +87,17 @@ module.exports = function(grunt) {
8887  } ) ; 
8988
9089  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 ( ) ; 
9895
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 ) ; 
10198
102-       return  dict ; 
103-     } , 
104-     { } 
105-   ) ; 
99+     return  dict ; 
100+   } ,  { } ) ; 
106101
107102  var  browserifyConfig  =  { 
108103    options : { 
@@ -202,30 +197,6 @@ module.exports = function(grunt) {
202197      } 
203198    } , 
204199
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- 
229200    release : { 
230201      options : { 
231202        npm : false , 
@@ -338,12 +309,10 @@ module.exports = function(grunt) {
338309
339310  // 3rd party Grunt tasks 
340311  grunt . loadNpmTasks ( 'grunt-browserify' ) ; 
341-   grunt . loadNpmTasks ( 'grunt-mocha' ) ; 
342312  grunt . loadNpmTasks ( 'grunt-release' ) ; 
343313  grunt . loadNpmTasks ( 'grunt-s3' ) ; 
344314  grunt . loadNpmTasks ( 'grunt-gitinfo' ) ; 
345315  grunt . loadNpmTasks ( 'grunt-sri' ) ; 
346-   grunt . loadNpmTasks ( 'grunt-eslint' ) ; 
347316
348317  // Build tasks 
349318  grunt . registerTask ( '_prep' ,  [ 'clean' ,  'gitinfo' ,  'version' ] ) ; 
@@ -355,7 +324,7 @@ module.exports = function(grunt) {
355324    '_prep' , 
356325    'browserify:plugins-combined' 
357326  ] ) ; 
358-   grunt . registerTask ( 'build.test' ,  [ '_prep' ,  'browserify:test' ] ) ; 
327+   grunt . registerTask ( 'build.test' ,  [ '_prep' ,  'browserify.core'  ,   'browserify :test'] ) ; 
359328  grunt . registerTask ( 'build.core' ,  [ 'browserify.core' ,  'uglify' ,  'sri:dist' ] ) ; 
360329  grunt . registerTask ( 'build.plugins-combined' ,  [ 
361330    'browserify.plugins-combined' , 
@@ -366,13 +335,9 @@ module.exports = function(grunt) {
366335  grunt . registerTask ( 'build' ,  [ 'build.plugins-combined' ] ) ; 
367336  grunt . registerTask ( 'dist' ,  [ 'build.core' ,  'copy:dist' ] ) ; 
368337
369-   // Test task 
370-   grunt . registerTask ( 'test' ,  [ 'eslint' ,  'browserify.core' ,  'browserify:test' ,  'mocha' ] ) ; 
371- 
372338  // Webserver tasks 
373339  grunt . registerTask ( 'run:test' ,  [ 'connect:test' ] ) ; 
374340  grunt . registerTask ( 'run:docs' ,  [ 'connect:docs' ] ) ; 
375341
376-   grunt . registerTask ( 'publish' ,  [ 'test' ,  'build.plugins-combined' ,  's3' ] ) ; 
377-   grunt . registerTask ( 'default' ,  [ 'test' ] ) ; 
342+   grunt . registerTask ( 'publish' ,  [ 'build.plugins-combined' ,  's3' ] ) ; 
378343} ; 
0 commit comments