forgot some stuff

This commit is contained in:
Seth Trowbridge 2024-04-23 15:35:23 -04:00
parent 9d31b9a08c
commit 91542c30a5

View File

@ -3,7 +3,9 @@ import { parse as JSONC } from "https://deno.land/x/jsonct@v0.1.0/mod.ts";
type ConfigCheck = {path?:string, text?:string, json?:Record<string, string|Record<string, string|string[]>>};
type ConfigCheckPair = [config:ConfigCheck, imports:ConfigCheck];
/** The full url location of checker.tsx wherever it is hosted */
export const RootHost = import.meta.resolve("./");
/** The file system url where deno is currently running */
export const Root = new URL(`file://${Deno.cwd().replaceAll("\\", "/")}`).toString();
export async function HuntConfig()
{
@ -58,7 +60,7 @@ export async function HuntConfig()
}
}
let imports:ConfigCheck = {};
const imports:ConfigCheck = {};
if(json && json.imports)
{
// config.imports
@ -116,7 +118,7 @@ export async function Install(file:string, overrideName?:string, handler?:(conte
export async function Check()
{
let [config, imports] = await HuntConfig();
const [config, imports] = await HuntConfig();
try
{
@ -167,7 +169,7 @@ export async function Check()
const importMap = imports.json.imports as Record<string, string>;
const bake =async(obj:ConfigCheck)=> await Deno.writeTextFile(Deno.cwd()+"/"+obj.path, JSON.stringify(obj.json, null, "\t"));
importMap["react"] = `https://esm.sh/preact@10.18.2/compat`;
importMap["react"] = `https://esm.sh/preact@10.20.2/compat`;
importMap["react/"] = `https://esm.sh/preact@10.20.2/compat/`;
importMap["@preact/signals"] = `https://esm.sh/@preact/signals@1.2.3`;
importMap["@twind/core"] = `https://esm.sh/@twind/core@1.1.3`;