mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-14 07:54:50 +00:00
refactor: rename core-public -> engine-public; fold helpers in; drop shared
Tighten the package model around the determinism invariant: everything the
engine imports must itself be deterministic.
- Rename core-public -> engine-public (package, dir, `engine-public/*` alias,
all 118 import sites). It is the deterministic public surface the engine
depends on and that client/server also use.
- Move the pure formatting helpers (renderNumber/renderTroops) from shared
into engine-public/format — the engine uses them and they're deterministic.
- Drop the now-empty shared package (and its alias). `shared` was intended for
client/server-shared, engine-forbidden code; there is none yet, so it is
removed and can be re-added when such code appears.
Final graph: engine-public (leaf) <- engine <- {client, server};
client/server also -> engine-public.
Verified: tsc clean; 1364 + 65 tests pass; prod build succeeds; engine-public
is a leaf; engine has no client/server imports. Lockfile regenerated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a7f992e9b0
commit
43d07ca85f
@@ -1,7 +1,7 @@
|
||||
import { NationExecution } from "engine/execution/NationExecution";
|
||||
import { SpawnExecution } from "engine/execution/SpawnExecution";
|
||||
import { Cell, Nation, PlayerInfo, PlayerType } from "engine/game/Game";
|
||||
import { GameConfig, GameID } from "core-public/Schemas";
|
||||
import { GameConfig, GameID } from "engine-public/Schemas";
|
||||
import { setup } from "../util/Setup";
|
||||
import { executeTicks } from "../util/utils";
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
PlayerType,
|
||||
UnitType,
|
||||
} from "engine/game/Game";
|
||||
import { GameID } from "core-public/Schemas";
|
||||
import { GameID } from "engine-public/Schemas";
|
||||
import { setup } from "../../util/Setup";
|
||||
import { constructionExecution, executeTicks } from "../../util/utils";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GameID } from "core-public/Schemas";
|
||||
import { GameID } from "engine-public/Schemas";
|
||||
import { AttackExecution } from "engine/execution/AttackExecution";
|
||||
import { SpawnExecution } from "engine/execution/SpawnExecution";
|
||||
//import { TransportShipExecution } from "engine/execution/TransportShipExecution";
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
} from "engine/game/Game";
|
||||
import { Cluster, TrainStation } from "engine/game/TrainStation";
|
||||
import { UserSettings } from "engine/game/UserSettings";
|
||||
import { GameConfig } from "core-public/Schemas";
|
||||
import { GameConfig } from "engine-public/Schemas";
|
||||
|
||||
vi.mock("engine/game/Game");
|
||||
vi.mock("engine/execution/TrainExecution");
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { createGame as createGameImpl } from "engine/game/GameImpl";
|
||||
import { GameMapImpl } from "engine/game/GameMap";
|
||||
import { UserSettings } from "engine/game/UserSettings";
|
||||
import { GameConfig } from "core-public/Schemas";
|
||||
import { GameConfig } from "engine-public/Schemas";
|
||||
import { TestConfig } from "../../util/TestConfig";
|
||||
|
||||
export const W = "W"; // Water
|
||||
|
||||
Reference in New Issue
Block a user