Skip to content

feat: XDG directory layout via VpDirs - #2346

Draft
forehalo wants to merge 5 commits into
voidzero-dev:mainfrom
forehalo:feat/dirs-path-resolution
Draft

feat: XDG directory layout via VpDirs#2346
forehalo wants to merge 5 commits into
voidzero-dev:mainfrom
forehalo:feat/dirs-path-resolution

Conversation

@forehalo

@forehalo forehalo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Close #827

Summary

Fresh installs use the split XDG/platform layout; existing ~/.vite-plus installs stay on the legacy monolithic root (grandfathered). Path placement is owned by vp_shared::VpDirs.

Resolution chain

Home / CurrentDir (exist-gated legacy) → VP_*_DIRXDG_* → 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 features
  • Call sites: all Rust path construction goes through VpDirs; JS gets VP_BIN_DIR/VP_DATA_DIR/VP_CACHE_DIR under split layout
  • Installers: default to split layout; frozen legacy_install.* for pre-split CLI CI; VP_HOME deprecated but still honored as override
  • vp implode / trampoline / Docker: both layouts
  • CI: legacy installer path + split preview e2e

Migration

Install Impact
Existing ~/.vite-plus None
Custom VP_HOME Still works (deprecated)
Fresh Split layout; typically only ~/.local/bin on PATH

Test plan

  • cargo check / clippy / fmt on touched crates
  • Unit tests for resolution + migrated call sites
  • Snapshot fixtures updated off per-step VP_HOME
  • CI: standalone install (legacy scripts) + preview split install

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit edf2500
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a74c626d934090008da1f4d

@forehalo
forehalo force-pushed the feat/dirs-path-resolution branch 4 times, most recently from b8069a5 to 2f8be03 Compare August 5, 2026 17:13
@forehalo forehalo changed the title feat: introduce Dirs for unified XDG-aware path resolution feat: XDG-compliant directory layout via unified Dirs resolution Aug 6, 2026
@forehalo
forehalo force-pushed the feat/dirs-path-resolution branch from 8fa20f7 to 08b7589 Compare August 6, 2026 07:54
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
forehalo force-pushed the feat/dirs-path-resolution branch from 08b7589 to 4e2abdf Compare August 6, 2026 17:25
@forehalo forehalo changed the title feat: XDG-compliant directory layout via unified Dirs resolution feat: XDG directory layout via VpDirs Aug 6, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use xdg config

1 participant