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/jquery.factory.js",
15 "dist/jquery.factory.slim.js",
16 "dist-module/jquery.module.js",
17 "dist-module/jquery.module.min.js",
18 "dist-module/jquery.module.min.map",
19 "dist-module/jquery.slim.module.js",
20 "dist-module/jquery.slim.module.min.js",
21 "dist-module/jquery.slim.module.min.map",
22 "dist-module/jquery.factory.module.js",
23 "dist-module/jquery.factory.slim.module.js"
25 const filesToCommit
= [
29 const cdn
= require( "./release/cdn" );
30 const dist
= require( "./release/dist" );
31 const { buildDefaultFiles
} = require( "./tasks/build" );
33 const npmTags
= Release
.npmTags
;
35 function setSrcVersion( filepath
) {
36 var contents
= fs
.readFileSync( filepath
, "utf8" );
37 contents
= contents
.replace( /@VERSION/g, Release
.newVersion
);
38 fs
.writeFileSync( filepath
, contents
, "utf8" );
43 issueTracker
: "github",
45 // Update cdn location to versioned files
46 cdnPublish
: "dist/cdn/versioned",
49 * Set the version in the src folder for distributing ES modules.
51 _setSrcVersion: function() {
52 setSrcVersion( `${ __dirname }/../src/core.js` );
56 * Generates any release artifacts that should be included in the release.
57 * The callback must be invoked with an array of files that should be
58 * committed before creating the tag.
59 * @param {Function} callback
61 generateArtifacts
: async
function( callback
) {
62 await
buildDefaultFiles( { version
: Release
.newVersion
} );
64 cdn
.makeReleaseCopies( Release
);
65 Release
._setSrcVersion();
66 callback( filesToCommit
);
70 * Acts as insertion point for restoring Release.dir.repo
71 * It was changed to reuse npm publish code in jquery-release
72 * for publishing the distribution repo instead
76 // origRepo is not defined if dist was skipped
77 Release
.dir
.repo
= Release
.dir
.origRepo
|| Release
.dir
.repo
;
82 * Publish to distribution repo and npm
83 * @param {Function} callback
85 dist
: async
function( callback
) {
86 await cdn
.makeArchives( Release
);
87 dist( Release
, distFiles
, callback
);
92 module
.exports
.dependencies
= [