feat(js-api): Add types for word-count ckeditor plugin#1266
Open
chestofwonders wants to merge 1 commit into
Open
feat(js-api): Add types for word-count ckeditor plugin#1266chestofwonders wants to merge 1 commit into
chestofwonders wants to merge 1 commit into
Conversation
izaera
reviewed
Jun 5, 2026
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| */ | ||
|
|
||
| /// <reference path="./ckeditor5-plugins" /> |
Member
There was a problem hiding this comment.
The lint errors seem correct: why not use import here? 🤔
dsanz
reviewed
Jun 8, 2026
dsanz
left a comment
Member
There was a problem hiding this comment.
@chestofwonders pls check the linting errors
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| */ | ||
|
|
||
| declare module '@ckeditor/ckeditor5-word-count/dist/index.js' { |
Member
There was a problem hiding this comment.
at some point, we shall end up adding any ootb plugin type here, so that CX implementors can include them easily regardless the plugin they want to enable.
This is something we need to think: which types should be here? All? The ones which we don't include in the toolbars at this moment? Just the ones referenced in the sample workspace?
So, this is not blocking the PR, just raising awareness
55d9e70 to
7ec0167
Compare
…nt types CKEditor5 v46 switched to an ESM-only distribution where types are declared under the package root but the actual entry point is dist/index.js. Consuming those types from inside js-toolkit is not feasible: js-toolkit's tsconfig is configured for CommonJS/moduleResolution:node, and its CI tooling (liferay-workspace-scripts) applies workspace-wide constraints that conflict with the moduleResolution:bundler and TypeScript 5 required by CKEditor5 v46. To avoid dragging js-toolkit into those requirements (and to avoid interfering with parallel work on js-api), the editor types are extracted to a new independent package, @liferay/js-api-editor, placed at projects/js-api-editor. This package has its own tsconfig (moduleResolution:bundler, TS5) and no dependency on js-toolkit's tooling.
7ec0167 to
3e8afed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: https://liferay.atlassian.net/browse/LPD-89734
Add types for word-count ckeditor plugin
This PR adds TypeScript type support for the CKEditor 5 word-count plugin by:
ckeditor5-plugins.tsfile with a module augmentation that maps@ckeditor/ckeditor5-word-count/dist/index.jsto the package's declared typeseditor/index.tsvia a triple-slash directive@ckeditor/ckeditor5-word-count@46.0.3as a dependency inpackage.json