2.0 KiB
2.0 KiB
本地构建控制台实施计划
- Create a dependency-free console server and static UI shell; add
npm run console, localhost-only binding, automatic browser launch and environment/readiness endpoint. - Extract/reuse small pipeline-facing helpers for area discovery, diagnostics summary, native ZIP inspection and supported tree-style options. Do not import
build-area.jsas a module. - Implement history cards and onboarding: config scanning, manifest/status summary, input descriptions, package/preview links and model option selection.
- Implement safe import and Save As: upload/copy OSM+ZIP into ignored managed storage, inspect ZIP contract/areaId, atomically write a config with collision-safe output overrides, and record ownership.
- Implement serialized build jobs with child-process log capture, SSE progress, completion/failure states, and links to the existing generated preview.
- Implement cleanup planning and confirmation. Validate canonical paths, move only allowed targets to macOS Trash, and cover single/batch clear-output versus remove-area paths.
- Add focused Node HTTP/unit tests, update README with launch/use/troubleshooting guidance, then manually run the actual imported-area build and preview flow.
Validation commands
node --checkfor each new Node entry/helper.- focused console test command added to
package.json. - existing
npm run test:native-road-package,npm run test:build-stages,npm run test:preview-assets, andnpm run test:package-contract. npm run console, import a valid OSM/ZIP fixture, run a full build, open preview, and exercise both cleanup scopes.
Risk controls and rollback
- Never bind beyond loopback; do not serve arbitrary paths or allow parallel builds.
- Validate cleanup targets after confirmation and immediately before Trash movement; no
rm -rfimplementation. - If the UI path fails, existing CLI remains the supported fallback. Removing console files/script rolls back the feature without changing existing area data or output contracts.