3 var fs = require( "fs" );
5 module.exports = function( Release ) {
10 "dist/jquery.min.map",
11 "dist/jquery.slim.js",
12 "dist/jquery.slim.min.js",
13 "dist/jquery.slim.min.map",
14 "dist-module/jquery.module.js",
15 "dist-module/jquery.module.min.js",
16 "dist-module/jquery.module.min.map",
17 "dist-module/jquery.slim.module.js",
18 "dist-module/jquery.slim.module.min.js",
19 "dist-module/jquery.slim.module.min.map"
21 const filesToCommit = [
25 const cdn = require( "./release/cdn" );
26 const dist = require( "./release/dist" );
28 const npmTags = Release.npmTags;
30 function setSrcVersion( filepath ) {
31 var contents = fs.readFileSync( filepath, "utf8" );
32 contents = contents.replace( /@VERSION/g, Release.newVersion );
33 fs.writeFileSync( filepath, contents, "utf8" );
38 issueTracker: "github",
41 * Set the version in the src folder for distributing ES modules.
43 _setSrcVersion: function() {
44 setSrcVersion( `${ __dirname }/../src/core.js` );
48 * Generates any release artifacts that should be included in the release.
49 * The callback must be invoked with an array of files that should be
50 * committed before creating the tag.
51 * @param {Function} callback
53 generateArtifacts: function( callback ) {
54 Release.exec( "npx grunt" );
56 cdn.makeReleaseCopies( Release );
57 Release._setSrcVersion();
58 callback( filesToCommit );
62 * Acts as insertion point for restoring Release.dir.repo
63 * It was changed to reuse npm publish code in jquery-release
64 * for publishing the distribution repo instead
68 // origRepo is not defined if dist was skipped
69 Release.dir.repo = Release.dir.origRepo || Release.dir.repo;
74 * Publish to distribution repo and npm
75 * @param {Function} callback
77 dist: async callback => {
78 await cdn.makeArchives( Release );
79 dist( Release, distFiles, callback );
84 module.exports.dependencies = [