@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.
- package/package.json +15 -4
- package/pkg/keyhive_wasm.d.ts +51 -0
- package/pkg/keyhive_wasm_bg.js +110 -65
- package/pkg/keyhive_wasm_bg.wasm +0 -0
- package/pkg-node/keyhive_wasm.d.ts +51 -0
- package/pkg-node/keyhive_wasm.js +263 -168
- package/pkg-node/keyhive_wasm_bg.wasm +0 -0
- package/pkg-slim/.gitignore +1 -0
- package/pkg-slim/README.md +34 -0
- package/pkg-slim/index.d.ts +2 -0
- package/pkg-slim/index.js +12 -0
- package/pkg-slim/index.ts +15 -0
- package/pkg-slim/keyhive_wasm.d.ts +634 -0
- package/pkg-slim/keyhive_wasm.js +3535 -0
- package/pkg-slim/keyhive_wasm_bg.wasm +0 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.base64.d.ts +4 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.base64.js +2 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.d.ts +209 -0
- package/pkg-slim/package.json +26 -0
|
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,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
|
+
}
|