feat: XDG directory layout via VpDirs - #2346
Draft
forehalo wants to merge 5 commits into
Draft
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
forehalo
force-pushed
the
feat/dirs-path-resolution
branch
4 times, most recently
from
August 5, 2026 17:13
b8069a5 to
2f8be03
Compare
forehalo
force-pushed
the
feat/dirs-path-resolution
branch
from
August 6, 2026 07:54
8fa20f7 to
08b7589
Compare
Replace get_vp_home / the monolithic home module with VpDirs: category roots (bin, data, cache) come from an ordered resolution chain in dirs/resolution.rs (Home/CurrentDir Exist-gated grandfathering, then VP_* and XDG Set overrides, then platform defaults), and first-level data subdirs (current, js_runtime, package_manager, packages, bins) are pure joins. Files and deeper trees stay with their features. Migrate every Rust consumer off the old home helpers onto VpDirs, inject VP_BIN_DIR/VP_DATA_DIR/VP_CACHE_DIR into JS children under the split layout, and teach hooks/org-tarball to honor those roots. implode, env setup/doctor, and shims understand split vs legacy layouts. Groundwork for voidzero-dev#827.
Fresh installs land versions under the data dir and shims under the bin dir (XDG/platform defaults via VpDirs). install.sh, install.ps1, the Windows installer, Dockerfile, and trampoline switch accordingly; an existing ~/.vite-plus or explicit VP_HOME/--install-dir keeps the legacy monolithic root. Ship frozen legacy_install.sh/legacy_install.ps1 for CI combinations that still install a pre-split CLI, and document the installer env surface with VP_HOME as a deprecated override only.
Point standalone install CI at the frozen legacy installers so released pre-split CLIs keep installing correctly. Serve those scripts from the docs site, and run a split-layout install e2e against the registry-bridge preview build on same-repo PRs.
Provision the full legacy on-disk shape in the runner and drive isolated install cases through real binaries so path resolution follows VpDirs instead of injecting VP_HOME on every step.
forehalo
force-pushed
the
feat/dirs-path-resolution
branch
from
August 6, 2026 17:25
08b7589 to
4e2abdf
Compare
Legacy roots were incorrectly pinning bin/data/cache to the same path (the root). Restore the on-disk mapping: bin=<root>/bin, data=<root>, cache=<root>/cache, with Exist gated on the root so missing subdirs still grandfather. Re-introduce VP_HOME as a Set override, and resolve config/state through XDG/platform chains (not data_dir aliases) so env scripts match install.sh. Add VpDirs layout tests and CI jobs for: fresh split install + implode, and legacy-root upgrade + implode against the preview build.
Member
|
@liangmiQwQ Your refactor needs to wait until this merge is completed first, as the changes are expected to be quite significant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #827
Summary
Fresh installs use the split XDG/platform layout; existing
~/.vite-plusinstalls stay on the legacy monolithic root (grandfathered). Path placement is owned byvp_shared::VpDirs.Resolution chain
Home/CurrentDir(exist-gated legacy) →VP_*_DIR→XDG_*→ platform defaults (~/.local/bin,~/.local/share/vite-plus,~/.cache/vite-plus, …). Relative env values are ignored.Notable changes
VpDirs: category roots + first-level data dirs only; files/deeper trees stay with featuresVpDirs; JS getsVP_BIN_DIR/VP_DATA_DIR/VP_CACHE_DIRunder split layoutlegacy_install.*for pre-split CLI CI;VP_HOMEdeprecated but still honored as overridevp implode/ trampoline / Docker: both layoutsMigration
~/.vite-plusVP_HOME~/.local/binon PATHTest plan
cargo check/ clippy / fmt on touched cratesVP_HOME