refactor: split bloated state types into State + Actions interfaces (issue #102)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

- CombatState: split into CombatState (data) + CombatActions + CombatStore
- PrestigeState: split into PrestigeState (data) + PrestigeActions + PrestigeStore
- ManaState: split into ManaState (data) + ManaActions + ManaStore
- GameState: deprecated, removed from barrel exports
- crafting-actions: updated to use CraftingState instead of GameState
- combat-utils/mana-utils: replaced Pick<GameState,...> with focused interfaces
- DisciplineCardProps: split into Definition + Runtime + Callbacks
- stores/index.ts: now exports both State and Actions types
This commit is contained in:
2026-05-20 21:05:22 +02:00
parent ee893e8973
commit 8a7ddaae27
24 changed files with 411 additions and 321 deletions
@@ -1,9 +1,9 @@
// ─── Computed Getters ──────────────────────────────────────────────────────
import type { GameState } from '../types';
import type { CraftingState } from '../stores/craftingStore.types';
import { ENCHANTMENT_EFFECTS } from '../data/enchantment-effects';
export function getEquipmentSpells(get: () => GameState): string[] {
export function getEquipmentSpells(get: () => CraftingState): string[] {
const state = get();
const spells: string[] = [];
@@ -23,7 +23,7 @@ export function getEquipmentSpells(get: () => GameState): string[] {
return [...new Set(spells)];
}
export function getEquipmentEffects(get: () => GameState): Record<string, number> {
export function getEquipmentEffects(get: () => CraftingState): Record<string, number> {
const state = get();
const effects: Record<string, number> = {};
@@ -47,7 +47,7 @@ export function getEquipmentEffects(get: () => GameState): Record<string, number
export function getAvailableCapacity(
instanceId: string,
get: () => GameState
get: () => CraftingState
): number {
const state = get();
const instance = state.equipmentInstances[instanceId];