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

refactor: split out api types #1027

Merged
merged 3 commits into from
Mar 8, 2023
Merged

refactor: split out api types #1027

merged 3 commits into from
Mar 8, 2023

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Mar 6, 2023

πŸ”— Linked issue

nuxt/nuxt#13920

❓ 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)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This is a follow-on from #1021, adding support for splitting explicit nitropack augmentations from auto-import types (which affect the global scope). This should mean that a consuming framework, like Nuxt, can pull in types/nitro-augmentations.d.ts safely for typed $fetch without also adding the auto-import types to the global namespace.

I've implemented this (with /// <reference />) to keep the change backward-compatible in case users are explicitly referencing nitro.d.ts, but with this change nitro-augmentations.d.ts also becomes part of the public API (so better naming ideas are definitely welcome)...

πŸ“ Checklist

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

@danielroe danielroe added the enhancement New feature or request label Mar 6, 2023
@danielroe danielroe requested a review from pi0 March 6, 2023 22:34
@danielroe danielroe self-assigned this Mar 6, 2023
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Merging #1027 (e762aa5) into main (b495675) will decrease coverage by 0.40%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1027      +/-   ##
==========================================
- Coverage   67.59%   67.20%   -0.40%     
==========================================
  Files          62       62              
  Lines        6259     6287      +28     
  Branches      707      707              
==========================================
- Hits         4231     4225       -6     
- Misses       2015     2049      +34     
  Partials       13       13              
Impacted Files Coverage Ξ”
src/build.ts 39.17% <0.00%> (-4.44%) ⬇️

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

@pi0
Copy link
Member

pi0 commented Mar 6, 2023

Nice change. Can we with the same PR, split to explicit nitro-imports.d.ts too? (then nitro can reference both)

(further, i think we might split nitro-routes and nitro-config too. logic in same file is getting longer over the time)

@pi0 pi0 changed the title feat: split out api types refactor: split out api types Mar 8, 2023
@pi0 pi0 merged commit 591f9aa into main Mar 8, 2023
@pi0 pi0 deleted the feat/split-types branch March 8, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants