reg-viz / storycap

A Storybook Addon, Save the screenshot image of your stories :camera: via puppeteer.
https://www.npmjs.com/package/storycap
MIT License
701 stars 89 forks source link

[Feature] Update Storycap commands for Storybook v7 #822

Open NaokiHaba opened 9 months ago

NaokiHaba commented 9 months ago

What does this change?

The name was changed from start-storybook to storybook-dev starting with storybook v7. https://storybook.js.org/docs/react/api/cli-options

I have spent a lot of time on CI/CD retrofits due to this change.

This change will help users of storybook v7.

Thank you for your cooperation. @hond0413

We need your opinions! Please feel free to comment here. Thank you 🙇

References

> storycap --serverTimeout 60000 --captureTimeout 10000 --serverCmd 'start-storybook -p 6006' http://localhost:6006

info Wait for connecting storybook server http://localhost:6006.
error Timed out waiting for: http-get://localhost:6006
Error: Timed out waiting for: http-get://localhost:6006

fix result

> app@1.0.0 screenshot /
> storycap --serverTimeout 60000 --captureTimeout 10000 --serverCmd 'storybook dev -p 6006' http://localhost:6006

info Wait for connecting storybook server http://localhost:6006.
info Executable Chromium path: /usr/bin/google-chrome-stable
info Storycap runs with managed mode
info Found 3 stories.
info Screenshot was ended successfully in 22285 msec capturing 3 PNGs.