Problem/Motivation
Keeping storybook updated has been one of the major challenges in CivicTheme.
It relies heavily upon a variety of webpack plugins and has been extremely difficult in keeping these packages updated in a timely basis and understanding how to make updates to the build system.
Equally the build process has been too slow to build the SASS and storybook and to see the changes developers causing an inefficiency in the development process
We have decided to:
- Remove the existing gulp and storybok system
- Implement a new front-end build system with node using as few packages as possible
- Rebuild the storybook system to 8.5x using vite and the twig plugin (https://github.com/larowlan/vite-plugin-twig-drupal) with an eye to keeping storybook updated regularly
The process in building storybook and building CSS remains the same with `npm run storybook`, `npm run build`, `npm run dist` still being the commands
you will rely on.
The major difference you will notice is building CSS and storybook will be much, much less than before down from 20+ to under 10seconds (2seconds to rebuild CSS!).
The PR to be merged can be viewed at:
Theme
https://github.com/civictheme/monorepo-drupal/pull/1313
UI Kit
https://github.com/civictheme/uikit/pull/433
Upgrade process
Storybook has been updated from using the deprecated knobs plugin to utilising controls.
CivicTheme's stories have all been updated to use the new system.
Sub-theme's will need to carry out an update to implement these changes:
- Overridden and custom component stories will need to be updated use the new controls API (if you do not need these stories anymore, then you can even remove the file to build storybook)
- the new build system will need to be copied in from the CivicTheme system
Comments
Comment #3
richardgaunt commentedComment #4
richardgaunt commentedComment #5
richardgaunt commentedComment #6
fionamorrison23 commentedComment #7
richardgaunt commentedComment #9
richardgaunt commentedComment #10
richardgaunt commentedComment #11
richardgaunt commentedComment #14
fionamorrison23 commentedComment #15
danielgry commentedComment #17
fionamorrison23 commentedComment #18
richardgaunt commentedComment #19
fionamorrison23 commentedComment #20
fionamorrison23 commented