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
In my opinion, there is room to improve the current package manager management system.
At present, Vite+ places the pm under $VP_HOME/package_manager, whether it's local CLI or global CLI
For global CLI, it's fine.
But for local CLI, there is room to improve. Vite+ allows local CLI runs without installing global CLI, if there is no global CLI installed and users run vp install in package json scripts or tasks, ~/.vite-plus will still be generated, leaving hard-to-find cache files and influence future probable Vite+ global CLI installation.
There are some Vite+ features that need package manager available, but since it's not able to make sure pnpm binary exists, Vite+ has to find the exact package manager in VPHOME, make the behavior inconsistent and cause problems like Do not update package.json when running vpr #2374.
corepack only handles pnpm, yarn, npm. But Vite+ can handle more package managers like bun, which causes confuse
One goal of Vite+ is to help beginners learn/use JavaScript, they've already known Vite+ helps manage package manager, it will be quite confusing to introduce another one. Learning corepack this concept itself also brings pressure.
Manage package managers through vp env
Extend vp env from Node.js-only management to a complete JavaScript environment: Node.js plus a selected package manager. Commands such as pin, use, install, clean, and current can manage either component.
Run package managers from PATH
Ordinary commands detect the appropriate manager and execute the binary available on PATH. They no longer download a manager, modify PATH, or write package-manager metadata to package.json. A Vite+ shim may still be the binary on PATH, so managed versions remain supported.
The goal is to separate three responsibilities that are currently mixed together:
detecting which package manager a project uses;
provisioning managed versions through vp env and shims;
executing ordinary package-manager commands.
This addresses the unexpected package.json mutation reported in #2374, avoids project-local Vite+ installations creating hidden global state, and removes the overlap between Corepack and Vite+ package-manager management.
The change is technically breaking, but the common workflow should remain mostly unchanged. The main affected cases are Corepack-specific usage, scripts consuming vp env --json, and local-only installations without a package manager on PATH.
In my opinion, there is room to improve the current package manager management system.
At present, Vite+ places the pm under
$VP_HOME/package_manager, whether it's local CLI or global CLIvp installin package json scripts or tasks,~/.vite-pluswill still be generated, leaving hard-to-find cache files and influence future probable Vite+ global CLI installation.pnpmbinary exists, Vite+ has to find the exact package manager inVPHOME, make the behavior inconsistent and cause problems like Do not updatepackage.jsonwhen runningvpr#2374.To get pm's binaries,
corepackwas introduced in feat(env): add corepack to the default shims tool list #1808.corepackonly handlespnpm,yarn,npm. But Vite+ can handle more package managers like bun, which causes confusecorepackthis concept itself also brings pressure.corepacknow mainly handlescorepackcan't read Vite+'s downloaded package managers, means the same pm might be downloaded twice.Proposed package-manager refactor plan
The refactor is split into three dependent but independently mergeable parts:
Replace Corepack with Vite+-owned shims
PR feat(env)!: replace Corepack with package manager shims #2391 removes the Corepack integration.
vp env setupdirectly provides shims for npm, pnpm, Yarn, and Bun.Manage package managers through
vp envExtend
vp envfrom Node.js-only management to a complete JavaScript environment: Node.js plus a selected package manager. Commands such aspin,use,install,clean, andcurrentcan manage either component.Run package managers from
PATHOrdinary commands detect the appropriate manager and execute the binary available on
PATH. They no longer download a manager, modifyPATH, or write package-manager metadata topackage.json. A Vite+ shim may still be the binary onPATH, so managed versions remain supported.The goal is to separate three responsibilities that are currently mixed together:
vp envand shims;This addresses the unexpected
package.jsonmutation reported in #2374, avoids project-local Vite+ installations creating hidden global state, and removes the overlap between Corepack and Vite+ package-manager management.The change is technically breaking, but the common workflow should remain mostly unchanged. The main affected cases are Corepack-specific usage, scripts consuming
vp env --json, and local-only installations without a package manager onPATH.