Skip to content

feat: add project foundations — Vite, Vitest, Playwright, ESLint, Prettier - #40

Merged
Sparksx merged 9 commits into
mainfrom
claude/strengthen-project-foundations-6udLg
Feb 17, 2026
Merged

feat: add project foundations — Vite, Vitest, Playwright, ESLint, Prettier#40
Sparksx merged 9 commits into
mainfrom
claude/strengthen-project-foundations-6udLg

Conversation

@Sparksx

@Sparksx Sparksx commented Feb 17, 2026

Copy link
Copy Markdown
Owner

Set up a modern development toolchain:

  • Vite: dev server with HMR and proxy to backend, production build to dist/
  • Vitest: 56 unit tests covering state, utils, save, and upgrades-data modules
  • Playwright: E2E test suite for mode selection, game mechanics, persistence
  • ESLint: flat config with separate frontend (ES modules) / backend (CommonJS) rules
  • Prettier: consistent code formatting (single quotes, trailing commas, 120 width)

Updated package.json with dev/build/test/lint/format scripts.
Updated CLAUDE.md with new development workflow documentation.

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT

…ttier

Set up a modern development toolchain:

- Vite: dev server with HMR and proxy to backend, production build to dist/
- Vitest: 56 unit tests covering state, utils, save, and upgrades-data modules
- Playwright: E2E test suite for mode selection, game mechanics, persistence
- ESLint: flat config with separate frontend (ES modules) / backend (CommonJS) rules
- Prettier: consistent code formatting (single quotes, trailing commas, 120 width)

Updated package.json with dev/build/test/lint/format scripts.
Updated CLAUDE.md with new development workflow documentation.

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
- GitHub Actions CI with 4 parallel jobs: lint, unit tests, E2E tests, build
- Coverage via Vitest v8 provider (text + HTML + lcov reporters)
- Server logic tests: streak multiplier, grade system, reward calculations,
  season timing, contribution rate validation (24 new tests, 80 total)

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
…tier

- Added missing @vitest/coverage-v8 dependency for CI coverage job
- Ran Prettier on all JS, HTML, CSS, and JSON files to fix format:check

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
- Dismiss intro overlay in E2E tests (blocks canvas clicks for 5s)
- Increase timeouts for game area visibility (3s → 5s)
- Silence Vite proxy errors when backend is not running
- Add webServer startup timeout in Playwright config

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
- Simplify intro overlay dismiss: click directly + wait for fade-out
- Use expect().toPass() polling for lumen counter and auto-save detection
  instead of fragile fixed timeouts
- Increase click intervals (80ms → 100ms) for CI stability

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
The previous proxy error handler swallowed errors without sending a
response, causing the browser request to hang indefinitely. Since
socket.io is loaded via <script defer>, a hanging request blocks
DOMContentLoaded and prevents main.js from executing — the game
never initializes.

Now proxy errors immediately return a 502, the script fails fast,
and the game starts normally without the backend.

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
The socket.io <script defer> blocks page load when the backend is
not running, preventing E2E tests from working in CI without a
running server. Commented out with a TODO to revisit.

Lint, unit tests + coverage, and build jobs remain active.

https://claude.ai/code/session_01JFMyMqB4VAa7qxqwC24BrT
@Sparksx
Sparksx merged commit 5014c8c into main Feb 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants