This package is only for internal use.
It is used to link the packages from the moox
monorepo into a project. It runs on MacOS, Linux and Windows.
cp .env.example .env
composer require moox/devlink
php artisan vendor:publish --tag="devlink-config"
- Prepare your project's
.gitignore
file:
# Ignore all files in packages/ (including symlinks)
packages/*
# Allow tracking of real directories inside packages/
!packages/**/
# Ensure empty directories can be committed
!packages/*/.gitkeep
# for windows
/packageslocal/*
-
Configure your paths and packages in the
config/devlink.php
file and the.env
file, if needed (Windows users for example). -
When running
devlink:link
:- Creates backup of original composer.json → composer.json.original
- Creates symlinks for all configured packages
- Updates composer.json with development configuration
- Creates composer.json-deploy for production use
- Asks to run
composer install
- Asks to run
php artisan optimize:clear
- Asks to run
php artisan queue:restart
-
When running
devlink:deploy
:- Removes all symlinks
- Deletes the packages folder, if empty
- Restores production-ready composer.json from composer.json-deploy
-
CI Safety Net -
deploy.sh
:- If composer.json-deploy exists in the repository:
- The script will restore it as composer.json
- Commit and push the change in GH action
- This ensures no development configuration reaches production
- If composer.json-deploy exists in the repository:
If you need to change the branches for ANY of the involved repositories, you just need to run the command again, it will automatically update the symlinks for the current branch.
⚠️ Important
If you forget to run the command, when CHANGING BRANCHES ON ANY OF THE REPOS, you will surely run into a 500 error, that drives you nuts.
Mac works out of the box. You can have local packages mixed with the symlinked packages in your /packages
folder.
On Windows there are most probably some issues with the symlinks. If you run into issues, you can either globally or project-wise disable the symlinks or do the following:
'packages_path' => 'packages-linked',
Devlink will then link the packages into the packages-linked
folder.
- Test on Mac
- Test on Windows
- Test Deployment on Mac
- Test Deployment on Windows
- Implement automatic Deployment
- Implement all 3 types of packages
- If package is a symlink itself, ...?
- If package is in multiple base paths...?
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.