feat: implement Phase 10 - minimal skeleton with empty grid

Create clean src/ structure with minimal viable implementation:

Core Files:
- src/types.ts: Basic type definitions (Difficulty, GameStatus, GameManager)
- src/index.ts: Main package exports
- src/game.css: Copied from src_old for styling
- src/useGame.ts: Orchestrator with mocked GameManager API
- src/useBoard/useBoard.ts: Renders empty 9x9 sudoku grid

Implementation Details:
- useBoard renders 81 cells with sudoku-grid/sudoku-cell classes
- Each cell has data-r and data-c attributes for identification
- useGame provides full GameManager interface to satisfy example app
- Real implementations: gameStatus, keyLog tracking, game controls
- Mocked implementations: cursor ({}), scoreManager (zeros/null)
- Supports optional platformHook parameter

Build Status:
- TypeScript compiles cleanly with no errors
- Example app builds successfully
- Ready for browser testing with empty grid display

Phase 10 complete. Next: Phase 20 (full useBoard with puzzle generation).
This commit is contained in:
2025-10-22 18:18:06 +01:00
parent 9292b83dd0
commit b7d740386e
6 changed files with 452 additions and 1 deletions
+30
View File
@@ -0,0 +1,30 @@
import type { RefObject } from 'react';
export type Difficulty = 'easy' | 'medium' | 'hard' | 'very-hard' | 'insane' | 'inhuman';
export type GameStatus = 'waiting' | 'started' | 'paused' | 'game-over' | 'game-won';
export type GameOptions = {
difficulty?: Difficulty;
};
export type KeyLogEntry = { key: string; timestamp: number };
export type GameManager = {
containerRef: RefObject<HTMLDivElement | null>;
renderBoard: () => void;
gameStatus: GameStatus;
setGameStatus: (status: GameStatus) => void;
startGame: () => void;
togglePause: (pause?: boolean) => void;
quitGame: () => void;
cursor: any;
scoreManager: {
timeValue: number;
keystrokes: number;
finalScore: number | null;
};
keyLog: KeyLogEntry[];
clearKeyLog: () => void;
getKeyLog: () => KeyLogEntry[];
};