fix(node): support module-sync export condition#34599
Conversation
littledivy
left a comment
There was a problem hiding this comment.
Does require(esm) match the module-sync export?
Co-Authored-By: Divy Srivastava <[email protected]>
8c6ad57 to
1a57ee4
Compare
|
Yes. I added a direct resolver unit test for that case: Re-ran:
|
Co-Authored-By: Divy Srivastava <[email protected]>
|
Pushed a fix for the CI failures. The spec was also importing Re-ran locally:
I also attempted the filtered spec locally, but stopped it during the first full CLI test-target build after confirming the CI failure source from logs. |
Co-Authored-By: Divy Srivastava <[email protected]>
|
Pushed a follow-up fix for the debug spec failure: the local Re-ran locally:
I also attempted the focused spec locally, but stopped it while it was still in the first full |
|
@divybot please open a PR in the docs repo updating relevant sections about this new export condition |
Closes denoland/orchid#350 Fixes denoland#29970 ## Summary - add `module-sync` to the default npm package export conditions for both import and require resolution - include `module-sync` in CJS analyzer require-style re-export resolution - add npm spec coverage for a package whose `module-sync` conditional export appears before `node` for both import and `createRequire()` ## Testing - `cargo fmt --check` - `cargo test -p node_resolver` ## Notes - Attempted `cargo test specs::npm::module_sync_condition -- --no-capture`, but the filtered spec target was killed during the first full CLI test binary build before reaching the test phase. --------- Co-authored-by: divybot <[email protected]> Co-authored-by: Divy Srivastava <[email protected]>
Closes denoland/orchid#350
Fixes #29970
Summary
module-syncto the default npm package export conditions for both import and require resolutionmodule-syncin CJS analyzer require-style re-export resolutionmodule-syncconditional export appears beforenodefor both import andcreateRequire()Testing
cargo fmt --checkcargo test -p node_resolverNotes
cargo test specs::npm::module_sync_condition -- --no-capture, but the filtered spec target was killed during the first full CLI test binary build before reaching the test phase.