shipfastlabs / link
Link local packages for development by modifying composer.json and composer.lock
Fund package maintenance!
pushpak1300
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:composer-plugin
pkg:composer/shipfastlabs/link
Requires
- php: ^8.2.0
- composer-plugin-api: ^2.6
Requires (Dev)
- composer/composer: ^2.6
- laravel/pint: ^1.24.0|^3.0
- peckphp/peck: ^0.1.3
- pestphp/pest: ^3.0|^4.1.0
- pestphp/pest-plugin-type-coverage: ^3.0|^4.0.2
- phpstan/phpstan: ^2.1.26
- rector/rector: ^2.1.7
- symfony/var-dumper: ^7.3.3
README
Link
Link local packages for development by modifying composer.json and composer.lock.
Requires PHP 8.2+ and Composer 2.6+
Installation
Install globally so it's available in all your projects:
composer global require shipfastlabs/link
Or install per-project:
composer require shipfastlabs/link --dev
Usage
Link a local package
composer link ../packages/my-package
This will:
- Add a
pathrepository entry to yourcomposer.json - Update the
requireconstraint to*so Composer resolves from the local path - Run
composer updateto updatecomposer.lockand symlink the package
Link multiple packages with wildcards
composer link ../packages/*
Only link packages that are already in your composer.lock:
composer link ../packages/* --only-installed
List linked packages
composer linked
Unlink a package
composer unlink ../packages/my-package
This restores the original version constraint in composer.json and runs composer update to install the released version from Packagist.
Unlink all packages
composer unlink-all
How it works
Unlike composer-link which works in-memory, this plugin modifies your composer.json and composer.lock files directly:
composer linkadds apathrepository tocomposer.jsonand runscomposer updatecomposer unlinkremoves the path repository, restores the original constraint, and runscomposer update- Original version constraints are tracked in
vendor/composer-link.jsonso they can be restored on unlink - Both
requireandrequire-devpackages are supported
Development
composer lint # Format code with Pint composer refactor # Run Rector refactors composer test:types # Static analysis with PHPStan composer test:unit # Unit tests with Pest composer test # Run the entire test suite
License
Link is open-sourced software licensed under the MIT license.
