Skip to main content

Storybook

Local dev

$ npm run storybook

  • If this command runs without errors on local machine, then production deployment also should pass successfully

To add new story pls create new file [COMPONENT_NAME].stories.js in /powr/stories.

You need to ensure you are running on node version 12.17.0 If you are not, use command nvm use 12.17.0

Here is an MR example : https://gitlab.com/powr/powr/-/merge_requests/7586 When adding stories, if you notice the orginal react component does not have all prop types listed, please add them. This will make sure your documentation is most accurate. Quick talk from Praneeta: https://www.loom.com/share/ad2da722594b4fa1b13f4636fa3989ed

Deployment (currently not on production)

https://gitlab.com/powr/powr/-/merge_requests/5408

https://www.loom.com/share/ad42fd54f71f4a4d89f609b7a910db84

Storybook is deployed to Gitlab Pages during “page” job and is accessible via URL https://powr.gitlab.io/powr/storybook/

\

The deployment is performed in 2 parallel jobs In order to prevent

  1. “pages” job affecting deployment time of “main” job
  2. deployment errors from “pages” job affect “main” job completion

.

“Main” job is started automatically on each deployment, and the “page” job is started manually.

Writing stories guide

https://storybook.js.org/docs/react/writing-stories/introduction