Skip to content

Commit 5a30298

Browse files
author
DavidQ
committed
Normalize shared folder layout by domain - PR_26140_063-normalize-shared-folder-layout
1 parent 725fba2 commit 5a30298

137 files changed

Lines changed: 287 additions & 193 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# PR_26140_063 Shared Folder Layout Normalization
2+
3+
## Summary
4+
- Moved the remaining root-level shared helper modules into explicit domain folders under `src/shared/`.
5+
- Kept imports pointing directly at the canonical domain files instead of creating root-level compatibility shims.
6+
- Removed the object helper's cross-domain `asArray` re-export and split affected imports so array helpers come from `src/shared/array/arrays.js`.
7+
- Refreshed the shared extraction guard baseline after the canonical path moves.
8+
- Preserved behavior; this PR is layout/import normalization only.
9+
10+
## Layout Decisions
11+
- Array helpers: `src/shared/array/arrays.js`.
12+
- Object helpers: `src/shared/object/objects.js`.
13+
- JSON clone helpers: `src/shared/json/clone.js`.
14+
- String helpers: `src/shared/string/strings.js`, `textWrap.js`, `commandText.js`, `fuzzyMatchScore.js`, and `stringifyValue.js`.
15+
- Math/spatial helpers: `src/shared/math/scalars.js`, `geometry.js`, `directions.js`, `vectorMath.js`, `vectorNormalize.js`, and `numberNormalization.js`.
16+
- Debug helpers: `src/shared/debug/config.js`, `network.js`, and `noopDevConsoleIntegration.js`.
17+
- Runtime helpers: `src/shared/runtime/registry.js` and `snapshotClone.js`.
18+
- Game-generic helpers: `src/shared/game/highScores.js` and `initialsEntry.js`.
19+
- Validation helper: `src/shared/validation/invariant.js`.
20+
21+
## Guardrail Checks
22+
- Confirmed `src/shared/` root contains only the existing `index.js` namespace barrel.
23+
- Confirmed no active import/export statements reference `shared/utils/`.
24+
- Confirmed no active import/export statements reference the relocated dangling root shared files such as `shared/arrays.js`, `shared/objects.js`, `shared/json.js`, or `shared/strings.js`.
25+
- Confirmed no `../` export-from chains exist inside `src/shared/**/*.js`.
26+
- Confirmed no `Utils`/`utils` naming remains in `src/shared/**/*.js`.
27+
- No root shared compatibility re-export shims were created.
28+
- No sample JSON files were modified.
29+
30+
## Validation
31+
- PASS: `node tools/dev/checkSharedExtractionGuard.mjs --update-baseline`.
32+
- PASS: `node tools/dev/checkSharedExtractionGuard.mjs`.
33+
- PASS: root shared file check confirmed only `src/shared/index.js` remains at root.
34+
- PASS: no active imports from `shared/utils` or relocated root shared files.
35+
- PASS: no `../` export-from chains in `src/shared`.
36+
- PASS: no `Utils`/`utils` naming in `src/shared/**/*.js`.
37+
- PASS: changed-file syntax validation for 135 JavaScript files.
38+
- PASS: changed-file import target validation for 135 JavaScript files.
39+
- PASS: `node tools/dev/checkSharedExtractionGuard.selftest.mjs`.
40+
- PASS: `node tests/shared/SharedFoundationCombinedPass.test.mjs`.
41+
- PASS: `node tests/shared/SharedNumberStringIdCloseout.test.mjs`.
42+
- PASS: `npm run test:workspace-v2` (59 passed).
43+
- PASS: `git diff --check`.
44+
45+
## Coverage Guardrail
46+
- `npm run test:workspace-v2` regenerated advisory Playwright V8 coverage reports.
47+
- `docs/dev/reports/coverage_changed_js_guardrail.txt` lists changed runtime JavaScript files with covered entries where Workspace V2 exercised them and WARN details for files not collected by that Playwright run.
48+
- Coverage is advisory and missing changed runtime files are WARN, not FAIL, per project instructions.
49+
50+
## Full Samples Smoke Test
51+
- Skipped as requested. This PR changes shared module layout/imports and is covered by targeted syntax/import checks plus Workspace V2; sample JSON remains out of scope.
52+
53+
## Manual Validation
54+
- Open Workspace Manager V2 and select the repo.
55+
- Launch Object Vector Studio V2, Palette Manager V2, Asset Manager V2, and Asteroids from Workspace Manager V2.
56+
- Expected: tools and Asteroids launch without module resolution errors, and behavior matches the pre-layout-change state.

games/Asteroids/entities/Bullet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Bullet.js
66
*/
77
import { wrap } from '/src/shared/math/scalars.js';
88
import { transformCollisionPoints } from '/src/engine/collision/index.js';
9-
import { normalizePoints } from '/src/shared/geometry.js';
9+
import { normalizePoints } from '/src/shared/math/geometry.js';
1010

