|
| 1 | +# Moox Devlink |
| 2 | + |
| 3 | +This package is only for internal use. |
| 4 | + |
| 5 | +It is used to link the packages from the `moox` monorepo into a project. It runs on MacOS, Linux and Windows. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +```bash |
| 10 | +composer require moox/devlink |
| 11 | +php artisan vendor:publish --tag="devlink-config" |
| 12 | +``` |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +```bash |
| 17 | +php artisan moox:devlink |
| 18 | +``` |
| 19 | + |
| 20 | +## Screenshot |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +## Preparation |
| 25 | + |
| 26 | +Before you can use this package, you need to prepare your project's `.gitignore` file. |
| 27 | + |
| 28 | +```bash |
| 29 | +# Ignore all files in packages/ (including symlinks) |
| 30 | +packages/* |
| 31 | +# Allow tracking of real directories inside packages/ |
| 32 | +!packages/**/ |
| 33 | +# Ensure empty directories can be committed |
| 34 | +!packages/*/.gitkeep |
| 35 | +``` |
| 36 | + |
| 37 | +## Configuration |
| 38 | + |
| 39 | +The configuration is done in the `config/devlink.php` file. |
| 40 | + |
| 41 | +```php |
| 42 | +'base_paths' => [ |
| 43 | + // 'path/to/base/path', |
| 44 | +], |
| 45 | + |
| 46 | +'packages' => [ |
| 47 | + // 'package-name', |
| 48 | +], |
| 49 | +``` |
| 50 | + |
| 51 | +## Command |
| 52 | + |
| 53 | +The devlink command will create a `packages` directory in the root of the project and symlink the packages from the configured base paths. |
| 54 | + |
| 55 | +```bash |
| 56 | +php artisan moox:devlink |
| 57 | +``` |
| 58 | + |
| 59 | +It will also update the `composer.json` file to include the packages in the `require` section and the `repositories` section. |
| 60 | + |
| 61 | +Finally, it will run `composer update`. |
| 62 | + |
| 63 | +You can have local packages mixed with the symlinked packages in your `/packages` folder. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +### Changing branches |
| 68 | + |
| 69 | +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. |
| 70 | + |
| 71 | +```bash |
| 72 | +php artisan moox:devlink |
| 73 | +``` |
| 74 | + |
| 75 | +> ⚠️ **Important** |
| 76 | +> 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. |
| 77 | +
|
| 78 | +## Security Vulnerabilities |
| 79 | + |
| 80 | +Please review [our security policy](https://github.com/mooxphp/moox/security/policy) on how to report security vulnerabilities. |
| 81 | + |
| 82 | +## Credits |
| 83 | + |
| 84 | +- [All Contributors](../../contributors) |
| 85 | + |
| 86 | +## License |
| 87 | + |
| 88 | +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
0 commit comments