Skip to content

fix: fix types for custom providers shadowing builtins#2016

Merged
danielroe merged 3 commits into
nuxt:mainfrom
dreitzner:fix-2015-custom-provider-type-generation
Nov 18, 2025
Merged

fix: fix types for custom providers shadowing builtins#2016
danielroe merged 3 commits into
nuxt:mainfrom
dreitzner:fix-2015-custom-provider-type-generation

Conversation

@dreitzner
Copy link
Copy Markdown
Contributor

fix correct type generation for custom providers with same name as built in providers

🔗 Linked issue

resolves #2015

❓ 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)
  • ✨ 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 fixes the ttype generation for cases where custom providers have the same name as built in providers.

@dreitzner dreitzner requested a review from danielroe as a code owner November 6, 2025 08:17
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Nov 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2016

commit: cad2396

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.99%. Comparing base (aba9b7f) to head (cad2396).

Files with missing lines Patch % Lines
src/provider.ts 0.00% 6 Missing ⚠️
src/module.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #2016      +/-   ##
========================================
- Coverage   7.00%   6.99%   -0.01%     
========================================
  Files         78      78              
  Lines       3625    3629       +4     
  Branches     140     140              
========================================
  Hits         254     254              
- Misses      3322    3326       +4     
  Partials      49      49              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

I wonder if we can resolve this with type safety by telling custom provider authors how to augment these interfaces

@dreitzner
Copy link
Copy Markdown
Contributor Author

I wonder if we can resolve this with type safety by telling custom provider authors how to augment these interfaces

Not sure how I would implement that 😁

@danielroe danielroe changed the title fix-2015: correct type generation for custom providers with same name fix: fix types for custom providers shadowing builtins Nov 16, 2025
@danielroe
Copy link
Copy Markdown
Member

pushed a change - does this work in your use case?

@dreitzner
Copy link
Copy Markdown
Contributor Author

pushed a change - does this work in your use case?

@danielroe yes that works and those changes look a little cleaner than mine 👍

Thank you

@danielroe danielroe merged commit ab652ab into nuxt:main Nov 18, 2025
7 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 18, 2025
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.

Bug: Custom provider types are not generated correctly if it has the same name as a built in provider

3 participants