atanasster / storybook-addon-deps

A storybook addon to add a dependencies tree exporer tab.
https://atanasster.github.io/storybook-addon-deps/?path=/docs/design-system-avatarlist--short
MIT License
59 stars 3 forks source link

Imported component not shown as dependency (vue) #11

Closed puyt closed 4 years ago

puyt commented 4 years ago

Hi,

Thanks for your fast update with the storybook 6 release but I can't seem to get it to work for my Vue project, am I doing something wrong? I want to use this addon to display the dependencies with other components.

Simple example: I have 2 components BButton.vue & BIcon.vue, the BIcon.vue is used in BButton.vue test-sb-deps.zip

So I on the BIcon docs I want that it's used in BButton and for BButton I want to see it has a dependency of the BIcon component.

Also can I get rid of the other dependencies as seen in the screen below?

image

Thanks in advance!

atanasster commented 4 years ago

Thanks @puyt for the sample - getting on it and will post as soon as I figure out the dependency issue.

As for filtering dependencies - which dependencies do you want to hide? There is an option to only show dependencies that do have a story written for them (so it will hide system-type dependencies)

puyt commented 4 years ago

As for filtering dependencies - which dependencies do you want to hide? There is an option to only show dependencies that do have a story written for them (so it will hide system-type dependencies)

Oh right I totally forgot about that, I turned the option off to see if it'd make any difference 😅

atanasster commented 4 years ago

@puyt - is this how you wanted to see it working:

grab97

atanasster commented 4 years ago

A release 2.1.1 should address the vue/sb6 support. Please confirm how it works for you.

I also added a bit of docs on the excludeFn parameter for dependecnies tables

puyt commented 4 years ago

@puyt - is this how you wanted to see it working:

grab97

Isn't BIcon a dependency for BButton instead of dependent and vice versa? Since BIcon is required in BButton in orde to make it work?

Thanks again!

atanasster commented 4 years ago

ooops, you are right - the solution for vue a bit of a hack and I fixed it now. Please try 2.1.2

grab98

puyt commented 4 years ago

Looks good for dependencies :+1: But the dependents aren't detected yet I think? In BIcon there should be a dependent for BButton as seen in your design system example for AvatarList & Avatar link

Not sure how much work/different it is for vue though and i mostly needed dependencies so i'm already happy :+1:

atanasster commented 4 years ago

yeah, thats why i said its a bit of a hack. Since you are ok for now, I will postpone looking for a real solution for this issue with vue as I am a bit busy with other projects atm.

puyt commented 4 years ago

Sure thanks for the fast update :+1:

atanasster commented 4 years ago

@puyt - ok, I couldn't leave it :)

Can you please try 2.1.3 - its still the hacky solution using vue's component.components but should show correctly dependents for now.

grab99

puyt commented 4 years ago

@atanasster heh :stuck_out_tongue: It works, thanks a lot :+1: :smile: