Skip to content
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

fix: sort aliases to ensure priority is given to more specific aliases #388

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Aug 5, 2022

πŸ”— Linked issue

resolves #378, see also unjs/unenv#45

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ 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

A couple of issues have come up recently about alias ordering. This PR applies a fix to order aliases by specificity (e.g. number of slashes) meaning we should always have more specific alias in front of general (fs/promises in front of fs).

The upstream PR to unenv resolves it more specifically within the unenv presets but this is still worth merging here as there are other potential aliases involved.

πŸ“ Checklist

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

@danielroe danielroe added the enhancement New feature or request label Aug 5, 2022
@danielroe danielroe requested a review from pi0 August 5, 2022 14:49
@danielroe danielroe self-assigned this Aug 5, 2022
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #388 (1be0b12) into main (09032a0) will increase coverage by 0.00%.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main     #388   +/-   ##
=======================================
  Coverage   55.95%   55.96%           
=======================================
  Files          54       54           
  Lines        3467     3472    +5     
  Branches      362      364    +2     
=======================================
+ Hits         1940     1943    +3     
  Misses       1178     1178           
- Partials      349      351    +2     
Impacted Files Coverage Ξ”
src/utils/index.ts 24.34% <50.00%> (+1.21%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danielroe danielroe added bug Something isn't working and removed enhancement New feature or request labels Aug 5, 2022
@danielroe danielroe changed the title feat: sort aliases to ensure priority is given to more specific aliases fix: sort aliases to ensure priority is given to more specific aliases Aug 5, 2022
src/utils/index.ts Outdated Show resolved Hide resolved
src/utils/index.ts Outdated Show resolved Hide resolved
@pi0 pi0 merged commit 2a36b1e into main Aug 5, 2022
@pi0 pi0 deleted the feat/sort-aliases branch August 5, 2022 15:45
WinterYukky pushed a commit to WinterYukky/nitro that referenced this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error building with cloudflare, vercel-edge or netlify-edge presets
2 participants