Skip to content

Commit 6e3be78

Browse files
authored
Merge pull request #494 from ckeditor/i/493
Switch to the new changelog
2 parents 65bffd0 + f40c541 commit 6e3be78

8 files changed

Lines changed: 341 additions & 262 deletions

File tree

.changelog/.gitkeep

Whitespace-only changes.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention))
1+
<!--
22
3-
Type: Message. Closes #000.
3+
This repository uses Markdown files to define changelog entries. If the changes in this pull request are **user-facing**, please create a changelog entry by running the following command:
4+
5+
yarn run nice
6+
7+
This will generate a `*.md` file in the `.changelog/` directory for your description. You can create as many as you need.
8+
9+
**Note:**
10+
If your PR is internal-only (e.g., tests, tooling, docs), you can skip this step - just mention it below.
11+
12+
-->
13+
14+
### 🚀 Summary
15+
16+
*A brief summary of what this PR changes.*
17+
18+
---
19+
20+
### 📌 Related issues
21+
22+
<!--
23+
24+
Although changelog entries list connected issues, GitHub requires listing them here to automatically link and close them.
25+
26+
-->
27+
28+
* Closes #000
429

530
---
631

7-
### Additional information
32+
### 💡 Additional information
833

9-
*For example – encountered issues, assumptions you had to make, other affected tickets, etc.*
34+
*Optional: Notes on decisions, edge cases, or anything helpful for reviewers.*

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,14 @@ Before you start, you need to prepare the changelog entries.
149149

150150
1. Make sure the `#master` branch is up-to-date: `git fetch && git checkout master && git pull`.
151151
1. Prepare a release branch: `git checkout -b release-[YYYYMMDD]` where `YYYYMMDD` is the current day.
152-
1. Generate the changelog entries: `yarn run changelog --branch release-[YYYYMMDD] [--from [GIT_TAG]]`.
153-
* By default, the changelog generator uses the latest published tag as a starting point for collecting commits to process.
154-
155-
The `--from` modifier option allows overriding the default behavior. It is required when preparing the changelog entries for the next stable release while the previous one was marked as a prerelease, e.g., `@alpha`.
156-
157-
**Example**: Let's assume that the `v40.5.0-alpha.0` tag is our latest and that we want to release it on a stable channel. The `--from` modifier should be equal to `--from v40.4.0`.
158-
* This task checks what changed in each package and bumps the version accordingly. It won't create a new changelog entry if nothing changes at all. If changes were irrelevant (e.g., only dependencies), it would make an "_internal changes_" entry.
159-
* Scan the logs printed by the tool to search for errors (incorrect changelog entries). Incorrect entries (e.g., ones without the type) should be addressed. You may need to create entries for them manually. This is done directly in CHANGELOG.md (in the root directory). Make sure to verify the proposed version after you modify the changelog.
152+
1. Generate the changelog entries: `yarn run release:prepare-changelog`.
153+
* You can specify the release date by passing the `--date` option, e.g., `--date=2025-06-11`.
154+
* By passing the `--dry-run` option, you can check what the script will do without actually modifying the files.
155+
* Read all the entries, correct poor wording and other issues, wrap code names in backticks to format them, etc.
156+
* Add the missing `the/a` articles, `()` to method names, "it's" -> "its", etc.
157+
* A newly introduced feature should have just one changelog entry – something like "The initial implementation of the FOO feature." with a description of what it does.
160158
1. Commit all changes and prepare a new pull request targeting the `#master` branch.
161-
1. Ping the `@ckeditor/ckeditor-5-devops` team to review the pull request and trigger the release process.
159+
1. Ping the `@ckeditor/ckeditor-5-platform` team to review the pull request and trigger the release process.
162160

