Skip to content

Commit 19cd542

Browse files
committed
chore(rivetkit): fmt
1 parent 8d1d88d commit 19cd542

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

biome.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"**/*.json",
77
"**/*.ts",
88
"!engine/artifacts",
9-
"!engine/sdks",
109
"!engine/sdks/typescript/api-full",
1110
"!engine/sdks/typescript/runner-protocol",
1211
"!frontend",

engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export class WebSocketTunnelAdapter {
2828
constructor(
2929
webSocketId: string,
3030
sendCallback: (data: ArrayBuffer | string, isBinary: boolean) => void,
31-
closeCallback: (code?: number, reason?: string, retry?: boolean) => void,
31+
closeCallback: (
32+
code?: number,
33+
reason?: string,
34+
retry?: boolean,
35+
) => void,
3236
) {
3337
this.#webSocketId = webSocketId;
3438
this.#sendCallback = sendCallback;
@@ -436,7 +440,12 @@ export class WebSocketTunnelAdapter {
436440
}
437441

438442
/// Returns false if the message was sent off.
439-
_handleMessage(requestId: ArrayBuffer, data: string | Uint8Array, index: number, isBinary: boolean): boolean {
443+
_handleMessage(
444+
requestId: ArrayBuffer,
445+
data: string | Uint8Array,
446+
index: number,
447+
isBinary: boolean,
448+
): boolean {
440449
if (this.#readyState !== 1) {
441450
// OPEN
442451
return true;

engine/sdks/typescript/test-runner/src/index.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ const INTERNAL_SERVER_PORT = process.env.INTERNAL_SERVER_PORT
1212
: 5051;
1313
const RIVET_NAMESPACE = process.env.RIVET_NAMESPACE ?? "default";
1414
const RIVET_RUNNER_NAME = process.env.RIVET_RUNNER_NAME ?? "test-runner";
15-
const RIVET_RUNNER_KEY =
16-
process.env.RIVET_RUNNER_KEY;
15+
const RIVET_RUNNER_KEY = process.env.RIVET_RUNNER_KEY;
1716
const RIVET_RUNNER_VERSION = process.env.RIVET_RUNNER_VERSION
1817
? Number(process.env.RIVET_RUNNER_VERSION)
1918
: 1;
@@ -106,8 +105,7 @@ if (AUTOSTART_SERVER) {
106105

107106
if (AUTOSTART_RUNNER) {
108107
[runner, runnerStarted, runnerStopped] = await startRunner();
109-
}
110-
else await autoConfigureServerless();
108+
} else await autoConfigureServerless();
111109

112110
async function autoConfigureServerless() {
113111
const res = await fetch(
@@ -155,13 +153,14 @@ async function startRunner(): Promise<
155153
token: RIVET_TOKEN,
156154
namespace: RIVET_NAMESPACE,
157155
runnerName: RIVET_RUNNER_NAME,
158-
runnerKey: RIVET_RUNNER_KEY ?? `key-${Math.floor(Math.random() * 10000)}`,
156+
runnerKey:
157+
RIVET_RUNNER_KEY ?? `key-${Math.floor(Math.random() * 10000)}`,
159158
totalSlots: RIVET_RUNNER_TOTAL_SLOTS,
160159
prepopulateActorNames: {},
161160
onConnected: () => {
162161
runnerStarted.resolve(undefined);
163162
},
164-
onDisconnected: () => { },
163+
onDisconnected: () => {},
165164
onShutdown: () => {
166165
runnerStopped.resolve(undefined);
167166
},
@@ -227,9 +226,17 @@ async function startRunner(): Promise<
227226
ws.send(`Echo: ${data}`);
228227

229228
// Ack
230-
const websocketId = Buffer.from((event as any).rivetRequestId).toString("base64");
231-
websocketLastMsgIndexes.set(websocketId, (event as any).rivetMessageIndex);
232-
runner.sendWebsocketMessageAck((event as any).rivetRequestId, (event as any).rivetMessageIndex);
229+
const websocketId = Buffer.from(
230+
(event as any).rivetRequestId,
231+
).toString("base64");
232+
websocketLastMsgIndexes.set(
233+
websocketId,
234+
(event as any).rivetMessageIndex,
235+
);
236+
runner.sendWebsocketMessageAck(
237+
(event as any).rivetRequestId,
238+
(event as any).rivetMessageIndex,
239+
);
233240
});
234241

235242
ws.addEventListener("close", () => {

engine/sdks/typescript/test-runner/src/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import { inspect } from "node:util";
12
import {
23
type Level,
34
type LevelWithSilent,
45
type Logger,
56
pino,
67
stdTimeFunctions,
78
} from "pino";
8-
import { inspect } from "util";
99

1010
export type { Logger } from "pino";
1111

0 commit comments

Comments
 (0)