Another project should be able to use CKEditor 5 as a dependency. It should be also possible to watch changes in the CKEditor plugin so the development of the custom project can be done together with some CKEditor5 plugins, without a need to rebuild CKEditor each time.
The workflow should be as described. Note that these are example names of folders and commands, they can be different then names suggested in other tickets.
1) A custom project has a list of ckeditor5-* projects, it needs, listed in the package.json. Some CKEditor5 tools and a compiler are also included there. Note that it does not need main ckeditor5 there. The custom project contains also a gulpfile.js with exposed needed ckeditor5 commands.
custom-project/
package.json (with a list of ckeditor5-* dependencies)
gulpfile.js
2) Using npm install dependencies are installed to the node_modules folder.
custom-project/
package.json (with a list of ckeditor5-* dependencies)
gulpfile.js
node_modules/
ckeditor5-util-*
ckeditor5-compiler-esnext
ckeditor5-*
3) The user can define the directory where all ckedior5 dev projects are kept. Using gulp ckeditor5-link all ckeditor5-* projects in node_modules are replaced with symlinks to the ckeditor5-project/ckeditor5-* folders. Note that this step is optional.
custom-project/
package.json (with a list of ckeditor5-* dependencies)
gulpfile.js
node_modules/
ckeditor5-* -> ../../ckeditor5-project/ckeditor5-*
ckeditor5-project/
ckeditor5-*
4) Using gulp ckeditor5-compile the compiler run and the result goes to the custom target folder:
custom-project/
package.json (with a list of ckeditor5-* dependencies)
gulpfile.js
node_modules/
ckeditor5-* -> ../../ckeditor5-project/ckeditor5-*
lib/
ckeditor5/ (same as `build/esnext` in the standard way of building)
ckeditor5-project/
ckeditor5-*
There should be also gulp ckeditor5-compile --watch option available which watch ckeditor5-project/ckeditor5-* for changes.
Then the custom project can use modules which land in lib/ckeditor5 and handle bundling (and any other future transformations) in the way it needs.
Let's treat this issue as an umbrella one. We can split work into couple of steps:
WORSKPACE_DIR and possibilities to link to packages outside ../ directory, as described above by @pjasiun.package.json fields, improving readmes, describing workflow for publishing ckeditor5-dev-* packages, etc.Another requirement to keep in mind: https://github.com/ckeditor/ckeditor5/issues/226#issuecomment-234878122. Build's output path and bundler input and output paths should be configurable via CLI (at least).
Think about configuring WORSKPACE_DIR and possibilities to link to packages outside ../ directory, as described above by @pjasiun.
I tested as much as possible usage of WORKSPACE_DIR option in ckeditor5/gulpfile.js and (apart from one fix) it is working flawlessly. I talked with @pjasiun and he seems to be happy about using this option.
We agreed with @pjasiun that we can close this issue and further topics will be described in separate tasks.
Most helpful comment
Let's treat this issue as an umbrella one. We can split work into couple of steps:
WORSKPACE_DIRand possibilities to link to packages outside../directory, as described above by @pjasiun.package.jsonfields, improving readmes, describing workflow for publishingckeditor5-dev-*packages, etc.