@ckeditor/ckeditor5-dev-release-tools 51.1.0 → 52.0.0
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/README.md +1 -72
- package/lib/index.js +0 -3
- package/lib/utils/constants.js +0 -12
- package/lib/utils/validaterepositorytorelease.js +9 -9
- package/package.json +2 -11
- package/lib/tasks/generatechangelogformonorepository.js +0 -771
- package/lib/tasks/generatechangelogforsinglepackage.js +0 -211
- package/lib/templates/commit.hbs +0 -29
- package/lib/templates/footer.hbs +0 -10
- package/lib/templates/header.hbs +0 -23
- package/lib/templates/release-package.json +0 -12
- package/lib/templates/template.hbs +0 -25
- package/lib/utils/displaycommits.js +0 -103
- package/lib/utils/displayskippedpackages.js +0 -32
- package/lib/utils/generatechangelog.js +0 -117
- package/lib/utils/getchangedfilesforcommit.js +0 -31
- package/lib/utils/getcommits.js +0 -103
- package/lib/utils/getformatteddate.js +0 -13
- package/lib/utils/getnewversiontype.js +0 -51
- package/lib/utils/getpackagespaths.js +0 -87
- package/lib/utils/getwriteroptions.js +0 -42
- package/lib/utils/parseroptions.js +0 -24
- package/lib/utils/providenewversionformonorepository.js +0 -67
- package/lib/utils/provideversion.js +0 -115
- package/lib/utils/savechangelog.js +0 -18
- package/lib/utils/transformcommitfactory.js +0 -532
- package/lib/utils/transformcommitutils.js +0 -130
- package/lib/utils/truncatechangelog.js +0 -42
package/README.md
CHANGED
|
@@ -4,81 +4,10 @@ CKEditor 5 release tools
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-dev-release-tools)
|
|
5
5
|
[](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5-dev?branch=master)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Contains tools used during a release of [CKEditor 5](https://ckeditor.com) and related packages.
|
|
8
8
|
|
|
9
9
|
More information about development tools packages can be found at the following URL: <https://github.com/ckeditor/ckeditor5-dev>.
|
|
10
10
|
|
|
11
|
-
## Release tools
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
npm i --save-dev @ckeditor/ckeditor5-dev-release-tools
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Then create a script that run tasks:
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
// scripts/changelog-self.js: Generate changelog for the current package.
|
|
23
|
-
require( '@ckeditor/ckeditor5-dev-release-tools' ).generateChangelogForSinglePackage( /* options */ );
|
|
24
|
-
|
|
25
|
-
// See the `options` argument:
|
|
26
|
-
// https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-release-tools/lib/tasks/generatechangelogforsinglepackage.js#L25-L43
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
```js
|
|
30
|
-
// scripts/changelog-repos.js: Generate changelog for all dependencies (repository using multiple repositories).
|
|
31
|
-
require( '@ckeditor/ckeditor5-dev-release-tools' ).generateChangelogForMonoRepository( /* options */ );
|
|
32
|
-
|
|
33
|
-
// See the `options` argument:
|
|
34
|
-
// https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-release-tools/lib/tasks/generatechangelogformonorepository.js#L30-L62
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
// scripts/release-bump-versions.js: Validates and updates version for all packages (includes the package found in options.cwd)
|
|
39
|
-
require( '@ckeditor/ckeditor5-dev-release-tools' ).bumpVersions( /* options */ );
|
|
40
|
-
|
|
41
|
-
// See the `options` argument:
|
|
42
|
-
// https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-release-tools/lib/tasks/bumpversions.js#L20-L27
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
// scripts/release-packages.js: Publish all changes.
|
|
47
|
-
require( '@ckeditor/ckeditor5-dev-release-tools' ).releaseSubRepositories( /* options */ );
|
|
48
|
-
|
|
49
|
-
// See the `options` argument:
|
|
50
|
-
// https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-release-tools/lib/tasks/releasesubrepositories.js#L20-L27
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Generating changelog
|
|
54
|
-
|
|
55
|
-
This tool can generate a changelog file based on commits in the repository. It can also propose what should be the next release version (according to [SemVer](http://semver.org)).
|
|
56
|
-
|
|
57
|
-
Read more about the [git commit message convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention) implemented by this tool.
|
|
58
|
-
|
|
59
|
-
### Creating a release for multiple repositories
|
|
60
|
-
|
|
61
|
-
**Note:** Before running the bumping versions task you need to generate the changelog for changes in the version to be released.
|
|
62
|
-
|
|
63
|
-
The process implemented by the tool:
|
|
64
|
-
|
|
65
|
-
1. Read a new release version from the changelog (the last header),
|
|
66
|
-
1. Filter out packages which won't be released (no changes or dependencies has not changed),
|
|
67
|
-
1. Update new versions of packages in `package.json` for all released packages,
|
|
68
|
-
1. Commit these changes as `Release: vX.Y.Z.`,
|
|
69
|
-
1. Create a tag `vX.Y.Z`.
|
|
70
|
-
|
|
71
|
-
### Publishing changes
|
|
72
|
-
|
|
73
|
-
**Note:** Before publishing changes you need to bump versions in all dependencies.
|
|
74
|
-
|
|
75
|
-
The process implemented by the tool:
|
|
76
|
-
|
|
77
|
-
1. Compares versions released on NPM and GitHub. Based on that, the tool know what should be published. You can call the same script multiple times and nothing wrong happens.
|
|
78
|
-
1. If choose publish on NPM: the tool publish changes on NPM.
|
|
79
|
-
1. If choose publish on GitHub: the tool creates a [GitHub release](https://help.github.com/articles/creating-releases/). Notes for the release are taken from the changelog.
|
|
80
|
-
1. If nothing was selected: the tool does nothing. No publish, no push, no creating releases.
|
|
81
|
-
|
|
82
11
|
## Changelog
|
|
83
12
|
|
|
84
13
|
See the [`CHANGELOG.md`](https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-release-tools/CHANGELOG.md) file.
|
package/lib/index.js
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { npm, workspaces } from '@ckeditor/ckeditor5-dev-utils';
|
|
7
7
|
|
|
8
|
-
export { default as generateChangelogForSinglePackage } from './tasks/generatechangelogforsinglepackage.js';
|
|
9
|
-
export { default as generateChangelogForMonoRepository } from './tasks/generatechangelogformonorepository.js';
|
|
10
8
|
export { default as updateDependencies } from './tasks/updatedependencies.js';
|
|
11
9
|
export { default as commitAndTag } from './tasks/commitandtag.js';
|
|
12
10
|
export { default as createGithubRelease } from './tasks/creategithubrelease.js';
|
|
@@ -29,7 +27,6 @@ export {
|
|
|
29
27
|
} from './utils/versions.js';
|
|
30
28
|
export { default as getChangesForVersion } from './utils/getchangesforversion.js';
|
|
31
29
|
export { default as getChangelog } from './utils/getchangelog.js';
|
|
32
|
-
export { default as saveChangelog } from './utils/savechangelog.js';
|
|
33
30
|
export { default as executeInParallel } from './utils/executeinparallel.js';
|
|
34
31
|
export { default as validateRepositoryToRelease } from './utils/validaterepositorytorelease.js';
|
|
35
32
|
export { default as getNpmTagFromVersion } from './utils/getnpmtagfromversion.js';
|
package/lib/utils/constants.js
CHANGED
|
@@ -12,15 +12,3 @@ export const CHANGELOG_FILE = 'CHANGELOG.md';
|
|
|
12
12
|
* Changelog header.
|
|
13
13
|
*/
|
|
14
14
|
export const CHANGELOG_HEADER = 'Changelog\n=========\n\n';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A size of default indent for a log.
|
|
18
|
-
*/
|
|
19
|
-
export const CLI_INDENT_SIZE = 3;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A size of indent for a second and next lines in a log. The number is equal to length of the log string:
|
|
23
|
-
* '* 1234567 ', where '1234567' is a short commit id.
|
|
24
|
-
* It does not include a value from `cli.INDENT_SIZE`.
|
|
25
|
-
*/
|
|
26
|
-
export const CLI_COMMIT_INDENT_SIZE = 10;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { simpleGit } from 'simple-git';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @param {object} options
|
|
@@ -11,6 +11,7 @@ import { tools } from '@ckeditor/ckeditor5-dev-utils';
|
|
|
11
11
|
* @param {string} options.changes Changelog entries for the current release.
|
|
12
12
|
* @param {boolean} [options.ignoreBranchCheck=false] If set on true, branch checking will be skipped.
|
|
13
13
|
* @param {string} [options.branch='master'] A name of the branch that should be used for releasing packages.
|
|
14
|
+
* @param {string} [options.cwd] Current working directory in which git status will be checked.
|
|
14
15
|
* @returns {Promise.<Array.<string>>}
|
|
15
16
|
*/
|
|
16
17
|
export default async function validateRepositoryToRelease( options ) {
|
|
@@ -18,22 +19,25 @@ export default async function validateRepositoryToRelease( options ) {
|
|
|
18
19
|
version,
|
|
19
20
|
changes,
|
|
20
21
|
ignoreBranchCheck = false,
|
|
21
|
-
branch = 'master'
|
|
22
|
+
branch = 'master',
|
|
23
|
+
cwd = process.cwd()
|
|
22
24
|
} = options;
|
|
25
|
+
|
|
23
26
|
const errors = [];
|
|
27
|
+
const git = simpleGit( { baseDir: cwd } );
|
|
24
28
|
|
|
25
29
|
// Check whether the repository is ready for the release.
|
|
26
|
-
const status =
|
|
30
|
+
const status = await git.status();
|
|
27
31
|
|
|
28
32
|
if ( !ignoreBranchCheck ) {
|
|
29
33
|
// Check whether current branch is "master".
|
|
30
|
-
if (
|
|
34
|
+
if ( status.current !== branch ) {
|
|
31
35
|
errors.push( `Not on the "#${ branch }" branch.` );
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
// Check whether the local branch is sync with the remote.
|
|
36
|
-
if ( status.
|
|
40
|
+
if ( status.behind ) {
|
|
37
41
|
errors.push( 'The branch is behind with the remote.' );
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -50,8 +54,4 @@ export default async function validateRepositoryToRelease( options ) {
|
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
return errors;
|
|
53
|
-
|
|
54
|
-
async function exec( command ) {
|
|
55
|
-
return tools.shExec( command, { verbosity: 'error', async: true } );
|
|
56
|
-
}
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-release-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "52.0.0",
|
|
4
4
|
"description": "Tools used for releasing CKEditor 5 and related packages.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -22,22 +22,13 @@
|
|
|
22
22
|
"lib"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
25
|
+
"@ckeditor/ckeditor5-dev-utils": "^52.0.0",
|
|
26
26
|
"@octokit/rest": "^22.0.0",
|
|
27
27
|
"chalk": "^5.0.0",
|
|
28
28
|
"cli-columns": "^4.0.0",
|
|
29
|
-
"compare-func": "^2.0.0",
|
|
30
|
-
"concat-stream": "^2.0.0",
|
|
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
|
-
"es-toolkit": "^1.35.0",
|
|
36
29
|
"fs-extra": "^11.0.0",
|
|
37
|
-
"git-raw-commits": "^5.0.0",
|
|
38
30
|
"glob": "^11.0.2",
|
|
39
31
|
"inquirer": "^12.5.2",
|
|
40
|
-
"minimatch": "^10.0.1",
|
|
41
32
|
"semver": "^7.6.3",
|
|
42
33
|
"shell-escape": "^0.2.0",
|
|
43
34
|
"simple-git": "^3.27.0",
|