src/contains all TypeScript source code. Core areas includesrc/model(physics),src/view(rendering/UI),src/controller(state system/input/game flow), andsrc/network(multiplayer).test/contains Jest tests organized by domain.dist/holds built artifacts and assets used for deployment (models, HTML, CSS, images).dist/index.htmlis the main game page.
yarn servestarts the webpack dev server; openhttp://localhost:8080/.yarn buildproduces a production build via webpack.yarn testruns Jest with the repo’s config.yarn coverageruns Jest with coverage reporting.yarn lintrunstsc --noEmitand ESLint.yarn prettifyformats JS/TS/JSON/CSS/HTML and caches results.
- TypeScript is the primary language; keep types explicit at public boundaries.
- Indentation follows the existing codebase (2 spaces in TS/JS files) no semicolons.
- Filenames are lower-case and descriptive. Tests use
*.spec.ts(e.g.,test/model/cushion.spec.ts). - Always run ESLint and Prettier after changes
yarn lintandyarn prettify.
- Jest is the test runner; configuration is in
test/jest.config.js. - Add tests alongside the affected domain (e.g., physics changes in
test/model). - Run
yarn testlocally before submitting;yarn coveragefor deeper validation. - After making changes, run
yarn lintandyarn test.
- Node/Yarn usage matches the README instructions (Yarn 1.x; see
package.jsonengines).
Before submitting changes, ensure the following commands pass:
- Build:
yarn dev - Test:
yarn test - Format:
yarn prettify