nitro icon indicating copy to clipboard operation
nitro copied to clipboard

feat: resolve actual subpaths before guessing

Open danielroe opened this issue 3 years ago • 4 comments

🔗 Linked issue

❓ Type of change

  • [ ] 📖 Documentation (updates to the documentation or readme)
  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [x] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This resolves actual subpaths rather than guessing, so (for example) node-fetch-native/dist/polyfill.mjs can correctly be resolved to node-fetch-native/polyfill and back again.

📝 Checklist

  • [x] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

danielroe avatar Sep 21 '22 21:09 danielroe

Codecov Report

Merging #527 (133f2bd) into main (99fbfb9) will decrease coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   76.50%   76.48%   -0.03%     
==========================================
  Files          73       73              
  Lines        7594     7578      -16     
  Branches      755      750       -5     
==========================================
- Hits         5810     5796      -14     
+ Misses       1783     1781       -2     
  Partials        1        1              
Files Changed Coverage Δ
src/rollup/plugins/externals.ts 93.27% <100.00%> (+0.16%) :arrow_up:

codecov[bot] avatar Sep 21 '22 21:09 codecov[bot]

If you like this approach we can also extract into a mlly util.

danielroe avatar Sep 23 '22 13:09 danielroe

A refactor to mlly would be nice idea for reverse resolving subpaths 👍🏼

pi0 avatar Sep 26 '22 10:09 pi0

extracted:

  • [x] https://github.com/unjs/pkg-types/pull/47
  • [x] https://github.com/unjs/mlly/pull/89

danielroe avatar Sep 26 '22 10:09 danielroe

@danielroe is this ready to review ?

Hebilicious avatar Jul 04 '23 22:07 Hebilicious

It is.

danielroe avatar Jul 04 '23 22:07 danielroe

@danielroe Had to create a new branch to fix the conflicts. You can force push from there https://github.com/unjs/nitro/pull/1395 This looks good to me, altough I'm not really a rollup wizard like you 💇🏽

Hebilicious avatar Jul 04 '23 22:07 Hebilicious

I don't believe there are any conflicts in this branch. I resolved them 5 days ago with a rebase.

danielroe avatar Jul 05 '23 06:07 danielroe

Ah yes ignore me 🤦 GitHub UI fooled me

Hebilicious avatar Jul 05 '23 07:07 Hebilicious