Skip to content
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
2 changes: 1 addition & 1 deletion .deployer/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ if [[ $framework == "laravel" ]]; then
# ----

echo "→ Optimizing..."
"${DEPLOYER_PHP}" artisan optimize:clear
"${DEPLOYER_PHP}" artisan optimize

fi

# Symfony (uncomment as needed)
Expand Down
12 changes: 6 additions & 6 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@
'database.redis.cache.backoff_base' => 'integer',
'database.redis.cache.backoff_cap' => 'integer',
'docs.path' => 'string',
'docs.cheat_sheet.cache_ttl_seconds' => 'integer',
'docs.command_index.cache_ttl_seconds' => 'integer',
'docs.github.repo' => 'string',
'docs.github.branch' => 'string',
'docs.github.dir' => 'string',
Expand Down Expand Up @@ -1527,7 +1527,7 @@
'database.redis.cache.backoff_base' => 'integer',
'database.redis.cache.backoff_cap' => 'integer',
'docs.path' => 'string',
'docs.cheat_sheet.cache_ttl_seconds' => 'integer',
'docs.command_index.cache_ttl_seconds' => 'integer',
'docs.github.repo' => 'string',
'docs.github.branch' => 'string',
'docs.github.dir' => 'string',
Expand Down Expand Up @@ -2037,7 +2037,7 @@
'database.redis.cache.backoff_base' => 'integer',
'database.redis.cache.backoff_cap' => 'integer',
'docs.path' => 'string',
'docs.cheat_sheet.cache_ttl_seconds' => 'integer',
'docs.command_index.cache_ttl_seconds' => 'integer',
'docs.github.repo' => 'string',
'docs.github.branch' => 'string',
'docs.github.dir' => 'string',
Expand Down Expand Up @@ -2369,7 +2369,7 @@
'database.redis.default.max_retries','database.redis.default.backoff_algorithm','database.redis.default.backoff_base','database.redis.default.backoff_cap','database.redis.cache.url',
'database.redis.cache.host','database.redis.cache.username','database.redis.cache.password','database.redis.cache.port','database.redis.cache.database',
'database.redis.cache.max_retries','database.redis.cache.backoff_algorithm','database.redis.cache.backoff_base','database.redis.cache.backoff_cap','docs.path',
'docs.cheat_sheet.cache_ttl_seconds','docs.github.repo','docs.github.branch','docs.github.dir','filesystems.default',
'docs.command_index.cache_ttl_seconds','docs.github.repo','docs.github.branch','docs.github.dir','filesystems.default',
'filesystems.disks.local.driver','filesystems.disks.local.root','filesystems.disks.local.serve','filesystems.disks.local.throw','filesystems.disks.local.report',
'filesystems.disks.public.driver','filesystems.disks.public.root','filesystems.disks.public.url','filesystems.disks.public.visibility','filesystems.disks.public.throw',
'filesystems.disks.public.report','filesystems.disks.s3.driver','filesystems.disks.s3.key','filesystems.disks.s3.secret','filesystems.disks.s3.region',
Expand Down Expand Up @@ -2423,10 +2423,10 @@
'signed','throttle','verified',);
registerArgumentsSet('routes',
'boost.browser-logs','default-livewire.update',
'livewire.upload-file','livewire.preview-file','home','docs.show','cheat-sheet',
'livewire.upload-file','livewire.preview-file','home','docs.show','command-index',
'storage.local',);
registerArgumentsSet('views',
'8c026b058f5337eae33f20fdb97d2c88::docs-viewer','cheat-sheet','components.docs.alert','components.docs.code-block','components.docs.content',
'8c026b058f5337eae33f20fdb97d2c88::docs-viewer','command-index','components.docs.alert','components.docs.code-block','components.docs.content',
'components.docs.headings','components.docs.toc','components.layouts.docs','docs-viewer','docs.alert',
'docs.code-block','docs.content','docs.headings','docs.toc','e60dd9d2c3a62d619c9acb38f20d5aa5::icon.github',
'e60dd9d2c3a62d619c9acb38f20d5aa5::icon.reddit','e60dd9d2c3a62d619c9acb38f20d5aa5::icon.x','f3dff5f3846978e0b3612bcd64f9871e::docs.alert','f3dff5f3846978e0b3612bcd64f9871e::docs.code-block','f3dff5f3846978e0b3612bcd64f9871e::docs.content',
Expand Down
24 changes: 24 additions & 0 deletions app/Console/Commands/DocsClearCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace App\Console\Commands;

use App\Services\DocsOutputCacheService;
use Illuminate\Console\Command;

final class DocsClearCommand extends Command
{
protected $signature = 'docs:clear';

protected $description = 'Clear docs output files';

public function handle(DocsOutputCacheService $docsOutput): int
{
$docsOutput->clear();

$this->components->info('Docs output cleared.');

return self::SUCCESS;
}
}
18 changes: 0 additions & 18 deletions app/Http/Controllers/HomeController.php

This file was deleted.

192 changes: 192 additions & 0 deletions app/Livewire/CommandIndex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<?php

declare(strict_types=1);

namespace App\Livewire;

use App\Services\CommandIndexService;
use App\Services\DocsOutputCacheService;
use App\Services\TocParserService;
use Illuminate\Contracts\View\View;
use Livewire\Attributes\Layout;
use Livewire\Component;

#[Layout('components.layouts.command-index')]
final class CommandIndex extends Component
{
/**
* @var array<int, array{
* name: string,
* count: int,
* namespaceCount: int,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>
* }>
*/
public array $sections = [];

/**
* @var array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>
*/
public array $groups = [];

public int $commandCount = 0;

public int $aliasCount = 0;

/**
* @var array<int, array{
* name: string,
* anchor: string,
* links: array<int, array{title: string, path: string}>
* }>
*/
public array $toc = [];

public function mount(
DocsOutputCacheService $docsOutputCache,
TocParserService $tocParser,
CommandIndexService $sheet,
): void {
/** @var array{
* toc: array<int, array{
* name: string,
* anchor: string,
* links: array<int, array{title: string, path: string}>
* }>,
* sections: array<int, array{
* name: string,
* count: int,
* namespaceCount: int,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>
* }>,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>,
* commandCount: int,
* aliasCount: int
* } $payload
*/
$payload = $docsOutputCache->remember(
$docsOutputCache->key('command-index'),
function () use ($tocParser, $sheet): array {
/** @var array{
* sections: array<int, array{
* name: string,
* count: int,
* namespaceCount: int,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>
* }>,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>,
* commandCount: int,
* aliasCount: int
* } $commandIndex
*/
$commandIndex = $sheet->build();

return [
'toc' => $tocParser->parse(),
'sections' => $commandIndex['sections'],
'groups' => $commandIndex['groups'],
'commandCount' => $commandIndex['commandCount'],
'aliasCount' => $commandIndex['aliasCount'],
];
},
);

$this->hydrateFromPayload($payload);
}

public function render(): View
{
return view('livewire.command-index');
}

/**
* @param array{
* toc: array<int, array{
* name: string,
* anchor: string,
* links: array<int, array{title: string, path: string}>
* }>,
* sections: array<int, array{
* name: string,
* count: int,
* namespaceCount: int,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>
* }>,
* groups: array<int, array{
* name: string,
* count: int,
* commands: array<int, array{
* primary: string,
* aliases: array<int, string>,
* description: string
* }>
* }>,
* commandCount: int,
* aliasCount: int
* } $payload
*/
private function hydrateFromPayload(array $payload): void
{
$this->toc = $payload['toc'];
$this->sections = $payload['sections'];
$this->groups = $payload['groups'];
$this->commandCount = $payload['commandCount'];
$this->aliasCount = $payload['aliasCount'];
}
}
Loading