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