Skip to content

Commit ba92328

Browse files
author
DavidQ
committed
Remove remaining engine systems index barrel exports - PR_26140_075-remove-engine-systems-index-barrels-phase2, and Remove engine core index barrel exports - PR_26140_076-remove-engine-core-index-barrel
1 parent 0ba474e commit ba92328

5 files changed

Lines changed: 120 additions & 45 deletions
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# PR_26140_076 Engine Core Index Barrel Removal
2+
3+
## Scope
4+
- Removed `src/engine/core/index.js` barrel usage.
5+
- Replaced active imports from `src/engine/core/index.js` with direct canonical imports.
6+
- Deleted `src/engine/core/index.js` after no active imports remained.
7+
- Import-only/direct-reference edits were limited to affected core tests.
8+
- Did not change schemas.
9+
- Did not touch sample JSON.
10+
- Did not remove sample/game entry `index.js` files.
11+
- Did not create replacement pass-through files.
12+
- Did not move runtime logic or circular dependency logic.
13+
14+
## Target Barrel
15+
- Deleted: `src/engine/core/index.js`
16+
17+
## Direct Import Updates
18+
- `tests/core/Engine2DCapabilityCombinedFoundation.test.mjs`
19+
- `Engine` now imports directly from `src/engine/core/Engine.js`.
20+
- `tests/core/EngineCoreBoundaryBaseline.test.mjs`
21+
- Core namespace import was replaced with direct canonical imports:
22+
- `Engine`
23+
- `FrameClock`
24+
- `FixedTicker`
25+
- `RuntimeMetrics`
26+
- `EventBus`
27+
- `Camera2D`
28+
- `Camera3D`
29+
- `followCameraTarget`
30+
- `worldRectToScreen`
31+
- Existing direct imports in the same test are referenced directly so the test remains executable without the removed namespace barrel.
32+
33+
## Validation
34+
- PASS: `node --check` for the 2 PR76 changed JS/MJS files.
35+
- PASS: direct import target validation for the 2 PR76 changed JS/MJS files.
36+
- PASS: no active references to `engine/core/index.js` remain in repo-owned JS/MJS outside reports/results.
37+
- PASS: `src/engine/core/index.js` no longer exists.
38+
- PASS: `node --input-type=module -e "const m = await import('./tests/core/EngineCoreBoundaryBaseline.test.mjs'); await m.run(); console.log('PASS EngineCoreBoundaryBaseline');"`
39+
- PASS: `node --input-type=module -e "const m = await import('./tests/core/Engine2DCapabilityCombinedFoundation.test.mjs'); await m.run(); console.log('PASS Engine2DCapabilityCombinedFoundation');"`
40+
- PASS: `npm run test:workspace-v2`
41+
- 59 passed.
42+
43+
## Not Run
44+
- Full samples smoke test was not run.
45+
46+
## Delta ZIP
47+
- `tmp/PR_26140_076-remove-engine-core-index-barrel_delta.zip`
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# PR_26140_075 Engine Systems Index Barrel Removal Phase 2
2+
3+
## Scope
4+
- Continued after PR_26140_074.
5+
- Checked for remaining active imports from `src/engine/systems/index.js`.
6+
- Confirmed `src/engine/systems/index.js` no longer exists.
7+
- No additional source import edits were required in this PR.
8+
- Did not change schemas.
9+
- Did not touch sample JSON.
10+
- Did not remove sample/game entry `index.js` files.
11+
- Did not remove `src/engine/core/index.js`.
12+
- Did not create replacement pass-through files.
13+
14+
## Result
15+
The remaining systems index barrel cleanup was already complete in the current baseline:
16+
17+
- No active repo-owned JS/MJS imports reference `engine/systems/index.js`.
18+
- `src/engine/systems/index.js` is absent.
19+
- No behavior changes were made.
20+
21+
## Validation
22+
- PASS: `node --check` over changed JS/MJS files.
23+
- Result: 0 changed JS/MJS files for PR_26140_075.
24+
- PASS: direct import target validation over changed JS/MJS files.
25+
- Result: 0 changed JS/MJS files for PR_26140_075.
26+
- PASS: no active references to `engine/systems/index.js` remain in repo-owned JS/MJS outside reports/results.
27+
- PASS: `src/engine/systems/index.js` no longer exists.
28+
- PASS: `npm run test:workspace-v2`
29+
- 59 passed.
30+
31+
## Affected Systems Tests
32+
- No affected systems tests were identified by import validation because PR_26140_075 made no source import changes.
33+
34+
## Not Run
35+
- Full samples smoke test was not run.
36+
37+
## Delta ZIP
38+
- `tmp/PR_26140_075-remove-engine-systems-index-barrels-phase2_delta.zip`

