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

Add support for story-level tags #207

Merged
merged 5 commits into from
Sep 1, 2024

Conversation

JReinhold
Copy link
Collaborator

@JReinhold JReinhold commented Aug 30, 2024

Fixes #203

This PR adds support for story-level tags as described at https://storybook.js.org/docs/writing-stories/tags

Ie. <Story name="..." tags={['!dev', 'autodocs']} />

  • Extracted tags from Story attributes
  • Forwarded extracted stories to the index inputs
  • Updated StoryProps types to support the tags prop
  • Added test stories that demonstrates/tests the feature
  • Upgraded the internal Storybook to ~8.1.0, because that's the first version that reliably works with tags as we know it today.

If you want to use this feature today, make sure you're at least on Storybook version 8.1.0

📦 Published PR as canary version: 4.1.7--canary.207.1873b6d.1

✨ Test out this PR locally via:

npm install @storybook/addon-svelte-csf@4.1.7--canary.207.1873b6d.1
# or 
yarn add @storybook/addon-svelte-csf@4.1.7--canary.207.1873b6d.1

@JReinhold JReinhold linked an issue Aug 30, 2024 that may be closed by this pull request
@JReinhold JReinhold self-assigned this Aug 30, 2024
@JReinhold JReinhold added enhancement New feature or request patch Increment the patch version when merged labels Aug 30, 2024
@JReinhold JReinhold marked this pull request as ready for review August 30, 2024 21:43
@JReinhold JReinhold requested a review from xeho91 August 30, 2024 21:43

<Meta title='test'/>

<Story name="Story1" tags="single" >
Copy link
Collaborator

@xeho91 xeho91 Sep 1, 2024

Choose a reason for hiding this comment

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

This isn't following CSF v3.0 format, right? Asking to clarify if we're supposed to preserve this behavior in v5 of this addon (on the next branch).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good question. I think our legacy support should support this, but the new API shouldn't, as this is not like regular CSF, and I only added it here because it's how Meta already works.

@JReinhold JReinhold merged commit cda2e91 into main Sep 1, 2024
4 checks passed
@JReinhold JReinhold deleted the 203-bug-story-level-tags-are-ignored branch September 1, 2024 20:13
@shilman
Copy link
Member

shilman commented Sep 1, 2024

🚀 PR was released in v4.1.7 🚀

@shilman shilman added the released This issue/pull request has been released. label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Story-level tags are ignored
3 participants