Successfully migrated 12 card components from @src/components/root/cards/ to the atoms registry system.
✅ Moved 12 card components from src/components/root/cards/ to src/components/atom/
Cards Migrated:
- activity-goal.tsx
- calendar.tsx
- chat.tsx
- cookie-settings.tsx
- create-account.tsx
- data-table.tsx
- metric.tsx
- payment-method.tsx
- report-issue.tsx
- share.tsx
- stats.tsx
- team-members.tsx
✅ Updated src/components/root/cards/index.tsx to re-export from @/components/atom/ instead of local files
Result: The import path @/components/root/cards still works for backward compatibility!
✅ Added all 12 cards to src/registry/default/atoms/_registry.ts
Categories:
- Display & Data: activity-goal, calendar, data-table, metric, stats
- Interactive: chat, calendar, share
- Forms: cookie-settings, create-account, payment-method, report-issue, team-members
✅ Created MDX documentation for all 12 cards in content/atoms/(root)/
Total Atoms: 43 (12 cards + 31 existing)
✅ Generated JSON files in public/r/styles/default/ and public/r/styles/new-york/
pnpm dev
# Visit: http://localhost:3000/atomsAvailable card pages:
/atoms/activity-goal/atoms/calendar/atoms/chat/atoms/cookie-settings/atoms/create-account/atoms/data-table/atoms/metric/atoms/payment-method/atoms/report-issue/atoms/share/atoms/stats/atoms/team-members
pnpm codebase add activity-goal
pnpm codebase add chat
pnpm codebase add payment-method// This still works! No changes needed in your app
import { CardsDemo } from "@/components/root/cards"
export default function Page() {
return <CardsDemo />
}The re-export in src/components/root/cards/index.tsx ensures backward compatibility.
src/components/
├── atom/ # ← Cards now here
│ ├── activity-goal.tsx
│ ├── calendar.tsx
│ ├── chat.tsx
│ ├── cookie-settings.tsx
│ ├── create-account.tsx
│ ├── data-table.tsx
│ ├── metric.tsx
│ ├── payment-method.tsx
│ ├── report-issue.tsx
│ ├── share.tsx
│ ├── stats.tsx
│ └── team-members.tsx
│
└── root/cards/
├── index.tsx # ← Re-exports from atom
└── page.tsx # ← Unchanged
content/atoms/(root)/
├── activity-goal.mdx # ← New documentation
├── calendar.mdx
├── chat.mdx
├── cookie-settings.mdx
├── create-account.mdx
├── data-table.mdx
├── metric.mdx
├── payment-method.mdx
├── report-issue.mdx
├── share.mdx
├── stats.mdx
├── team-members.mdx
└── ... (31 other atoms)
public/r/styles/default/
├── activity-goal.json # ← Registry JSON
├── calendar.json
├── chat.json
└── ... (all card JSONs)
pnpm dev
# Visit: http://localhost:3000
# The CardsDemo should render correctly# Visit: http://localhost:3000/atoms
# Should see all 43 atoms including the 12 cardspnpm codebase list
# Should show all 43 atoms including cards
pnpm codebase add calendar
# Should install the calendar card- Cards in
src/components/root/cards/ - No registry entries
- No documentation
- Not browsable in /atoms
- Cards in
src/components/atom/ - Full registry support
- Complete MDX documentation
- Browsable at /atoms/[card-name]
- Installable via CLI
- Backward compatible imports
- ✅ Unified System - All atoms in one place
- ✅ Documentation - Each card has full docs
- ✅ Registry - Can be installed via CLI
- ✅ Browsable - View cards at /atoms
- ✅ Backward Compatible - Existing code still works
- ✅ Discoverable - Shows up in
pnpm codebase list
-
Remove Old Files (Optional)
- Can delete original files from
src/components/root/cards/ - Keep
index.tsxandpage.tsxfor backward compatibility
- Can delete original files from
-
Enhance Documentation
- Add live previews to MDX files
- Add code examples
- Add usage notes
-
Add More Cards
- Follow the same pattern
- Add to
_registry.ts - Run
pnpm generate:docs - Run
pnpm build:registry
🎉 Successfully migrated 12 cards to atoms registry!
- Total Atoms: 43
- Cards: 12
- Other Atoms: 31
- Documentation: 44 MDX files
- Registry JSON: 86 files (43 × 2 styles)
The root page at / still works with CardsDemo, and all cards are now browsable at /atoms with full documentation and CLI support!