mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°7355 - Update jQuery-migrate to 3.4.1
This commit is contained in:
72
node_modules/jquery-migrate/build/tasks/build.js
generated
vendored
Normal file
72
node_modules/jquery-migrate/build/tasks/build.js
generated
vendored
Normal 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 );
|
||||
}
|
||||
} );
|
||||
};
|
||||
5
node_modules/jquery-migrate/build/tasks/testswarm.js
generated
vendored
5
node_modules/jquery-migrate/build/tasks/testswarm.js
generated
vendored
@@ -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
|
||||
} )
|
||||
|
||||
Reference in New Issue
Block a user