fix: remove unused imports and variables from server files to resolve build errors.
All checks were successful
Build and Deploy / build (push) Successful in 1m32s

This commit is contained in:
2025-12-19 01:10:19 +01:00
parent 49080d8233
commit 755ae73d9e
6 changed files with 31 additions and 8 deletions

View File

@@ -140,3 +140,4 @@
- [Strict Cache Structure](./devlog/2025-12-18-213300_strict_cache_structure.md): Completed. Enforced cache structure `/cards/[code]/full` and `/cards/[code]/crop`, removing the `images` subdirectory and ensuring strict local file usage.
- [Implicit Image Caching](./devlog/2025-12-18-213900_implicit_image_caching.md): Completed. Updated API routes `/api/sets/:code/cards` and `/api/cards/parse` to implicitly trigger and await image caching, ensuring assets are available immediately for generators.
- [Restore Images Subdirectory](./devlog/2025-12-18-214300_restore_images_subdir.md): Completed. Corrected cache folder structure to `/cards/images/[set]/full` and `/cards/images/[set]/crop` as per user request.
- [Fix Build Unused Variables](./devlog/2025-12-19-011500_fix_build_unused_vars.md): Completed. Resolved TS6133 errors in RulesEngine, PersistenceManager, and CardService to fix Docker build failure.

View File

@@ -0,0 +1,24 @@
# Fix Build Unused Variables
## Objective
Fix Typescript errors preventing `npm run build` execution in the Docker container.
The errors were `TS6133` (unused variables) in:
- `server/game/RulesEngine.ts`
- `server/managers/PersistenceManager.ts`
- `server/services/CardService.ts`
## Changes
1. **RulesEngine.ts**:
- Removed unused imports: `PlayerState`, `StackObject`.
- Renamed unused parameter `playerId` to `_playerId` in `cleanupStep`.
- (Also fixed an accidental comment injection during the process).
2. **PersistenceManager.ts**:
- Removed unused `__dirname` and `__filename` definitions.
- Removed unused `fileURLToPath` import.
3. **CardService.ts**:
- Removed unused `fs` import.
## Verification
- Ran `npx tsc --noEmit` in `src` directory. Result: Exit code 0 (Success).