GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat!: XDG directory layout via VpDirs by forehalo · Pull Request #2346 · voidzero-dev/vite-plus

Conversation

@forehalo

@forehalo forehalo commented Aug 5, 2026 •
edited by fengmk2
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Close #827

Summary

Centralize Vite+ directory resolution in vp_shared::VpDirs and use a split XDG/platform layout for fresh installs.

Fresh Unix installs now place all Vite+-managed executables in an application-owned directory:

~/.local/share/vite-plus/bin

Existing installs under ~/.vite-plus keep their monolithic layout. This PR does not migrate installed files.

Directory layout

Category Unix default Windows default Monolithic VP_HOME
bin ~/.local/share/vite-plus/bin %LOCALAPPDATA%\vite-plus\bin <root>/bin
data ~/.local/share/vite-plus %LOCALAPPDATA%\vite-plus\data <root>
cache ~/.cache/vite-plus %LOCALAPPDATA%\vite-plus\cache <root>/cache
config ~/.config/vite-plus %APPDATA%\vite-plus <root>
state ~/.local/state/vite-plus %LOCALAPPDATA%\vite-plus\state <root>

The Unix bin directory lives under <DATA> because Vite+ manages more than the vp executable. It also manages Node.js, package-manager, and global-package dispatch shims. A private bin avoids collisions with unrelated executables in ~/.local/bin.

Resolution order

VpDirs resolves each category from these sources:

  1. An absolute VP_HOME
  2. An existing default ~/.vite-plus install that contains current
  3. Absolute VP_BIN_DIR, VP_DATA_DIR, or VP_CACHE_DIR overrides
  4. XDG base directories on Unix
  5. Platform defaults

VP_BIN_DIR takes precedence for the bin category. When it is unset, an absolute VP_DATA_DIR also supplies <DATA>/bin.

On Unix, XDG_DATA_HOME resolves data to $XDG_DATA_HOME/vite-plus and bin to $XDG_DATA_HOME/vite-plus/bin. Vite+ no longer uses XDG_BIN_HOME or derives a sibling bin from $XDG_DATA_HOME/../bin.

Relative VP_* and XDG values are ignored.

Bin ownership

The default Unix and Windows bin directories are application-owned.

A user-supplied VP_BIN_DIR remains potentially shared. Installers, env setup, package shim management, and vp implode retain per-entry ownership checks for this case:

  • Preserve entries that Vite+ cannot identify as its own.
  • Verify symlink targets or Windows trampoline sidecars before replacement or removal.
  • Do not recursively remove a separately resolved custom bin directory.

The Unix default bin is removed with its containing data root during vp implode.

Centralized installer resolution

The shell and PowerShell installers use the selected Vite+ binary as the directory source of truth.

A split-aware binary reports the resolved bin, data, cache, config, and state paths through VP_DUMP_DIRS=1. Installers consume those paths without reproducing VP_HOME, XDG, Windows known-folder, or legacy-grandfathering logic.

External integrations should use the same interface instead of reconstructing <BIN> from $HOME or platform conventions.

The installers also:

  • Preserve foreign Node.js and package executable entries in custom bins.
  • Render config paths safely for Bash, Zsh, Fish, and Nushell.
  • Keep shell $HOME separate from the Windows profile used for directory resolution.
  • Fall back to the monolithic layout when installing a pre-split Vite+ release.

Compatibility and upgrades

Existing default installs remain under ~/.vite-plus. vp upgrade updates them in place.

Fresh installs use the split layout. A split install rejects upgrades to releases older than the first split-aware version and directs the user to upgrade to the latest release.

The upgrade guide documents how users can move an existing install to the split layout by running vp implode, unsetting VP_HOME, and reinstalling. Automatic migration remains follow-up work.

User impact

Install state Behavior
Existing ~/.vite-plus install Keeps the monolithic layout
Custom VP_HOME Keeps the single-root mapping
Fresh Unix install Uses ~/.local/share/vite-plus/bin and the split XDG roots
Fresh Windows install Uses Local/Roaming application-data roots
Custom VP_BIN_DIR Uses strict per-entry ownership checks
Pre-split target version Uses the monolithic fallback or is rejected by a split install upgrade

Follow-up work

  • chore: remove remaining VP_HOME usage (especially snapshot tests) #2371: Remove remaining assumptions that VP_HOME is the primary install root.
  • feat: migrate ~/.vite-plus into split VP_*/XDG dirs on vp upgrade #2372: Migrate default monolithic installs during vp upgrade.

Test plan

  • vp check
  • cargo test -p vp_shared
  • cargo test -p vp_installer
  • Global CLI env setup, implode, and global-install tests
  • Fresh install.sh smoke test with VP_DUMP_DIRS
  • Installer CI coverage for fresh split, legacy grandfathering, custom shared bins, and pre-split releases
  • Shell config path escaping tests
  • Windows trampoline ownership and directory-resolution tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jong-kyung and ekhodx reacted with rocket emoji liangmiQwQ reacted with eyes emoji
All reactions
  • 🚀 2 reactions
  • 👀 1 reaction
@netlify

netlify Bot commented Aug 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit bbf954d
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a856758ed0ee04108d0b08a
😎 Deploy Preview https://deploy-preview-2346--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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 mentioned this pull request Aug 5, 2026
feat: remove VP_HOME and default installers to the split XDG layout #2349
Closed
@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 2 times, most recently 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
@fengmk2

fengmk2 commented Aug 7, 2026

Copy link
Copy Markdown
Member

@liangmiQwQ Your refactor needs to wait until this merge is completed first, as the changes are expected to be quite significant.