163161
## License
164162

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"private": true,
66
"description": "Official Angular component for CKEditor 5 – the best browser-based rich text editor.",
77
"scripts": {
8+
"nice": "ckeditor5-dev-changelog-create-entry",
89
"postinstall": "node ./scripts/postinstall.js",
910
"start": "ng serve",
1011
"build": "ng build --configuration production",
@@ -13,8 +14,8 @@
1314
"test:e2e:ci": "start-server-and-test 'yarn run start' http://localhost:4200/ 'yarn run test:e2e --quiet'",
1415
"coverage": "ng test --watch=false --code-coverage",
1516
"lint": "eslint",
16-
"changelog": "node ./scripts/changelog.mjs",
1717
"build-package": "ng-packagr -p src/ckeditor/ng-package.json",
18+
"release:prepare-changelog": "node scripts/preparechangelog.mjs",
1819
"release:prepare-packages": "node scripts/preparepackages.mjs",
1920
"release:publish-packages": "node scripts/publishpackages.mjs"
2021
},
@@ -38,10 +39,11 @@
3839
"@angular/cli": "^16",
3940
"@angular/compiler-cli": "^16",
4041
"@angular/language-service": "^16",
41-
"@ckeditor/ckeditor5-dev-bump-year": "^49.0.0",
42-
"@ckeditor/ckeditor5-dev-ci": "^49.0.0",
43-
"@ckeditor/ckeditor5-dev-release-tools": "^49.0.0",
44-
"@ckeditor/ckeditor5-dev-utils": "^49.0.0",
42+
"@ckeditor/ckeditor5-dev-bump-year": "^50.0.0",
43+
"@ckeditor/ckeditor5-dev-changelog": "^50.0.0",
44+
"@ckeditor/ckeditor5-dev-ci": "^50.0.0",
45+
"@ckeditor/ckeditor5-dev-release-tools": "^50.0.0",
46+
"@ckeditor/ckeditor5-dev-utils": "^50.0.0",
4547
"@types/jasminewd2": "^2.0.10",
4648
"@types/node": "^14.11.8",
4749
"ckeditor5": "^44.3.0",

scripts/changelog.mjs

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/preparechangelog.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4+
*/
5+
6+
import upath from 'upath';
7+
import { fileURLToPath } from 'url';
8+
import { generateChangelogForSingleRepository } from '@ckeditor/ckeditor5-dev-changelog';
9+
import parseArguments from './utils/parsearguments.mjs';
10+
11+
const __filename = fileURLToPath( import.meta.url );
12+
const __dirname = upath.dirname( __filename );
13+
const ROOT_DIRECTORY = upath.join( __dirname, '..' );
14+
15+
const cliOptions = parseArguments( process.argv.slice( 2 ) );
16+
17+
const changelogOptions = {
18+
cwd: ROOT_DIRECTORY,
19+
disableFilesystemOperations: cliOptions.dryRun
20+
};
21+
22+
if ( cliOptions.date ) {
23+
changelogOptions.date = cliOptions.date;
24+
}
25+
26+
generateChangelogForSingleRepository( changelogOptions )
27+
.then( maybeChangelog => {
28+
if ( maybeChangelog ) {
29+
console.log( maybeChangelog );
30+
}
31+
} );

scripts/utils/parsearguments.mjs

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,33 @@ export default function parseArguments( cliArguments ) {
1414
boolean: [
1515
'verbose',
1616
'compile-only',
17-
'ci'
17+
'ci',
18+
'dry-run'
1819
],
1920

2021
string: [
2122
'branch',
22-
'npm-tag'
23+
'npm-tag',
24+
'date'
2325
],
2426

2527
default: {
2628
branch: 'master',
2729
ci: false,
2830
'compile-only': false,
2931
'npm-tag': null,
30-
verbose: false
32+
verbose: false,
33+
'dry-run': false
3134
}
3235
};
3336

3437
const options = minimist( cliArguments, config );
3538

36-
options.compileOnly = options[ 'compile-only' ];
37-
delete options[ 'compile-only' ];
38-
39-
options.npmTag = options[ 'npm-tag' ];
40-
delete options[ 'npm-tag' ];
39+
replaceKebabCaseWithCamelCase( options, [
40+
'npm-tag',
41+
'compile-only',
42+
'dry-run'
43+
] );
4144

4245
if ( process.env.CI ) {
4346
options.ci = true;
@@ -46,6 +49,27 @@ export default function parseArguments( cliArguments ) {
4649
return options;
4750
}
4851

52+
function replaceKebabCaseWithCamelCase( options, keys ) {
53+
for ( const key of keys ) {
54+
const camelCaseKey = toCamelCase( key );
55+
56+
options[ camelCaseKey ] = options[ key ];
57+
delete options[ key ];
58+
}
59+
}
60+
61+
function toCamelCase( value ) {
62+
return value.split( '-' )
63+
.map( ( item, index ) => {
64+
if ( index == 0 ) {
65+
return item.toLowerCase();
66+
}
67+
68+
return item.charAt( 0 ).toUpperCase() + item.slice( 1 ).toLowerCase();
69+
} )
70+
.join( '' );
71+
}
72+
4973
/**
5074
* @typedef {Object} ReleaseOptions
5175
*
@@ -58,4 +82,8 @@ export default function parseArguments( cliArguments ) {
5882
* @property {Boolean} [verbose=false]
5983
*
6084
* @property {Boolean} [ci=false]
85+
*
86+
* @property {Boolean} [dryRun=false]
87+
*
88+
* @property {String} [date]
6189
*/

0 commit comments

Comments
 (0)