-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Fix indexing for non-prefixed stories.*
stories
#23974
Conversation
Self-merging @JReinhold |
@@ -196,7 +196,7 @@ export const features = async ( | |||
}); | |||
|
|||
export const csfIndexer: Indexer = { | |||
test: /\.(stories|story)\.(m?js|ts)x?$/, | |||
test: /(stories|story)\.(m?js|ts)x?$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use *.examples.tsx
naming convention in our project. Can we somehow override this regexp in our config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. There's been talk about using the stories glob directly, but that's not implemented. Easiest thing is to use .stories.x per the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also add a custom indexer yourself. @JReinhold and @kylegach are working on docs for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we get documentation on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes @antrianis! The docs won't be published until the next minor version, but you can see it here: https://github.com/storybookjs/storybook/blob/next/docs/api/main-config-indexers.md
Closes #23923
What I did
Add support for
(stories|story)\.*
filesChecklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Add a
stories.ts
file to a sandbox🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>