@@ -53,12 +53,6 @@ export function updateRelatedChangeType(params: {
5353 while ( queue . length > 0 ) {
5454 const { subjectPackage, changeType } = queue . shift ( ) ! ;
5555
56- if ( visited . has ( subjectPackage ) ) {
57- continue ;
58- }
59-
60- visited . add ( subjectPackage ) ;
61-
6256 // Step 1. Update change type of the subjectPackage according to the dependent change type propagation
6357 const packageInfo = packageInfos [ subjectPackage ] ;
6458 if ( ! packageInfo ) {
@@ -79,7 +73,14 @@ export function updateRelatedChangeType(params: {
7973 const dependentPackages = dependents [ subjectPackage ] ;
8074
8175 if ( bumpDeps && dependentPackages ?. length ) {
82- queue . push ( ...dependentPackages . map ( pkg => ( { subjectPackage : pkg , changeType : updatedChangeType } ) ) ) ;
76+ for ( const dependentPackage of dependentPackages ) {
77+ if ( visited . has ( dependentPackage ) ) {
78+ continue ;
79+ }
80+
81+ visited . add ( dependentPackage ) ;
82+ queue . push ( ( { subjectPackage : dependentPackage , changeType : updatedChangeType } ) ) ;
83+ }
8384 }
8485
8586 // TODO: when we do "locked", or "lock step" versioning, we could simply skip this grouped traversal,
@@ -92,6 +93,11 @@ export function updateRelatedChangeType(params: {
9293 if ( group ) {
9394 for ( const packageNameInGroup of group . packageNames ) {
9495 if ( ! group . disallowedChangeTypes ?. includes ( updatedChangeType ) ) {
96+ if ( visited . has ( packageNameInGroup ) ) {
97+ continue ;
98+ }
99+
100+ visited . add ( packageNameInGroup ) ;
95101 queue . push ( {
96102 subjectPackage : packageNameInGroup ,
97103 changeType : updatedChangeType ,
0 commit comments