@@ -3,6 +3,7 @@ module.exports = function( grunt ) {
3
3
"use strict" ;
4
4
5
5
var
6
+
6
7
// files
7
8
coreFiles = [
8
9
"core.js" ,
16
17
"effect.js"
17
18
] ,
18
19
19
- uiFiles = coreFiles . map ( function ( file ) {
20
+ uiFiles = coreFiles . map ( function ( file ) {
20
21
return "ui/" + file ;
21
- } ) . concat ( expandFiles ( "ui/**/*.js" ) . filter ( function ( file ) {
22
+ } ) . concat ( expandFiles ( "ui/**/*.js" ) . filter ( function ( file ) {
22
23
return coreFiles . indexOf ( file . substring ( 3 ) ) === - 1 ;
23
- } ) ) ,
24
+ } ) ) ,
24
25
25
26
allI18nFiles = expandFiles ( "ui/i18n/*.js" ) ,
26
27
45
46
"tabs" ,
46
47
"tooltip" ,
47
48
"theme"
48
- ] . map ( function ( component ) {
49
+ ] . map ( function ( component ) {
49
50
return "themes/base/" + component + ".css" ;
50
- } ) ,
51
+ } ) ,
51
52
52
53
// minified files
53
54
minify = {
@@ -92,28 +93,30 @@ function mapMinFile( file ) {
92
93
}
93
94
94
95
function 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 ) {
96
97
return values [ 0 ] ;
97
- } ) ;
98
+ } ) ;
98
99
}
99
100
100
- uiFiles . concat ( allI18nFiles ) . forEach ( function ( file ) {
101
+ uiFiles . concat ( allI18nFiles ) . forEach ( function ( file ) {
101
102
minify [ file ] = {
102
103
options : {
103
104
banner : createBanner ( )
104
105
} ,
105
106
files : { }
106
107
} ;
107
108
minify [ file ] . files [ mapMinFile ( file ) ] = file ;
108
- } ) ;
109
+ } ) ;
110
+
111
+ uiFiles . forEach ( function ( file ) {
109
112
110
- uiFiles . forEach ( function ( file ) {
111
113
// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
112
114
compareFiles [ file ] = [ file , mapMinFile ( file ) ] ;
113
- } ) ;
115
+ } ) ;
114
116
115
117
// grunt plugins
116
118
require ( "load-grunt-tasks" ) ( grunt ) ;
119
+
117
120
// local testswarm and build tasks
118
121
grunt . loadTasks ( "build/tasks" ) ;
119
122
@@ -122,17 +125,18 @@ function stripDirectory( file ) {
122
125
}
123
126
124
127
function createBanner ( files ) {
128
+
125
129
// strip folders
126
130
var fileNames = files && files . map ( stripDirectory ) ;
127
131
return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
128
132
"<%= grunt.template.today('isoDate') %>\n" +
129
133
"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
130
- ( files ? "* Includes: " + fileNames . join ( ", " ) + "\n" : "" ) +
134
+ ( files ? "* Includes: " + fileNames . join ( ", " ) + "\n" : "" ) +
131
135
"* Copyright <%= pkg.author.name %>;" +
132
136
" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n" ;
133
137
}
134
138
135
- grunt . initConfig ( {
139
+ grunt . initConfig ( {
136
140
pkg : grunt . file . readJSON ( "package.json" ) ,
137
141
files : {
138
142
dist : "<%= pkg.name %>-<%= pkg.version %>"
@@ -166,7 +170,7 @@ grunt.initConfig({
166
170
include : expandFiles ( [ "ui/**/*.js" , "!ui/core.js" , "!ui/i18n/*" ] ) ,
167
171
out : "dist/jquery-ui.js" ,
168
172
wrap : {
169
- start : createBanner ( uiFiles ) ,
173
+ start : createBanner ( uiFiles )
170
174
}
171
175
}
172
176
}
@@ -215,9 +219,9 @@ grunt.initConfig({
215
219
}
216
220
} ,
217
221
qunit : {
218
- files : expandFiles ( "tests/unit/" + component + "/*.html" ) . filter ( function ( file ) {
222
+ files : expandFiles ( "tests/unit/" + component + "/*.html" ) . filter ( function ( file ) {
219
223
return ! ( / ( a l l | i n d e x | t e s t ) \. h t m l $ / ) . test ( file ) ;
220
- } ) ,
224
+ } ) ,
221
225
options : {
222
226
inject : false ,
223
227
page : {
@@ -397,6 +401,24 @@ grunt.initConfig({
397
401
"jquery-3.1.1/jquery.js" : "jquery-3.1.1/dist/jquery.js" ,
398
402
"jquery-3.1.1/LICENSE.txt" : "jquery-3.1.1/LICENSE.txt" ,
399
403
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
+
400
422
"jquery-migrate-1.4.1/jquery-migrate.js" : "jquery-migrate-1.4.1/dist/jquery-migrate.js" ,
401
423
"jquery-migrate-1.4.1/LICENSE.txt" : "jquery-migrate-1.4.1/LICENSE.txt" ,
402
424
@@ -432,43 +454,43 @@ grunt.initConfig({
432
454
"Bohdan Ganicky <bohdan.ganicky@gmail.com>"
433
455
]
434
456
}
435
- } ) ;
457
+ } ) ;
436
458
437
459
grunt . registerTask ( "update-authors" , function ( ) {
438
460
var getAuthors = require ( "grunt-git-authors" ) . getAuthors ,
439
461
done = this . async ( ) ;
440
462
441
- getAuthors ( {
463
+ getAuthors ( {
442
464
priorAuthors : grunt . config ( "authors.prior" )
443
465
} , function ( error , authors ) {
444
466
if ( error ) {
445
467
grunt . log . error ( error ) ;
446
468
return done ( false ) ;
447
469
}
448
470
449
- authors = authors . map ( function ( author ) {
471
+ authors = authors . map ( function ( author ) {
450
472
if ( author . match ( / ^ J a c e k J ę d r z e j e w s k i < / ) ) {
451
473
return "Jacek Jędrzejewski (http://jacek.jedrzejewski.name)" ;
452
474
} else if ( author . match ( / ^ P a w e l M a r u s z c z y k < / ) ) {
453
475
return "Pawel Maruszczyk (http://hrabstwo.net)" ;
454
476
} else {
455
477
return author ;
456
478
}
457
- } ) ;
479
+ } ) ;
458
480
459
481
grunt . file . write ( "AUTHORS.txt" ,
460
482
"Authors ordered by first contribution\n" +
461
483
"A list of current team members is available at http://jqueryui.com/about\n\n" +
462
484
authors . join ( "\n" ) + "\n" ) ;
463
485
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" ] ) ;
473
495
474
496
} ;
0 commit comments