@thi.ng/wasm-api 1.2.1 → 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 +14 -5
- package/package.json +2 -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,13 +305,17 @@ 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
|
|
317
321
|
// (wasm-api and wasm-api-bindgen are made available everywhere)
|
|
@@ -322,7 +326,12 @@ pub fn build(b: *std.build.Builder) void {
|
|
|
322
326
|
// (optional) build mode override
|
|
323
327
|
// if commented out, we can pass CLI args to choose build mode (default: .Debug)
|
|
324
328
|
.mode = .ReleaseSmall,
|
|
325
|
-
})
|
|
329
|
+
});
|
|
330
|
+
// optionally, add further custom configuration
|
|
331
|
+
// ...
|
|
332
|
+
|
|
333
|
+
// finally trigger build
|
|
334
|
+
lib.install();
|
|
326
335
|
}
|
|
327
336
|
```
|
|
328
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",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"status": "alpha",
|
|
116
116
|
"year": 2022
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "54c5f22520162bac0d58426a3f86ca636e797f71\n"
|
|
119
119
|
}
|