diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-08-16 09:59:58 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-09-07 20:03:50 +0300 |
commit | 10fdad742a2a6aa9f0e00b3e04fc5264797c53c7 (patch) | |
tree | 6b6d7b1375ff88f4bebbfa0703f7b595eb485df9 /build/release | |
parent | 7aa46e0df8a673e6b00550bbbbed21eed50108b7 (diff) | |
download | jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.tar.gz jquery-10fdad742a2a6aa9f0e00b3e04fc5264797c53c7.zip |
Build: Update jscs and lint files
Fixes gh-2056
Diffstat (limited to 'build/release')
-rw-r--r-- | build/release/cdn.js | 19 | ||||
-rw-r--r-- | build/release/dist.js | 13 | ||||
-rw-r--r-- | build/release/ensure-sizzle.js | 11 | ||||
-rw-r--r-- | build/release/release-notes.js | 34 |
4 files changed, 41 insertions, 36 deletions
diff --git a/build/release/cdn.js b/build/release/cdn.js index 6c497ee0b..07285a56d 100644 --- a/build/release/cdn.js +++ b/build/release/cdn.js @@ -29,13 +29,14 @@ var function makeReleaseCopies( Release ) { shell.mkdir( "-p", cdnFolder ); - Object.keys( releaseFiles ).forEach(function( key ) { + Object.keys( releaseFiles ).forEach( function( key ) { var text, builtFile = releaseFiles[ key ], unpathedFile = key.replace( /VER/g, Release.newVersion ), releaseFile = cdnFolder + "/" + unpathedFile; if ( /\.map$/.test( releaseFile ) ) { + // Map files need to reference the new uncompressed name; // assume that all files reside in the same directory. // "file":"jquery.min.js","sources":["jquery.js"] @@ -47,7 +48,7 @@ function makeReleaseCopies( Release ) { } else if ( builtFile !== releaseFile ) { shell.cp( "-f", builtFile, releaseFile ); } - }); + } ); } function makeArchives( Release, callback ) { @@ -75,23 +76,23 @@ function makeArchives( Release, callback ) { output.on( "error", function( err ) { throw err; - }); + } ); archiver.pipe( output ); - files = files.map(function( item ) { + files = files.map( function( item ) { return "dist" + ( rver.test( item ) ? "/cdn" : "" ) + "/" + item.replace( rver, Release.newVersion ); - }); + } ); sum = Release.exec( "md5sum " + files.join( " " ), "Error retrieving md5sum" ); fs.writeFileSync( md5file, sum ); files.push( md5file ); - files.forEach(function( file ) { + files.forEach( function( file ) { archiver.append( fs.createReadStream( file ), { name: path.basename( file ) } ); - }); + } ); archiver.finalize(); } @@ -104,9 +105,9 @@ function makeArchives( Release, callback ) { makeArchive( "mscdn", msFilesCDN, callback ); } - buildGoogleCDN(function() { + buildGoogleCDN( function() { buildMicrosoftCDN( callback ); - }); + } ); } module.exports = { diff --git a/build/release/dist.js b/build/release/dist.js index 8ef6faf86..32053eafb 100644 --- a/build/release/dist.js +++ b/build/release/dist.js @@ -5,6 +5,7 @@ module.exports = function( Release, complete ) { shell = require( "shelljs" ), pkg = require( Release.dir.repo + "/package.json" ), distRemote = Release.remote.replace( "jquery.git", "jquery-dist.git" ), + // These files are included with the distribution files = [ "src", @@ -34,7 +35,7 @@ module.exports = function( Release, complete ) { * Generate bower file for jquery-dist */ function generateBower() { - return JSON.stringify({ + return JSON.stringify( { name: pkg.name, main: pkg.main, license: "MIT", @@ -42,7 +43,7 @@ module.exports = function( Release, complete ) { "package.json" ], keywords: pkg.keywords - }, null, 2); + }, null, 2 ); } /** @@ -57,14 +58,14 @@ module.exports = function( Release, complete ) { "dist/jquery.js", "dist/jquery.min.js", "dist/jquery.min.map" - ].forEach(function( file ) { + ].forEach( function( file ) { shell.cp( Release.dir.repo + "/" + file, distFolder ); - }); + } ); // Copy other files - files.forEach(function( file ) { + files.forEach( function( file ) { shell.cp( "-r", Release.dir.repo + "/" + file, Release.dir.dist ); - }); + } ); // Write generated bower file fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() ); diff --git a/build/release/ensure-sizzle.js b/build/release/ensure-sizzle.js index c3e4ed159..795760643 100644 --- a/build/release/ensure-sizzle.js +++ b/build/release/ensure-sizzle.js @@ -8,7 +8,7 @@ var fs = require( "fs" ), * @param {Function(string)} callback */ function getLatestSizzle( callback ) { - npm.load(function( err, npm ) { + npm.load( function( err, npm ) { if ( err ) { throw err; } @@ -17,8 +17,8 @@ function getLatestSizzle( callback ) { throw err; } callback( Object.keys( info )[ 0 ] ); - }); - }); + } ); + } ); } /** @@ -29,11 +29,12 @@ function getLatestSizzle( callback ) { function ensureSizzle( Release, callback ) { console.log(); console.log( "Checking Sizzle version..." ); - getLatestSizzle(function( latest ) { + getLatestSizzle( function( latest ) { var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ), version = match ? match[ 1 ] : "Not Found"; if ( version !== latest ) { + // colors is inherited from jquery-release console.log( "The Sizzle version in the src folder (" + version.red + @@ -44,7 +45,7 @@ function ensureSizzle( Release, callback ) { console.log( "Sizzle is latest (" + latest.green + ")" ); callback(); } - }); + } ); } module.exports = ensureSizzle; diff --git a/build/release/release-notes.js b/build/release/release-notes.js index 00cdc8659..f3f6a6ff2 100644 --- a/build/release/release-notes.js +++ b/build/release/release-notes.js @@ -3,16 +3,16 @@ * jQuery Release Note Generator */ -var http = require("http"), +var http = require( "http" ), extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g, - version = process.argv[2]; + version = process.argv[ 2 ]; if ( !/^\d+\.\d+/.test( version ) ) { console.error( "Invalid version number: " + version ); process.exit( 1 ); } -http.request({ +http.request( { host: "bugs.jquery.com", port: 80, method: "GET", @@ -23,34 +23,36 @@ http.request({ res.on( "data", function( chunk ) { data.push( chunk ); - }); + } ); res.on( "end", function() { var match, cur, cat, - file = data.join(""); + file = data.join( "" ); - while ( (match = extract.exec( file )) ) { - if ( "#" + match[1] !== match[2] ) { - cat = match[3]; + while ( ( match = extract.exec( file ) ) ) { + if ( "#" + match[ 1 ] !== match[ 2 ] ) { + cat = match[ 3 ]; if ( !cur || cur !== cat ) { if ( cur ) { - console.log("</ul>"); + console.log( "</ul>" ); } cur = cat; - console.log( "<h3>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h3>" ); - console.log("<ul>"); + console.log( + "<h3>" + cat.charAt( 0 ).toUpperCase() + cat.slice( 1 ) + "</h3>" + ); + console.log( "<ul>" ); } console.log( - " <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" + - match[1] + ": " + match[2] + "</a></li>" + " <li><a href=\"http://bugs.jquery.com/ticket/" + match[ 1 ] + "\">#" + + match[ 1 ] + ": " + match[ 2 ] + "</a></li>" ); } } if ( cur ) { - console.log("</ul>"); + console.log( "</ul>" ); } - }); -}).end(); + } ); +} ).end(); |