From 27b98c06927d67e0d90b4eddb4ed0e8261f6ed1e Mon Sep 17 00:00:00 2001 From: Dale Weaver Date: Fri, 11 Aug 2023 10:23:05 -0400 Subject: [PATCH 1/5] add option to indicate whether Breeze should be scaffolded with Typescript support --- src/NewCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NewCommand.php b/src/NewCommand.php index 3341e016..49f5c9e7 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -37,6 +37,7 @@ protected function configure() ->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for') ->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding') ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support') + ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Typescript support') ->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support') ->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding') ->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Breeze / Jetstream stack that should be installed') @@ -232,6 +233,7 @@ protected function installBreeze(string $directory, InputInterface $input, Outpu trim(sprintf( '"'.PHP_BINARY.'" artisan breeze:install %s %s %s %s', $input->getOption('stack'), + $input->getOption('typescript') ? '--typescript' : '', $input->getOption('pest') ? '--pest' : '', $input->getOption('dark') ? '--dark' : '', $input->getOption('ssr') ? '--ssr' : '', @@ -295,10 +297,12 @@ protected function promptForBreezeOptions(InputInterface $input) collect(multiselect( label: 'Would you like any optional features?', options: [ + 'typescript' => 'Typescript', 'dark' => 'Dark mode', 'ssr' => 'Inertia SSR', ], default: array_filter([ + $input->getOption('typescript') ? 'typescript' : null, $input->getOption('dark') ? 'dark' : null, $input->getOption('ssr') ? 'ssr' : null, ]), From 52959de5bd3086117ed695a22e1208456676adca Mon Sep 17 00:00:00 2001 From: Dale Weaver Date: Fri, 11 Aug 2023 10:36:38 -0400 Subject: [PATCH 2/5] add "experimental" wording and adjust option position to match breeze installer --- src/NewCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 49f5c9e7..fdd489d0 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -37,7 +37,7 @@ protected function configure() ->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for') ->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding') ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support') - ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Typescript support') + ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Typescript support (experimental)') ->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support') ->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding') ->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Breeze / Jetstream stack that should be installed') @@ -297,9 +297,9 @@ protected function promptForBreezeOptions(InputInterface $input) collect(multiselect( label: 'Would you like any optional features?', options: [ - 'typescript' => 'Typescript', 'dark' => 'Dark mode', 'ssr' => 'Inertia SSR', + 'typescript' => 'Typescript (experimental)', ], default: array_filter([ $input->getOption('typescript') ? 'typescript' : null, From efe389714bfb71eb1a0fd15adfbc85880716ff82 Mon Sep 17 00:00:00 2001 From: Dale Weaver Date: Fri, 11 Aug 2023 10:41:21 -0400 Subject: [PATCH 3/5] fix typo in TypeScript --- src/NewCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index fdd489d0..81938db0 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -37,7 +37,7 @@ protected function configure() ->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for') ->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding') ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support') - ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Typescript support (experimental)') + ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with TypeScript support (experimental)') ->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support') ->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding') ->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Breeze / Jetstream stack that should be installed') @@ -299,7 +299,7 @@ protected function promptForBreezeOptions(InputInterface $input) options: [ 'dark' => 'Dark mode', 'ssr' => 'Inertia SSR', - 'typescript' => 'Typescript (experimental)', + 'typescript' => 'TypeScript (experimental)', ], default: array_filter([ $input->getOption('typescript') ? 'typescript' : null, From 6750f497f1817c7d01873bd3fa2af3995ef355b7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 11 Aug 2023 09:49:33 -0500 Subject: [PATCH 4/5] Update NewCommand.php --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 81938db0..689b4cfb 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -37,7 +37,7 @@ protected function configure() ->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for') ->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding') ->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support') - ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with TypeScript support (experimental)') + ->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with TypeScript support (Experimental)') ->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support') ->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding') ->addOption('stack', null, InputOption::VALUE_OPTIONAL, 'The Breeze / Jetstream stack that should be installed') From 26fa96c506aa5e911d18cf48f7c8d34d9f4415c9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 11 Aug 2023 09:50:08 -0500 Subject: [PATCH 5/5] Update NewCommand.php --- src/NewCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index 689b4cfb..2bc04cb9 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -302,9 +302,9 @@ protected function promptForBreezeOptions(InputInterface $input) 'typescript' => 'TypeScript (experimental)', ], default: array_filter([ - $input->getOption('typescript') ? 'typescript' : null, $input->getOption('dark') ? 'dark' : null, $input->getOption('ssr') ? 'ssr' : null, + $input->getOption('typescript') ? 'typescript' : null, ]), ))->each(fn ($option) => $input->setOption($option, true)); } elseif ($input->getOption('stack') === 'blade' && ! $input->getOption('dark')) {