-
Notifications
You must be signed in to change notification settings - Fork 507
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
feat: generate types for runtime config #2306
Conversation
It would maybe be nice to allow this to be disabled, in case there's an issue with types conflicting between auto-generated nuxt + nitro types. |
I was thinking about that, but what condition do I check against to disable it? |
You would add a nitro option: Lines 121 to 128 in d12aae1
|
We can disable when framework usage is detected. What inconsistency can happen? |
Ideally we wouldn't disable - just wanted a way to bail out if there was an issue. Sometimes if you have multiple augmentations of the same underlying property there can be failure, and I haven't yet tested this implementation. (Which might be a better first step! π) |
Might be nice to add a type test to the fixture to verify that these types do in fact type the runtimeConfig. π |
Ok, I will add tests too |
I was looking into test the types but I don't see a good way to do so, any suggestions? |
π Linked issue
#1706
β Type of change
π Description
I have add
untyped
as a dependency and now nitro can generate types foruseRuntimeConfig()
just like Nuxt does.It would be helpful for users to have types for
useRuntimeConfig()
which helps a lot while using nitro standalone.For now I have utilized
nitro-config.d.ts
to keep the types in, please let me know If you would want to change the file.Fixes #1706
π Checklist