Commit 154537a
docs: add RFC for add/remove package commands with workspace support
Add comprehensive RFC for `vite add` and `vite remove` commands that provide
a unified interface for package management across pnpm/yarn/npm with full
workspace support following pnpm's API design.
Key features:
- Auto-detection of package manager (pnpm/yarn/npm)
- Multiple package support in single command
- Workspace filtering with pnpm-inspired syntax (--filter)
- Workspace root operations (-w flag)
- Workspace protocol support (--workspace for pnpm)
- Common flag translation (-D, -E, -P, -O, -g)
- Command aliases (rm, un, uninstall)
- No caching overhead (direct execution)
Filter patterns (pnpm-focused):
- Exact match: --filter app
- Wildcards: --filter "app*"
- Scope: --filter "@myorg/*"
- Exclusion: --filter "!test*"
- Dependencies: --filter "app..."
- Graceful degradation for yarn/npm
Examples:
vite add react --filter app
vite add @myorg/utils --workspace --filter web
vite add typescript -D -w
vite remove lodash --filter "app*"
Implementation follows existing install command pattern with new
add.rs and remove.rs modules. Package manager adapter provides
command translation with proper argument ordering for each PM.
RFC includes:
- Complete command mapping for all package managers
- Workspace filter patterns and compatibility matrix
- Implementation architecture with code samples
- Test strategy with 12 test cases
- Real-world monorepo workflow examples
- Phased implementation plan (MVP → Workspace → Advanced)
- 1,373 lines of comprehensive design documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 096aca2 commit 154537a
1 file changed
Lines changed: 1412 additions & 0 deletions
0 commit comments