Skip to content

web: add Storybook workspace level commands

Warren Gifford requested to merge vb/storybook-build-perf-scripts into main

Created by: valerybugakov

Context

The default yarn storybook command loads all stories defined in our monorepo. Often it's not required to load all of them to implement a particular feature. Loading only a subset of stories greatly increases Storybook development server performance. This PR introduces the environment variable to load a subset of all stories and a list of predefined npm scripts to use this environment variable.

Changes

  • Added STORIES_GLOB environment variable support to the Storybook config to load only a subset of all stories.
  • Added npm scripts to start Storybook development server for a particular package.
  • Added Storybook section to the web app "Local Development" documentation.

Timings

Examples to better understand the time required for different packages:

yarn storybook

Screenshot 2021-06-23 at 11 22 31

yan storybook:web

Screenshot 2021-06-23 at 11 19 45

yan storybook:branded

Screenshot 2021-06-23 at 11 20 56

yan storybook:wildcard

Screenshot 2021-06-23 at 11 21 28

Merge request reports

Loading