diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..12004c54a --- /dev/null +++ b/.vscode/launch.json @@ -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": ["/**"], + "preLaunchTask": "npx tsc", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "postDebugTask": "cleanup build" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..bd050a834 --- /dev/null +++ b/.vscode/tasks.json @@ -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" + } + } + ] +} diff --git a/tsconfig.json b/tsconfig.json index a5682c974..34311469f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,6 @@ "jsx": "react-jsx", "jsxImportSource": "hono/jsx", "resolveJsonModule": true - } + }, + "exclude": ["**/*.test.ts"] }