lldlab-yaegi-runtime 0.1.0 → 0.2.1
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/LICENSE-go +0 -0
- package/README.md +9 -5
- package/package.json +20 -3
- package/wasm_exec.js +0 -0
- package/yaegi.wasm +2 -2
package/LICENSE-go
CHANGED
|
File without changes
|
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.1
|
|
7
|
+
await import('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.2.1/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.1
|
|
10
|
+
fetch('https://cdn.jsdelivr.net/npm/lldlab-yaegi-runtime@0.2.1/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` (except the parsing-only `net/url` and `net/netip`), `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,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lldlab-yaegi-runtime",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
-
"
|
|
7
|
-
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/UtkarshNigam1221/lldlab-problems.git",
|
|
9
|
+
"directory": "packages/yaegi-runtime"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"yaegi.wasm",
|
|
13
|
+
"wasm_exec.js",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE-yaegi",
|
|
16
|
+
"LICENSE-go"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"go",
|
|
20
|
+
"yaegi",
|
|
21
|
+
"wasm",
|
|
22
|
+
"interpreter",
|
|
23
|
+
"lldlab"
|
|
24
|
+
]
|
|
8
25
|
}
|
package/wasm_exec.js
CHANGED
|
File without changes
|
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: 39511768 bytes
|
|
4
|
+
sha256: b1675d32340f5b60acb9a5cccc622762cce742d0770892cb44e883d3b38a42b0
|