@@ -568,11 +568,8 @@ export class RegistryClient {
568
568
569
569
try {
570
570
// Use composer outdated to get all available updates, then filter based on version constraints
571
- this . logger . info ( 'Running composer outdated command...' )
572
571
const output = await this . runCommand ( 'composer' , [ 'outdated' , '--format=json' , '--direct' ] )
573
- this . logger . info ( `Composer outdated raw output: ${ output } ` )
574
572
const composerData = JSON . parse ( output )
575
- this . logger . info ( `Parsed composer data:` , composerData )
576
573
577
574
const updates : PackageUpdate [ ] = [ ]
578
575
@@ -582,84 +579,30 @@ export class RegistryClient {
582
579
const fs = await import ( 'node:fs' )
583
580
const path = await import ( 'node:path' )
584
581
const composerJsonPath = path . join ( this . projectPath , 'composer.json' )
585
- this . logger . info ( `Looking for composer.json at: ${ composerJsonPath } ` )
586
582
if ( fs . existsSync ( composerJsonPath ) ) {
587
583
const composerContent = fs . readFileSync ( composerJsonPath , 'utf-8' )
588
584
composerJsonData = JSON . parse ( composerContent )
589
- this . logger . info ( `Found composer.json with packages:` , Object . keys ( composerJsonData . require || { } ) , Object . keys ( composerJsonData [ 'require-dev' ] || { } ) )
590
- } else {
591
- this . logger . warn ( `composer.json not found at ${ composerJsonPath } ` )
592
585
}
593
586
}
594
587
catch ( error ) {
595
588
this . logger . warn ( 'Failed to read composer.json for dependency type detection:' , error )
596
589
}
597
590
598
- // Parse composer outdated output and filter based on version constraints
591
+ // Parse composer outdated output and filter based on version constraints
599
592
if ( composerData . installed ) {
600
- this . logger . info ( `Processing ${ composerData . installed . length } outdated Composer packages` )
601
-
602
593
for ( const pkg of composerData . installed ) {
603
594
if ( pkg . name && pkg . version && pkg . latest ) {
604
- this . logger . info ( `Checking ${ pkg . name } : ${ pkg . version } → ${ pkg . latest } ` )
605
-
606
595
// Get the version constraint from composer.json
607
596
const requireConstraint = composerJsonData . require ?. [ pkg . name ]
608
597
const requireDevConstraint = composerJsonData [ 'require-dev' ] ?. [ pkg . name ]
609
598
const constraint = requireConstraint || requireDevConstraint
610
-
611
- this . logger . info ( `Constraint for ${ pkg . name } : ${ constraint } ` )
612
-
599
+
613
600
if ( ! constraint ) {
614
- this . logger . info ( `Skipping ${ pkg . name } : not found in composer.json` )
615
601
continue // Skip packages not found in composer.json
616
602
}
617
603
618
- // Check if the latest version respects the version constraint
604
+ // Include all available updates - let grouping and strategy handle filtering
619
605
let newVersion = pkg . latest
620
- const currentMajor = this . getMajorVersion ( pkg . version )
621
- const latestMajor = this . getMajorVersion ( pkg . latest )
622
-
623
- this . logger . info ( `Version analysis for ${ pkg . name } : current major=${ currentMajor } , latest major=${ latestMajor } ` )
624
-
625
- // For caret constraints (^), only allow updates within the same major version
626
- if ( constraint . startsWith ( '^' ) ) {
627
- if ( currentMajor !== latestMajor ) {
628
- this . logger . info ( `Skipping ${ pkg . name } : major version change not allowed by ^ constraint` )
629
- continue // Skip major version updates for caret constraints
630
- }
631
- }
632
-
633
- // For tilde constraints (~), handle according to the constraint level
634
- if ( constraint . startsWith ( '~' ) ) {
635
- const currentMinor = this . getMinorVersion ( pkg . version )
636
- const latestMinor = this . getMinorVersion ( pkg . latest )
637
-
638
- // ~1.2.3 allows patch updates within 1.2.x
639
- // ~1.2 allows minor and patch updates within 1.x.x
640
- const constraintParts = constraint . replace ( '~' , '' ) . split ( '.' )
641
- if ( constraintParts . length >= 3 ) {
642
- // ~1.2.3 - only allow patches in same minor version
643
- if ( currentMajor !== latestMajor || currentMinor !== latestMinor ) {
644
- this . logger . info ( `Skipping ${ pkg . name } : version change not allowed by ~x.y.z constraint` )
645
- continue
646
- }
647
- } else if ( constraintParts . length >= 2 ) {
648
- // ~1.2 - allow minor/patch in same major version
649
- if ( currentMajor !== latestMajor ) {
650
- this . logger . info ( `Skipping ${ pkg . name } : major version change not allowed by ~x.y constraint` )
651
- continue
652
- }
653
- } else {
654
- // ~1 - allow minor/patch in same major version
655
- if ( currentMajor !== latestMajor ) {
656
- this . logger . info ( `Skipping ${ pkg . name } : major version change not allowed by ~x constraint` )
657
- continue
658
- }
659
- }
660
- }
661
-
662
- this . logger . info ( `Accepted ${ pkg . name } : ${ pkg . version } → ${ newVersion } ` )
663
606
664
607
const updateType = getUpdateType ( pkg . version , newVersion )
665
608
0 commit comments