Commit 72e914d
feat(pm): add vite install command with package manager support
Implements a comprehensive package manager installation system that automatically
detects and downloads the appropriate package manager (npm, yarn, pnpm) based on
lockfiles, configuration files, and package.json settings.
Key features:
- Automatic package manager detection from multiple sources
- Support for pnpm, yarn (including v2+), and npm
- Intelligent version resolution with semver support
- Automatic shim generation for cross-platform compatibility
- HTTP client with automatic retry support using backon
- Workspace root and package root detection utilities
- Path filtering for cache optimization using gitignore-style patterns
- Comprehensive test coverage with mocked HTTP requests
Detection priority order:
1. packageManager field in package.json
2. pnpm-workspace.yaml
3. Lock files (pnpm-lock.yaml, yarn.lock, package-lock.json)
4. Config files (pnpmfile.cjs, yarn.config.cjs, .yarnrc.yml)
The implementation ensures consistent package manager usage across the monorepo
and automatically updates the packageManager field when detecting from other sources.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 8c1c5c1 commit 72e914d
20 files changed
Lines changed: 4272 additions & 35 deletions
File tree
- .github/workflows
- crates
- vite_error
- src
- vite_package_manager
- src
- vite_path/src
- vite_task
- docs
- src
- config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
0 commit comments