Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit a19ff3b

Browse files
committed
chore: implement inline client for all drivers
1 parent fd29304 commit a19ff3b

File tree

103 files changed

+3982
-1950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3982
-1950
lines changed

examples/chat-room-python/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "npx rivetkit/cli@latest dev actors/app.ts",
7+
"dev": "tsx src/server.ts",
88
"check-types": "tsc --noEmit",
99
"pytest": "pytest tests/test_chat_room.py -v"
1010
},
@@ -14,6 +14,9 @@
1414
"tsx": "^3.12.7",
1515
"typescript": "^5.5.2"
1616
},
17+
"dependencies": {
18+
"@rivetkit/nodejs": "workspace:*"
19+
},
1720
"example": {
1821
"platforms": [
1922
"*"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { serve } from "@rivetkit/nodejs";
2+
import { app } from "./workers/app";
3+
4+
serve(app);

examples/chat-room-python/actors/app.ts renamed to examples/chat-room-python/src/workers/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { actor, setup } from "rivetkit";
1+
import { worker, setup } from "rivetkit";
22

33
// state managed by the actor
44
export interface State {
55
messages: { username: string; message: string }[];
66
}
77

8-
export const chatRoom = actor({
8+
export const chatRoom = worker({
99
// initialize state
1010
state: { messages: [] } as State,
1111

@@ -28,7 +28,7 @@ export const chatRoom = actor({
2828

2929
// Create and export the app
3030
export const app = setup({
31-
actors: { chatRoom },
31+
workers: { chatRoom },
3232
});
3333

3434
// Export type for client type checking

examples/chat-room/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "npx rivetkit/cli@latest dev actors/app.ts",
7+
"dev": "tsx src/server.ts",
88
"check-types": "tsc --noEmit",
99
"test": "vitest run"
1010
},
@@ -17,6 +17,9 @@
1717
"typescript": "^5.5.2",
1818
"vitest": "^3.1.1"
1919
},
20+
"dependencies": {
21+
"@rivetkit/nodejs": "workspace:*"
22+
},
2023
"example": {
2124
"platforms": [
2225
"*"

examples/chat-room/src/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { serve } from "@rivetkit/nodejs";
2+
import { app } from "./workers/app";
3+
4+
serve(app);

examples/chat-room/actors/app.ts renamed to examples/chat-room/src/workers/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { actor, setup } from "rivetkit";
1+
import { worker, setup } from "rivetkit";
22

33
// state managed by the actor
44
export interface State {
55
messages: { username: string; message: string }[];
66
}
77

8-
export const chatRoom = actor({
8+
export const chatRoom = worker({
99
// initialize state
1010
state: { messages: [] } as State,
1111

@@ -28,7 +28,7 @@ export const chatRoom = actor({
2828

2929
// Create and export the app
3030
export const app = setup({
31-
actors: { chatRoom },
31+
workers: { chatRoom },
3232
});
3333

3434
// Export type for client type checking

examples/chat-room/tests/chat-room.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test, expect } from "vitest";
22
import { setupTest } from "rivetkit/test";
3-
import { app } from "../actors/app";
3+
import { app } from "../src/workers/app";
44

55
test("chat room should handle messages", async (test) => {
66
const { client } = await setupTest(test, app);

examples/counter/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "npx rivetkit/cli@latest dev actors/app.ts",
7+
"dev": "tsx src/server.ts",
88
"check-types": "tsc --noEmit",
99
"test": "vitest run"
1010
},
@@ -15,6 +15,9 @@
1515
"typescript": "^5.7.3",
1616
"vitest": "^3.1.1"
1717
},
18+
"dependencies": {
19+
"@rivetkit/nodejs": "workspace:*"
20+
},
1821
"example": {
1922
"platforms": [
2023
"*"

examples/counter/src/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { serve } from "@rivetkit/nodejs";
2+
import { app } from "./workers/app";
3+
4+
serve(app);

examples/counter/actors/app.ts renamed to examples/counter/src/workers/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { actor, setup } from "rivetkit";
1+
import { worker, setup } from "rivetkit";
22

3-
const counter = actor({
3+
const counter = worker({
44
state: { count: 0 },
55
actions: {
66
increment: (c, x: number) => {
@@ -15,7 +15,7 @@ const counter = actor({
1515
});
1616

1717
export const app = setup({
18-
actors: { counter },
18+
workers: { counter },
1919
});
2020

2121
export type App = typeof app;

0 commit comments

Comments
 (0)