Skip to content

♻️ refactor(game): organize components and migrate to path aliases (v2.3.3)#9

Merged
Teczer merged 4 commits into
mainfrom
fix/responsive-gameroom
Nov 26, 2025
Merged

♻️ refactor(game): organize components and migrate to path aliases (v2.3.3)#9
Teczer merged 4 commits into
mainfrom
fix/responsive-gameroom

Conversation

@Teczer

@Teczer Teczer commented Nov 26, 2025

Copy link
Copy Markdown
Owner

♻️ Refactor organize components and migrate to path aliases

Description

Summary

Refactors the game components architecture by organizing components into logical folders and migrating all relative imports to TypeScript path aliases (@/features/game/...).

Changes

🏗️ Components Organization

  • Created folder structure:

    • components/game/ - Game-specific components (role-card, flash-button, timer-controls, timer-control-button, item-toggle)
    • components/room/ - Room/lobby components (room-info, user-list, mobile-user-list, mobile-user-list-drawer)
    • components/status/ - Status components (connection-status, game-info-display)
    • components/controls/ - Control components (game-controls)
    • components/ - Direct components (loading-spinner, summoner-input)
  • Removed unnecessary folders:

    • components/ui/ - Moved loading-spinner to root
    • components/input/ - Moved summoner-input to root

🔄 Import Migration

  • Replaced all relative imports (../, ../../) with TypeScript path aliases (@/features/game/...)
  • Updated all files in features/game/ to use consistent import paths
  • Improved IDE support for autocomplete and refactoring

Technical Details

Files Modified:

Components:

  • components/game/flash-button.component.tsx - Updated imports
  • components/game/role-card.component.tsx - Updated imports
  • components/game/timer-controls.component.tsx - Updated imports
  • components/game/timer-control-button.component.tsx - Updated imports
  • components/game/item-toggle.component.tsx - Updated imports
  • components/room/room-info.component.tsx - Updated imports
  • components/room/user-list.component.tsx - Updated imports
  • components/room/mobile-user-list.component.tsx - Updated imports
  • components/room/mobile-user-list-drawer.component.tsx - Updated imports
  • components/status/connection-status.component.tsx - Updated imports
  • components/status/game-info-display.component.tsx - Updated imports
  • components/controls/game-controls.component.tsx - Updated imports
  • components/loading-spinner.component.tsx - Updated imports
  • components/summoner-input.component.tsx - Updated imports

Screens:

  • screens/game-multiplayer.screen.tsx - Updated imports
  • screens/game-solo.screen.tsx - Updated imports

Contexts:

  • contexts/game.context.tsx - Updated imports

Hooks:

  • hooks/use-flash-cooldown.hook.ts - Updated imports
  • hooks/use-audio.hook.ts - Updated imports
  • hooks/use-game-timer.hook.ts - Updated imports
  • hooks/use-fetch-live-game.hook.ts - Updated imports

Constants:

  • constants/game.constants.ts - Updated imports

Barrel Exports:

  • components/game/index.ts - Created
  • components/room/index.ts - Created
  • components/status/index.ts - Created
  • components/controls/index.ts - Created
  • components/index.ts - Updated

Benefits

Better Organization: Components grouped by functionality
Consistent Imports: All imports use path aliases
IDE Support: Better autocomplete and refactoring
Maintainability: Easier to navigate and understand codebase
Scalability: Easier to add new components in the right place

Testing

  • ✅ All components render correctly
  • ✅ All imports resolve correctly
  • ✅ No TypeScript errors
  • ✅ No runtime errors
  • ✅ Linter passes

Version

2.3.22.3.3

Breaking Changes

None


Ready to merge 🚀

@Teczer Teczer self-assigned this Nov 26, 2025
@Teczer Teczer added bug Something isn't working enhancement New feature or request labels Nov 26, 2025
@Teczer
Teczer merged commit 19e81db into main Nov 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant