Skip to content

Commit 2dc782c

Browse files
add option to indicate whether Breeze should be scaffolded with TypeScript support (#271)
* add option to indicate whether Breeze should be scaffolded with Typescript support * add "experimental" wording and adjust option position to match breeze installer * fix typo in TypeScript * Update NewCommand.php * Update NewCommand.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent fb2002a commit 2dc782c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/NewCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ protected function configure()
3737
->addOption('organization', null, InputOption::VALUE_REQUIRED, 'The GitHub organization to create the new repository for')
3838
->addOption('breeze', null, InputOption::VALUE_NONE, 'Installs the Laravel Breeze scaffolding')
3939
->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support')
40+
->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with TypeScript support (Experimental)')
4041
->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with Inertia SSR support')
4142
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
4243
->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
232233
trim(sprintf(
233234
'"'.PHP_BINARY.'" artisan breeze:install %s %s %s %s',
234235
$input->getOption('stack'),
236+
$input->getOption('typescript') ? '--typescript' : '',
235237
$input->getOption('pest') ? '--pest' : '',
236238
$input->getOption('dark') ? '--dark' : '',
237239
$input->getOption('ssr') ? '--ssr' : '',
@@ -297,10 +299,12 @@ protected function promptForBreezeOptions(InputInterface $input)
297299
options: [
298300
'dark' => 'Dark mode',
299301
'ssr' => 'Inertia SSR',
302+
'typescript' => 'TypeScript (experimental)',
300303
],
301304
default: array_filter([
302305
$input->getOption('dark') ? 'dark' : null,
303306
$input->getOption('ssr') ? 'ssr' : null,
307+
$input->getOption('typescript') ? 'typescript' : null,
304308
]),
305309
))->each(fn ($option) => $input->setOption($option, true));
306310
} elseif ($input->getOption('stack') === 'blade' && ! $input->getOption('dark')) {

0 commit comments

Comments
 (0)