storybookjs / addon-svelte-csf

[Incubation] CSF using Svelte components.
MIT License
103 stars 32 forks source link

[Bug] Can't set tags on <Meta> component to enable fine-grained autodocs #87

Closed hallefsantos closed 1 year ago

hallefsantos commented 1 year ago

Hey guys, is there a way to use tags: ['autodocs'] to auto-generate documentation? Or is there a better way?

I've tried this, but didn't work.

image

Environment

System: OS: Linux 5.10 Ubuntu 20.04.5 LTS (Focal Fossa) CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor Memory: 4.14 GB / 7.74 GB Container: Yes Shell: 5.8 - /bin/zsh Binaries: Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.18.1/bin/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm npmPackages: vite: 4.0.0 => 4.0.0

JReinhold commented 1 year ago

It should work the way you tried, but I'm not surprised that it doesn't, since this is a new prop to the top level meta definition. Thanks for bringing this up!

In the mean time, the best workaround currently is to set autodocs globally, but that won't allow you specify it at the file level unfortunately.

https://storybook.js.org/docs/7.0/svelte/writing-docs/docs-page#configure

// .storybook/main.js

module.exports = {
  ...
  docs: {
    ...
    autodocs: true,
  },
};
JReinhold commented 1 year ago

@hallefsantos did it work natively as you expected? if not, then let's keep this open as a bug report to fix it.

enyo commented 1 year ago

@JReinhold just ran into this and can confirm that setting auto docs on the Meta component does not work.

viktorgullmark commented 1 year ago

@JReinhold Same here, cant set tags on Meta

Masstronaut commented 1 year ago

@JReinhold the workaround of setting autodocs globally worked for my use case. I do still think it's worth adding the missing fields to the Meta component though.

j3rem1e commented 1 year ago

See #134