feat: ✨ Aggiunta generazione del file `pnpm-workspace.yaml`
This commit is contained in:
parent
4905aaea68
commit
e5e97ac13c
|
@ -19,6 +19,8 @@ _ide_helper_models.php
|
||||||
.idea/watcherTasks.xml
|
.idea/watcherTasks.xml
|
||||||
.idea/webServers.xml
|
.idea/webServers.xml
|
||||||
storage/dotenv-editor/backups
|
storage/dotenv-editor/backups
|
||||||
|
pnpm-workspace.yaml
|
||||||
|
pnpm-lock.yaml
|
||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/laravel,composer,phpstorm,phpstorm+iml
|
# Created by https://www.toptal.com/developers/gitignore/api/laravel,composer,phpstorm,phpstorm+iml
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=laravel,composer,phpstorm,phpstorm+iml
|
# Edit at https://www.toptal.com/developers/gitignore?templates=laravel,composer,phpstorm,phpstorm+iml
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
|
class WritePnpmWorkspacesFile extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'osm:write-pnpm-workspaces';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Write PNPM workspaces file for additional modules dependencies installation';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
$modules = app(Controller::class)->getModules();
|
||||||
|
$workspaces_file = base_path('pnpm-workspace.yaml');
|
||||||
|
$workspaces = Yaml::parseFile($workspaces_file);
|
||||||
|
|
||||||
|
$workspaces['packages'] = [];
|
||||||
|
foreach ($modules as $module) {
|
||||||
|
$workspaces['packages'][] = relative_path(base_path(), $module['modulePath']);
|
||||||
|
}
|
||||||
|
|
||||||
|
File::put($workspaces_file, Yaml::dump($workspaces));
|
||||||
|
|
||||||
|
$this->info('Done');
|
||||||
|
}
|
||||||
|
}
|
8044
pnpm-lock.yaml
8044
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue