fix: resolve TS compilation errors and all 7 circular dependencies
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m25s
TypeScript fixes: - gameStore.ts: replace result.ok with result.success (Result<void> uses success not ok) - gameStore.ts: fix undefined newProgress variable → ctx.prestige.pactRitualProgress + HOURS_PER_TICK - prestigeStore.ts: replace result.ok with result.success Circular dependency fixes: - Extract GameCoordinatorState to stores/gameStore.types.ts to break gameStore↔tick-pipeline/gameActions/gameLoopActions cycle - Remove getDodgeChance re-export from floor-utils.ts to break floor-utils↔room-utils↔enemy-utils cycle - Replace direct combatStore import in discipline-slice.ts with callback pattern to break discipline-slice↔combatStore↔combat-actions↔discipline-effects cycle Verification: tsc --noEmit clean, madge --circular clean (0 circular deps)
This commit is contained in:
+16
-15
@@ -1,17 +1,18 @@
|
||||
# Circular Dependencies
|
||||
Generated: 2026-05-26T18:59:01.066Z
|
||||
Found: 7 circular chain(s) — these MUST be fixed before modifying involved files.
|
||||
Generated: $(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||
Found: 0 circular chain(s) — clean!
|
||||
|
||||
1. Processed 135 files (1.6s) (2 warnings)
|
||||
2. 1) effects/discipline-effects.ts > stores/discipline-slice.ts > stores/combatStore.ts > stores/combat-actions.ts
|
||||
3. 2) utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
|
||||
4. 3) utils/floor-utils.ts > utils/room-utils.ts
|
||||
5. 4) stores/gameStore.ts > stores/gameActions.ts
|
||||
6. 5) stores/gameStore.ts > stores/gameLoopActions.ts
|
||||
7. 6) stores/gameStore.ts > stores/tick-pipeline.ts
|
||||
|
||||
## How to fix
|
||||
1. Identify which import in the chain can be extracted to a shared types/utils file.
|
||||
2. Move the shared type or function there.
|
||||
3. Both files import from the new shared module instead of each other.
|
||||
4. Run: bunx madge --circular src/lib/game (should return clean)
|
||||
## Status
|
||||
All 7 previously-known circular dependency chains have been resolved:
|
||||
1. ✅ effects/discipline-effects.ts > stores/discipline-slice.ts > stores/combatStore.ts > stores/combat-actions.ts
|
||||
- Fixed by: discipline-slice.ts uses callbacks instead of directly importing combatStore
|
||||
2. ✅ utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
|
||||
- Fixed by: removed re-export of getDodgeChance from floor-utils.ts
|
||||
3. ✅ utils/floor-utils.ts > utils/room-utils.ts
|
||||
- Fixed by: same as above
|
||||
4. ✅ stores/gameStore.ts > stores/gameActions.ts
|
||||
- Fixed by: extracted GameCoordinatorState to gameStore.types.ts
|
||||
5. ✅ stores/gameStore.ts > stores/gameLoopActions.ts
|
||||
- Fixed by: extracted GameCoordinatorState to gameStore.types.ts
|
||||
6. ✅ stores/gameStore.ts > stores/tick-pipeline.ts
|
||||
- Fixed by: extracted GameCoordinatorState to gameStore.types.ts
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"_meta": {
|
||||
"generated": "2026-05-26T18:58:59.230Z",
|
||||
"generated": "2026-05-26T19:43:50.116Z",
|
||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
||||
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
|
||||
},
|
||||
|
||||
@@ -334,6 +334,7 @@ Mana-Loop/
|
||||
│ │ │ ├── gameHooks.ts
|
||||
│ │ │ ├── gameLoopActions.ts
|
||||
│ │ │ ├── gameStore.ts
|
||||
│ │ │ ├── gameStore.types.ts
|
||||
│ │ │ ├── index.ts
|
||||
│ │ │ ├── manaStore.ts
|
||||
│ │ │ ├── prestigeStore.ts
|
||||
|
||||
Reference in New Issue
Block a user