Migrate to Typescript - #130
Conversation
|
Much welcomed! I will check this over the weekend. |
|
Am I fine to make commits to this branch? |
Sure. Be my guest. 😃 |
6c96cb4 to
1f0f233
Compare
ERROR in ckeditor5-math/src/mathcommand.ts
./src/mathcommand.ts 5:8-13
[tsl] ERROR in ckeditor5-math/src/mathcommand.ts(5,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Command'.
@ ./src/autoformatmath.ts 6:0-40 24:31-42
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/mathcommand.ts
./src/mathcommand.ts 6:8-15
[tsl] ERROR in ckeditor5-math/src/mathcommand.ts(6,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Command'.
@ ./src/autoformatmath.ts 6:0-40 24:31-42
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/mathcommand.ts
./src/mathcommand.ts 48:8-15
[tsl] ERROR in ckeditor5-math/src/mathcommand.ts(48,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Command'.
@ ./src/autoformatmath.ts 6:0-40 24:31-42
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/mathui.ts
./src/mathui.ts 41:8-15
[tsl] ERROR in ckeditor5-math/src/mathui.ts(41,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Plugin'.
@ ./src/autoformatmath.ts 7:0-30 33:50-56
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/ui/mainformview.ts
./src/ui/mainformview.ts 40:8-14
[tsl] ERROR in ckeditor5-math/src/ui/mainformview.ts(40,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'View<HTMLElement>'.
@ ./src/mathui.ts 2:0-45 61:29-41
@ ./src/autoformatmath.ts 7:0-30 33:50-56
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/ui/mainformview.ts
./src/ui/mainformview.ts 130:8-14
[tsl] ERROR in ckeditor5-math/src/ui/mainformview.ts(130,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'View<HTMLElement>'.
@ ./src/mathui.ts 2:0-45 61:29-41
@ ./src/autoformatmath.ts 7:0-30 33:50-56
@ ./src/index.ts 5:0-61 5:0-61
ERROR in ckeditor5-math/src/ui/mathview.ts
./src/ui/mathview.ts 76:8-14
[tsl] ERROR in ckeditor5-math/src/ui/mathview.ts(76,9)
TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'View<HTMLElement>'.
@ ./src/ui/mainformview.ts 5:0-34 48:32-40
@ ./src/mathui.ts 2:0-45 61:29-41
@ ./src/autoformatmath.ts 7:0-30 33:50-56
@ ./src/index.ts 5:0-61 5:0-61
7 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
src/katex.d.ts:145:36 - error TS2304: Cannot find name 'TrustContext'. 145 trust?: boolean | ( ( context: TrustContext ) => boolean ) | undefined;
More appropriate to be stored in the typings directory, as it is not a source file, but a type definition file for SVGs.
This way the .d.ts will not be deleted when filse are deleted through rimraf
|
@fedemp I've added some commits Build output when integrating into a custom build, as of 41.2.1-alpha.2: Details |
|
I'm sorry, but what command did you run to get such output? I'm sure I've run all available scripts but none has shown any build errors. From what I see, the |
|
@fedemp Those errors are when using ckeditor5-math via NPM in a built editor from source I don't have a reproducible version of that readily available. |
That clue helped solve it: diff --git a/package.json b/package.json
index 3f59b3c..b381975 100644
--- a/package.json
+++ b/package.json
@@ -59,7 +59,8 @@
},
"files": [
"lang",
- "src",
+ "src/**/*.js",
+ "src/**/*.d.ts",
"build",
"theme",
"ckeditor5-metadata.json",Fixed it. |
|
So cool that you found the problem in the npmjs builder. I would not have thought of that. I installed the package and could import it fine. The only thing I regret is not being able to migrate the tests, but I think it's because ckeditor uses an outdated version of webpack. |
|
BTW, you will have to update the README. 😄 |
I may be able to take a look. See also #131
Very good catch, I will note the TypeScript support and DLL build as well. |


These PR migrate the source to TS. Tests are not included cause some issues with Webpack.