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

List of all stories in runtime #3847

Closed
Diokuz opened this issue Jul 6, 2018 · 3 comments
Closed

List of all stories in runtime #3847

Diokuz opened this issue Jul 6, 2018 · 3 comments
Labels

Comments

@Diokuz
Copy link

Diokuz commented Jul 6, 2018

Is there are way to get the list of all stories in storybook?
For example: I want to know urls of all my stories to make screenshots.
Or: I want to load all urls and make sure nobody fails.

@stale
Copy link

stale bot commented Jul 27, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jul 27, 2018
@matthiaskomarek
Copy link
Contributor

@Diokuz I have managed to get all stories by doing this inside the .storybook/config.js file:

import {configure, getStorybook} from '@storybook/react';

// basic setup for storybook, depends on your project structure
const req = require.context('../packages', true, /\.story\.js$/);

function loadStories() {
  req.keys().forEach((filename) => req(filename))
}

configure(loadStories, module);

// this will return an object with all stories inside
const stories = getStorybook();

@stale stale bot removed the inactive label Aug 2, 2018
@stale
Copy link

stale bot commented Aug 23, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

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

No branches or pull requests

3 participants