-
-
Notifications
You must be signed in to change notification settings - Fork 609
types: avoid overriding app runtime config namespace #1333
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1333 +/- ##
==========================================
+ Coverage 76.74% 76.77% +0.02%
==========================================
Files 71 71
Lines 7181 7190 +9
Branches 710 710
==========================================
+ Hits 5511 5520 +9
Misses 1669 1669
Partials 1 1
|
src/types/nitro.ts
Outdated
@@ -31,11 +31,19 @@ export type NitroDynamicConfig = Pick< | |||
"runtimeConfig" | "routeRules" | |||
>; | |||
|
|||
export interface NitroRuntimeConfigApp { | |||
baseURL: string; | |||
[key: string]: unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untyped keys were any since before 2.5. Changing any to unknown (at least for me) is a breaking change. When users where depending on any type it will basically break their type checks even if safer or better. Can we override it for nuxt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made change to make PR mergeable. Would be happy to discuss about next steps plan of adopting unknown...
π Linked issue
β Type of change
π Description
Currently it's not possible to augment
runtimeConfig.app
whilst also using Nitro types for runtime config.This PR makes it possible to augment
app
. It also exposes thenitro
type. (I can also make augmentation disallowed for this if that is desirable.)π Checklist