|
| 1 | +# BUILD_PR_SHARED_EXTRACTION_03_IMPORT_NORMALIZATION_RETRY |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Normalize import usage for helpers already extracted to `src/shared`, using an explicit file list and exact import replacements only. |
| 5 | + |
| 6 | +## Source Basis |
| 7 | +This BUILD is derived from the uploaded repo snapshot used in-session. |
| 8 | +This BUILD replaces the prior non-executable import-normalization BUILD. |
| 9 | + |
| 10 | +## Single PR Purpose |
| 11 | +Normalize imports for: |
| 12 | +- `isPlainObject` |
| 13 | +- `asPositiveInteger` |
| 14 | + |
| 15 | +This retry does **not** include: |
| 16 | +- `asFiniteNumber` |
| 17 | +- `getState` |
| 18 | + |
| 19 | +Reason: |
| 20 | +No explicit import-update targets for those helpers were identified in the uploaded repo snapshot, so including them would require guessing. |
| 21 | + |
| 22 | +## Hard Constraints |
| 23 | +- DO NOT scan the repo beyond the exact files listed below |
| 24 | +- DO NOT modify logic |
| 25 | +- DO NOT move files |
| 26 | +- DO NOT rename helpers |
| 27 | +- DO NOT expand scope to additional helpers or files |
| 28 | +- Keep one PR purpose only |
| 29 | + |
| 30 | +## Exact File List + Exact Import Map |
| 31 | + |
| 32 | +### 1) `src/advanced/state/events.js` |
| 33 | +Replace: |
| 34 | +```js |
| 35 | +import { cloneDeep, isPlainObject } from './utils.js'; |
| 36 | +``` |
| 37 | + |
| 38 | +With: |
| 39 | +```js |
| 40 | +import { cloneDeep } from './utils.js'; |
| 41 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 42 | +``` |
| 43 | + |
| 44 | +### 2) `src/advanced/state/initialState.js` |
| 45 | +Replace: |
| 46 | +```js |
| 47 | +import { isPlainObject, mergeDeep } from './utils.js'; |
| 48 | +``` |
| 49 | + |
| 50 | +With: |
| 51 | +```js |
| 52 | +import { mergeDeep } from './utils.js'; |
| 53 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 54 | +``` |
| 55 | + |
| 56 | +### 3) `src/advanced/state/transitions.js` |
| 57 | +Replace: |
| 58 | +```js |
| 59 | +import { isPlainObject } from './utils.js'; |
| 60 | +``` |
| 61 | + |
| 62 | +With: |
| 63 | +```js |
| 64 | +import { isPlainObject } from '../../shared/utils/objectUtils.js'; |
| 65 | +``` |
| 66 | + |
| 67 | +### 4) `src/engine/debug/inspectors/host/debugInspectorHost.js` |
| 68 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 69 | + |
| 70 | +Update to: |
| 71 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 72 | +- add: |
| 73 | +```js |
| 74 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 75 | +``` |
| 76 | + |
| 77 | +### 5) `src/engine/debug/inspectors/registry/debugInspectorRegistry.js` |
| 78 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 79 | + |
| 80 | +Update to: |
| 81 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 82 | +- add: |
| 83 | +```js |
| 84 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 85 | +``` |
| 86 | + |
| 87 | +### 6) `src/engine/debug/inspectors/viewModels/entityInspectorViewModel.js` |
| 88 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 89 | + |
| 90 | +Update to: |
| 91 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 92 | +- add: |
| 93 | +```js |
| 94 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 95 | +``` |
| 96 | + |
| 97 | +### 7) `src/engine/debug/inspectors/viewModels/eventStreamInspectorViewModel.js` |
| 98 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 99 | + |
| 100 | +Update to: |
| 101 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 102 | +- add: |
| 103 | +```js |
| 104 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 105 | +``` |
| 106 | + |
| 107 | +### 8) `src/engine/debug/inspectors/viewModels/stateDiffInspectorViewModel.js` |
| 108 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 109 | + |
| 110 | +Update to: |
| 111 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 112 | +- add: |
| 113 | +```js |
| 114 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 115 | +``` |
| 116 | + |
| 117 | +### 9) `src/engine/debug/inspectors/viewModels/timelineInspectorViewModel.js` |
| 118 | +Current import block contains `asPositiveInteger` from `../shared/inspectorUtils.js`. |
| 119 | + |
| 120 | +Update to: |
| 121 | +- remove `asPositiveInteger` from the existing `../shared/inspectorUtils.js` import block |
| 122 | +- add: |
| 123 | +```js |
| 124 | +import { asPositiveInteger } from '../../../../shared/utils/numberUtils.js'; |
| 125 | +``` |
| 126 | + |
| 127 | +## Required Execution Rules |
| 128 | +- Only edit the 9 files listed above |
| 129 | +- Do not touch any other import lines |
| 130 | +- Preserve existing import ordering/style as much as possible |
| 131 | +- If a file already matches the target import state, leave it unchanged |
| 132 | +- No repo-wide cleanup pass |
| 133 | + |
| 134 | +## Validation Checklist |
| 135 | +1. Confirm only the 9 listed files changed |
| 136 | +2. Confirm `isPlainObject` is no longer imported from `./utils.js` in: |
| 137 | + - `src/advanced/state/events.js` |
| 138 | + - `src/advanced/state/initialState.js` |
| 139 | + - `src/advanced/state/transitions.js` |
| 140 | +3. Confirm `asPositiveInteger` is no longer imported from `../shared/inspectorUtils.js` in: |
| 141 | + - `src/engine/debug/inspectors/host/debugInspectorHost.js` |
| 142 | + - `src/engine/debug/inspectors/registry/debugInspectorRegistry.js` |
| 143 | + - `src/engine/debug/inspectors/viewModels/entityInspectorViewModel.js` |
| 144 | + - `src/engine/debug/inspectors/viewModels/eventStreamInspectorViewModel.js` |
| 145 | + - `src/engine/debug/inspectors/viewModels/stateDiffInspectorViewModel.js` |
| 146 | + - `src/engine/debug/inspectors/viewModels/timelineInspectorViewModel.js` |
| 147 | +4. Confirm the new shared imports resolve to: |
| 148 | + - `../../shared/utils/objectUtils.js` |
| 149 | + - `../../../../shared/utils/numberUtils.js` |
| 150 | +5. Confirm no logic/runtime changes were made |
| 151 | + |
| 152 | +## Non-Goals |
| 153 | +- No changes to `asFiniteNumber` |
| 154 | +- No changes to `getState` |
| 155 | +- No helper movement |
| 156 | +- No dedupe beyond the 9 exact files above |
| 157 | +- No alias-path migration |
0 commit comments