Appearance
2026-03-11 simulator src migration implementation record
This record captures the implementation of the simulator source migration from docs/.vitepress/theme/components/simulator to src/simulator, while keeping simulator code out of all SDK runtime build artifacts.
Change summary
- Moved simulator implementation into
src/simulatorwith a structured layout:components/,core/,adapters/, andtypes/index.ts. - Replaced docs
MapPlaygroundwith a thin host component that only mounts the simulator implementation fromsrc/simulator. - Removed docs-side simulator implementation files and docs-side simulator type shims.
- Unified simulator type sourcing to
@core/@typesand@core/@types/callbacksthroughsrc/simulator/adapters/sdkTypes.ts. - Added import guardrails to forbid
@simulatorimports from runtime modules:src/core/**,src/rjs-entry/**, andsrc/app/**. - Added
@simulatoralias wiring for root Vite/TypeScript and VitePress docs.
Key files
src/simulator/components/SimulatorMapPlayground.vuesrc/simulator/core/useMapPlayground.tssrc/simulator/adapters/external.tssrc/simulator/adapters/sdkTypes.tssrc/simulator/types/index.tssrc/simulator/index.tsdocs/.vitepress/theme/components/MapPlayground.vuedocs/.vitepress/config.tsdocs/.vitepress/tsconfig.jsonvite.config.jstsconfig.jsoneslint.config.jspackage.json
Risk points and handling
- Risk: simulator code accidentally enters SDK/runtime bundles.
- Handling: added ESLint
no-restricted-importsguardrail for runtime folders and verified built outputs by keyword scanning.
- Handling: added ESLint
- Risk: docs typecheck pulls in full core runtime implementation and fails for unrelated reasons.
- Handling: constrained docs typecheck path mapping to simulator-relevant targets and type-only modules.
- Risk: behavior regression during file relocation.
- Handling: migrated files with no feature changes and preserved existing simulator render/runtime/event/cache logic paths.
Verification results
npm run lint: passnpx tsc --noEmit: passnpm run typecheck:docs: passnpm run build:core: passnpm run build:rjs: passnpm run build:app: pass
Artifact exclusion evidence
After each build target, outputs were scanned with: rg -n "simulator|SimulatorMapPlayground|@simulator|useMapPlayground|src/simulator".
build:coreoutput (dist/**): no simulator markers found.build:rjsoutput (dist/index.rjs.js): no simulator markers found.build:appoutput (dist-app/**): no simulator markers found.