|
| 1 | +# PR_26140_037 Remove Export Alias Confusion Report |
| 2 | + |
| 3 | +## Scope |
| 4 | +- Continued PR_26140_036 alias cleanup with a focus on export aliases. |
| 5 | +- Removed active non-default export aliases where compatibility was not required. |
| 6 | +- Kept behavior unchanged; changes are name-surface cleanup only. |
| 7 | +- Did not touch vendor, generated, archive, report snapshot, or `tests/results` files. |
| 8 | + |
| 9 | +## Implementation Summary |
| 10 | +- Removed `deepClone as clone` from Collision Inspector V2 constants and imported `deepClone` directly where used. |
| 11 | +- Removed `asArray as asObjectArray` from the shared utils barrel; the canonical `asArray` export remains from `arrayUtils`. |
| 12 | +- Renamed the promotion helper export source from `getState` to canonical `getPromotionState`, removing `getState as getPromotionState` from the shared state barrel. |
| 13 | +- Removed unused compatibility exports `LegacyAttractModeController` and `legacySummary3d`. |
| 14 | +- Renamed the Asteroids boot export to canonical `bootAsteroids` and updated active tests/imports away from `bootAsteroidsNew as bootAsteroids`. |
| 15 | +- Removed the Pacman `opposite` compatibility export and updated the active ghost controller to use `oppositeCardinalDirection` directly. |
| 16 | + |
| 17 | +## Alias Search Results |
| 18 | +Non-default export alias search: |
| 19 | + |
| 20 | +`rg --pcre2 -n "^\\s*export\\s+\\{(?!\\s*default\\b).*\\bas\\b" games tools src -g "*.js" -g "*.mjs" -g "!**/node_modules/**" -g "!**/tests/results/**" -g "!docs/dev/reports/**" -g "!docs/archive/**"` |
| 21 | + |
| 22 | +Result: no matches. |
| 23 | + |
| 24 | +Broader active import/export `as` search still reports intentional leftovers: |
| 25 | + |
| 26 | +- `games/Asteroids/utils/math.js` keeps `import { wrap as sharedWrap } ...` because this file exposes the Asteroids-specific `wrap(value, max)` adapter over shared `wrap(value, min, max)`. Renaming that public helper or rewriting all consumers is outside this export-alias PR and would change a game utility surface. |
| 27 | +- `src/shared/index.js` keeps `export * as sharedMath/sharedUtils/...` namespace exports as the deliberate top-level shared namespace barrel. |
| 28 | +- `export { default as ... }` entries in engine/tool barrels remain because default-export modules need named public barrel exports; changing those would require a broad public API migration. |
| 29 | + |
| 30 | +Removed compatibility bridges not actively required: |
| 31 | + |
| 32 | +- `tools/collision-inspector-v2/js/constants.js`: `deepClone as clone`. |
| 33 | +- `src/shared/utils/index.js`: `asArray as asObjectArray`. |
| 34 | +- `src/shared/state/index.js`: `getState as getPromotionState`. |
| 35 | +- `src/engine/scene/AttractModeController.js`: `AttractModeController as LegacyAttractModeController`. |
| 36 | +- `src/engine/debug/standard/threeD/index.js`: `export * as legacySummary3d`. |
| 37 | +- `games/Asteroids/main.js`: `bootAsteroidsNew as bootAsteroids`. |
| 38 | +- `games/Pacman/game/PacmanFullAINavigator.js`: `oppositeCardinalDirection as opposite`. |
| 39 | + |
| 40 | +## Validation |
| 41 | +- INFO: `npm run build` is not defined in this repo (`Missing script: "build"`). |
| 42 | +- PASS: `npm run build:manifest`. |
| 43 | +- PASS: changed-file syntax sanity via `node --check` for every changed `.js`/`.mjs` file after fixing the duplicate `asArray` barrel export. |
| 44 | +- PASS: `node tests/games/AsteroidsValidation.test.mjs`. |
| 45 | +- PASS: `node tests/games/AsteroidsManifestScreenDimensions.test.mjs`. |
| 46 | +- PASS: `node tests/games/AsteroidsPresentation.test.mjs`. |
| 47 | +- PASS: `node tests/tools/ObjectVectorFinalRuntimeCleanup.test.mjs`. |
| 48 | +- PASS: `node tests/tools/ObjectVectorStudioV2DeleteCleanup.test.mjs`. |
| 49 | +- INFO: extra `node tests/games/PacmanFullAIValidation.test.mjs` was attempted because Pacman naming changed, but the test cannot resolve existing browser-absolute `/src/...` imports under plain Node (`C:\\src\\engine\\scene\\index.js`). |
| 50 | +- INFO: first `npm run test:workspace-v2` run had one transient checkbox interaction miss in the Object Vector Studio V2 shape drawing test; the isolated failing case passed immediately on rerun. |
| 51 | +- PASS: final `npm run test:workspace-v2` (58 passed). |
| 52 | +- PASS: `npx playwright test tests/playwright/tools/ObjectVectorStudioV2FirstClassToolStarter.spec.mjs --project=playwright --workers=1 --reporter=list` (4 passed). |
| 53 | +- PASS: `npx playwright test tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list` (4 passed). |
| 54 | +- PASS: `npx playwright test tests/playwright/tools/AsteroidsGameSceneCleanup.spec.mjs --project=playwright --workers=1 --reporter=list` (1 passed). |
| 55 | +- PASS: non-default export alias search found no matches. |
| 56 | +- PASS: vendor/generated/archive/report snapshot modification check found no matching changed paths. |
| 57 | +- PASS: `git diff --check` (CRLF normalization warnings only; no whitespace errors). |
| 58 | + |
| 59 | +## Playwright Impact |
| 60 | +Playwright impacted: Yes. Active runtime/tool module surfaces changed for Workspace Manager V2 launch paths, Object Vector Studio V2 validation paths, Collision Inspector V2 manifest cloning, and Asteroids boot naming. Expected pass behavior is unchanged launch/load/render/collision behavior. Expected fail behavior would be module import errors, failed boot, failed tool launch, or broken manifest load; none appeared in final passing runs. |
| 61 | + |
| 62 | +## Coverage |
| 63 | +- Advisory Playwright V8 coverage artifacts were refreshed at `docs/dev/reports/playwright_v8_coverage_report.txt` and `docs/dev/reports/coverage_changed_js_guardrail.txt`. |
| 64 | +- Missing changed runtime JS coverage is reported as WARN per project rules, not FAIL. |
| 65 | + |
| 66 | +## Full Samples Smoke |
| 67 | +Skipped. This PR is a scoped alias/name-surface cleanup covered by targeted Workspace Manager, Asteroids, Object Vector Studio V2, and Collision Inspector V2 validation; it does not broadly change the sample loader/framework. |
| 68 | + |
| 69 | +## Manual Validation Notes |
| 70 | +1. Open Workspace Manager V2, select the repo, and confirm games/tools populate. |
| 71 | +2. Launch Object Vector Studio V2 from Workspace Manager V2 and confirm schema-valid load still renders. |
| 72 | +3. Launch Collision Inspector V2 and confirm manifest objects load. |
| 73 | +4. Launch Asteroids and confirm normal gameplay smoke behavior. |
0 commit comments