Skip to content

Commit

Permalink
Devlink init
Browse files Browse the repository at this point in the history
  • Loading branch information
adrolli committed Feb 12, 2025
1 parent 540fee5 commit 203441e
Show file tree
Hide file tree
Showing 12 changed files with 624 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/monorepo-split-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- builder
- category
- core
- devlink
- expiry
- flags
- jobs
Expand Down
50 changes: 50 additions & 0 deletions packages/devlink/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Environment
.env
.env.backup

# Composer
/vendor
composer.lock
auth.json

# NPM / Node
/node_modules
npm-debug.log
package-lock.json

# Laravel
/public/hot
/public/storage
/storage/*.key

# PHPUnit
.phpunit.result.cache
phpunit.xml

# Yarn
yarn-error.log

# PHPStan
/build
phpstan.neon

# Testbench
testbench.yaml
/workbench/*

# PHP CS Fixer
.php-cs-fixer.cache

# Homestead
Homestead.json
Homestead.yaml

# IDEs
/.idea
/.vscode

# MacOS
.DS_Store

# Windows
Thumbs.db
3 changes: 3 additions & 0 deletions packages/devlink/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

We don't track changes in this package. Please refer to the [Moox Monorepo](https://github.com/mooxphp/moox) for the latest changes.
21 changes: 21 additions & 0 deletions packages/devlink/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Moox <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
88 changes: 88 additions & 0 deletions packages/devlink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Moox Devlink

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.

## Installation

```bash
composer require moox/devlink
php artisan vendor:publish --tag="devlink-config"
```

## Usage

```bash
php artisan moox:devlink
```

## Screenshot

![Moox Devlink](./devlink.jpg)

## Preparation

Before you can use this package, you need to prepare your project's `.gitignore` file.

```bash
# Ignore all files in packages/ (including symlinks)
packages/*
# Allow tracking of real directories inside packages/
!packages/**/
# Ensure empty directories can be committed
!packages/*/.gitkeep
```

## Configuration

The configuration is done in the `config/devlink.php` file.

```php
'base_paths' => [
// 'path/to/base/path',
],

'packages' => [
// 'package-name',
],
```

## Command

The devlink command will create a `packages` directory in the root of the project and symlink the packages from the configured base paths.

```bash
php artisan moox:devlink
```

It will also update the `composer.json` file to include the packages in the `require` section and the `repositories` section.

Finally, it will run `composer update`.

You can have local packages mixed with the symlinked packages in your `/packages` folder.

![Moox Devlink](./devlink-mix.jpg)

### Changing branches

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.

```bash
php artisan moox:devlink
```

> ⚠️ **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.
## Security Vulnerabilities

Please review [our security policy](https://github.com/mooxphp/moox/security/policy) on how to report security vulnerabilities.

## Credits

- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
13 changes: 13 additions & 0 deletions packages/devlink/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

We maintain the current version of `Moox Devlink` actively.

Do not expect security fixes for older versions.

## Reporting a Vulnerability

If you find any security-related bug, please report it to [email protected].

Please do not use Github issues, to give us enough time to review and fix the issue, before others can use it, to do stupid things.
30 changes: 30 additions & 0 deletions packages/devlink/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "moox/devlink",
"description": "This package is only for internal use. It allows Moox developers to link packages from moox to their projects.",
"keywords": [
"Moox"
],
"homepage": "https://moox.org/",
"license": "MIT",
"authors": [
{
"name": "Moox Developer",
"email": "[email protected]",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Moox\\Devlink\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"Moox\\Devlink\\DevlinkServiceProvider"
]
}
},
"minimum-stability": "stable",
"prefer-stable": true
}
37 changes: 37 additions & 0 deletions packages/devlink/config/devlink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

return [
'base_paths' => [
base_path('../moox/packages'),
],

'packages' => [
'audit',
// 'backup-server-ui',
'builder',
// 'builder-pro',
// 'category',
// 'core',
// 'connect',
// 'data',
// 'devops',
// 'expiry',
'flags',
'jobs',
// 'login-link',
// 'localization',
// 'media',
// 'notifications',
// 'page',
// 'passkey',
// 'permission',
// 'press',
// 'security',
// 'sync',
// 'tag',
// 'trainings',
// 'user',
// 'user-device',
// 'user-session',
],
];
Binary file added packages/devlink/devlink-mix.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/devlink/devlink.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 203441e

Please sign in to comment.