From 75e76fa3322005da99fa5a5c5feee5608673050b Mon Sep 17 00:00:00 2001 From: Yaro Shkvorets Date: Fri, 27 Dec 2024 13:29:57 -0500 Subject: [PATCH] Add VS Code debug config (#1882) * add vscode debugging --- .vscode/launch.json | 19 +++++++++++++++++++ .vscode/tasks.json | 20 ++++++++++++++++++++ packages/cli/package.json | 1 + packages/cli/tsconfig.dev.json | 8 ++++++++ 4 files changed, 48 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 packages/cli/tsconfig.dev.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..5bbab7d34 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug graph init", + "skipFiles": ["/**"], + "program": "${workspaceFolder}/packages/cli/bin/run", + "args": ["init", "--skip-git"], + "preLaunchTask": "build:dev", + "outFiles": ["${workspaceFolder}/packages/cli/dist/**/*.js"], + "sourceMaps": true, + "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..88c94bdff --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,20 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build:dev", + "type": "shell", + "command": "pnpm", + "args": ["--filter=@graphprotocol/graph-cli", "build:dev"], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "silent", + "panel": "shared" + }, + "problemMatcher": "$tsc" + } + ] +} diff --git a/packages/cli/package.json b/packages/cli/package.json index 7cd1e32b7..10e5802a4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,6 +22,7 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json && oclif manifest && oclif readme && copyfiles -u 1 src/**/*.graphql dist/", + "build:dev": "tsc -b tsconfig.dev.json", "oclif:pack": "npm pack && pnpm oclif pack tarballs --no-xz", "test": "vitest run --bail=1", "test:add": "vitest run tests/cli/add.test.ts", diff --git a/packages/cli/tsconfig.dev.json b/packages/cli/tsconfig.dev.json new file mode 100644 index 000000000..232e0bb0c --- /dev/null +++ b/packages/cli/tsconfig.dev.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "sourceMap": true, + "inlineSources": true + }, + "include": ["./src"] +}