@thi.ng/wasm-api 1.2.0 → 1.2.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/CHANGELOG.md +1 -1
- package/README.md +17 -6
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -56,8 +56,8 @@ WebGL, WebGPU, WebAudio etc. is being actively worked on.
|
|
|
56
56
|
defining glue code for the TypeScript [core
|
|
57
57
|
API](https://docs.thi.ng/umbrella/wasm-api/interfaces/CoreAPI.html) defined
|
|
58
58
|
by this package
|
|
59
|
-
7. [Zig build files]() to simplify using hybrid
|
|
60
|
-
built-in build system
|
|
59
|
+
7. [Zig build files](#using-the-zig-build-system) to simplify using hybrid
|
|
60
|
+
TS/Zig packages with the built-in build system
|
|
61
61
|
8. Extensible shared [datatype code generator
|
|
62
62
|
infrastructure](https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api-bindgen/)
|
|
63
63
|
for (currently) Zig & TypeScript and C11. For TS fully type checked and
|
|
@@ -305,22 +305,33 @@ packages this is used to manage Zig-side event listeners.
|
|
|
305
305
|
|
|
306
306
|
## Using the Zig build system
|
|
307
307
|
|
|
308
|
-
This package provides utilities to simplify using hybrid TS/Zig WASM API modules
|
|
308
|
+
This package provides utilities to simplify using hybrid TS/Zig WASM API modules
|
|
309
|
+
which are distributed as NPM packages. Using these utils, a build file for Zig's
|
|
310
|
+
built-in build system is as simple as:
|
|
309
311
|
|
|
310
312
|
```zig
|
|
311
313
|
const std = @import("std");
|
|
312
314
|
|
|
313
315
|
pub fn build(b: *std.build.Builder) void {
|
|
314
|
-
|
|
316
|
+
// obtain a standard std.build.LibExeObjStep, pre-configured w/ given options
|
|
317
|
+
// see source comments in imported build.zig for further details...
|
|
318
|
+
var lib = @import("node_modules/@thi.ng/wasm-api/zig/build.zig").wasmLib(b, .{
|
|
315
319
|
// Declare extra WASM API packages to use
|
|
316
|
-
|
|
320
|
+
// Each package can also declare dependencies to other such packages
|
|
321
|
+
// (wasm-api and wasm-api-bindgen are made available everywhere)
|
|
317
322
|
.packages = &.{
|
|
318
323
|
.{ .id = "wasm-api-dom", .path = "@thi.ng/wasm-api-dom/zig/lib.zig" },
|
|
319
324
|
.{ .id = "wasm-api-schedule", .path = "@thi.ng/wasm-api-schedule/zig/lib.zig" },
|
|
320
325
|
},
|
|
321
326
|
// (optional) build mode override
|
|
327
|
+
// if commented out, we can pass CLI args to choose build mode (default: .Debug)
|
|
322
328
|
.mode = .ReleaseSmall,
|
|
323
|
-
})
|
|
329
|
+
});
|
|
330
|
+
// optionally, add further custom configuration
|
|
331
|
+
// ...
|
|
332
|
+
|
|
333
|
+
// finally trigger build
|
|
334
|
+
lib.install();
|
|
324
335
|
}
|
|
325
336
|
```
|
|
326
337
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -55,19 +55,24 @@
|
|
|
55
55
|
"allocator",
|
|
56
56
|
"api",
|
|
57
57
|
"bindings",
|
|
58
|
+
"bigint",
|
|
58
59
|
"browser",
|
|
59
60
|
"c",
|
|
60
61
|
"event",
|
|
62
|
+
"hex",
|
|
61
63
|
"interop",
|
|
62
64
|
"logger",
|
|
63
65
|
"memory",
|
|
64
66
|
"modular",
|
|
67
|
+
"polyglot",
|
|
68
|
+
"shared-memory",
|
|
65
69
|
"string",
|
|
66
70
|
"typedarray",
|
|
67
71
|
"typescript",
|
|
68
72
|
"utf8",
|
|
69
73
|
"wasm",
|
|
70
74
|
"webassembly",
|
|
75
|
+
"zig",
|
|
71
76
|
"ziglang"
|
|
72
77
|
],
|
|
73
78
|
"publishConfig": {
|
|
@@ -110,5 +115,5 @@
|
|
|
110
115
|
"status": "alpha",
|
|
111
116
|
"year": 2022
|
|
112
117
|
},
|
|
113
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "54c5f22520162bac0d58426a3f86ca636e797f71\n"
|
|
114
119
|
}
|