mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 08:45:50 +00:00
refactor: 清理未使用 import 和添加 spriteCache 错误日志
- SpeciesDetail.tsx: 移除未使用的 SPECIES_PERSONALITY import - CompanionCard.tsx: 移除未使用的 SPECIES_I18N import - spriteCache.ts: 空 catch 块添加错误日志输出 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,8 @@ export function loadSprite(speciesId: SpeciesId): SpriteCache | null {
|
|||||||
try {
|
try {
|
||||||
const raw = readFileSync(filePath, 'utf-8')
|
const raw = readFileSync(filePath, 'utf-8')
|
||||||
return JSON.parse(raw) as SpriteCache
|
return JSON.parse(raw) as SpriteCache
|
||||||
} catch {
|
} catch (e) {
|
||||||
|
console.error(`[buddy] Failed to load sprite cache for ${speciesId}:`, e)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,7 +74,8 @@ export async function fetchAndCacheSprite(speciesId: SpeciesId): Promise<SpriteC
|
|||||||
writeFileSync(filePath, JSON.stringify(sprite, null, 2))
|
writeFileSync(filePath, JSON.stringify(sprite, null, 2))
|
||||||
|
|
||||||
return sprite
|
return sprite
|
||||||
} catch {
|
} catch (e) {
|
||||||
|
console.error(`[buddy] Failed to fetch sprite for ${speciesId}:`, e)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Box, Text, type Color } from '@anthropic/ink'
|
|||||||
import type { BuddyData, Creature, SpeciesId } from '../types'
|
import type { BuddyData, Creature, SpeciesId } from '../types'
|
||||||
import { STAT_NAMES, STAT_LABELS } from '../types'
|
import { STAT_NAMES, STAT_LABELS } from '../types'
|
||||||
import { getSpeciesData } from '../data/species'
|
import { getSpeciesData } from '../data/species'
|
||||||
import { SPECIES_I18N, SPECIES_PERSONALITY } from '../data/names'
|
import { SPECIES_PERSONALITY } from '../data/names'
|
||||||
import { calculateStats, getCreatureName, getTotalEV } from '../core/creature'
|
import { calculateStats, getCreatureName, getTotalEV } from '../core/creature'
|
||||||
import { getXpProgress } from '../core/experience'
|
import { getXpProgress } from '../core/experience'
|
||||||
import { getEVSummary } from '../core/effort'
|
import { getEVSummary } from '../core/effort'
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { Box, Text, type Color } from '@anthropic/ink'
|
|||||||
import type { SpeciesId, StatName } from '../types'
|
import type { SpeciesId, StatName } from '../types'
|
||||||
import { STAT_NAMES, STAT_LABELS } from '../types'
|
import { STAT_NAMES, STAT_LABELS } from '../types'
|
||||||
import { getSpeciesData } from '../data/species'
|
import { getSpeciesData } from '../data/species'
|
||||||
import { SPECIES_PERSONALITY } from '../data/names'
|
|
||||||
import { getNextEvolution } from '../data/evolution'
|
import { getNextEvolution } from '../data/evolution'
|
||||||
import { StatBar } from './StatBar'
|
import { StatBar } from './StatBar'
|
||||||
import { getStatColor } from './shared'
|
import { getStatColor } from './shared'
|
||||||
|
|||||||
Reference in New Issue
Block a user