src/engine/core/index.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/core/Engine2DCapabilityCombinedFoundation.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ David Quesenberry
55
Engine2DCapabilityCombinedFoundation.test.mjs
66
*/
77
import assert from 'node:assert/strict';
8-
import { Engine } from '../../src/engine/core/index.js';
8+
import Engine from '../../src/engine/core/Engine.js';
99
import Scene from '../../src/engine/scene/Scene.js';
1010
import Camera2D from '../../src/engine/camera/Camera2D.js';
1111
import { followCameraTarget, worldRectToScreen } from '../../src/engine/camera/CameraSystem.js';

tests/core/EngineCoreBoundaryBaseline.test.mjs

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ David Quesenberry
55
EngineCoreBoundaryBaseline.test.mjs
66
*/
77
import assert from 'node:assert/strict';
8-
import * as core from '../../src/engine/core/index.js';
8+
import Engine from '../../src/engine/core/Engine.js';
9+
import FrameClock from '../../src/engine/core/FrameClock.js';
10+
import FixedTicker from '../../src/engine/core/FixedTicker.js';
11+
import RuntimeMetrics from '../../src/engine/core/RuntimeMetrics.js';
12+
import EventBus from '../../src/engine/events/EventBus.js';
13+
import Camera2D from '../../src/engine/camera/Camera2D.js';
14+
import Camera3D from '../../src/engine/camera/Camera3D.js';
15+
import { followCameraTarget, worldRectToScreen } from '../../src/engine/camera/CameraSystem.js';
916
import Scene from '../../src/engine/scene/Scene.js';
1017
import SceneManager from '../../src/engine/scene/SceneManager.js';
1118
import CanvasRenderer from '../../src/engine/rendering/CanvasRenderer.js';
@@ -23,51 +30,51 @@ import { stepWorldPhysics3D } from '../../src/engine/systems/PhysicsSystem.js';
2330

