wasm-idle 0.0.4 → 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.
@@ -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 (await import('./worker/clang?worker')).default();
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 (await import('./worker/python?worker')).default();
16
+ this.worker = new Worker(workerUrl, { type: 'module' });
16
17
  this.worker.onmessage = (event) => {
17
18
  resolve();
18
19
  };
@@ -19,8 +19,10 @@ export const terminal = {
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
28
  await wait();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-idle",
3
- "version": "0.0.4",
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.2.1"
36
+ "vite": "^4.3.0-beta.6"
36
37
  },
37
38
  "dependencies": {
38
39
  "pyodide": "^0.23.1",