Skip to content

fix(devtui): regenerate var/plugins.json before starting watchers#1039

Merged
Soner (shyim) merged 2 commits into
nextfrom
fix/devtui-watcher-plugins-json
May 19, 2026
Merged

fix(devtui): regenerate var/plugins.json before starting watchers#1039
Soner (shyim) merged 2 commits into
nextfrom
fix/devtui-watcher-plugins-json

Conversation

@shyim
Copy link
Copy Markdown
Member

Summary

  • devtui's admin/storefront watcher startup now regenerates var/plugins.json (parity with the standalone admin-watch / storefront-watch commands), fixing the missing-file failure.
  • Shared helpers extracted into internal/extension/project_plugin_json.go (LoadProjectAssetSources, ExcludeExtensionsFromSources, WriteProjectPluginJson, WritePluginJsonForSources); filterAndWritePluginJson / filterAndGetSources reuse them.
  • bundle:dump no longer inherits stdout/stderr — its "Dumped plugin configuration." line was corrupting the TUI. Output is captured and surfaced only on failure.
  • devtui's watcher prep runs under logging.DisableLogger so the npm "Installing dependencies" line stays out of the render.
  • watcherStoppedMsg carries the real error; the model appends it to the logs tab and switches there so startup failures are visible instead of a silent "stopped" badge.

Test plan

  • go test ./...
  • Manual: start devtui in a project missing var/plugins.json, hit the admin watcher hotkey, confirm it starts cleanly with no TUI corruption.
  • Manual: same for the storefront watcher.
  • Manual: force a failure (e.g. break composer.lock) and confirm the error appears in the logs tab.
  • Manual: run shopware-cli project admin-watch standalone to confirm the cobra path still works.

The standalone admin-watch / storefront-watch commands run
filterAndWritePluginJson before launching the watcher; devtui skipped
that step and the watcher could fail with a missing var/plugins.json.

Extract the shared pieces (LoadProjectAssetSources,
ExcludeExtensionsFromSources, WriteProjectPluginJson,
WritePluginJsonForSources) into internal/extension so both code paths
share them, then call WriteProjectPluginJson from the devtui watcher
start commands.

While here:
- stop DumpAndLoadAssetSourcesOfProject from inheriting os.Stdout/Stderr
  so bundle:dump's success line no longer corrupts the TUI; surface
  captured output only on failure.
- run devtui's watcher prep with logging.DisableLogger so the npm
  "Installing dependencies" log stays out of the rendered UI.
- carry the real error on watcherStoppedMsg and append it to the logs
  tab so startup failures are visible instead of a silent "stopped".
@shyim Soner (shyim) marked this pull request as ready for review May 19, 2026 09:20
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8418fe866

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread cmd/project/platform.go Outdated
The refactored switch made --only-custom-static-extensions mutually
exclusive with --only-extensions / --skip-extensions, silently dropping
the explicit filter. Restore the original semantics: custom-static is
its own independent pass that runs first, then the only/skip/default
exclusion runs on the narrowed list. The default exclude-list still
skips when --only-custom-static is set (matching the original).
@shyim Soner (shyim) merged commit 9091a94 into next May 19, 2026
2 checks passed
@shyim Soner (shyim) deleted the fix/devtui-watcher-plugins-json branch May 19, 2026 09:47
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.

1 participant