Skip to content

🔧 Sort composer.json packages alphabetically#814

Merged
retlehs merged 2 commits intomasterfrom
composer-sort-packages
Mar 11, 2026
Merged

🔧 Sort composer.json packages alphabetically#814
retlehs merged 2 commits intomasterfrom
composer-sort-packages

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Mar 11, 2026

Summary

  • Enable sort-packages in Composer config
  • Alphabetically sort existing packages in require

Context

As suggested in #764 (comment), adding back sort-packages: true reduces git conflicts by keeping a consistent ordering.

This was originally removed due to concerns raised in #479 about merge conflicts when using Bedrock as an upstream repo. The main downside is transition churn: Bedrock-as-upstream projects with custom package ordering may need a one-time conflict resolution when this lands. After that, consistent sorting should make future diffs cleaner.

Also worth noting that major PHP app skeletons/starter projects do this. Examples:

@retlehs retlehs self-assigned this Mar 11, 2026
@retlehs retlehs mentioned this pull request Mar 11, 2026
5 tasks
@retlehs retlehs merged commit fdad399 into master Mar 11, 2026
8 checks passed
@retlehs retlehs deleted the composer-sort-packages branch March 11, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant