refactor: centralize theme/config/utils + fix data and console bugs
Phase 1 of the cohesion refactor (behavior-preserving): Single source of truth: - New src/lib/theme.ts: category colors (moved from data.ts, re-exported for back-compat), derived hex strings, nebula palette, UI colors, CSS var map - New src/lib/config.ts: breakpoint, zoom, parallax, node radii, particle counts, animation timings (previously scattered magic numbers) - New src/lib/utils/tree.ts: getNodeById, getNodeRadius, getDistanceFromOrigin, getBeamIntensity (pure helpers lifted out of onMount) - New src/lib/utils/stats.ts: branch ids/labels, proficiency order, and the stats-panel aggregation helpers (deduped from inline copies) - SkillTree.svelte now imports all of the above; removed the duplicated getCategoryColorHex, stats helpers, branch id/label lists, and inline magic numbers - Populated src/lib/index.ts barrel Bug fixes: - data.ts: tmdbAPI pypiUrl pointed at tvdbAPI -> corrected to tmdbAPI - Removed/ gated stray console.log noise (skill-tree-loaded, SW logs) - Removed dead vars (maxAlpha, glowMaxAlpha) and unused catch binding Tooling: ESLint + Prettier now clean; added Vitest unit tests for the new pure utils (14 tests). svelte-check: 0 errors. build: ok. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
aa58425f1a
commit
6c652e7138
12 files changed
+491
-219
No files matched your search
@@ -6,6 +6,14 @@ export default [
|
||||
ignores: ['build/', '.svelte-kit/', 'static/', 'node_modules/']
|
||||
},
|
||||
...svelteConfig,
|
||||
{
|
||||
rules: {
|
||||
// This is a static, client-only portfolio whose links point at external
|
||||
// URLs (projects, resume, mailto). The resolve() rule targets SvelteKit
|
||||
// internal navigation, so it only produces false positives here.
|
||||
'svelte/no-navigation-without-resolve': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
// Service worker runs in a ServiceWorkerGlobalScope, not the browser/node defaults.
|
||||
files: ['static/service-worker.js'],
|
||||
|
||||
Reference in new issue
Block a user