From d29414691c04a03887c3bcaf5feb92a1c263ceb2 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 8 Jul 2023 15:25:09 -0400 Subject: [PATCH] remove spoof convention --- example/app.tsx | 2 +- example/deno.json | 3 +-- run-local.tsx | 2 +- run-serve.tsx | 14 ++------------ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/example/app.tsx b/example/app.tsx index 19f4170..e448c01 100644 --- a/example/app.tsx +++ b/example/app.tsx @@ -38,7 +38,7 @@ export default ()=> return

Title????

-

subtitle!!!!

+

subtitle

diff --git a/example/deno.json b/example/deno.json index 9fab40a..0f675fb 100644 --- a/example/deno.json +++ b/example/deno.json @@ -2,8 +2,7 @@ "compilerOptions": { "lib": ["deno.window", "dom"] }, "imports": { - "react":"https://esm.sh/preact@10.15.1/compat", - "@able/":"http://localhost:8000/" + "react":"https://esm.sh/preact@10.15.1/compat" }, "tasks": { diff --git a/run-local.tsx b/run-local.tsx index 0314cf6..e9981e9 100644 --- a/run-local.tsx +++ b/run-local.tsx @@ -26,7 +26,7 @@ Configure({ }, async Serve(inReq, inURL, inExt, inMap, inConfig) { - if(Transpile.Check(inExt) && !inURL.searchParams.get("reload") && !inURL.pathname.startsWith(inConfig.Spoof+"/")) + if(Transpile.Check(inExt) && !inURL.searchParams.get("reload")) { const imp = await import(inConfig.Proxy+inURL.pathname); const members = []; diff --git a/run-serve.tsx b/run-serve.tsx index 1b3aeea..828665e 100644 --- a/run-serve.tsx +++ b/run-serve.tsx @@ -49,15 +49,6 @@ const ImportMapReload =async()=> } }); - /* - const mapKey = (Configuration.Spoof.startsWith("/") ? Configuration.Spoof.substring(1) : Configuration.Spoof)+"/"; - if(!json.imports[mapKey]) - { - console.log(`"${mapKey}" specifier not defined in import map`); - } - json.imports[mapKey] = Configuration.Spoof+"/"; - */ - if(!json.imports["react"]) { console.log(`"react" specifier not defined in import map`); @@ -69,14 +60,13 @@ const ImportMapReload =async()=> type CustomHTTPHandler = (inReq:Request, inURL:URL, inExt:string|false, inMap:{imports:Record}, inConfig:Configuration)=>void|false|Response|Promise; type CustomRemapper = (inImports:Record, inConfig:Configuration)=>Record; -type Configuration = {Proxy:string, Spoof:string, Allow:string, Reset:string, SWCOp:SWCW.Options, Serve:CustomHTTPHandler, Shell:CustomHTTPHandler, Remap:CustomRemapper}; -type ConfigurationArgs = {Proxy?:string, Spoof?:string, Allow?:string, Reset?:string, SWCOp?:SWCW.Options, Serve?:CustomHTTPHandler, Shell?:CustomHTTPHandler, Remap?:CustomRemapper}; +type Configuration = {Proxy:string, Allow:string, Reset:string, SWCOp:SWCW.Options, Serve:CustomHTTPHandler, Shell:CustomHTTPHandler, Remap:CustomRemapper}; +type ConfigurationArgs = {Proxy?:string, Allow?:string, Reset?:string, SWCOp?:SWCW.Options, Serve?:CustomHTTPHandler, Shell?:CustomHTTPHandler, Remap?:CustomRemapper}; let Configuration:Configuration = { Proxy: new URL(`file://${Deno.cwd().replaceAll("\\", "/")}`).toString(), Allow: "*", Reset: "/clear-cache", - Spoof: "/@able", async Serve(inReq, inURL, inExt, inMap, inConfig){}, Remap: (inImports, inConfig)=> {