Skip to content

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Aug 6, 2025

🎫 Issue IBX-10558

Description:

Allow to have yarn encore dev --watch feature without changing habitual command.

php bin/console ibexa:encore:compile --watch runs until killed, it watches the assets, and rebuilds them on change.

About errors:

  • php bin/console ibexa:encore:compile --watch --timeout 123 throws error Watch mode can't be used with a timeout.
  • php bin/console ibexa:encore:compile --timeout still throws error The "--timeout" option requires a value.
  • php bin/console ibexa:encore:compile --timeout abc still throws error Timeout value has to be an integer.

For QA:

Documentation:

@adamwojs adamwojs requested a review from a team August 11, 2025 17:57
@ezrobot ezrobot requested review from adamwojs, mikadamczyk, Steveb-p, alongosz, ciastektk, ViniTou, barw4, wiewiurdp, konradoboza and tbialcz and removed request for a team August 11, 2025 17:58
@@ -77,7 +83,8 @@ protected function getFrontendConfigPath(string $configName): string

protected function execute(InputInterface $input, OutputInterface $output): int
{
$timeout = (float)$input->getOption('timeout');
$watch = $input->getOption('watch');
$timeout = $watch ? null : (float)$input->getOption('timeout');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone passes --timeout, but we silently discard it due to --watch, it should raise an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 84aab74...a220c2d I implemented the error when both options are used at the same time --watch --timeout 123.
To be able to detected if the user passed the --timeout option, I had to remove its default value from definition.

@adriendupuis adriendupuis requested a review from Steveb-p August 12, 2025 07:43
Copy link

@adamwojs adamwojs merged commit 6433d08 into main Aug 28, 2025
24 checks passed
@adamwojs adamwojs deleted the yarn-encore-watch branch August 28, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants