👍 DX | Making sure storybook
can be started encapsulated from the docs
.
#525
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hey 👋 ,
Cool stuff we have here. I wanted to contribute slightly to the DX. Currently we have two apps who live inside of this monorepo:
docs
storybook
They're (to my understanding) supposed to be able to run and live in parallel. I noticed that when starting the storybook in preview mode, that was not the case, as the build would fail, because of a built resource from Gatsby would be missing, and the
-o
argument inside of thestorybook build
script would fail.This fixes that, and allows devs to just start storybook, avoiding a race condition. Vice versa, it does not mess with the
docs
build progress.List of notable
build-storybook
command not looks for if a directory$STATIC_DIR
exists, if not, it creates it. Thanks to the-p
command, we don't have to create a side effect to create it.apps/docs/README.md
as it references a command which does not exist.What should reviewers focus on?
Ive tested pretty thoroughly that the built is not encapsulated in such a way that we can start storybook without messing with the Gatsby build, for quick and easy previewing.
Steps to test:
npm i
(in root)npm run build:storybook:preview
(in root)npm run start:storybook
(in root)On
main
:ERR! Failed to load static files, no such directory: [outside of module]/apps/docs/public/static
On
branch
:🎺 We get a preview of storybook!
Supporting resources (related issues, external links, etc):
Contributor checklist:
Reviewer checklist:
Screenshots:
Before:
sad.webm
After:
happy.webm