Skip to content

refactor(game): prune dead imports + finalize facade (Phase 7 of #132) - #142

Merged
nodots merged 1 commit into
refactor/game-decomp-phase6-robotfrom
refactor/game-decomp-phase7-facade
Jul 15, 2026
Merged

refactor(game): prune dead imports + finalize facade (Phase 7 of #132)#142
nodots merged 1 commit into
refactor/game-decomp-phase6-robotfrom
refactor/game-decomp-phase7-facade

Conversation

@nodots

@nodots nodots commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Phase 7 (final) of the Game/index.ts decomposition epic (#133)

Stacked on #141 (Phase 6). Retarget to development as parents merge.

index.ts is now a thin facade over shared / guards / undo / cube / lifecycle / turnFlow / robot. Game remains a class (constructor path + gnuPositionId getter), createNewGame / initialize / the player accessors stay on it, and every public Game.* method delegates to a free function.

What changed

  • Removed type imports left dead by the extractions: BackgammonCubeValue, BackgammonDieValue, BackgammonMoveSkeleton, BackgammonPlayerDoubled, BackgammonPlayerWinner, BackgammonRoll, BackgammonPlayersMovingTuple, BackgammonPlayersRollingTuple.

Downstream guard

Rebuilt core and typechecked consumers against the local build:

  • aitsc -b clean
  • apitsc --noEmit clean
  • client — does not consume core at the type level (only doc/marketing string literals)

Public Game.* API + signatures were preserved through every phase, so no consumer changes were needed.

Epic result

Game/index.ts: 2491 → 531 lines (−79%), 27 new characterization tests, tsc -b clean and 475 tests passing at every phase.

Refs #132, #133

…132)

After the module extractions, index.ts is a thin facade over
shared/guards/undo/cube/lifecycle/turnFlow/robot. Remove type imports
left dead by the moves: BackgammonCubeValue, BackgammonDieValue,
BackgammonMoveSkeleton, BackgammonPlayerDoubled, BackgammonPlayerWinner,
BackgammonRoll, BackgammonPlayersMovingTuple, BackgammonPlayersRollingTuple.

Downstream guard: rebuilt core + typechecked consumers against local
core -- ai (tsc -b) clean, api (tsc --noEmit) clean; client does not
consume core at the type level. Game.* public API + signatures preserved
throughout the epic.

No behavior change. Core: 475 passed / 12 skipped, tsc -b clean.
index.ts: 2491 -> ~530 lines across the epic.

Refs #132, #133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant