Commit 08a11f1
authored
feat(cli): add outdated command for checking package updates (#262)
### TL;DR
Added a new `vite outdated` command to check for outdated packages, with support for all package managers (pnpm, npm, yarn).
### What changed?
- Added a new `outdated` command to the Vite CLI that checks for outdated packages
- Implemented package manager-specific command resolution for pnpm, npm, and yarn
- Added support for various output formats (table, list, JSON)
- Implemented workspace filtering with `--filter` flag
- Added dependency type filtering options (`--prod`, `--dev`, `--no-optional`)
- Added support for global package checking with `-g` flag
- Implemented special handling for yarn@2+ which uses `upgrade-interactive`
- Added appropriate warnings when flags aren't supported by specific package managers
### How to test?
```bash
# Basic usage
vite outdated
# Check specific packages
vite outdated react lodash
# Output formats
vite outdated --format json
vite outdated --format list
vite outdated --long
# Workspace operations
vite outdated --filter app
vite outdated -r
# Dependency type filtering (pnpm-specific)
vite outdated --prod
vite outdated --dev
vite outdated --no-optional
# Global packages
vite outdated -g
```
### Why make this change?
This command simplifies dependency management by providing a unified interface for checking outdated packages across all package managers. It automatically adapts to the detected package manager (pnpm/npm/yarn) and translates flags appropriately, making it easier for developers to maintain up-to-date dependencies without needing to remember different syntaxes for each package manager.1 parent d2e67f7 commit 08a11f1
28 files changed
Lines changed: 2752 additions & 17 deletions
File tree
- crates/vite_install/src/commands
- packages
- cli
- binding/src
- commands
- snap-tests/exit-non-zero-on-cmd-not-exists
- global/snap-tests
- cli-helper-message
- command-outdated-npm10-with-workspace
- packages
- app
- utils
- command-outdated-npm10
- command-outdated-pnpm10-with-workspace
- packages
- app
- utils
- command-outdated-pnpm10
- command-outdated-yarn4
- rfcs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
0 commit comments