@@ -3,6 +3,7 @@ module.exports = function( grunt ) {
33"use strict" ;
44
55var
6+
67 // files
78 coreFiles = [
89 "core.js" ,
1617 "effect.js"
1718 ] ,
1819
19- uiFiles = coreFiles . map ( function ( file ) {
20+ uiFiles = coreFiles . map ( function ( file ) {
2021 return "ui/" + file ;
21- } ) . concat ( expandFiles ( "ui/**/*.js" ) . filter ( function ( file ) {
22+ } ) . concat ( expandFiles ( "ui/**/*.js" ) . filter ( function ( file ) {
2223 return coreFiles . indexOf ( file . substring ( 3 ) ) === - 1 ;
23- } ) ) ,
24+ } ) ) ,
2425
2526 allI18nFiles = expandFiles ( "ui/i18n/*.js" ) ,
2627
4546 "tabs" ,
4647 "tooltip" ,
4748 "theme"
48- ] . map ( function ( component ) {
49+ ] . map ( function ( component ) {
4950 return "themes/base/" + component + ".css" ;
50- } ) ,
51+ } ) ,
5152
5253 // minified files
5354 minify = {
@@ -92,28 +93,30 @@ function mapMinFile( file ) {
9293}
9394
9495function expandFiles ( files ) {
95- return grunt . util . _ . pluck ( grunt . file . expandMapping ( files ) , "src" ) . map ( function ( values ) {
96+ return grunt . util . _ . pluck ( grunt . file . expandMapping ( files ) , "src" ) . map ( function ( values ) {
9697 return values [ 0 ] ;
97- } ) ;
98+ } ) ;
9899}
99100
100- uiFiles . concat ( allI18nFiles ) . forEach ( function ( file ) {
101+ uiFiles . concat ( allI18nFiles ) . forEach ( function ( file ) {
101102 minify [ file ] = {
102103 options : {
103104 banner : createBanner ( )
104105 } ,
105106 files : { }
106107 } ;
107108 minify [ file ] . files [ mapMinFile ( file ) ] = file ;
108- } ) ;
109+ } ) ;
110+
111+ uiFiles . forEach ( function ( file ) {
109112
110- uiFiles . forEach ( function ( file ) {
111113 // TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
112114 compareFiles [ file ] = [ file , mapMinFile ( file ) ] ;
113- } ) ;
115+ } ) ;
114116
115117// grunt plugins
116118require ( "load-grunt-tasks" ) ( grunt ) ;
119+
117120// local testswarm and build tasks
118121grunt . loadTasks ( "build/tasks" ) ;
119122
@@ -122,17 +125,18 @@ function stripDirectory( file ) {
122125}
123126
124127function createBanner ( files ) {
128+
125129 // strip folders
126130 var fileNames = files && files . map ( stripDirectory ) ;
127131 return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
128132 "<%= grunt.template.today('isoDate') %>\n" +
129133 "<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
130- ( files ? "* Includes: " + fileNames . join ( ", " ) + "\n" : "" ) +
134+ ( files ? "* Includes: " + fileNames . join ( ", " ) + "\n" : "" ) +
131135 "* Copyright <%= pkg.author.name %>;" +
132136 " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n" ;
133137}
134138
135- grunt . initConfig ( {
139+ grunt . initConfig ( {
136140 pkg : grunt . file . readJSON ( "package.json" ) ,
137141 files : {
138142 dist : "<%= pkg.name %>-<%= pkg.version %>"
@@ -166,7 +170,7 @@ grunt.initConfig({
166170 include : expandFiles ( [ "ui/**/*.js" , "!ui/core.js" , "!ui/i18n/*" ] ) ,
167171 out : "dist/jquery-ui.js" ,
168172 wrap : {
169- start : createBanner ( uiFiles ) ,
173+ start : createBanner ( uiFiles )
170174 }
171175 }
172176 }
@@ -215,9 +219,9 @@ grunt.initConfig({
215219 }
216220 } ,
217221 qunit : {
218- files : expandFiles ( "tests/unit/" + component + "/*.html" ) . filter ( function ( file ) {
222+ files : expandFiles ( "tests/unit/" + component + "/*.html" ) . filter ( function ( file ) {
219223 return ! ( / ( a l l | i n d e x | t e s t ) \. h t m l $ / ) . test ( file ) ;
220- } ) ,
224+ } ) ,
221225 options : {
222226 inject : false ,
223227 page : {
@@ -397,6 +401,24 @@ grunt.initConfig({
397401 "jquery-3.1.1/jquery.js" : "jquery-3.1.1/dist/jquery.js" ,
398402 "jquery-3.1.1/LICENSE.txt" : "jquery-3.1.1/LICENSE.txt" ,
399403
404+ "jquery-3.2.0/jquery.js" : "jquery-3.2.0/dist/jquery.js" ,
405+ "jquery-3.2.0/LICENSE.txt" : "jquery-3.2.0/LICENSE.txt" ,
406+
407+ "jquery-3.2.1/jquery.js" : "jquery-3.2.1/dist/jquery.js" ,
408+ "jquery-3.2.1/LICENSE.txt" : "jquery-3.2.1/LICENSE.txt" ,
409+
410+ "jquery-3.3.0/jquery.js" : "jquery-3.3.0/dist/jquery.js" ,
411+ "jquery-3.3.0/LICENSE.txt" : "jquery-3.3.0/LICENSE.txt" ,
412+
413+ "jquery-3.3.1/jquery.js" : "jquery-3.3.1/dist/jquery.js" ,
414+ "jquery-3.3.1/LICENSE.txt" : "jquery-3.3.1/LICENSE.txt" ,
415+
416+ "jquery-3.4.0/jquery.js" : "jquery-3.4.0/dist/jquery.js" ,
417+ "jquery-3.4.0/LICENSE.txt" : "jquery-3.4.0/LICENSE.txt" ,
418+
419+ "jquery-3.4.1/jquery.js" : "jquery-3.4.1/dist/jquery.js" ,
420+ "jquery-3.4.1/LICENSE.txt" : "jquery-3.4.1/LICENSE.txt" ,
421+
400422 "jquery-migrate-1.4.1/jquery-migrate.js" : "jquery-migrate-1.4.1/dist/jquery-migrate.js" ,
401423 "jquery-migrate-1.4.1/LICENSE.txt" : "jquery-migrate-1.4.1/LICENSE.txt" ,
402424
@@ -432,43 +454,43 @@ grunt.initConfig({
432454 "Bohdan Ganicky <bohdan.ganicky@gmail.com>"
433455 ]
434456 }
435- } ) ;
457+ } ) ;
436458
437459grunt . registerTask ( "update-authors" , function ( ) {
438460 var getAuthors = require ( "grunt-git-authors" ) . getAuthors ,
439461 done = this . async ( ) ;
440462
441- getAuthors ( {
463+ getAuthors ( {
442464 priorAuthors : grunt . config ( "authors.prior" )
443465 } , function ( error , authors ) {
444466 if ( error ) {
445467 grunt . log . error ( error ) ;
446468 return done ( false ) ;
447469 }
448470
449- authors = authors . map ( function ( author ) {
471+ authors = authors . map ( function ( author ) {
450472 if ( author . match ( / ^ J a c e k J ę d r z e j e w s k i < / ) ) {
451473 return "Jacek Jędrzejewski (http://jacek.jedrzejewski.name)" ;
452474 } else if ( author . match ( / ^ P a w e l M a r u s z c z y k < / ) ) {
453475 return "Pawel Maruszczyk (http://hrabstwo.net)" ;
454476 } else {
455477 return author ;
456478 }
457- } ) ;
479+ } ) ;
458480
459481 grunt . file . write ( "AUTHORS.txt" ,
460482 "Authors ordered by first contribution\n" +
461483 "A list of current team members is available at http://jqueryui.com/about\n\n" +
462484 authors . join ( "\n" ) + "\n" ) ;
463485 done ( ) ;
464- } ) ;
465- } ) ;
466-
467- grunt . registerTask ( "default" , [ "lint" , "requirejs" , "test" ] ) ;
468- grunt . registerTask ( "jenkins" , [ "default" , "concat" ] ) ;
469- grunt . registerTask ( "lint" , [ "asciilint" , "jshint" , "jscs" , "csslint" , "htmllint" ] ) ;
470- grunt . registerTask ( "test" , [ "qunit" ] ) ;
471- grunt . registerTask ( "sizer" , [ "requirejs:js" , "uglify:main" , "compare_size:all" ] ) ;
472- grunt . registerTask ( "sizer_all" , [ "requirejs:js" , "uglify" , "compare_size" ] ) ;
486+ } ) ;
487+ } ) ;
488+
489+ grunt . registerTask ( "default" , [ "lint" , "requirejs" , "test" ] ) ;
490+ grunt . registerTask ( "jenkins" , [ "default" , "concat" ] ) ;
491+ grunt . registerTask ( "lint" , [ "asciilint" , "jshint" , "jscs" , "csslint" , "htmllint" ] ) ;
492+ grunt . registerTask ( "test" , [ "qunit" ] ) ;
493+ grunt . registerTask ( "sizer" , [ "requirejs:js" , "uglify:main" , "compare_size:all" ] ) ;
494+ grunt . registerTask ( "sizer_all" , [ "requirejs:js" , "uglify" , "compare_size" ] ) ;
473495
474496} ;
0 commit comments