wasm-idle 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/playground/clang.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import workerUrl from './worker/clang?worker&url';
|
|
1
2
|
class Clang {
|
|
2
3
|
ts = Date.now();
|
|
3
4
|
output = null;
|
|
@@ -12,7 +13,7 @@ class Clang {
|
|
|
12
13
|
return new Promise(async (resolve) => {
|
|
13
14
|
this.internalBuffer = [];
|
|
14
15
|
if (!this.worker) {
|
|
15
|
-
this.worker = new (
|
|
16
|
+
this.worker = new Worker(workerUrl, { type: 'module' });
|
|
16
17
|
this.worker.onmessage = (event) => {
|
|
17
18
|
resolve();
|
|
18
19
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import workerUrl from './worker/python?worker&url';
|
|
1
2
|
class Python {
|
|
2
3
|
ts = Date.now();
|
|
3
4
|
output = null;
|
|
@@ -12,7 +13,7 @@ class Python {
|
|
|
12
13
|
return new Promise(async (resolve) => {
|
|
13
14
|
this.internalBuffer = [];
|
|
14
15
|
if (!this.worker) {
|
|
15
|
-
this.worker = new (
|
|
16
|
+
this.worker = new Worker(workerUrl, { type: 'module' });
|
|
16
17
|
this.worker.onmessage = (event) => {
|
|
17
18
|
resolve();
|
|
18
19
|
};
|
|
@@ -5,7 +5,7 @@ import { load } from "../playground";
|
|
|
5
5
|
import "xterm/css/xterm.css";
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
7
|
let ref, clientWidth, clientHeight, term, finish = true, input = "", sandbox, first = true;
|
|
8
|
-
const wait = new Promise((r) => {
|
|
8
|
+
const wait = () => new Promise((r) => {
|
|
9
9
|
const i = setInterval(() => {
|
|
10
10
|
if (term) {
|
|
11
11
|
clearInterval(i);
|
|
@@ -15,15 +15,17 @@ const wait = new Promise((r) => {
|
|
|
15
15
|
});
|
|
16
16
|
export const terminal = {
|
|
17
17
|
async clear() {
|
|
18
|
-
await wait;
|
|
18
|
+
await wait();
|
|
19
19
|
term.clear();
|
|
20
20
|
term.write(`\x1B[?25l`);
|
|
21
21
|
term.write("\x1B[0m");
|
|
22
|
+
term.write("\x1B[?25h");
|
|
22
23
|
term.options.cursorBlink = false;
|
|
23
24
|
first = true;
|
|
25
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
24
26
|
},
|
|
25
27
|
async run(language, code, log = true) {
|
|
26
|
-
await wait;
|
|
28
|
+
await wait();
|
|
27
29
|
if (sandbox)
|
|
28
30
|
await sandbox.clear();
|
|
29
31
|
input = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-idle",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "A simple web app to run C++/Python code in the browser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
13
13
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
14
14
|
"format": "prettier --plugin-search-dir . --write .",
|
|
15
|
-
"deploy": "svelte-package && npm publish"
|
|
15
|
+
"deploy": "svelte-package && npm publish",
|
|
16
|
+
"page": "pnpm run build && gh-pages -d build"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@sveltejs/adapter-auto": "^2.0.0",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"svelte-check": "^3.2.0",
|
|
33
34
|
"tslib": "^2.5.0",
|
|
34
35
|
"typescript": "^5.0.4",
|
|
35
|
-
"vite": "^4.
|
|
36
|
+
"vite": "^4.3.0-beta.6"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"pyodide": "^0.23.1",
|