From 7498c12fdd8809746def7dba7b981ef4a3e2fe71 Mon Sep 17 00:00:00 2001 From: YaroShkvorets Date: Thu, 26 Dec 2024 18:11:29 -0500 Subject: [PATCH 1/3] add vscode debugging --- .vscode/launch.json | 28 ++++++++++++++++++++++++++++ .vscode/tasks.json | 23 +++++++++++++++++++++++ packages/cli/package.json | 1 + packages/cli/tsconfig.debug.json | 10 ++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 packages/cli/tsconfig.debug.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..bba91d8d7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug graph init", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}/packages/cli/bin/run", + "args": [ + "init" + ], + "preLaunchTask": "build", + "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..3d90eb9be --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "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..69b172fbd 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.debug.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.debug.json b/packages/cli/tsconfig.debug.json new file mode 100644 index 000000000..c4bf13c31 --- /dev/null +++ b/packages/cli/tsconfig.debug.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "sourceMap": true, + "inlineSources": true + }, + "include": [ + "./src", + ], +} From e30df66c9295d95ab0047a6ff63a6bceaff79e7e Mon Sep 17 00:00:00 2001 From: YaroShkvorets Date: Thu, 26 Dec 2024 22:01:01 -0500 Subject: [PATCH 2/3] lint --- .vscode/launch.json | 43 +++++++++++++------------------- .vscode/tasks.json | 39 +++++++++++++---------------- packages/cli/tsconfig.debug.json | 4 +-- 3 files changed, 36 insertions(+), 50 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bba91d8d7..5bbab7d34 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,28 +1,19 @@ { - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Debug graph init", - "skipFiles": [ - "/**" - ], - "program": "${workspaceFolder}/packages/cli/bin/run", - "args": [ - "init" - ], - "preLaunchTask": "build", - "outFiles": [ - "${workspaceFolder}/packages/cli/dist/**/*.js" - ], - "sourceMaps": true, - "resolveSourceMapLocations": [ - "${workspaceFolder}/**", - "!**/node_modules/**" - ], - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen" - } - ] + "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 index 3d90eb9be..88c94bdff 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,23 +1,20 @@ { - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "type": "shell", - "command": "pnpm", - "args": [ - "--filter=@graphprotocol/graph-cli", - "build:dev" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "presentation": { - "reveal": "silent", - "panel": "shared" - }, - "problemMatcher": "$tsc" - } - ] + "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/tsconfig.debug.json b/packages/cli/tsconfig.debug.json index c4bf13c31..232e0bb0c 100644 --- a/packages/cli/tsconfig.debug.json +++ b/packages/cli/tsconfig.debug.json @@ -4,7 +4,5 @@ "sourceMap": true, "inlineSources": true }, - "include": [ - "./src", - ], + "include": ["./src"] } From c005c2820e6ebb295af60ff50b475016f14281cb Mon Sep 17 00:00:00 2001 From: YaroShkvorets Date: Fri, 27 Dec 2024 13:15:36 -0500 Subject: [PATCH 3/3] rename dev tsconfig.json --- packages/cli/package.json | 2 +- packages/cli/{tsconfig.debug.json => tsconfig.dev.json} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/cli/{tsconfig.debug.json => tsconfig.dev.json} (100%) diff --git a/packages/cli/package.json b/packages/cli/package.json index 69b172fbd..10e5802a4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,7 +22,7 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json && oclif manifest && oclif readme && copyfiles -u 1 src/**/*.graphql dist/", - "build:dev": "tsc -b tsconfig.debug.json", + "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.debug.json b/packages/cli/tsconfig.dev.json similarity index 100% rename from packages/cli/tsconfig.debug.json rename to packages/cli/tsconfig.dev.json