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

Autoload all /.story.js$/ #1013

Closed
ndelangen opened this issue May 10, 2017 · 8 comments
Closed

Autoload all /.story.js$/ #1013

ndelangen opened this issue May 10, 2017 · 8 comments

Comments

@ndelangen
Copy link
Member

Instead of having consumers require every story file, we can do a glob-pattern match and auto-load.

This is consistent with how tools like jest work.

@aaronmcadam
Copy link
Contributor

Another common idiom I see is *.stories.js, but I'd be happy if we agree on a single naming scheme.

@dikarel
Copy link

dikarel commented May 10, 2017

IMO it should be able to load any of:
*.stories.js, *.story.js, story.js, stories.js

A use-case where you want story.js or stories.js is something like:

  • components
    • text-field
      • index.js
      • styles.js
      • stories.js
    • button
      • index.js
      • styles.js
      • stories.js

@pierrecholhot
Copy link

I would rather have an addon that auto loads all my stories when instructed rather than have this behaviour applied by default

@danielduan
Copy link
Member

I think the *.jsx extension should be added as well.

@usulpro
Copy link
Member

usulpro commented May 14, 2017

If we talk about add this pattern to "getstorybook" as default, I think It's great. It allows people to start writing stories just after adding storybook to their project but also lefts flexibility of manual customization

@danielduan
Copy link
Member

danielduan commented Oct 31, 2017

I'm gonna toss it into the cli for 3.3.

@stale stale bot removed the inactive label Oct 31, 2017
@danielduan danielduan self-assigned this Oct 31, 2017
@danielduan danielduan modified the milestones: v4.0.0, v3.3.0 Oct 31, 2017
@ndelangen
Copy link
Member Author

@danielduan that sounds great!

In #1209 I'd also like the visit the idea of configuring this in a config, much like how you set a testPattern for jest.

@Hypnosphi
Copy link
Member

Works in 3.3.0-alpha.4

@storybookjs storybookjs deleted a comment from stale bot Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants