feat(pm): vite add command for package installation#221
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
vite add command for package installation
300547f to
2695939
Compare
154537a to
1860a27
Compare
vite add command for package installationvite add command for package installation
2695939 to
5ffc1b5
Compare
1860a27 to
88f7e5b
Compare
5ffc1b5 to
921c4e8
Compare
vite add command for package installationa40e9f4 to
f33a8b1
Compare
88f7e5b to
91c00c5
Compare
579a820 to
61e86bf
Compare
91c00c5 to
39b091e
Compare
54197ef to
adba73b
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 57 out of 57 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
777bd7c to
20d51ba
Compare
20d51ba to
23ad827
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 59 out of 60 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (2)
crates/vite_package_manager/src/add.rs:1
- The
argsparameter should be&[String]instead of&Vec<String>. Using a slice is more idiomatic and flexible in Rust.
use std::{collections::HashMap, process::ExitStatus};
packages/cli/binding/src/cli.rs:1
- This debug statement appears to be leftover from development. Consider removing it or clarifying if it's intentionally added for debugging purposes.
//! CLI types and logic moved from vite_task
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
23ad827 to
320d654
Compare
320d654 to
c6a3c8c
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
packages/tools/src/utils.ts:1
- Corrected spelling of 'passth rough' to 'passthrough'.
import { Minimatch } from 'minimatch';
packages/tools/src/utils.ts:1
- Corrected spelling of 'passth rough' to 'passthrough'.
import { Minimatch } from 'minimatch';
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
c6a3c8c to
25352cf
Compare
25352cf to
805bfae
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 6 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
805bfae to
5004b6b
Compare
5004b6b to
6086205
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
6086205 to
cce1331
Compare
cce1331 to
1f4e6a9
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

TL;DR
Added a new
vite addcommand to simplify adding packages to dependencies with automatic package manager detection.What changed?
AddCommandimplementation invite_task/src/add.rsthat handles adding packages to dependenciesbuild_add_argsmethod inPackageManagerto generate the correct command arguments for different package managers (npm, yarn, pnpm)How to test?
Test the new command with different package managers:
Why make this change?
This change simplifies the process of adding dependencies to projects by automatically detecting the package manager and translating the command to the appropriate syntax. It eliminates the need for users to remember different command formats for npm, yarn, and pnpm, especially in monorepo setups where workspace flags differ significantly between package managers.
Note
Introduces a unified
vite addcommand that detects pnpm/yarn/npm, builds correct args (filters, workspace/root/global, save flags), aliasesinstall <pkgs>to add, and adds error handling with extensive tests/snapshots.Addsubcommand incrates/vite_task/src/lib.rswith flags (-D/-P/-O/--save-peer,-E,--filter,-w,--workspace,-g, pass-through--).crates/vite_task/src/add.rs; prints resolved command and runs via task graph.install <PACKAGES>as alias toaddviaparse_install_as_add.crates/vite_package_manager/src/add.rswithAddCommandOptionsandSaveDependencyTypeandPackageManager::resolve_add_commandthat maps to pnpm/yarn/npm args (filters ordering, workspace/root, save flags, exact, catalogs,--allow-build, global via npm).crates/vite_package_manager/src/lib.rs.Error::NoPackagesSpecifiedincrates/vite_error/src/lib.rs.addand new outputs.packages/tools: normalize CI output; strip YarnYN0013inreplaceUnstableOutputwith new test.Written by Cursor Bugbot for commit b868089. This will update automatically on new commits. Configure here.