Files
specs/openspec/changes/archive/2026-08-25-codify-frontend-component-style/tasks.md
T

4.5 KiB
Raw Blame History

1. Tooling Guardrail

  • 1.1 Настроить frontend Biome rules для enforceable subset component style: const-valued named React components, no default exports и exports после declarations тела module. Verification: npm run lint сообщает настроенные rules и падает на representative local violations.
  • 1.2 Доказать новый hard guardrail одним compliant fixture или временным authored source sample и representative failing samples для запрещённой component declaration, default export и export ordering. Verification: записать exact Biome commands и observed pass/fail behavior в implementation summary перед archive.

2. Frontend Conventions

  • 2.1 Обновить frontend-local conventions и описать полный React component style: FC typing, named props types только когда они несут real props shape, no inline props typing, props destructuring внутри component body, один нижний named export block для обычных modules и прямые re-exports для чистых barrels. Verification: frontend/docs/CONVENTIONS.md явно разделяет Biome-enforced guardrails и mandatory review conventions.
  • 2.2 При необходимости обновить frontend routing guidance для AI agents, чтобы будущие frontend edits находили component style convention до implementation. Verification: affected local guidance указывает на documented convention без дублирования product architecture.

3. Source Migration

  • 3.1 Мигрировать authored production React components в frontend/src на const-valued FC component declarations без изменения JSX, hook order, route behavior, state selection, localized text keys или API calls. Verification: TypeScript и existing frontend tests проходят после migration.
  • 3.2 Заменить inline props typing в authored React components на named props types, использовать FC<PropsWithChildren> без alias для children-only components, использовать PropsWithChildren<{ ... }> для components с children и дополнительными props и не создавать empty props type для components без props. Verification: review migrated source на documented convention и запуск npm run typecheck.
  • 3.3 Перенести React component props destructuring из function parameters в component bodies. Verification: review migrated source на documented convention и запуск npm run typecheck.
  • 3.4 Свести обычные authored module exports к одному нижнему named export block, а чистые barrels — к прямым re-exports с сохранением public APIs и import paths. Verification: npm run lint, npm run knip и npm run deps проходят.
  • 3.5 Оставить generated OpenAPI source вне manual style migration. Verification: generated files остаются owned by existing OpenAPI workflow и не редактируются руками ради component style.

4. Verification

  • 4.1 Запустить targeted frontend checks после migration. Verification: npm run lint, npm run typecheck, npm run test:coverage, npm run knip, npm run deps и npm run build проходят из frontend.
  • 4.2 Запустить frontend canonical gate. Verification: npm run verify проходит из frontend под Node 22.
  • 4.3 Проверить OpenSpec change структурно. Verification: openspec validate codify-frontend-component-style --type change --strict --store wealth-ledger-specs проходит из specs.
  • 4.4 Выполнить semantic verification против Proposal, Delta Spec, Design и Tasks. Verification: implementation summary подтверждает, что user-visible behavior, routes, localization, API contract, backend behavior, generated API source ownership и product documentation не изменились вне approved scope.
  • 4.5 Выполнить independent read-only review перед archive. Verification: review не содержит Critical или Important findings.
  • 4.6 Запустить workspace change dispatcher после завершения affected tasks. Verification: bash specs/scripts/verify-workspace-change.sh codify-frontend-component-style проходит из workspace root.