fix: more safer Vite+ global install and vp upgrade - #1338
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
@cpojer @TheAlexLichter Should the first-time installation of Vite+ follow this config as well? Wouldn’t that feel a bit strange? |
|
Yes, I would honor the settings for the first time install as well. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63c54eb115
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Hey guys, I am handling the package manager refactor (#2406) these days and noticed that. In my opinion, this is quite odd, and we should probably reconsider about that. First, I want to argue that the reason we call Second, this doesn't make sense for Vite+ itself's internal installation semantically. Unlike Third, if we indeed want to add a safety guard, the timing is not right. |
|
Thanks for the comment! I take the core point to be: this is not a user-project As long as we use pnpm here, we still have to handle the cooldown. Dropping pnpm and fetching So I think it is enough to fix only the timing of the prompt, rather than removing pnpm or writing our own resolver. I also agree we should not carry this after-the-fact prompt, retry, and partial rollback into the #2611 self-setup. Asking before setup starts fits that unification better. |
|
@kazupon Thank you! I don't think replacing For this question, I suggest directly bypassing pnpm's On the one hand,
On the other hand, if we move this prompt before everything starts, we have to read users' settings or set a random number, as Would it be okay? |
|
/cc @TheAlexLichter |
Summary
related issues and PRs
vp upgradefails whenminimumReleaseAgeis configured #1260vp upgrade#1272curl -fsSL https://vite.plus | bashfails silently whenvp installencounters an error #833This updates the release-age handling for the Vite+ global install/upgrade path so we no longer silently bypass package manager protections.
Users who configure pnpm
minimumReleaseAgeare explicitly trying to reduce supply-chain risk from newly published compromised packages.Instead of always writing
minimum-release-age=0, Vite+ now first runs the wrapper install normally.If pnpm blocks the install with a release-age error, Vite+ only writes the local override and retries after an interactive, default-No confirmation.
The same behavior is applied to the standalone install scripts, including
install.ps1andinstall.sh.Changes
minimum-release-age=0override fromvp upgradeand standalone installers.ERR_PNPM_NO_MATURE_MATCHING_VERSION,minimumReleaseAgemessages, and guardedERR_PNPM_NO_MATCHING_VERSIONcases.install.log/upgrade.logvisibility for failure diagnosis.--silentto the inner capturedvp install, because pnpm suppresses the release-age error body in silent mode.