@thi.ng/wasm-api 1.1.0 → 1.1.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/CHANGELOG.md +1 -1
- package/README.md +5 -4
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -148,7 +148,7 @@ Main Zig file:
|
|
|
148
148
|
|
|
149
149
|
```zig
|
|
150
150
|
// Import JS core API
|
|
151
|
-
const js = @import("
|
|
151
|
+
const js = @import("wasm-api");
|
|
152
152
|
const custom = @import("custom.zig");
|
|
153
153
|
|
|
154
154
|
export fn test_randomVec4() void {
|
|
@@ -348,7 +348,7 @@ node --experimental-repl-await
|
|
|
348
348
|
> const wasmApi = await import("@thi.ng/wasm-api");
|
|
349
349
|
```
|
|
350
350
|
|
|
351
|
-
Package sizes (
|
|
351
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.47 KB
|
|
352
352
|
|
|
353
353
|
## Dependencies
|
|
354
354
|
|
|
@@ -371,6 +371,7 @@ A selection:
|
|
|
371
371
|
| Screenshot | Description | Live demo | Source |
|
|
372
372
|
|:---------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------|:----------------------------------------------------|:---------------------------------------------------------------------------------|
|
|
373
373
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-canvas.png" width="240"/> | Zig-based DOM creation & canvas drawing app | [Demo](https://demo.thi.ng/umbrella/zig-canvas/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-canvas) |
|
|
374
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-cellular.jpg" width="240"/> | Zig-based 2D multi-behavior cellular automata | [Demo](https://demo.thi.ng/umbrella/zig-cellular/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-cellular) |
|
|
374
375
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-counter.png" width="240"/> | Simple Zig/WASM click counter DOM component | [Demo](https://demo.thi.ng/umbrella/zig-counter/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-counter) |
|
|
375
376
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/zig-todo-list.png" width="240"/> | Zig-based To-Do list, DOM creation, local storage task persistence | [Demo](https://demo.thi.ng/umbrella/zig-todo-list/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/zig-todo-list) |
|
|
376
377
|
|
|
@@ -413,7 +414,7 @@ Requires [Zig](https://ziglang.org) to be installed:
|
|
|
413
414
|
|
|
414
415
|
/// import externals
|
|
415
416
|
/// see build command for configuration
|
|
416
|
-
const js = @import("
|
|
417
|
+
const js = @import("wasm-api");
|
|
417
418
|
|
|
418
419
|
export fn start() void {
|
|
419
420
|
js.printStr("hello world!");
|
|
@@ -427,7 +428,7 @@ folder):
|
|
|
427
428
|
```bash
|
|
428
429
|
# compile WASM binary
|
|
429
430
|
zig build-lib \
|
|
430
|
-
--pkg-begin
|
|
431
|
+
--pkg-begin wasm-api node_modules/@thi.ng/wasm-api/zig/lib.zig --pkg-end \
|
|
431
432
|
-target wasm32-freestanding \
|
|
432
433
|
-O ReleaseSmall -dynamic \
|
|
433
434
|
hello.zig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"test:build-zig": "zig build-lib -O ReleaseSmall -target wasm32-freestanding -dynamic --strip --pkg-begin wasmapi zig/lib.zig --pkg-end test/custom.zig && wasm-dis -o custom.wast custom.wasm && cp custom.wasm test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.5.
|
|
39
|
-
"@thi.ng/arrays": "^2.4.
|
|
40
|
-
"@thi.ng/checks": "^3.3.
|
|
41
|
-
"@thi.ng/errors": "^2.2.
|
|
42
|
-
"@thi.ng/hex": "^2.3.
|
|
43
|
-
"@thi.ng/idgen": "^2.1.
|
|
44
|
-
"@thi.ng/logger": "^1.4.
|
|
38
|
+
"@thi.ng/api": "^8.5.1",
|
|
39
|
+
"@thi.ng/arrays": "^2.4.4",
|
|
40
|
+
"@thi.ng/checks": "^3.3.4",
|
|
41
|
+
"@thi.ng/errors": "^2.2.5",
|
|
42
|
+
"@thi.ng/hex": "^2.3.1",
|
|
43
|
+
"@thi.ng/idgen": "^2.1.20",
|
|
44
|
+
"@thi.ng/logger": "^1.4.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@microsoft/api-extractor": "^7.33.5",
|
|
48
|
-
"@thi.ng/testament": "^0.3.
|
|
48
|
+
"@thi.ng/testament": "^0.3.6",
|
|
49
49
|
"rimraf": "^3.0.2",
|
|
50
50
|
"tools": "^0.0.1",
|
|
51
51
|
"typedoc": "^0.23.20",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"status": "alpha",
|
|
111
111
|
"year": 2022
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n"
|
|
114
114
|
}
|