1 | CKEditor 5 development environment tasks
|
2 | ========================================
|
3 |
|
4 | Tasks used during development of [CKEditor 5](https://ckeditor.com).
|
5 |
|
6 | More information about development tools packages can be found at the following URL: <https://github.com/ckeditor/ckeditor5-dev>.
|
7 |
|
8 | ## Release tools
|
9 |
|
10 | ### Usage
|
11 |
|
12 | ```
|
13 | npm i --save-dev @ckeditor/ckeditor5-dev-env
|
14 | ```
|
15 |
|
16 | Then create a script that run tasks:
|
17 |
|
18 | ```js
|
19 | // scripts/changelog-self.js: Generate changelog for the current package.
|
20 | require( '@ckeditor/ckeditor5-dev-env' ).generateChangelogForSinglePackage();
|
21 | ```
|
22 |
|
23 | ```js
|
24 | // scripts/changelog-repos.js: Generate changelog for all dependencies (repository using multiple repositories).
|
25 | require( '@ckeditor/ckeditor5-dev-env' ).generateChangelogForSubRepositories( /* options */ );
|
26 |
|
27 | // See the `options` argument:
|
28 | // https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsubrepositories.js#L20-L27
|
29 | ```
|
30 |
|
31 | ```js
|
32 | // scripts/changelog-packages.js: Generate changelog for all packages (repository contains multiple packages).
|
33 | require( '@ckeditor/ckeditor5-dev-env' ).generateChangelogForSubPackages( /* options */ );
|
34 |
|
35 | // See the `options` argument:
|
36 | // https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/lib/release-tools/tasks/generatechangelogforsubpackages.js#L20-L27
|
37 | ```
|
38 |
|
39 | ```js
|
40 | // scripts/release-bump-versions.js: Validates and updates version for all packages (includes the package found in options.cwd)
|
41 | require( '@ckeditor/ckeditor5-dev-env' ).bumpVersions( /* options */ );
|
42 |
|
43 | // See the `options` argument:
|
44 | // https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/lib/release-tools/tasks/bumpversions.js#L20-L27
|
45 | ```
|
46 |
|
47 | ```js
|
48 | // scripts/release-packages.js: Publish all changes.
|
49 | require( '@ckeditor/ckeditor5-dev-env' ).releaseSubRepositories( /* options */ );
|
50 |
|
51 | // See the `options` argument:
|
52 | // https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/lib/release-tools/tasks/releasesubrepositories.js#L20-L27
|
53 | ```
|
54 |
|
55 | ### Generating changelog
|
56 |
|
57 | 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)).
|
58 |
|
59 | Read more about the [git commit message convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention) implemented by this tool.
|
60 |
|
61 | ### Creating a release for multiple repositories
|
62 |
|
63 | **Note:** Before running the bumping versions task you need to generate the changelog for changes in the version to be released.
|
64 |
|
65 | The process implemented by the tool:
|
66 |
|
67 | 1. Read a new release version from the changelog (the last header),
|
68 | 1. Filter out packages which won't be released (no changes or dependencies has not changed),
|
69 | 1. Update new versions of packages in `package.json` for all released packages,
|
70 | 1. Commit these changes as `Release: vX.Y.Z.`,
|
71 | 1. Create a tag `vX.Y.Z`.
|
72 |
|
73 | ### Publishing changes
|
74 |
|
75 | **Note:** Before publishing changes you need to bump versions in all dependencies.
|
76 |
|
77 | The process implemented by the tool:
|
78 |
|
79 | 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.
|
80 | 1. If choose publish on NPM: the tool publish changes on NPM.
|
81 | 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.
|
82 | 1. If nothing was selected: the tool does nothing. No publish, no push, no creating releases.
|
83 |
|
84 | ## Translation tools
|
85 |
|
86 | Available tasks:
|
87 | - `collect` - Collects translation strings ( from `t()` calls ) and stores them in ckeditor5/build/.transifex directory.
|
88 | - `upload` - Uploads translations to the Transifex from collected files.
|
89 | - `download` - Downloads translations from the Transifex for each package and language.
|
90 |
|
91 | ### Usage
|
92 |
|
93 | ```
|
94 | npm i --save-dev @ckeditor/ckeditor5-dev-env
|
95 | ```
|
96 |
|
97 | Then use `ckeditor5-dev-env-translations` command:
|
98 |
|
99 | ```
|
100 | # directly from command line:
|
101 | node ./node_modules/bin/ckeditor5-dev-env-translations collect
|
102 |
|
103 | # using npx:
|
104 | npx ckeditor5-dev-env-translations collect
|
105 | ```
|
106 |
|
107 | Or add to `package.json` scripts:
|
108 |
|
109 | ```
|
110 | {
|
111 | "scripts": {
|
112 | "translations:collect": "ckeditor5-dev-env-translations collect",
|
113 | "translations:download": "ckeditor5-dev-env-translations download",
|
114 | "translations:upload": "ckeditor5-dev-env-translations upload"
|
115 | }
|
116 | }
|
117 | ```
|
118 |
|
119 | ## Changelog
|
120 |
|
121 | See the [`CHANGELOG.md`](https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/CHANGELOG.md) file.
|
122 |
|
123 | ## License
|
124 |
|
125 | Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.
|