From 2d7d0323b026be8ea2d4df0cd6232c6c14aaae0e Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Wed, 17 Dec 2025 14:08:24 +0200 Subject: [PATCH] feat(VisualStudio Code): add launch configurations --- .vscode/launch.json | 37 +++++++ desktop/angular/.vscode/launch.json | 25 +++++ desktop/angular/.vscode/tasks.json | 152 ++++++++++++++++++++++++++++ desktop/angular/package.json | 5 + desktop/tauri/.vscode/launch.json | 34 +++++++ desktop/tauri/.vscode/tasks.json | 13 +++ 6 files changed, 266 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 desktop/angular/.vscode/launch.json create mode 100644 desktop/angular/.vscode/tasks.json create mode 100644 desktop/tauri/.vscode/launch.json create mode 100644 desktop/tauri/.vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..4161f937 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,37 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "portmaster-core", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmds/portmaster-core", + + "windows": { + "args": ["--bin-dir=C:\\Program Files\\Portmaster", "--log-stdout", "--log", "trace"] + }, + "linux": { + "args": ["--bin-dir=/usr/lib/portmaster", "--log-stdout", "--log", "trace"] + + }, + }, + { + "name": "portmaster-core (NO INTERCEPTION)", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmds/portmaster-core", + + "windows": { + "args": ["--bin-dir=C:\\Program Files\\Portmaster", "--log-stdout", "--log", "trace", "--disable-interception=true"] + }, + "linux": { + "args": ["--bin-dir=/usr/lib/portmaster", "--log-stdout", "--log", "trace", "--disable-interception=true"] + }, + } + ] +} \ No newline at end of file diff --git a/desktop/angular/.vscode/launch.json b/desktop/angular/.vscode/launch.json new file mode 100644 index 00000000..dbe72834 --- /dev/null +++ b/desktop/angular/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Run UI in Chrome (npm run start)", + "type": "chrome", + "request": "launch", + "preLaunchTask": "debugproj", + "postDebugTask": "killnode", + "url": "http://localhost:4200/", + "webRoot": "${workspaceFolder}", + "sourceMapPathOverrides": { + "webpack:/*": "${webRoot}/*", + "/./*": "${webRoot}/*", + "/src/*": "${webRoot}/*", + "/*": "*", + "/./~/*": "${webRoot}/node_modules/*" + } + }, + + ] +} \ No newline at end of file diff --git a/desktop/angular/.vscode/tasks.json b/desktop/angular/.vscode/tasks.json new file mode 100644 index 00000000..c9339a3a --- /dev/null +++ b/desktop/angular/.vscode/tasks.json @@ -0,0 +1,152 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "ui-library-watch", + "type": "npm", + "script": "build-ui:dev:watch", + "isBackground": true, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "group": "dev-libraries" + }, + "group": { + "kind": "build" + }, + "problemMatcher": { + "owner": "typescript", + "source": "ts", + "fileLocation": ["relative", "${workspaceFolder}"], + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": "Building Angular Package", + "endsPattern": "Compilation complete\\. Watching for file changes\\.\\.\\." + } + } + }, + { + "label": "api-library-watch", + "type": "npm", + "script": "build-api:dev:watch", + "isBackground": true, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "group": "dev-libraries" + }, + "group": { + "kind": "build" + }, + "problemMatcher": { + "owner": "typescript", + "source": "ts", + "fileLocation": ["relative", "${workspaceFolder}"], + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": "Building Angular Package", + "endsPattern": "Compilation complete\\. Watching for file changes\\.\\.\\." + } + } + }, + { + "label": "build-libs-first", + "type": "npm", + "script": "build-libs:dev", + "isBackground": false, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared" + }, + "group": { + "kind": "build" + }, + "problemMatcher": [] + }, + { + "label": "debugproj", + "dependsOrder": "sequence", + "dependsOn": [ + "build-libs-first", + "ui-library-watch", + "api-library-watch", + "main-app-with-polling" + ], + "isBackground": true, + "presentation": { + "echo": false, + "reveal": "never", + "focus": false, + "panel": "shared" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "main-app-with-polling", + "type": "npm", + "script": "serve-with-lib-watch", + "isBackground": true, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "group": "dev-main" + }, + "group": { + "kind": "build" + }, + "problemMatcher": { + "owner": "typescript", + "source": "ts", + "applyTo": "closedDocuments", + "fileLocation": ["relative", "${workspaceFolder}"], + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": "Generating browser application bundles", + "endsPattern": "Compiled successfully\\.|Failed to compile\\." + } + } + }, + { + "label": "killnode", + "type": "process", + "windows": { + "command": "taskkill", + "args": ["/F", "/IM", "node.exe"] + }, + "osx":{ + "command": "killall", + "args": ["node"] + }, + "linux":{ + "command": "killall", + "args": ["node"] + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared" + }, + "group": { + "kind": "build" + }, + "isBackground": false, + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/desktop/angular/package.json b/desktop/angular/package.json index 062c824c..66341293 100644 --- a/desktop/angular/package.json +++ b/desktop/angular/package.json @@ -6,6 +6,11 @@ "start": "npm install && npm run build-libs:dev && ng serve --proxy-config ./proxy.json", "build-libs": "cross-env NODE_ENV=production ng build --configuration production @safing/ui && cross-env NODE_ENV=production ng build --configuration production @safing/portmaster-api", "build-libs:dev": "ng build --configuration development @safing/ui && ng build --configuration development @safing/portmaster-api", + + "build-ui:dev:watch": "ng build --configuration development @safing/ui --watch", + "build-api:dev:watch": "ng build --configuration development @safing/portmaster-api --watch", + "serve-with-lib-watch": "ng serve --proxy-config ./proxy.json --poll=2000", + "serve": "npm run build-libs:dev && ng serve --proxy-config ./proxy.json", "build:dev": "npm run build-libs:dev && ng build", "test": "ng test", diff --git a/desktop/tauri/.vscode/launch.json b/desktop/tauri/.vscode/launch.json new file mode 100644 index 00000000..d721dbad --- /dev/null +++ b/desktop/tauri/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + + // How to debug Tauri project: + // https://v2.tauri.app/develop/debug/ + // + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", // `vscode-lldb` extension has to be installed (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) + "request": "launch", + "name": "Debug Dev", + "cargo": {"args": ["build", "--manifest-path=./src-tauri/Cargo.toml", "--no-default-features"]}, + "env": { "TAURI_PM_URL": "http://127.0.0.1:817" } + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug Prod", + "cargo": {"args": ["build", "--manifest-path=./src-tauri/Cargo.toml", "--release"]}, + }, + { + "name": "Debug Dev (VS Win Debugger)", + "type": "cppvsdbg", + "request": "launch", + "program": "${workspaceRoot}/src-tauri/target/debug/portmaster.exe", + "cwd": "${workspaceRoot}", + "preLaunchTask": "build:debug", + "env": { "TAURI_PM_URL": "http://127.0.0.1:817" } + } + ] + } \ No newline at end of file diff --git a/desktop/tauri/.vscode/tasks.json b/desktop/tauri/.vscode/tasks.json new file mode 100644 index 00000000..5b58196d --- /dev/null +++ b/desktop/tauri/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "build:debug", + "type": "cargo", + "command": "build", + "args": ["--manifest-path=./src-tauri/Cargo.toml", "--no-default-features"] + } + ] + } \ No newline at end of file