Repository navigation
feat(vite-config): fan the dev server hot file out to every theme - #149
Merged
Merged
Conversation
A single dev server means laravel-vite-plugin writes one hot file, into the public directory of the theme hosting it. Standalone parent themes had no public/hot of their own and ended up hardcoding the path to sage's. The plugin copies the hot file into every theme's public directory on server start and removes the copies on shutdown. A hard kill leaves them behind, so the toolkit gains a clean command that removes leftovers.
YvetteNikolov
requested review from
FreakyWizard,
JasperS20,
WybeBosch,
Yannicvanveen,
laravdiemen and
rivanuff
and
a balanced review from Copilot
and removed request for
Copilot
October 8, 2026 13:57
Copilot stopped reviewing on behalf of
YvetteNikolov due to an error
October 8, 2026 13:58
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is focused and tested; only a minor README help-list inconsistency remains.
1 open finding
What changed in this PR
Adds Vite hot-file fan-out so every discovered theme can resolve the shared development server.
Changes:
- Adds hot-file copying, watcher exclusion, shutdown cleanup, and tests.
- Adds
yard-toolkit cleanfor stale hot files. - Documents multi-theme hot-file behavior.
| File | Description |
|---|---|
vitest.config.mjs |
Registers Vite config tests. |
packages/vite-config/vitest.config.mjs |
Configures Vite package tests. |
packages/vite-config/tests/write-theme-hot-files.test.js |
Tests fan-out and plugin configuration. |
packages/vite-config/src/plugins/write-theme-hot-files.js |
Implements hot-file fan-out and cleanup. |
packages/vite-config/src/configs/brave.js |
Integrates the new plugin. |
packages/vite-config/README.md |
Documents multi-theme hot files. |
packages/toolkit/src/config/help.js |
Adds the clean action to CLI help. |
packages/toolkit/src/config/actions.js |
Registers the clean action. |
packages/toolkit/src/actions/clean.js |
Removes stale theme hot files. |
packages/toolkit/README.md |
Documents clean command usage. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+54
to
+57
| ```bash | ||
| # Removes leftover Vite hot files after a dev server was killed hard. | ||
| yard-toolkit clean | ||
| ``` |
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.

Split from #144.
Dev runs a single Vite server hosted by the default theme, so laravel-vite-plugin writes exactly one hot file. Any other parent theme has no
public/hot, andget_parent_theme_file_path('public/hot')on the PHP side comes up empty — which is why standalone themes hardcoded the path to sage's hot file.write-theme-hot-filesVite plugin: copies the hot file into every theme'spublic/on server start, removes the copies on shutdown, ignores them in the watcher.yard-toolkit clean: removes leftover hot files after a hard kill.vite-configwith plugin tests.Independent of the project layout resolver (#144's main change); only uses
themes[].dir, which the current context already exposes.