unjs / mlly

๐Ÿค Common ECMAScript module utils
MIT License
471 stars 36 forks source link

fix(lookupNodeModuleSubpath): handle conditions and nested exports #210

Closed productdevbook closed 10 months ago

productdevbook commented 10 months ago

issua: https://github.com/unjs/mlly/issues/209

๐Ÿ”— Linked issue

โ“ Type of change

๐Ÿ“š Description

- Expected
+ Received

- import
+ bun

In package json the paths to bun and import are the same, but you don't have a bun file and you don't have a ts file. Therefore this output /../node_modules/.pnpm/postgres@3.4.3/node_modules/postgres/bun' is wrong. it should give the import path instead of bun.

๐Ÿ“ Checklist

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (5213717) 86.98% compared to head (fc2f980) 87.10%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #210 +/- ## ========================================== + Coverage 86.98% 87.10% +0.12% ========================================== Files 8 8 Lines 1037 1039 +2 Branches 168 172 +4 ========================================== + Hits 902 905 +3 + Misses 135 134 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pi0 commented 10 months ago

Thanks for reproduction dear @productdevbook. I have pushed fixes on top of it ๐Ÿ‘๐Ÿผ

pi0 commented 10 months ago

Followup: https://github.com/unjs/mlly/issues/218