Honor server.json webroot server discovery in coldbox watch-reinit#77
Conversation
coldbox watch-reinit
|
@copilot I need you to add this to the changelog.md |
There was a problem hiding this comment.
Pull request overview
Updates coldbox watch-reinit to locate the correct running CommandBox server when a project’s server.json uses a non-root web.webroot (e.g., test-harness), preventing false “server stopped” detection during watch-based reinit workflows.
Changes:
- Discover the default server name from the local
server.json. - Resolve server details using both the discovered
nameand the current projectdirectory(viagetCWD()), mirroringcoldbox reinit. - Avoid relying on unscoped
resolveServerDetails( {} ), which can miss the intended server in webroot-discovery scenarios.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implemented in commit
|
|
@lmajano did the AI consider what happens if the server is started using the non-default |
coldbox watch-reinitcould report a running server as stopped when the app was started from a project whoseserver.jsonsetsweb.webrootto a subdirectory such astest-harness. This left module/template workflows unable to watch the project root and reinit the actual running app.Align
watch-reinitserver resolution withreinitserver.jsonnameand the current projectdirectoryresolveServerDetails( {} ), which can miss servers started with a non-root webrootScope of behavior change
watch-reinitlocates the running CommandBox servervar defaultServer = serverService.getServerInfoByDiscovery( serverConfigFile = "server.json" ); var serverDetails = serverService.resolveServerDetails( { name : defaultServer.keyExists( "name" ) ? defaultServer.name : "", directory : getCWD() } );