{"id":15286641,"url":"https://github.com/davidrjonas/composer-lock-diff","last_synced_at":"2025-04-14T06:40:27.592Z","repository":{"id":13170578,"uuid":"69639604","full_name":"davidrjonas/composer-lock-diff","owner":"davidrjonas","description":"See what has changed after a composer update","archived":false,"fork":false,"pushed_at":"2025-01-24T06:12:37.000Z","size":114,"stargazers_count":278,"open_issues_count":10,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-07T04:01:34.887Z","etag":null,"topics":["composer","composer-lock","composer-lock-diff","diff","lock","php","plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidrjonas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-30T06:22:24.000Z","updated_at":"2025-04-05T20:03:29.000Z","dependencies_parsed_at":"2024-06-18T13:37:09.557Z","dependency_job_id":"cd0bf302-4614-4f8b-9917-f07e5af4b369","html_url":"https://github.com/davidrjonas/composer-lock-diff","commit_stats":{"total_commits":63,"total_committers":8,"mean_commits":7.875,"dds":0.2698412698412699,"last_synced_commit":"3c39a39849e6d235e588c6ae273d97c8785e9008"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidrjonas%2Fcomposer-lock-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidrjonas%2Fcomposer-lock-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidrjonas%2Fcomposer-lock-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidrjonas%2Fcomposer-lock-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidrjonas","download_url":"https://codeload.github.com/davidrjonas/composer-lock-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837047,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","composer-lock","composer-lock-diff","diff","lock","php","plugin"],"created_at":"2024-09-30T15:17:46.942Z","updated_at":"2025-04-14T06:40:27.567Z","avatar_url":"https://github.com/davidrjonas.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"composer-lock-diff\n==================\n\nSee what packages have changed after you run `composer update` by comparing composer.lock to the the git HEAD.\n\nRequires:\n- php \u003e= 5.3\n\nThere are no other dependencies.\n\nInstall\n-------\n\n```bash\ncomposer global require davidrjonas/composer-lock-diff:^1.0\n\n# With zsh, run `rehash` to make it known to the shell.\n\n# try it\ncomposer-lock-diff --help\n```\n\nIf `composer-lock-diff` is not found, make sure `~/.composer/vendor/bin` is in\nyour `$PATH` env variable. For more information on how to do that see [this question on Stack Overflow][SO].\n\n[SO]: https://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your\n\nUsage\n=====\n\n```bash\ncomposer update\n# don't commit yet!\ncomposer-lock-diff\n```\n\nOr from vim, to insert the output into the commit message, type `:r!composer-lock-diff`.\n\n### Options\n\n- `-h, --help`: Print this message\n- `-p, --path`: Base to with which to prefix paths. Default \"./\"  \n  E.g. `-p app` would look for HEAD:app/composer.lock and app/composer.lock\n- `--from`: The file^, git ref, or git ref with filename to compare from (git: HEAD:composer.lock, svn: composer.lock@BASE)\n- `--to`: The file^, git ref, or git ref with filename to compare to (composer.lock)\n- `--json`: Format output as JSON\n- `--pretty`: Pretty print JSON output (PHP \u003e= 5.4.0)\n- `--md`: Use markdown instead of plain text\n- `--no-links`: Don't include Compare links in plain text or any links in markdown\n- `--only-prod`: Only include changes from `packages`\n- `--only-dev`: Only include changes from `packages-dev`\n- `--vcs`: Force vcs (git, svn, ...). Default: attempt to auto-detect\n\n^ File includes anything available as a [protocol stream wrapper](http://php.net/manual/en/wrappers.php) such as URLs.\n\nExample Plain Text Table Output\n===============================\n\n```\n+--------------------+-------+--------+------------------------------------------------------------------+\n| Production Changes | From  | To     | Compare                                                          |\n+--------------------+-------+--------+------------------------------------------------------------------+\n| guzzlehttp/guzzle  | 6.2.0 | 6.3.0  | https://github.com/guzzle/guzzle/compare/6.2.0...6.3.0           |\n| hashids/hashids    | 2.0.0 | 2.0.4  | https://github.com/ivanakimov/hashids.php/compare/2.0.0...2.0.4  |\n| league/flysystem   | 1.0.0 | 1.0.42 | https://github.com/thephpleague/flysystem/compare/1.0.0...1.0.42 |\n| monolog/monolog    | NEW   | 1.21.0 |                                                                  |\n+--------------------+-------+--------+------------------------------------------------------------------+\n\n+------------------+--------+---------+---------+\n| Dev Changes      | From   | To      | Compare |\n+------------------+--------+---------+---------+\n| phpspec/php-diff | v1.0.2 | REMOVED |         |\n+------------------+--------+---------+---------+\n```\n\nMarkdown Table\n==============\n\n### Raw\n\n```\n| Production Changes | From  | To     | Compare                                                                 |\n|--------------------|-------|--------|-------------------------------------------------------------------------|\n| guzzlehttp/guzzle  | 6.2.0 | 6.3.0  | [...](https://github.com/guzzle/guzzle/compare/6.2.0...6.3.0)           |\n| hashids/hashids    | 2.0.0 | 2.0.4  | [...](https://github.com/ivanakimov/hashids.php/compare/2.0.0...2.0.4)  |\n| league/flysystem   | 1.0.0 | 1.0.42 | [...](https://github.com/thephpleague/flysystem/compare/1.0.0...1.0.42) |\n| monolog/monolog    | NEW   | 1.21.0 |                                                                         |\n\n| Dev Changes      | From   | To      | Compare |\n|------------------|--------|---------|---------|\n| phpspec/php-diff | v1.0.2 | REMOVED |         |\n```\n\n### Rendered\n\n| Production Changes | From  | To     | Compare                                                                 |\n|--------------------|-------|--------|-------------------------------------------------------------------------|\n| guzzlehttp/guzzle  | 6.2.0 | 6.3.0  | [...](https://github.com/guzzle/guzzle/compare/6.2.0...6.3.0)           |\n| hashids/hashids    | 2.0.0 | 2.0.4  | [...](https://github.com/ivanakimov/hashids.php/compare/2.0.0...2.0.4)  |\n| league/flysystem   | 1.0.0 | 1.0.42 | [...](https://github.com/thephpleague/flysystem/compare/1.0.0...1.0.42) |\n| monolog/monolog    | NEW   | 1.21.0 |                                                                         |\n\n| Dev Changes      | From   | To      | Compare |\n|------------------|--------|---------|---------|\n| phpspec/php-diff | v1.0.2 | REMOVED |         |\n\nDevelopment\n===========\n\nNew features are always welcome! Follow these guidelines\n\n- Try to match the style of the code that already exists, even if it isn't _your_ style (sorry!).\n- Make sure there is a way to test the feature.\n- Test with PHP 5.3 (I'm serious!), \u003e=5.4\u003c7, 7.current. Docker is helpful, particularly for the older versions. Just run the ubuntu:12.04 image and install php for 5.3 and 14.04 for 5.6. I can help if you're having trouble.\n\nThe [Makefile](Makefile) has some test cases. Run `make | less` and inspect the output. If you need specific versions or more information, continue reading.\n\nTo run using the test data manually simply point the `--to` and `--from` args at the lock files,\n\n```php\nphp ./composer-lock-diff --from ./test-data/composer.from.lock --to ./test-data/composer.to.lock\n```\n\nDocker is very helpful for targeting a specific version of php and/or composer,\n\n```php\ndocker run --rm -it -v \"$PWD\":/src -w /src php:7.4.2 \\\n  php ./composer-lock-diff --from ./test-data/composer.from.lock --to ./test-data/composer.to.lock\n```\n\nSometimes you want to test the git related functions. To do that first I make a temporary repo. Then I copy into it `test-data/composer.from.lock` as `composer.lock` to set the previous state and `test-data/composer.to.json` as `composer.json` for the future state. I commit those then run `composer-lock-diff` with the options I want to test and visually inspect the results.\n\n```bash\nmkdir tmp \u0026\u0026 cd tmp\ngit init\ncp ../test-data/composer.to.json composer.json\ncp ../test-data/composer.from.lock composer.lock\ngit add .\ngit commit -m \"initial\"\n\ncomposer update\n# or\ndocker run --rm -it -v \"$PWD\":/src -w /src composer:latest php composer update\n\nphp ../composer-lock-diff\n\n# or, if you want to use docker, you'll need git\ncd ..\ndocker run --rm -it -v \"$PWD\":/src -w /src php:7.4.2 bash\napt-get update \u0026\u0026 apt-get install -y git\n# You may want composer as well,\ncurl -OL https://getcomposer.org/download/1.9.3/composer.phar\ncd tmp\nphp ../composer.phar update\nphp ../composer-lock-diff\n```\n\nAdd a test case to test-data/\n-----------------------------\n\n- Make a new, temporary git repo in `./tmp`\n- Copy `../test-data/composer.from.json` as `composer.json` and `../test-data/composer.from.lock` as `composer.lock`.\n- Commit them.\n- Run `composer install`\n- Add your _pre_ case to `composer.json`. Use an exact version.\n- Run `composer update`.\n- The generated `composer.lock` should look similar to `../test-data/composer.from.lock` but there will be differences due to transient dependencies. No real way around that. Use `composer-lock-diff` to make sure none of the named packages change versions and your new case is there.\n- Copy `composer.json` to `../test-data/composer.from.json` and `composer.lock` to `composer.from.lock`.\n- Copy `../test-data/composer.to.json` as `composer.json`.\n- Add your _post_ case to `composer.json`. Again, exact versions are best.\n- Generate a new lock file.\n- Use composer-lock-diff to test your feature.\n- When you're happy with it, copy `composer.json` to `../test-data/composer.to.json` and `composer.lock` to `../test-data/composer.to.lock`.\n\nTest Cases\n----------\n\nSee [Makefile](Makefile).\n\n- `comopser-lock-diff` # no args\n- `composer-lock-diff --from ./test-data/composer.from.lock --to ./test-data/composer.to.lock`\n- `composer-lock-diff --path ./test-data/`\n- `composer-lock-diff --from \u003cgit ref\u003e` # this gets tested with 'no args'\n- `composer-lock-diff --from \u003cgit ref with filename\u003e`\n- `composer-lock-diff --to \u003cgit ref\u003e`\n- `composer-lock-diff --to \u003cgit ref with filename\u003e`\n- `composer-lock-diff --only-dev`\n- `composer-lock-diff --only-prod`\n- `composer-lock-diff --no-links`\n- `composer-lock-diff --json`\n- `composer-lock-diff --json --pretty`\n- `composer-lock-diff --md`\n- `composer-lock-diff --md --no-links`\n\nIf anyone can help test with Windows that would be very much appreciated!\n\nContributors\n============\n\nThanks to everyone who has shared ideas and code! In particular,\n\n- https://github.com/delamart\n- https://github.com/prometheas\n- https://github.com/paxal\n- https://github.com/nclavaud\n- https://github.com/cafferata\n- https://github.com/ihor-sviziev\n- https://github.com/wiese\n- https://github.com/jibran\n- https://github.com/soleuu\n- https://github.com/stof\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidrjonas%2Fcomposer-lock-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidrjonas%2Fcomposer-lock-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidrjonas%2Fcomposer-lock-diff/lists"}