-
-
Notifications
You must be signed in to change notification settings - Fork 743
fix: get mdc configs by calling mdc:configSources hook
#3736
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
Open
danielroe
wants to merge
1
commit into
main
Choose a base branch
from
fix/mdc-config-order
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19
β15
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
π§© Analysis chain
π Script executed:
Repository: nuxt/content
Length of output: 361
π Web query:
@nuxtjs/mdc mdc:configSources hook release version history PR 471π‘ Result:
mdc:configSourcesis a Nuxt hook exposed by@nuxtjs/mdcwith signature(configs: string[]) => void(i.e., modules can mutate/extend the list of MDC config source files). Itβs present at least as far back as@nuxtjs/mdc@0.13.1(in the published type declarations). [3]mdc:configSourcesafter all modules have runβ (PR Link to edit the page in Github is invalidΒ #455). [2]mdc:configSourceschanges). [2]#471(release status): PR feat(theme-docs): add locale simplified chinese supportΒ #471 titled βfix: don't memoise configs, and allow external modules to callmdc:configSourcesβ is open as of Feb 27, 2026, and is intended to let external modules call the hook (not just listen) and to avoid memoizing configs, coordinated withnuxt/content#3736. It is not released yet (not included in the v0.20.1 notes). [1]Sources: PR
#471page [1],nuxt-content/mdcGitHub Releases [2],@nuxtjs/mdc@0.13.1type declarations (unpkg) [3].π Script executed:
Repository: nuxt/content
Length of output: 2008
π Web query:
@nuxtjs/mdc v0.20.1 mdc:configSources hook usage external modules callπ‘ Result:
In
@nuxtjs/mdc, the Nuxt hook is typed as:mdc:configSources:(configs: string[]) => void(you receive a mutable array of file paths and can push your own config source paths into it). [1]Use it from an external Nuxt module
Add your module after
@nuxtjs/mdcinnuxt.config.tsso the hook exists when you register:Notes
nuxt.hook(...)), not from a runtime plugin.string[]), so you typically push resolved absolute paths to config files. [1]Source(s):
@nuxtjs/mdctype declarations showing the hook signature. [1]References
[1] https://app.unpkg.com/%40nuxtjs/mdc%400.13.1/files/dist/module.d.mts
The
mdc:configSourceshook call requires unreleased features not available in v0.20.1.Line 23 calls
await nuxt.callHook('mdc:configSources', paths)to allow modules to populate the paths array. However, this requires PR#471("allow external modules to callmdc:configSources"), which is currently open and not released. The locked version@nuxtjs/mdc@0.20.1predates this feature, meaning the hook call will succeed but paths will silently remain empty if no code in v0.20.1 processes it. Either upgrade the version constraint once PR#471is released, or verify that v0.20.1 supports external hook calls via a different mechanism.π€ Prompt for AI Agents