Open mrmchughes opened 5 months ago
Thanks Michael. Let's talk to the UX team for wishlist on Storybook to understand how they'd imagine it.
As a starting point any of the pieces of the design could be a good test component.
We have some components already in the components/ui/heat folder I think but they’re not very intricate yet state-wise, the situation where Storybook becomes pretty helpful . An ideal test could have some detailed state. Maybe a row of the table they’ve designed. Welcome to chat or ask the UX/design team for ideas.
I got it running with npm run storybook
I also ran npm run build-storybook
and it put a static version into the heat-stack/storybook-static
folder. Maybe as an enhancement you could change the target of this so it goes into public/heat-stack/storybook-static
and make sure we're running that build command in the Dockerfile after the main build. Then when we merge this, we'll get Storybook at https://heat-stack.fly.io/storybook-static .
Figuring the wishlist out with the UX team sounds great. Still working on the tutorial, I want to make sure I understand the fundamentals before I start working on our more complex compents.
Please try to get the storybook-static working as described above before converting to full non-draft PR.
Hi Thad, I think I may have made some progress on this, but also running into a bug. When I run npm run build-storybook
, I get an error in my terminal Error: Cannot copy './public' to a subdirectory of itself, './public/heat-stack/storybook-static/'.
. It does seem to make a directory within public like you wanted though, so I'm not sure.
I'm also getting an error from ESLint when I push a commit, I'm not sure why. This is what I've been using CLI options
Ah sorry @mrmchughes , I made a typo. public
folder is inside heat-stack
.
Please add your storybook-static
folder to .eslintignore
to solve the linter error on the autogenerated files: https://github.com/codeforboston/home-energy-analysis-tool/blob/main/heat-stack/.eslintignore
I solved the Linter issue. I'm confused on how to get storybook-build pointed at the directory you want, since whenever I attempt to run the command with the -o modifier it seems to not work as intended. CLI Options
I have also attempted to modify the staticDirs in .storybook/main.ts, and this did not work.
@mrmchughes Good start. I saw the warning you mentioned.
Once I changed the staticDirs: []
in .storybook/main.ts
, npm run build-storybook
seems to work without any warnings now. Can you please update the PR with that change ~and also resolve the broken test~?
When I did a local git rebase main
(don't forget to pull the latest main before you do it), the conflict issue with package.json and package-lock were resolved without further input from me. Hopefully you find the same.
We must all use http://localhost:3000/storybook-static/index.html , explicitly adding index.html as it does not get forwarded to that automatically.
I've installed Storybook on my fork, and will start work on the Storybook tutorial. Is there a specific small component or something similar that we need converted over that would make for a good starting point?