diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index ecfd7e91..50649647 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -15,10 +15,15 @@ use Native\Electron\Traits\OsAndArch; use Native\Electron\Traits\PatchesPackagesJson; use Native\Electron\Traits\PrunesVendorDirectory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Process\Process as SymfonyProcess; use function Laravel\Prompts\intro; +#[AsCommand( + name: 'native:build', + description: 'Build the NativePHP application for the specified operating system and architecture.', +)] class BuildCommand extends Command { use CleansEnvFile; diff --git a/src/Commands/BundleCommand.php b/src/Commands/BundleCommand.php index a3a94065..a27d5449 100644 --- a/src/Commands/BundleCommand.php +++ b/src/Commands/BundleCommand.php @@ -17,11 +17,16 @@ use Native\Electron\Traits\LocatesPhpBinary; use Native\Electron\Traits\PatchesPackagesJson; use Native\Electron\Traits\PrunesVendorDirectory; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Finder\Finder; use ZipArchive; use function Laravel\Prompts\intro; +#[AsCommand( + name: 'native:bundle', + description: 'Bundle your application for distribution.', +)] class BundleCommand extends Command { use CleansEnvFile; @@ -35,8 +40,6 @@ class BundleCommand extends Command protected $signature = 'native:bundle {--fetch} {--clear} {--without-cleanup}'; - protected $description = 'Bundle your application for distribution.'; - private ?string $key; private string $zipPath; diff --git a/src/Commands/DevelopCommand.php b/src/Commands/DevelopCommand.php index 9a5d7f95..59385676 100644 --- a/src/Commands/DevelopCommand.php +++ b/src/Commands/DevelopCommand.php @@ -8,10 +8,15 @@ use Native\Electron\Traits\Installer; use Native\Electron\Traits\InstallsAppIcon; use Native\Electron\Traits\PatchesPackagesJson; +use Symfony\Component\Console\Attribute\AsCommand; use function Laravel\Prompts\intro; use function Laravel\Prompts\note; +#[AsCommand( + name: 'native:serve', + description: 'Start the NativePHP development server with the Electron app', +)] class DevelopCommand extends Command { use CopiesCertificateAuthority; diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index db71977c..29626b31 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -5,6 +5,7 @@ use Illuminate\Console\Command; use Native\Electron\Traits\Installer; use RuntimeException; +use Symfony\Component\Console\Attribute\AsCommand; use function Laravel\Prompts\confirm; use function Laravel\Prompts\info; @@ -12,6 +13,10 @@ use function Laravel\Prompts\note; use function Laravel\Prompts\outro; +#[AsCommand( + name: 'native:install', + description: 'Install all of the NativePHP resources', +)] class InstallCommand extends Command { use Installer; @@ -20,8 +25,6 @@ class InstallCommand extends Command {--force : Overwrite existing files by default} {--installer=npm : The package installer to use: npm, yarn or pnpm}'; - protected $description = 'Install all of the NativePHP resources'; - public function handle(): void { intro('Publishing NativePHP Service Provider...'); diff --git a/src/Commands/PublishCommand.php b/src/Commands/PublishCommand.php index a631c336..c2aef693 100644 --- a/src/Commands/PublishCommand.php +++ b/src/Commands/PublishCommand.php @@ -6,7 +6,12 @@ use Illuminate\Support\Facades\Artisan; use Native\Electron\Traits\LocatesPhpBinary; use Native\Electron\Traits\OsAndArch; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand( + name: 'native:publish', + description: 'Build and publish the NativePHP app for the specified operating system and architecture', +)] class PublishCommand extends Command { use LocatesPhpBinary; diff --git a/src/Commands/ResetCommand.php b/src/Commands/ResetCommand.php index ab3ffdeb..094f7f13 100644 --- a/src/Commands/ResetCommand.php +++ b/src/Commands/ResetCommand.php @@ -4,18 +4,21 @@ use Illuminate\Console\Command; use Native\Electron\Traits\PatchesPackagesJson; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Filesystem\Filesystem; use function Laravel\Prompts\intro; +#[AsCommand( + name: 'native:reset', + description: 'Clear all build and dist files', +)] class ResetCommand extends Command { use PatchesPackagesJson; protected $signature = 'native:reset {--with-app-data : Clear the app data as well}'; - protected $description = 'Clear all build and dist files'; - public function handle(): int { intro('Clearing build and dist directories...');