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

fix: fix CJS import of log at session.ts #875

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

mato533
Copy link
Contributor

@mato533 mato533 commented Dec 15, 2024

Description

This is update for following TODO.
Updated package.json in "@wdio/electron-utils/log" to fix this TODO.

TODO: Fix CJS import of log from '@wdio/electron-utils/log'

Memo

In my understand, when CommonJS is set module at tsconfig.json, then moduleResolution will be set node10 (same as node) as a default.(docs)
Then exports field of package.json(imported module side) will be ignored. (exports field is added Node v12.7.0.)
So this PR adds a typesVersions field and tells typescript to the appropriate types file.

@mato533 mato533 closed this Dec 15, 2024
@mato533 mato533 deleted the fix/launcher2 branch December 15, 2024 17:50
@mato533 mato533 restored the fix/launcher2 branch December 15, 2024 17:53
@mato533 mato533 reopened this Dec 15, 2024
@mato533
Copy link
Contributor Author

mato533 commented Dec 16, 2024

In order to avoid such complications, one idea is to introduce a bundler such as rollup and build both esm and cjs source code from esm.

@goosewobbler goosewobbler added this to the 8.0.0 milestone Dec 20, 2024
@goosewobbler
Copy link
Member

goosewobbler commented Dec 20, 2024

I think the bundler approach sounds like the best option to reduce the complexity of CJS / ESM here, I'll raise a ticket for that, but we can merge this fix in the meantime. I wasn't aware of the typesVersions field - I am now...

Thanks for the contribution!

UPDATE: Raised #880 to cover the above.

@goosewobbler goosewobbler merged commit c9d4e30 into webdriverio-community:main Dec 20, 2024
20 checks passed
@mato533
Copy link
Contributor Author

mato533 commented Dec 20, 2024

@goosewobbler
thank you for merging this PR!

@mato533 mato533 deleted the fix/launcher2 branch December 20, 2024 15:01
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