davidrjonas/composer-lock-diff
A CLI tool that compares two composer.lock files and reports which packages were added, removed, or updated, including version changes. Useful for changelogs, release notes, and reviewing dependency upgrades in pull requests. Outputs plain text or Markdown tables.
Architecture fit. davidrjonas/composer-lock-diff is a CLI utility, not a runtime library. It takes two composer.lock files (or a git ref plus the current lock) and emits a structured summary of added, removed, upgraded, and downgraded packages. That keeps it entirely outside the application boundary—no autoloading, no service container involvement, no production footprint. For a Laravel codebase it slots into the developer-tooling and CI layer alongside Pint, PHPStan, and Pest rather than into app/. The natural architectural role is dependency-change observability: it answers "what actually moved?" at the PR and release boundary.
Integration feasibility. High and cheap. Two viable paths: (1) composer require --dev davidrjonas/composer-lock-diff and invoke via vendor/bin/composer-lock-diff, or (2) install the distributed PHAR in CI to avoid touching the project's own dependency graph. Since the tool's whole job is to inspect lock files, keeping it out of require-dev is often preferable—a dev dependency that parses your dependency graph creates a mild recursion in reasoning during audits. Output is human-readable by default with a machine-readable mode, which is what makes CI gating realistic.
Technical risk. Low but non-zero, concentrated in three places:
composer.lock schema. Composer 2 changed plugin-api-version semantics and content-hash behavior; future schema shifts are the primary breakage vector.Key questions for the maintainer/spike.
packages array, or also packages-dev and platform overrides? (Affects whether dev-only churn pollutes release notes.)main" in PR workflows?Stack fit. Composer-native by definition; works on any PHP 7.x/8.x project managed by Composer 2, Laravel included. It is equally useful in a monorepo where multiple composer.lock files exist, since each can be diffed independently. No framework coupling, no Laravel package discovery, no config publishing—the absence of framework integration is a feature here.
Migration path. There is no production migration; this is additive tooling. The realistic sequence:
composer update to sanity-check what a routine bump dragged in.Compatibility. Pin the version explicitly (or pin the PHAR checksum) rather than floating. Verify the chosen PHP matrix version matches the runner image; if the team runs multiple PHP versions in CI, the tool needs to work under the lowest one or be isolated to a single job.
Sequencing and dependencies. Nothing here blocks on other work, which is the main attraction. The only prerequisite is that CI have read access to the base ref to produce a second lock file. If the organization already gates on dependency review (e.g., a supply-chain scanning step), introduce lock-diff first—it produces the human-readable "why" that makes scanner findings actionable, and it reduces the friction that causes teams to disable scanners.
Maintenance. Very low steady-state cost. The package is a thin parser with no runtime dependencies inside the application. Maintenance effort is dominated by version pinning discipline, not by code. Budget a periodic review (per PHP minor release or Composer major release) to confirm the tool still parses current lock files correctly—a silent misparse is worse than a failure.
Support. Developer-facing only, so support load is a README section and a make deps:diff target. Ownership should sit with the platform/DevEx function rather than any product team. The failure surface is small enough that one engineer can own it as a secondary responsibility.
Scaling. Effectively free. Execution is a sub-second CLI run against local files; there is no service, no shared state, and no per-seat cost. It scales linearly and trivially across repos because each invocation is independent. The only scaling consideration is noise: in a monorepo with frequent dependency churn, unfiltered PR comments become spam and teams will mute them. Filter to significant changes (major/minor bumps, additions, removals) or comment only when thresholds are crossed.
Failure modes and mitigations.
Ramp-up. Minutes. A developer runs one command and immediately understands the output without documentation. The organizational ramp-up is about habit, not learning: the tool only pays off if reviewing the dependency delta becomes a normal part of the PR ritual. Expect a short adoption curve where the CI comment is ignored, followed by steady use once one incident is traced back to an unreviewed transitive bump.
How can I help you explore Laravel packages today?