Skip to content
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 boilerplate to design-system package #1660

Merged
merged 17 commits into from
Dec 16, 2022

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Dec 13, 2022

🌟 What is the purpose of this PR?

This PR initializes Storybook in /packages/hash/design-system. Once Storybook boilerplate is merged, we can configure its deployment and proceed to writing initial user stories. Boilerplate content is pretty lightweight so we won’t lose much from having it in main for a short while. This boilerplate can work as a handy reference in the future.

🔗 Related links

📜 Does this require a change to the docs?

Not yet

⚠️ Known issues

  • The current stable version of Storybook is v6. It has issues with MDX pages when React 18 is used: MDX Docs doesn't display after upgrades to React v18.1.0 + Storybook v6.5.6 -> v6.5.7 -> v6.5.8 -> v6.5.9 storybookjs/storybook#18383. To avoid this, I have upgraded to v7 beta which comes with MDX2 and has a few more improvements (satisfies operator, new API for stories etc. The versions of Storybook packages are pinned in yarn.lock so we can chose when to upgrade to another beta or a stable version. The boilerplate for v6 looks a bit different to what I’ve seen in v7, so I suggest that we start with v7 straight away and save ourselves time on migrating. Using beta carries a bit of risk, but it’s not worse than not being able to use MDX in v6.

  • I had to manually create babel.config.json to avoid syntax errors in v7. Could be an issue with the init command or default parser config.

🐾 Next steps

  • Configure Vercel deployment
  • Start writing stories and remove boilerplate pages

🛡 What tests cover this?

  • Manual tests

❓ How to test this?

yarn install

yarn workspace @hashintel/hash-design-system storybook 
open http://localhost:6006

yarn workspace @hashintel/hash-design-system build-storybook 
yarn workspace @hashintel/hash-design-system serve storybook-static
open http://localhost:3000

📹 Demo

Screenshot 2022-12-13 at 22 31 28

Screenshot 2022-12-13 at 22 31 12

Screenshot 2022-12-13 at 22 31 53

@github-actions github-actions bot added area/apps > hash* Affects HASH (a `hash-*` app) area/deps Relates to third-party dependencies (area) labels Dec 13, 2022
@github-actions github-actions bot added the area/infra Relates to version control, CI, CD or IaC (area) label Dec 13, 2022
@kachkaev kachkaev changed the title Add Storybook for design-system package Add Storybook to design-system package Dec 13, 2022
@kachkaev kachkaev changed the title Add Storybook to design-system package Add Storybook boilerplate to design-system package Dec 13, 2022
@kachkaev kachkaev enabled auto-merge (squash) December 16, 2022 18:41
@vercel
Copy link

vercel bot commented Dec 16, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
hashdotdev 🔄 Building (Inspect) Dec 16, 2022 at 6:41PM (UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apps > hash* Affects HASH (a `hash-*` app) area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area)
Development

Successfully merging this pull request may close these issues.

2 participants