lldlab-yaegi-runtime 0.1.0 → 0.2.0
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/README.md +9 -5
- package/package.json +2 -1
- package/yaegi.wasm +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
# lldlab-yaegi-runtime
|
|
2
2
|
|
|
3
|
-
[Yaegi](https://github.com/traefik/yaegi) (Go interpreter) compiled to `GOOS=js GOARCH=wasm`, plus Go's `wasm_exec.js`. Built from `
|
|
3
|
+
[Yaegi](https://github.com/traefik/yaegi) (Go interpreter) compiled to `GOOS=js GOARCH=wasm`, plus Go's `wasm_exec.js`. Built from `packages/yaegi-runtime` in [lldlab-problems](https://github.com/UtkarshNigam1221/lldlab-problems).
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
6
|
// In a (Web) Worker:
|
|
7
|
-
await import('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.
|
|
7
|
+
await import('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.2.0/wasm_exec.js');
|
|
8
8
|
const go = new Go();
|
|
9
9
|
const { instance } = await WebAssembly.instantiateStreaming(
|
|
10
|
-
fetch('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.
|
|
10
|
+
fetch('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.2.0/yaegi.wasm'), go.importObject);
|
|
11
11
|
go.run(instance);
|
|
12
|
-
const { stdout, results, error } = globalThis.yaegiRun(
|
|
12
|
+
const { stdout, results, error } = globalThis.yaegiRun(JSON.stringify({ helper, workspace, tests }));
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
`
|
|
15
|
+
- `workspace`: `{ path: source }`. Root-level `.go` files are `package main`; files in folders are packages imported as `app/<folder>`.
|
|
16
|
+
- `tests`: `[{ stage, file, src }]`, each a `package main` file defining `func lldlabTests()`.
|
|
17
|
+
- `net`, `os/exec`, `os/signal`, `plugin`, `syscall` and `unsafe` can't be imported.
|
|
18
|
+
|
|
19
|
+
0.1.0 (single-file `yaegiRun(files, entry)`) stays published for older clients.
|
|
16
20
|
|
|
17
21
|
Licenses: Yaegi is Apache-2.0 (`LICENSE-yaegi`); `wasm_exec.js` and the Go runtime are BSD-3-Clause (`LICENSE-go`).
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lldlab-yaegi-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Yaegi Go interpreter compiled to WebAssembly for the LLDLab in-browser test runner (exposes globalThis.yaegiRun).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"repository": { "type": "git", "url": "git+https://github.com/UtkarshNigam1221/lldlab-problems.git", "directory": "packages/yaegi-runtime" },
|
|
6
7
|
"files": ["yaegi.wasm", "wasm_exec.js", "README.md", "LICENSE-yaegi", "LICENSE-go"],
|
|
7
8
|
"keywords": ["go", "yaegi", "wasm", "interpreter", "lldlab"]
|
|
8
9
|
}
|
package/yaegi.wasm
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/yaegi.wasm
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 39149010 bytes
|
|
4
|
+
sha256: c2df53fabc7a740754d02e48afd588850c7679229ffbcf9c790407d8c522d0f8
|