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

Generate storybook-report.json in static builds #16990

Closed
ghengeveld opened this issue Dec 12, 2021 · 2 comments
Closed

Generate storybook-report.json in static builds #16990

ghengeveld opened this issue Dec 12, 2021 · 2 comments

Comments

@ghengeveld
Copy link
Member

Is your feature request related to a problem? Please describe

Since the --static-dir CLI flag was superseded in 6.4 by the staticDirs option in .storybook/main.js, there is no simple way to determine which static directories were used, making it harder to do automatic change detection for e.g. Chromatic's TurboSnap. An additional complication is that the original source code (including the Storybook config dir) might not be available, but only the statically built Storybook.

Describe the solution you'd like

I would like to add a new --report flag to the build-storybook CLI which writes a storybook-report.json file to the output directory (e.g. storybook-static). This file would contain a JSON dump of all contextual values processed by the CLI, including things like configuration values, file sizes and whatnot. This would be similar to the --report flag in the Chromatic CLI.

Describe alternatives you've considered

There’s a static analysis called ConfigFile in @storybook/csf-tools that could pull out the staticDirs value. We could pipe that to a file instead.

Are you able to assist to bring the feature to reality?

Of course.

@stale
Copy link

stale bot commented Jan 9, 2022

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 Jan 9, 2022
@shilman
Copy link
Member

shilman commented Jan 15, 2022

I believe this was fixed with the --webpack-stats-json option. Closing this for now. Please let me know if there's more to be done here!

@shilman shilman closed this as completed Jan 15, 2022
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

2 participants