Skip to content

Commit 152a85c

Browse files
committed
Devlink Windows
1 parent 203441e commit 152a85c

File tree

2 files changed

+39
-13
lines changed

2 files changed

+39
-13
lines changed

packages/devlink/README.md

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ It is used to link the packages from the `moox` monorepo into a project. It runs
77
## Installation
88

99
```bash
10+
cp composer.json.example composer.json
11+
cp .env.example .env
1012
composer require moox/devlink
1113
php artisan vendor:publish --tag="devlink-config"
1214
```
@@ -32,49 +34,73 @@ packages/*
3234
!packages/**/
3335
# Ensure empty directories can be committed
3436
!packages/*/.gitkeep
37+
# Ignore all files in packages-linked/ (for Windows)
38+
packages-linked/*
3539
```
3640

3741
## Configuration
3842

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

4145
```php
42-
'base_paths' => [
43-
// 'path/to/base/path',
44-
],
4546

46-
'packages' => [
47-
// 'package-name',
48-
],
47+
'packages_path' => 'packages',
48+
49+
'base_paths' => [
50+
base_path('../moox/packages'),
51+
],
52+
53+
'packages' => [
54+
'moox/tag',
55+
],
56+
4957
```
5058

5159
## Command
5260

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

5563
```bash
56-
php artisan moox:devlink
64+
65+
php artisan moox:devlink
66+
5767
```
5868

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

6171
Finally, it will run `composer update`.
6272

63-
You can have local packages mixed with the symlinked packages in your `/packages` folder.
64-
65-
![Moox Devlink](./devlink-mix.jpg)
66-
6773
### Changing branches
6874

6975
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.
7076

7177
```bash
72-
php artisan moox:devlink
78+
79+
php artisan moox:devlink
80+
7381
```
7482

7583
> ⚠️ **Important**
7684
> 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.
7785
86+
## Mac
87+
88+
Mac works out of the box. You can have local packages mixed with the symlinked packages in your `/packages` folder.
89+
90+
![Moox Devlink](./devlink-mix.jpg)
91+
92+
## Windows
93+
94+
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:
95+
96+
```php
97+
98+
'packages_path' => 'packages-linked',
99+
100+
```
101+
102+
Devlink will then link the packages into the `packages-linked` folder.
103+
78104
## Security Vulnerabilities
79105

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

packages/devlink/src/Commands/LinkPackages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct()
3434
}
3535

3636
$this->composerJsonPath = base_path('composer.json');
37-
$this->packagesPath = base_path('packages');
37+
$this->packagesPath = config('devlink.packages_path', base_path('packages'));
3838
}
3939

4040
public function handle(): void

0 commit comments

Comments
 (0)