Date: 2025-10-19 Status: ✅ FULLY OPERATIONAL
ProofCore v1.0.0 includes a complete Storybook setup for component development and documentation.
.storybook/
├── main.ts (Storybook configuration)
├── preview.ts (Global preview settings)
└── preview.tsx (React-specific preview)
storybook-static/ (Built static site)
├── index.html (Entry point)
├── iframe.html (Story container)
├── project.json (Metadata)
└── assets/ (Built components & documentation)
✅ Build Complete: 15.31 seconds
✅ Output Directory: storybook-static/
✅ Bundle Size: ~2.5MB (with all dependencies)
✅ Key Chunks:
- iframe.js: 1.2MB (gzipped: 344KB) [Stories & UI]
- blocks.js: 663KB (gzipped: 218KB) [Docs blocks]
- axe.js: 578KB (gzipped: 159KB) [A11y testing]
Note: Large chunks are expected for Storybook (includes testing tools)
Design System Components:
├── Button.stories.tsx
├── FormField.stories.tsx
├── Alert.stories.tsx
└── ModalDrawer.stories.tsx
Page/Feature Stories:
├── HybridDashboard.stories.tsx
├── ExecutionHistory.stories.tsx
├── Settings.stories.tsx
└── Page.stories.tsx
Utilities:
└── Header.stories.tsx
Start live Storybook development server:
npm run storybook
# Server runs on: http://localhost:6006
# Auto-reload on file changesGenerate production-ready static site:
npm run build-storybook
# Output: storybook-static/# Using local server
npx http-server storybook-static/
# Or any static server
python -m http.server 8000 --directory storybook-static/-
@chromatic-com/storybook
- Visual regression testing integration
- Chromatic cloud deployment ready
-
@storybook/addon-docs
- MDX documentation support
- Auto-generated component documentation
-
@storybook/addon-onboarding
- First-time user guide
-
@storybook/addon-a11y
- Accessibility testing (axe)
- ARIA violation detection
- @storybook/react-vite
- Vite-powered fast builds
- HMR (Hot Module Reloading)
- Optimized bundle
- Create Story File
// src/components/MyComponent.stories.ts
import type { Meta, StoryObj } from '@storybook/react';
import { MyComponent } from './MyComponent';
const meta = {
component: MyComponent,
title: 'Components/MyComponent',
} satisfies Meta<typeof MyComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
label: 'Click me',
},
};- Run Development Server
npm run storybook- View in Browser Navigate to: http://localhost:6006/
- Visual Inspection: Manual review in Storybook UI
- Accessibility: Use a11y addon tab for ARIA checks
- Documentation: MDX files for usage guides
- Chromatic: Optional cloud-based visual regression testing
Since Storybook stories are isolated component tests, they work well with Zustand stores:
// Use in stories that need Zustand state
import { useProofStore } from '../stores/proof_store';
export const WithStoreData: Story = {
render: (args) => {
// Initialize store state for story
useProofStore.getState().setEvaluationResult('test', {...});
return <MyComponent {...args} />;
},
};Development Mode:
- HMR: <100ms
- Full rebuild: 5-10s
- Incremental update: <1s
Production Build:
- First build: 15-20s
- Static output: ~2.5MB
- Gzipped: ~400KB
Serving:
- Static files: Instant (CDN-ready)
- No runtime overhead
npm run storybook# Build once
npm run build-storybook
# Deploy storybook-static/ to:
# - GitHub Pages
# - Netlify
# - Vercel
# - Any static host# Install Chromatic CLI
npm install --save-dev chromatic
# Deploy (with API key)
chromaticSolution: Check story file naming
// Must match pattern:
// *.stories.ts or *.stories.tsx or *.stories.jsxSolution: Verify import paths
// Correct
import { MyComponent } from '../MyComponent';
// Incorrect
import MyComponent from '../MyComponent';Solution: Initialize store before render
beforeEach(() => {
useProofStore.getState().clearAll();
});-
Visual Testing
- Chromatic integration for regression testing
- Snapshot testing with Playwright
-
E2E Testing in Storybook
- Interaction testing with
playfunction - User event simulation
- Interaction testing with
-
Performance Monitoring
- Bundle size tracking
- Performance metrics dashboard
-
Documentation Generation
- Auto-generated changelog
- API reference from JSDoc
| File | Size | Status |
|---|---|---|
| .storybook/main.ts | 431B | ✅ Working |
| .storybook/preview.ts | 240B | ✅ Working |
| .storybook/preview.tsx | 416B | ✅ Working |
| storybook-static/ | 2.5MB | ✅ Built |
- Update Storybook quarterly:
npm update @storybook/* - Review and update outdated stories
- Monitor bundle size
- Update component documentation
# Example GitHub Actions
- name: Build Storybook
run: npm run build-storybook
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static- Storybook Docs: https://storybook.js.org/docs/react/
- Addon Library: https://storybook.js.org/integrations/
- Chromatic: https://www.chromatic.com/
- React Best Practices: https://react.dev/
✅ Storybook is fully operational and ready for:
- Component development and documentation
- Visual testing and regression detection
- Team collaboration on UI components
- Static site deployment
- Integration with design systems
Next Steps:
- Start dev server:
npm run storybook - Add stories for Zustand-refactored components
- Document component usage with MDX
- Set up Chromatic for visual regression (optional)
Storybook Status: Production-Ready ✅