From e5d73147b67b9cc42b36ad9b66e12507c46baebf Mon Sep 17 00:00:00 2001 From: Seth Trowbridge Date: Sat, 10 Dec 2022 10:27:23 -0500 Subject: [PATCH] buildless configuration --- .gitignore | 1 + deno.json | 20 +++++++++++++------- deno.map.json | 8 ++++++++ index.html | 9 ++++++--- src/app.js | 4 ++-- src/store.js | 2 +- src/twind.js | 6 +++--- src/ui.js | 4 ++-- 8 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 .gitignore create mode 100644 deno.map.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..941fcf1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +deno.lock \ No newline at end of file diff --git a/deno.json b/deno.json index 331aa3a..6997ddd 100644 --- a/deno.json +++ b/deno.json @@ -1,9 +1,15 @@ { - "compilerOptions": {"types":["./store"], "checkJs": true}, - "tasks": - { - "fs": "deno run -A --no-lock https://deno.land/std@0.166.0/http/file_server.ts", - "test": "deno test --no-lock --no-check --watch store.test.ts", - "test-debug": "deno test --no-lock --no-check --inspect-brk store.test.ts" + "compilerOptions": { "types": ["./store"], "checkJs": true }, + "importMap": "./deno.map.json", + "fmt": { + "options": { + "lineWidth": 256 } -} \ No newline at end of file + }, + "tasks": { + "dev": "deno task serve & deno task test", + "fmt": "deno fmt --watch", + "serve": "deno run -A --unstable --no-check https://deno.land/std@0.167.0/http/file_server.ts", + "test": "deno test store.test.ts --watch --no-lock --no-check" + } +} diff --git a/deno.map.json b/deno.map.json new file mode 100644 index 0000000..65001b1 --- /dev/null +++ b/deno.map.json @@ -0,0 +1,8 @@ +{ + "imports": { + "@twind/": "https://esm.sh/@twind/", + "react": "https://esm.sh/preact@10.11.3/compat", + "htm": "https://esm.sh/htm@3.1.1/preact", + "app": "./src/app.js" + } +} diff --git a/index.html b/index.html index 904fa1f..11a419f 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,7 @@ - - + + +
- \ No newline at end of file + + + \ No newline at end of file diff --git a/src/app.js b/src/app.js index 4dce494..fc3ce9e 100644 --- a/src/app.js +++ b/src/app.js @@ -1,8 +1,8 @@ +import React from "react"; +import {html} from "htm"; import * as TW from "./twind.js"; import * as UI from "./ui.js"; import * as Store from "./store.js"; -import React from "https://esm.sh/preact@10.11.3/compat"; -import {html} from "https://esm.sh/htm@3.1.1/preact"; const ShadowDOM = document.querySelector("#app").attachShadow({mode: "open"}); const ShadowDiv = document.createElement("div"); diff --git a/src/store.js b/src/store.js index 9f35e92..4469f93 100644 --- a/src/store.js +++ b/src/store.js @@ -1,4 +1,4 @@ -import React from "https://esm.sh/preact@10.11.3/compat"; +import React from "react"; const size = 1/6; /** @type {Array} */ diff --git a/src/twind.js b/src/twind.js index 226342d..c95c3ee 100644 --- a/src/twind.js +++ b/src/twind.js @@ -1,6 +1,6 @@ -import * as TW from "https://esm.sh/@twind/core@1.0.1"; -import TWPreTail from "https://esm.sh/@twind/preset-tailwind@1.0.1"; -import TWPreAuto from "https://esm.sh/@twind/preset-autoprefix@1.0.1"; +import * as TW from "@twind/core@1.0.1"; +import TWPreTail from "@twind/preset-tailwind@1.0.1"; +import TWPreAuto from "@twind/preset-autoprefix@1.0.1"; /** @type {TW.TwindConfig} */ export const Configure = { diff --git a/src/ui.js b/src/ui.js index e1070d1..a9a2a7f 100644 --- a/src/ui.js +++ b/src/ui.js @@ -1,5 +1,5 @@ -import React from "https://esm.sh/preact@10.11.3/compat"; -import { html } from "https://esm.sh/htm@3.1.1/preact"; +import React from "react"; +import { html } from "htm"; import * as Store from "./store.js"; /** @typedef {({children}:{children?:preact.ComponentChildren})=>preact.VNode} BasicElement */