Skip to content

refactor(game): extract shared.ts (Phase 0 of #132)#135

Merged
nodots merged 1 commit into
developmentfrom
refactor/game-decomp-phase0-shared
Jul 15, 2026
Merged

refactor(game): extract shared.ts (Phase 0 of #132)#135
nodots merged 1 commit into
developmentfrom
refactor/game-decomp-phase0-shared

Conversation

@nodots

@nodots nodots commented Jul 15, 2026

Copy link
Copy Markdown
Owner

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

First slice of splitting the 2491-line Game/index.ts god file (#132).

What changed

  • New src/Game/shared.ts (leaf module) holds createBaseGameProperties, incrementStateVersion, and MAX_PIP_COUNT as exported free functions/const.
  • index.ts imports them directly and calls them as free functions — Rule A: extracted functions never route back through the Game facade (avoids an index↔module cycle).
  • Both helpers were private static methods (no external callers). MAX_PIP_COUNT was dead code in index.ts; it now has a shared home for later modules.

Verification

  • tsc -b --force clean
  • npx jest: 448 passed / 12 skipped (identical to baseline)
  • No behavior change; no public API change (external Game.* surface untouched)

Refs #132, #133

Move createBaseGameProperties, incrementStateVersion, and MAX_PIP_COUNT
out of the Game class into src/Game/shared.ts as free functions.
Call sites in index.ts now import them directly (Rule A: extracted
functions never route through the Game facade). MAX_PIP_COUNT was dead
in index.ts; it now has a shared home for downstream modules.

No behavior change. Core: 448 passed / 12 skipped, tsc -b clean.

Refs #132, #133
@nodots
nodots merged commit fb5c472 into development Jul 15, 2026
1 check passed
@nodots
nodots deleted the refactor/game-decomp-phase0-shared branch July 15, 2026 18:32
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