@rivetkit/rivetkit-wasm 0.0.0-pr.4860.f43cf47 → 0.0.0-pr.4880.c7bfbc5
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 +3 -2
- package/pkg/rivetkit_wasm.d.ts +6 -6
- package/pkg/rivetkit_wasm.js +17 -18
- package/pkg/rivetkit_wasm_bg.wasm +0 -0
- package/pkg/rivetkit_wasm_bg.wasm.d.ts +5 -5
- package/scripts/build.mjs +20 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-wasm",
|
|
3
|
-
"version": "0.0.0-pr.
|
|
3
|
+
"version": "0.0.0-pr.4880.c7bfbc5",
|
|
4
4
|
"description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"prepack": "node scripts/build.mjs"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"typescript": "^5.9.2"
|
|
39
|
+
"typescript": "^5.9.2",
|
|
40
|
+
"wasm-pack": "0.14.0"
|
|
40
41
|
}
|
|
41
42
|
}
|
package/pkg/rivetkit_wasm.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function start(): void;
|
|
4
3
|
export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
|
|
5
4
|
export function roundTripBytes(bytes: Uint8Array): Uint8Array;
|
|
5
|
+
export function start(): void;
|
|
6
6
|
export function awaitPromise(promise: Promise<any>): Promise<any>;
|
|
7
7
|
export function bridgeRivetErrorPrefix(): string;
|
|
8
8
|
export class ActorContext {
|
|
@@ -173,6 +173,7 @@ export interface InitOutput {
|
|
|
173
173
|
readonly actorcontext_state: (a: number) => [number, number];
|
|
174
174
|
readonly actorcontext_takePendingHibernationChanges: (a: number) => any;
|
|
175
175
|
readonly actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
|
|
176
|
+
readonly actorcontext_waitUntil: (a: number, b: any) => void;
|
|
176
177
|
readonly actorfactory_new: (a: any, b: any) => [number, number, number];
|
|
177
178
|
readonly awaitPromise: (a: any) => any;
|
|
178
179
|
readonly bridgeRivetErrorPrefix: () => [number, number];
|
|
@@ -229,11 +230,10 @@ export interface InitOutput {
|
|
|
229
230
|
readonly websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
|
|
230
231
|
readonly websockethandle_setEventCallback: (a: number, b: any) => void;
|
|
231
232
|
readonly start: () => void;
|
|
232
|
-
readonly actorcontext_waitUntil: (a: number, b: any) => void;
|
|
233
233
|
readonly actorcontext_queue: (a: number) => number;
|
|
234
234
|
readonly actorcontext_schedule: (a: number) => number;
|
|
235
|
-
readonly __wbg_schedule_free: (a: number, b: number) => void;
|
|
236
235
|
readonly __wbg_queue_free: (a: number, b: number) => void;
|
|
236
|
+
readonly __wbg_schedule_free: (a: number, b: number) => void;
|
|
237
237
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
238
238
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
239
239
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
@@ -242,9 +242,9 @@ export interface InitOutput {
|
|
|
242
242
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
243
243
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
244
244
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
245
|
-
readonly
|
|
246
|
-
readonly
|
|
247
|
-
readonly
|
|
245
|
+
readonly closure1558_externref_shim: (a: number, b: number, c: any) => void;
|
|
246
|
+
readonly closure1761_externref_shim: (a: number, b: number, c: any) => void;
|
|
247
|
+
readonly closure1980_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
248
248
|
readonly __wbindgen_start: () => void;
|
|
249
249
|
}
|
|
250
250
|
|
package/pkg/rivetkit_wasm.js
CHANGED
|
@@ -221,11 +221,6 @@ function _assertClass(instance, klass) {
|
|
|
221
221
|
throw new Error(`expected instance of ${klass.name}`);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
export function start() {
|
|
226
|
-
wasm.start();
|
|
227
|
-
}
|
|
228
|
-
|
|
229
224
|
/**
|
|
230
225
|
* @param {Uint8Array} bytes
|
|
231
226
|
* @returns {Uint8Array}
|
|
@@ -250,6 +245,10 @@ export function roundTripBytes(bytes) {
|
|
|
250
245
|
return v2;
|
|
251
246
|
}
|
|
252
247
|
|
|
248
|
+
export function start() {
|
|
249
|
+
wasm.start();
|
|
250
|
+
}
|
|
251
|
+
|
|
253
252
|
/**
|
|
254
253
|
* @param {Promise<any>} promise
|
|
255
254
|
* @returns {Promise<any>}
|
|
@@ -276,15 +275,15 @@ export function bridgeRivetErrorPrefix() {
|
|
|
276
275
|
}
|
|
277
276
|
|
|
278
277
|
function __wbg_adapter_46(arg0, arg1, arg2) {
|
|
279
|
-
wasm.
|
|
278
|
+
wasm.closure1558_externref_shim(arg0, arg1, arg2);
|
|
280
279
|
}
|
|
281
280
|
|
|
282
281
|
function __wbg_adapter_55(arg0, arg1, arg2) {
|
|
283
|
-
wasm.
|
|
282
|
+
wasm.closure1761_externref_shim(arg0, arg1, arg2);
|
|
284
283
|
}
|
|
285
284
|
|
|
286
285
|
function __wbg_adapter_223(arg0, arg1, arg2, arg3) {
|
|
287
|
-
wasm.
|
|
286
|
+
wasm.closure1980_externref_shim(arg0, arg1, arg2, arg3);
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -1768,24 +1767,24 @@ function __wbg_get_imports() {
|
|
|
1768
1767
|
const ret = false;
|
|
1769
1768
|
return ret;
|
|
1770
1769
|
};
|
|
1771
|
-
imports.wbg.
|
|
1772
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1770
|
+
imports.wbg.__wbindgen_closure_wrapper3627 = function(arg0, arg1, arg2) {
|
|
1771
|
+
const ret = makeMutClosure(arg0, arg1, 1559, __wbg_adapter_46);
|
|
1773
1772
|
return ret;
|
|
1774
1773
|
};
|
|
1775
|
-
imports.wbg.
|
|
1776
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1774
|
+
imports.wbg.__wbindgen_closure_wrapper3629 = function(arg0, arg1, arg2) {
|
|
1775
|
+
const ret = makeMutClosure(arg0, arg1, 1559, __wbg_adapter_46);
|
|
1777
1776
|
return ret;
|
|
1778
1777
|
};
|
|
1779
|
-
imports.wbg.
|
|
1780
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1778
|
+
imports.wbg.__wbindgen_closure_wrapper3631 = function(arg0, arg1, arg2) {
|
|
1779
|
+
const ret = makeMutClosure(arg0, arg1, 1559, __wbg_adapter_46);
|
|
1781
1780
|
return ret;
|
|
1782
1781
|
};
|
|
1783
|
-
imports.wbg.
|
|
1784
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1782
|
+
imports.wbg.__wbindgen_closure_wrapper3633 = function(arg0, arg1, arg2) {
|
|
1783
|
+
const ret = makeMutClosure(arg0, arg1, 1559, __wbg_adapter_46);
|
|
1785
1784
|
return ret;
|
|
1786
1785
|
};
|
|
1787
|
-
imports.wbg.
|
|
1788
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1786
|
+
imports.wbg.__wbindgen_closure_wrapper4226 = function(arg0, arg1, arg2) {
|
|
1787
|
+
const ret = makeMutClosure(arg0, arg1, 1762, __wbg_adapter_55);
|
|
1789
1788
|
return ret;
|
|
1790
1789
|
};
|
|
1791
1790
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
Binary file
|
|
@@ -40,6 +40,7 @@ export const actorcontext_sql: (a: number) => number;
|
|
|
40
40
|
export const actorcontext_state: (a: number) => [number, number];
|
|
41
41
|
export const actorcontext_takePendingHibernationChanges: (a: number) => any;
|
|
42
42
|
export const actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
|
|
43
|
+
export const actorcontext_waitUntil: (a: number, b: any) => void;
|
|
43
44
|
export const actorfactory_new: (a: any, b: any) => [number, number, number];
|
|
44
45
|
export const awaitPromise: (a: any) => any;
|
|
45
46
|
export const bridgeRivetErrorPrefix: () => [number, number];
|
|
@@ -96,11 +97,10 @@ export const websockethandle_close: (a: number, b: number, c: number, d: number)
|
|
|
96
97
|
export const websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
|
|
97
98
|
export const websockethandle_setEventCallback: (a: number, b: any) => void;
|
|
98
99
|
export const start: () => void;
|
|
99
|
-
export const actorcontext_waitUntil: (a: number, b: any) => void;
|
|
100
100
|
export const actorcontext_queue: (a: number) => number;
|
|
101
101
|
export const actorcontext_schedule: (a: number) => number;
|
|
102
|
-
export const __wbg_schedule_free: (a: number, b: number) => void;
|
|
103
102
|
export const __wbg_queue_free: (a: number, b: number) => void;
|
|
103
|
+
export const __wbg_schedule_free: (a: number, b: number) => void;
|
|
104
104
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
105
105
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
106
106
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
@@ -109,7 +109,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
|
|
|
109
109
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
110
110
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
111
111
|
export const __externref_table_dealloc: (a: number) => void;
|
|
112
|
-
export const
|
|
113
|
-
export const
|
|
114
|
-
export const
|
|
112
|
+
export const closure1558_externref_shim: (a: number, b: number, c: any) => void;
|
|
113
|
+
export const closure1761_externref_shim: (a: number, b: number, c: any) => void;
|
|
114
|
+
export const closure1980_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
115
115
|
export const __wbindgen_start: () => void;
|
package/scripts/build.mjs
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
4
5
|
import { dirname, join } from "node:path";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
7
|
|
|
7
8
|
const packageDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
8
9
|
const pkgDir = join(packageDir, "pkg");
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
function resolveWasmPackBin() {
|
|
13
|
+
try {
|
|
14
|
+
const packageJsonPath = require.resolve("wasm-pack/package.json", {
|
|
15
|
+
paths: [packageDir],
|
|
16
|
+
});
|
|
17
|
+
return join(dirname(packageJsonPath), "run.js");
|
|
18
|
+
} catch (err) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
"Missing pinned wasm-pack dependency. Run pnpm install before building @rivetkit/rivetkit-wasm.",
|
|
21
|
+
{ cause: err },
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
9
25
|
|
|
10
26
|
if (["1", "true"].includes(process.env.SKIP_WASM_BUILD ?? "")) {
|
|
11
27
|
const hasPkg = existsSync(join(pkgDir, "rivetkit_wasm.js"));
|
|
@@ -33,7 +49,6 @@ if (!outDir) {
|
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
const cmd = [
|
|
36
|
-
"wasm-pack",
|
|
37
52
|
"build",
|
|
38
53
|
"--target",
|
|
39
54
|
target,
|
|
@@ -43,5 +58,7 @@ const cmd = [
|
|
|
43
58
|
"rivetkit_wasm",
|
|
44
59
|
];
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
const wasmPackBin = resolveWasmPackBin();
|
|
62
|
+
|
|
63
|
+
console.log(`[rivetkit-wasm/build] running: wasm-pack ${cmd.join(" ")}`);
|
|
64
|
+
execFileSync(process.execPath, [wasmPackBin, ...cmd], { stdio: "inherit" });
|