|
| 1 | +# BUILD_PR_SHARED_EXTRACTION_15B_ALIAS_CONFIG_BOOTSTRAP_JSCONFIG_ONLY |
| 2 | + |
| 3 | +## Purpose |
| 4 | +Unblock the alias-import proof point by adding one minimal repo config file that supports `@shared/*` path resolution for editor/tooling use, then switching the two advanced files to that alias. |
| 5 | + |
| 6 | +## Single PR Purpose |
| 7 | +Create exactly one new config file: |
| 8 | + |
| 9 | +- `jsconfig.json` |
| 10 | + |
| 11 | +Then update only these 2 files to use `@shared/*` imports: |
| 12 | + |
| 13 | +1. `src/advanced/promotion/createPromotionGate.js` |
| 14 | +2. `src/advanced/state/createWorldGameStateSystem.js` |
| 15 | + |
| 16 | +This BUILD exists because the prior alias BUILD fail-fast stopped: no suitable existing config file from the allowed set was present. |
| 17 | + |
| 18 | +## Exact Files Allowed |
| 19 | +Edit only these 3 files: |
| 20 | + |
| 21 | +1. `jsconfig.json` **(new file)** |
| 22 | +2. `src/advanced/promotion/createPromotionGate.js` |
| 23 | +3. `src/advanced/state/createWorldGameStateSystem.js` |
| 24 | + |
| 25 | +Do not edit any other file. |
| 26 | + |
| 27 | +## Exact New File |
| 28 | +Create: |
| 29 | + |
| 30 | +`jsconfig.json` |
| 31 | + |
| 32 | +With exactly this content: |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "compilerOptions": { |
| 37 | + "baseUrl": ".", |
| 38 | + "paths": { |
| 39 | + "@shared/*": ["src/shared/*"] |
| 40 | + } |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +Do not add any other alias. |
| 46 | +Do not add any other compiler options. |
| 47 | +Do not create tsconfig, vite, or webpack config in this PR. |
| 48 | + |
| 49 | +## Exact Source Changes |
| 50 | + |
| 51 | +### 1) `src/advanced/promotion/createPromotionGate.js` |
| 52 | +Replace only shared-helper relative imports with alias imports. |
| 53 | + |
| 54 | +Target alias forms: |
| 55 | +```js |
| 56 | +import { asFiniteNumber } from '@shared/utils/numberUtils.js'; |
| 57 | +import { asPositiveInteger } from '@shared/utils/numberUtils.js'; |
| 58 | +import { isPlainObject } from '@shared/utils/objectUtils.js'; |
| 59 | +import { createPromotionStateSnapshot } from '@shared/state/createPromotionStateSnapshot.js'; |
| 60 | +``` |
| 61 | + |
| 62 | +Rules: |
| 63 | +- preserve existing imported specifiers |
| 64 | +- if imports from the same aliased module can be combined without changing behavior/style, minimum-edit combination is allowed |
| 65 | +- do not touch unrelated imports |
| 66 | +- do not change logic |
| 67 | + |
| 68 | +### 2) `src/advanced/state/createWorldGameStateSystem.js` |
| 69 | +Replace only shared-helper relative imports with alias imports. |
| 70 | + |
| 71 | +Target alias forms: |
| 72 | +```js |
| 73 | +import { asFiniteNumber } from '@shared/utils/numberUtils.js'; |
| 74 | +import { asPositiveInteger } from '@shared/utils/numberUtils.js'; |
| 75 | +import { isPlainObject } from '@shared/utils/objectUtils.js'; |
| 76 | +import { createPromotionStateSnapshot } from '@shared/state/createPromotionStateSnapshot.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 | + |
| 85 | +## Fail-Fast Gate |
| 86 | +Before editing the 2 source files, confirm these shared targets exist: |
| 87 | + |
| 88 | +- `src/shared/utils/numberUtils.js` |
| 89 | +- `src/shared/utils/objectUtils.js` |
| 90 | +- `src/shared/state/createPromotionStateSnapshot.js` |
| 91 | + |
| 92 | +If any is missing: |
| 93 | +- stop |
| 94 | +- report blocker |
| 95 | +- make no changes |
| 96 | +- do not create a delta ZIP |
| 97 | + |
| 98 | +## Hard Constraints |
| 99 | +- edit only the 3 listed files |
| 100 | +- no engine files |
| 101 | +- no sample files |
| 102 | +- no repo-wide alias rollout |
| 103 | +- no removal of `.js` extensions |
| 104 | +- no helper behavior changes |
| 105 | +- no extra config beyond the exact `jsconfig.json` content above |
| 106 | +- keep one PR purpose only |
| 107 | + |
| 108 | +## Validation Checklist |
| 109 | +1. Confirm only the 3 listed files changed |
| 110 | +2. Confirm `jsconfig.json` exists and matches the exact content in this BUILD |
| 111 | +3. Confirm exactly 2 advanced files now import shared helpers via `@shared/...` |
| 112 | +4. Confirm no unrelated imports changed |
| 113 | +5. Confirm no logic changed |
| 114 | +6. Confirm no sample or engine file was touched |
| 115 | + |
| 116 | +## Non-Goals |
| 117 | +- no repo-wide alias migration |
| 118 | +- no alias rollout to samples |
| 119 | +- no alias rollout to engine |
| 120 | +- no Vite/Webpack/TS config work |
| 121 | +- no path cleanup outside the 2 exact advanced files |
| 122 | +- no toolchain redesign |
0 commit comments