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

Move build packages to TypeScript #13463

Merged
merged 15 commits into from
Feb 23, 2023

Conversation

filipsobol
Copy link
Member

@filipsobol filipsobol commented Feb 14, 2023

Suggested merge commit message (convention)

Other (build-balloon): Rewrite ckeditor5-build-balloon into Typescript. Closes #13000.

Other (build-balloon-block): Rewrite ckeditor5-build-balloon-block into Typescript. Closes #13001.

Other (build-classic): Rewrite ckeditor5-build-classic into Typescript. Closes #13002.

Other (build-decoupled-document): Rewrite ckeditor5-build-decoupled-document into Typescript. Closes #13003.

Other (build-inline): Rewrite ckeditor5-build-inline into Typescript. Closes #13004.

@filipsobol filipsobol marked this pull request as ready for review February 15, 2023 12:45
Copy link
Contributor

@arkflpc arkflpc left a comment

Choose a reason for hiding this comment

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

tsconfig files are missing.

Please verify if any changes are needed in package.json(s).

@arkflpc
Copy link
Contributor

arkflpc commented Feb 16, 2023

Please verify if any changes are needed in package.json(s).

CC: @pomek

@pomek
Copy link
Member

pomek commented Feb 16, 2023

Do you think it would work at all?

Webpack configuration should be aligned too. Also, I think the tsconfig.json will be required. Other than that, it should be fine. Please, let me know when R+, so I will jump here and make a few tests.

@pomek
Copy link
Member

pomek commented Feb 16, 2023

The _src directory is not needed here. CKEditor 5 builds do not provide any documentation.

@filipsobol filipsobol requested a review from arkflpc February 16, 2023 12:33
@filipsobol
Copy link
Member Author

I updated the PR and yarn build commands in all of these packages seem to be working fine after minor update to the webpack configuration. @arkflpc @pomek

@pomek
Copy link
Member

pomek commented Feb 16, 2023

We may want to publish typings for builds too.

  • I would redesign tsconfig.json:

     {
       "extends": "../../tsconfig.release.json",
       "compilerOptions": {
         "sourceMap": true
       },
       "include": [
         "./src/",
         "../../typings/"
       ],
       "exclude": [
         "./tests/"
       ]
     }

    Let's use the release config as a base and generate source maps as builds export them.

  • Then, we need to update package.json:

    • Add src/ckeditor.d.ts to files.
    • Add the types field pointing to the src/ckeditor.d.ts file.

Unfortunately, I am not sure if we go the right direction.

@filipsobol
Copy link
Member Author

Today we were discussing how we should publish typings and how other libraries do it. This will require further research, but AFAIK the approach you described is the most popular and the one I used in the past.

Because we are already using webpack to build the package, we can use emitDeclarationOnly option, so that tsc will only output .d.ts files and skip the build step. See this commit for more details: 65de1ce @pomek

@filipsobol filipsobol requested a review from pomek February 22, 2023 15:40
Copy link
Member

@pomek pomek left a comment

Choose a reason for hiding this comment

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

Please, update the merge message. We do not convert html-support.

LGTM.

@arkflpc arkflpc merged commit 4bf33ea into master Feb 23, 2023
@arkflpc arkflpc deleted the ck/13000-move-build-packages-to-typescript branch February 23, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants