From a8e599c6ed93789506f9e02c115cda9503bed551 Mon Sep 17 00:00:00 2001 From: jer3k <99355997+jer3k@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:57:50 -0800 Subject: [PATCH] Improve vscode settings --- .vscode/fin-pay-transparency.code-workspace | 9 +++++---- .vscode/launch.json | 18 +++++++++--------- .vscode/tasks.json | 15 +++++++++++---- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.vscode/fin-pay-transparency.code-workspace b/.vscode/fin-pay-transparency.code-workspace index 06d476ab9..cafc10744 100644 --- a/.vscode/fin-pay-transparency.code-workspace +++ b/.vscode/fin-pay-transparency.code-workspace @@ -1,18 +1,16 @@ { "folders": [ { + "name": "infrastructure", "path": ".." }, { - "name": "admin-frontend", "path": "../admin-frontend" }, { - "name": "frontend", "path": "../frontend" }, { - "name": "backend", "path": "../backend" }, { @@ -20,6 +18,9 @@ }, { "path": "../backend-external" + }, + { + "path": "../clamav-service" } ], "settings": { @@ -37,7 +38,7 @@ "admin-frontend": true, "doc-gen-service": true, "backend-external": true, - "coverage": true + "clamav-service": true, } } } diff --git a/.vscode/launch.json b/.vscode/launch.json index 35162ae13..29cfaa602 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "skipFiles": ["/**"], "type": "node", "cwd": "${workspaceFolder}/backend", - "preLaunchTask": "Launch and migrate database", + "preLaunchTask": "Launch and migrate database in container", "outputCapture": "std", "presentation": { "hidden": true, @@ -51,8 +51,6 @@ } }, { - // Start clamav server which depends on clamav also running in podman. - // clamav requires quite a bit of memory and therefore isn't included with the rest by detault. "name": "ClamAV Server", "request": "launch", "runtimeArgs": ["run-script", "dev"], @@ -60,9 +58,11 @@ "skipFiles": ["/**"], "type": "node", "cwd": "${workspaceFolder}/clamav-service", - "preLaunchTask": "Launch ClamAV", + "preLaunchTask": "Launch ClamAV in container", + "postDebugTask": "Stop ClamAV container", "outputCapture": "std", "presentation": { + "hidden": true, "group": "Individual Servers", "order": 1 } @@ -118,8 +118,7 @@ "group": "Browser", "order": 1 }, - // This is a hack to get rid of some warnings - "resolveSourceMapLocations": [ + "resolveSourceMapLocations": [ // This is a hack to get rid of some warnings "${workspaceFolder}/**", "!**/node_modules/**" ] @@ -151,8 +150,7 @@ "group": "Browser", "order": 1 }, - // This is a hack to get rid of some warnings - "resolveSourceMapLocations": [ + "resolveSourceMapLocations": [ // This is a hack to get rid of some warnings "${workspaceFolder}/**", "!**/node_modules/**" ] @@ -176,6 +174,7 @@ "Frontend Server", "Admin-Frontend Server", "DocGenService Server", + "ClamAV Server", "Open All URLs (No Debugging)" ], "stopAll": true, @@ -196,7 +195,8 @@ "Backend-External Server", "Frontend Server", "Admin-Frontend Server", - "DocGenService Server" + "DocGenService Server", + "ClamAV Server" ], "stopAll": true, "presentation": { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3a41a3b50..f73400983 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,16 +4,23 @@ { // This starts the database container and performs the Flyway // migration to get the database uptodate with the latest changes. - "label": "Launch and migrate database", + "label": "Launch and migrate database in container", "type": "shell", "command": "podman compose up -d database-migrations", "problemMatcher": [] }, { - // This creates a new temporary container in podman to run clamav. - "label": "Launch ClamAV", + // This starts a container in podman to run clamav. + "label": "Launch ClamAV in container", "type": "shell", - "command": "podman run --rm -d -p 3310:3310 --name 'clamav' clamav/clamav", + "command": "podman start fin-pay-transparency-clamav 2>$null; if ($LASTEXITCODE -ne 0) { podman run -d -p 3310:3310 --name 'fin-pay-transparency-clamav' clamav/clamav }", + "problemMatcher": [] + }, + { + // Stop clamav (becuase it's a memory hog) + "label": "Stop ClamAV container", + "type": "shell", + "command": "podman stop fin-pay-transparency-clamav", "problemMatcher": [] }, {