Spaces:
Running
Running
Commit
·
231c65e
1
Parent(s):
c355051
Fix Docker build: ESM backend, exclude config.ts, fix type errors
Browse files
trigo-web/backend/src/sockets/gameSocket.ts
CHANGED
|
@@ -67,7 +67,7 @@ export function setupSocketHandlers(io: Server, socket: Socket, gameManager: Gam
|
|
| 67 |
|
| 68 |
// Get player list with colors
|
| 69 |
const players: { [playerId: string]: { nickname: string; color: "black" | "white" } } = {};
|
| 70 |
-
for (const [pid, player] of Object.entries(room.players)) {
|
| 71 |
players[pid] = {
|
| 72 |
nickname: player.nickname,
|
| 73 |
color: player.color
|
|
|
|
| 67 |
|
| 68 |
// Get player list with colors
|
| 69 |
const players: { [playerId: string]: { nickname: string; color: "black" | "white" } } = {};
|
| 70 |
+
for (const [pid, player] of Object.entries(room.players) as [string, { nickname: string; color: "black" | "white" }][]) {
|
| 71 |
players[pid] = {
|
| 72 |
nickname: player.nickname,
|
| 73 |
color: player.color
|
trigo-web/backend/tsconfig.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"compilerOptions": {
|
| 3 |
"target": "ES2020",
|
| 4 |
-
"module": "
|
| 5 |
"lib": ["ES2020"],
|
| 6 |
"outDir": "./dist",
|
| 7 |
"rootDir": "../",
|
|
@@ -9,7 +9,7 @@
|
|
| 9 |
"esModuleInterop": true,
|
| 10 |
"skipLibCheck": true,
|
| 11 |
"forceConsistentCasingInFileNames": true,
|
| 12 |
-
"moduleResolution": "
|
| 13 |
"resolveJsonModule": true,
|
| 14 |
"declaration": true,
|
| 15 |
"declarationMap": true,
|
|
@@ -19,11 +19,11 @@
|
|
| 19 |
"noImplicitAny": false
|
| 20 |
},
|
| 21 |
"include": ["src/**/*", "../inc/**/*"],
|
| 22 |
-
"exclude": ["node_modules", "dist", "../inc/trigo/parserInit.ts", "../inc/tgn/tgn.jison.cjs"],
|
| 23 |
"ts-node": {
|
| 24 |
-
"esm":
|
| 25 |
"compilerOptions": {
|
| 26 |
-
"module": "
|
| 27 |
}
|
| 28 |
}
|
| 29 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"compilerOptions": {
|
| 3 |
"target": "ES2020",
|
| 4 |
+
"module": "ESNext",
|
| 5 |
"lib": ["ES2020"],
|
| 6 |
"outDir": "./dist",
|
| 7 |
"rootDir": "../",
|
|
|
|
| 9 |
"esModuleInterop": true,
|
| 10 |
"skipLibCheck": true,
|
| 11 |
"forceConsistentCasingInFileNames": true,
|
| 12 |
+
"moduleResolution": "bundler",
|
| 13 |
"resolveJsonModule": true,
|
| 14 |
"declaration": true,
|
| 15 |
"declarationMap": true,
|
|
|
|
| 19 |
"noImplicitAny": false
|
| 20 |
},
|
| 21 |
"include": ["src/**/*", "../inc/**/*"],
|
| 22 |
+
"exclude": ["node_modules", "dist", "../inc/trigo/parserInit.ts", "../inc/tgn/tgn.jison.cjs", "../inc/config.ts"],
|
| 23 |
"ts-node": {
|
| 24 |
+
"esm": true,
|
| 25 |
"compilerOptions": {
|
| 26 |
+
"module": "ESNext"
|
| 27 |
}
|
| 28 |
}
|
| 29 |
}
|