Skip to content

chore(install): reduce retained vp versions from 5 to 3#1716

Draft
fengmk2 wants to merge 4 commits into
mainfrom
chore/keep-3-vp-versions
Draft

chore(install): reduce retained vp versions from 5 to 3#1716
fengmk2 wants to merge 4 commits into
mainfrom
chore/keep-3-vp-versions

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented May 30, 2026

What

Lower the global vp version-retention limit from 5 → 3 across all three install paths that manage ~/.vite-plus:

Path Location
Rust (installer binary + vp upgrade) crates/vite_setup/src/lib.rsMAX_VERSIONS_KEEP
Shell bootstrap (curl … | sh) packages/cli/install.shmax_versions
PowerShell bootstrap (irm … | iex) packages/cli/install.ps1$maxVersions

Why

The 5 was an undocumented default. Keeping 3 cuts ~/.vite-plus disk usage (~60–90MB instead of ~100–150MB) while still leaving rollback headroom. The cleanup logic is fully parameterized and the protected-versions safeguard is unchanged — the active and previous versions are never pruned regardless of the limit, so a downgrade/rollback target is always preserved.

Behavior change applies to future cleanup runs only (next install / vp upgrade); it does not retroactively prune existing machines.

Also updated

  • RFCs synced to the new number: rfcs/global-cli-rust-binary.md, rfcs/upgrade-command.md (incl. the disk-math line), rfcs/windows-installer.md.
  • Docs: added a concise Rollback section to docs/guide/upgrade.md documenting the 3-version retention and vp upgrade --rollback.

Testing

  • cargo test -p vite_setup → 14/14 passing. The existing cleanup_old_versions tests pass explicit max_keep values, so they exercise the generic logic independently of the constant.
  • Doc/RFC edits are text-only.

Note

Low Risk
Config and documentation only; cleanup semantics and protected-version safeguards are unchanged, so rollback safety is preserved with slightly less disk headroom.

Overview
Retained global vp versions drop from 5 → 3 everywhere post-install cleanup runs: MAX_VERSIONS_KEEP in vite_setup (used by vp upgrade and vp-setup.exe), plus max_versions / $maxVersions in install.sh and install.ps1. Pruning still only targets semver dirs under ~/.vite-plus; active and previous versions stay protected for rollback—the limit only caps how many other old copies remain.

Docs: docs/guide/upgrade.md now documents vp upgrade --check, a Rollback subsection (vp upgrade --rollback, 3-version retention), and clarifies upgrade command examples.

RFCs (global-cli-rust-binary, upgrade-command, windows-installer) are updated to say “keep max 3” and the lower disk estimate (~60–90MB vs ~100–150MB). Behavior change applies on the next install or upgrade, not as a one-time migration on existing machines.

Reviewed by Cursor Bugbot for commit b933a20. Configure here.

Lower MAX_VERSIONS_KEEP and the install.sh / install.ps1 cleanup limit from 5 to 3. This cuts ~/.vite-plus disk usage (~60-90MB instead of ~100-150MB) while keeping enough rollback headroom — the active and previous versions stay protected from cleanup regardless of the limit.

Applies to future cleanup runs (next install/upgrade). Syncs the related RFCs and documents the retention/rollback behavior in the upgrade guide.
@fengmk2 fengmk2 self-assigned this May 30, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 30, 2026

Deploy Preview for viteplus-preview canceled.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: 4d45efb

@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented May 30, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b933a20. Configure here.

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.

1 participant