Skip to content

Commit 7946459

Browse files
committed
Release 1.0.11
1 parent aab483a commit 7946459

3 files changed

Lines changed: 8 additions & 75 deletions

File tree

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,7 @@ bin/console sidworks:watch-storefront --no-twig
116116
bin/console sidworks:watch-storefront --no-scss
117117
```
118118

119-
Theme selection shortcuts:
120-
121-
```bash
122-
bin/console sidworks:watch-storefront --theme-name=QsoTheme
123-
bin/console sidworks:watch-storefront --theme-id=018e94f67ba2719da036725041793f30 --domain-url=https://carclean.ddev.site/nl
124-
bin/console sidworks:watch-storefront --pick-theme
125-
```
126-
127-
`--domain-url` requires `--theme-id` (or use `--pick-theme` for interactive theme + domain selection).
119+
Theme/domain selection is always interactive in the console prompt.
128120

129121
### Template Inspector — Basic Workflow
130122

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Sidworks Developer tools for Shopware 6",
44
"type": "shopware-platform-plugin",
55
"license": "MIT",
6-
"version": "1.0.10",
6+
"version": "1.0.11",
77
"authors": [
88
{
99
"name": "Sidworks"

src/Command/WatchCommand.php

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ protected function configure(): void
2222
->addOption('no-js', null, InputOption::VALUE_NONE, 'Disable JS compilation (core + plugins)')
2323
->addOption('no-twig', null, InputOption::VALUE_NONE, 'Disable Twig watch/live reload feedback')
2424
->addOption('no-scss', null, InputOption::VALUE_NONE, 'Disable SCSS compilation')
25-
->addOption('open-browser', null, InputOption::VALUE_NONE, 'Auto-open browser on startup')
26-
->addOption('theme-name', null, InputOption::VALUE_REQUIRED, 'Technical theme name passed to theme:dump')
27-
->addOption('theme-id', null, InputOption::VALUE_REQUIRED, 'Theme ID passed to theme:dump')
28-
->addOption('domain-url', null, InputOption::VALUE_REQUIRED, 'Sales channel domain URL passed to theme:dump')
29-
->addOption('pick-theme', null, InputOption::VALUE_NONE, 'Force interactive theme:dump theme/domain picker');
25+
->addOption('open-browser', null, InputOption::VALUE_NONE, 'Auto-open browser on startup');
3026
}
3127

3228
protected function execute(InputInterface $input, OutputInterface $output): int
@@ -67,35 +63,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6763
$disableTwig = (bool) $input->getOption('no-twig');
6864
$disableScss = (bool) $input->getOption('no-scss');
6965
$openBrowser = (bool) $input->getOption('open-browser');
70-
$themeName = $this->normalizeOptionalString($input->getOption('theme-name'));
71-
$themeId = $this->normalizeOptionalString($input->getOption('theme-id'));
72-
$domainUrl = $this->normalizeOptionalString($input->getOption('domain-url'));
73-
$pickThemeOption = (bool) $input->getOption('pick-theme');
74-
$canRunThemePicker = $input->isInteractive() && Process::isTtySupported();
75-
$hasExplicitThemeSelection = $themeName !== '' || $themeId !== '' || $domainUrl !== '';
76-
$pickTheme = $pickThemeOption || (!$hasExplicitThemeSelection && $canRunThemePicker);
7766
$scssEngine = $this->resolveScssEngine();
7867

79-
if ($themeName !== '' && $themeId !== '') {
80-
$io->error('Use either --theme-name or --theme-id (not both).');
81-
82-
return self::FAILURE;
83-
}
84-
85-
if ($domainUrl !== '' && $themeId === '') {
86-
$io->error('--domain-url requires --theme-id. Use --pick-theme for interactive theme/domain selection.');
87-
88-
return self::FAILURE;
89-
}
90-
91-
if ($pickThemeOption && ($themeName !== '' || $themeId !== '' || $domainUrl !== '')) {
92-
$io->error('--pick-theme cannot be combined with --theme-name, --theme-id, or --domain-url.');
93-
94-
return self::FAILURE;
95-
}
96-
97-
if ($pickThemeOption && !$canRunThemePicker) {
98-
$io->error('--pick-theme requires an interactive TTY terminal.');
68+
if (!$input->isInteractive() || !Process::isTtySupported()) {
69+
$io->error('sidworks:watch-storefront requires an interactive TTY terminal because theme selection is always prompted.');
9970

10071
return self::FAILURE;
10172
}
@@ -141,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
141112
}
142113
}
143114

144-
$prepExitCode = $this->runPrepCommands($output, $input, $projectRoot, $themeName, $themeId, $domainUrl, $pickTheme);
115+
$prepExitCode = $this->runPrepCommands($output, $input, $projectRoot);
145116
if ($prepExitCode !== 0) {
146117
return $prepExitCode;
147118
}
@@ -161,31 +132,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
161132
private function runPrepCommands(
162133
OutputInterface $output,
163134
InputInterface $input,
164-
string $projectRoot,
165-
string $themeName,
166-
string $themeId,
167-
string $domainUrl,
168-
bool $pickTheme
135+
string $projectRoot
169136
): int {
170-
$hasThemeSelection = $themeName !== '' || $themeId !== '' || $domainUrl !== '' || $pickTheme;
171-
if (is_file($projectRoot . '/var/theme-files.json') && !$hasThemeSelection) {
172-
return 0;
173-
}
174-
175-
$themeDumpArguments = ['theme:dump'];
176-
if ($themeName !== '') {
177-
$themeDumpArguments[] = '--theme-name=' . $themeName;
178-
}
179-
180-
if ($themeId !== '') {
181-
$themeDumpArguments[] = $themeId;
182-
}
183-
184-
if ($domainUrl !== '') {
185-
$themeDumpArguments[] = $domainUrl;
186-
}
187-
188-
return $this->runConsoleCommand($themeDumpArguments, $projectRoot, $output, $input, !$pickTheme);
137+
return $this->runConsoleCommand(['theme:dump'], $projectRoot, $output, $input, false);
189138
}
190139

191140
private function runConsoleCommand(
@@ -724,12 +673,4 @@ private function killPids(array $pids, string $signal): void
724673
$kill->run();
725674
}
726675

727-
private function normalizeOptionalString(mixed $value): string
728-
{
729-
if (!\is_string($value)) {
730-
return '';
731-
}
732-
733-
return trim($value);
734-
}
735676
}

0 commit comments

Comments
 (0)