-
-
Notifications
You must be signed in to change notification settings - Fork 172
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(types): export interface for module builder type generation #738
fix(types): export interface for module builder type generation #738
Conversation
@@ -245,3 +246,16 @@ export default defineNuxtModule<ModuleOptions>({ | |||
logger.success('`nuxt-auth` setup done') | |||
} | |||
}) satisfies NuxtModule<ModuleOptions> | |||
|
|||
// Used by nuxt/module-builder for `types.d.ts` generation | |||
export type { ModuleOptions } |
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.
If possible, you can export the whole file of types export * from './runtime/types'
and this would generate the entire module
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.
@joaltoroc Thanks for your input, is there a strong reason why that is better?
is it possible that this fix gets released as 0.7.3? because without it, we get unnecessary eslint issues while having nuxt 3.11.2. I think it will be sometime before we get stable version 8. thanks |
๐ Linked issue
โ Type of change
๐ Description
Resolves #797
This moves the type augmentation to
module.ts
and exports theModulePublicRuntimeConfig
interface (as well asModuleOptions
) which are used by nuxt/module-builder to generate the correct types.The original type augmentation is kept to for type inference in the source code (matches previous behaviour).
Without these changes the types will conflict with those of other modules (nuxt-modules/i18n#2915), I have tested these changes locally with the reproduction provided in the referenced issues and it seems to work.
๐ Checklist