liangmiQwQ reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 7, 2026
chore: remove remaining VP_HOME usage (especially snapshot tests) #2371
Open
feat: migrate ~/.vite-plus into split VP_*/XDG dirs on vp upgrade #2372
Closed
@forehalo
forehalo force-pushed the feat/dirs-path-resolution branch from 78a23b6 to a433ed4 Compare August 7, 2026 09:29
@forehalo
forehalo marked this pull request as ready for review August 7, 2026 09:29
@socket-security

socket-security Bot commented Aug 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​temp-env@​0.3.68710093100100

View full report

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@forehalo
forehalo force-pushed the feat/dirs-path-resolution branch 3 times, most recently from 6b26e69 to ca9dcca Compare August 7, 2026 12:17
@fengmk2 fengmk2 self-assigned this Aug 7, 2026
@fengmk2

This comment was marked as resolved.

Sign in to view
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liangmiQwQ

liangmiQwQ commented Aug 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

IMO, I would be a little bit curious about the benefit for this move. The current VP_HOME layout has been working well, the similar single-root approaches are also used by tools like Cargo, Bun, and Volta. Moving to a new layout is not a low-cost change: it affects existing installations, upgrade paths, user workflows, and debugging. For a released tool, I think we should carefully evaluate the trade-offs.

For example, I help maintain the Vite+'s global package installations in several, I'm concerned that using ~/.local/bin may introduce heavier binary conflicts and overlapping issues. I'm not sure if ~/.local/bin, a public bin location, should be managed (even partially) by Vite+.

I'm not against this direction, I just want to understand the motivation and the problem it solves. If it does help Vite+ improve, then now is really a good time to implement it (before RC).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

fengmk2
fengmk2 reviewed Aug 7, 2026
View reviewed changes
Comment thread rfcs/directory-layout.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 mentioned this pull request Aug 9, 2026
ci: deploy production docs on release, main preview on push #2389
Merged
@fengmk2

fengmk2 commented Aug 10, 2026

Copy link
Copy Markdown
Member

@liangmiQwQ Following the XDG directory convention will allow Vite+ to be more widely accepted, and many mature developer tools follow this convention, such as Claude Code and uv astral-sh/uv#8420

liangmiQwQ reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@forehalo
forehalo force-pushed the feat/dirs-path-resolution branch 2 times, most recently from ad9d7dd to 5cc3b6c Compare August 10, 2026 06:07
@fengmk2 fengmk2 added the preview-build Publish this PR's commits to the registry bridge as preview builds label Aug 10, 2026
@forehalo
forehalo marked this pull request as draft August 10, 2026 06:33
fengmk2 added 5 commits August 19, 2026 09:51
@fengmk2
docs(rfc): clarify XDG bin semantics
59970d3
@fengmk2
test(installer): assert platform-specific bin layout
c8ad597
@fengmk2
fix(installer): preserve setup-vp legacy path
0e3c4ee
@fengmk2
fix(env): escape directory paths in shell files
015af1d
@fengmk2
docs: clear directory overrides during layout migration
940a1ea
@fengmk2
fengmk2 force-pushed the feat/dirs-path-resolution branch from 756bf47 to 940a1ea Compare August 19, 2026 02:06
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Aug 19, 2026
This was referenced Aug 19, 2026
chore(deps): update vite-plus to v0.3.0 node-modules/urllib#874
Merged
test: use Vite+ PR 2346 preview cnpm/cnpmcore#1131
Closed
@fengmk2
chore: simplify directory layout language
11f389d
@fengmk2 fengmk2 mentioned this pull request Aug 19, 2026
test: use latest Vite+ and setup-vp builds voidzero-dev/pkg-pr-registry-bridge#106
Closed
fengmk2 added 3 commits August 19, 2026 13:20
@fengmk2
fix(trampoline): preserve split directory layout
6e39547
@fengmk2
fix(implode): defer locked Windows shim removal
f17ae1c
@fengmk2
fix(env): write PowerShell setup as UTF-8 BOM
d9cb5d8
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Aug 19, 2026
fengmk2 added 3 commits August 19, 2026 14:09
@fengmk2
test(env): check the first resolved Windows shim
b1f154c
@fengmk2
fix(implode): complete deferred Windows root cleanup
0d6318a
@fengmk2
fix(dirs): require complete directory overrides
2922dfc
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Aug 19, 2026
@fengmk2
fix(ci): pass directory layout checks
bbf954d
@fengmk2 fengmk2 mentioned this pull request Aug 19, 2026
Windows: deferred implode cleanup leaves payloads with paths over 260 characters #2502
Closed
fengmk2
fengmk2 approved these changes Aug 19, 2026
View reviewed changes
@fengmk2
fengmk2 merged commit d43c5f9 into voidzero-dev:main Aug 19, 2026
123 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@forehalo
forehalo deleted the feat/dirs-path-resolution branch August 20, 2026 06:52
@fengmk2 fengmk2 mentioned this pull request Aug 23, 2026
release: v0.3.0: XDG install layout, tsup project migration, and Bun 1.4 support #2536
Merged
@BrewTestBot BrewTestBot mentioned this pull request Aug 24, 2026
vite-plus 0.3.1 Homebrew/homebrew-core#300377
Merged
2 tasks done
@liangmiQwQ liangmiQwQ mentioned this pull request Sep 19, 2026
Install in LocalAppData on Windows #1592
Closed
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@fengmk2 fengmk2 fengmk2 approved these changes
+1 more reviewer
@naokihaba naokihaba naokihaba approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@fengmk2 fengmk2

Labels

preview-build Publish this PR's commits to the registry bridge as preview builds test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

use xdg config

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@forehalo @fengmk2 @liangmiQwQ @naokihaba
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.