Skip to content

feat: Add Storybook for the Vue package instead of Histoire #3396

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
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

carwack
Copy link
Collaborator

@carwack carwack commented Mar 18, 2025

Add Storybook v8.6.7 in favor of Histoire for the Vue package.

As reply on: #3382 (comment)

Works with one workaround in .storybook/main.ts

 // TODO: fix this when vue-docgen accepts types from other packages in components
   // This is a workaround until vue-docgen-plugin is fixed since we also dont use autodocs
   // This removes the plugin vue-docgen-plugin so it wont load and throws an error on the use of an type import like
   // import { Avatar, type AvatarRootEmits, type AvatarRootProps } from '@ark-ui/vue/avatar'
   // using options: { docgen: "vue-component-meta",} throws other errors with node_modules/@zag-js/avatar/dist/index.mjs.vue' 
   // could not be found. This could be a fix for the vue-docgen-plugin error but it is not working for now
   viteFinal(config) {
     const vueDocgenIndex = config.plugins?.findIndex((plugin) => 
       plugin && typeof plugin === 'object' && 'name' in plugin && plugin.name === 'storybook:vue-docgen-plugin'
     ) ?? -1
     if (vueDocgenIndex !== -1) config.plugins?.splice(vueDocgenIndex, 1)
     return config
   }

carwack added 30 commits March 18, 2025 22:26
@carwack carwack added the vue label Mar 18, 2025
@carwack carwack self-assigned this Mar 18, 2025
Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ark-docs ✅ Ready (Inspect) Visit Preview Mar 18, 2025 11:52pm

Copy link

pkg-pr-new bot commented Mar 18, 2025

Open in Stackblitz

npm i https://pkg.pr.new/chakra-ui/ark/@ark-ui/react@3396
npm i https://pkg.pr.new/chakra-ui/ark/@ark-ui/solid@3396
npm i https://pkg.pr.new/chakra-ui/ark/@ark-ui/svelte@3396
npm i https://pkg.pr.new/chakra-ui/ark/@ark-ui/vue@3396

commit: 1d77784

@carwack carwack changed the title Feat/add vue storybook feat: Add Storybook for the Vue package instead of Histoire Mar 19, 2025
export const Closed = {
render: () => ({
components: { AccordionExample },
template: `<AccordionExample multiple :items="['React', 'Solid', 'Vue']" />`,
Copy link
Member

Choose a reason for hiding this comment

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

@carwack

I don't know but having the template as a string feels not great from a DX perspective, as errors can easily happen. Is there an alternative to this?

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

Successfully merging this pull request may close these issues.

2 participants