voidzero-dev / voidzero-dev/vite-plus

Orphaned BinConfig entries not cleaned up on package reinstall

オープン
#1,370 コメント 1 件 リアクション 0 件 担当者 1 名 @fengmk2 が担当を希望しています GitHub で見る
主要言語
Rust
スター
5.8k
フォーク
262
平均マージ
23時間 41分
マージ済み PR(30日)
138

説明

## Problem

When a globally installed package removes a binary between versions (e.g., `typescript` drops `tsserver`), reinstalling the package via `vp install -g` does not prune the old `BinConfig` entry from `~/.vite-plus/bins/`.

These orphaned entries:
- Still resolve through `shim::dispatch` and then fail when the binary is no longer in `package.json`
- Get refreshed on every Windows upgrade by `refresh_package_shims()`, and can recreate `.exe` files even if manually removed

## Relevant code

- `crates/vite_global_cli/src/commands/env/global_install.rs` — reinstall path does not diff old vs new binaries
- `crates/vite_global_cli/src/commands/env/bin_config.rs` — `BinConfig` entries persist indefinitely
- `crates/vite_global_cli/src/shim/dispatch.rs` — resolves stale configs, then fails at runtime

## Expected behavior

When reinstalling a global package, compare the new set of binaries against the existing `BinConfig` entries for that package and remove any that are no longer provided.

Found during code review of #1349.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。