rector / jack
Jack helps you incrementally update your `composer.json` dependencies, ensuring your project stays current without the chaos of outdated packages
Fund package maintenance!
tomasvotruba
www.paypal.me/rectorphp
Requires
- php: >=8.2
- composer/semver: ^3.4
- illuminate/container: ^12.0
- nette/utils: ^4.0
- symfony/console: ^6.4
- symfony/finder: ^7.2
- symfony/process: ^7.2
- webmozart/assert: ^1.11
Requires (Dev)
- phpecs/phpecs: ^2.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- rector/rector: ^2.0
- shipmonk/composer-dependency-analyser: ^1.8
- symplify/phpstan-extensions: ^12.0
- symplify/vendor-patches: ^11.3
- tomasvotruba/class-leak: ^2.0
- tracy/tracy: ^2.10
This package is auto-updated.
Last update: 2025-04-22 13:29:44 UTC
README
Experimental: Jack is an experimental project under active development. It is not yet stable, may contain bugs or undergo breaking changes. It's build it in the open with the community feedback.
Jack helps you incrementally update your composer.json
dependencies, ensuring your project stays current without the chaos of outdated packages.
Say goodbye to unnoticed, years-old dependencies!
Install
composer require rector/jack --dev
Why Jack?
Manually upgrading dependencies can be daunting, especially when tackling multiple outdated packages at once. Large upgrades often lead to errors, compatibility issues, and costly delays. Jack automates and simplifies this process by:
- Monitoring outdated dependencies via CI.
- Gradually opening up package versions for safe updates.
- Prioritizing low-risk updates (e.g., dev dependencies).
With Jack, you upgrade slowly and steadily, avoiding the stress of massive, error-prone dependency overhauls.
Usage
Jack offers two powerful commands to keep your dependencies up to date:
1. Too many outdated dependencies? Let your CI tell you
Postponing upgrades often results in large, risky jumps (e.g., updating every few years). Jack integrates with your CI pipeline to catch outdated dependencies early.
Run the breakpoint
command to check for outdated major packages:
vendor/bin/jack breakpoint
By default, CI fails if there are more than 5 outdated packages. Customize this limit to suit your project’s needs:
vendor/bin/jack breakpoint --limit 13
This ensures upgrades stay on your radar without overwhelming you. No more "oops, our dependencies are three years old" moments!
2. Open up Next Versions
We know we're behind the latest versions of our dependencies, but where to start? Which versions should be force to update first? We can get lot of errors if we try to bump wrong end of knot.
Instead, let composer handle it. How? We open-up package versions to the next version:
{ "require": { "php": "^7.4", - "symfony/console": "^5.0" + "symfony/console": "^5.0|^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^10.0" } } }
This "opens up" versions without forcing updates. If no blockers exist, Composer will upgrade to the next version.
Command Options:
Limit the number of packages to process (default: 5):
vendor/bin/jack open-versions --limit 3
Dry run to preview changes without modifying composer.json
:
vendor/bin/jack open-versions --dry-run
Update dev dependencies first for safer, low-risk updates:
vendor/bin/jack open-versions --dev
This approach ensures you progress steadily toward the latest dependency versions.
Happy coding!