2431
export function run() {
2532
// Core boot/timing boundaries.
26-
assert.equal(typeof core.Engine, 'function');
27-
assert.equal(typeof core.FrameClock, 'function');
28-
assert.equal(typeof core.FixedTicker, 'function');
29-
assert.equal(typeof core.RuntimeMetrics, 'function');
33+
assert.equal(typeof Engine, 'function');
34+
assert.equal(typeof FrameClock, 'function');
35+
assert.equal(typeof FixedTicker, 'function');
36+
assert.equal(typeof RuntimeMetrics, 'function');
3037

3138
// Scene/render/input/physics/audio/systems public homes.
32-
assert.equal(typeof scene.Scene, 'function');
33-
assert.equal(typeof scene.SceneManager, 'function');
34-
assert.equal(typeof rendering.CanvasRenderer, 'function');
35-
assert.equal(typeof rendering.renderByLayers, 'function');
39+
assert.equal(typeof Scene, 'function');
40+
assert.equal(typeof SceneManager, 'function');
41+
assert.equal(typeof CanvasRenderer, 'function');
42+
assert.equal(typeof renderByLayers, 'function');
3643
assert.equal(typeof InputService, 'function');
3744
assert.equal(typeof ActionInputService, 'function');
38-
assert.equal(typeof physics.stepArcadeBody, 'function');
39-
assert.equal(typeof physics.applyDrag, 'function');
40-
assert.equal(typeof physics.integrateVelocity3D, 'function');
41-
assert.equal(typeof physics.isAabbColliding3D, 'function');
42-
assert.equal(typeof physics.resolveAabbCollision3D, 'function');
43-
assert.equal(typeof physics.stepSceneBodies3D, 'function');
45+
assert.equal(typeof stepArcadeBody, 'function');
46+
assert.equal(typeof applyDrag, 'function');
47+
assert.equal(typeof integrateVelocity3D, 'function');
48+
assert.equal(typeof isAabbColliding3D, 'function');
49+
assert.equal(typeof resolveAabbCollision3D, 'function');
50+
assert.equal(typeof stepSceneBodies3D, 'function');
4451
assert.equal(typeof AudioService, 'function');
4552
assert.equal(typeof moveEntities, 'function');
4653
assert.equal(typeof moveEntities3D, 'function');
4754
assert.equal(typeof stepArcadeBody, 'function');
4855
assert.equal(typeof stepWorldPhysics3D, 'function');
4956

5057
// Combined service cluster contracts: timing/frame, event routing, camera.
51-
const frameClock = new core.FrameClock({ now: () => 100, maxDeltaMs: 100 });
58+
const frameClock = new FrameClock({ now: () => 100, maxDeltaMs: 100 });
5259
frameClock.reset(100);
5360
const tick = frameClock.tick(116);
5461
assert.equal(tick.deltaMs, 16);
5562

56-
const ticker = new core.FixedTicker({ stepMs: 10, maxCatchUpSteps: 5 });
63+
const ticker = new FixedTicker({ stepMs: 10, maxCatchUpSteps: 5 });
5764
const steps = [];
5865
const tickerResult = ticker.advance(25, (stepSeconds) => steps.push(stepSeconds));
5966
assert.equal(tickerResult.steps, 2);
6067
assert.deepEqual(steps, [0.01, 0.01]);
6168

62-
const bus = new core.EventBus();
69+
const bus = new EventBus();
6370
let eventSeen = 0;
6471
bus.on('engine.core.boundary', () => {
6572
eventSeen += 1;
6673
});
6774
assert.equal(bus.emit('engine.core.boundary', { ok: true }), 1);
6875
assert.equal(eventSeen, 1);
6976

70-
const camera = new core.Camera2D({
77+
const camera = new Camera2D({
7178
x: 0,
7279
y: 0,
7380
viewportWidth: 100,
@@ -76,14 +83,14 @@ export function run() {
7683
worldHeight: 300,
7784
});
7885
const target = { x: 80, y: 50, width: 20, height: 20 };
79-
core.followCameraTarget(camera, target, true);
80-
const rect = core.worldRectToScreen(camera, { x: 100, y: 100, width: 10, height: 10 });
86+
followCameraTarget(camera, target, true);
87+
const rect = worldRectToScreen(camera, { x: 100, y: 100, width: 10, height: 10 });
8188
assert.equal(typeof rect.x, 'number');
8289
assert.equal(typeof rect.y, 'number');
8390
assert.equal(rect.width, 10);
8491
assert.equal(rect.height, 10);
8592

86-
const camera3D = new core.Camera3D({
93+
const camera3D = new Camera3D({
8794
position: { x: 1, y: 2, z: 3 },
8895
rotation: { x: 0.1, y: 0.2, z: 0.3 },
8996
});
@@ -117,11 +124,11 @@ export function run() {
117124
depth: 2,
118125
};
119126

120-
physics.integrateVelocity3D(movingBody, 0.5);
127+
integrateVelocity3D(movingBody, 0.5);
121128
assert.equal(movingBody.x, 3);
122-
assert.equal(physics.isAabbColliding3D(movingBody, wallBody), true);
129+
assert.equal(isAabbColliding3D(movingBody, wallBody), true);
123130

124-
const resolveResult = physics.resolveAabbCollision3D(movingBody, wallBody);
131+
const resolveResult = resolveAabbCollision3D(movingBody, wallBody);
125132
assert.equal(resolveResult.collided, true);
126133
assert.equal(resolveResult.axis, 'x');
127134
assert.equal(movingBody.x, 2);
@@ -143,7 +150,7 @@ export function run() {
143150
],
144151
staticColliders3D: [],
145152
};
146-
const stepSummary = physics.stepSceneBodies3D(scene3D, 0.5);
153+
const stepSummary = stepSceneBodies3D(scene3D, 0.5);
147154
assert.equal(stepSummary.movedBodies, 1);
148155
assert.equal(stepSummary.resolvedCollisions, 0);
149156
assert.equal(scene3D.bodies3D[0].x, 1);
@@ -152,7 +159,7 @@ export function run() {
152159
const before3D = world3D.getComponent(movingEntity, 'transform3D');
153160
assert.equal(before3D.x, 0);
154161
assert.equal(before3D.z, 8);
155-
const physics3DSummary = systems.stepWorldPhysics3D(world3D, 1);
162+
const physics3DSummary = stepWorldPhysics3D(world3D, 1);
156163
const after3D = world3D.getComponent(movingEntity, 'transform3D');
157164
const velocity3D = world3D.getComponent(movingEntity, 'velocity3D');
158165
assert.equal(physics3DSummary.movedEntities, 1);

0 commit comments

Comments
 (0)