-
Notifications
You must be signed in to change notification settings - Fork 6
chore: Migrate package to esm #102
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #102 +/- ##
==========================================
+ Coverage 96.30% 97.38% +1.07%
==========================================
Files 46 46
Lines 2163 2138 -25
Branches 406 403 -3
==========================================
- Hits 2083 2082 -1
+ Misses 79 56 -23
+ Partials 1 0 -1 ☔ View full report in Codecov by Sentry. |
| "lint-staged": "^12.5.0", | ||
| "loader-utils": "^3.2.1", | ||
| "lodash": "^4.17.21", | ||
| "merge": "^2.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an unused dependency while doing it
| '.': { | ||
| import: './build/index.js', | ||
| require: './build/index.cjs', | ||
| }, | ||
| './internal': { | ||
| import: './build/internal.js', | ||
| require: './build/internal.cjs', | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compatibility for require() use-case is still supported
src/build/index.cjs
Outdated
| const buildThemedComponents = async (...args) => { | ||
| const esmAPI = await import('./index.js'); | ||
| return esmAPI.buildThemedComponents(...args); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to webdriverio for this idea how to support compatibility without code duplication:
1e288ab to
99a7500
Compare
99a7500 to
05f592a
Compare
Issue #, if available:
Notes
make this package a proper ESM module
type: "module"(which requires.jsextension everywhere)isolatedModulesandverbatimModuleSyntax(requireimport typefor all type imports)Testing
Dry-runs: 7218081746, 7218084211
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.