|
| 1 | +# PR_26140_062 Shared Utils Consolidation |
| 2 | + |
| 3 | +## Summary |
| 4 | +- Consolidated reusable shared helpers out of `src/shared/utils/` into canonical `src/shared/` locations. |
| 5 | +- Removed redundant `Utils` naming for active shared modules where the surrounding path already communicates shared ownership. |
| 6 | +- Deleted compatibility/pass-through shared utility files instead of leaving shims. |
| 7 | +- Updated active imports across games, tools, engine, samples, and tests to the new canonical paths. |
| 8 | +- Refreshed the shared extraction guard baseline and removed legacy compatibility alias ledger entries tied to deleted utility shims. |
| 9 | + |
| 10 | +## Canonical Module Moves |
| 11 | +- `src/shared/utils/arrayUtils.js` -> `src/shared/arrays.js` |
| 12 | +- `src/shared/utils/jsonUtils.js` -> `src/shared/json.js` |
| 13 | +- `src/shared/utils/objectUtils.js` -> `src/shared/objects.js` |
| 14 | +- `src/shared/utils/geometryUtils.js` -> `src/shared/geometry.js` |
| 15 | +- `src/shared/utils/mathUtils.js` -> `src/shared/math/scalars.js` |
| 16 | +- `src/shared/string/stringHelpers.js` -> `src/shared/strings.js` |
| 17 | +- `src/shared/id/idUtils.js` -> `src/shared/id/ids.js` |
| 18 | +- `src/shared/number/numberUtils.js` -> `src/shared/number/numbers.js` |
| 19 | +- `src/shared/math/vectorNormalizeUtils.js` -> `src/shared/math/vectorNormalize.js` |
| 20 | +- One-concept helpers such as `debugConfig`, `directions`, `highScores`, `initialsEntry`, `runtimeRegistry`, `snapshotClone`, `stringifyValue`, and `textWrap` now live directly under `src/shared/`. |
| 21 | + |
| 22 | +## Deleted Compatibility Shims |
| 23 | +- `src/shared/utils/index.js` |
| 24 | +- `src/shared/utils/stringUtils.js` |
| 25 | +- `src/shared/utils/idUtils.js` |
| 26 | +- `src/shared/utils/numberUtils.js` |
| 27 | +- `src/shared/string/stringUtil.js` |
| 28 | + |
| 29 | +## Import Cleanup |
| 30 | +- Active imports now point to canonical shared paths such as `/src/shared/math/scalars.js`, `/src/shared/objects.js`, `/src/shared/json.js`, and `/src/shared/strings.js`. |
| 31 | +- Confirmed no active import/export statements reference `src/shared/utils/`. |
| 32 | +- Sample JSON files were not modified. |
| 33 | + |
| 34 | +## Validation |
| 35 | +- PASS: changed-file syntax validation for 198 changed JavaScript files. |
| 36 | +- PASS: changed-file import target validation for 197 changed JavaScript files, excluding the guard selftest fixture that intentionally contains fake import text. |
| 37 | +- PASS: no active import/export statements reference `shared/utils/`. |
| 38 | +- PASS: `node tools/dev/checkSharedExtractionGuard.mjs --update-baseline` and follow-up guard run. |
| 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 the 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 changed runtime files not collected by that Playwright run. |
| 48 | +- Missing coverage is advisory only per project instructions and did not fail validation. |
| 49 | + |
| 50 | +## Non-Blocking Notes |
| 51 | +- A direct `node tests/games/AsteroidsHardening.test.mjs` attempt failed because Node cannot resolve browser-root imports like `/src/engine/...` without the repo test import hook. |
| 52 | +- A broader custom Asteroids node validation with the import hook passed `AsteroidsHardening` but stopped in `AsteroidsValidation` on an existing manifest bullet geometry expectation mismatch unrelated to this import-path consolidation. Required Workspace V2 validation, including Asteroids runtime asset coverage slices, passed. |
0 commit comments