Skip to content

Commit 0da8d8d

Browse files
committed
feat: add README for removing Storybook from UI components package; outline evaluation, plan, and success criteria
1 parent 2dbcd42 commit 0da8d8d

File tree

1 file changed

+138
-0
lines changed
  • specs/200-remove-storybook-ui-components

1 file changed

+138
-0
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
status: planned
3+
created: 2026-01-05
4+
priority: medium
5+
tags:
6+
- ui
7+
- refactoring
8+
- simplification
9+
- maintenance
10+
depends_on:
11+
- 185-ui-components-extraction
12+
created_at: 2026-01-05T07:35:59.442762720Z
13+
updated_at: 2026-01-05T07:36:39.871103173Z
14+
---
15+
16+
# Remove Storybook from UI Components Package
17+
18+
> **Status**: 🗓️ Planned · **Created**: 2026-01-05
19+
20+
## Overview
21+
22+
The `@leanspec/ui-components` package currently includes Storybook for component documentation and development. This adds significant complexity with minimal value:
23+
24+
- **6+ Storybook devDependencies** (~100MB+ in node_modules)
25+
- **23 story files** that duplicate README documentation
26+
- **Additional configuration** (.storybook/, npm scripts)
27+
- **No CI/CD integration** - Storybook not deployed or used in workflows
28+
- **Redundant documentation** - README.md already has comprehensive usage examples
29+
30+
**Impact**: Removing Storybook will reduce maintenance burden, simplify the package, and speed up installs without losing functionality.
31+
32+
## Evaluation
33+
34+
### ✅ Safe to Remove
35+
36+
1. **No external dependencies**: Only ui-components has Storybook; ui-vite and desktop don't use it
37+
2. **No published artifacts**: Storybook isn't built or deployed anywhere
38+
3. **Comprehensive README**: All components already documented with usage examples
39+
4. **No CI/CD usage**: No workflows reference Storybook commands
40+
5. **Development alternative**: Components can be tested directly in ui-vite during development
41+
42+
### 📊 What We're Removing
43+
44+
**Dependencies** (from package.json devDependencies):
45+
```
46+
@storybook/addon-essentials
47+
@storybook/addon-interactions
48+
@storybook/addon-links
49+
@storybook/react
50+
@storybook/react-vite
51+
@storybook/test
52+
storybook
53+
```
54+
55+
**Files/Directories**:
56+
- `.storybook/` (2 config files)
57+
- `stories/` (23 story files)
58+
- `storybook-static/` (build artifacts)
59+
60+
**Scripts** (from package.json):
61+
- `storybook`
62+
- `build-storybook`
63+
64+
**Documentation references**:
65+
- Makefile storybook target
66+
- scripts.md Storybook commands
67+
- Spec 185 mentions (historical)
68+
69+
### 🎯 Why Now?
70+
71+
With the Rust migration and unified architecture (spec 184), LeanSpec is moving toward simplicity and reduced tooling complexity. Storybook adds overhead that doesn't align with:
72+
73+
1. **Context economy** - Extra tooling = cognitive load
74+
2. **Lean development** - Simpler is better for AI-assisted workflows
75+
3. **Maintenance burden** - One less tool to update and debug
76+
77+
## Plan
78+
79+
### Phase 1: Remove Code
80+
- [ ] Remove Storybook devDependencies from package.json
81+
- [ ] Remove npm scripts (storybook, build-storybook)
82+
- [ ] Delete .storybook/ directory
83+
- [ ] Delete stories/ directory
84+
- [ ] Delete storybook-static/ directory (if exists)
85+
86+
### Phase 2: Update Documentation
87+
- [ ] Remove Storybook references from README.md
88+
- [ ] Update Makefile (remove storybook target)
89+
- [ ] Update scripts.md (remove Storybook commands)
90+
- [ ] Verify README has sufficient component documentation
91+
92+
### Phase 3: Cleanup
93+
- [ ] Run `pnpm install` to update lockfile
94+
- [ ] Verify builds still work: `pnpm build`
95+
- [ ] Verify typecheck passes: `pnpm typecheck`
96+
- [ ] Verify tests pass: `pnpm test`
97+
- [ ] Update turbo.json if needed
98+
99+
## Component Documentation Strategy
100+
101+
**Before**: Storybook stories + README
102+
**After**: README only (already comprehensive)
103+
104+
The README.md includes:
105+
- Installation instructions
106+
- Usage examples for all components
107+
- Component API documentation
108+
- Integration examples with ui-vite
109+
110+
**For development**: Test components in ui-vite's actual UI during feature work. This provides:
111+
- Real-world usage context
112+
- Integration testing with actual data
113+
- Faster feedback loop (no separate Storybook server)
114+
115+
## Success Criteria
116+
117+
- [ ] All Storybook code/config removed
118+
- [ ] package.json has no Storybook dependencies
119+
- [ ] Build, typecheck, and tests pass
120+
- [ ] README.md remains comprehensive
121+
- [ ] No broken references in docs/scripts
122+
- [ ] Reduced package install time (verify with `time pnpm install`)
123+
124+
## Notes
125+
126+
**Historical Context**: Storybook was added in spec 185 (UI Components Extraction) as standard practice for component libraries. However, for LeanSpec's internal components:
127+
128+
- **Not a public component library** - Only used within LeanSpec ecosystem
129+
- **Active development** - Components tested in ui-vite constantly
130+
- **AI-first development** - README examples more useful for AI agents than interactive Storybook
131+
132+
**Alternative Considered**: Keep Storybook for visual regression testing
133+
**Decision**: Not needed - UI components are simple, well-typed, and tested in ui-vite's E2E tests
134+
135+
**Related Specs**:
136+
- Spec 184: UI Packages Consolidation (consolidation strategy)
137+
- Spec 185: UI Components Extraction (where Storybook was added)
138+
- Spec 187: Vite SPA Migration (primary consumer of ui-components)

0 commit comments

Comments
 (0)