fix(devtui): regenerate var/plugins.json before starting watchers#1039
Merged
Conversation
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".
There was a problem hiding this comment.
💡 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".
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
var/plugins.json(parity with the standaloneadmin-watch/storefront-watchcommands), fixing the missing-file failure.internal/extension/project_plugin_json.go(LoadProjectAssetSources,ExcludeExtensionsFromSources,WriteProjectPluginJson,WritePluginJsonForSources);filterAndWritePluginJson/filterAndGetSourcesreuse them.bundle:dumpno longer inherits stdout/stderr — its "Dumped plugin configuration." line was corrupting the TUI. Output is captured and surfaced only on failure.logging.DisableLoggerso the npm "Installing dependencies" line stays out of the render.watcherStoppedMsgcarries 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 ./...var/plugins.json, hit the admin watcher hotkey, confirm it starts cleanly with no TUI corruption.shopware-cli project admin-watchstandalone to confirm the cobra path still works.