Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Compares composer.lock changes and generates Markdown report so you can use it in PR description.

License

NotificationsYou must be signed in to change notification settings

IonBazan/composer-diff

Repository files navigation

PHP 5.3+ | 7.x | 8.xComposer v1 | v2Dependencies: 0Latest versionGitHub Workflow StatusCodecovMutation testing badgeDownloadsLicense

Generates packages changes report in Markdown format by comparingcomposer.lock files. Compares with last-committed changes by default.

Now available asGitHub Action!

Web version available athttps://lyrixx.github.io/composer-diff

preview

Installation

composer global require ion-bazan/composer-diff

Usage

composer diff# Displays packages changed in current git tree compared with HEADcomposer diff --help# Display detailed usage instructions

Example output

Prod PackagesOperationBaseTarget
psr/event-dispatcherNew-1.0.0
symfony/deprecation-contractsNew-v2.1.2
symfony/event-dispatcherUpgradedv2.8.52v5.1.2
symfony/event-dispatcher-contractsNew-v2.1.2
symfony/polyfill-php80New-v1.17.1
phpNew->=5.3
Dev PackagesOperationBaseTarget
phpunit/php-code-coverageDowngraded8.0.27.0.10
phpunit/php-file-iteratorDowngraded3.0.22.0.2
phpunit/php-text-templateDowngraded2.0.11.2.1
phpunit/php-timerDowngraded5.0.02.1.2
phpunit/php-token-streamDowngraded4.0.23.1.1
phpunit/phpunitDowngraded9.2.58.5.8
sebastian/code-unit-reverse-lookupDowngraded2.0.11.0.1
sebastian/comparatorDowngraded4.0.23.0.2
sebastian/diffDowngraded4.0.13.0.2
sebastian/environmentDowngraded5.1.14.2.3
sebastian/exporterDowngraded4.0.13.1.2
sebastian/global-stateDowngraded4.0.03.0.0
sebastian/object-enumeratorDowngraded4.0.13.0.3
sebastian/object-reflectorDowngraded2.0.11.1.1
sebastian/recursion-contextDowngraded4.0.13.0.0
sebastian/resource-operationsDowngraded3.0.12.0.1
sebastian/typeDowngraded2.1.01.1.3
sebastian/versionDowngraded3.0.02.0.1
phpunit/php-invokerRemoved3.0.1-
sebastian/code-unitRemoved1.0.3-

Options

  • --base (-b) - path, URL or git ref to originalcomposer.lock file
  • --target (-t) - path, URL or git ref to modifiedcomposer.lock file
  • --no-dev - ignore dev dependencies (require-dev)
  • --no-prod - ignore prod dependencies (require)
  • --direct (-D) - only show direct dependencies
  • --with-platform (-p) - include platform dependencies (PHP, extensions, etc.)
  • --with-links (-l) - include compare/release URLs
  • --with-licenses (-c) - include license information
  • --format (-f) - output format (mdtable, mdlist, json, github) - default:mdtable
  • --gitlab-domains - custom gitlab domains for compare/release URLs - default: use composer config

Advanced usage

composer diff master# Compare current composer.lock with the one on master branchcomposer diff master:composer.lock develop:composer.lock -p# Compare master and develop branches, including platform dependenciescomposer diff --no-dev# ignore dev dependenciescomposer diff -p# include platform dependenciescomposer diff -f json# Output as JSON instead of table

You can find more documentation in thedocs directory.

Strict mode

To help you control your dependencies, you may pass--strict option when running in CI. If there are any changes detected, a non-zero exit code will be returned.

Exit code of the command is built using following bit flags:

  • 0 - OK.
  • 1 - General error.
  • 2 - There were changes in prod packages.
  • 4 - There were changes is dev packages.
  • 8 - There were downgrades in prod packages.
  • 16 - There were downgrades in dev packages.

You may check for individual flags or simply check if the status is greater or equal 8 if you don't want to downgrade any package.

Contributing

Composer Diff is an open source project that welcomes pull requests and issues from anyone.Before opening pull requests, please consider reading our shortContribution Guidelines.

Similar packages

While there are several existing packages offering similar functionality:

This package offers:

  • Support for wide range of PHP versions, starting from 5.3.2 up to 8.0 and newer.
  • No dependencies if you run it as composer plugin.
  • Both standalone executable and composer plugin interface - you choose how you want to use it.
  • Allows generating reports in several formats.
  • Extra Gitlab domains support.
  • GitHub Action with example workflow
  • 100% test coverage.
  • MIT license.

About

Compares composer.lock changes and generates Markdown report so you can use it in PR description.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors8

Languages


[8]ページ先頭

©2009-2025 Movatter.jp