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(vercel-edge): fix route generation #1071

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

smaeda-ks
Copy link
Contributor

It seems routeRules generates invalid routes when using the vercel-edge preset.

This is because nitro only creates pretender functions for the vercel preset:
https://github.com/unjs/nitro/blob/4585ca856b0fb4d5601e30fc36f9dbde4aef03de/src/presets/vercel.ts#L51-L85

and the generateEndpoint function isn't considering the vercel-edge preset:
https://github.com/unjs/nitro/blob/4585ca856b0fb4d5601e30fc36f9dbde4aef03de/src/presets/vercel.ts#L226-L234

🔗 Linked issue

❓ 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

📝 Checklist

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

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #1071 (649f418) into main (7ae95d2) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1071      +/-   ##
==========================================
- Coverage   67.32%   67.32%   -0.01%     
==========================================
  Files          62       62              
  Lines        6292     6295       +3     
  Branches      707      709       +2     
==========================================
+ Hits         4236     4238       +2     
  Misses       2042     2042              
- Partials       14       15       +1     
Impacted Files Coverage Δ
src/presets/vercel.ts 76.79% <100.00%> (-0.13%) ⬇️

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

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 💯

@pi0 pi0 changed the title fix(vercel): fix route generation for vercel-edge preset fix(vercel-edge): fix route generation Mar 22, 2023
@pi0 pi0 merged commit ac8ca35 into nitrojs:main Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants