diff --git a/.dockerignore b/.dockerignore index 2bd8264..4c16ffc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -# The server image only needs `shared/` and `backend/`. **/node_modules **/dist **/lib diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 1136a06..dc0929c 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -13,7 +13,6 @@ concurrency: cancel-in-progress: true jobs: - # ---- Static website -> /pages mount on the runner host -------------------- website: name: Build & deploy website runs-on: docker @@ -45,11 +44,9 @@ jobs: source: frontend/dist target: declared - # ---- Server Docker image -> Forgejo container registry -------------------- server-image: name: Build & publish server image runs-on: docker - # No registry push on PRs; build validation still happens in the website job. if: github.event_name != 'pull_request' steps: - name: Checkout diff --git a/.vscode/launch.json b/.vscode/launch.json index 3b0b653..a685a4c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,7 +1,4 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { diff --git a/Dockerfile b/Dockerfile index 327d1f2..8c283ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,6 @@ # syntax=docker/dockerfile:1 -# doppler game server (the `doppler-server` package). -# The frontend is a static site and is NOT built here — see .forgejo/workflows. - -# ---- Stage 1: build the shared lib, then bundle the server ------------------- -# Node 22 (current LTS) matches the project toolchain (webpack 5 / TypeScript 6, -# see .devcontainer). The full (non-slim) image carries the build tools that -# socket.io's optional native deps (bufferutil/utf-8-validate) compile against. +# The full image carries the build tools for socket.io's optional native dependencies. FROM node:22-bookworm AS build WORKDIR /app @@ -17,7 +11,6 @@ RUN cd shared && npm install COPY shared/ shared/ RUN cd shared && npm run build -# Install the backend deps. `file:../shared` now resolves to the built /app/shared. COPY backend/package.json backend/ RUN cd backend && npm install COPY backend/ backend/ @@ -27,12 +20,10 @@ RUN cd backend && npm run build # left external (express, socket.io, cors, gl-matrix, minimist, msgpack parser). RUN cd backend && npm prune --production -# ---- Stage 2: minimal runtime ---------------------------------------------- FROM node:22-bookworm-slim WORKDIR /app ENV NODE_ENV=production -# Run as an unprivileged user. RUN groupadd -r app && useradd -r -g app -d /app app COPY --from=build /app/backend/dist ./dist @@ -41,7 +32,6 @@ COPY --from=build /app/backend/node_modules ./node_modules USER app EXPOSE 3000 -# Hits the same /state endpoint the website polls (see serverInformationEndpoint). HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ CMD node -e "require('http').get('http://localhost:3000/state',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))" diff --git a/frontend/src/main.scss b/frontend/src/main.scss index 021ab71..b9c6a92 100644 --- a/frontend/src/main.scss +++ b/frontend/src/main.scss @@ -230,8 +230,6 @@ body { } } - // Top-down radar of the whole arena (see Minimap). The circular border is - // the world boundary; dots are painted onto the canvas. .minimap { top: $small-padding; left: $small-padding; @@ -252,7 +250,6 @@ body { z-index: 100; } - // Off-screen pointer to the keystone "Heart", tinted by its current owner. .keystone-arrow { opacity: 0.9; @@ -330,8 +327,6 @@ body { content: '\25C9'; } - // Twin-stick aim indicator: drawn from the button centre toward the - // current drag direction while aiming a shot (see TouchListener). .aim-line { position: absolute; left: 50%; @@ -735,8 +730,6 @@ body { } } - // Centred "Eliminated" overlay shown while the local player is dead; the - // respawn countdown is the server-driven "Reviving in N…" announcement. .elimination { position: absolute; top: 42%; @@ -959,4 +952,4 @@ body { color: #f2c9c7; font-size: 0.85rem; text-align: center; -} \ No newline at end of file +} diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index b57b543..4bbc556 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -75,7 +75,6 @@ module.exports = (env, argv) => { ], }, { - // svg-url-loader emits a CJS module that css-loader 7 writes out verbatim. test: /\.svg$/, type: 'asset/inline', }, diff --git a/shared/src/physics/resolve-circle-movement.ts b/shared/src/physics/resolve-circle-movement.ts index c3c477c..724c8ab 100644 --- a/shared/src/physics/resolve-circle-movement.ts +++ b/shared/src/physics/resolve-circle-movement.ts @@ -13,7 +13,6 @@ export const resolveCircleMovement = ( let remainingSeconds = deltaTimeInSeconds; let firstHit: Sdf | undefined; - // Resolve at most two contacts per step, spending only the time left after each hit. for (let pass = 0; pass < 2 && remainingSeconds > 0; pass++) { const speed = vec2.length(body.velocity); if (speed === 0) { diff --git a/test/render-smoothness.test.ts b/test/render-smoothness.test.ts index 2b145b9..1e65de9 100644 --- a/test/render-smoothness.test.ts +++ b/test/render-smoothness.test.ts @@ -64,7 +64,6 @@ interface Result { maximumSpeed: number; } -// Exercise shared movement with independent server, network, and render clocks. // Measure world travel: the camera tracks the local character exactly, so measuring // their relative position would always report zero even when the world visibly stutters. const measure = ({ @@ -96,7 +95,6 @@ const measure = ({ const predictor = new LocalCharacterPredictor(); predictor.setStrength(settings.playerMaxStrength); - // Deterministic frame-time noise: a real display never delivers a perfectly even cadence. let seed = 12345; const random = () => (seed = (seed * 1103515245 + 12345) & 0x7fffffff) / 0x7fffffff; diff --git a/test/suspended-rendering.test.ts b/test/suspended-rendering.test.ts index a1ae8a5..92b777b 100644 --- a/test/suspended-rendering.test.ts +++ b/test/suspended-rendering.test.ts @@ -61,7 +61,6 @@ function character(id = 1) { step: vi.fn(), render: vi.fn(), beforeDestroy: vi.fn(), - // A health setter also represents damage sound/flash feedback in CharacterView. setHealth: vi.fn((health: number) => (object.health = health)), onShoot: vi.fn(), onDie: vi.fn(), @@ -126,7 +125,6 @@ describe('suspended rendering', () => { expect(survivor.onShoot).not.toHaveBeenCalled(); expect(retained(container).remoteCalls.length).toBeLessThanOrEqual(3); - // With no additional effects, subsequent snapshots retire the entire old tail. snapshot(container, 46); expect(container.planets).toHaveLength(0); expect(retained(container).objects.size).toBe(1);