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