3 Commits
Author SHA1 Message Date
tiennm99 3584d897c1 build(deps): upgrade web to SvelteKit 3 and vitest 5
Move the SvelteKit config into vite.config.js, replace the $lib alias with
#lib subpath imports (dropping the vitest alias), extend $app/tsconfig, and
pass asset() paths without a leading slash. Drop the @babel/core and js-yaml
overrides, which no longer match anything in the tree.
2026-10-03 13:12:03 +07:00
tiennm99 078d80c962 refactor: port lib layer to src/lib
classic-mode.js moves byte-for-byte. champion-data.js swaps the Next.js
env-var fetch prefix for asset() from $app/paths, which resolves to
/champions.json in dev and /loldle/champions.json in the deployed build.
getChampionImageUrl keeps returning an absolute Data Dragon URL, unwrapped.

Drops three exports with no callers: getAllChampions, getChampionByName,
getGuessedNames.

The characterization suite passes unchanged against the new location -- only
import specifiers moved, no assertions touched.
2026-07-25 11:01:40 +07:00
tiennm99 d0c75e84b1 test: add characterization tests for lib layer
Cover classic-mode comparison rules, game-engine state machine and
localStorage persistence, and champion-data search/seeding/loading with
Vitest. Storage keys are asserted literally so returning players' saved
games and stats cannot silently break.

Node environment with a hand-rolled localStorage stub; fixtures are four
hand-written champions so the weekly data sync cannot destabilise the
suite.
2026-07-25 10:54:36 +07:00