wasm-idle 0.0.20 → 0.0.22

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.
@@ -102,7 +102,7 @@ export default class Clang {
102
102
  await this.ready;
103
103
  this.memfs.addFile(input, code);
104
104
  const clang = await this.getModule(clangUrl(this.path));
105
- return await this.run(clang, this.log, 'clang', '-cc1', '-emit-obj', ...clangCommonArgs, '-O' + opt, '-o', obj, '-std=c++17', '-x', 'c++', input);
105
+ return await this.run(clang, true, 'clang', '-cc1', '-emit-obj', ...clangCommonArgs, '-O' + opt, '-o', obj, '-std=c++17', '-x', 'c++', input);
106
106
  }
107
107
  async link(obj, wasm) {
108
108
  const stackSize = 1024 * 1024;
@@ -76,6 +76,11 @@ export const terminal = {
76
76
  term.dispose();
77
77
  if (sandbox)
78
78
  await sandbox.clear();
79
+ },
80
+ async write(input2) {
81
+ await wait();
82
+ term.write(input2 + "\r\n");
83
+ sandbox.write(input2.replaceAll("\r", "\n") + "\n");
79
84
  }
80
85
  };
81
86
  $:
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  prepare(language: any, code: any, log: boolean | undefined, prog: any): Promise<any>;
11
11
  run(language: any, code: any, log: boolean | undefined, prog: any): Promise<any>;
12
12
  destroy(): Promise<void>;
13
+ write(input: string): Promise<void>;
13
14
  } | undefined;
14
15
  };
15
16
  events: {
@@ -30,6 +31,7 @@ export default class Terminal extends SvelteComponentTyped<TerminalProps, Termin
30
31
  prepare(language: any, code: any, log: boolean | undefined, prog: any): Promise<any>;
31
32
  run(language: any, code: any, log: boolean | undefined, prog: any): Promise<any>;
32
33
  destroy(): Promise<void>;
34
+ write(input: string): Promise<void>;
33
35
  };
34
36
  }
35
37
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-idle",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "A simple web app to run C++/Python code in the browser",
5
5
  "license": "MIT",
6
6
  "type": "module",