@@ -307,6 +307,20 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
307
307
) ;
308
308
}
309
309
310
+ if ( options . all ) {
311
+ const updateCmd = this . packageManager === PackageManager . Yarn
312
+ ? `'yarn upgrade-interactive' or 'yarn upgrade'`
313
+ : `'${ this . packageManager } update'` ;
314
+
315
+ this . logger . warn ( `
316
+ '--all' functionality has been removed as updating multiple packages at once is not recommended.
317
+ To update packages which don’t provide 'ng update' capabilities in your workspace 'package.json' use ${ updateCmd } instead.
318
+ Run the package manager update command after updating packages which provide 'ng update' capabilities.
319
+ ` ) ;
320
+
321
+ return 0 ;
322
+ }
323
+
310
324
const packages : PackageIdentifier [ ] = [ ] ;
311
325
for ( const request of options [ '--' ] || [ ] ) {
312
326
try {
@@ -342,24 +356,15 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
342
356
}
343
357
}
344
358
345
- if ( options . all && packages . length > 0 ) {
346
- this . logger . error ( 'Cannot specify packages when using the "all" option.' ) ;
347
-
348
- return 1 ;
349
- } else if ( options . all && options . migrateOnly ) {
350
- this . logger . error ( 'Cannot use "all" option with "migrate-only" option.' ) ;
351
-
352
- return 1 ;
353
- } else if ( ! options . migrateOnly && ( options . from || options . to ) ) {
359
+ if ( ! options . migrateOnly && ( options . from || options . to ) ) {
354
360
this . logger . error ( 'Can only use "from" or "to" options with "migrate-only" option.' ) ;
355
361
356
362
return 1 ;
357
363
}
358
364
359
365
// If not asking for status then check for a clean git repository.
360
366
// This allows the user to easily reset any changes from the update.
361
- const statusCheck = packages . length === 0 && ! options . all ;
362
- if ( ! statusCheck && ! this . checkCleanGit ( ) ) {
367
+ if ( packages . length && ! this . checkCleanGit ( ) ) {
363
368
if ( options . allowDirty ) {
364
369
this . logger . warn (
365
370
'Repository is not clean. Update changes will be mixed with pre-existing changes.' ,
@@ -379,7 +384,6 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
379
384
if (
380
385
options . migrateOnly === undefined &&
381
386
options . from === undefined &&
382
- ! options . all &&
383
387
packages . length === 1 &&
384
388
packages [ 0 ] . name === '@angular/cli' &&
385
389
this . workspace . configFile &&
@@ -395,25 +399,14 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
395
399
396
400
this . logger . info ( `Found ${ rootDependencies . size } dependencies.` ) ;
397
401
398
- if ( options . all ) {
399
- // 'all' option and a zero length packages have already been checked.
400
- // Add all direct dependencies to be updated
401
- for ( const dep of rootDependencies . keys ( ) ) {
402
- const packageIdentifier = npa ( dep ) ;
403
- if ( options . next ) {
404
- packageIdentifier . fetchSpec = 'next' ;
405
- }
406
-
407
- packages . push ( packageIdentifier ) ;
408
- }
409
- } else if ( packages . length === 0 ) {
402
+ if ( packages . length === 0 ) {
410
403
// Show status
411
404
const { success } = await this . executeSchematic ( '@schematics/update' , 'update' , {
412
405
force : options . force || false ,
413
406
next : options . next || false ,
414
407
verbose : options . verbose || false ,
415
408
packageManager : this . packageManager ,
416
- packages : options . all ? rootDependencies . keys ( ) : [ ] ,
409
+ packages : [ ] ,
417
410
} ) ;
418
411
419
412
return success ? 0 : 1 ;
0 commit comments