You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: more safer Vite+ global install and vp upgrade (#1338)
## Summary
related issues and PRs
- #1260
- #1272
- #833
- #834
This 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 `minimumReleaseAge` are 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.ps1` and `install.sh`.
## Changes
- Remove unconditional `minimum-release-age=0` override from `vp
upgrade` and standalone installers.
- Detect pnpm release-age failures from
`ERR_PNPM_NO_MATURE_MATCHING_VERSION`, `minimumReleaseAge` messages, and
guarded `ERR_PNPM_NO_MATCHING_VERSION` cases.
- Prompt users with a default-No warning before disabling release-age
protection for this Vite+ install only.
- Keep non-interactive environments blocked instead of adding a bypass
flag or env var.
- Preserve `install.log` / `upgrade.log` visibility for failure
diagnosis.
- Avoid passing `--silent` to the inner captured `vp install`, because
pnpm suppresses the release-age error body in silent mode.
- Add comments with pnpm source references explaining the release-age
detection signals.
.map_or_else(String::new, |p| format!(". See log for details: {}", p.as_path().display()));
204
+
205
+
if release_age_blocked {
206
+
format!(
207
+
"Upgrade blocked by your minimumReleaseAge setting. Wait until the package is old enough or adjust your package manager configuration explicitly{log_msg}"
208
+
)
209
+
}else{
210
+
format!("Failed to install production dependencies (exit code: {exit_code}){log_msg}")
211
+
}
212
+
}
213
+
125
214
/// Write stdout and stderr from a failed install to `upgrade.log`.
126
215
///
127
216
/// The log is written to the **parent** of `version_dir` (i.e. `~/.vite-plus/upgrade.log`)
b"ERR_PNPM_NO_MATCHING_VERSION No matching version found. Add the package name to minimumReleaseAgeExclude if you want to ignore the time it was published.",
0 commit comments