@@ -237,7 +237,7 @@ func readDependencies(
237
237
isDev bool ,
238
238
bar * progressbar.ProgressBar ,
239
239
filter string ,
240
- ) {
240
+ ) ( lockedDependencyCount int ) {
241
241
242
242
var wg sync.WaitGroup
243
243
semaphoreChan := make (chan struct {}, concurrencyLimit )
@@ -265,6 +265,12 @@ func readDependencies(
265
265
continue
266
266
}
267
267
268
+ if versionPrefix == "" {
269
+ fmt .Printf (" is locked to version %s, skipping..." , cleanCurrentVersion )
270
+ lockedDependencyCount ++
271
+ continue
272
+ }
273
+
268
274
wg .Add (1 )
269
275
270
276
go func (dependency string , currentVersion string ) {
@@ -343,7 +349,7 @@ func readDependencies(
343
349
// Wait for all goroutines to complete
344
350
wg .Wait ()
345
351
close (doneChan )
346
-
352
+ return lockedDependencyCount
347
353
}
348
354
349
355
func Init (cfg npm.CmdFlags ) {
@@ -367,11 +373,14 @@ func Init(cfg npm.CmdFlags) {
367
373
bar := initProgressBar (totalDependencyCount )
368
374
369
375
// Process dependencies
370
- readDependencies (dependencies , versionComparison , false , bar , cfg .Filter )
376
+ var lockedDependencyCount int
377
+ var lockedDevDependencyCount int
378
+
379
+ lockedDependencyCount = readDependencies (dependencies , versionComparison , false , bar , cfg .Filter )
371
380
372
381
// Process devDependencies
373
382
if ! cfg .NoDev {
374
- readDependencies (devDependencies , versionComparison , true , bar , cfg .Filter )
383
+ lockedDevDependencyCount = readDependencies (devDependencies , versionComparison , true , bar , cfg .Filter )
375
384
}
376
385
377
386
// Count total dependencies and filtered dependencies
@@ -401,6 +410,12 @@ func Init(cfg npm.CmdFlags) {
401
410
fmt .Println ("Filtered" , aurora .Blue (filteredDependencyCount ), "dependencies from a total of" , aurora .Blue (totalDependencyCount ))
402
411
} else {
403
412
fmt .Println ("Total dependencies: " , aurora .Cyan (filteredDependencyCount ))
413
+
414
+ totalLockedDependencyCount := lockedDependencyCount + lockedDevDependencyCount
415
+ if totalLockedDependencyCount > 0 {
416
+ s := fmt .Sprintf ("Locked dependencies: %d" , totalLockedDependencyCount )
417
+ fmt .Println (aurora .Faint (s ))
418
+ }
404
419
}
405
420
406
421
printSummary (totalCount , majorCount , minorCount , patchCount )
@@ -422,28 +437,6 @@ func Init(cfg npm.CmdFlags) {
422
437
423
438
for {
424
439
425
- if value .VersionPrefix == "" {
426
- isDevDependencyText := ""
427
- if value .IsDev {
428
- isDevDependencyText = aurora .Sprintf (
429
- aurora .Magenta (" (devDependency)" ),
430
- )
431
- }
432
-
433
- message := aurora .Sprintf (
434
- aurora .Yellow ("Upgrade ignored because package \" %s\" %s is locked to version %s" ),
435
- key ,
436
- isDevDependencyText ,
437
- value .Current ,
438
- )
439
-
440
- fmt .Println (message )
441
-
442
- updateProgressCount ++
443
- break
444
-
445
- }
446
-
447
440
response := cli .PromptUpdateDependency (
448
441
key ,
449
442
value .Current ,
0 commit comments