Skip to content

Commit

Permalink
Merge pull request #602 from narengogi/chore/debug-config-vscode
Browse files Browse the repository at this point in the history
Chore: Debug configs for vscode
  • Loading branch information
VisargD authored Sep 27, 2024
2 parents a65600e + 58902f2 commit 64e50c5
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
/*
1. steps to run wrangler debugger (https://blog.cloudflare.com/debugging-cloudflare-workers/)
- run `npm run dev` in a terminal
- in debug and run tab, select 'Wrangler debug' and run
- add a breakpoint and verify

2. Steps tp run node debugger
- In debug tab select "Node debug" and run
- add a breakpoint and verify
*/
"version": "0.2.0",
"configurations": [
{
"name": "Wrangler debug",
"type": "node",
"request": "attach",
"port": 9229,
"cwd": "/",
"resolveSourceMapLocations": null,
"attachExistingChildren": false,
"autoAttachChildProcesses": false
},
{
"type": "node",
"request": "launch",
"name": "Node debug",
"runtimeExecutable": "tsx",
"runtimeArgs": ["${workspaceFolder}/build/src/start-server.js"],
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/build/**/*.js"],
"sourceMapPathOverrides": {
"../src/*": "${workspaceFolder}/src/*"
},
"skipFiles": ["<node_internals>/**"],
"preLaunchTask": "npx tsc",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"postDebugTask": "cleanup build"
}
]
}
36 changes: 36 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "npx tsc",
"command": "npx",
"args": [
"tsc",
"--sourcemap",
"true",
"--outDir",
"${workspaceFolder}/build"
],
"problemMatcher": ["$tsc"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "cleanup build",
"command": "rm",
"args": ["-rf", "${workspaceFolder}/build"],
"problemMatcher": [],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx",
"resolveJsonModule": true
}
},
"exclude": ["**/*.test.ts"]
}

0 comments on commit 64e50c5

Please sign in to comment.