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

fix: support stories config with configuration objects #424

Merged
merged 2 commits into from
Feb 19, 2023

Conversation

stevoland
Copy link
Contributor

Issue: #423 sb-rn-get-stories does not support stories config with a configuration object (titlePrefix)

What I did

Updated loader script to use normaliseStories which supports string globs and configuration objects

How to test

Use configuration objects and remove title property from story metadata.

module.exports = {
  stories: [
    {
      files: '**/*.stories.tsx',
      directory: './components',
      titlePrefix: 'ComponentsPrefix',
    },
  ],

@@ -91,7 +140,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";


const getStories=() => {
return {\\"./scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx\\": require(\\"include-components/FakeStory.stories.tsx\\")};
return {\\"./scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx\\": require(\\"./include-components/FakeStory.stories.tsx\\")};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this snapshot but it seems correct now?

@dannyhw
Copy link
Member

dannyhw commented Feb 13, 2023

@stevoland thanks for your contribution 🙏. This looks really great!

I'll go through this more thoroughly soon, sorry for the delay I've been very busy unfortunately.

@stevoland
Copy link
Contributor Author

I'll go through this more thoroughly soon, sorry for the delay I've been very busy unfortunately

Thanks, no rush. I know the feeling!

@dannyhw
Copy link
Member

dannyhw commented Feb 19, 2023

Looks good, thanks again!

@dannyhw dannyhw merged commit 0cb086c into storybookjs:next-6.0 Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants