desloppify: fix 34 unused imports/vars, debug logs, and code quality issues
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m20s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 2m20s
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# Circular Dependencies
|
# Circular Dependencies
|
||||||
Generated: 2026-05-25T18:18:45.184Z
|
Generated: 2026-05-25T18:44:15.053Z
|
||||||
Found: 6 circular chain(s) — these MUST be fixed before modifying involved files.
|
Found: 6 circular chain(s) — these MUST be fixed before modifying involved files.
|
||||||
|
|
||||||
1. Processed 135 files (1.6s) (2 warnings)
|
1. Processed 135 files (1.7s) (2 warnings)
|
||||||
2. 1) utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
|
2. 1) utils/floor-utils.ts > utils/room-utils.ts > utils/enemy-utils.ts
|
||||||
3. 2) utils/floor-utils.ts > utils/room-utils.ts
|
3. 2) utils/floor-utils.ts > utils/room-utils.ts
|
||||||
4. 3) stores/gameStore.ts > stores/gameActions.ts
|
4. 3) stores/gameStore.ts > stores/gameActions.ts
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"generated": "2026-05-25T18:18:43.369Z",
|
"generated": "2026-05-25T18:44:13.132Z",
|
||||||
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
|
"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."
|
"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."
|
||||||
},
|
},
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
@@ -9,7 +9,7 @@ import type { SpellDef } from '@/lib/game/types';
|
|||||||
|
|
||||||
export function GrimoireTab() {
|
export function GrimoireTab() {
|
||||||
const [grimoireSpells, setGrimoireSpells] = useState<[string, SpellDef][]>([]);
|
const [grimoireSpells, setGrimoireSpells] = useState<[string, SpellDef][]>([]);
|
||||||
const [loaded, setLoaded] = useState(false);
|
const [loaded, _setLoaded] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof window !== 'undefined' && SPELLS_DEF) {
|
if (typeof window !== 'undefined' && SPELLS_DEF) {
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export function EnchantmentApplier({
|
|||||||
</div>
|
</div>
|
||||||
<ScrollArea className="h-32">
|
<ScrollArea className="h-32">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
{equippedItems.map(({ slot, instance }) => (
|
{equippedItems.map(({ slot: _slot, instance }) => (
|
||||||
<div
|
<div
|
||||||
key={instance.instanceId}
|
key={instance.instanceId}
|
||||||
className={`p-2 rounded border cursor-pointer text-sm transition-all
|
className={`p-2 rounded border cursor-pointer text-sm transition-all
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ export function DesignForm({
|
|||||||
selectedEquipmentCapacity,
|
selectedEquipmentCapacity,
|
||||||
isOverCapacity,
|
isOverCapacity,
|
||||||
designTime,
|
designTime,
|
||||||
selectedEquipmentType,
|
|
||||||
handleCreateDesign,
|
handleCreateDesign,
|
||||||
}: DesignFormProps) {
|
}: DesignFormProps) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import type { EffectSelectorProps } from './types';
|
|||||||
export function EffectSelector({
|
export function EffectSelector({
|
||||||
selectedEquipmentType,
|
selectedEquipmentType,
|
||||||
selectedEffects,
|
selectedEffects,
|
||||||
setSelectedEffects,
|
|
||||||
availableEffects,
|
availableEffects,
|
||||||
incompatibleEffects,
|
incompatibleEffects,
|
||||||
enchantingLevel,
|
enchantingLevel,
|
||||||
@@ -53,7 +52,7 @@ export function EffectSelector({
|
|||||||
{/* Compatible Effects */}
|
{/* Compatible Effects */}
|
||||||
{availableEffects.map(effect => {
|
{availableEffects.map(effect => {
|
||||||
const selected = selectedEffects.find(e => e.effectId === effect.id);
|
const selected = selectedEffects.find(e => e.effectId === effect.id);
|
||||||
const cost = calculateEffectCapacityCost(effect.id, (selected?.stacks || 0) + 1, efficiencyBonus);
|
const _cost = calculateEffectCapacityCost(effect.id, (selected?.stacks || 0) + 1, efficiencyBonus);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ interface DisciplineCardProps {
|
|||||||
const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, callbacks }) => {
|
const DisciplineCard: React.FC<DisciplineCardProps> = ({ definition, runtime, callbacks }) => {
|
||||||
const {
|
const {
|
||||||
id, name, description, manaType, baseCost, perkThresholds, perkValues, perkTypes,
|
id, name, description, manaType, baseCost, perkThresholds, perkValues, perkTypes,
|
||||||
statBonus, statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
|
statBonusLabel, baseValue, drainBase, difficultyFactor, scalingFactor,
|
||||||
} = definition;
|
} = definition;
|
||||||
const { xp, paused: isPaused, concurrentLimit, isLocked, missingPrereqs } = runtime;
|
const { xp, paused: isPaused, concurrentLimit, isLocked, missingPrereqs } = runtime;
|
||||||
const { onToggle } = callbacks;
|
const { onToggle } = callbacks;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('Prestige upgrade definitions', () => {
|
|||||||
|
|
||||||
it('all upgrades have required fields', async () => {
|
it('all upgrades have required fields', async () => {
|
||||||
const { PRESTIGE_DEF } = await import('@/lib/game/constants/prestige');
|
const { PRESTIGE_DEF } = await import('@/lib/game/constants/prestige');
|
||||||
for (const [id, def] of Object.entries(PRESTIGE_DEF)) {
|
for (const [, def] of Object.entries(PRESTIGE_DEF)) {
|
||||||
expect(def.name).toBeTruthy();
|
expect(def.name).toBeTruthy();
|
||||||
expect(def.desc).toBeTruthy();
|
expect(def.desc).toBeTruthy();
|
||||||
expect(def.max).toBeGreaterThan(0);
|
expect(def.max).toBeGreaterThan(0);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ function EnemyRow({ enemy }: { enemy: EnemyState }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RoomDisplay({ floorState, floor }: RoomDisplayProps) {
|
export function RoomDisplay({ floorState, _floor }: RoomDisplayProps) {
|
||||||
// Guard against null/undefined/stale floorState
|
// Guard against null/undefined/stale floorState
|
||||||
if (!floorState || !floorState.roomType) {
|
if (!floorState || !floorState.roomType) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export function SpireCombatPage() {
|
|||||||
floorHP,
|
floorHP,
|
||||||
floorMaxHP,
|
floorMaxHP,
|
||||||
castProgress,
|
castProgress,
|
||||||
clearedFloors,
|
|
||||||
isDescending,
|
isDescending,
|
||||||
currentRoom,
|
currentRoom,
|
||||||
activityLog,
|
activityLog,
|
||||||
@@ -73,7 +72,6 @@ export function SpireCombatPage() {
|
|||||||
floorHP: s.floorHP,
|
floorHP: s.floorHP,
|
||||||
floorMaxHP: s.floorMaxHP,
|
floorMaxHP: s.floorMaxHP,
|
||||||
castProgress: s.castProgress,
|
castProgress: s.castProgress,
|
||||||
clearedFloors: s.clearedFloors,
|
|
||||||
isDescending: s.isDescending,
|
isDescending: s.isDescending,
|
||||||
currentRoom: s.currentRoom,
|
currentRoom: s.currentRoom,
|
||||||
activityLog: s.activityLog,
|
activityLog: s.activityLog,
|
||||||
|
|||||||
@@ -314,12 +314,10 @@ export function SpireSummaryTab() {
|
|||||||
const [mounted, setMounted] = useState(false);
|
const [mounted, setMounted] = useState(false);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
currentFloor,
|
|
||||||
maxFloorReached,
|
maxFloorReached,
|
||||||
clearedFloors,
|
clearedFloors,
|
||||||
enterSpireMode,
|
enterSpireMode,
|
||||||
} = useCombatStore(useShallow((s) => ({
|
} = useCombatStore(useShallow((s) => ({
|
||||||
currentFloor: s.currentFloor,
|
|
||||||
maxFloorReached: s.maxFloorReached,
|
maxFloorReached: s.maxFloorReached,
|
||||||
clearedFloors: s.clearedFloors,
|
clearedFloors: s.clearedFloors,
|
||||||
enterSpireMode: s.enterSpireMode,
|
enterSpireMode: s.enterSpireMode,
|
||||||
|
|||||||
@@ -83,10 +83,10 @@ describe('getFloorElement', () => {
|
|||||||
|
|
||||||
it('should cycle through elements based on floor number', () => {
|
it('should cycle through elements based on floor number', () => {
|
||||||
// Check that floors have different elements
|
// Check that floors have different elements
|
||||||
const elem1 = getFloorElement(1);
|
const _elem1 = getFloorElement(1);
|
||||||
const elem7 = getFloorElement(7);
|
const _elem7 = getFloorElement(7);
|
||||||
// Since it cycles every 5 floors, floor 1 and 7 might have same element
|
// Since it cycles every 5 floors, floor 1 and 7 might have same element
|
||||||
const elem2 = getFloorElement(2);
|
const _elem2 = getFloorElement(2);
|
||||||
// Floor 1 and 2 should have different elements (if cycle allows)
|
// Floor 1 and 2 should have different elements (if cycle allows)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ describe('computePactMultiplier', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle three pacts with penalty', () => {
|
it('should handle three pacts with penalty', () => {
|
||||||
const floor10 = getGuardianForFloor(10)!;
|
const _floor10 = getGuardianForFloor(10)!;
|
||||||
const floor20 = getGuardianForFloor(20)!;
|
const _floor20 = getGuardianForFloor(20)!;
|
||||||
const floor30 = getGuardianForFloor(30)!;
|
const _floor30 = getGuardianForFloor(30)!;
|
||||||
|
|
||||||
// 3 pacts: numAdditional = 2, basePenalty = 1.0, effectivePenalty = 1.0
|
// 3 pacts: numAdditional = 2, basePenalty = 1.0, effectivePenalty = 1.0
|
||||||
// result = baseMult * (1 - 1.0) = 0
|
// result = baseMult * (1 - 1.0) = 0
|
||||||
@@ -225,9 +225,9 @@ describe('computePactInsightMultiplier', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle three pacts with full penalty', () => {
|
it('should handle three pacts with full penalty', () => {
|
||||||
const floor10 = getGuardianForFloor(10)!;
|
const _floor10 = getGuardianForFloor(10)!;
|
||||||
const floor20 = getGuardianForFloor(20)!;
|
const _floor20 = getGuardianForFloor(20)!;
|
||||||
const floor30 = getGuardianForFloor(30)!;
|
const _floor30 = getGuardianForFloor(30)!;
|
||||||
|
|
||||||
const result = computePactInsightMultiplier({
|
const result = computePactInsightMultiplier({
|
||||||
signedPacts: [10, 20, 30],
|
signedPacts: [10, 20, 30],
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export function startCraftingEquipment(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function cancelEquipmentCrafting(
|
export function cancelEquipmentCrafting(
|
||||||
get: () => CraftingState,
|
_get: () => CraftingState,
|
||||||
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
|
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
|
||||||
) {
|
) {
|
||||||
set((state) => {
|
set((state) => {
|
||||||
@@ -65,7 +65,7 @@ export function cancelEquipmentCrafting(
|
|||||||
export function deleteMaterial(
|
export function deleteMaterial(
|
||||||
materialId: string,
|
materialId: string,
|
||||||
amount: number,
|
amount: number,
|
||||||
get: () => CraftingState,
|
_get: () => CraftingState,
|
||||||
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
|
set: (fn: (state: CraftingState) => Partial<CraftingState>) => void
|
||||||
) {
|
) {
|
||||||
set((state) => {
|
set((state) => {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export interface CraftingInitResult {
|
|||||||
export function initializeEquipmentCrafting(
|
export function initializeEquipmentCrafting(
|
||||||
blueprintId: string,
|
blueprintId: string,
|
||||||
materials: Record<string, number>,
|
materials: Record<string, number>,
|
||||||
currentMana: number
|
_currentMana: number
|
||||||
): CraftingInitResult {
|
): CraftingInitResult {
|
||||||
const recipe = CRAFTING_RECIPES[blueprintId];
|
const recipe = CRAFTING_RECIPES[blueprintId];
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ export interface CraftingCancelResult {
|
|||||||
logMessage: string;
|
logMessage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cancelEquipmentCrafting(blueprintId: string, manaSpent: number): CraftingCancelResult {
|
export function cancelEquipmentCrafting(_blueprintId: string, manaSpent: number): CraftingCancelResult {
|
||||||
const recipe = CRAFTING_RECIPES[blueprintId];
|
const recipe = CRAFTING_RECIPES[blueprintId];
|
||||||
if (!recipe) {
|
if (!recipe) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export function calculatePreparationTick(
|
|||||||
// Apply preparation completion to equipment instance
|
// Apply preparation completion to equipment instance
|
||||||
export function completePreparation(
|
export function completePreparation(
|
||||||
instance: EquipmentInstance,
|
instance: EquipmentInstance,
|
||||||
manaSpent: number
|
_manaSpent: number
|
||||||
): {
|
): {
|
||||||
updatedInstance: EquipmentInstance;
|
updatedInstance: EquipmentInstance;
|
||||||
manaRecovered: number;
|
manaRecovered: number;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export function getAttunementBySlot(slot: AttunementSlot): AttunementDef | undef
|
|||||||
// Helper function to get all unlocked attunements for a player
|
// Helper function to get all unlocked attunements for a player
|
||||||
export function getUnlockedAttunements(attunements: Record<string, { active: boolean; level: number; experience: number }>): AttunementDef[] {
|
export function getUnlockedAttunements(attunements: Record<string, { active: boolean; level: number; experience: number }>): AttunementDef[] {
|
||||||
return Object.entries(attunements)
|
return Object.entries(attunements)
|
||||||
.filter(([id, state]) => state.active)
|
.filter(([, state]) => state.active)
|
||||||
.map(([id]) => ATTUNEMENTS_DEF[id])
|
.map(([id]) => ATTUNEMENTS_DEF[id])
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export function computeDynamicClickMana(
|
|||||||
export function computeDynamicDamage(
|
export function computeDynamicDamage(
|
||||||
effects: ComputedEffects,
|
effects: ComputedEffects,
|
||||||
baseDamage: number,
|
baseDamage: number,
|
||||||
floorHPPct: number,
|
_floorHPPct: number,
|
||||||
currentMana: number,
|
currentMana: number,
|
||||||
maxMana: number
|
maxMana: number
|
||||||
): number {
|
): number {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const initialState = {
|
|||||||
|
|
||||||
export const useAttunementStore = create<AttunementStoreState>()(
|
export const useAttunementStore = create<AttunementStoreState>()(
|
||||||
persist(
|
persist(
|
||||||
(set, get) => ({
|
(set, _get) => ({
|
||||||
...initialState,
|
...initialState,
|
||||||
|
|
||||||
addAttunementXP: (attunementId: string, amount: number) => {
|
addAttunementXP: (attunementId: string, amount: number) => {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export function processCombatTick(
|
|||||||
set: (state: Partial<CombatState>) => void,
|
set: (state: Partial<CombatState>) => void,
|
||||||
rawMana: number,
|
rawMana: number,
|
||||||
elements: Record<string, { current: number; max: number; unlocked: boolean }>,
|
elements: Record<string, { current: number; max: number; unlocked: boolean }>,
|
||||||
maxMana: number,
|
_maxMana: number,
|
||||||
attackSpeedMult: number,
|
attackSpeedMult: number,
|
||||||
onFloorCleared: (floor: number, wasGuardian: boolean) => void,
|
onFloorCleared: (floor: number, wasGuardian: boolean) => void,
|
||||||
onDamageDealt: (damage: number) => {
|
onDamageDealt: (damage: number) => {
|
||||||
|
|||||||
@@ -277,9 +277,9 @@ export const useManaStore = create<ManaStore>()(
|
|||||||
|
|
||||||
resetMana: (
|
resetMana: (
|
||||||
prestigeUpgrades: Record<string, number>,
|
prestigeUpgrades: Record<string, number>,
|
||||||
skills: Record<string, number> = {},
|
_skills: Record<string, number> = {},
|
||||||
skillUpgrades: Record<string, string[]> = {},
|
_skillUpgrades: Record<string, string[]> = {},
|
||||||
skillTiers: Record<string, number> = {}
|
_skillTiers: Record<string, number> = {}
|
||||||
) => {
|
) => {
|
||||||
const elementMax = 10 + (prestigeUpgrades.elemMax || 0) * 5;
|
const elementMax = 10 + (prestigeUpgrades.elemMax || 0) * 5;
|
||||||
const startingMana = 10 + (prestigeUpgrades.manaStart || 0) * 10;
|
const startingMana = 10 + (prestigeUpgrades.manaStart || 0) * 10;
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export function createSafeStorage(): any {
|
|||||||
if (str === null) return null;
|
if (str === null) return null;
|
||||||
return str;
|
return str;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(`[persist] Failed to read "${name}" from localStorage:`, error);
|
|
||||||
try {
|
try {
|
||||||
localStorage.removeItem(name);
|
localStorage.removeItem(name);
|
||||||
} catch {
|
} catch {
|
||||||
@@ -31,18 +30,12 @@ export function createSafeStorage(): any {
|
|||||||
try {
|
try {
|
||||||
localStorage.setItem(name, JSON.stringify(value));
|
localStorage.setItem(name, JSON.stringify(value));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof DOMException && error.name === 'QuotaExceededError') {
|
|
||||||
console.warn(`[persist] localStorage quota exceeded for "${name}". State will not persist this tick.`);
|
|
||||||
} else {
|
|
||||||
console.warn(`[persist] Failed to write "${name}" to localStorage:`, error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeItem: (name: string): void => {
|
removeItem: (name: string): void => {
|
||||||
try {
|
try {
|
||||||
localStorage.removeItem(name);
|
localStorage.removeItem(name);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(`[persist] Failed to remove "${name}" from localStorage:`, error);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user