@@ -588,48 +588,62 @@ export class RegistryClient {
588
588
this . logger . warn ( 'Failed to read composer.json for dependency type detection:' , error )
589
589
}
590
590
591
- // Parse composer outdated output and filter based on version constraints
591
+ // Parse composer outdated output and filter based on version constraints
592
592
if ( composerData . installed ) {
593
+ this . logger . info ( `Processing ${ composerData . installed . length } outdated Composer packages` )
594
+
593
595
for ( const pkg of composerData . installed ) {
594
596
if ( pkg . name && pkg . version && pkg . latest ) {
597
+ this . logger . info ( `Checking ${ pkg . name } : ${ pkg . version } → ${ pkg . latest } ` )
598
+
595
599
// Get the version constraint from composer.json
596
600
const requireConstraint = composerJsonData . require ?. [ pkg . name ]
597
601
const requireDevConstraint = composerJsonData [ 'require-dev' ] ?. [ pkg . name ]
598
602
const constraint = requireConstraint || requireDevConstraint
599
-
603
+
604
+ this . logger . info ( `Constraint for ${ pkg . name } : ${ constraint } ` )
605
+
600
606
if ( ! constraint ) {
607
+ this . logger . info ( `Skipping ${ pkg . name } : not found in composer.json` )
601
608
continue // Skip packages not found in composer.json
602
609
}
603
610
604
- // Check if the latest version respects the version constraint
611
+ // Check if the latest version respects the version constraint
605
612
let newVersion = pkg . latest
606
613
const currentMajor = this . getMajorVersion ( pkg . version )
607
614
const latestMajor = this . getMajorVersion ( pkg . latest )
608
-
615
+
616
+ this . logger . info ( `Version analysis for ${ pkg . name } : current major=${ currentMajor } , latest major=${ latestMajor } ` )
617
+
609
618
// For caret constraints (^), only allow updates within the same major version
610
619
if ( constraint . startsWith ( '^' ) ) {
611
620
if ( currentMajor !== latestMajor ) {
621
+ this . logger . info ( `Skipping ${ pkg . name } : major version change not allowed by ^ constraint` )
612
622
continue // Skip major version updates for caret constraints
613
623
}
614
624
}
615
-
625
+
616
626
// For tilde constraints (~), handle according to the constraint level
617
627
if ( constraint . startsWith ( '~' ) ) {
618
628
const currentMinor = this . getMinorVersion ( pkg . version )
619
629
const latestMinor = this . getMinorVersion ( pkg . latest )
620
-
630
+
621
631
// ~1.2 allows patch updates within 1.2.x
622
632
if ( constraint . includes ( '.' ) ) {
623
633
if ( currentMajor !== latestMajor || currentMinor !== latestMinor ) {
634
+ this . logger . info ( `Skipping ${ pkg . name } : version change not allowed by ~x.y constraint` )
624
635
continue // Skip if not within same minor version
625
636
}
626
637
} else {
627
638
// ~1 allows minor and patch updates within 1.x.x
628
639
if ( currentMajor !== latestMajor ) {
640
+ this . logger . info ( `Skipping ${ pkg . name } : major version change not allowed by ~x constraint` )
629
641
continue // Skip if not within same major version
630
642
}
631
643
}
632
644
}
645
+
646
+ this . logger . info ( `Accepted ${ pkg . name } : ${ pkg . version } → ${ newVersion } ` )
633
647
634
648
const updateType = getUpdateType ( pkg . version , newVersion )
635
649
0 commit comments