Compare commits

..

2 Commits

Author SHA1 Message Date
55f484cf70 Stopping debug session now stops the tasks 2026-02-16 18:53:14 +00:00
97909483d4 VS Code debugging is working 2026-02-16 18:24:05 +00:00
4 changed files with 121 additions and 21 deletions

47
.vscode/launch.json vendored
View File

@ -1,22 +1,29 @@
{ {
// Use IntelliSense to learn about possible attributes. // Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes. // Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch Chrome", "name": "Debug React App",
"request": "launch", "type": "pwa-chrome",
"type": "chrome", "request": "launch",
"url": "http://localhost:3000", "url": "http://localhost:3001",
"webRoot": "${workspaceFolder}" "webRoot": "${workspaceFolder}/src",
}, "runtimeExecutable": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
{ "runtimeArgs": [
"type": "pwa-chrome", "--remote-debugging-port=9222",
"request": "launch", "--user-data-dir=C:\\ChromeDebug"
"name": "Launch Chrome against localhost", ],
"url": "http://localhost:3000", "preLaunchTask": "Start All",
"webRoot": "${workspaceFolder}" "postDebugTask": "Stop All Tasks"
} },
] {
"name": "Attach to Chrome",
"type": "pwa-chrome",
"request": "attach",
"port": 9222,
"webRoot": "${workspaceFolder}/src"
}
]
} }

68
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,68 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Proxy",
"type": "process",
"command": "./proxy.cmd",
"isBackground": true,
"runOptions": {
"reevaluateOnRerun": true,
"terminateOnExit": true
},
"problemMatcher": {
"pattern": { "regexp": ".*" },
"background": {
"activeOnStart": true,
"beginsPattern": "^.*",
"endsPattern": "listening on|started|ready"
}
}
},
{
"label": "Start CRA",
"type": "process",
"command": "npm",
"args": ["start"],
"isBackground": true,
"runOptions": {
"reevaluateOnRerun": true,
"terminateOnExit": true
},
"options": {
"env": {
"BROWSER": "none"
}
},
"problemMatcher": {
"pattern": { "regexp": ".*" },
"background": {
"activeOnStart": true,
"beginsPattern": "^.*",
"endsPattern": "Compiled successfully|webpack compiled"
}
}
},
{
"label": "Start All",
"dependsOn": ["Start Proxy", "Start CRA"],
"dependsOrder": "parallel"
},
{
"label": "Stop All Tasks",
"type": "shell",
"command": "powershell",
"args": [
"-ExecutionPolicy",
"Bypass",
"-File",
"${workspaceFolder}/stop-tasks.ps1"
],
"presentation": {
"reveal": "always",
"panel": "dedicated"
},
"problemMatcher": []
}
]
}

View File

@ -1,2 +1,4 @@
@echo off
cd ../e-suite.Proxy/ cd ../e-suite.Proxy/
echo ready
docker compose up docker compose up

23
stop-tasks.ps1 Normal file
View File

@ -0,0 +1,23 @@
# Stop all tasks started by VS Code debugging
Write-Host "Stopping development tasks..."
# Find and stop processes by command line
$processes = Get-WmiObject Win32_Process | Where-Object {
($_.CommandLine -like '*proxy.cmd*') -or
($_.CommandLine -like '*npm*start*') -or
($_.CommandLine -like '*react-scripts*')
}
foreach ($proc in $processes) {
Write-Host "Stopping process $($proc.ProcessId): $($proc.Name)"
Stop-Process -Id $proc.ProcessId -Force -ErrorAction SilentlyContinue
# Also stop child processes
$children = Get-WmiObject Win32_Process | Where-Object { $_.ParentProcessId -eq $proc.ProcessId }
foreach ($child in $children) {
Write-Host "Stopping child process $($child.ProcessId): $($child.Name)"
Stop-Process -Id $child.ProcessId -Force -ErrorAction SilentlyContinue
}
}
Write-Host "Tasks stopped"