@@ -146,6 +146,13 @@ Thus, `user_home` and `dirs` cannot use different home directories. Directory
146146resolution reads only ` VP_HOME ` , ` VP_*_DIR ` , and ` XDG_* ` . It does not read
147147` HOME ` or ` USERPROFILE ` .
148148
149+ ` crates/vp_shared/src/dirs/env_overrides.rs ` classifies ` VP_HOME ` ,
150+ ` VP_BIN_DIR ` , ` VP_DATA_DIR ` , and ` VP_CACHE_DIR ` as unset, absolute, or
151+ relative. Runtime resolution accepts absolute candidates and skips invalid
152+ candidates. ` validate_vp_dir_env ` applies the installer policy to the same
153+ classification. The function returns an error for a relative ` VP_HOME ` , an
154+ incomplete split group, or a relative path in a complete split group.
155+
149156Directory resolution has no test-only branches. Tests use the process
150157environment to run the production resolution chain. See
151158[ Test configuration] ( #test-configuration ) .
@@ -242,16 +249,17 @@ A restricted service or CI environment can prevent the known-folder query.
242249When this occurs, Vite+ uses ` AppData\Local ` and ` AppData\Roaming ` under the
243250resolved user home. Thus, a known home always produces a complete layout.
244251
245- | Source | Behavior |
252+ | Source | Runtime behavior |
246253| ------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
247254| ** ` VP_HOME ` ** | Vite+ puts the ** monolithic mapping** for all categories under this root. |
248255| ** ` ~/.vite-plus ` ** | Vite+ uses the monolithic mapping when this directory contains a ` current ` link. |
249256| ** ` VP_BIN_DIR ` / ` VP_DATA_DIR ` / ` VP_CACHE_DIR ` ** | All three values must be set to absolute paths. An incomplete or invalid group has no effect. |
250257| ** ` XDG_* ` ** (Unix) | Vite+ uses absolute XDG category roots with the app name ` vite-plus ` . Bin resolves to ` <DATA>/bin ` . |
251258| ** Platform defaults** | [ Category mapping] ( #category-mapping ) defines the Unix and Windows defaults. |
252259
253- Vite+ ignores relative ` VP_* ` and ` XDG_* ` values. This behavior follows the XDG
254- Base Directory Specification.
260+ Runtime resolution ignores relative ` VP_* ` and ` XDG_* ` values. This behavior
261+ follows the XDG Base Directory Specification. Installers apply stricter rules
262+ before they create installation roots.
255263
256264### Category mapping
257265
@@ -314,12 +322,19 @@ root. Features must not store machine identity or durable state in these files.
314322` install.sh ` , ` install.ps1 ` , and the local ` install-global-cli ` use the CLI
315323resolution chain:
316324
317- 1 . If ` VP_HOME ` is set, use that root for the ** monolithic** layout.
325+ 1 . If ` VP_HOME ` contains an absolute path, use that root for the
326+ ** monolithic** layout.
3183272 . Otherwise, check the default ` ~/.vite-plus ` directory or its Windows
319328 equivalent. If it contains a ` current ` link, keep the monolithic root.
3203293 . Otherwise, use a complete ` VP_*_DIR ` group, ` XDG_* ` , or platform defaults
321330 for the ** split** layout.
322331
332+ The script installers reject an incomplete or relative ` VP_*_DIR ` group.
333+ ` vp-setup ` rejects those groups and a relative ` VP_HOME ` . It calls
334+ ` vp_shared::validate_vp_dir_env ` before ` EnvConfig ` resolves paths. A validation
335+ error makes ` vp-setup ` exit with status 1 before it creates a requested or
336+ default installation root.
337+
323338Each platform has one install script. There is no separate script for each
324339layout. Local bootstrap does not set ` VP_HOME ` . It resolves the install data
325340directory through the same chain.
@@ -387,8 +402,8 @@ However, the installer still exits with status 0:
387402** Detection.** Each installer downloads the platform payload before it selects
388403the final layout. This includes ` install.sh ` , ` install.ps1 ` , and ` vp-setup ` . The
389404installer then runs the payload binary once with ` VP_DUMP_DIRS=1 ` . The shell and
390- PowerShell installers do not resolve ` VP_*_DIR ` , XDG variables, platform
391- defaults, or legacy installs themselves :
405+ PowerShell installers validate the split override group, but they do not
406+ resolve ` VP_*_DIR ` , XDG variables, platform defaults, or legacy installs:
392407
393408- A current split-aware binary prints the layout mode and one tab-separated line
394409 for each category root. The categories are ` bin ` , ` data ` , ` cache ` , ` config ` ,
@@ -431,7 +446,10 @@ directories for the success summary.
431446The wrapper install uses managed Node.js and pnpm. These tools get their paths
432447from the process-wide ` EnvConfig ` , which resolves before the fallback. Therefore,
433448the tools first go into the unused split data root. ` do_install ` removes this
434- root if the current run created it.
449+ root if the current run created it. Before the probe, ` vp-setup ` records
450+ whether the split data parent exists. After a legacy fallback, it removes that
451+ parent with a non-recursive operation if the current run created it and left it
452+ empty. Existing parents and parents with new contents remain in place.
435453
436454The interactive menu has one known limit. It shows the split directories before
437455the download. For a pinned pre-split version, the user confirms those
@@ -452,6 +470,11 @@ define the boundary.
452470pre-split release without ` VP_HOME ` . They check the monolithic layout, the
453471absence of split roots, and commands that run through ` PATH ` .
454472
473+ The ` test-vp-setup-exe ` job rejects each incomplete split-variable combination,
474+ a relative ` VP_HOME ` , and a relative complete split group. It checks that
475+ validation creates no requested or default roots. The pinned ` 0.2.9 ` case
476+ checks that the legacy install works and that no empty split root remains.
477+
455478This mechanism also keeps fresh default installs of ` latest ` functional before
456479the 0.3.0 release becomes available.
457480
0 commit comments