Skip to content

Storybook 10: per-component stories + PR preview workflow - #5

Merged
Muzaffar-codes07 merged 3 commits into
mainfrom
feat/storybook-preview
May 18, 2026
Merged

Storybook 10: per-component stories + PR preview workflow#5
Muzaffar-codes07 merged 3 commits into
mainfrom
feat/storybook-preview

Conversation

@Muzaffar-codes07

Copy link
Copy Markdown
Owner

Summary

The last open Week 1–2 foundation task — Task 4, Storybook deploy (docs/superpowers/plans/2026-05-11-week-1-2-foundation.md). Two commits:

  1. fix(ci) — the same four main-rooted duplicates as the other in-flight branches; auto-resolves on PR Auth foundation: NextAuth v5 + Google OAuth + WebAuthn + TimescaleDB #2 merge.
  2. feat(ui) — Storybook 10 config, six stories, and the PR preview workflow.

Why Storybook 10 (not 8, as the plan said)

The plan specified Storybook 8. Storybook 8 peer-caps at Vite 6, but the Vitest 3 toolchain in @lockin/ui already pulls Vite 7 — pnpm install failed the peer check. Storybook 10 supports Vite 7. Storybook 9+ also folded the old addon-essentials (controls/actions/viewport/backgrounds/docs) into core, so the addon list is gone and type imports moved from @storybook/react to @storybook/react-vite. Adjusted accordingly.

What's in it

File Purpose
.storybook/main.ts react-vite framework; @tailwindcss/vite registered in viteFinal so stories render with the real tokens.css
.storybook/preview.{tsx,css} Tailwind v4 + tokens import; surface/muted/dark background swatches
src/components/*.stories.tsx (×6) One story per base component, every variant axis covered

Stories: Button (4 variants × 3 sizes + disabled), Input (invalid/disabled), Card, Stack (row/col × gap/align/justify), Text (full size scale + tones), Icon (decorative vs labeled a11y + sizes).

.github/workflows/storybook.yml

  • Triggers on PRs touching packages/ui/**
  • pnpm install → events codegen → build-storybook
  • Vercel preview deploy + PR comment — both gated on VERCEL_STORYBOOK_PROJECT_ID existing as a repo secret. Until that's provisioned, the job still passes on the build step alone (no hard failure).

Acceptance — Week 1–2 deliverable 7

Check State
Storybook configured
Storybook deploys on PR ✅ workflow shipped; live deploy gated on VERCEL_STORYBOOK_PROJECT_ID
apps/web uses @lockin/ui components ✅ shipped in PR #1
Lighthouse ≥95 ⚠️ verify post-deploy on a web page using only ui components — tracked in the handoff

Known follow-ups not in this PR

  • Provision the Storybook Vercel project + VERCEL_STORYBOOK_PROJECT_ID repo secret.
  • Run Lighthouse against the deployed Storybook / a ui-only web page and confirm ≥95.

Verification

  • pnpm -F @lockin/ui build-storybook — clean static build to storybook-static/
  • pnpm typecheck green (5 turbo tasks)
  • pnpm lint green (3 tasks)
  • pnpm test green (5 tasks; 18 ui component tests still pass — stories don't interfere)

Test plan

  • CI js + events-roundtrip jobs green
  • CI storybook workflow builds successfully
  • Reviewer runs pnpm -F @lockin/ui storybook locally and eyeballs all six component stories

🤖 Generated with Claude Code

Same four fixes as the other in-flight branches; auto-resolves on PR #2 merge.
packages/ui:
- Storybook 10 (react-vite framework) — supports Vite 7 which the
  Vitest 3 toolchain already pulls. Storybook 8 capped at Vite 6.
- .storybook/main.ts: react-vite framework; registers @tailwindcss/vite
  in viteFinal so stories render with the real design tokens. Storybook 9+
  folds the old addon-essentials into core, so no separate addon install.
- .storybook/preview.{tsx,css}: Tailwind v4 + tokens.css imported, three
  background swatches (surface/muted/dark)
- Six stories — one per base component — exercising every variant axis:
  Button (4 variants x 3 sizes + disabled), Input (invalid/disabled),
  Card, Stack (row/col x gap/align/justify), Text (size scale + tones),
  Icon (decorative vs labeled a11y paths + sizes)
- build-storybook verified locally: clean static build to storybook-static/

.github/workflows/storybook.yml:
- Triggers on PRs touching packages/ui/**
- pnpm install + events codegen + build-storybook
- Vercel preview deploy + PR comment, both gated on
  VERCEL_STORYBOOK_PROJECT_ID existing — until that repo secret is
  provisioned the job still passes on the build alone

Closes the last open Week 1-2 foundation task (deliverable 7 — Storybook
half; the @lockin/ui-consumed-by-web half shipped in PR #1).
# Conflicts:
#	apps/api/app/events/publisher.py
#	apps/mcp/tests/integration/test_smoke.py
#	pnpm-lock.yaml
@Muzaffar-codes07
Muzaffar-codes07 merged commit b19f94e into main May 18, 2026
8 checks passed
@Muzaffar-codes07
Muzaffar-codes07 deleted the feat/storybook-preview branch May 18, 2026 11:32
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.

1 participant