@ckeditor/ckeditor5-dev-release-tools 36.0.1 → 37.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -284,7 +284,7 @@ module.exports = async function releaseSubRepositories( options ) {
|
|
|
284
284
|
const packageJson = getPackageJson( options.cwd );
|
|
285
285
|
logProcess( 'Verifying the npm tag...' );
|
|
286
286
|
|
|
287
|
-
const
|
|
287
|
+
const versionTag = getVersionTag( packageJson.version );
|
|
288
288
|
|
|
289
289
|
if ( versionTag !== npmTag ) {
|
|
290
290
|
log.warning( '⚠️ The version tag is different from the npm tag.' );
|
|
@@ -427,7 +427,7 @@ module.exports = async function releaseSubRepositories( options ) {
|
|
|
427
427
|
throw new Error( MISSING_FILES_MESSAGE );
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
const npmVersion = getVersionFromNpm( packageJson.name );
|
|
430
|
+
const npmVersion = getVersionFromNpm( packageJson.name, npmTag );
|
|
431
431
|
|
|
432
432
|
logDryRun( `Versions: package.json: "${ releaseDetails.version }", npm: "${ npmVersion || 'initial release' }".` );
|
|
433
433
|
|
|
@@ -545,9 +545,9 @@ module.exports = async function releaseSubRepositories( options ) {
|
|
|
545
545
|
// Checks whether specified `packageName` has been published on npm.
|
|
546
546
|
// If so, returns its version. Otherwise returns `null` which means that
|
|
547
547
|
// this package will be published for the first time.
|
|
548
|
-
function getVersionFromNpm( packageName ) {
|
|
548
|
+
function getVersionFromNpm( packageName, npmTag ) {
|
|
549
549
|
try {
|
|
550
|
-
return exec( `npm show ${ packageName } version` ).trim();
|
|
550
|
+
return exec( `npm show ${ packageName }@${ npmTag } version` ).trim();
|
|
551
551
|
} catch ( err ) {
|
|
552
552
|
if ( err.message.match( /npm ERR! 404/ ) ) {
|
|
553
553
|
return null;
|
|
@@ -869,11 +869,14 @@ module.exports = async function releaseSubRepositories( options ) {
|
|
|
869
869
|
return Promise.resolve();
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
+
const versionTag = getVersionTag( releaseDetails.version );
|
|
873
|
+
|
|
872
874
|
const githubReleaseOptions = {
|
|
873
875
|
repositoryOwner: releaseDetails.repositoryOwner,
|
|
874
876
|
repositoryName: releaseDetails.repositoryName,
|
|
875
877
|
version: `v${ releaseDetails.version }`,
|
|
876
|
-
description: releaseDetails.changes
|
|
878
|
+
description: releaseDetails.changes,
|
|
879
|
+
isPrerelease: versionTag !== 'latest'
|
|
877
880
|
};
|
|
878
881
|
|
|
879
882
|
return createGithubRelease( releaseOptions.token, githubReleaseOptions )
|
|
@@ -894,6 +897,21 @@ module.exports = async function releaseSubRepositories( options ) {
|
|
|
894
897
|
);
|
|
895
898
|
}
|
|
896
899
|
|
|
900
|
+
/**
|
|
901
|
+
* Returns the version tag for the package.
|
|
902
|
+
*
|
|
903
|
+
* For the official release, returns the "latest" tag. For a non-official release (pre-release), returns the version tag extracted from
|
|
904
|
+
* the package version.
|
|
905
|
+
*
|
|
906
|
+
* @param {String} version Version of the package to be released.
|
|
907
|
+
* @returns {String}
|
|
908
|
+
*/
|
|
909
|
+
function getVersionTag( version ) {
|
|
910
|
+
const [ versionTag ] = semver.prerelease( version ) || [ 'latest' ];
|
|
911
|
+
|
|
912
|
+
return versionTag;
|
|
913
|
+
}
|
|
914
|
+
|
|
897
915
|
// Removes all temporary directories that were created for publishing the custom repository.
|
|
898
916
|
//
|
|
899
917
|
// @returns {Promise}
|
|
@@ -14,7 +14,7 @@ const glob = require( 'glob' );
|
|
|
14
14
|
const { diffLines: diff } = require( 'diff' );
|
|
15
15
|
|
|
16
16
|
// The pattern defines CKEditor 5 dependencies.
|
|
17
|
-
const CKEDITOR5_DEPENDENCY_PATTERN = /^@ckeditor\/ckeditor5-(.*)|^ckeditor5
|
|
17
|
+
const CKEDITOR5_DEPENDENCY_PATTERN = /^@ckeditor\/ckeditor5-(.*)|^ckeditor5(-collaboration)?$/;
|
|
18
18
|
|
|
19
19
|
// Packages that match the CKEditor 5 pattern but should not be updated because they aren't a dependency of the project.
|
|
20
20
|
const PATTERNS_TO_SKIP = [
|
|
@@ -16,6 +16,7 @@ const { Octokit } = require( '@octokit/rest' );
|
|
|
16
16
|
* @param {String} options.repositoryName Repository name.
|
|
17
17
|
* @param {String} options.version Name of tag connected with the release.
|
|
18
18
|
* @param {String} options.description Description of the release.
|
|
19
|
+
* @param {Boolean} options.isPrerelease Indicates whether the release is a pre-release.
|
|
19
20
|
* @returns {Promise}
|
|
20
21
|
*/
|
|
21
22
|
module.exports = function createGithubRelease( token, options ) {
|
|
@@ -28,7 +29,8 @@ module.exports = function createGithubRelease( token, options ) {
|
|
|
28
29
|
owner: options.repositoryOwner,
|
|
29
30
|
repo: options.repositoryName,
|
|
30
31
|
tag_name: options.version,
|
|
31
|
-
body: options.description
|
|
32
|
+
body: options.description,
|
|
33
|
+
prerelease: options.isPrerelease
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
return github.repos.createRelease( releaseParams );
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.1",
|
|
4
4
|
"description": "Tools used for releasing CKEditor 5 and related packages.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
8
|
+
"@ckeditor/ckeditor5-dev-utils": "^37.0.1",
|
|
9
9
|
"@octokit/rest": "^17.9.2",
|
|
10
10
|
"chalk": "^4.0.0",
|
|
11
11
|
"cli-table": "^0.3.1",
|