## Context #2346 introduces split XDG/platform layout for **fresh** installs and keeps existing `~/.vite-plus` installs on the legacy monolithic root (grandfathered). We intentionally **did not** ship automatic layout migration in that PR: moving a live global install is high risk (Windows file locks, PATH/profile cutover, concurrent shims). Follow-up to #2346 / #827. Branch sketch: `feat/layout-migrate` (local experiment; re-land carefully). ## Goal On `vp upgrade` (and reinstall via installers where appropriate), detect a **default** legacy install at `~/.vite-plus` / `%USERPROFILE%\.vite-plus` and **split its contents** into the correct category roots, then remove the legacy root. | From under `~/.vite-plus` | To (Unix defaults) | |---------------------------|--------------------| | version dirs, `current`, runtimes, packages, bins | `VP_DATA_DIR` / `XDG_DATA_HOME/vite-plus` / `~/.local/share/vite-plus` | | `config.json` | config dir (`~/.config/vite-plus`, …) | | session / upgrade-check state | state dir | | shims / env scripts | **regenerate** into bin + config (do not copy relative links / stale env) | | resolve cache | **drop** (rebuild) | Custom `VP_HOME` roots stay out of auto-migrate (deprecated pin only). ## Design constraints (from review) - Copy-first, then delete legacy root (no long-lived tombstone unless Windows locks force a retry) - Never delete legacy before split `data/current` is verified - Conflict if split data already has a healthy unrelated install - Shell profiles that source `~/.vite-plus/env*` must be rewritten or cleaned - N-1 users: best-effort upgrade path + install script as guaranteed fallback - Full plan notes live in the dirs-path-resolution design discussion ## Acceptance - Machine with only `~/.vite-plus` runs `vp upgrade` once → split roots populated, `~/.vite-plus` gone, shims/env work after shell restart - Fresh install never creates `~/.vite-plus` - CI covers legacy→split migrate + implode; unit tests for preflight/copy/delete - No silent migrate of custom `VP_HOME` roots