composer/metadata-minifier
A small PHP utility that minifies and expands Composer package version metadata using version diffs, powering Composer 2.x's repository metadata protocol. Requires PHP 5.3.2+, MIT licensed.
What it actually is (and is not). composer/metadata-minifier is a two-method utility class — Composer\MetadataMinifier\MetadataMinifier::minify() and ::expand() — implementing the version-diff format that Composer 2 uses for repository metadata (the p2/<vendor>/<package>.json and ~dev.json endpoints on Packagist). It is not a CLI, has no lockfile-minification feature, no Laravel service provider, no config file, and no vendor/bin/ binary. Any roadmap item framed as "clean up composer.lock / reduce PR noise" is based on a misreading of the package and should be dropped; composer.lock is already a compact, hashed, non-redundant file.
Real decisions this package informs:
composer update failure.expand() before reading fields; the raw JSON is deltas, not full records. This is a one-line decision with a real "silently wrong data" failure mode if skipped.0 listed dependents understate its importance: it is a Composer-org package maintained alongside Composer itself, MIT-licensed, PHP 5.3.2+, and effectively "finished" — small, stable, and intentionally so. Low stars here means narrow scope, not abandonment. Treat the low signal as a reason to read the source (it is short) rather than a reason to reject.Adopt if:
p2 metadata without reimplementing the diff format.Look elsewhere (or do nothing) if:
composer.lock, fewer merge conflicts, or faster composer install. This package does none of that. Use composer-normalize for lockfile tidiness; there is no tool here for PR noise.Adoption criteria in one line: we own a repository endpoint or a metadata pipeline, and we want the format implemented correctly for free instead of approximately ourselves.
Executives. This is a small, MIT-licensed utility from the Composer maintainers that lets our systems read and write Composer's compact package-metadata format correctly. It is not a product feature and not a dependency-hygiene fix for our Laravel apps — earlier internal notes that described it as a composer.lock-cleanup tool were mistaken, and I'd recommend correcting that wherever it has been circulated. Its only material business relevance is conditional: if we operate an internal package mirror or build dependency-reporting tooling, it removes a class of subtle bugs and shrinks the metadata we store and serve. If we do neither, the recommendation is to adopt nothing and close the item. Cost is effectively zero; risk is effectively zero; upside is real but narrow.
Engineering. Two static methods: minify() turns an array of full version records into Composer 2's delta format, expand() reverses it. Install with composer require composer/metadata-minifier and call Composer\MetadataMinifier\MetadataMinifier::expand($json['packages'][$name]) when you consume a P2 or ~dev.json endpoint — the first array element is complete, the rest are diffs, which is why naive json_decode reads produce half-empty records. Use minify() only on the serving side of a repository we own. There is no binary, no config, no Artisan command, and no Laravel coupling — please don't budget integration work for any of those. The library targets PHP 5.3.2+, so it will not constrain our runtime; it is Composer-org maintained and deliberately minimal, so treat the source as the documentation and pin the version. If we are not implementing a repo endpoint or parsing Packagist metadata, this is not on our critical path and we should not add it.
How can I help you explore Laravel packages today?