refactor: split the five largest files for maintainability (#58) #61

Merged
Reliodas merged 5 commits from refactor/58-split-large-files into develop 2026-06-25 07:27:08 +00:00
Owner

Closes #58

Réduit le coût de maintenance en découpant les cinq plus gros fichiers, sans changer le comportement du jeu ni le contrat Socket.IO.

Découpages (1 commit ciblé par fichier)

  • game.state.ts (497→91) → projections d'état séparées par manche : round1.state.ts, round2.state.ts, round3.state.ts + helpers partagés game.state.shared.ts. broadcastState reste la seule API publique.
  • socket.integration.test.ts (761) → harness commun socket.integration.harness.ts + suites par thème : room, round1, round2, reconnect. Mêmes tests, même couverture.
  • Host.vue (498→31) → HostRound1/2/3.vue + styles partagés style/host-rounds.css.
  • Player.vue (410→59) → PlayerRound1/2/3.vue + styles partagés style/player-rounds.css.
  • main.css (634) → zones style/zones/ (tokens, base, components, views, game, responsive) importées en ordre de cascade. CSS bundlé byte-identique (même content hash).

Invariants préservés

  • Aucun changement de comportement utilisateur ni de contrat Socket.IO.
  • Sortie CSS identique (hash inchangé) ; sortie de templates identique.
  • Couverture serveur maintenue (93.84% stmts, seuils respectés) ; gates client OK.

Vérification

  • typecheck (shared/server/client) OK
  • node:test 192 pass (1 skipped), Jest 13/13, Vitest 83/83
  • coverage serveur + client : exit 0 (seuils non abaissés)
  • build (tous workspaces) OK, check:assets OK, validate:questions OK (142), smoke OK
  • e2e Playwright 3/3
Closes #58 Réduit le coût de maintenance en découpant les cinq plus gros fichiers, sans changer le comportement du jeu ni le contrat Socket.IO. ## Découpages (1 commit ciblé par fichier) - **`game.state.ts`** (497→91) → projections d'état séparées par manche : `round1.state.ts`, `round2.state.ts`, `round3.state.ts` + helpers partagés `game.state.shared.ts`. `broadcastState` reste la seule API publique. - **`socket.integration.test.ts`** (761) → harness commun `socket.integration.harness.ts` + suites par thème : `room`, `round1`, `round2`, `reconnect`. Mêmes tests, même couverture. - **`Host.vue`** (498→31) → `HostRound1/2/3.vue` + styles partagés `style/host-rounds.css`. - **`Player.vue`** (410→59) → `PlayerRound1/2/3.vue` + styles partagés `style/player-rounds.css`. - **`main.css`** (634) → zones `style/zones/` (tokens, base, components, views, game, responsive) importées en ordre de cascade. CSS bundlé **byte-identique** (même content hash). ## Invariants préservés - Aucun changement de comportement utilisateur ni de contrat Socket.IO. - Sortie CSS identique (hash inchangé) ; sortie de templates identique. - Couverture serveur maintenue (93.84% stmts, seuils respectés) ; gates client OK. ## Vérification - typecheck (shared/server/client) OK - `node:test` 192 pass (1 skipped), Jest 13/13, Vitest 83/83 - coverage serveur + client : exit 0 (seuils non abaissés) - build (tous workspaces) OK, check:assets OK, validate:questions OK (142), smoke OK - e2e Playwright 3/3
Extract the per-round state builders from game.state.ts into round1.state.ts,
round2.state.ts and round3.state.ts, with shared player/question helpers in
game.state.shared.ts. game.state.ts keeps only broadcastState and the host and
participant orchestration. No behavior or socket-contract change; broadcastState
remains the sole public export.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the shared Fastify/Socket.IO harness (server boot, client/waitFor
helpers, reset hooks) into socket.integration.harness.ts and split the 761-line
suite into room, round1, round2 and reconnection files. Same tests and coverage,
no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the first-round, second-round and final blocks of Host.vue into
HostRound1/2/3 components, with the shared second-round and final card styles in
style/host-rounds.css. Host.vue keeps the top bar and dispatches by round. No
behavior or template-output change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the first-round, second-round and final blocks of Player.vue into
PlayerRound1/2/3 components, with the shared round panel styles in
style/player-rounds.css. Player.vue keeps the score header and dispatches by
round. No behavior or template-output change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
refactor(client): split main.css into cascade-ordered zones (#58)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
12f96f3975
Move the global stylesheet into style/zones/ (tokens, base, components, views,
game, responsive) and turn main.css into an ordered @import manifest. The
imports preserve the original source order, so the bundled CSS is byte-identical
(same content hash). No visual change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reliodas merged commit 8859268128 into develop 2026-06-25 07:27:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jeux/le-grand-concours#61
No description provided.