-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StoryBook #251
Add StoryBook #251
Conversation
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit f41008e previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-dy4lu8awa.vercel.app |
… already installed by Next.js and shouldn't be specified (let Next.js auto-update those) + use fixed versions + ignore storybook-static folder (when exporting static site)
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit d5570f8 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-achjbsxj3.vercel.app |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit 206f209 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-k3vj7njcb.vercel.app |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit a2cd983 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-59pt4acow.vercel.app |
❌ Deployment FAILED |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit 6a3bff2 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-gvvn8qawf.vercel.app |
❌ Deployment FAILED |
✅ Deployment SUCCESS |
…ting + don't deploy to all regions to avoid Vercel error
✅ E2E tests SUCCESS for commit f6d01a6 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-lu970cmal.vercel.app |
✅ Deployment SUCCESS |
✅ Deployment SUCCESS |
…useful later to trigger production deployment on master branch)
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit f5e4923 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-9tfk8dr3x.vercel.app |
✅ E2E tests SUCCESS for commit 623d2d0 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-fwgk2f52j.vercel.app |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit d179fa4 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-7oaf6d5f4.vercel.app |
✅ Deployment SUCCESS |
✅ Deployment SUCCESS |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit 8467569 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-d8wh6xvpg.vercel.app |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit 833c4e1 previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-ka6iuy3za.vercel.app |
✅ Deployment SUCCESS |
✅ Deployment SUCCESS |
✅ E2E tests SUCCESS for commit f1e44ff previously deployed at https://nrn-v2-mst-aptd-at-lcz-sty-c1-e631etced.vercel.app |
✅ E2E tests SUCCESS for commit f1e44ff previously deployed Storybook static site at https://nrn-v2-mst-aptd-at-lcz-sty-storybook-ch60it9z1.vercel.app |
Status
STABLE, the biggest issues have been fixed (babel/webpack/Emotion 10-11/Node vs browser/React providers).
Currently studying Storybook addons (first time using SB) to see what should be included by default.SB is now configured with proper plugins, adding more stories (ideally, all components should have their stories).All NRN components have been documented thoroughly.
Resources:
Issues
css
prop isn't recognized in some part of the codeDOMAttributes
innode_modules/@emotion/core/types/index.d.ts
)@ts-ignore
the few statements where errors were thrown (~6)babel.config.js
) but it usesautomatic
runtime, which isn't supported by MDX, which is used in Storybook. So, I had to create a custom.storybook/babel.config.js
file usingclassic
mode. See https://emotion.sh/docs/css-prop#babel-presetdecorators
in.storybook/preview.js
router
needs to be mocked (decorator), I usedstorybook-addon-next-router
@sentry/node
, webpack was configured to replace it by@sentry/browser
during compilationfs
, etc. (webpack config)storybook-css-modules-preset
(they're supported natively in Next.js) - See Next.js + TypeScript + Storybook compatibility issues storybookjs/storybook#9610 (comment) and @next/plugin-storybook issues vercel/next.js#19345Features
Storybook static site hosted on Vercel
This way, you always have an online up-to-date version of your components!
Demo: https://nrn-v2-mst-aptd-at-lcz-sty-storybook.vercel.app/ (auto-updated)
Support for MDX, TSX, Emotion 11 and CSS Modules
I18n support in Stories
locale
in the Storybook top toolbar!Usage
Storybook localhost
Run
yarn sb
Storybook online
Automatically built + deployed on another Vercel project (dedicated project), as a static site.
https://nrn-v2-mst-aptd-at-lcz-sty-storybook.vercel.app/
Looking for a way to optionally protect the static site behind Basic Auth.