];
const cdn = require( "./release/cdn" );
const dist = require( "./release/dist" );
+ const { buildDefaultFiles } = require( "./tasks/build" );
const npmTags = Release.npmTags;
* committed before creating the tag.
* @param {Function} callback
*/
- generateArtifacts: function( callback ) {
- Release.exec( "npm run build:all" );
+ generateArtifacts: async function( callback ) {
+ await buildDefaultFiles( { version: Release.newVersion } );
cdn.makeReleaseCopies( Release );
Release._setSrcVersion();
delete packageJson.devDependencies;
delete packageJson.dependencies;
delete packageJson.commitplease;
+ packageJson.version = Release.newVersion;
await fs.writeFile(
`${ Release.dir.dist }/package.json`,
JSON.stringify( packageJson, null, 2 )
await minify( { filename, dir } );
}
-async function buildDefaultFiles( { version } = {} ) {
+async function buildDefaultFiles( {
+ version = process.env.VERSION
+} = {} ) {
await Promise.all( [
build( { version } ),
build( { filename: "jquery.slim.js", slim: true, version } )
// Remove the short SHA and .dirty from comparisons.
// The short SHA so commits can be compared against each other
// and .dirty to compare with the existing branch during development.
- const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?\+(?:slim.)?([^ \.]+(?:\.dirty)?)/.exec( contents )[ 1 ];
+ const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+|\+slim\.)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ];
contents = contents.replace( new RegExp( sha, "g" ), "" );
const size = Buffer.byteLength( contents, "utf8" );