@fleetbase/registry-bridge-engine 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/composer.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbase/registry-bridge",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Internal Bridge between Fleetbase API and Extensions Registry",
5
5
  "keywords": [
6
6
  "fleetbase-extension",
package/extension.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Registry Bridge",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Internal Bridge between Fleetbase API and Extensions Registry",
5
5
  "repository": "https://github.com/fleetbase/registry-bridge",
6
6
  "license": "AGPL-3.0-or-later",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/registry-bridge-engine",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Internal Bridge between Fleetbase API and Extensions Registry",
5
5
  "fleetbase": {
6
6
  "route": "extensions"
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace Fleetbase\RegistryBridge\Console\Commands;
4
4
 
5
- use Fleetbase\RegistryBridge\Providers\RegistryBridgeServiceProvider;
5
+ use Fleetbase\RegistryBridge\Support\Utils;
6
6
  use Illuminate\Console\Command;
7
7
 
8
8
  class Initialize extends Command
@@ -28,7 +28,7 @@ class Initialize extends Command
28
28
  */
29
29
  public function handle()
30
30
  {
31
- RegistryBridgeServiceProvider::bootRegistryAuth(true);
31
+ Utils::bootRegistryAuth(true);
32
32
 
33
33
  return 0;
34
34
  }
@@ -27,7 +27,6 @@ class RegistryBridgeServiceProvider extends CoreServiceProvider
27
27
  * @var array
28
28
  */
29
29
  public $commands = [
30
- \Fleetbase\RegistryBridge\Console\Commands\PostInstallExtension::class,
31
30
  \Fleetbase\RegistryBridge\Console\Commands\Initialize::class,
32
31
  ];
33
32
 
@@ -1,84 +0,0 @@
1
- <?php
2
-
3
- namespace Fleetbase\RegistryBridge\Console\Commands;
4
-
5
- use Fleetbase\RegistryBridge\Models\RegistryExtension;
6
- use Illuminate\Console\Command;
7
- use Symfony\Component\Process\Exception\ProcessFailedException;
8
- use Symfony\Component\Process\Process;
9
-
10
- class PostInstallExtension extends Command
11
- {
12
- /**
13
- * The name and signature of the console command.
14
- *
15
- * @var string
16
- */
17
- protected $signature = 'registry:post-install {extensionId}';
18
-
19
- /**
20
- * The console command description.
21
- *
22
- * @var string
23
- */
24
- protected $description = 'Post install an extension by running necessary commands';
25
-
26
- /**
27
- * Execute the console command.
28
- *
29
- * @return int
30
- */
31
- public function handle()
32
- {
33
- $extensionId = $this->argument('extensionId');
34
- $extension = RegistryExtension::disableCache()->where('public_id', $extensionId)->first();
35
-
36
- if ($extension) {
37
- $this->postInstallExtension($extension);
38
- $this->info('Post install commands executed successfully.');
39
- } else {
40
- $this->error('Extension not found.');
41
- }
42
-
43
- return 0;
44
- }
45
-
46
- /**
47
- * Post install extension commands.
48
- */
49
- public function postInstallExtension(RegistryExtension $extension): void
50
- {
51
- if (isset($extension->currentBundle)) {
52
- $composerJson = $extension->currentBundle->meta['composer.json'];
53
- if ($composerJson) {
54
- $extensionPath = base_path('vendor/' . $composerJson['name']);
55
-
56
- $commands = [
57
- 'rm -rf /fleetbase/.pnpm-store',
58
- 'rm -rf node_modules',
59
- 'pnpm install',
60
- 'pnpm build',
61
- ];
62
-
63
- $this->info('Running post install for: ' . $extension->name);
64
- $this->info('Extension install path: ' . $extensionPath);
65
- foreach ($commands as $command) {
66
- $this->info('Running extension post install command: `' . $command . '`');
67
- $process = Process::fromShellCommandline($command, $extensionPath);
68
- $process->run(function ($type, $buffer) {
69
- if (Process::ERR === $type) {
70
- $this->error($buffer);
71
- } else {
72
- $this->info($buffer);
73
- }
74
- });
75
-
76
- // Check if the process was successful
77
- if (!$process->isSuccessful()) {
78
- throw new ProcessFailedException($process);
79
- }
80
- }
81
- }
82
- }
83
- }
84
- }