@@ -260,24 +260,34 @@ grunt.initConfig({
260
260
qunit : {
261
261
files : grunt . file . expandFiles ( "tests/unit/**/*.html" ) . filter ( function ( file ) {
262
262
// disabling everything that doesn't (quite) work with PhantomJS for now
263
- // except for all|index|test, try to include more as we go
264
- return ! ( / ( a l l | a l l - a c t i v e | i n d e x | t e s t | d r a g g a b l e | d r o p p a b l e | s e l e c t a b l e | r e s i z a b l e | s o r t a b l e | d i a l o g | s l i d e r | d a t e p i c k e r | t a b s | t a b s _ d e p r e c a t e d ) \. h t m l / ) . test ( file ) ;
263
+ // TODO except for all|index|test, try to include more as we go
264
+ return ! ( / ( a l l | a l l - a c t i v e | i n d e x | t e s t | d r a g g a b l e | d r o p p a b l e | s e l e c t a b l e | r e s i z a b l e | s o r t a b l e | d i a l o g | s l i d e r | d a t e p i c k e r | t a b s | t a b s _ d e p r e c a t e d ) \. h t m l $ / ) . test ( file ) ;
265
265
} )
266
266
} ,
267
267
lint : {
268
268
ui : grunt . file . expandFiles ( "ui/*.js" ) . filter ( function ( file ) {
269
- // remove items from this list once rewritten
269
+ // TODO remove items from this list once rewritten
270
270
return ! ( / ( e f f e c t s .c o r e | m o u s e | d a t e p i c k e r | d r a g g a b l e | d r o p p a b l e | r e s i z a b l e | s e l e c t a b l e | s o r t a b l e ) \. j s $ / ) . test ( file ) ;
271
271
} ) ,
272
- grunt : "grunt.js" ,
273
- tests : "tests/unit/**/*.js"
272
+ grunt : "grunt.js"
273
+ // TODO enabled once fixed up
274
+ // tests: "tests/unit/**/*.js"
274
275
} ,
275
276
csslint : {
277
+ // nothing: []
278
+ // TODO figure out what to check for, then fix and enable
276
279
base_theme : {
277
- src : "themes/base/*.css" ,
280
+ src : grunt . file . expandFiles ( "themes/base/*.css" ) . filter ( function ( file ) {
281
+ // TODO remove items from this list once rewritten
282
+ return ! ( / ( b u t t o n | d a t e p i c k e r | c o r e | d i a l o g | t h e m e ) \. c s s $ / ) . test ( file ) ;
283
+ } ) ,
284
+ // TODO consider reenabling some of these rules
278
285
rules : {
279
286
"import" : false ,
280
- "overqualified-elements" : 2
287
+ "important" : false ,
288
+ "outline-none" : false ,
289
+ // especially this one
290
+ "overqualified-elements" : false
281
291
}
282
292
}
283
293
} ,
@@ -351,9 +361,11 @@ grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @
351
361
function replaceVersion ( source ) {
352
362
return source . replace ( "@VERSION" , grunt . config ( "pkg.version" ) ) ;
353
363
}
354
- var files = grunt . file . expandFiles ( this . file . src ) ;
355
- var target = this . file . dest + "/" ;
356
- var strip = this . data . strip ;
364
+ var files = grunt . file . expandFiles ( this . file . src ) ,
365
+ target = this . file . dest + "/" ,
366
+ strip = this . data . strip ,
367
+ renameCount = 0 ,
368
+ fileName ;
357
369
if ( typeof strip === "string" ) {
358
370
strip = new RegExp ( "^" + grunt . template . process ( strip , grunt . config ( ) ) . replace ( / [ \- \[ \] { } ( ) * + ? . , \\ \^ $ | # \s ] / g, "\\$&" ) ) ;
359
371
}
@@ -368,8 +380,7 @@ grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @
368
380
}
369
381
} ) ;
370
382
grunt . log . writeln ( "Copied " + files . length + " files." ) ;
371
- var renameCount = 0 ;
372
- for ( var fileName in this . data . renames ) {
383
+ for ( fileName in this . data . renames ) {
373
384
renameCount += 1 ;
374
385
grunt . file . copy ( fileName , target + grunt . template . process ( this . data . renames [ fileName ] , grunt . config ( ) ) ) ;
375
386
}
@@ -396,9 +407,9 @@ grunt.registerMultiTask( "zip", "Create a zip file for release", function() {
396
407
//zip.writeZip( "dist/" + this.file.dest );
397
408
//grunt.log.writeln( "Wrote " + files.length + " files to " + this.file.dest );
398
409
399
- var done = this . async ( ) ;
400
- var dest = this . file . dest ;
401
- var src = grunt . template . process ( this . file . src , grunt . config ( ) ) ;
410
+ var done = this . async ( ) ,
411
+ dest = this . file . dest ,
412
+ src = grunt . template . process ( this . file . src , grunt . config ( ) ) ;
402
413
grunt . utils . spawn ( {
403
414
cmd : "zip" ,
404
415
args : [ "-r" , dest , src ] ,
@@ -421,9 +432,9 @@ grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", fun
421
432
if ( path . existsSync ( this . file . dest ) ) {
422
433
fs . unlinkSync ( this . file . dest ) ;
423
434
}
424
- var crypto = require ( "crypto" ) ;
425
- var dir = this . file . src + "/" ;
426
- var hashes = [ ] ;
435
+ var crypto = require ( "crypto" ) ,
436
+ dir = this . file . src + "/" ,
437
+ hashes = [ ] ;
427
438
grunt . file . expandFiles ( dir + "**/*" ) . forEach ( function ( fileName ) {
428
439
var hash = crypto . createHash ( "md5" ) ;
429
440
hash . update ( grunt . file . read ( fileName , "ascii" ) ) ;
@@ -439,15 +450,15 @@ grunt.registerTask( "download_docs", function() {
439
450
return value [ 0 ] . toUpperCase ( ) + value . slice ( 1 ) ;
440
451
}
441
452
// should be grunt.config("pkg.version")?
442
- var version = "1.8" ;
443
- var docsDir = "dist/docs" ;
444
- var files = "draggable droppable resizable selectable sortable accordion autocomplete button datepicker dialog progressbar slider tabs position"
445
- . split ( " " ) . map ( function ( widget ) {
446
- return {
447
- url : "http://docs.jquery.com/action/render/UI/API/" + version + "/" + capitalize ( widget ) ,
448
- dest : docsDir + '/' + widget + '.html'
449
- } ;
450
- } ) ;
453
+ var version = "1.8" ,
454
+ docsDir = "dist/docs" ,
455
+ files = "draggable droppable resizable selectable sortable accordion autocomplete button datepicker dialog progressbar slider tabs position"
456
+ . split ( " " ) . map ( function ( widget ) {
457
+ return {
458
+ url : "http://docs.jquery.com/action/render/UI/API/" + version + "/" + capitalize ( widget ) ,
459
+ dest : docsDir + '/' + widget + '.html'
460
+ } ;
461
+ } ) ;
451
462
files = files . concat ( "animate addClass effect hide removeClass show switchClass toggle toggleClass" . split ( " " ) . map ( function ( widget ) {
452
463
return {
453
464
url : "http://docs.jquery.com/action/render/UI/Effects/" + widget ,
@@ -470,15 +481,15 @@ grunt.registerTask( "download_docs", function() {
470
481
471
482
grunt . registerTask ( "download_themes" , function ( ) {
472
483
// var AdmZip = require('adm-zip');
473
- var done = this . async ( ) ;
474
- var themes = grunt . file . read ( "build/themes" ) . split ( "," ) ;
475
- var requests = 0 ;
484
+ var done = this . async ( ) ,
485
+ themes = grunt . file . read ( "build/themes" ) . split ( "," ) ,
486
+ requests = 0 ;
476
487
grunt . file . mkdir ( "dist/tmp" ) ;
477
488
themes . forEach ( function ( theme , index ) {
478
489
requests += 1 ;
479
490
grunt . file . mkdir ( "dist/tmp/" + index ) ;
480
- var zipFileName = "dist/tmp/" + index + ".zip" ;
481
- var out = fs . createWriteStream ( zipFileName ) ;
491
+ var zipFileName = "dist/tmp/" + index + ".zip" ,
492
+ out = fs . createWriteStream ( zipFileName ) ;
482
493
out . on ( "close" , function ( ) {
483
494
grunt . log . writeln ( "done downloading " + zipFileName ) ;
484
495
// TODO AdmZip produces "crc32 checksum failed", need to figure out why
@@ -503,20 +514,19 @@ grunt.registerTask( "download_themes", function() {
503
514
504
515
grunt . registerTask ( "copy_themes" , function ( ) {
505
516
// each package includes the base theme, ignore that
506
- var filter = / t h e m e s \/ b a s e / ;
507
- var files = grunt . file . expandFiles ( "dist/tmp/*/development-bundle/themes/**/*" ) . filter ( function ( file ) {
508
- return ! filter . test ( file ) ;
509
- } ) ;
510
- // TODO the grunt.template.process call shouldn't be necessary
511
- var target = "dist/" + grunt . template . process ( grunt . config ( "files.themes" ) , grunt . config ( ) ) + "/" ;
517
+ var filter = / t h e m e s \/ b a s e / ,
518
+ files = grunt . file . expandFiles ( "dist/tmp/*/development-bundle/themes/**/*" ) . filter ( function ( file ) {
519
+ return ! filter . test ( file ) ;
520
+ } ) ,
521
+ // TODO the grunt.template.process call shouldn't be necessary
522
+ target = "dist/" + grunt . template . process ( grunt . config ( "files.themes" ) , grunt . config ( ) ) + "/" ,
523
+ distFolder = "dist/" + grunt . template . process ( grunt . config ( "files.dist" ) , grunt . config ( ) ) ;
512
524
files . forEach ( function ( fileName ) {
513
525
var targetFile = fileName . replace ( / d i s t \/ t m p \/ \d + \/ d e v e l o p m e n t - b u n d l e \/ / , "" ) . replace ( "jquery-ui-.custom" , "jquery-ui" ) ;
514
526
grunt . file . copy ( fileName , target + targetFile ) ;
515
527
} ) ;
516
528
517
529
// copy minified base theme from regular release
518
- // TODO same as the one above
519
- var distFolder = "dist/" + grunt . template . process ( grunt . config ( "files.dist" ) , grunt . config ( ) ) ;
520
530
files = grunt . file . expandFiles ( distFolder + "/themes/base/**/*" ) ;
521
531
files . forEach ( function ( fileName ) {
522
532
grunt . file . copy ( fileName , target + fileName . replace ( distFolder , "" ) ) ;
0 commit comments