Refactor area preview orchestration

This commit is contained in:
2026-08-04 12:55:20 +08:00
parent 0ce7d1ea5e
commit 396df5127c
16 changed files with 541 additions and 455 deletions

View File

@@ -0,0 +1,20 @@
# Split area build orchestration implementation plan
1. Extract vehicle route helpers into `vehicle-route.js`; add unit coverage using fixture OSM.
2. Extract vehicle glTF builder into `vehicle-model.js`; assert schema, mesh/material counts and data URI.
3. Extract preview support-file copy, HTML template, escaping and summary into `area-preview.js`.
4. Replace `build-area.js` bodies with imports/calls while preserving preview manifest ownership and ordering.
5. Run Node syntax/unit tests, then only the nantaizi `preview`, diagnose and quality gate commands.
6. Update pipeline/preview specs and changelog; inspect diff for accidental stage or output changes.
## Validation
- `node --check scripts/build-area.js`
- `node --check scripts/lib/vehicle-route.js`
- `node --check scripts/lib/vehicle-model.js`
- `node --check scripts/lib/area-preview.js`
- `npm run test:preview-assets`
- `npm run build:area -- --config config/areas/nantaizi-lake-innovation-valley.json --stages preview`
- `npm run diagnose:area -- --config config/areas/nantaizi-lake-innovation-valley.json`
- `npm run check:area -- --config config/areas/nantaizi-lake-innovation-valley.json`
- `git diff --check`