Skip to content

feat(nuxt): generate basic jsdoc for module config entry #27689

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

Merged
merged 7 commits into from
Aug 13, 2024

Conversation

antfu
Copy link
Member

@antfu antfu commented Jun 18, 2024

Before:

Screenshot 2024-06-18 at 14 06 30

After:

Screenshot 2024-06-18 at 14 06 02

The duplication of tags are because we are extending both @nuxt/schema and nuxt/schema - I guess it won't hurt much, we could figure out it later, or we only generate jsdoc for one of them?

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@antfu
Copy link
Member Author

antfu commented Jun 18, 2024

Currently the information we have are kinda limited:

Screenshot 2024-06-18 at 14 09 09

Should we encourage module authors to have more fields in meta, like documentation for custom URL, description for short description, etc?

export interface ModuleMeta {
/** Module name. */
name?: string
/** Module version. */
version?: string
/**
* The configuration key used within `nuxt.config` for this module's options.
* For example, `@nuxtjs/axios` uses `axios`.
*/
configKey?: string
/**
* Constraints for the versions of Nuxt or features this module requires.
*/
compatibility?: NuxtCompatibility
[key: string]: unknown
}

/cc @pi0 @danielroe

@atinux
Copy link
Member

atinux commented Jun 18, 2024

Thank you for working on it ❤️

I like the description and documentation fields 👍

@danielroe
Copy link
Member

Maybe we could add the jsdoc tags to only one of the augmented modules?

@antfu
Copy link
Member Author

antfu commented Jul 28, 2024

It should be good now; I assume mod.meta could be the data structured as package.json

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely - thank you! ❤️

It's possible there are still some edge cases (like alternative registries) but we can always iterate if needed.

@danielroe danielroe merged commit c92b2df into main Aug 13, 2024
38 checks passed
@danielroe danielroe deleted the feat/jsdoc-module-config branch August 13, 2024 11:19
@github-actions github-actions bot mentioned this pull request Aug 13, 2024
@github-actions github-actions bot mentioned this pull request Aug 28, 2024
Kamsou pushed a commit to Kamsou/nuxt that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants