diff options
| author | Xe Iaso <me@christine.website> | 2023-01-17 10:02:45 -0500 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2023-01-17 10:10:46 -0500 |
| commit | 4738b3e347509d8a4e53a51cf7faf170a9642faa (patch) | |
| tree | bb4d4a1232634052873e515c5f6990d918d6dc47 | |
| parent | d64d75a4dc1c482cd63b613cacbbaaf34cfd3706 (diff) | |
| download | xesite-4738b3e347509d8a4e53a51cf7faf170a9642faa.tar.xz xesite-4738b3e347509d8a4e53a51cf7faf170a9642faa.zip | |
i give up lol
Signed-off-by: Xe Iaso <me@christine.website>
| -rw-r--r-- | src/frontend/deno.json | 8 | ||||
| -rw-r--r-- | src/frontend/deps.ts | 2 | ||||
| -rw-r--r-- | src/frontend/wasiterm.tsx | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/frontend/deno.json b/src/frontend/deno.json index b763d25..36e6c17 100644 --- a/src/frontend/deno.json +++ b/src/frontend/deno.json @@ -2,7 +2,13 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "xeact", - "lib": ["esnext", "dom", "dom.iterable"] + "lib": [ + "dom", + "dom.iterable", + "dom.asynciterable", + "deno.ns", + "deno.unstable" + ], }, "importMap": "./import_map.json", } diff --git a/src/frontend/deps.ts b/src/frontend/deps.ts index d885509..f19e9ae 100644 --- a/src/frontend/deps.ts +++ b/src/frontend/deps.ts @@ -1,5 +1,5 @@ import * as wasi from "https://deno.land/x/wasm@v1.2.2/wasi.ts"; -//import * as xterm from "https://esm.sh/xterm@5.0.0"; +//import * as xterm from "https://esm.sh/xterm@5.0.0?pin=v102"; import * as xeact from "xeact"; diff --git a/src/frontend/wasiterm.tsx b/src/frontend/wasiterm.tsx index 352d03c..a9b0ea5 100644 --- a/src/frontend/wasiterm.tsx +++ b/src/frontend/wasiterm.tsx @@ -1,10 +1,11 @@ -import { wasi as wasiMod, xeact } from "./deps.ts"; +import { wasi as wasiMod, xeact, /*xterm*/ } from "./deps.ts"; const { x, t } = xeact; //const { Terminal } = xterm; const { WASI } = wasiMod; const init = async (rootElem: Element, wasmURL: string) => { + //const termElem = <div></div>; const termElem = <code></code>; //const term = new Terminal(); @@ -13,6 +14,7 @@ const init = async (rootElem: Element, wasmURL: string) => { const runProgram = async () => { await wasiMod.init(new URL("https://cdn.xeiaso.net/file/christine-static/wasm/5410143de81b20061e9750d1cf80aceef56d2938ab949e30dd7b13fa699307ad.wasm")); + //term.writeln(`loading ${wasmURL}`); termElem.appendChild(t(`loading ${wasmURL}`)); const wasi = new WASI({ @@ -29,6 +31,7 @@ const init = async (rootElem: Element, wasmURL: string) => { let exitCode = wasi.start(); let stdout = wasi.getStdoutString(); console.log(`${stdout}\n\n(exit code: ${exitCode})`); + //term.writeln(`${stdout}\n\n(exit code: ${exitCode})`); termElem.appendChild(t(`${stdout}\n\n(exit code: ${exitCode})`)); }; |
