@@ -612,7 +612,7 @@ async function addOverrides(
612
612
)
613
613
}
614
614
if ( spinner ) {
615
- spinner . text = `Adding overrides${ workspaceName ? ` to ${ workspaceName } ` : '' } ...`
615
+ spinner . text = `Adding overrides${ isWorkspace ? ` to ${ workspaceName } ` : '' } ...`
616
616
}
617
617
const depAliasMap = new Map < string , { id : string ; version : string } > ( )
618
618
// Chunk package names to process them in parallel 3 at a time.
@@ -635,7 +635,9 @@ async function addOverrides(
635
635
pkgSpec = `${ regSpecStartsLike } ^${ version } `
636
636
depObj [ origPkgName ] = pkgSpec
637
637
state . added . add ( regPkgName )
638
- state . addedInWorkspaces . add ( workspaceName )
638
+ if ( isWorkspace ) {
639
+ state . addedInWorkspaces . add ( workspaceName )
640
+ }
639
641
}
640
642
depAliasMap . set ( origPkgName , {
641
643
id : pkgSpec ,
@@ -681,12 +683,11 @@ async function addOverrides(
681
683
}
682
684
if ( newSpec !== oldSpec ) {
683
685
overrides [ origPkgName ] = newSpec
684
- if ( overrideExists ) {
685
- state . updated . add ( regPkgName )
686
- state . updatedInWorkspaces . add ( workspaceName )
687
- } else {
688
- state . added . add ( regPkgName )
689
- state . addedInWorkspaces . add ( workspaceName )
686
+ const addedOrUpdated = overrideExists ? 'updated' : 'added'
687
+ state [ addedOrUpdated ] . add ( regPkgName )
688
+ if ( isWorkspace ) {
689
+ const addedOrUpdatedIn = overrideExists ? 'updatedInWorkspaces' : 'addedInWorkspaces'
690
+ state [ addedOrUpdatedIn ] . add ( workspaceName )
690
691
}
691
692
}
692
693
}
0 commit comments