Skip to content

feat: Setup Storybook in monorepo for web and mobile - #686

Merged
Asherlc merged 2 commits into
mainfrom
Asherlc/storybook-monorepo-setup
Apr 1, 2026
Merged

Asherlc merged 2 commits into
mainfrom
Asherlc/storybook-monorepo-setup

Conversation

@Asherlc

@Asherlc Asherlc commented Apr 1, 2026

Copy link
Copy Markdown
Owner
  • Sets up Storybook for both the web and mobile packages.

Copilot AI review requested due to automatic review settings April 1, 2026 00:46
@Asherlc
Asherlc enabled auto-merge (squash) April 1, 2026 00:46
@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (9918fd9) to head (578c035).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   97.35%   97.47%   +0.12%     
==========================================
  Files         317      317              
  Lines       44649    44649              
  Branches     9018     9027       +9     
==========================================
+ Hits        43466    43522      +56     
+ Misses       1183     1127      -56     
Flag Coverage Δ
integration 61.06% <ø> (ø)
unit 92.57% <ø> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Storybook to the monorepo so UI components can be developed and reviewed in isolation for both the Vite-based web app and the Expo-based mobile app.

Changes:

  • Web: adds Storybook dependencies/scripts plus .storybook configuration and a starter story for PageSection.
  • Mobile: adds React Native Storybook dependencies/scripts, conditional entrypoint (index.js), Metro integration, and a starter story for Card.
  • Root/docs: adds root-level pnpm storybook:* scripts and updates README with Storybook commands.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Documents the new Storybook commands.
package.json Adds root scripts to run/build Storybook for web and run Storybook for mobile.
pnpm-lock.yaml Locks new Storybook (web + RN) dependency graph.
packages/web/package.json Adds Storybook scripts and devDependencies for web Storybook.
packages/web/.storybook/main.ts Storybook config for web (stories/addons/framework/staticDirs/autodocs).
packages/web/.storybook/preview.ts Loads global CSS and sets Storybook parameters for web.
packages/web/.storybook/vite.config.ts Adds Tailwind Vite plugin for web Storybook bundling.
packages/web/src/components/PageSection.stories.tsx Adds an initial web story demonstrating PageSection variants.
packages/mobile/package.json Adds Storybook scripts and devDependencies; changes entrypoint to index.js.
packages/mobile/index.js Conditionally loads RN Storybook vs Expo Router based on env flag.
packages/mobile/metro.config.js Wraps Metro config with Storybook support when enabled.
packages/mobile/.rnstorybook/main.ts Storybook config for mobile stories/addons.
packages/mobile/.rnstorybook/preview.tsx Adds a decorator/background and control settings for mobile Storybook.
packages/mobile/.rnstorybook/index.tsx Storybook UI root that consumes generated storybook.requires.
packages/mobile/components/Card.stories.tsx Adds an initial mobile story demonstrating Card variants.
packages/mobile/.gitignore Ignores the generated Storybook requires file.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"scripts": {
"start": "expo start",
"storybook": "EXPO_PUBLIC_STORYBOOK_ENABLED=true sb-rn-get-stories && EXPO_PUBLIC_STORYBOOK_ENABLED=true expo start --clear",
"storybook:ios": "EXPO_PUBLIC_STORYBOOK_ENABLED=true expo run:ios",

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storybook:ios script enables Storybook but does not run sb-rn-get-stories first. On a fresh checkout, .rnstorybook/storybook.requires.ts is gitignored and won't exist, so packages/mobile/.rnstorybook/index.tsx will fail to import ./storybook.requires. Consider adding sb-rn-get-stories to storybook:ios (or committing a non-generated stub) so the command works reliably.

Suggested change
"storybook:ios": "EXPO_PUBLIC_STORYBOOK_ENABLED=true expo run:ios",
"storybook:ios": "EXPO_PUBLIC_STORYBOOK_ENABLED=true sb-rn-get-stories && EXPO_PUBLIC_STORYBOOK_ENABLED=true expo run:ios",

Copilot uses AI. Check for mistakes.
@Asherlc
Asherlc merged commit 9b995a2 into main Apr 1, 2026
43 checks passed
@Asherlc
Asherlc deleted the Asherlc/storybook-monorepo-setup branch April 1, 2026 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants