feat!: migrate to esm-only - #2765
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/plugins/rolldown/forceFileExtensionsPlugin.ts`:
- Around line 21-35: Update ESM_RELATIVE_IMPORT_EXP and modifyRelativeImports to
rewrite both from-clause and side-effect relative imports, while preserving
existing non-JavaScript extensions such as .json instead of appending
ESM_EXTENSION. Retain directory handling with /index and support
import-attribute syntax, then add coverage for side-effect, JSON, directory, and
import-attribute cases before publishing chunks.
In `@config/plugins/rolldown/resolveCoreImportsPlugin.ts`:
- Around line 3-31: Update resolveCoreImportsPlugin and replaceCoreImports so
the rewritten `#core` import path is calculated relative to each emitted chunk’s
fileName rather than hardcoding ../core. Pass the chunk fileName into the
replacement logic and preserve the existing submodule and semicolon handling
while resolving the correct relative path for nested output chunks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d0ec95d8-e1f9-4809-993c-7be555318409
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (20)
.oxlintrc.jsonbrowser/package.jsoncli/package.jsoncommitlint.config.jsconfig/package.jsonconfig/plugins/rolldown/copyWorkerPlugin.tsconfig/plugins/rolldown/forceFileExtensionsPlugin.tsconfig/plugins/rolldown/resolveCoreImportsPlugin.tsconfig/replaceCoreImports.jsconfig/scripts/patch-ts.jsconfig/scripts/postinstall.jsgraphql/package.jsonnative/package.jsonnode/package.jsonpackage.jsonsrc/package.jsontest/modules/node/esm-node.test.tstest/support/alias.tstest/support/msw-esm/package.jsontsdown.config.mts
💤 Files with no reviewable changes (10)
- config/replaceCoreImports.js
- node/package.json
- cli/package.json
- src/package.json
- config/scripts/patch-ts.js
- browser/package.json
- graphql/package.json
- config/package.json
- native/package.json
- test/support/msw-esm/package.json
Migrates MSW to be ESM-only 🎉 Finally.