refactor: extract sub-components from monster functions (issue #99)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m21s

- GuardianPactsTab: extracted GuardianCard, PactHeaderSummary, TierFilter + 5 helper components into guardian-pacts-components.tsx
- SpireSummaryTab: extracted TopStatsRow, NextGuardianCard, GuardianRoster, GuardianRosterItem, FloorLegend
- PrestigeTab: extracted InsightSummary, MemoriesCard, PactsCard, ResetLoopSection
- GameStateDebug: extracted WarningBanner, DisplayOptions, GameResetSection, ManaDebugSection, TimeControlSection, QuickActionsSection
- EquipmentCrafter: extracted CraftingProgress, BlueprintCard, BlueprintList, MaterialCard, MaterialsInventory
- PactDebug: extracted GuardianPactRow, GuardianPactList
- GameStateDebugSection: extracted DisplayOptions, GameResetSection, ManaDebugSection, TimeControlSection, QuickActionsSection
- PactDebugSection: extracted GuardianPactRow
- SpireCombatPage: extracted useSpireStats hook
- page.tsx: extracted GrimoireTab to separate file, useGameDerivedStats hook, TabTriggers, LazyTab wrapper

All files now under 400 lines. Build passes. All 639 tests pass.
This commit is contained in:
2026-05-20 18:38:24 +02:00
parent 53b3a94725
commit ce084a61a3
15 changed files with 1765 additions and 1539 deletions
+5 -3
View File
@@ -1,8 +1,10 @@
# Circular Dependencies
Generated: 2026-05-20T13:20:47.227Z
Found: 1 circular chain(s) — these MUST be fixed before modifying involved files.
Generated: 2026-05-20T15:46:48.123Z
Found: 3 circular chain(s) — these MUST be fixed before modifying involved files.
1. Processed 125 files (1.4s) (4 warnings)
1. Processed 125 files (1.5s) (3 warnings)
2. 1) stores/gameStore.ts > stores/gameActions.ts
3. 2) stores/gameStore.ts > stores/gameLoopActions.ts
## How to fix
1. Identify which import in the chain can be extracted to a shared types/utils file.
+8 -6
View File
@@ -1,6 +1,6 @@
{
"_meta": {
"generated": "2026-05-20T13:20:45.668Z",
"generated": "2026-05-20T15:46:46.373Z",
"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."
},
@@ -127,7 +127,7 @@
"data/attunements.ts",
"data/enchantment-effects.ts",
"effects/special-effects.ts",
"effects/upgrade-effects.ts",
"effects/upgrade-effects.types.ts",
"types.ts"
],
"crafting-attunements.ts": [
@@ -139,7 +139,7 @@
"data/enchantment-effects.ts",
"data/equipment/index.ts",
"effects/special-effects.ts",
"effects/upgrade-effects.ts",
"effects/upgrade-effects.types.ts",
"types.ts"
],
"crafting-equipment.ts": [
@@ -158,7 +158,6 @@
],
"crafting-utils.ts": [
"data/crafting-recipes.ts",
"data/enchantment-effects.ts",
"data/equipment/index.ts",
"types.ts"
],
@@ -371,7 +370,7 @@
"effects/discipline-effects.ts": [
"data/disciplines/index.ts",
"stores/discipline-slice.ts",
"types.ts",
"types/disciplines.ts",
"utils/discipline-math.ts"
],
"effects/dynamic-compute.ts": [
@@ -431,7 +430,8 @@
"stores/craftingStore.types.ts",
"stores/manaStore.ts",
"stores/uiStore.ts",
"types.ts"
"types.ts",
"types/equipmentSlot.ts"
],
"stores/craftingStore.types.ts": [
"types.ts"
@@ -448,6 +448,7 @@
"effects/discipline-effects.ts",
"stores/combatStore.ts",
"stores/discipline-slice.ts",
"stores/gameStore.ts",
"stores/manaStore.ts",
"stores/prestigeStore.ts",
"stores/uiStore.ts",
@@ -471,6 +472,7 @@
"effects/discipline-effects.ts",
"stores/combatStore.ts",
"stores/discipline-slice.ts",
"stores/gameStore.ts",
"stores/manaStore.ts",
"stores/prestigeStore.ts",
"stores/uiStore.ts",
+2
View File
@@ -52,6 +52,7 @@ Mana-Loop/
│ ├── app/
│ │ ├── components/
│ │ │ ├── GameOverScreen.tsx
│ │ │ ├── GrimoireTab.tsx
│ │ │ └── LeftPanel.tsx
│ │ ├── globals.css
│ │ ├── layout.tsx
@@ -140,6 +141,7 @@ Mana-Loop/
│ │ │ │ ├── SpireSummaryTab.test.ts
│ │ │ │ ├── SpireSummaryTab.tsx
│ │ │ │ ├── StatsTab.tsx
│ │ │ │ ├── guardian-pacts-components.tsx
│ │ │ │ └── index.ts
│ │ │ ├── ActionButtons.tsx
│ │ │ ├── ActivityLogPanel.tsx