Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New status wip #749

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions composer.json-deployed
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"name": "mooxphp/moox",
"type": "project",
"description": "The Moox Monorepo - a Laravel Demo App and our Homepage",
"keywords": [
"framework",
"laravel",
"package",
"admin",
"dashboard",
"components",
"tall-stack",
"livewire",
"tailwindcss"
],
"repositories": [
{
"type": "path",
"url": "packages/*"
}
],
"license": "MIT",
"require": {
"laravel-lang/lang": "^15.5",
"laravel/framework": "^11.0",
"laravel/tinker": "^2.8",
"moox/audit": "*",
"moox/builder": "*",
"moox/expiry": "*",
"moox/flags": "*",
"moox/frontend": "*",
"moox/jobs": "*",
"moox/locate": "*",
"moox/login-link": "*",
"moox/notifications": "*",
"moox/page": "*",
"moox/passkey": "*",
"moox/permission": "*",
"moox/press": "*",
"moox/press-trainings": "*",
"moox/press-wiki": "*",
"moox/security": "*",
"moox/skeleton": "*",
"moox/slug": "*",
"moox/trainings": "*",
"moox/user": "*",
"moox/user-device": "*",
"moox/user-session": "*",
"resend/resend-laravel": "^1.0@dev",
"wikimedia/composer-merge-plugin": "^2.1"
},
"require-dev": {
"moox/devlink": "*",
"fakerphp/faker": "^1.23.1",
"larastan/larastan": "^3.0",
"laravel/pint": "^1.0",
"laravel/sail": "^1.26",
"nunomaduro/collision": "^8.0",
"pestphp/pest": "^3.0",
"pestphp/pest-plugin-laravel": "^3.0",
"pestphp/pest-plugin-livewire": "^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^2.0",
"rector/rector": "^2.0",
"spatie/laravel-ignition": "^2.3",
"spatie/laravel-ray": "^1.33"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"analyse": "./vendor/bin/phpstan analyze --memory-limit 512m",
"analyze": "@analyse",
"pint": "vendor/bin/pint",
"format": "@pint",
"lint": "@pint --test",
"rector": "vendor/bin/rector",
"refactor": "@rector",
"pest": "vendor/bin/pest",
"test:coverage": "@pest --coverage",
"test:lint": "@lint",
"test:refactor": "@rector --dry-run",
"test:types": "@analyse",
"test:arch": "@pest --filter=arch",
"test:type-coverage": "@pest --type-coverage --min=100",
"test:unit": "@pest --parallel --coverage --exactly=99.4",
"test": [
"@test:lint",
"@test:refactor",
"@test:types",
"@test:type-coverage",
"@test:unit"
]
},
"extra": {
"laravel": {
"dont-discover": []
},
"merge-plugin": {
"include": [
"_custom/composer.json"
],
"recurse": true,
"replace": false,
"ignore-duplicates": false,
"merge-dev": true,
"merge-extra": false,
"merge-extra-deep": false,
"merge-replace": true,
"merge-scripts": false
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true,
"wikimedia/composer-merge-plugin": true,
"roots/wordpress-core-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": false
}
52 changes: 18 additions & 34 deletions packages/devlink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,44 @@ php artisan vendor:publish --tag="devlink-config"

```bash

# Ignore all files in packages/ (including symlinks)
# Devlink
# ignore symlinks in packages/
packages/*
# Allow tracking of real directories inside packages/
!packages/**/
# Ensure empty directories can be committed
!packages/*/.gitkeep
# for windows
# and for windows
/packageslocal/*

```

2. 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 the `DEVLINK_PACKAGES_PATH` variable to `packageslocal`).

3. When running `devlink:status`:
3. When running `php init.php`

- Lists all packages that are currently devlinked
- Lists all packages that are configured but not devlinked
- Lists all packages that are not configured, but devlinked
- Shows the configuration and the deploy status of each package
- Creates a `.env` file from `.env.example`
- Copies `composer.json-deploy` to `composer.json`
- Runs `composer install`

4. When running `devlink:link`:
4. 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)

5. When running `devlink:link`:

- Creates the packages folder, if it does not exist
- 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`

5. When running `devlink:unlink`:

- Removes all symlinks
- Deletes the packages folder, if empty
- Creates a backup of composer.json to composer.json-backup
- Restores original composer.json from composer.json-original
- Asks to run `composer install`
- Asks to run `php artisan optimize:clear`
- Asks to run `php artisan queue:restart`

6. When running `devlink:deploy`:

- Removes all symlinks
- Deletes the packages folder, if empty
- Creates a backup of composer.json to composer.json-backup
- Restores production-ready composer.json from composer.json-deploy
- Asks to run `composer install`
- Asks to run `php artisan optimize:clear`
Expand All @@ -73,17 +65,9 @@ packages/*
7. CI Safety Net - `deploy.sh`:

- If composer.json-deploy exists in the repository:
- the script will restore it as composer.json
- rename composer.json-original to composer.json-backup
- Commit and push the change in GH action
- This ensures no development configuration reaches production

## 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.

> ⚠️ **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.
- Remove all symlinks from /packages
- rename composer.json-deploy to composer.json
- Commit and push the change in your GitHub Action

## Mac

Expand All @@ -93,7 +77,7 @@ Mac works out of the box. You can have local packages mixed with the symlinked p

## Windows

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:
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:

```env
DEVLINK_PACKAGES_PATH=packageslocal
Expand Down
13 changes: 9 additions & 4 deletions packages/devlink/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Roadmap

This is the roadmap for the devlink package.

## Current tasks

- [ ] Private packages are not yet handled (copied and wired with path)
- [ ] Need to delete private packages in the link and unlink steps then
- [ ] There is probably an unclear state, because we do not yet use `-backup` yet
- [ ] For the shell script, we also need to check if `-original` and `-backup` are correct
We are working on the following tasks from top to bottom. Please don't forget to update the roadmap when a task is completed.

- [ ] ... no open tasks at the moment ...

## Ideas

- [ ] Deploy: new feature: last version for all packages instead of \*
15 changes: 0 additions & 15 deletions packages/devlink/config/devlink.json

This file was deleted.

Loading
Loading