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(nuxt): improved typing support for app config #20526

Merged
merged 1 commit into from Apr 26, 2023
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Apr 26, 2023

πŸ”— Linked issue

closes #20440

❓ 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 PR bundles a few type fixes for app config:

  1. First, it ensures that even keys that are not actually present in appConfig are represented in its types. This might affect modules that use custom schema. (resolves error TS2339: Property 'nuxtIcon' does not exist on type 'AppConfig'Β nuxt-modules/icon#62)
  2. Second, it ensures that keys can be set in defineAppConfig that are not present on AppConfigInput (resolves nuxt-icon breaks type extension of AppConfigInput?Β nuxt-modules/icon#72).

I've added a test to cover both.

πŸ“ Checklist

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

@codesandbox
Copy link

codesandbox bot commented Apr 26, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

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.

πŸ’―

@danielroe danielroe merged commit dd0d13d into main Apr 26, 2023
17 checks passed
@danielroe danielroe deleted the fix/app-configs branch April 26, 2023 13:30
This was referenced Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants