csnx icon indicating copy to clipboard operation
csnx copied to clipboard

Move storybook to run in a separate app in CSNX

Open oliverabrahams opened this issue 5 months ago • 1 comments

storybook is starting to depend on new versions of react/react-dom than we want to develop against (we want to support a wider range of versions than the latest).

this make it hard to install storybook and the version of react we want in the same package.

if we move storybook to its own app, it can use whatever deps it likes while we continue to develop the source packages at the lowest version of react we support.

this has a second benefit, in that storybook becomes a de facto consumer of source, rather than can of component unit test.

this will give us a much truer picture of what we're exporting, and removes a footgun for contributors whereby exports that have not been added will not available to storybook (e.g. https://github.com/guardian/csnx/pull/1653#pullrequestreview-2248399234)

### Tasks
- [x] Move storybook config and storybook commands to for source dev kitchen into `apps/storybook`
- [x] Move storybook config and storybook commands to for source react-components into `apps/storybook`
- [ ] Update stories to consume the absolute paths instead of relative
- [ ] Update eslint to check all stories use the correct paths
- [x] Add storybook dependencies to the storybook app and remove from source
- [x] Add `build` source as a dependancy of the storybooks app
- [x] Update CI to run storybooks in new locations

oliverabrahams avatar Sep 16 '24 10:09 oliverabrahams