@thi.ng/wasm-api 1.4.3 → 1.4.5
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 +1 -1
- package/bridge.d.ts +1 -1
- package/bridge.js +1 -1
- package/package.json +15 -15
- package/zig/build-v0.11.zig +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Event, INotify, IObjectOf, Listener, NumericArray } from "@thi.ng/api";
|
|
3
3
|
import type { ILogger } from "@thi.ng/logger";
|
|
4
|
-
import { BigIntArray, CoreAPI, IWasmAPI, IWasmMemoryAccess, MemorySlice, WasmExports } from "./api.js";
|
|
4
|
+
import { type BigIntArray, type CoreAPI, type IWasmAPI, type IWasmMemoryAccess, type MemorySlice, type WasmExports } from "./api.js";
|
|
5
5
|
export declare const Panic: {
|
|
6
6
|
new (msg?: string | undefined): {
|
|
7
7
|
name: string;
|
package/bridge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { INotifyMixin } from "@thi.ng/api/mixins/inotify";
|
|
|
3
3
|
import { topoSort } from "@thi.ng/arrays/topo-sort";
|
|
4
4
|
import { assert } from "@thi.ng/errors/assert";
|
|
5
5
|
import { defError } from "@thi.ng/errors/deferror";
|
|
6
|
-
import {
|
|
6
|
+
import { U16, U32, U64BIG, U8, hexdumpLines } from "@thi.ng/hex";
|
|
7
7
|
import { ConsoleLogger } from "@thi.ng/logger/console";
|
|
8
8
|
import { EVENT_MEMORY_CHANGED, EVENT_PANIC, } from "./api.js";
|
|
9
9
|
export const Panic = defError(() => "Panic");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
28
|
-
"clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
|
|
28
|
+
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
|
|
29
29
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
30
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
31
|
"doc:readme": "yarn doc:stats && tools:readme",
|
|
@@ -35,21 +35,21 @@
|
|
|
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.7.
|
|
39
|
-
"@thi.ng/arrays": "^2.5.
|
|
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.7.5",
|
|
39
|
+
"@thi.ng/arrays": "^2.5.9",
|
|
40
|
+
"@thi.ng/checks": "^3.3.11",
|
|
41
|
+
"@thi.ng/errors": "^2.2.14",
|
|
42
|
+
"@thi.ng/hex": "^2.3.8",
|
|
43
|
+
"@thi.ng/idgen": "^2.1.30",
|
|
44
|
+
"@thi.ng/logger": "^1.4.12"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@microsoft/api-extractor": "^7.34.
|
|
48
|
-
"@thi.ng/testament": "^0.3.
|
|
49
|
-
"rimraf": "^4.1
|
|
47
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
48
|
+
"@thi.ng/testament": "^0.3.14",
|
|
49
|
+
"rimraf": "^4.4.1",
|
|
50
50
|
"tools": "^0.0.1",
|
|
51
|
-
"typedoc": "^0.23.
|
|
52
|
-
"typescript": "^
|
|
51
|
+
"typedoc": "^0.23.28",
|
|
52
|
+
"typescript": "^5.0.2"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"allocator",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"status": "alpha",
|
|
116
116
|
"year": 2022
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "83b15b34326d480cbca0472b20390d4d3bbb792a\n"
|
|
119
119
|
}
|
package/zig/build-v0.11.zig
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//! Intended for use with https://thi.ng/wasm-api and support packages
|
|
3
3
|
//!
|
|
4
4
|
//! This version of the script is only compatible with:
|
|
5
|
-
//! Zig v0.11.0-dev.
|
|
5
|
+
//! Zig v0.11.0-dev.2266+49e33a2f2 or newer
|
|
6
6
|
//!
|
|
7
7
|
//! Use build.zig (in this same directory) for earlier Zig versions
|
|
8
8
|
|
|
@@ -94,7 +94,7 @@ pub fn wasmLib(b: *Build, opts: WasmLibOpts) *Build.CompileStep {
|
|
|
94
94
|
/// Registers a single package and its deps (also injects core wasm-api deps)
|
|
95
95
|
pub fn register(step: *Build.CompileStep, mod: ModuleSpec, opts: WasmLibOpts) void {
|
|
96
96
|
const num = if (mod.dependencies) |ids| ids.len else 0;
|
|
97
|
-
var dpkgs = step.
|
|
97
|
+
var dpkgs = step.step.owner.allocator.alloc(Build.ModuleDependency, num + 2) catch unreachable;
|
|
98
98
|
dpkgs[0] = if (step.modules.get(wasmapi)) |m| .{ .name = wasmapi, .module = m } else unreachable;
|
|
99
99
|
dpkgs[1] = if (step.modules.get(wasmbind)) |m| .{ .name = wasmbind, .module = m } else unreachable;
|
|
100
100
|
var i: usize = 2;
|
|
@@ -110,8 +110,8 @@ pub fn register(step: *Build.CompileStep, mod: ModuleSpec, opts: WasmLibOpts) vo
|
|
|
110
110
|
} else @panic("unknown dependency");
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
step.addModule(mod.name, step.
|
|
114
|
-
.source_file = modulePath(step.
|
|
113
|
+
step.addModule(mod.name, step.step.owner.createModule(.{
|
|
114
|
+
.source_file = modulePath(step.step.owner.allocator, opts.base, mod.path),
|
|
115
115
|
.dependencies = dpkgs[0..i],
|
|
116
116
|
}));
|
|
117
117
|
}
|