33d5d55c33
Per Codex's Phase 2 audit notes. Moved the drag-snap (lineFrom) and find-match (matchWord) logic into $lib/wordsearch.js and added vitest coverage: - lineFrom always yields a straight, in-bounds path — a non-straight drag snaps, never returns bent; single cell and edge-clamping covered. - matchWord matches forward + reversed selections, is a harmless no-op on an already-found word (so completion/best-time can't double-record), and returns null for non-words / too-short selections. Restore behaviour audited: finish() (which records best-time) only runs when the final word is found mid-play; on refresh, restore() repopulates found cells + time and the derived status flips to done WITHOUT calling finish(), so best-time never re-records. First JS test runner for the frontend (npm test → vitest run). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
482 B
JSON
22 lines
482 B
JSON
{
|
|
"name": "goodnews-web",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev --host",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"test": "vitest run"
|
|
},
|
|
"devDependencies": {
|
|
"@sveltejs/adapter-static": "^3.0.6",
|
|
"@sveltejs/kit": "^2.8.0",
|
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
"an-array-of-english-words": "^2.0.0",
|
|
"svelte": "^5.1.0",
|
|
"vite": "^6.0.0",
|
|
"vitest": "^4.1.8"
|
|
}
|
|
}
|