|
| 1 | +# BUILD_PR_SHARED_EXTRACTION_16_ALIAS_IMPORTS_NETWORK_SAMPLE_C |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Extend the proven `@shared/*` alias usage to the network_sample_c consumer slice only. |
| 5 | + |
| 6 | +## Single PR Purpose |
| 7 | +Switch shared-helper imports in these 2 files from relative paths to the existing `@shared/*` alias: |
| 8 | + |
| 9 | +1. `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 10 | +2. `games/network_sample_c/game/StateTimelineBuffer.js` |
| 11 | + |
| 12 | +This BUILD assumes the prior alias bootstrap is already present and does not modify config. |
| 13 | + |
| 14 | +## Exact Files Allowed |
| 15 | +Edit only these 2 files: |
| 16 | + |
| 17 | +1. `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 18 | +2. `games/network_sample_c/game/StateTimelineBuffer.js` |
| 19 | + |
| 20 | +Do not edit any other file. |
| 21 | + |
| 22 | +## Alias Assumption |
| 23 | +The repo already contains alias support for: |
| 24 | + |
| 25 | +```js |
| 26 | +@shared/ |
| 27 | +``` |
| 28 | + |
| 29 | +resolving to: |
| 30 | + |
| 31 | +```js |
| 32 | +src/shared/ |
| 33 | +``` |
| 34 | + |
| 35 | +Do not modify `jsconfig.json` or any other config file in this PR. |
| 36 | + |
| 37 | +## Fail-Fast Gate |
| 38 | +Before making source edits, confirm: |
| 39 | + |
| 40 | +1. `jsconfig.json` exists |
| 41 | +2. it contains `@shared/*` -> `src/shared/*` |
| 42 | +3. these shared targets exist: |
| 43 | + - `src/shared/utils/numberUtils.js` |
| 44 | + - `src/shared/utils/objectUtils.js` |
| 45 | + |
| 46 | +If any condition is false: |
| 47 | +- stop |
| 48 | +- report blocker |
| 49 | +- make no changes |
| 50 | +- do not create a delta ZIP |
| 51 | + |
| 52 | +## Exact Source Changes |
| 53 | + |
| 54 | +### 1) `games/network_sample_c/game/ReconciliationLayerAdapter.js` |
| 55 | +Replace only shared-helper relative imports with alias imports. |
| 56 | + |
| 57 | +Target alias forms: |
| 58 | +```js |
| 59 | +import { asFiniteNumber, asPositiveInteger } from '@shared/utils/numberUtils.js'; |
| 60 | +import { isPlainObject } from '@shared/utils/objectUtils.js'; |
| 61 | +``` |
| 62 | + |
| 63 | +Rules: |
| 64 | +- preserve existing imported specifiers |
| 65 | +- if imports from the same aliased module can be combined without changing behavior/style, minimum-edit combination is allowed |
| 66 | +- do not touch unrelated imports |
| 67 | +- do not change logic |
| 68 | +- do not add snapshot helper import unless this file already uses it |
| 69 | + |
| 70 | +### 2) `games/network_sample_c/game/StateTimelineBuffer.js` |
| 71 | +Replace only shared-helper relative imports with alias imports. |
| 72 | + |
| 73 | +Target alias forms: |
| 74 | +```js |
| 75 | +import { asPositiveInteger } from '@shared/utils/numberUtils.js'; |
| 76 | +import { isPlainObject } from '@shared/utils/objectUtils.js'; |
| 77 | +``` |
| 78 | + |
| 79 | +Rules: |
| 80 | +- preserve existing imported specifiers |
| 81 | +- if imports from the same aliased module can be combined without changing behavior/style, minimum-edit combination is allowed |
| 82 | +- do not touch unrelated imports |
| 83 | +- do not change logic |
| 84 | +- do not add `asFiniteNumber` unless this file already imports/uses it |
| 85 | + |
| 86 | +## Hard Constraints |
| 87 | +- edit only the 2 listed files |
| 88 | +- no config changes |
| 89 | +- no engine changes |
| 90 | +- no advanced-file changes |
| 91 | +- no repo-wide alias rollout |
| 92 | +- no removal of `.js` extensions |
| 93 | +- no helper behavior changes |
| 94 | +- keep one PR purpose only |
| 95 | + |
| 96 | +## Validation Checklist |
| 97 | +1. Confirm only the 2 listed files changed |
| 98 | +2. Confirm both files now import shared helpers via `@shared/...` |
| 99 | +3. Confirm no unrelated imports changed |
| 100 | +4. Confirm no logic changed |
| 101 | +5. Confirm no config file was touched |
| 102 | + |
| 103 | +## Non-Goals |
| 104 | +- no alias rollout to engine |
| 105 | +- no alias rollout repo-wide |
| 106 | +- no import cleanup outside the 2 exact files |
| 107 | +- no toolchain redesign |
| 108 | +- no helper redesign |
0 commit comments