@keyhive/keyhive 0.0.0-alpha.1 → 0.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.
Binary file
@@ -0,0 +1 @@
1
+ *
@@ -0,0 +1,34 @@
1
+ # Keyhive WASM bindings
2
+
3
+ ## Build package
4
+
5
+ ```
6
+ wasm-pack build --target web --out-dir pkg -- --features web-sys
7
+ ```
8
+
9
+ To build with the `ingest_static` feature:
10
+ ```
11
+ wasm-pack build --target web --out-dir pkg -- --features web-sys,ingest_static
12
+ ```
13
+
14
+ ## Run tests
15
+
16
+ Install dependencies:
17
+ ```
18
+ pnpm install
19
+ ```
20
+
21
+ Install Playwright's browser binaries:
22
+ ```
23
+ npx playwright install
24
+ ```
25
+
26
+ Run tests:
27
+ ```
28
+ npx playwright test
29
+ ```
30
+
31
+ View Playwright report:
32
+ ```
33
+ npx playwright show-report
34
+ ```
@@ -0,0 +1,2 @@
1
+ export * from "./keyhive_wasm.js";
2
+ export declare function initFromBase64Wasm(base64Wasm: string): void;
@@ -0,0 +1,12 @@
1
+ // This file is compiled by the build script in `build_slim.js` to
2
+ // produce a stub in the `@keyhive/keyhive/slim` subpath export
3
+ // which knows how to initialize the wasm module from a base64
4
+ // encoded string
5
+ import * as keyhive from "./keyhive_wasm.js";
6
+ export * from "./keyhive_wasm.js";
7
+ export function initFromBase64Wasm(base64Wasm) {
8
+ const wasm = new Uint8Array(atob(base64Wasm)
9
+ .split("")
10
+ .map((c) => c.charCodeAt(0)));
11
+ keyhive.initSync({ module: wasm });
12
+ }
@@ -0,0 +1,15 @@
1
+ // This file is compiled by the build script in `build_slim.js` to
2
+ // produce a stub in the `@keyhive/keyhive/slim` subpath export
3
+ // which knows how to initialize the wasm module from a base64
4
+ // encoded string
5
+ import * as keyhive from "./keyhive_wasm.js";
6
+ export * from "./keyhive_wasm.js";
7
+
8
+ export function initFromBase64Wasm(base64Wasm: string) {
9
+ const wasm = new Uint8Array(
10
+ atob(base64Wasm)
11
+ .split("")
12
+ .map((c) => c.charCodeAt(0)),
13
+ );
14
+ keyhive.initSync({ module: wasm });
15
+ }