fix: resolve all TypeScript compilation errors
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m17s

- Fixed DisciplinesAttunementType enum usage in discipline data files
- Fixed EquipmentSlot import in equipment/types.ts
- Fixed enchantment-effects.ts export/import chain
- Fixed safe-persist.ts StateStorage type compatibility
- Fixed store persist partial return types for all stores
- Fixed gameStore.ts ElementState type and error handling
- Fixed useGameDerived.ts missing properties on GameCoordinatorStore
- Added SkillUpgradeChoice type to types.ts
- Fixed ActionButtons.tsx optional currentStudyTarget prop
- Fixed GameToast.tsx Toast type compatibility
- Fixed EnchantmentDesigner sub-component type mismatches
- Fixed SpireCombatPage equippedInstances/equipmentInstances types
- Fixed page.tsx computeClickMana argument
- Added baseCastTime to SpellDef type
- Fixed golem/types.ts and loot-drops.ts import paths
- Fixed craftingStore.ts missing lastError in initial state and actions
- Fixed store-actions-combat-prestige.test.ts Memory type usage
- Fixed floor-utils.upgraded.test.ts array type annotation
- Fixed computed-stats.test.ts state type assertions
- Fixed activity-log.test.ts state type annotation
- Fixed discipline-math.test.ts enum value usage
- Fixed game-loop.test.ts vitest mock import
- Various other test file type fixes
This commit is contained in:
2026-05-24 14:34:49 +02:00
parent 14f25fffda
commit 23a83a04cf
44 changed files with 191 additions and 142 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import type { GameAction } from '@/lib/game/types';
interface ActionButtonsProps {
currentAction: GameAction;
currentStudyTarget: { type: 'skill' | 'spell'; id: string; progress: number; required: number } | null;
currentStudyTarget?: { type: 'skill' | 'spell'; id: string; progress: number; required: number } | null;
designProgress: { progress: number; required: number } | null;
designProgress2: { progress: number; required: number } | null;
preparationProgress: { progress: number; required: number } | null;
+2 -9
View File
@@ -124,16 +124,9 @@ export function useGameToast() {
const toastTypeClass = `toast-type-${type}`;
return toast({
title,
description,
title: title as string,
description: description as string,
className: toastTypeClass,
// Store the type for styling
...{ toastType: type },
} as {
title: ReactNode;
description?: ReactNode;
className?: string;
toastType?: ToastType;
});
};
}
@@ -78,7 +78,7 @@ export function EffectSelector({
{selected && (
<ActionButton
size="sm"
variant="outline"
variant="ghost"
className="h-6 w-6 p-0"
onClick={() => removeEffect(effect.id)}
>
@@ -87,7 +87,7 @@ export function EffectSelector({
)}
<ActionButton
size="sm"
variant="outline"
variant="ghost"
className="h-6 w-6 p-0"
onClick={() => addEffect(effect.id)}
disabled={!selected && selectedEffects.length >= 5}
@@ -29,7 +29,7 @@ export function EquipmentTypeSelector({
/>
<div className="flex justify-between text-xs text-[var(--text-muted)]">
<span>{designProgress.progress.toFixed(1)}h / {designProgress.required.toFixed(1)}h</span>
<ActionButton size="sm" variant="outline" onClick={cancelDesign}>Cancel</ActionButton>
<ActionButton size="sm" variant="ghost" onClick={cancelDesign}>Cancel</ActionButton>
</div>
</div>
) : (
@@ -1,4 +1,4 @@
import type { EquipmentInstance, EnchantmentDesign, DesignEffect, EquipmentCraftingProgress, EquipmentCategory } from '@/lib/game/types';
import type { EquipmentInstance, EnchantmentDesign, DesignEffect, DesignProgress, EquipmentCategory } from '@/lib/game/types';
export interface EnchantmentDesignerProps {
selectedEquipmentType: string | null;
@@ -15,7 +15,7 @@ export interface EquipmentTypeSelectorProps {
ownedEquipmentTypes: Array<{ id: string; name: string; baseCapacity: number }>;
selectedEquipmentType: string | null;
setSelectedEquipmentType: (type: string | null) => void;
designProgress: EquipmentCraftingProgress | null;
designProgress: DesignProgress | null;
cancelDesign: () => void;
}
@@ -24,10 +24,10 @@ export interface EffectSelectorProps {
selectedEffects: DesignEffect[];
setSelectedEffects: (effects: DesignEffect[]) => void;
availableEffects: Array<{ id: string; name: string; description: string; baseCapacityCost: number; maxStacks: number }>;
incompatibleEffects: Array<{ id: string; name: string; description: string }>;
incompatibleEffects: Array<{ id: string; name: string; description: string; allowedEquipmentCategories: EquipmentCategory[] }>;
enchantingLevel: number;
efficiencyBonus: number;
designProgress: EquipmentCraftingProgress | null;
designProgress: DesignProgress | null;
addEffect: (effectId: string) => void;
removeEffect: (effectId: string) => void;
getIncompatibilityReason: (effect: { id: string; name: string; description: string; allowedEquipmentCategories: EquipmentCategory[] }) => string;
@@ -93,7 +93,7 @@ export function EnchantmentPreparer({
<span>{preparationProgress.progress.toFixed(1)}h / {preparationProgress.required.toFixed(1)}h</span>
<span>Mana paid: {fmt(preparationProgress.manaCostPaid)}</span>
</div>
<ActionButton size="sm" variant="outline" onClick={() => {
<ActionButton size="sm" variant="ghost" onClick={() => {
cancelPreparation();
showToast('warning', 'Preparation Cancelled', 'Equipment preparation was cancelled.');
}}>Cancel</ActionButton>
@@ -16,7 +16,7 @@ import { SpireManaDisplay } from './SpireManaDisplay';
// ─── Derived Stats Hook ──────────────────────────────────────────────────────
function useSpireStats(prestigeUpgrades: Record<string, number>, equippedInstances: unknown[], equipmentInstances: unknown[]) {
function useSpireStats(prestigeUpgrades: Record<string, number>, equippedInstances: Record<string, string | null>, equipmentInstances: Record<string, import('@/lib/game/types').EquipmentInstance>) {
const disciplineEffects = computeDisciplineEffects();
const upgradeEffects = getUnifiedEffects({