From 16b1a20a6683f3c727290592deb12017a30589cf Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Sun, 8 Jun 2025 17:54:52 +0200 Subject: [PATCH 1/2] fix: symfony console deprecation notice --- src/Commands/BuildCommand.php | 5 +++++ src/Commands/BundleCommand.php | 7 +++++-- src/Commands/DevelopCommand.php | 5 +++++ src/Commands/InstallCommand.php | 7 +++++-- src/Commands/PublishCommand.php | 5 +++++ src/Commands/ResetCommand.php | 6 +++++- 6 files changed, 30 insertions(+), 5 deletions(-) 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..1b333fa4 100644 --- a/src/Commands/DevelopCommand.php +++ b/src/Commands/DevelopCommand.php @@ -9,9 +9,14 @@ 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..7c5597e2 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -6,12 +6,17 @@ use Native\Electron\Traits\Installer; use RuntimeException; +use Symfony\Component\Console\Attribute\AsCommand; use function Laravel\Prompts\confirm; use function Laravel\Prompts\info; use function Laravel\Prompts\intro; 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..82dd600f 100644 --- a/src/Commands/ResetCommand.php +++ b/src/Commands/ResetCommand.php @@ -4,17 +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 { From 82910bd3c1dc3107a28f86b1846694d2ce403c02 Mon Sep 17 00:00:00 2001 From: SRWieZ <1408020+SRWieZ@users.noreply.github.com> Date: Sun, 8 Jun 2025 15:56:10 +0000 Subject: [PATCH 2/2] Fix styling --- src/Commands/DevelopCommand.php | 2 +- src/Commands/InstallCommand.php | 2 +- src/Commands/ResetCommand.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Commands/DevelopCommand.php b/src/Commands/DevelopCommand.php index 1b333fa4..59385676 100644 --- a/src/Commands/DevelopCommand.php +++ b/src/Commands/DevelopCommand.php @@ -8,8 +8,8 @@ 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; diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 7c5597e2..29626b31 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -5,8 +5,8 @@ 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; use function Laravel\Prompts\intro; diff --git a/src/Commands/ResetCommand.php b/src/Commands/ResetCommand.php index 82dd600f..094f7f13 100644 --- a/src/Commands/ResetCommand.php +++ b/src/Commands/ResetCommand.php @@ -19,7 +19,6 @@ class ResetCommand extends Command protected $signature = 'native:reset {--with-app-data : Clear the app data as well}'; - public function handle(): int { intro('Clearing build and dist directories...');