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 |
|
28 | ```js
|
29 | // scripts/changelog-packages.js: Generate changelog for all packages (repository contains multiple packages).
|
30 | require( '@ckeditor/ckeditor5-dev-env' ).generateChangelogForSubPackages( /* options */ );
|
31 | ```
|
32 |
|
33 | ```js
|
34 | // scripts/release-self.js: Create release for the current package.
|
35 | require( '@ckeditor/ckeditor5-dev-env' ).releaseRepository();
|
36 | ```
|
37 |
|
38 | ```js
|
39 | // scripts/release-bump-versions.js: Validates and updates version for all packages (includes the package found in options.cwd)
|
40 | require( '@ckeditor/ckeditor5-dev-env' ).bumpVersions( /* options */ );
|
41 | ```
|
42 |
|
43 | ```js
|
44 | // scripts/release-packages.js: Publish all changes.
|
45 | require( '@ckeditor/ckeditor5-dev-env' ).releaseSubRepositories( /* options */ );
|
46 | ```
|
47 |
|
48 | ### Generating changelog
|
49 |
|
50 | 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)).
|
51 |
|
52 | Read more about the [git commit message convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention) implemented by this tool.
|
53 |
|
54 | ### Creating a release for multiple repositories
|
55 |
|
56 | **Note:** Before running the bumping versions task you need to generate the changelog for changes in the version to be released.
|
57 |
|
58 | The process implemented by the tool:
|
59 |
|
60 | 1. Read a new release version from the changelog (the last header),
|
61 | 1. Filter out packages which won't be released (no changes or dependencies has not changed),
|
62 | 1. Update new versions of packages in `package.json` for all released packages,
|
63 | 1. Commit these changes as `Release: vX.Y.Z.`,
|
64 | 1. Create a tag `vX.Y.Z`.
|
65 |
|
66 | ### Publishing changes
|
67 |
|
68 | **Note:** Before publishing changes you need to bump versions in all dependencies.
|
69 |
|
70 | The process implemented by the tool:
|
71 |
|
72 | 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.
|
73 | 1. If choose publish on NPM: the tool publish changes on NPM.
|
74 | 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.
|
75 | 1. If nothing was selected: the tool does nothing. No publish, no push, no creating releases.
|
76 |
|
77 | ## Translation tools
|
78 |
|
79 | Available tasks:
|
80 | - `collect` - Collects translation strings ( from `t()` calls ) and stores them in ckeditor5/build/.transifex directory.
|
81 | - `upload` - Uploads translations to the Transifex from collected files.
|
82 | - `download` - Downloads translations from the Transifex for each package and language.
|
83 |
|
84 | ### Usage
|
85 |
|
86 | ```
|
87 | npm i --save-dev @ckeditor/ckeditor5-dev-env
|
88 | ```
|
89 |
|
90 | Then use `ckeditor5-dev-env-translations` command:
|
91 |
|
92 | ```
|
93 | # directly from command line:
|
94 | node ./node_modules/bin/ckeditor5-dev-env-translations collect
|
95 |
|
96 | # using npx:
|
97 | npx ckeditor5-dev-env-translations collect
|
98 | ```
|
99 |
|
100 | Or add to `package.json` scripts:
|
101 |
|
102 | ```
|
103 | {
|
104 | "scripts": {
|
105 | "translations:collect": "ckeditor5-dev-env-translations collect",
|
106 | "translations:download": "ckeditor5-dev-env-translations download",
|
107 | "translations:upload": "ckeditor5-dev-env-translations upload"
|
108 | }
|
109 | }
|
110 | ```
|
111 |
|
112 | ## Changelog
|
113 |
|
114 | See the [`CHANGELOG.md`](https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-env/CHANGELOG.md) file.
|
115 |
|
116 | ## License
|
117 |
|
118 | 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.
|