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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix indexing for non-prefixed stories.* stories #23974

Merged
merged 2 commits into from Aug 28, 2023

Conversation

shilman
Copy link
Member

@shilman shilman commented Aug 28, 2023

Closes #23923

What I did

Add support for (stories|story)\.* files

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end 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>

@shilman
Copy link
Member Author

shilman commented Aug 28, 2023

Self-merging @JReinhold

@shilman shilman merged commit aecfa17 into next Aug 28, 2023
53 checks passed
@shilman shilman deleted the shilman/23923-fix-story-indexing branch August 28, 2023 14:20
@github-actions github-actions bot mentioned this pull request Aug 28, 2023
11 tasks
@@ -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?$/,
Copy link
Member

@Hypnosphi Hypnosphi Aug 28, 2023

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?

Copy link
Member Author

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

Copy link
Member Author

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

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?

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: I cannot name stories stories.tsx
4 participants