From 1b16b087886a4aacc355731fc2234d57f78021f1 Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 29 Apr 2023 20:16:28 -0400 Subject: [PATCH] auto booter --- example/deno.jsonc | 6 +++--- lib/iso.tsx | 4 ++++ server.tsx | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/example/deno.jsonc b/example/deno.jsonc index c24e154..dc2d7a4 100644 --- a/example/deno.jsonc +++ b/example/deno.jsonc @@ -2,13 +2,13 @@ "compilerOptions": {"lib": ["deno.window", "dom"]}, "imports": { - "react": "https://esm.sh/preact@10.13.2/compat", + "react": "https://esm.sh/stable/preact@10.13.2/compat", + "preact": "https://esm.sh/stable/preact@10.13.2/", "@deep/": "./deep/", "@eno/app": "./app.tsx", "@eno/iso": "http://localhost:4507/lib/iso.tsx" }, "tasks": { - "host": "deno run -A --unstable https://deno.land/std@0.181.0/http/file_server.ts", - "dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock --config=deno.jsonc 'http://localhost:4507/server.tsx'" + "dev": "deno run -A --unstable --reload=http://localhost:4507/ --no-lock app.tsx" } } \ No newline at end of file diff --git a/lib/iso.tsx b/lib/iso.tsx index c91cde4..b5b1e98 100644 --- a/lib/iso.tsx +++ b/lib/iso.tsx @@ -7,6 +7,10 @@ export const CSS = { hash:false }; +if(Deno) +{ + import(import.meta.resolve("../../server.tsx")).then(()=>{console.log("...imported!");}); +} type Meta = {title:string, description:string, keywords:string, image:string, canonical:string } type MetaKeys = keyof Meta; diff --git a/server.tsx b/server.tsx index 29bb34b..d79d382 100644 --- a/server.tsx +++ b/server.tsx @@ -8,6 +8,8 @@ import * as Twind from "https://esm.sh/@twind/core@1.1.3"; import React from "react"; import * as Iso from "@eno/iso"; +Deno.env.set("initialized", "true"); + /** * Setup a transpiler. * @param inDevMode When true, starts a file-watcher @@ -275,6 +277,7 @@ const Path = { }; console.log(Path); console.log(`Dev Mode: ${DevMode}`); +console.log(`Args seen: ${Deno.args}`); const {Transpileable, TranspileURL, SocketsHandler} = Transpiler(DevMode); const {Imports, App, TwindInst, Error} = await Configure(DevMode, Path.LibDir);