Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Debug configs for vscode #602

Merged
merged 10 commits into from
Sep 27, 2024
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"]
}
Loading