refactor(frontend): split hooks/ into shared, scanner, admin (Phase 5)#21
Merged
refactor(frontend): split hooks/ into shared, scanner, admin (Phase 5)#21
Conversation
Phase 5 of the directory restructure plan. Pure file moves with
import-path updates and new barrel index files; no runtime behaviour
change.
Moves (15 files, all tracked as renames):
- hooks/{useAuthInit,useTheme,useTokenRefresh,useWebSocket}.* -> hooks/shared/
- hooks/{useScanner,useAudioPlayer,useTGSelectionSync,useActiveUnit}.ts -> hooks/scanner/
- hooks/{useAdminWebSocket,useAdminWsOps,useAdminActivity,useAdminLogs,useWsQuery}.ts -> hooks/admin/
Added barrel index.ts in each subfolder plus hooks/index.ts (root
safety net). All 31 @/hooks/* import sites across components, pages,
hooks, and tests have been updated to specific paths.
tsc --noEmit clean, 188/188 unit tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 5 of the directory restructure plan. Pure file moves with import-path updates and new barrel index files; no runtime behaviour change.
File moves (15 files, all tracked as renames)
hooks/shared/useAuthInit.ts(+.test.tsx)useTheme.tsuseTokenRefresh.ts(+.test.tsx)useWebSocket.tshooks/scanner/useScanner.tsuseAudioPlayer.tsuseTGSelectionSync.tsuseActiveUnit.tshooks/admin/useAdminWebSocket.tsuseAdminWsOps.tsuseAdminActivity.tsuseAdminLogs.tsuseWsQuery.tsNew barrel files
Added
index.tsin each subfolder plus a roothooks/index.tsas a safety net. Per the plan, callers should prefer specific paths (@/hooks/shared/useTheme); the root barrel is only there as a fallback.Import updates
All 31
@/hooks/*import sites across components, pages, intra-hook references, and testvi.mockcalls have been updated to specific paths.Verification
pnpm exec tsc --noEmit— cleanpnpm test -- --run— 188/188 passservices/downloadFilename.tsis unchanged fromdev(out of scope)Phase progress
/api/wscanonical +/wsaliasinternal/adminextractioninternal/apidecomposition (refactor(backend): Phase 3 — decompose internal/api into feature-scoped handler packages #18)CHANGELOG
One bullet appended under
[Unreleased]### Changed.