N°7355 - Update jQuery-migrate to 3.4.1

This commit is contained in:
Molkobain
2024-03-22 16:35:41 +01:00
parent e8c4c45c5c
commit db4c70cea3
26 changed files with 1811 additions and 390 deletions

72
node_modules/jquery-migrate/build/tasks/build.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
/**
* A build task that compiles jQuery Migrate JS modules into one bundle.
*/
"use strict";
module.exports = function( grunt ) {
const path = require( "path" );
const rollup = require( "rollup" );
const rootFolder = path.resolve( `${ __dirname }/../..` );
const srcFolder = path.resolve( `${ rootFolder }/src` );
const read = function( fileName ) {
return grunt.file.read( `${ srcFolder }/${ fileName }` );
};
// Catch `// @CODE` and subsequent comment lines event if they don't start
// in the first column.
const wrapper = read( "wrapper.js" )
.split( /[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ );
const inputRollupOptions = {};
const outputRollupOptions = {
// The ESM format is not actually used as we strip it during
// the build; it's just that it doesn't generate any extra
// wrappers so there's nothing for us to remove.
format: "esm",
intro: wrapper[ 0 ]
.replace( /\n*$/, "" ),
outro: wrapper[ 1 ]
.replace( /^\n*/, "" )
};
grunt.registerMultiTask(
"build",
"Build jQuery Migrate ECMAScript modules, embed date/version",
async function() {
const done = this.async();
try {
const version = grunt.config( "pkg.version" );
const dest = this.files[ 0 ].dest;
const src = this.files[ 0 ].src[ 0 ];
inputRollupOptions.input = path.resolve( `${ rootFolder }/${ src }` );
const bundle = await rollup.rollup( inputRollupOptions );
const { output: [ { code } ] } = await bundle.generate( outputRollupOptions );
const compiledContents = code
// Embed Version
.replace( /@VERSION/g, version )
// Embed Date
// yyyy-mm-ddThh:mmZ
.replace(
/@DATE/g,
( new Date() ).toISOString()
.replace( /:\d+\.\d+Z$/, "Z" )
);
grunt.file.write( `${ rootFolder }/${ dest }`, compiledContents );
grunt.log.ok( `File '${ dest }' created.` );
done();
} catch ( err ) {
done( err );
}
} );
};

View File

@@ -19,7 +19,9 @@ module.exports = function( grunt ) {
browserSets = JSON.parse( browserSets );
}
timeout = timeout || 1000 * 60 * 15;
tests = grunt.config( "tests" ).jquery;
tests = grunt.config( "tests" )[
Array.isArray( browserSets ) ? browserSets[ 0 ] : browserSets ||
"jquery" ];
if ( pull ) {
jobName = "Pull <a href='https://github.com/jquery/jquery-migrate/pull/" +
@@ -35,7 +37,6 @@ module.exports = function( grunt ) {
pluginjQuery[ 0 ] + "&jquery=" + pluginjQuery[ 1 ];
} );
// TODO: create separate job for git so we can do different browsersets
testswarm.createClient( {
url: config.swarmUrl
} )