@ckeditor/ckeditor5-dev-release-tools 44.0.0-alpha.0 → 44.0.0-alpha.2
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.
- package/lib/tasks/commitandtag.js +7 -3
- package/lib/tasks/generatechangelogformonorepository.js +7 -3
- package/lib/tasks/generatechangelogforsinglepackage.js +6 -3
- package/lib/utils/generatechangelog.js +2 -2
- package/lib/utils/getcommits.js +7 -7
- package/lib/utils/getpackagespaths.js +1 -1
- package/lib/utils/getwriteroptions.js +7 -1
- package/lib/utils/transformcommitfactory.js +1 -3
- package/package.json +15 -15
|
@@ -38,7 +38,11 @@ export default async function commitAndTag( { version, files, cwd = process.cwd(
|
|
|
38
38
|
await tools.shExec( `git add ${ shellEscape( [ filePath ] ) }`, shExecOptions );
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const escapedVersion =
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const escapedVersion = {
|
|
42
|
+
commit: shellEscape( [ `Release: v${ version }.` ] ),
|
|
43
|
+
tag: shellEscape( [ `v${ version }` ] )
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
await tools.shExec( `git commit --message ${ escapedVersion.commit } --no-verify`, shExecOptions );
|
|
47
|
+
await tools.shExec( `git tag ${ escapedVersion.tag }`, shExecOptions );
|
|
44
48
|
}
|
|
@@ -53,6 +53,8 @@ const noteInfo = `[ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-c
|
|
|
53
53
|
*
|
|
54
54
|
* @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
|
|
55
55
|
*
|
|
56
|
+
* @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
|
|
57
|
+
*
|
|
56
58
|
* @param {Array.<ExternalRepository>} [options.externalRepositories=[]] An array of object with additional repositories
|
|
57
59
|
* that the function takes into consideration while gathering commits. It assumes that those directories are also mono repositories.
|
|
58
60
|
*
|
|
@@ -85,6 +87,7 @@ export default async function generateChangelogForMonoRepository( options ) {
|
|
|
85
87
|
cwd: options.cwd,
|
|
86
88
|
from: options.from ? options.from : 'v' + rootPkgJson.version,
|
|
87
89
|
releaseBranch: options.releaseBranch || 'master',
|
|
90
|
+
mainBranch: options.mainBranch || 'master',
|
|
88
91
|
externalRepositories: options.externalRepositories || []
|
|
89
92
|
};
|
|
90
93
|
|
|
@@ -225,7 +228,8 @@ export default async function generateChangelogForMonoRepository( options ) {
|
|
|
225
228
|
|
|
226
229
|
const commitOptions = {
|
|
227
230
|
from: options.from,
|
|
228
|
-
releaseBranch: options.releaseBranch
|
|
231
|
+
releaseBranch: options.releaseBranch,
|
|
232
|
+
mainBranch: options.mainBranch
|
|
229
233
|
};
|
|
230
234
|
|
|
231
235
|
let promise = getCommits( transformCommit, commitOptions )
|
|
@@ -415,9 +419,9 @@ export default async function generateChangelogForMonoRepository( options ) {
|
|
|
415
419
|
date: options.formatDate ? options.formatDate( new Date() ) : getFormattedDate()
|
|
416
420
|
};
|
|
417
421
|
|
|
418
|
-
const writerOptions = getWriterOptions( {
|
|
422
|
+
const writerOptions = getWriterOptions( commit => {
|
|
419
423
|
// We do not allow modifying the commit hash value by the generator itself.
|
|
420
|
-
|
|
424
|
+
return commit;
|
|
421
425
|
} );
|
|
422
426
|
|
|
423
427
|
writerOptions.commitsSort = sortFunctionFactory( 'rawScope' );
|
|
@@ -36,6 +36,8 @@ const SKIP_GENERATE_CHANGELOG = 'Typed "skip" as a new version. Aborting.';
|
|
|
36
36
|
*
|
|
37
37
|
* @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
|
|
38
38
|
*
|
|
39
|
+
* @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
|
|
40
|
+
*
|
|
39
41
|
* @param {FormatDateCallback} [options.formatDate] A callback allowing defining a custom format of the date inserted into the changelog.
|
|
40
42
|
* If not specified, the default date matches the `YYYY-MM-DD` pattern.
|
|
41
43
|
*
|
|
@@ -53,7 +55,8 @@ export default async function generateChangelogForSinglePackage( options = {} )
|
|
|
53
55
|
|
|
54
56
|
const commitOptions = {
|
|
55
57
|
from: options.from ? options.from : 'v' + pkgJson.version,
|
|
56
|
-
releaseBranch: options.releaseBranch
|
|
58
|
+
releaseBranch: options.releaseBranch || 'master',
|
|
59
|
+
mainBranch: options.mainBranch || 'master'
|
|
57
60
|
};
|
|
58
61
|
|
|
59
62
|
// Initial release.
|
|
@@ -110,9 +113,9 @@ export default async function generateChangelogForSinglePackage( options = {} )
|
|
|
110
113
|
date: options.formatDate ? options.formatDate( new Date() ) : getFormattedDate()
|
|
111
114
|
};
|
|
112
115
|
|
|
113
|
-
const writerOptions = getWriterOptions( {
|
|
116
|
+
const writerOptions = getWriterOptions( commit => {
|
|
114
117
|
// We do not allow modifying the commit hash value by the generator itself.
|
|
115
|
-
|
|
118
|
+
return commit;
|
|
116
119
|
} );
|
|
117
120
|
|
|
118
121
|
const publicCommits = [ ...allCommits ]
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { Readable } from 'stream';
|
|
7
7
|
import { stream } from '@ckeditor/ckeditor5-dev-utils';
|
|
8
|
-
import
|
|
8
|
+
import { writeChangelogStream } from 'conventional-changelog-writer';
|
|
9
9
|
|
|
10
10
|
const UPDATED_TRANSLATION_COMMIT = '* Updated translations.';
|
|
11
11
|
|
|
@@ -49,7 +49,7 @@ export default function generateChangelog( commits, context, options ) {
|
|
|
49
49
|
|
|
50
50
|
return new Promise( ( resolve, reject ) => {
|
|
51
51
|
commitStream
|
|
52
|
-
.pipe(
|
|
52
|
+
.pipe( writeChangelogStream( context, options ) )
|
|
53
53
|
.pipe( stream.noop( changes => {
|
|
54
54
|
changes = mergeUpdateTranslationsCommits( changes.toString(), {
|
|
55
55
|
skipCommitsLink: context.skipCommitsLink
|
package/lib/utils/getcommits.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { parseCommitsStream } from 'conventional-commits-parser';
|
|
7
|
+
import { filterRevertedCommitsSync } from 'conventional-commits-filter';
|
|
8
|
+
import { getRawCommitsStream } from 'git-raw-commits';
|
|
9
9
|
import concat from 'concat-stream';
|
|
10
10
|
import parserOptions from './parseroptions.js';
|
|
11
11
|
import { tools } from '@ckeditor/ckeditor5-dev-utils';
|
|
@@ -45,7 +45,7 @@ export default function getCommits( transformCommit, options = {} ) {
|
|
|
45
45
|
// 1. Commits from the last release and to the point where the release branch was created (the merge-base commit).
|
|
46
46
|
findCommits( { from: options.from, to: baseCommit } ),
|
|
47
47
|
// 2. Commits from the merge-base commit to HEAD.
|
|
48
|
-
findCommits( { from: baseCommit } )
|
|
48
|
+
findCommits( { from: baseCommit, to: 'HEAD' } )
|
|
49
49
|
];
|
|
50
50
|
|
|
51
51
|
return Promise.all( commitPromises )
|
|
@@ -60,7 +60,7 @@ export default function getCommits( transformCommit, options = {} ) {
|
|
|
60
60
|
} );
|
|
61
61
|
|
|
62
62
|
return new Promise( ( resolve, reject ) => {
|
|
63
|
-
const stream =
|
|
63
|
+
const stream = getRawCommitsStream( gitRawCommitsOpts )
|
|
64
64
|
.on( 'error', err => {
|
|
65
65
|
/* istanbul ignore else */
|
|
66
66
|
if ( err.message.match( /'HEAD': unknown/ ) ) {
|
|
@@ -74,9 +74,9 @@ export default function getCommits( transformCommit, options = {} ) {
|
|
|
74
74
|
}
|
|
75
75
|
} );
|
|
76
76
|
|
|
77
|
-
stream.pipe(
|
|
77
|
+
stream.pipe( parseCommitsStream( parserOptions ) )
|
|
78
78
|
.pipe( concat( data => {
|
|
79
|
-
const commits =
|
|
79
|
+
const commits = [ ...filterRevertedCommitsSync( data ) ]
|
|
80
80
|
.map( commit => transformCommit( commit ) )
|
|
81
81
|
.reduce( ( allCommits, commit ) => {
|
|
82
82
|
if ( Array.isArray( commit ) ) {
|
|
@@ -14,7 +14,7 @@ const __dirname = path.dirname( __filename );
|
|
|
14
14
|
const templatePath = path.join( __dirname, '..', 'templates' );
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {WriterOptionsTransformCallback} transform
|
|
18
18
|
* @returns {Object}
|
|
19
19
|
*/
|
|
20
20
|
export default function getWriterOptions( transform ) {
|
|
@@ -34,3 +34,9 @@ export default function getWriterOptions( transform ) {
|
|
|
34
34
|
function sortFunction( a, b ) {
|
|
35
35
|
return getTypeOrder( a.title ) - getTypeOrder( b.title );
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @callback WriterOptionsTransformCallback
|
|
40
|
+
* @param {Commit}
|
|
41
|
+
* @returns {Commit}
|
|
42
|
+
*/
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import { cloneDeepWith } from 'lodash-es';
|
|
7
7
|
import * as utils from './transformcommitutils.js';
|
|
8
8
|
import getChangedFilesForCommit from './getchangedfilesforcommit.js';
|
|
9
9
|
|
|
10
|
-
const { cloneDeepWith } = lodash;
|
|
11
|
-
|
|
12
10
|
// Squash commit follows the pattern: "A pull request title (#{number})".
|
|
13
11
|
const SQUASH_COMMIT_REGEXP = /^[\W\w]+ \(#\d+\)$/;
|
|
14
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "44.0.0-alpha.
|
|
3
|
+
"version": "44.0.0-alpha.2",
|
|
4
4
|
"description": "Tools used for releasing CKEditor 5 and related packages.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"lib"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ckeditor/ckeditor5-dev-utils": "^44.0.0-alpha.
|
|
26
|
-
"@octokit/rest": "^
|
|
27
|
-
"chalk": "^
|
|
25
|
+
"@ckeditor/ckeditor5-dev-utils": "^44.0.0-alpha.2",
|
|
26
|
+
"@octokit/rest": "^21.0.0",
|
|
27
|
+
"chalk": "^5.0.0",
|
|
28
28
|
"cli-columns": "^4.0.0",
|
|
29
29
|
"compare-func": "^2.0.0",
|
|
30
30
|
"concat-stream": "^2.0.0",
|
|
31
|
-
"conventional-changelog-writer": "^
|
|
32
|
-
"conventional-commits-filter": "^
|
|
33
|
-
"conventional-commits-parser": "^
|
|
34
|
-
"date-fns": "^
|
|
35
|
-
"fs-extra": "^11.
|
|
36
|
-
"git-raw-commits": "^
|
|
37
|
-
"glob": "^10.
|
|
38
|
-
"inquirer": "^
|
|
39
|
-
"lodash": "^4.17.
|
|
40
|
-
"minimatch": "^
|
|
41
|
-
"semver": "^7.
|
|
31
|
+
"conventional-changelog-writer": "^8.0.0",
|
|
32
|
+
"conventional-commits-filter": "^5.0.0",
|
|
33
|
+
"conventional-commits-parser": "^6.0.0",
|
|
34
|
+
"date-fns": "^4.0.0",
|
|
35
|
+
"fs-extra": "^11.0.0",
|
|
36
|
+
"git-raw-commits": "^5.0.0",
|
|
37
|
+
"glob": "^10.0.0",
|
|
38
|
+
"inquirer": "^11.0.0",
|
|
39
|
+
"lodash-es": "^4.17.21",
|
|
40
|
+
"minimatch": "^9.0.0",
|
|
41
|
+
"semver": "^7.6.3",
|
|
42
42
|
"shell-escape": "^0.2.0",
|
|
43
43
|
"upath": "^2.0.1"
|
|
44
44
|
}
|