Skip to content

Add component description and name to vue-component-meta #5693

@Daenara

Description

@Daenara

What problem does this feature solve?

I am using vue-component-meta to extract meta data from my components to then generate web-typers.json so that IntelliJ will correctly offer data on hover and the autocomplete works. This works great for what is currently offered, but I would like to also get the component description that can be added by using a jsdoc string above the export default.

Currently I do that with a workaround, namely reading the file from disk, parsing and compiling it with the vue-compiler-sfc, then throwing the resulting js code into a jsdoc extraction script and it seems like such a waste to go through all that, when I see that vue-component-meta already deals with exports in a private function.

What does the proposed solution look like?

I propose to add a name and a description entry on the root of ComponentMeta to also expose the "global" meta data for the component. Name can technically be inferred from the file name, but with the option of actually setting a name in the options api it would be nice to also expose that.

{
  name: 'MyComponent',
  description: 'My awesome component description',
  type: [Getter],
  props: [Getter],
  events: [Getter],
  slots: [Getter],
  exposed: [Getter]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions