From daa4b268a6e5ac1ae4db9eb8208bff3341673be1 Mon Sep 17 00:00:00 2001 From: lexx Date: Thu, 7 May 2026 21:38:07 +0300 Subject: [PATCH] cli setup --- front/js/svelte/Account.svelte | 2 - front/js/svelte/setup/Index.svelte | 28 ------------- front/js/svelte/setup/Step.svelte | 63 ----------------------------- src/Commands/Setup.php | 54 +++++++++++++++++++++++++ src/Http/web.php | 2 - src/LucentServiceProvider.php | 2 + src/Setup/Step/StorageSetupStep.php | 42 ------------------- 7 files changed, 56 insertions(+), 137 deletions(-) delete mode 100644 front/js/svelte/setup/Index.svelte delete mode 100644 front/js/svelte/setup/Step.svelte create mode 100644 src/Commands/Setup.php delete mode 100644 src/Setup/Step/StorageSetupStep.php diff --git a/front/js/svelte/Account.svelte b/front/js/svelte/Account.svelte index d6eabe3..9848048 100644 --- a/front/js/svelte/Account.svelte +++ b/front/js/svelte/Account.svelte @@ -3,7 +3,6 @@ import Login from "./account/Login.svelte"; import Verify from "./account/Verify.svelte"; import Profile from "./account/Profile.svelte"; - import SetupIndex from "./setup/Index.svelte"; import { setContext } from "svelte"; const components = { @@ -11,7 +10,6 @@ login: Login, verify: Verify, profile: Profile, - setup: SetupIndex, }; export let title; diff --git a/front/js/svelte/setup/Index.svelte b/front/js/svelte/setup/Index.svelte deleted file mode 100644 index 1727563..0000000 --- a/front/js/svelte/setup/Index.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - -
-

- {channel.name ?? "Lucent Setup"} -

-
-
- {#each steps as step} - - {/each} - -
- {#if allSuccess} - Create the first user - {/if} -
-
diff --git a/front/js/svelte/setup/Step.svelte b/front/js/svelte/setup/Step.svelte deleted file mode 100644 index 606f3f9..0000000 --- a/front/js/svelte/setup/Step.svelte +++ /dev/null @@ -1,63 +0,0 @@ - - -
-
- {#if step.status === "success"} - - {:else} - - {/if} -
-
-

{step.name}

-
- Instructions - {step.instructions} -
-
-
- - diff --git a/src/Commands/Setup.php b/src/Commands/Setup.php new file mode 100644 index 0000000..83d2418 --- /dev/null +++ b/src/Commands/Setup.php @@ -0,0 +1,54 @@ +status === SetupStepStatus::SUCCESS) { + $this->line(" ✔ {$result->name}"); + } else { + $this->line(" ✘ {$result->name}"); + $this->line(" {$result->instructions}"); + $allSuccess = false; + } + } + + $this->newLine(); + + if ($allSuccess) { + $this->info("All checks passed. Lucent is ready."); + return self::SUCCESS; + } + + $this->error("Some checks failed. Fix the issues above and run again."); + return self::FAILURE; + } +} diff --git a/src/Http/web.php b/src/Http/web.php index 5ec3f12..171afe4 100644 --- a/src/Http/web.php +++ b/src/Http/web.php @@ -10,9 +10,7 @@ use Lucent\Http\Controller\HomeController; use Lucent\Http\Controller\MemberController; use Lucent\Http\Controller\RecordController; use Lucent\Http\Controller\RevisionController; -use Lucent\Http\Controller\SetupController; -Route::get("/lucent/setup", [SetupController::class, "setup"]); Route::get("/lfs-{disk}/{any}", [FileController::class, "fromDisk"])->where( "any", ".*", diff --git a/src/LucentServiceProvider.php b/src/LucentServiceProvider.php index 1417a7d..3928bc9 100644 --- a/src/LucentServiceProvider.php +++ b/src/LucentServiceProvider.php @@ -22,6 +22,7 @@ use Lucent\Commands\RemoveOrphanEdges; use Lucent\Commands\SetupDatabase; use Lucent\Commands\Export; use Lucent\Commands\Import; +use Lucent\Commands\Setup; use Lucent\Data\ChannelAuth; use Lucent\File\FileService; use Lucent\Query\DatabaseGraph\DatabaseGraph; @@ -100,6 +101,7 @@ class LucentServiceProvider extends ServiceProvider GenerateCollectionSchema::class, Export::class, Import::class, + Setup::class, ]); } diff --git a/src/Setup/Step/StorageSetupStep.php b/src/Setup/Step/StorageSetupStep.php deleted file mode 100644 index 0206ad7..0000000 --- a/src/Setup/Step/StorageSetupStep.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'lucent' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', - 'visibility' => 'public', - 'throw' => true, - ], - ], -]; - - -EOD; - - - return match (!empty($storage)) { - true => SetupStep::makeSuccess($name, $instructions), - false => SetupStep::makeFail($name, $instructions), - }; - } -} \ No newline at end of file