-
Notifications
You must be signed in to change notification settings - Fork 473
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
chore: refactor module #3117
chore: refactor module #3117
Conversation
approving to run ci |
|
||
ctx.genTemplate = genTemplate | ||
|
||
nuxt.options.runtimeConfig.public.i18n.locales = simplifyLocaleOptions(nuxt, defu({}, options)) |
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.
I'm guessing we can't move this to prepare/runtime-config.ts
right? 🤔
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.
oh, we can do what we want here
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 can move runtime config after runtime and then we can move it: do you want me to move it?
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.
This PR is amazing!
Thanks!
🔗 Linked issue
This PR just moves logic from
module.ts
to the corresponding module: for example, when configuring nitro, the currentmodule.ts
will build theAdditionalSetupNitroParams
(being used or not), with the new approach, thenitro.ts
module will build theAdditionalSetupNitroParams
when required.The idea is to have the
module.ts
to orchestrate the I18n configuration: any shared data should be on the context, and the modules should do their work. Themodule.ts
will call the initialization sequence correctly, and modules preparing shared data should add their stuff to the context (checkprepare/locale-info.ts
andprepare/runtime.ts
).Any module should only accept the context and nuxt as parameters: using destructuring on the context to get used data.
❓ Type of change
📚 Description
📝 Checklist