|
1 | | -# BUILD_PR_SHARED_EXTRACTION_02_EXACT_HELPER_MOVE |
| 1 | +# BUILD_PR_SHARED_EXTRACTION_02_EXACT_HELPER_MOVE (EXECUTABLE) |
2 | 2 |
|
3 | | -Purpose: Move duplicate helpers into src/shared using ONLY the target map. |
| 3 | +## Purpose |
| 4 | +Move duplicated helper functions into src/shared with ZERO guessing. |
4 | 5 |
|
5 | | -Source of Truth: |
6 | | -PLAN_PR_SHARED_EXTRACTION_02_TARGET_MAP |
| 6 | +## Exact Moves |
7 | 7 |
|
8 | | -Rules: |
9 | | -- DO NOT scan repo |
10 | | -- ONLY use listed files |
11 | | -- NO API changes |
12 | | -- NO new helpers |
| 8 | +### asFiniteNumber |
| 9 | +FROM: |
| 10 | +- src/advanced/promotion/createPromotionGate.js |
| 11 | +- src/advanced/state/createWorldGameStateSystem.js |
| 12 | +- games/network_sample_c/game/ReconciliationLayerAdapter.js |
13 | 13 |
|
14 | | -Instructions: |
15 | | -- Move helpers exactly as defined in target map |
16 | | -- Update imports only |
| 14 | +TO: |
| 15 | +- src/shared/utils/numberUtils.js |
17 | 16 |
|
18 | | -Acceptance: |
19 | | -- No duplicates remain |
20 | | -- Imports valid |
| 17 | +### asPositiveInteger |
| 18 | +FROM: |
| 19 | +- src/advanced/promotion/createPromotionGate.js |
| 20 | +- src/advanced/state/createWorldGameStateSystem.js |
| 21 | +- games/network_sample_c/game/ReconciliationLayerAdapter.js |
| 22 | +- games/network_sample_c/game/StateTimelineBuffer.js |
| 23 | +- src/engine/debug/inspectors/shared/inspectorUtils.js |
| 24 | + |
| 25 | +TO: |
| 26 | +- src/shared/utils/numberUtils.js |
| 27 | + |
| 28 | +### isPlainObject |
| 29 | +FROM: |
| 30 | +- src/advanced/state/utils.js |
| 31 | +- src/advanced/state/events.js |
| 32 | +- src/advanced/state/initialState.js |
| 33 | +- src/advanced/state/transitions.js |
| 34 | +- src/advanced/promotion/createPromotionGate.js |
| 35 | + |
| 36 | +TO: |
| 37 | +- src/shared/utils/objectUtils.js |
| 38 | + |
| 39 | +### getState (ONLY shared system variants) |
| 40 | +FROM: |
| 41 | +- src/advanced/state/createWorldGameStateSystem.js |
| 42 | +- samples/shared/worldGameStateSystem.js |
| 43 | + |
| 44 | +TO: |
| 45 | +- src/shared/state/getState.js |
| 46 | + |
| 47 | +## Import Updates |
| 48 | + |
| 49 | +All moved helpers must: |
| 50 | +- remove local definition |
| 51 | +- import from src/shared path |
| 52 | + |
| 53 | +Example: |
| 54 | +import { asFiniteNumber } from "../../shared/utils/numberUtils.js"; |
| 55 | + |
| 56 | +## Constraints |
| 57 | +- DO NOT scan repo further |
| 58 | +- DO NOT move additional helpers |
| 59 | +- DO NOT modify logic |
| 60 | +- DO NOT rename helpers |
| 61 | + |
| 62 | +## Acceptance |
| 63 | +- Helpers exist only in shared |
| 64 | +- No duplicate definitions remain |
| 65 | +- All imports updated |
21 | 66 | - Build passes |
0 commit comments