1111
export default class Bullet {
1212
constructor(x, y, vx, vy, life = 1.1, { angle = 0, collisionPoints = [] } = {}) {

games/Asteroids/entities/Ship.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ship.js
66
*/
77
import { wrap } from '/src/shared/math/scalars.js';
88
import { transformCollisionPoints } from '/src/engine/collision/index.js';
9-
import { normalizePoints } from '/src/shared/geometry.js';
9+
import { normalizePoints } from '/src/shared/math/geometry.js';
1010

1111
export default class Ship {
1212
constructor(x, y, { collisionPoints = [] } = {}) {

games/Asteroids/entities/Ufo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Ufo.js
66
*/
77
import Bullet from './Bullet.js';
88
import { distance, randomRange } from '/src/shared/math/scalars.js';
9-
import { normalizePoints } from '/src/shared/geometry.js';
9+
import { normalizePoints } from '/src/shared/math/geometry.js';
1010
import { transformCollisionPoints } from '/src/engine/collision/index.js';
1111

1212
const UFO_PROFILES = {

games/Asteroids/game/asteroidObjectGeometry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {
22
ASTEROIDS_ASTEROID_SIZE_OBJECT_IDS,
33
} from './asteroidsObjectGeometryManifest.js';
44
import { getObjectVectorCollisionOutlinePoints } from '/src/engine/collision/index.js';
5-
import { asArray } from '/src/shared/arrays.js';
6-
import { centerPoints, maxRadius } from '/src/shared/geometry.js';
5+
import { asArray } from '/src/shared/array/arrays.js';
6+
import { centerPoints, maxRadius } from '/src/shared/math/geometry.js';
77

88
const ASTEROID_SIZE_LABELS = Object.freeze({
99
1: 'SML',

games/Asteroids/game/asteroidsObjectGeometryManifest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getObjectVectorCollisionOutlinePoints } from '/src/engine/collision/index.js';
22
import { isRecord } from '/src/shared/types/typeGuards.js';
3-
import { deepClone } from '/src/shared/json.js';
3+
import { deepClone } from '/src/shared/json/clone.js';
44

55
const ASTEROIDS_OBJECT_VECTOR_TOOL_KEY = 'object-vector-studio-v2';
66
const OBJECT_VECTOR_PAYLOAD_KEYS = new Set(['version', 'toolId', 'name', 'objects']);

games/Asteroids/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Engine from "/src/engine/core/Engine.js";
66
import { InputService } from "/src/engine/input/index.js";
77
import { ObjectVectorRuntimeAssetService } from "/src/engine/rendering/index.js";
88
import { Theme, ThemeTokens } from "/src/engine/theme/index.js";
9-
import { resolveDebugConfig } from "/src/shared/debugConfig.js";
10-
import { createNoopDevConsoleIntegration } from "/src/shared/noopDevConsoleIntegration.js";
9+
import { resolveDebugConfig } from "/src/shared/debug/config.js";
10+
import { createNoopDevConsoleIntegration } from "/src/shared/debug/noopDevConsoleIntegration.js";
1111
import { asPositiveInteger } from "/src/shared/number/index.js";
1212
import AsteroidsGameScene from "./game/AsteroidsGameScene.js";
1313
import { loadAsteroidsObjectGeometryFromManifest } from "./game/asteroidsObjectGeometryManifest.js";

games/Asteroids/systems/AsteroidsHighScoreService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
sanitizeInitials,
1111
sanitizeRow,
1212
sortRows,
13-
} from '/src/shared/highScores.js';
13+
} from '/src/shared/game/highScores.js';
1414

1515
const DEFAULT_KEY = 'toolboxaid:games:asteroids:high-score-table';
1616
const DEFAULT_ROWS = [

games/Asteroids/systems/AsteroidsInitialsEntry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ David Quesenberry
44
03/25/2026
55
AsteroidsInitialsEntry.js
66
*/
7-
import { codeToLetter } from '/src/shared/initialsEntry.js';
7+
import { codeToLetter } from '/src/shared/game/initialsEntry.js';
88

99
const KEY_CODES = Array.from({ length: 26 }).map((_, index) => `Key${String.fromCharCode(65 + index)}`);
1010

games/Asteroids/systems/ShipDebrisSystem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ David Quesenberry
55
ShipDebrisSystem.js
66
*/
77
import { randomRange } from '/src/shared/math/scalars.js';
8-
import { normalizePoints } from '/src/shared/geometry.js';
8+
import { normalizePoints } from '/src/shared/math/geometry.js';
99

1010
function createShipSegments(points) {
1111
const normalized = normalizePoints(points);

0 commit comments

Comments
 (0)