Sergey Krylov b069575fbb
Some checks failed
CI / ci (pull_request) Failing after 2m51s
CI / ci (push) Failing after 2m38s
refactor(frontend): remove FSD shim files and dead code
- Break entity shim chain: brokerPositionApi, brokerOperationApi now use shared/api/client directly
- Remove all 43 shim re-export files (api/, hooks/, context/, components/, pages/ flat shims, routes.tsx)
- Remove entire pages/broker/ dead code directory
- Remove api/broker.ts after breaking the shim chain
- Switch auth consumers from AuthProvider (shim) to SessionProvider (FSD)
- Fix api/screener.ts imports to use @/shared/api
- Update frontend hooks.md and routes.md documentation
- 2840 lines removed, 71 lines added
2026-06-20 20:42:44 +03:00

69 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Frontend FSD Cleanup — задачи
Статус: выполнено
## 1. Разорвать цепочку entity shims
- [x] Переписать `entities/broker-position/api/brokerPositionApi.ts` на прямой вызов `shared/api/client`
- [x] Переписать `entities/broker-operation/api/brokerOperationApi.ts` на прямой вызов `shared/api/client`
- [x] Проверить `npm test -w apps/frontend`
## 2. Переключить потребителей shim на FSD-импорты
- [x] Удалены вместе с `pages/broker/` (BrokerPages.test.tsx, BrokerAccountsPage.test.tsx)
- [x] Обновить `test/test-utils.tsx``AuthProvider``SessionProvider` из `app/providers/SessionProvider`
- [x] Обновить `hooks/useAuth.test.tsx``AuthProvider``SessionProvider` (удалён на шаге 4)
- [x] Обновить `entities/session/model/useSession.test.tsx``AuthProvider``SessionProvider`
- [x] Проверить `npm test -w apps/frontend`
## 3. Удалить shim-файлы
### api/
- [x] Удалить `api/auth.ts`, `api/client.ts`, `api/portfolio.ts`, `api/responses.ts`, `api/types.ts`
- [x] Удалить `api/broker.test.ts`
### hooks/
- [x] Удалить все файлы кроме `useScreener.ts`
### context/
- [x] Удалить `context/AuthContext.tsx`
- [x] Удалить `context/AuthContext.test.tsx`
### components/
- [x] Удалить все flat shims
### pages/ flat shims
- [x] Удалить `pages/HomePage.tsx`, `pages/StockPage.tsx`, `pages/BondPage.tsx`
### pages/broker/
- [x] Удалить весь каталог `pages/broker/`
### Корень src/
- [x] Удалить `routes.tsx`
- [x] Проверить `npm test -w apps/frontend`
## 4. Удалить тесты, привязанные к shim-файлам
- [x] Удалены 17 тестовых файлов
- [x] Исправлен `api/screener.ts` — импорты из `./client``@/shared/api/client`
## 5. Удалить api/broker.ts
- [x] Удалить `api/broker.ts`
- [x] Проверить `npm test -w apps/frontend`
## 6. Обновить документацию
- [x] Обновить `apps/docs/docs/frontend/hooks.md`
- [x] Обновить `apps/docs/docs/frontend/routes.md`
- [x] Проверить `npm run build -w apps/docs`
## 7. Финальная верификация
- [x] `npm test -w apps/frontend` — PASS (23 files, 112 tests)
- [x] `npm run lint -w apps/frontend` — PASS
- [x] `npm run build -w apps/frontend` — PASS
- [x] `npm run build -w apps/docs` — PASS
- [x] Legacy import check — no matches