-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(kit): provide type support for module options in installModule
#26744
Conversation
Run & review this pull request in StackBlitz Codeflow. |
installModule
packages/kit/build.config.ts
Outdated
@@ -7,6 +7,7 @@ export default defineBuildConfig({ | |||
], | |||
externals: [ | |||
'@nuxt/schema', | |||
'nuxt/schema', |
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.
we need to use @nuxt/schema
within Kit as there is no nuxt
dependency. The end user is the only one who should use nuxt/schema
as a type import/augmentation...
(We might need to generate an augmentation against @nuxt/schema
as well.)
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.
Makes sense, but the updated NuxtConfig that has the new modules
options would be based on the types Nuxt has written for their project right, so they get imported using nuxt/schema
is what I've found
(typecheck CI has now failed)
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.
Yes, I understand. We need to find a different solution than using nuxt/schema
with @nuxt/kit
...
Nice work! And also debugging the type issue. This will be a nice DX improvement ❤️ |
🔗 Linked issue
📚 Description
These changes relies and builds on top of #18416 (my first PR on Nuxt 😄); it extracts the options from there after module authors run prepare.
Try this in the repo playground: