Add plugin auto-build and hot reload for dev#4
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds development-only plugin hot reload and auto-build capabilities to improve the plugin development workflow when debugging Turbo.Main. The changes introduce file system watchers that monitor plugin artifacts and source code, automatically rebuilding and reloading plugins when changes are detected. These features are only enabled in the Development environment via configuration.
Changes:
- Added
ReloadAsync(string key)method to PluginManager for targeted single-plugin reloads - Implemented PluginHotReloadService to watch plugin artifact folders and trigger reloads on file changes
- Implemented PluginAutoBuildService to watch plugin source folders and trigger dotnet builds on code changes
- Wired up console commands
reload-pluginsandreload-plugin <key>for manual plugin management
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| Turbo.Plugins/PluginManager.cs | Added ReloadAsync method for single-plugin reloads and extracted RebuildDependents helper |
| Turbo.Plugins/PluginHotReloadService.cs | New hosted service that watches plugin artifacts and debounces reload requests |
| Turbo.Plugins/PluginAutoBuildService.cs | New hosted service that watches plugin source files and triggers auto-builds |
| Turbo.Plugins/Extensions/ServiceCollectionExtensions.cs | Conditionally registers hot reload and auto-build services in Development environment |
| Turbo.Plugins/Configuration/PluginConfig.cs | Added configuration properties for hot reload and auto-build features |
| Turbo.Main/Console/ConsoleCommandService.cs | Implemented reload-plugins and reload-plugin commands with proper usage messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4506f48 to
faa9095
Compare
|
FYI So after editing:
|
Adds DevPluginPaths config so the emulator loads plugins directly from their build output directory — no more copying DLLs into plugins/ during development.
Dev workflow:
Changes: