From b118ba02f93a75212c630be7c5237ae5393b0afd Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 29 Jul 2023 17:13:49 -0400 Subject: [PATCH] setup debug --- .vscode/launch.json | 16 ++++++++++++++++ .vscode/settings.json | 3 +-- deno.json | 3 ++- run-local.tsx | 7 ------- run-serve.tsx | 14 ++++++++++++-- 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..33b5a41 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "request": "launch", + "name": "Debug Serve Mode", + "type": "node", + "runtimeExecutable": "deno", + "runtimeArgs": ["task", "debug"], + "attachSimplePort": 9229 + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index b003be2..8675ad5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { "deno.enable": true, - "deno.unstable": true, - "deno.config": "./deno.json" + "deno.unstable": true } \ No newline at end of file diff --git a/deno.json b/deno.json index 0c02170..3aa3101 100644 --- a/deno.json +++ b/deno.json @@ -12,6 +12,7 @@ "tasks": { "local": "deno run -A --no-lock ./run-local.tsx --port=1234", - "serve": "deno run -A --no-lock ./run-serve.tsx --port=1234" + "serve": "deno run -A --no-lock ./run-serve.tsx --port=1234", + "debug": "deno run -A --inspect-wait --no-lock ./run-serve.tsx --port=1234" } } \ No newline at end of file diff --git a/run-local.tsx b/run-local.tsx index e76ed3a..6cf1af7 100644 --- a/run-local.tsx +++ b/run-local.tsx @@ -33,9 +33,6 @@ Configure({ { // we dont need to add ?reload= because this fetch is by way the file system not the hosted url - - console.log("collecting exports for", Root+inURL.pathname); - const [local, foreign] = await Collect.FileExports(Root+inURL.pathname); const code =` import {FileListen} from ">able/hmr-listen.tsx"; @@ -66,10 +63,6 @@ Configure({ catch(e){ /**/ } } } - else - { - console.log("not collecting", inURL.pathname) - } } }); diff --git a/run-serve.tsx b/run-serve.tsx index 831a99b..ea500b6 100644 --- a/run-serve.tsx +++ b/run-serve.tsx @@ -278,7 +278,16 @@ export const Configure =(config:ConfigurationArgs)=> } await ImportMapReload(); -await SWCW.default(); +try +{ + await SWCW.default(); +} +catch(e) +{ + console.log("swc init error:", e); +} + + const server = Deno.serve({port:parseInt(Deno.env.get("port")||"8000")}, async(req: Request)=> { const url:URL = new URL(req.url); @@ -363,4 +372,5 @@ const server = Deno.serve({port:parseInt(Deno.env.get("port")||"8000")}, async(r return new Response(`{"error":"unmatched route", "path":"${url.pathname}"}`, {status:404, headers}); -}); \ No newline at end of file +}); +