feat(vue3-vite): expose vue-component-meta checker options in docgen configuration #35552
dmitriy-prokoshev
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
@storybook/vue3-viteusesvue-component-metawhen configured with:Internally, the framework creates the component-meta checker with fixed options and does not enable or expose its schema option.
With vue-component-meta@3.x, when schema is disabled, a prop declared through a type alias may contain only a string schema:
With schema: true, the same prop contains enum metadata:
This metadata is useful for custom Storybook controls and overview stories that need to enumerate literal-union values.
Describe the solution you'd like
Expose vue-component-meta checker options through the Vue 3 + Vite docgen configuration:
checkerOptions could use the MetaCheckerOptions type exported by vue-component-meta.
Describe alternatives you've considered
Use
vue-docgen-apiinstead ofvue-component-meta.This would avoid the specific schema format change, but
vue-component-metais the recommended Vue docgen implementation and provides better support for complex TypeScript types. Switching would be a regression for our use case.Maintain a local replacement for Storybook’s internal Vite plugin.
A local plugin can call
createChecker(..., { schema: true }), but it duplicates Storybook internals and is fragile: any upstream change to the plugin must be copied and reviewed manually.Patch
@storybook/vue3-vitewithpatch-package.This is smaller than maintaining a full local plugin, but still relies on an internal implementation detail and must be updated or revalidated after every dependency upgrade.
Hard-code union values in each story.
This avoids relying on docgen metadata, but duplicates component type definitions and can become outdated when the prop union changes.
Downgrade or pin
vue-component-metato v2.This restores the previous behavior indirectly, but it is not a sustainable solution because the dependency is transitive and may be incompatible with current or future Storybook releases.
Are you able to assist to bring the feature to reality?
no
Additional context
Currently consumers must replace the internal storybook:vue-component-meta-plugin with a local copy solely to pass schema: true.
Storybook docs currently expose plugin and tsconfig for this configuration, but no checker options.
All reactions