docs: refine frontend conventions and routing
Frontend security / security (push) Successful in 8s
Frontend verify / verify (push) Successful in 3m56s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 3m41s
Conventional commits / commits (pull_request) Successful in 19s
Frontend security / security (push) Successful in 8s
Frontend verify / verify (push) Successful in 3m56s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 3m41s
Conventional commits / commits (pull_request) Successful in 19s
This commit is contained in:
@@ -1,36 +1,26 @@
|
||||
# Frontend
|
||||
# Frontend router
|
||||
|
||||
React/Vite-клиент; общие правила работы — в root `AGENTS.md`.
|
||||
До frontend-решения прочитай [router](.ai/CONVENTIONS.md) и
|
||||
[sources](.ai/SOURCES.md), затем только применимые документы/разделы.
|
||||
Общие инструкции — [workspace AGENTS](../AGENTS.md). Объединяй triggers задачи,
|
||||
путей и обнаруженных boundaries; читай только нужные темы до решения.
|
||||
[Sources](.ai/SOURCES.md) выбирает факты/spec/ADR по возникшему вопросу.
|
||||
|
||||
## Проверка
|
||||
| Решение / сигнал | Читать |
|
||||
| --- | --- |
|
||||
| Первое знакомство, data flow, общая архитектура | [Mental model](.ai/architecture.md) |
|
||||
| Создать/перенести component/module/slice, owner/FSD, cross-slice imports | [FSD](.ai/conventions/frontend-architecture.md) |
|
||||
| TS types/props/imports/exports, hooks/effects, derived state, memoization, domain literals | [TypeScript/React](.ai/conventions/typescript-react.md) |
|
||||
| UI/Mantine, form, container/VM/view, state owner, loading/error/recovery | [UI](.ai/conventions/frontend-ui.md) |
|
||||
| Только продуктовая строка / Zod message | [Строки](.ai/conventions/frontend-ui.md#строки-и-валидация) |
|
||||
| Query/mutation, server cache, shared/api, generated types | [Data](.ai/conventions/frontend-data.md) |
|
||||
| API/network/application errors, codes и сообщения | [Errors](.ai/conventions/frontend-data.md#errors) |
|
||||
| Login/refresh/logout, token/cookie, session ownership | Data + [Security](../backend/.ai/conventions/security-auth.md) + [Testing](.ai/conventions/frontend-testing.md) |
|
||||
| Request/response field, route/status/error shape, OpenAPI | Data + [HTTP contract source](../docs/architecture/http-api.md#источник-контракта) |
|
||||
| Tests или behavior с regression risk | [Testing](.ai/conventions/frontend-testing.md) |
|
||||
| Storybook/stories/play, theme/tokens/shared UI | [Storybook](.ai/conventions/storybook.md), UI; design facts — через Sources |
|
||||
| Helper/dependency/новый pattern, refactor/scope | [Code health](../.ai/conventions/code-health.md), для пакета — [Dependencies](../.ai/conventions/dependencies.md) |
|
||||
| Выбор gate, tooling, завершение | [Guardrails](../.ai/conventions/guardrails.md) |
|
||||
|
||||
Перед Node-командами: `nvm use --silent` по `.nvmrc`.
|
||||
После lockfile install `npm ci` полный gate — `npm run verify`.
|
||||
Он проверяет OpenAPI drift, TypeScript, Biome, Vitest/coverage, Knip,
|
||||
dependency boundaries и сборки приложения/Storybook без backend.
|
||||
Точные scripts принадлежат `package.json`; targeted checks — у выбранного convention.
|
||||
|
||||
HTTP contract changes используют предоставленный OpenAPI snapshot; frontend
|
||||
локально проверяет только соответствие generated types этому snapshot:
|
||||
[Источник HTTP-контракта](../docs/architecture/http-api.md#источник-контракта).
|
||||
Generated types редактируются через их source; T-Bank доступен только через backend.
|
||||
Frontend dependencies используют exact versions. Pre-commit запускает staged
|
||||
formatting и FSD checks; сообщения commits — Conventional Commits.
|
||||
Если у задачи есть связанная issue этого репозитория, добавляй её номер
|
||||
в конец заголовка: `ci: run full frontend verification #1`.
|
||||
Без связанной issue номер необязателен: `chore(deps): update non-major dependencies`.
|
||||
Формат Conventional Commits проверяет `commitlint.config.cjs`.
|
||||
|
||||
Code/style checks автоматические только в scope конфигурации. i18n, props,
|
||||
semantic placement и выбор полезных тестов обязательны при review.
|
||||
Storybook уже доступен как reference; ожидаемый UI и его состояния определяет
|
||||
задача, а визуальное соответствие проверяется отдельно от сборки.
|
||||
|
||||
## Ветки и релизы
|
||||
|
||||
Работа — в отдельной ветке от `develop`, затем PR в `develop`; в `main` напрямую
|
||||
не пушить. Release/hotfix и синхронизация веток — по [root README](../README.md#релизы-и-ветки).
|
||||
Commits и заголовки PR — Conventional Commits; для спецификаций допустим `spec:`.
|
||||
Перед подготовкой релиза прочитай root README; версии вручную не повышать.
|
||||
Показ query state не означает изменение fetching. Изменение тестов активирует
|
||||
Testing и без production diff. Повтори routing по итоговому diff, включая новые
|
||||
файлы. Migration backlog читается только при работе над соответствующим finding
|
||||
через [plan](../.ai/migrations/conventions-v1/plan.md).
|
||||
|
||||
Reference in New Issue
Block a user