5.3 KiB
Implementation Summary: codify-frontend-component-style
Scope
Реализована behavior-preserving frontend style migration для утверждённого change:
- Biome настроен на enforceable subset React component style;
- frontend conventions описывают полный React component style и границу между enforced guardrails и mandatory review conventions;
- authored frontend source мигрирован на const-valued
FCReact components, named props types only where they carry real props shape, directFC<PropsWithChildren>for children-only components, internal props destructuring, bottom named exports for ordinary modules and direct re-exports for pure barrels; - generated OpenAPI source оставлен под ownership генератора и не редактировался руками ради style.
Backend code, persisted data, runtime OpenAPI behavior, routes, localization keys, API calls, state selection и visual design намеренно не менялись.
Guardrail Proof
Локально использовался Biome 2.5.8.
npm exec biome -- check .tmp-biome-style/compliant.tsx— pass,Checked 1 file ... No fixes applied.npm exec biome -- check .tmp-biome-style/function-component.tsx— fail сlint/nursery/useReactFunctionComponentDefinitionдля React component, объявленного как function declaration.npm exec biome -- check .tmp-biome-style/default-export.tsx— fail сlint/style/noDefaultExportдляexport default.npm exec biome -- check .tmp-biome-style/export-order.tsx— fail сlint/style/useExportsLastдля export перед module declarations.
Temporary samples удалены после proof и не входят в delivered source.
Review-Only Convention Checks
Manual scans после migration:
rg -n "^export function|^export const|^export type|^export interface|^export default|^function [A-Z][A-Za-z0-9]*" src scripts --glob '*.{ts,tsx,mjs}'— остались только generated OpenAPI declarations.rg -n "\\}: \\{[^}]+\\}\\) =>|\\}: \\{[^}]+\\}\\)" src --glob '*.tsx'— не нашёл inline destructured component props matches.rg --pcre2 -n "^const [A-Z][A-Za-z0-9]*(?![^=]*:\\s*FC\\b)[^=]*=" src --glob '*.tsx'— нашёл толькоlazy(...)route bindings иAuthContext, а не const-valued React function component declarations.rg -n "type \\w+Props = PropsWithChildren;" src --glob '*.tsx'— не нашёл лишних aliases для children-only components.rg -n "^import \\{ .+ \\} from \\\"\\." src/**/index.ts— не нашёл чистых barrel imports, которые нужны только для последующего re-export.
Verification
Baseline before structural edits:
npm run typecheck— pass.npm run test:coverage— pass,21test files и67tests passed.
Targeted checks после migration:
npm run lint— pass,Checked 121 files ... No fixes applied.npm run typecheck— pass.npm run test:coverage— pass,21test files и67tests passed; coverage summary: statements86%, branches78.28%, functions79.09%, lines86.64%.npm run knip— pass.npm run deps— pass,4dependency-cruiser config tests passed иno dependency violations found.npm run build— pass.
Canonical frontend gate:
npm run verifyпод Node26.7.0— blocked by runtime preflight as expected: repository требует Node22.x.PATH=/Users/ksv741/.nvm/versions/node/v22.21.0/bin:$PATH npm run verify— pass; runtime verified Node22.21.0, OpenAPI check passed, repository hygiene passed, lint/typecheck/coverage/knip/deps/build/bundle checks passed, bundle check reportedInitial JavaScript payload: 510523 bytes.
OpenSpec structural validation:
openspec validate codify-frontend-component-style --type change --strict --store wealth-ledger-specs— pass.
Independent read-only review:
- Separate read-only review reported no Critical or Important findings.
- Minor findings about mixed language and stale implementation-summary status were addressed before workspace dispatcher.
Workspace dispatcher:
PATH=/Users/ksv741/.nvm/versions/node/v22.21.0/bin:$PATH bash specs/scripts/verify-workspace-change.sh codify-frontend-component-style— pass; Delivery Map verifiedfrontend=affected backend=N/A specs=affected docs=N/A, Contract Gate Decision verifiedruntime-openapi=N/A, main specs20 passed, 0 failed, frontend canonical verification passed and workspace verification passed.
Semantic Verification
Implementation соответствует утверждённым Proposal, Delta Spec, Design и Tasks
как style/tooling change с уточнением Change Owner: children-only components
используют FC<PropsWithChildren> без лишнего alias, а чистые barrels
используют прямые re-exports без промежуточных imports. Изменены
declaration/export shape и documentation. User-visible behavior, routes,
localized text keys, API contract, backend behavior, generated API source
ownership и product documentation остаются вне изменённого scope.