From 9217bce663744a307dc9de3aab50dd806cbdf0e5 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Sun, 11 May 2025 18:13:47 +0900 Subject: [PATCH] [Toolkit] Minor adjustements on Kit creation command (reword questions, fix doc format) --- src/Toolkit/src/Command/CreateKitCommand.php | 49 +++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/Toolkit/src/Command/CreateKitCommand.php b/src/Toolkit/src/Command/CreateKitCommand.php index ddbe6ff2920..604a88c0265 100644 --- a/src/Toolkit/src/Command/CreateKitCommand.php +++ b/src/Toolkit/src/Command/CreateKitCommand.php @@ -43,10 +43,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io = new SymfonyStyle($input, $output); // Get the kit name - $question = new Question('What is the name of your kit?'); + $question = new Question("What's the name of your kit?"); $question->setValidator(function (?string $value) { if (empty($value)) { - throw new \RuntimeException('Kit name cannot be empty'); + throw new \RuntimeException('Kit name cannot be empty.'); } Assert::kitName($value); @@ -55,10 +55,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $kitName = $io->askQuestion($question); // Get the kit homepage - $question = new Question('What is the homepage of your kit?'); + $question = new Question("What's the Homepage URL of your kit?"); $question->setValidator(function (?string $value) { if (empty($value) || !filter_var($value, \FILTER_VALIDATE_URL)) { - throw new \Exception('The homepage must be a valid URL'); + throw new \Exception('The homepage URL must be valid.'); } return $value; @@ -66,10 +66,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $kitHomepage = $io->askQuestion($question); // Get the kit author name - $question = new Question('What is the author name of your kit?'); + $question = new Question("What's the name of the author?"); $question->setValidator(function (?string $value) { if (empty($value)) { - throw new \Exception('The author name cannot be empty'); + throw new \Exception('The author name cannot be empty.'); } return $value; @@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $question = new Question('What is the license of your kit?'); $question->setValidator(function (string $value) { if (empty($value)) { - throw new \Exception('The license cannot be empty'); + throw new \Exception('The license cannot be empty.'); } return $value; @@ -107,20 +107,31 @@ protected function execute(InputInterface $input, OutputInterface $output): int ) -%} TWIG ); - $this->filesystem->dumpFile('docs/components/Button.twig', <<filesystem->dumpFile('docs/components/Button.md', << @@ -128,17 +139,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int ``` -# Button with Variants +## Examples + +### Button with Variants ```twig Default Secondary ``` -{% endblock %} + TWIG ); - $io->success('Perfect, you can now start building your kit!'); + $io->success('Your kit has been scaffolded, enjoy!'); return self::SUCCESS; }