Skip to content

Commit 121bc89

Browse files
authored
Merge pull request #367 from ckeditor/i/363-new-changelog
Switch to the new changelog.
2 parents 04d5bbb + 3d140b8 commit 121bc89

File tree

9 files changed

+387
-274
lines changed

9 files changed

+387
-274
lines changed

.changelog/.gitkeep

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
type: Other
3+
---
4+
5+
Added logging CDN fetch errors to console when an exception is thrown.

.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
@@ -70,16 +70,14 @@ Before you start, you need to prepare the changelog entries.
7070

7171
1. Make sure the `#master` branch is up-to-date: `git fetch && git checkout master && git pull`.
7272
1. Prepare a release branch: `git checkout -b release-[YYYYMMDD]` where `YYYYMMDD` is the current day.
73-
1. Generate the changelog entries: `yarn run changelog --branch release-[YYYYMMDD] [--from [GIT_TAG]]`.
74-
* By default, the changelog generator uses the latest published tag as a starting point for collecting commits to process.
75-
76-
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`.
77-
78-
**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`.
79-
* 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.
80-
* 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.
73+
1. Generate the changelog entries: `yarn run release:prepare-changelog`.
74+
* You can specify the release date by passing the `--date` option, e.g., `--date=2025-06-11`.
75+
* By passing the `--dry-run` option, you can check what the script will do without actually modifying the files.
76+
* Read all the entries, correct poor wording and other issues, wrap code names in backticks to format them, etc.
77+
* Add the missing `the/a` articles, `()` to method names, "it's" -> "its", etc.
78+
* 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.
8179
1. Commit all changes and prepare a new pull request targeting the `#master` branch.
82-
1. Ping the `@ckeditor/ckeditor-5-devops` team to review the pull request and trigger the release process.
80+
1. Ping the `@ckeditor/ckeditor-5-platform` team to review the pull request and trigger the release process.
8381

8482
## License
8583

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
"vue": "^3.4.0"
3939
},
4040
"devDependencies": {
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",
41+
"@ckeditor/ckeditor5-dev-bump-year": "^50.0.0",
42+
"@ckeditor/ckeditor5-dev-changelog": "^50.0.0",
43+
"@ckeditor/ckeditor5-dev-ci": "^50.0.0",
44+
"@ckeditor/ckeditor5-dev-release-tools": "^50.0.0",
45+
"@ckeditor/ckeditor5-dev-utils": "^50.0.0",
4546
"@types/lodash-es": "^4.17.6",
4647
"@vitejs/plugin-vue": "^5.0.5",
4748
"@vitest/browser": "^2.1.9",
@@ -63,6 +64,7 @@
6364
"semver": "^7.0.0",
6465
"typescript": "~5.4.5",
6566
"typescript-eslint": "^8.32.1",
67+
"upath": "^2.0.1",
6668
"vite": "^5.3.1",
6769
"vitest": "^2.1.9",
6870
"vue": "^3.4.30",
@@ -80,14 +82,15 @@
8082
"node": ">=22.0.0"
8183
},
8284
"scripts": {
85+
"nice": "ckeditor5-dev-changelog-create-entry",
8386
"dev": "vite",
8487
"build": "tsc --noEmit && vite build && vue-tsc --emitDeclarationOnly",
8588
"test": "vitest run --coverage",
8689
"test:watch": "vitest --ui --watch",
8790
"test:check:types": "tsc --noEmit -p ./tests/tsconfig.json",
8891
"lint": "eslint",
8992
"postinstall": "node ./scripts/postinstall.js",
90-
"changelog": "node ./scripts/changelog.js",
93+
"release:prepare-changelog": "node ./scripts/preparechangelog.js",
9194
"release:prepare-packages": "node ./scripts/preparepackages.js",
9295
"release:publish-packages": "node ./scripts/publishpackages.js"
9396
},

scripts/changelog.js

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

scripts/preparechangelog.js

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 { generateChangelogForSingleRepository } from '@ckeditor/ckeditor5-dev-changelog';
7+
import parseArguments from './utils/parsearguments.js';
8+
import { fileURLToPath } from 'url';
9+
import upath from 'upath';
10+
11+
const cliOptions = parseArguments( process.argv.slice( 2 ) );
12+
13+
const __filename = fileURLToPath( import.meta.url );
14+
const __dirname = upath.dirname( __filename );
15+
const ROOT_DIRECTORY = upath.join( __dirname, '..' );
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.js

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,35 @@ 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',
2223
'from',
23-
'npm-tag'
24+
'npm-tag',
25+
'date'
2426
],
2527

2628
default: {
2729
branch: 'master',
2830
ci: false,
2931
'compile-only': false,
3032
'npm-tag': null,
31-
verbose: false
33+
verbose: false,
34+
date: undefined,
35+
'dry-run': false
3236
}
3337
};
3438

3539
const options = minimist( cliArguments, config );
3640

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

4347
if ( process.env.CI ) {
4448
options.ci = true;
@@ -47,6 +51,27 @@ export default function parseArguments( cliArguments ) {
4751
return options;
4852
}
4953

54+
function replaceKebabCaseWithCamelCase( options, keys ) {
55+
for ( const key of keys ) {
56+
const camelCaseKey = toCamelCase( key );
57+
58+
options[ camelCaseKey ] = options[ key ];
59+
delete options[ key ];
60+
}
61+
}
62+
63+
function toCamelCase( value ) {
64+
return value.split( '-' )
65+
.map( ( item, index ) => {
66+
if ( index == 0 ) {
67+
return item.toLowerCase();
68+
}
69+
70+
return item.charAt( 0 ).toUpperCase() + item.slice( 1 ).toLowerCase();
71+
} )
72+
.join( '' );
73+
}
74+
5075
/**
5176
* @typedef {Object} ReleaseOptions
5277
*
@@ -59,4 +84,8 @@ export default function parseArguments( cliArguments ) {
5984
* @property {Boolean} [verbose=false]
6085
*
6186
* @property {Boolean} [ci=false]
87+
*
88+
* @property {String} [date=undefined]
89+
*
90+
* @property {Boolean} [dryRun=false]
6291
*/

0 commit comments

Comments
 (0)