chore(install): reduce retained vp versions from 5 to 3#1716
Draft
fengmk2 wants to merge 4 commits into
Draft
Conversation
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.
✅ Deploy Preview for viteplus-preview canceled.
|
Contributor
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
Member
Author
|
@cursor review |
There was a problem hiding this comment.
✅ 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.
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.
What
Lower the global
vpversion-retention limit from 5 → 3 across all three install paths that manage~/.vite-plus:vp upgrade)crates/vite_setup/src/lib.rs—MAX_VERSIONS_KEEPcurl … | sh)packages/cli/install.sh—max_versionsirm … | iex)packages/cli/install.ps1—$maxVersionsWhy
The
5was an undocumented default. Keeping 3 cuts~/.vite-plusdisk 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/global-cli-rust-binary.md,rfcs/upgrade-command.md(incl. the disk-math line),rfcs/windows-installer.md.docs/guide/upgrade.mddocumenting the 3-version retention andvp upgrade --rollback.Testing
cargo test -p vite_setup→ 14/14 passing. The existingcleanup_old_versionstests pass explicitmax_keepvalues, so they exercise the generic logic independently of the constant.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
vpversions drop from 5 → 3 everywhere post-install cleanup runs:MAX_VERSIONS_KEEPinvite_setup(used byvp upgradeandvp-setup.exe), plusmax_versions/$maxVersionsininstall.shandinstall.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.mdnow documentsvp 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.