@gcoredev/proxy-wasm-sdk-as 1.0.0-alpha.2
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.txt +202 -0
- package/README.md +102 -0
- package/assembly/exports.ts +138 -0
- package/assembly/imports.ts +175 -0
- package/assembly/index.ts +15 -0
- package/assembly/malloc.ts +16 -0
- package/assembly/proxy.ts +2 -0
- package/assembly/runtime.ts +1114 -0
- package/assembly/tsconfig.json +6 -0
- package/index.js +16 -0
- package/package.json +54 -0
package/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const compiled = new WebAssembly.Module(fs.readFileSync(__dirname + "/build/optimized.wasm"));
|
|
3
|
+
const imports = {
|
|
4
|
+
env: {
|
|
5
|
+
abort(_msg, _file, line, column) {
|
|
6
|
+
console.error("abort called at index.ts:" + line + ":" + column);
|
|
7
|
+
},
|
|
8
|
+
proxy_get_configuration(configuration_ptr, configuration_size) {
|
|
9
|
+
console.error("configuration_ptr index.ts:" + configuration_ptr + ":" + configuration_size);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(module, "exports", {
|
|
15
|
+
get: () => new WebAssembly.Instance(compiled, imports).exports
|
|
16
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"asbuild:debug": "asc assembly/index.ts --target debug",
|
|
4
|
+
"asbuild:release": "asc assembly/index.ts --target release",
|
|
5
|
+
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
|
|
6
|
+
"server": "ws --log.format dev",
|
|
7
|
+
"docs": "typedoc"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
11
|
+
"assemblyscript": "^0.27.34",
|
|
12
|
+
"http-server": "^14.1.1",
|
|
13
|
+
"local-web-server": "^5.4.0",
|
|
14
|
+
"minimist": ">=1.2.2",
|
|
15
|
+
"typedoc": "^0.27.7"
|
|
16
|
+
},
|
|
17
|
+
"name": "@gcoredev/proxy-wasm-sdk-as",
|
|
18
|
+
"description": "Use this SDK to write extensions for the proxy WASM ABI",
|
|
19
|
+
"version": "1.0.0-alpha.2",
|
|
20
|
+
"main": "assembly/index.ts",
|
|
21
|
+
"directories": {
|
|
22
|
+
"doc": "docs"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/G-Core/proxy-wasm-sdk-as.git"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"wasm",
|
|
30
|
+
"proxy"
|
|
31
|
+
],
|
|
32
|
+
"author": "Yuval Kohavi",
|
|
33
|
+
"license": " Apache-2.0",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/G-Core/proxy-wasm-sdk-as/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/G-Core/proxy-wasm-sdk-as",
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"/assembly",
|
|
44
|
+
"package-lock.json",
|
|
45
|
+
"index.js"
|
|
46
|
+
],
|
|
47
|
+
"type": "module",
|
|
48
|
+
"exports": {
|
|
49
|
+
".": {
|
|
50
|
+
"import": "./build/release.js",
|
|
51
|
+
"types": "./build/release.d.ts"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|