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

Convert the repository to ESM and use the latest ckeditor5-dev-* #192

Closed
pomek opened this issue Sep 27, 2024 · 7 comments · Fixed by #196
Closed

Convert the repository to ESM and use the latest ckeditor5-dev-* #192

pomek opened this issue Sep 27, 2024 · 7 comments · Fixed by #196
Labels
squad:platform Issue to be handled by the Platform team. type:task This issue reports a chore (non-production change) and other types of "todos".
Milestone

Comments

@pomek
Copy link
Member

pomek commented Sep 27, 2024

Provide a description of the task

This issue is a continuation of #191.

We want to use the upcoming release (PR) of ckeditor5-dev-* packages. Unfortunately, it requires converting packages from this repository to ESM, but it also needs aligned CKEditor 5 code (PR).

Definition of Done

  • Packages located in this repository are marked as ESM.
  • The ckeditor5-dev-* packages are used in their latest versions.
  • CI is green.
@pomek pomek added squad:platform Issue to be handled by the Platform team. type:task This issue reports a chore (non-production change) and other types of "todos". labels Sep 27, 2024
@pomek
Copy link
Member Author

pomek commented Sep 27, 2024

@psmyrek
Copy link
Contributor

psmyrek commented Sep 30, 2024

Branch with conversion of this repository to ESM: ci/3772 (master...ci/3772).

@pomek
Copy link
Member Author

pomek commented Oct 3, 2024

We can use CKEditor 5 nightly releases to verify if our changes follow a good path. Unfortunately, we can merge them right after the next CKEditor 5 release, which is not scheduled yet. Hence, let's keep them on a feature branch. We will go back to this topic later.

@yoyo837
Copy link

yoyo837 commented Oct 24, 2024

I can't successfully execute npm install after cloning https://github.com/ckeditor/ckeditor5, it seems to be caused by this isssue, how can I successfully install it?

npm error Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/chalk/source/index.js from /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js not supported.

@pomek
Copy link
Member Author

pomek commented Oct 24, 2024

@yoyo837, this repository touches a tool for generating a package for use in CKEditor 5. Is it the correct repository to discuss your case?

@yoyo837
Copy link

yoyo837 commented Oct 24, 2024

@yoyo837, this repository touches a tool for generating a package for use in CKEditor 5. Is it the correct repository to discuss your case?

I found this issue link based on the clues from the npm cli error message on above. The message tells me that @ckeditor/ckeditor5-package-tools/bin/index.js cannot use the require to call the ESM version of chalk.

npm error /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js:10
npm error const { red } = require( 'chalk' );
npm error                 ^
npm error
npm error Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/chalk/source/index.js from /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js not supported.
npm error Instead change the require of /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/chalk/source/index.js in /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js to a dynamic import() which is available in all CommonJS modules.
npm error     at Object.<anonymous> (/Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js:10:17) {
npm error   code: 'ERR_REQUIRE_ESM'
npm error }
npm error
npm error Node.js v18.20.4
npm error error Command failed with exit code 1.
npm error npm error code 1
npm error npm error path /Users/tanghui/.npm/_cacache/tmp/git-clonejCVTc4
npm error npm error command failed
npm error npm error command sh -c yarn run dll:build && yarn run build:dist
npm error
npm error npm error A complete log of this run can be found in: /Users/tanghui/.npm/_logs/2024-10-24T07_30_04_701Z-debug-0.log

npm error A complete log of this run can be found in: /Users/tanghui/.npm/_logs/2024-10-24T07_29_04_966Z-debug-0.log

@yoyo837
Copy link

yoyo837 commented Oct 24, 2024

I cloned the ckeditor5 main repository and checked out the v43.2.0 tag, commit ckeditor/ckeditor5@46c386c

@pomek pomek closed this as completed in 30f0ada Oct 30, 2024
@CKEditorBot CKEditorBot added this to the iteration 80 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:platform Issue to be handled by the Platform team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants