tmeasday / storybook-skeleton

3 stars 1 forks source link

Storybook Skeleton

A "skeleton" version of SB designed to do the bare minimum as quickly as possible and as a test bed for new webpack configs/features.

Basic architecture

What this project creates is a composition API compatible Storybook preview which performs the "minimum" functions of Storybook with the least amount of code possible.

Then we use a pre-built manager UI, configured to compose the skeleton, in order to get the "full" Storybook experience with the skeleton-built preview.

Running the skeleton

The process to build and run the skeleton is as follows:

  1. Check out the skeleton code on your machine and symlink inside your project at skeleton

  2. Ensure you have webpack, webpack-cli and webpack-dev-server installed.

  3. Add a skeletonWebpackConfig field to .storybook/main.js with the minimal webpack config you need to compile your stories/components.

  4. Run the skeleton with yarn webpack serve --config ./skeleton/webpack/webpack.config.js

The following additional parameters are supported:

  1. Run the prebuild manager (inside the skeleton project):
yarn start-manager
  1. Browse to the URL from step 3: http://localhost:8080

Examples

Benchmarking

Run yarn benchmark and it will give you some numbers as it builds design-system (make sure to link first as above) using different tools available.

Code structure

That is about it for now!

Limitations