From 36eee7f6944d5773d473c3c02087fe2e861c6b0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:10:40 +0000 Subject: [PATCH 1/6] Initial plan From cffd205788146f7e21c42e1f92ac1af072740d41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:20:12 +0000 Subject: [PATCH 2/6] #add - Implement verbose output support for watch task Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com> --- src/Console/Command/Theme/WatchCommand.php | 9 +++++++- .../ThemeBuilder/HyvaThemes/Builder.php | 19 +++++++++++++++-- .../ThemeBuilder/MagentoStandard/Builder.php | 21 ++++++++++++++++--- .../ThemeBuilder/TailwindCSS/Builder.php | 19 +++++++++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/Console/Command/Theme/WatchCommand.php b/src/Console/Command/Theme/WatchCommand.php index 258d4f1..05b48cc 100644 --- a/src/Console/Command/Theme/WatchCommand.php +++ b/src/Console/Command/Theme/WatchCommand.php @@ -50,6 +50,12 @@ protected function configure() InputOption::VALUE_OPTIONAL, 'Theme to watch (format: Vendor/theme)' ) + ->addOption( + 'verbose', + 'v', + InputOption::VALUE_NONE, + 'Enable verbose output' + ) ->setAliases(['frontend:watch']); } @@ -59,6 +65,7 @@ protected function configure() protected function executeCommand(InputInterface $input, OutputInterface $output): int { $themeCode = $input->getArgument('themeCode'); + $isVerbose = $this->isVerbose($output); if (empty($themeCode)) { $themeCode = $input->getOption('theme'); @@ -89,6 +96,6 @@ protected function executeCommand(InputInterface $input, OutputInterface $output } $builder = $this->builderPool->getBuilder($themePath); - return $builder->watch($themePath, $this->io, $output, true) ? self::SUCCESS : self::FAILURE; + return $builder->watch($themePath, $this->io, $output, $isVerbose) ? self::SUCCESS : self::FAILURE; } } diff --git a/src/Service/ThemeBuilder/HyvaThemes/Builder.php b/src/Service/ThemeBuilder/HyvaThemes/Builder.php index 7bc5f33..b3d8b9d 100644 --- a/src/Service/ThemeBuilder/HyvaThemes/Builder.php +++ b/src/Service/ThemeBuilder/HyvaThemes/Builder.php @@ -121,7 +121,9 @@ private function buildTheme(string $themePath, SymfonyStyle $io, bool $isVerbose if ($isVerbose) { $io->text('Running npm build...'); } - $this->shell->execute('npm run build --quiet'); + // Use --quiet only in non-verbose mode to suppress routine output + $buildCommand = $isVerbose ? 'npm run build' : 'npm run build --quiet'; + $this->shell->execute($buildCommand); if ($isVerbose) { $io->success('Hyvä theme build completed successfully.'); } @@ -226,8 +228,21 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp } try { + if ($isVerbose) { + $io->text('Starting watch mode with verbose output...'); + } else { + $io->text('Starting watch mode... (use -v for verbose output)'); + } + chdir($tailwindPath); - passthru('npm run watch'); + $exitCode = 0; + passthru('npm run watch', $exitCode); + + // Check if the command failed + if ($exitCode !== 0) { + $io->error(sprintf('Watch mode exited with error code: %d', $exitCode)); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false; diff --git a/src/Service/ThemeBuilder/MagentoStandard/Builder.php b/src/Service/ThemeBuilder/MagentoStandard/Builder.php index 2b81156..d89b9a0 100644 --- a/src/Service/ThemeBuilder/MagentoStandard/Builder.php +++ b/src/Service/ThemeBuilder/MagentoStandard/Builder.php @@ -50,12 +50,14 @@ public function build(string $themePath, SymfonyStyle $io, OutputInterface $outp if ($isVerbose) { $io->text('Running grunt clean...'); } - $this->shell->execute('node_modules/.bin/grunt clean --quiet'); + // Use --quiet only in non-verbose mode to suppress routine output + $quietFlag = $isVerbose ? '' : '--quiet'; + $this->shell->execute("node_modules/.bin/grunt clean $quietFlag"); if ($isVerbose) { $io->text('Running grunt less...'); } - $this->shell->execute('node_modules/.bin/grunt less --quiet'); + $this->shell->execute("node_modules/.bin/grunt less $quietFlag"); if ($isVerbose) { $io->success('Grunt tasks completed successfully.'); @@ -193,7 +195,20 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp } try { - passthru('node_modules/.bin/grunt watch'); + if ($isVerbose) { + $io->text('Starting watch mode with verbose output...'); + } else { + $io->text('Starting watch mode... (use -v for verbose output)'); + } + + $exitCode = 0; + passthru('node_modules/.bin/grunt watch', $exitCode); + + // Check if the command failed + if ($exitCode !== 0) { + $io->error(sprintf('Watch mode exited with error code: %d', $exitCode)); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false; diff --git a/src/Service/ThemeBuilder/TailwindCSS/Builder.php b/src/Service/ThemeBuilder/TailwindCSS/Builder.php index 3e03a7e..5b8c27d 100644 --- a/src/Service/ThemeBuilder/TailwindCSS/Builder.php +++ b/src/Service/ThemeBuilder/TailwindCSS/Builder.php @@ -79,7 +79,9 @@ public function build(string $themePath, SymfonyStyle $io, OutputInterface $outp if ($isVerbose) { $io->text('Running npm build...'); } - $this->shell->execute('npm run build --quiet'); + // Use --quiet only in non-verbose mode to suppress routine output + $buildCommand = $isVerbose ? 'npm run build' : 'npm run build --quiet'; + $this->shell->execute($buildCommand); if ($isVerbose) { $io->success('Custom TailwindCSS theme build completed successfully.'); } @@ -198,8 +200,21 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp } try { + if ($isVerbose) { + $io->text('Starting watch mode with verbose output...'); + } else { + $io->text('Starting watch mode... (use -v for verbose output)'); + } + chdir($tailwindPath); - passthru('npm run watch'); + $exitCode = 0; + passthru('npm run watch', $exitCode); + + // Check if the command failed + if ($exitCode !== 0) { + $io->error(sprintf('Watch mode exited with error code: %d', $exitCode)); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false; From 42d5221e6b730555e7d93a38e33a984f5c473f0a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:20:57 +0000 Subject: [PATCH 3/6] #docs - Update CHANGELOG with verbose output feature Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10497ad..1d0df36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ All notable changes to this project will be documented in this file. ### Added +- feat: add verbose output support for watch task with `-v` flag + - Shows informative messages during watch mode based on verbosity level + - Captures and reports exit codes from npm/grunt watch commands + - Displays clear error messages when watch mode exits with errors + - Provides hint to use `-v` flag for verbose output in non-verbose mode - feat: add `mageforge:theme:tokens` command to generate Hyvä design tokens from design.tokens.json or hyva.config.json - feat: add `mageforge:hyva:compatibility:check` command to add a Hyvä compatibility checker - Scans Magento modules for Hyvä theme compatibility issues @@ -28,6 +33,9 @@ All notable changes to this project will be documented in this file. ### Changed +- refactor: improve build commands to show full output in verbose mode + - Remove `--quiet` flag from npm/grunt build commands when using verbose mode + - Allow better debugging of build issues during theme compilation - refactor: split complex executeCommand method into smaller, focused methods to reduce cyclomatic complexity - docs: update copilot-instructions.md with CI/CD integration guidelines for new commands From a723675b96f4b9dd1dcfdae512df69893e297221 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:22:20 +0000 Subject: [PATCH 4/6] #fix - Address command injection vulnerability in MagentoStandard Builder Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com> --- src/Service/ThemeBuilder/MagentoStandard/Builder.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Service/ThemeBuilder/MagentoStandard/Builder.php b/src/Service/ThemeBuilder/MagentoStandard/Builder.php index d89b9a0..be2d83d 100644 --- a/src/Service/ThemeBuilder/MagentoStandard/Builder.php +++ b/src/Service/ThemeBuilder/MagentoStandard/Builder.php @@ -49,15 +49,17 @@ public function build(string $themePath, SymfonyStyle $io, OutputInterface $outp try { if ($isVerbose) { $io->text('Running grunt clean...'); + $this->shell->execute('node_modules/.bin/grunt clean'); + } else { + $this->shell->execute('node_modules/.bin/grunt clean --quiet'); } - // Use --quiet only in non-verbose mode to suppress routine output - $quietFlag = $isVerbose ? '' : '--quiet'; - $this->shell->execute("node_modules/.bin/grunt clean $quietFlag"); if ($isVerbose) { $io->text('Running grunt less...'); + $this->shell->execute('node_modules/.bin/grunt less'); + } else { + $this->shell->execute('node_modules/.bin/grunt less --quiet'); } - $this->shell->execute("node_modules/.bin/grunt less $quietFlag"); if ($isVerbose) { $io->success('Grunt tasks completed successfully.'); From 3d1cf857def28cd26b3ed98e3714b81b0939265f Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Mon, 12 Jan 2026 13:27:38 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20remove=20v?= =?UTF-8?q?erbose=20option=20from=20watch=20command=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Console/Command/Theme/WatchCommand.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Console/Command/Theme/WatchCommand.php b/src/Console/Command/Theme/WatchCommand.php index 05b48cc..9afcee1 100644 --- a/src/Console/Command/Theme/WatchCommand.php +++ b/src/Console/Command/Theme/WatchCommand.php @@ -50,12 +50,6 @@ protected function configure() InputOption::VALUE_OPTIONAL, 'Theme to watch (format: Vendor/theme)' ) - ->addOption( - 'verbose', - 'v', - InputOption::VALUE_NONE, - 'Enable verbose output' - ) ->setAliases(['frontend:watch']); } From f0d31aba0ce0d037d1b89495f59a59d4a5faab86 Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Mon, 12 Jan 2026 13:31:01 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=90=9B=20fix:=20remove=20duplicate=20?= =?UTF-8?q?`--verbose`=20option=20from=20WatchCommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0df36..6cf48da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,6 @@ All notable changes to this project will be documented in this file. ## UNRELEASED - ### Added - feat: add verbose output support for watch task with `-v` flag @@ -31,6 +30,10 @@ All notable changes to this project will be documented in this file. - feat: add command alias `frontend:clean` for quick access - feat: add CI/CD tests for static:clean command in compatibility workflow +### Fixed + +- fix: remove duplicate `--verbose` option from WatchCommand that conflicted with Symfony Console's built-in verbose option + ### Changed - refactor: improve build commands to show full output in verbose mode