Skip to content

chore: sort root composer.json replace and autoload-dev alphabetically#54

Merged
markshust merged 1 commit intodevelopfrom
feature/sort-composer-blocks
May 2, 2026
Merged

chore: sort root composer.json replace and autoload-dev alphabetically#54
markshust merged 1 commit intodevelopfrom
feature/sort-composer-blocks

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

Summary

  • Sort the root composer.json replace block alphabetically (only 3 entries were out of place: marko/http, marko/http-guzzle, marko/layout had drifted past the inertia siblings)
  • Sort the root composer.json autoload-dev.psr-4 block alphabetically — this had significant drift; ~25 entries were out of order (Authentication, Queue\*, RateLimiting, Scheduler, Translation\*, View\*, Notification\*, Pagination, Api, Sse, PubSub\*, Amphp, etc. were all appended chronologically as packages were added)
  • Document the convention in .claude/pr-review-process.md so future contributors keep these blocks sorted when adding new packages

Why

Composer auto-sorts require/require-dev (via "sort-packages": true in config), but does NOT touch repositories, replace, or autoload-dev.psr-4. Those drifted into append-order because no convention was documented and no tooling enforces it. As the package list grew past ~50 entries, the file became hard to scan and prone to the same accidental duplication / mis-placement that cropped up during the recent inertia-companion PRs (#51/#52/#53) where conflict resolution was uglier than it needed to be.

Sort rule

Pure alphabetical, with one nuance for nested namespaces: when a namespace family has both a parent (e.g. Marko\Cache\Tests\) and children (Marko\Cache\File\Tests\, Marko\Cache\Memory\Tests\), the parent's own \Tests\ entry comes first, then children alphabetically. This matches the existing convention used across Cache, Database, Filesystem, Http, Inertia, Log, Mail, Notification, PubSub, Queue, Session, Translation, and View.

Test plan

  • composer validate --strict --no-check-lock — passes
  • composer dump-autoload — clean
  • composer test — 4889/4889 pass (no behavior change; pure key reorder)
  • No package additions, removals, or version changes — only ordering

🤖 Generated with Claude Code

…etically

Both blocks had drifted into chronological/append order as packages were
added over time. Composer auto-sorts `require`/`require-dev` (via the
`sort-packages: true` config) but does NOT touch `repositories`, `replace`,
or `autoload-dev.psr-4` — those need manual maintenance.

For nested namespaces (e.g. `Marko\Cache\File\Tests\`), the parent's own
`\Tests\` entry is placed first, then siblings sorted alphabetically. This
matches the existing convention used for `Cache`, `Database`, `Filesystem`,
`Http`, `Inertia`, `Log`, `Mail`, `Notification`, `PubSub`, `Queue`,
`Session`, `Translation`, and `View`.

Also documents the rule in `.claude/pr-review-process.md` so future
contributors keep these blocks sorted when adding new packages.

No behavior change — pure key reorder; tests pass (4889/4889).
@github-actions github-actions Bot added the maintenance Dependency updates and housekeeping label May 2, 2026
@markshust markshust merged commit d4f66e2 into develop May 2, 2026
1 check passed
@markshust markshust deleted the feature/sort-composer-blocks branch May 2, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Dependency updates and housekeeping

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant