Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Typescript #130

Merged
merged 17 commits into from
Mar 17, 2024
Merged

Migrate to Typescript #130

merged 17 commits into from
Mar 17, 2024

Conversation

fedemp
Copy link
Contributor

@fedemp fedemp commented Mar 15, 2024

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

@fedemp fedemp mentioned this pull request Mar 15, 2024
@tony
Copy link
Collaborator

tony commented Mar 15, 2024

Much welcomed! I will check this over the weekend.

@tony
Copy link
Collaborator

tony commented Mar 15, 2024

Am I fine to make commits to this branch?

@fedemp
Copy link
Contributor Author

fedemp commented Mar 15, 2024

Am I fine to make commits to this branch?

Sure. Be my guest. 😃

@tony tony mentioned this pull request Mar 16, 2024
@tony tony force-pushed the typescript branch 3 times, most recently from 6c96cb4 to 1f0f233 Compare March 16, 2024 10:54
tony added 3 commits March 16, 2024 06:06
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;
tony added 5 commits March 16, 2024 06:07
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
@tony
Copy link
Collaborator

tony commented Mar 16, 2024

@fedemp I've added some commits

Build output when integrating into a custom build, as of 41.2.1-alpha.2:

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 83:14-20
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(83,15)
      TS2339: Property 'engine' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 84:14-22
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(84,15)
      TS2339: Property 'lazyLoad' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 85:14-27
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(85,15)
      TS2339: Property 'enablePreview' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 88:14-30
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(88,15)
      TS2339: Property 'previewClassName' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 90:14-28
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(90,15)
      TS2339: Property 'popupClassName' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 92:14-32
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(92,15)
      TS2339: Property 'katexRenderOptions' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 105:90-100
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(105,91)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 105:113-128
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathui.ts(105,114)
      TS2339: Property 'forceOutputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 90:24-39
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(90,25)
      TS2339: Property 'forceOutputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 91:19-29
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(91,20)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 113:24-39
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(113,25)
      TS2339: Property 'forceOutputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 114:19-29
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(114,20)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 127:27-36
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(127,28)
      TS2339: Property 'className' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 135:24-39
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(135,25)
      TS2339: Property 'forceOutputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 136:19-29
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(136,20)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 166:23-38
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(166,24)
      TS2339: Property 'forceOutputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 167:18-28
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(167,19)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 242:17-23
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(242,18)
      TS2339: Property 'engine' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 243:17-25
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(243,18)
      TS2339: Property 'lazyLoad' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 247:17-33
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(247,18)
      TS2339: Property 'previewClassName' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 248:17-35
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(248,18)
      TS2339: Property 'katexRenderOptions' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts
../../node_modules/@isaul32/ckeditor5-math/src/mathediting.ts 279:23-32
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/mathediting.ts(279,24)
      TS2339: Property 'className' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 4:0-40 8:16-27
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 116:5-11
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(116,6)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 157:4-10
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(157,5)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 159:10-16
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(159,11)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 296:17-23
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(296,18)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 299:14-20
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(299,15)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 303:2-8
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(303,3)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 309:4-10
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(309,5)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 321:2-8
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(321,3)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 322:2-8
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(322,3)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 339:14-20
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(339,15)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts
../../node_modules/@isaul32/ckeditor5-math/src/utils.ts 340:13-19
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/utils.ts(340,14)
      TS2304: Cannot find name 'global'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/mathui.ts 8:0-49 112:22-44
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 3:0-30 8:29-35
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/automath.ts
../../node_modules/@isaul32/ckeditor5-math/src/automath.ts 122:23-33
[tsl] ERROR in ~/projects/ckeditor5/node_modules/@isaul32/ckeditor5-math/src/automath.ts(122,24)
      TS2339: Property 'outputType' does not exist on type '{}'.
 @ ../../node_modules/@isaul32/ckeditor5-math/src/math.ts 5:0-34 8:37-45
 @ ../../node_modules/@isaul32/ckeditor5-math/src/index.js 4:0-41 4:0-41
 @ ./src/ckeditor.ts 33:0-62 155:4-15

34 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.90.3 compiled with 34 errors in 22963 ms

@fedemp
Copy link
Contributor Author

fedemp commented Mar 17, 2024

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 augmentation.d.ts and typings-external.d.ts are not read by the compiler.

@tony
Copy link
Collaborator

tony commented Mar 17, 2024

@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.

@tony
Copy link
Collaborator

tony commented Mar 17, 2024

From what I see, the augmentation.d.ts and typings-external.d.ts are not read by the compiler.

That clue helped solve it: .d.ts weren't being included in the exported package

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.

@tony tony self-requested a review March 17, 2024 09:24
Copy link
Collaborator

@tony tony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fedemp LGTM

DLL build

yarn dll:serve

image

Normal build

yarn start

image

@tony tony merged commit 3b57dbf into isaul32:master Mar 17, 2024
tony added a commit that referenced this pull request Mar 17, 2024
tony added a commit that referenced this pull request Mar 17, 2024
@tony
Copy link
Collaborator

tony commented Mar 17, 2024

@fedemp Live in 41.2.1 (NPM, Changelog, Release)

Work for you?

@fedemp fedemp deleted the typescript branch March 17, 2024 15:52
@fedemp
Copy link
Contributor Author

fedemp commented Mar 17, 2024

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.

@fedemp
Copy link
Contributor Author

fedemp commented Mar 17, 2024

BTW, you will have to update the README. 😄

@tony
Copy link
Collaborator

tony commented Mar 17, 2024

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.

I may be able to take a look. See also #131

BTW, you will have to update the README. 😄

Very good catch, I will note the TypeScript support and DLL build as well.

@tony
Copy link
Collaborator

tony commented Mar 17, 2024

@fedemp README updates, live in Live in 41.2.2 (NPM, Changelog, Release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants