Skip to content

fix: Prevent exported runtime stories from colliding with story names #310

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

Merged
merged 9 commits into from
May 28, 2025

Conversation

xeho91
Copy link
Collaborator

@xeho91 xeho91 commented May 18, 2025

Resolves #250

@xeho91 xeho91 self-assigned this May 18, 2025
@xeho91 xeho91 added bug Something isn't working patch Increment the patch version when merged internal Changes only affect the internal API tests Add or improve existing tests labels May 18, 2025
@xeho91 xeho91 requested a review from JReinhold May 18, 2025 14:11
@JReinhold
Copy link
Collaborator

I've confirmed that the failing test is indeed because Storybook's internal CSF parsing (that is used by the Vitest addon) has a bug where it does not get tags (like '!test') out from stories exported like export { localName as exportName }. That bug is fixed in storybookjs/storybook#31519

Thus making this change would mean that story-level 'test'/'!test' tags in Svelte CSF would not be picked up by addon-vitest until the bug is fixed in Storybook 9.0.0. I think we should wait with releasing this change to the addon until SB 9 goes stable then, but I wouldn't consider it a breaking change.
Thoughts @shilman ?

@shilman
Copy link
Member

shilman commented May 20, 2025

We could patch the fix back to 8.6 if it helps?

I'm doing an RC release in the next hour also FWIW

@JReinhold
Copy link
Collaborator

We could patch the fix back to 8.6 if it helps?

The addon supports 8.2 and up, so that wouldn't help that much in terms of breaking change. I think waiting till 9.0 GA is fine.

@JReinhold
Copy link
Collaborator

I updated the Storybook (and a bunch of other stuff) to include the fix and now the tests are passing. 🎉

@JReinhold JReinhold removed the internal Changes only affect the internal API label May 28, 2025
@JReinhold JReinhold merged commit 8dffb2d into main May 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch Increment the patch version when merged tests Add or improve existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Error when Story name is same as component import specifier
3 participants