Integrate PR #1: new client at /, original at /classic#2
Merged
Conversation
Brings in the server-side portion of PR #1 by path, leaving the original client/ untouched. Verified the original client still works against this server. - index.js: additive only — /api/create-game HTTP endpoint, bot players (add_bot/remove_bot socket events, bot_list updates, scheduled bot turns), guards against renaming/removing bots. - reducer.js: camel-movement helpers extracted into camel-movement.js. - New: bot.js, camel-movement.js, sim.js, sim-batch.js, words.js. - .npmrc: min-release-age=7 (supply-chain safety for installs). Note: the extraction is NOT purely mechanical. moveCamel's guard changed from `if (newPosition)` to `if (newPosition != null)`, fixing a latent bug where a camel landing on position 0 (a black/ white camel reversing to the start, or one pushed to 0 by a desert tile) was removed from the board and never replaced. Behavior for all other positions is unchanged; the original client renders the corrected state fine. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Nikhil Jha <nikhiljha@users.noreply.github.com>
Extracts the new React 19 + Vite client from PR #1 into its own client_v2/ directory, leaving the original hand-written client/ completely untouched. The new client will become the default (served at /), with the original served at /classic (wired up next). - Regenerated package-lock.json: the PR shipped the stale CRA lock (referenced react-scripts, no vite); npm install rebuilt it from the Vite package.json. - Builds cleanly with vite build → client_v2/dist (root-absolute asset paths, correct for serving at /). - .gitignore: ignore client_v2/node_modules and client_v2/dist. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Nikhil Jha <nikhiljha@users.noreply.github.com>
Wires up the single Express server to host both clients: - build.sh now builds client_v2 into server/static (root) and the original client into server/static/classic. The original is built with PUBLIC_URL=/classic so its CRA assets resolve under that path. - index.js mounts static/classic at /classic ahead of the root static mount. Both clients read the game id from the ?game= query string (not the path) and connect their socket same-origin in production, so serving the original under a /classic prefix needs no client code changes. Verified against a production-mode server: / and /classic both load, their assets return 200, /api/create-game and socket.io work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Nikhil Jha <nikhiljha@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates the work from #1 while preserving the original hand-written client. Instead of replacing the client in place (as #1 did), this keeps the original untouched and adds the new one alongside it.
What's here
Server (
5570df2) — merges the server-side changes from #1: bot players (add_bot/remove_bot, scheduled bot turns), an/api/create-gameendpoint, and extraction of the camel-movement helpers intocamel-movement.js. All changes are additive except one latent bug fix noted below. The original client was verified working against this server.New client (
4e3238f) — the React 19 + Vite client from #1, extracted into a newclient_v2/directory. The originalclient/is left completely untouched. Regeneratedpackage-lock.json(the PR shipped the stale create-react-app lockfile, which referencedreact-scriptsand no Vite).Serving (
e8ad23a) — one Express server hosts both://classicbuild.shbuilds both intoserver/static(original built withPUBLIC_URL=/classicso its assets resolve under the prefix). Noapp.yamlchange needed. Both clients key off the?game=query string and connect their socket same-origin, so the original needs no code changes to run under/classic.Heads up: server behavior change
The camel-movement extraction is not purely mechanical —
moveCamel's guard changed fromif (newPosition)toif (newPosition != null). This fixes a latent bug where a camel landing on position 0 (a black/white camel reversing to the start, or one pushed to 0 by a desert tile) was removed from the board and never replaced. Behavior at all other positions is unchanged.Testing
Verified against a production-mode server:
/and/classicboth load, their assets return 200, and/api/create-game+ socket.io work. Original client also manually tested against the updated server.Co-authored with the original PR author (@nikhiljha).
🤖 Generated with Claude Code