Skip to content
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

[Feature request] api that accepts a file ( .vue, .ts, .js, .tsx...) and return if it is a component or no. #3151

Closed
Tracked by #3271
chakAs3 opened this issue May 10, 2023 · 1 comment · Fixed by #3286
Labels
enhancement New feature or request

Comments

@chakAs3
Copy link
Contributor

chakAs3 commented May 10, 2023

vue-component-meta is a tool that enables the extraction of metadata, such as props, slots, events, etc., from a file, regardless of whether the file is a component or not. While .vue files are compiled as components, .js and .ts files may not export any component.

In a Storybook application, vue-component-meta can be useful for extracting metadata from component files. However, the current implementation only allows filtering of .vue files, assuming they are components. To extract metadata from .ts, .js, .tsx, and .jsx files, a new API is needed to filter only the files that are components (SFC, options API components, functional components, etc.).

Similarly, in other contexts such as a UI library, vue-component-meta can be useful for code analytics, such as counting the number of components and their types. The new API that filters only component files would be beneficial in this context as well. Overall, vue-component-meta has several potential use cases where the ability to extract metadata from a variety of file types is necessary.

@chakAs3 chakAs3 changed the title [Feature request] api that accepts a file ( .vue ,.ts, .js, tsx...) and return if it is a component or no [Feature request] api that accepts a file ( .vue, .ts, .js, .tsx...) and return if it is a component or no. May 10, 2023
@johnsoncodehk johnsoncodehk added the enhancement New feature or request label May 17, 2023
@johnsoncodehk johnsoncodehk pinned this issue Jun 8, 2023
@johnsoncodehk johnsoncodehk unpinned this issue Jun 8, 2023
@chakAs3
Copy link
Contributor Author

chakAs3 commented Jul 4, 2023

@johnsoncodehk Amazing my final implementation in Storybook gives, https://stackblitz.com/~/github.com/chakAs3/vue3-storybook-custom-render.
checkout this if you have any feedback, and really thank you for the amazing tooling that makes Vue a great ecosystem that can impact other great tools like storybook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants