2019-10-08 22:17:55 +00:00
|
|
|
"use strict";
|
|
|
|
|
2016-03-09 17:06:17 +00:00
|
|
|
var fs = require( "fs" );
|
2015-01-28 19:37:29 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
module.exports = function( Release ) {
|
2011-04-26 20:23:09 +00:00
|
|
|
|
2020-03-02 21:42:38 +00:00
|
|
|
const distFiles = [
|
|
|
|
"dist/jquery.js",
|
|
|
|
"dist/jquery.min.js",
|
|
|
|
"dist/jquery.min.map",
|
|
|
|
"dist/jquery.slim.js",
|
|
|
|
"dist/jquery.slim.min.js",
|
|
|
|
"dist/jquery.slim.min.map"
|
|
|
|
];
|
|
|
|
const filesToCommit = [
|
|
|
|
...distFiles,
|
|
|
|
"src/core.js"
|
|
|
|
];
|
|
|
|
const cdn = require( "./release/cdn" );
|
|
|
|
const dist = require( "./release/dist" );
|
2013-12-20 22:13:48 +00:00
|
|
|
|
2020-03-02 21:42:38 +00:00
|
|
|
const npmTags = Release.npmTags;
|
2013-12-20 22:13:48 +00:00
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
Release.define( {
|
2014-01-10 12:45:01 +00:00
|
|
|
npmPublish: true,
|
2015-01-28 19:37:29 +00:00
|
|
|
issueTracker: "github",
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2016-03-09 17:06:17 +00:00
|
|
|
/**
|
|
|
|
* Set the version in the src folder for distributing AMD
|
|
|
|
*/
|
|
|
|
_setSrcVersion: function() {
|
|
|
|
var corePath = __dirname + "/../src/core.js",
|
|
|
|
contents = fs.readFileSync( corePath, "utf8" );
|
|
|
|
contents = contents.replace( /@VERSION/g, Release.newVersion );
|
|
|
|
fs.writeFileSync( corePath, contents, "utf8" );
|
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
|
|
|
* Generates any release artifacts that should be included in the release.
|
|
|
|
* The callback must be invoked with an array of files that should be
|
|
|
|
* committed before creating the tag.
|
|
|
|
* @param {Function} callback
|
|
|
|
*/
|
|
|
|
generateArtifacts: function( callback ) {
|
2024-01-31 14:18:57 +00:00
|
|
|
Release.exec( "npm run build:all" );
|
2023-07-10 18:45:30 +00:00
|
|
|
|
2015-01-28 19:37:29 +00:00
|
|
|
cdn.makeReleaseCopies( Release );
|
2016-03-09 17:06:17 +00:00
|
|
|
Release._setSrcVersion();
|
2019-10-04 14:13:14 +00:00
|
|
|
callback( filesToCommit );
|
2013-12-20 22:13:48 +00:00
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
2015-01-28 19:37:29 +00:00
|
|
|
* Acts as insertion point for restoring Release.dir.repo
|
|
|
|
* It was changed to reuse npm publish code in jquery-release
|
|
|
|
* for publishing the distribution repo instead
|
2013-12-20 22:13:48 +00:00
|
|
|
*/
|
2015-01-28 19:37:29 +00:00
|
|
|
npmTags: function() {
|
2015-08-16 06:59:58 +00:00
|
|
|
|
2015-01-28 19:37:29 +00:00
|
|
|
// origRepo is not defined if dist was skipped
|
|
|
|
Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
|
|
|
|
return npmTags();
|
2013-12-20 22:13:48 +00:00
|
|
|
},
|
2016-05-10 09:12:28 +00:00
|
|
|
|
2013-12-20 22:13:48 +00:00
|
|
|
/**
|
2015-01-28 19:37:29 +00:00
|
|
|
* Publish to distribution repo and npm
|
|
|
|
* @param {Function} callback
|
2013-12-20 22:13:48 +00:00
|
|
|
*/
|
2023-08-28 13:30:59 +00:00
|
|
|
dist: function( callback ) {
|
|
|
|
cdn.makeArchives( Release, function() {
|
|
|
|
dist( Release, distFiles, callback );
|
|
|
|
} );
|
2013-12-20 22:13:48 +00:00
|
|
|
}
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|
2013-12-20 22:13:48 +00:00
|
|
|
};
|
2014-03-18 15:48:21 +00:00
|
|
|
|
|
|
|
module.exports.dependencies = [
|
2021-03-01 21:48:41 +00:00
|
|
|
"archiver@5.2.0",
|
|
|
|
"shelljs@0.8.4",
|
|
|
|
"inquirer@8.0.0",
|
|
|
|
"chalk@4.1.0"
|
2014-03-18 15:48:21 +00:00
|
|
|
];
|