dc7185c15e
Requested after Phase 2: from here on, MCMapper development follows TDD (test-first) — this retrofits the pieces already built before that request landed. worker: unit tests for the tile rasterizer (background fill, exact upscaled-block boundaries, full-grid painting, out-of-bounds columns) and the block-color palette (distinctness checks, including that the "unmapped block" placeholder never accidentally collides with a real block's color). 16 tests total alongside the existing mesher tests. api: wired up `bun test`. Unit tests for chunkOf's coordinate math. Integration tests (real Postgres/Redis/MinIO, see README's new "Running tests" section) for wsGateway.message() — auth accept/reject, upsert + dedup on columns/sections, not-authenticated/invalid-JSON handling — and for the tile/mesh/servers HTTP routes, driven through Elysia's in-process `.handle()` rather than a bound port (sidesteps the stale dev-server port-collision issue hit repeatedly this session). index.ts now exports `app` and only calls `.listen()` when run directly, specifically so tests can drive it this way. frontend: extracted mesh.js's binary-format parser into its own ESM module (mesh-format.js) so it's unit-testable without a browser/Babylon; mesh.js now imports it. Tests build a buffer independently of the parser (mirroring worker's encoder layout) so a mismatch in either direction — Rust producer or JS consumer drifting — would be caught.
24 lines
553 B
JSON
24 lines
553 B
JSON
{
|
|
"name": "@mcmapper/frontend",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "bun run --watch src/index.ts",
|
|
"start": "bun run src/index.ts",
|
|
"build:css": "tailwindcss -i src/public/css/input.css -o src/public/css/tailwind.css",
|
|
"test": "bun test"
|
|
},
|
|
"dependencies": {
|
|
"elysia": "^1.1.0",
|
|
"pug": "^3.0.3"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/cli": "^4.0.0",
|
|
"@types/pug": "^2.0.10",
|
|
"bun-types": "latest",
|
|
"tailwindcss": "^4.0.0",
|
|
"typescript": "^5.5.0"
|
|
}
|
|
}
|