- index.html (8.4k lines) becomes markup only; styles move to css/app.css
and the script to nine feature files in js/ (data, game, scoring,
render, scorecard, mlb, storage, reports, ui), loaded in order as plain
scripts sharing one global scope. Code is unchanged apart from moving
(checked character-for-character); a load-order check confirmed no code
that runs at load uses a later file.
- sw.js precaches the new files (cache scorecard-v3) and revalidates with
the server so a new page never runs with older cached scripts.
- Tests (npm test; node:test + jsdom, MLB fixtures, no network):
* all four ALDS Game 1s caught up from an empty scorecard: 0 Check vs MLB
differences, team RISP/LOB, score, every batter and pitcher line equal
to MLB's box score; a hand-scored start + mid-at-bat catch-up
* hand-scoring rules: strike three, ABS overturns, reaching on error,
double plays, outs on the bases, counts kept on runner outs, RISP,
innings pitched, inherited runners, Undo with log edits, cell editor,
loading older saved games
34 passing; GitHub Actions runs them on every push.
- README: what it does, running locally, code layout, tests, credits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
283 B
JSON
12 lines
283 B
JSON
{
|
|
"name": "baseball-scorecard",
|
|
"private": true,
|
|
"description": "Live baseball scorecard web app (no build step). These dev dependencies are only for the tests.",
|
|
"scripts": {
|
|
"test": "node --test tests/*.test.js"
|
|
},
|
|
"devDependencies": {
|
|
"jsdom": "^24.1.3"
|
|
}
|
|
}
|