1.7 KiB
1.7 KiB
name, description
| name | description |
|---|---|
| dyolink-frontend-structure | Audits or refactors Dyolink frontend folder layout (components vs components/ui, thin pages). Use when moving components, fixing structure violations, or when the user mentions folder rules, page.tsx bloat, or component organization. |
Frontend structure audit
Target layout
components/ui/shared/ → reusable UI (Button, Dialog, …)
components/ui/{feature}/ → feature UI + {Feature}Page.tsx
components/shared/ → cross-feature non-UI
components/{feature}/ → feature non-UI (helpers, config)
app/**/page.tsx → thin wrapper importing ui/{feature} page component
Audit steps
- List files in
components/outsideui/— any.tsxwith JSX → move tocomponents/ui/{feature}/. - List files in
components/ui/— any pure.tshelper → move tocomponents/{feature}/orcomponents/shared/. - List
app/**/page.tsx— if > ~30 lines of logic/state, extract tocomponents/ui/{feature}/{Feature}Page.tsx. - Update all
@/components/...imports. - Run
npx tsc --noEmitinfrontend/.
Common mistakes
| Wrong | Right |
|---|---|
components/today/TodayDashboard.tsx |
components/ui/today/TodayDashboard.tsx |
components/ui/treatment/treatmentTypeDisplay.ts |
components/shared/treatmentTypeDisplay.ts |
Logic in app/.../staff/page.tsx |
components/ui/staff/StaffPage.tsx |
Non-UI that stays outside ui/
components/today/widget-registry.ts,chart-theme.ts(config)components/staff/workingHours.tscomponents/appointments/appointmentTime.tscomponents/i18n/LocaleSync.tsx(null-render side effect for layout)