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

2.6 KiB
Raw Blame History

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.tsxAuthProviderSessionProvider из app/providers/SessionProvider
  • Обновить hooks/useAuth.test.tsxAuthProviderSessionProvider (удалён на шаге 4)
  • Обновить entities/session/model/useSession.test.tsxAuthProviderSessionProvider
  • Проверить 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 — PASS
  • npm run build -w apps/frontend — PASS
  • npm run build -w apps/docs — PASS
  • Legacy import check — no matches