Uh oh!
There was an error while loading. Please reload this page.
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 installation300547f to
2695939Comparevite add command for package installationvite add command for package installationUh oh!
There was an error while loading. Please reload this page.
2695939 to
5ffc1b5Compare1860a27 to
88f7e5bCompare5ffc1b5 to
921c4e8Comparevite add command for package installationa40e9f4 to
f33a8b1Compare88f7e5b to
91c00c5Compare579a820 to
61e86bfCompare91c00c5 to
39b091eCompare54197ef to
adba73bCompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
777bd7c to
20d51baCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
20d51ba to
23ad827CompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
23ad827 to
320d654Compare320d654 to
c6a3c8cCompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c6a3c8c to
25352cfCompareUh oh!
There was an error while loading. Please reload this page.
25352cf to
805bfaeCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
805bfae to
5004b6bCompare5004b6b to
6086205CompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6086205 to
cce1331Comparecce1331 to
1f4e6a9CompareThere 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.

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.