Moox Devlink is used to link packages a monorepo into any project and to deploy a production-ready composer.json. That allows us to develop Moox packages in any project. It runs on MacOS and Linux, Windows with special configuration.
composer require moox/devlink
php artisan vendor:publish --tag="devlink-config"
- Prepare your project's
.gitignore
file:
# Devlink
# ignore symlinks in packages/
packages/*
!packages/**/
!packages/*/.gitkeep
# and for windows
/packageslocal/*
# optional:
composer.json-deploy
-
Configure your paths and packages in the
config/devlink.php
file and change the package path in the.env
file, if needed (Windows users should set theDEVLINK_PACKAGES_PATH
variable topackageslocal
). -
When running
php init.php
- Creates a
.env
file from.env.example
- Copies
composer.json-linked
tocomposer.json
- Runs
composer update
- Creates a
-
When running
devlink:status
:- Shows the configuration and status of each package
- Shows the link status (Linked, Unlinked, Deployed)
- Shows the update status (Up-to-date, Outdated)
- Has a verbose mode
-v
to show more information
-
When running
devlink:link
:- Creates the packages folder, if it does not exist
- Creates symlinks for all configured packages
- Updates composer.json with development configuration
- Creates composer.json-linked 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-linked
- Asks to run
composer install
- Asks to run
php artisan optimize:clear
- Asks to run
php artisan queue:restart
-
CI Safety Net -
deploy.sh
:- If composer.json-linked exists in the repository:
- Remove all symlinks from /packages
- rename composer.json-linked to composer.json
- Commit and push the change in your GitHub Action
- If composer.json-linked exists in the repository:
Mac and Linux work 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 ignoring symlinks. If you run into issues, you can either globally or project-wise disable the symlinks or do the following:
DEVLINK_PACKAGES_PATH=packageslocal
Devlink will then link the packages into the packageslocal
folder instead of mixing them into packages.
Please see the CLASSES.md file for a quick class overview.
Please see the ROADMAP.md file for what is planned.
Please see the CHANGELOG.md file for what has changed.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.