@@ -140,7 +140,7 @@ The standard directory structure for a Rush monorepo is as follows:
140140
141141 // Allow certain dependencies to use multiple different versions
142142 "allowedAlternativeVersions" : {
143- "typescript" : [" ~4.5.0 " , " ~4. 6.0" ]
143+ "typescript" : [" ~4.6.0" ]
144144 }
145145 }
146146 ```
@@ -193,32 +193,36 @@ Choose the correct command tool based on different scenarios:
193193
194194## 3.2 Common Commands Explained
195195
196- 1 . `rush update`
197- - Function: Install and update dependencies
196+ 1 . `rush install`
197+ - Function: Install dependencies based on existing shrinkwrap file
198+ - Features:
199+ - Most common day-to-day dependency command
200+ - Read-only operation, won't modify shrinkwrap file
201+ - Suitable for CI environment
198202 - Important parameters:
199203 - `-p, --purge`: Clean before installation
200204 - `--bypass-policy`: Bypass gitPolicy rules
201205 - `--no-link`: Don't create project symlinks
202- - `--network-concurrency COUNT`: Limit concurrent network requests
203206 - Use cases:
204207 - After first cloning repository
205208 - After pulling new Git changes
206- - After modifying package.json
207- - When dependencies need updating
209+ - After switching branches
210+ - CI/CD pipeline
211+ - Ensuring dependency version consistency
212+ - Avoiding accidental shrinkwrap file updates
208213
209- 2 . `rush install`
210- - Function: Install dependencies based on existing shrinkwrap file
211- - Features:
212- - Read-only operation, won't modify shrinkwrap file
213- - Suitable for CI environment
214+ 2 . `rush update`
215+ - Function: Update dependencies and lockfiles
214216 - Important parameters:
215217 - `-p, --purge`: Clean before installation
216218 - `--bypass-policy`: Bypass gitPolicy rules
217219 - `--no-link`: Don't create project symlinks
220+ - `--network-concurrency COUNT`: Limit concurrent network requests
218221 - Use cases:
219- - CI/CD pipeline
220- - Ensuring dependency version consistency
221- - Avoiding accidental shrinkwrap file updates
222+ - Run only when `rush install` explicitly reports that `rush update` is required (do not run it preemptively)
223+ - Commit hygiene:
224+ - Commit files modified by `rush update` in a dedicated commit named `(chore) rush update`
225+ - During a rebase, drop all `(chore) rush update` commits, rerun `rush update`, and create a fresh `(chore) rush update` commit
222226
2232273 . `rush build`
224228 - Function: Incremental project build
@@ -290,7 +294,7 @@ Specify in `rush.json`:
290294
291295 // Allow certain dependencies to use multiple versions
292296 "allowedAlternativeVersions" : {
293- "typescript" : [" ~4.5.0 " , " ~4. 6.0" ]
297+ "typescript" : [" ~4.6.0" ]
294298 }
295299 }
296300 ```
@@ -398,7 +402,7 @@ When running commands like `install`, `update`, `build`, `rebuild`, etc., by def
3984021. Dependency Issue Handling
399403 - Avoid directly using `npm`, `pnpm`, `yarn` package managers
400404 - Use `rush purge` to clean all temporary files
401- - Run `rush update --recheck` to force check all dependencies
405+ - Run `rush install` first; only run `rush update` if `rush install` explicitly tells you to do so
402406
4034072. Build Issue Handling
404408 - Use `rush rebuild` to skip cache and perform complete build
0 commit comments