Adds the multiplayer functionality the user requested:
- LobbyRoomList UI component (create / list / join via boardgame.io's
built-in Lobby REST API). Credentials are server-issued; no more hardcoded
p0/p1 in OnlineConfig.
- LobbyClient re-export wrapper in @tts-like/engine (typed factory
createLobbyClient).
- CORS origin default: dev-friendly regex list (boardgame.io's
isOriginAllowed treats literal '*' as exact-match, which silently blocks
everything; we now use RegExp matching localhost + Tauri schemes).
- War shuffle accepts an injected random fn so unit tests are deterministic;
fixed a tie-handling bug where piles were cleared without redistributing
cards (now piles stay on tie for a "war" round).
- Engine unit tests (vitest + Local master for 2-client sync):
packages/engine/src/games/{drag-test,war,mill}.test.ts (34 cases)
- Server REST tests (vitest + supertest, port 0 random):
packages/server/src/server.test.ts (9 cases)
- Playwright E2E (apps/web/e2e/*): 3 specs covering create → join →
sync for War / DragTest / Mill across two browser contexts.
- Dockerfile fix: pnpm deploy --prod leaves boardgame.io as a symlink to
.pnpm/boardgame.io@…; copy -rL materialises the dist so the runtime
image can resolve boardgame.io/server.
- Root scripts: dev:server, test:e2e, verify (ts + test + e2e).
30 lines
701 B
JSON
30 lines
701 B
JSON
{
|
|
"name": "@tts-like/web",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc --noEmit && vite build",
|
|
"preview": "vite preview",
|
|
"ts": "tsc --noEmit",
|
|
"test:e2e": "playwright test"
|
|
},
|
|
"dependencies": {
|
|
"@tts-like/engine": "workspace:*",
|
|
"@tts-like/protocol": "workspace:*",
|
|
"@tts-like/ui": "workspace:*",
|
|
"boardgame.io": "0.50.2",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.62.1",
|
|
"@types/react": "^18.3.0",
|
|
"@types/react-dom": "^18.3.0",
|
|
"@vitejs/plugin-react": "^4.3.0",
|
|
"typescript": "^5.7.0",
|
|
"vite": "^5.4.0"
|
|
}
|
|
}
|