refactor(game): prune dead imports + finalize facade (Phase 7 of #132) - #142
Merged
nodots merged 1 commit intoJul 15, 2026
Merged
Conversation
…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
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.
Phase 7 (final) of the Game/index.ts decomposition epic (#133)
Stacked on #141 (Phase 6). Retarget to
developmentas parents merge.index.tsis now a thin facade overshared/guards/undo/cube/lifecycle/turnFlow/robot.Gameremains a class (constructor path +gnuPositionIdgetter),createNewGame/initialize/ the player accessors stay on it, and every publicGame.*method delegates to a free function.What changed
BackgammonCubeValue,BackgammonDieValue,BackgammonMoveSkeleton,BackgammonPlayerDoubled,BackgammonPlayerWinner,BackgammonRoll,BackgammonPlayersMovingTuple,BackgammonPlayersRollingTuple.Downstream guard
Rebuilt core and typechecked consumers against the local build:
ai—tsc -bcleanapi—tsc --noEmitcleanclient— 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 -bclean and 475 tests passing at every phase.Refs #132, #133