-
Couldn't load subscription status.
- Fork 914
perf(module): use moduleDependencies to manipulate options
#4927
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
base: v4
Are you sure you want to change the base?
Conversation
|
@danielroe Don't we need to update to |
|
oh, quite right. I'll update this PR once 4.1.2 is out. |
moduleDependencies to manipulate options
3f0c24a to
c9ba808
Compare
| defaults: { | ||
| weights: [400, 500, 600, 700] | ||
| } |
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.
| defaults: { | |
| weights: [400, 500, 600, 700] | |
| } | |
| weights: [400, 500, 600, 700] |
The @nuxt/fonts module configuration has an extra nested defaults property that shouldn't be there, which will cause the module to receive incorrect configuration.
View Details
Analysis
Extra nested defaults property in @nuxt/fonts moduleDependencies configuration
What fails: The @nuxt/fonts module configuration in src/module.ts line 123 has an unnecessary nested defaults property: defaults: { defaults: { weights: [...] } } instead of the correct defaults: { weights: [...] }
How to reproduce:
# Both configurations work, but the nested one is incorrect:
git log --oneline -p -S "defaults: {" -- src/module.ts
# Shows migration from registerModule to moduleDependencies introduced extra nestingResult: The configuration works due to @nuxt/fonts being robust, but contains unnecessary nesting introduced during migration from registerModule('@nuxt/fonts', 'fonts', { defaults: { weights: [...] } }) to moduleDependencies structure
Expected: Should use single-level defaults consistent with other modules like @nuxt/icon and @nuxtjs/color-mode in the same configuration block, per Nuxt Kit moduleDependencies docs
π Linked issue
β Type of change
π Description
this uses the new module dependencies feature in https://github.com/nuxt/nuxt/releases/tag/v4.1.0 to specify options for other modules (and require them).
Schema + kit are pinned because this repo is using shamefully-hoist, and the wrong version of each of these might be hoisted.
(We ultimately need to resolve that issue, but it's for another time.)
I'm opening this as a draft because it's very possible that something might break.
π Checklist