5 Commits

Author SHA1 Message Date
3a54cdcc53 Add a Vitest unit suite for the pure-logic modules
31 tests in test/, run in a plain Node env with a tiny localStorage shim
(no jsdom — its Node-22.4 transitive-dep breakage isn't worth working
around for logic tests):

- type-chart: modern effectiveness, dual-type stacking, and the era rules
  (no Fairy pre-6, Steel resists Ghost/Dark pre-6, the Gen 1 Ghost→Psychic
  and Bug↔Poison quirks).
- damage-calc: nature multipliers, the Gen 3+ stat formula (Garchomp
  reference values), STAB/effectiveness/immunity, pre/post-Gen-6 crit.
- savedex: a synthetic Gen 1 SRAM (bitfields + checksum) round-trips;
  checksum-mismatch and size guards.
- selection: normalizeSelection v2→v3 migration, per-game isolation,
  global favourite, stats vs statsNational.
- pokedex-resolver: prettify, dex resolution against a mini snapshot.

`npm test` wired into CI after format:check.

Also: docker-compose host port 8080 → 4753 (README updated).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
2026-09-10 11:33:27 -04:00
dfd848d506 Add Prettier (config + scripts), not yet applied
printWidth 100 to stay close to the existing hand-formatting; single
quotes; trailing commas. `npm run format` / `npm run format:check`.
The formatting pass itself is the next commit so it stays isolated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
2026-09-10 11:22:46 -04:00
803ed2a988 Upgrade to Vite 6, drop unused ws dep
Vite 5 pulled esbuild 0.21.5 — the only source of the GHSA-67mh-4wv8-2f99
dev-server advisory. Vite 6.4 (esbuild 0.25) runs on the current Node
baseline and clears it: `npm audit` now reports 0 vulnerabilities.

- vite 5.4 → 6.4, vite-plugin-pwa 0.21 → 1.3 (needs Vite 6+).
- Removed `ws` from devDependencies — it was only used by throwaway test
  scripts, never the app or build.
- Build, all 14 routes, and the service worker verified on Vite 6.
- SECURITY.md / AGENTS.md updated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Ve7HLspzeG2xDPtJQ8vmu
2026-09-10 11:20:02 -04:00
f1abe07128 Add moves, evolution, type matchups, locations; game-accurate data; fix desktop layout
- Detail page: base stats, type matchups (defending), evolution chain,
  learnset with per-move power/type/acc/PP/effect, wild locations
- Game-aware: abilities gated to Gen 3+ (hidden to Gen 5+), type chart
  applies Gen 1 / pre-Gen 6 rules, move stats use PokeAPI past_values,
  pre-Gen 4 physical/special-by-type, evolution tree re-parented to the
  selected generation
- Moves and evolution clickable/expandable; no horizontal scroll
- Fix: .view-host shrink-wrapped as a grid item on desktop (margin:0 auto)
- Era-accurate sprite option; Search tab relabelled as global lookup

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-27 11:35:30 -04:00
cd2655011f Scaffold Pokedex PWA (Vite + Workbox)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-27 10:54:36 -04:00