diff --git a/docs/workers/quickstart.mdx b/docs/workers/quickstart.mdx index 6cc30d1db..e91268eb6 100644 --- a/docs/workers/quickstart.mdx +++ b/docs/workers/quickstart.mdx @@ -92,11 +92,11 @@ _If you want to run without export fetch (i.e. standalone Node.js), see below._ ```sh Node.js -npx serve-fetch src/server.ts +npx tsx --watch src/server.ts ``` ```sh Bun -bun serve src/server.ts +bun run --watch src/server.ts ``` diff --git a/examples/better-auth/package.json b/examples/better-auth/package.json index eb6572e16..fcde06536 100644 --- a/examples/better-auth/package.json +++ b/examples/better-auth/package.json @@ -17,7 +17,7 @@ "@types/react-dom": "^18.2.0", "@vitejs/plugin-react": "^4.2.0", "concurrently": "^8.2.2", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2", "vite": "^5.0.0", diff --git a/examples/better-auth/src/backend/registry.ts b/examples/better-auth/src/backend/registry.ts index 7043bf599..bca18a372 100644 --- a/examples/better-auth/src/backend/registry.ts +++ b/examples/better-auth/src/backend/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; import { auth, type Session, type User } from "./auth"; export const chatRoom = worker({ @@ -45,4 +45,4 @@ export const registry = setup({ workers: { chatRoom }, }); -export type Registry = typeof registry; \ No newline at end of file +export type Registry = typeof registry; diff --git a/examples/chat-room/package.json b/examples/chat-room/package.json index 341aa1a4e..556d37b79 100644 --- a/examples/chat-room/package.json +++ b/examples/chat-room/package.json @@ -12,7 +12,7 @@ "@types/node": "^22.13.9", "@types/prompts": "^2", "prompts": "^2.4.2", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2", "vitest": "^3.1.1" diff --git a/examples/chat-room/scripts/cli.ts b/examples/chat-room/scripts/cli.ts index 0886e968a..e22b876f1 100644 --- a/examples/chat-room/scripts/cli.ts +++ b/examples/chat-room/scripts/cli.ts @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import type { Registry } from "../workers/registry"; import prompts from "prompts"; diff --git a/examples/chat-room/scripts/connect.ts b/examples/chat-room/scripts/connect.ts index 3d8fdb8b1..0fdd3e4f5 100644 --- a/examples/chat-room/scripts/connect.ts +++ b/examples/chat-room/scripts/connect.ts @@ -1,5 +1,5 @@ /// -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import type { Registry } from "../workers/registry"; async function main() { diff --git a/examples/chat-room/src/workers/registry.ts b/examples/chat-room/src/workers/registry.ts index b242ecd20..634c3c0a9 100644 --- a/examples/chat-room/src/workers/registry.ts +++ b/examples/chat-room/src/workers/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; // state managed by the actor export interface State { diff --git a/examples/chat-room/tests/chat-room.test.ts b/examples/chat-room/tests/chat-room.test.ts index 04ebf493a..b14ea9592 100644 --- a/examples/chat-room/tests/chat-room.test.ts +++ b/examples/chat-room/tests/chat-room.test.ts @@ -1,5 +1,5 @@ import { test, expect } from "vitest"; -import { setupTest } from "rivetkit/test"; +import { setupTest } from "@rivetkit/worker/test"; import { registry } from "../src/workers/registry"; test("chat room should handle messages", async (test) => { diff --git a/examples/cloudflare-workers/package.json b/examples/cloudflare-workers/package.json index a7f34ace0..1bb44fa84 100644 --- a/examples/cloudflare-workers/package.json +++ b/examples/cloudflare-workers/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@cloudflare/workers-types": "^4.20250129.0", "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2", "wrangler": "^3.0.0" diff --git a/examples/cloudflare-workers/scripts/client.ts b/examples/cloudflare-workers/scripts/client.ts index 5c7cec651..ef15618e2 100644 --- a/examples/cloudflare-workers/scripts/client.ts +++ b/examples/cloudflare-workers/scripts/client.ts @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import type { Registry } from "../src/registry.js"; // Create RivetKit client diff --git a/examples/cloudflare-workers/src/registry.ts b/examples/cloudflare-workers/src/registry.ts index 11f62e9b9..84f7d059b 100644 --- a/examples/cloudflare-workers/src/registry.ts +++ b/examples/cloudflare-workers/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { @@ -17,4 +17,4 @@ export const registry = setup({ workers: { counter }, }); -export type Registry = typeof registry; \ No newline at end of file +export type Registry = typeof registry; diff --git a/examples/counter/package.json b/examples/counter/package.json index ea8e41584..9bd64035a 100644 --- a/examples/counter/package.json +++ b/examples/counter/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.7.3", "vitest": "^3.1.1" diff --git a/examples/counter/scripts/connect.ts b/examples/counter/scripts/connect.ts index 6ac56f893..04091852d 100644 --- a/examples/counter/scripts/connect.ts +++ b/examples/counter/scripts/connect.ts @@ -1,5 +1,5 @@ /// -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import type { Registry } from "../workers/registry"; async function main() { diff --git a/examples/counter/src/workers/registry.ts b/examples/counter/src/workers/registry.ts index 717b2b917..13f56c12b 100644 --- a/examples/counter/src/workers/registry.ts +++ b/examples/counter/src/workers/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; const counter = worker({ state: { count: 0 }, diff --git a/examples/counter/tests/counter.test.ts b/examples/counter/tests/counter.test.ts index 4504750f7..618096300 100644 --- a/examples/counter/tests/counter.test.ts +++ b/examples/counter/tests/counter.test.ts @@ -1,5 +1,5 @@ import { test, expect } from "vitest"; -import { setupTest } from "rivetkit/test"; +import { setupTest } from "@rivetkit/worker/test"; import { registry } from "../src/workers/registry"; test("it should count", async (test) => { diff --git a/examples/elysia/package.json b/examples/elysia/package.json index 7ad7df28e..b8899a345 100644 --- a/examples/elysia/package.json +++ b/examples/elysia/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "typescript": "^5.5.2" }, "dependencies": { @@ -23,4 +23,4 @@ "platforms": ["*"] }, "stableVersion": "0.8.0" -} \ No newline at end of file +} diff --git a/examples/elysia/src/registry.ts b/examples/elysia/src/registry.ts index 11f62e9b9..84f7d059b 100644 --- a/examples/elysia/src/registry.ts +++ b/examples/elysia/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { @@ -17,4 +17,4 @@ export const registry = setup({ workers: { counter }, }); -export type Registry = typeof registry; \ No newline at end of file +export type Registry = typeof registry; diff --git a/examples/express/package.json b/examples/express/package.json index 7b49b173f..1c0601f20 100644 --- a/examples/express/package.json +++ b/examples/express/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@types/express": "^4.17.21", "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2" }, diff --git a/examples/express/src/registry.ts b/examples/express/src/registry.ts index ce4f8a995..84f7d059b 100644 --- a/examples/express/src/registry.ts +++ b/examples/express/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/hono-react/package.json b/examples/hono-react/package.json index ab32ac262..8a0857752 100644 --- a/examples/hono-react/package.json +++ b/examples/hono-react/package.json @@ -17,7 +17,7 @@ "@types/react-dom": "^18.2.0", "@vitejs/plugin-react": "^4.2.0", "concurrently": "^8.2.2", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2", "vite": "^5.0.0", diff --git a/examples/hono-react/src/backend/registry.ts b/examples/hono-react/src/backend/registry.ts index 70eff98ac..de9d21a60 100644 --- a/examples/hono-react/src/backend/registry.ts +++ b/examples/hono-react/src/backend/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/hono/package.json b/examples/hono/package.json index 9294760a9..791801226 100644 --- a/examples/hono/package.json +++ b/examples/hono/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2" }, diff --git a/examples/hono/src/registry.ts b/examples/hono/src/registry.ts index ce4f8a995..84f7d059b 100644 --- a/examples/hono/src/registry.ts +++ b/examples/hono/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/nodejs/package.json b/examples/nodejs/package.json index 87b0fb01b..406f36689 100644 --- a/examples/nodejs/package.json +++ b/examples/nodejs/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2" }, diff --git a/examples/nodejs/src/registry.ts b/examples/nodejs/src/registry.ts index ce4f8a995..84f7d059b 100644 --- a/examples/nodejs/src/registry.ts +++ b/examples/nodejs/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/react/package.json b/examples/react/package.json index f3c135345..b1296e965 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -17,7 +17,7 @@ "@types/react-dom": "^18.2.0", "@vitejs/plugin-react": "^4.2.0", "concurrently": "^8.2.2", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2", "vite": "^5.0.0", diff --git a/examples/react/src/backend/registry.ts b/examples/react/src/backend/registry.ts index 70eff98ac..de9d21a60 100644 --- a/examples/react/src/backend/registry.ts +++ b/examples/react/src/backend/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/rivet/package.json b/examples/rivet/package.json index 0cd0e06b4..808e79f42 100644 --- a/examples/rivet/package.json +++ b/examples/rivet/package.json @@ -14,7 +14,7 @@ "typescript": "^5.5.2" }, "dependencies": { - "rivetkit": "https://pkg.pr.new/rivet-gg/rivetkit@65c3659", + "@rivetkit/worker": "https://pkg.pr.new/rivet-gg/rivetkit@65c3659", "@rivetkit/rivet": "https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/rivet@65c3659" }, "example": { diff --git a/examples/rivet/scripts/client.ts b/examples/rivet/scripts/client.ts index ce52868f5..860099971 100644 --- a/examples/rivet/scripts/client.ts +++ b/examples/rivet/scripts/client.ts @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { execSync } from "node:child_process"; import type { registry } from "../src/registry.js"; diff --git a/examples/rivet/src/registry.ts b/examples/rivet/src/registry.ts index ce4f8a995..84f7d059b 100644 --- a/examples/rivet/src/registry.ts +++ b/examples/rivet/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { diff --git a/examples/snippets/ai-agent/App.tsx b/examples/snippets/ai-agent/App.tsx index 54f3dfbac..39a31ef88 100644 --- a/examples/snippets/ai-agent/App.tsx +++ b/examples/snippets/ai-agent/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/ai-agent/actor-json.ts b/examples/snippets/ai-agent/actor-json.ts index 0e4062d6c..5d5ede675 100644 --- a/examples/snippets/ai-agent/actor-json.ts +++ b/examples/snippets/ai-agent/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { generateText, tool } from "ai"; import { openai } from "@ai-sdk/openai"; import { getWeather } from "./my-utils"; diff --git a/examples/snippets/ai-agent/actor-sqlite.ts b/examples/snippets/ai-agent/actor-sqlite.ts index 6dda2ec17..61ed3ce46 100644 --- a/examples/snippets/ai-agent/actor-sqlite.ts +++ b/examples/snippets/ai-agent/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { generateText, tool } from "ai"; import { openai } from "@ai-sdk/openai"; diff --git a/examples/snippets/chat-room/App.tsx b/examples/snippets/chat-room/App.tsx index c544dc3bf..8735e5a96 100644 --- a/examples/snippets/chat-room/App.tsx +++ b/examples/snippets/chat-room/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/chat-room/actor-json.ts b/examples/snippets/chat-room/actor-json.ts index 05f88b080..b6c9e0b02 100644 --- a/examples/snippets/chat-room/actor-json.ts +++ b/examples/snippets/chat-room/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; export type Message = { sender: string; text: string; timestamp: number; } diff --git a/examples/snippets/chat-room/actor-sqlite.ts b/examples/snippets/chat-room/actor-sqlite.ts index 0c58f1777..ad922290d 100644 --- a/examples/snippets/chat-room/actor-sqlite.ts +++ b/examples/snippets/chat-room/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { messages } from "./schema"; diff --git a/examples/snippets/crdt/App.tsx b/examples/snippets/crdt/App.tsx index d34232ea2..e37bc7b6d 100644 --- a/examples/snippets/crdt/App.tsx +++ b/examples/snippets/crdt/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect, useRef } from "react"; import * as Y from 'yjs'; diff --git a/examples/snippets/crdt/actor-json.ts b/examples/snippets/crdt/actor-json.ts index a906c329e..a50f34d6c 100644 --- a/examples/snippets/crdt/actor-json.ts +++ b/examples/snippets/crdt/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import * as Y from 'yjs'; import { encodeStateAsUpdate, applyUpdate } from 'yjs'; diff --git a/examples/snippets/crdt/actor-sqlite.ts b/examples/snippets/crdt/actor-sqlite.ts index 4487c1810..a99acde4c 100644 --- a/examples/snippets/crdt/actor-sqlite.ts +++ b/examples/snippets/crdt/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import * as Y from 'yjs'; import { encodeStateAsUpdate, applyUpdate } from 'yjs'; diff --git a/examples/snippets/database/App.tsx b/examples/snippets/database/App.tsx index 7e12ff5c8..637445f81 100644 --- a/examples/snippets/database/App.tsx +++ b/examples/snippets/database/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; diff --git a/examples/snippets/database/actor-json.ts b/examples/snippets/database/actor-json.ts index a800808bb..9761bdf35 100644 --- a/examples/snippets/database/actor-json.ts +++ b/examples/snippets/database/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { authenticate } from "./my-utils"; export type Note = { id: string; content: string; updatedAt: number }; diff --git a/examples/snippets/database/actor-sqlite.ts b/examples/snippets/database/actor-sqlite.ts index 532cb8bb0..41f1f974b 100644 --- a/examples/snippets/database/actor-sqlite.ts +++ b/examples/snippets/database/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { notes } from "./schema"; import { authenticate } from "./my-utils"; diff --git a/examples/snippets/document/App.tsx b/examples/snippets/document/App.tsx index 0d4d201d4..03f00c7ca 100644 --- a/examples/snippets/document/App.tsx +++ b/examples/snippets/document/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/document/actor-json.ts b/examples/snippets/document/actor-json.ts index d48503ca4..9fd4c668e 100644 --- a/examples/snippets/document/actor-json.ts +++ b/examples/snippets/document/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; export type Cursor = { x: number, y: number, userId: string }; diff --git a/examples/snippets/document/actor-sqlite.ts b/examples/snippets/document/actor-sqlite.ts index 2ef7726d1..a65d8a0a2 100644 --- a/examples/snippets/document/actor-sqlite.ts +++ b/examples/snippets/document/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { documents, cursors } from "./schema"; diff --git a/examples/snippets/game/App.tsx b/examples/snippets/game/App.tsx index 8e7170615..4122f81bc 100644 --- a/examples/snippets/game/App.tsx +++ b/examples/snippets/game/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect, useRef } from "react"; import type { Player } from "./actor"; diff --git a/examples/snippets/game/actor-json.ts b/examples/snippets/game/actor-json.ts index 531c778e6..739de59dd 100644 --- a/examples/snippets/game/actor-json.ts +++ b/examples/snippets/game/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; export type Position = { x: number; y: number }; export type Input = { x: number; y: number }; diff --git a/examples/snippets/game/actor-sqlite.ts b/examples/snippets/game/actor-sqlite.ts index 3b059cead..22e93635e 100644 --- a/examples/snippets/game/actor-sqlite.ts +++ b/examples/snippets/game/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { players, gameSettings } from "./schema"; diff --git a/examples/snippets/rate/App.tsx b/examples/snippets/rate/App.tsx index 844378bc6..b54a99047 100644 --- a/examples/snippets/rate/App.tsx +++ b/examples/snippets/rate/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/rate/actor-json.ts b/examples/snippets/rate/actor-json.ts index 8f799713b..b06432d19 100644 --- a/examples/snippets/rate/actor-json.ts +++ b/examples/snippets/rate/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; // Simple rate limiter - allows 5 requests per minute const rateLimiter = actor({ diff --git a/examples/snippets/rate/actor-sqlite.ts b/examples/snippets/rate/actor-sqlite.ts index f6745501b..ace413872 100644 --- a/examples/snippets/rate/actor-sqlite.ts +++ b/examples/snippets/rate/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { limiters } from "./schema"; diff --git a/examples/snippets/stream/App.tsx b/examples/snippets/stream/App.tsx index 0166dc044..21f4de62f 100644 --- a/examples/snippets/stream/App.tsx +++ b/examples/snippets/stream/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/stream/actor-json.ts b/examples/snippets/stream/actor-json.ts index 61d6e83a8..ba49b271e 100644 --- a/examples/snippets/stream/actor-json.ts +++ b/examples/snippets/stream/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; export type StreamState = { topValues: number[]; diff --git a/examples/snippets/stream/actor-sqlite.ts b/examples/snippets/stream/actor-sqlite.ts index 9e7e03029..ae7bd64f0 100644 --- a/examples/snippets/stream/actor-sqlite.ts +++ b/examples/snippets/stream/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { streams, streamValues } from "./schema"; diff --git a/examples/snippets/sync/App.tsx b/examples/snippets/sync/App.tsx index 1e239ec29..ab6283ddb 100644 --- a/examples/snippets/sync/App.tsx +++ b/examples/snippets/sync/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect, useRef } from "react"; import type { Contact } from "./actor"; diff --git a/examples/snippets/sync/actor-json.ts b/examples/snippets/sync/actor-json.ts index 68d236214..656904868 100644 --- a/examples/snippets/sync/actor-json.ts +++ b/examples/snippets/sync/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; export type Contact = { id: string; name: string; email: string; phone: string; updatedAt: number; } diff --git a/examples/snippets/sync/actor-sqlite.ts b/examples/snippets/sync/actor-sqlite.ts index 26b679856..25d88f81a 100644 --- a/examples/snippets/sync/actor-sqlite.ts +++ b/examples/snippets/sync/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { contacts } from "./schema"; diff --git a/examples/snippets/tenant/App.tsx b/examples/snippets/tenant/App.tsx index 501e4c72a..0f0cf9dc8 100644 --- a/examples/snippets/tenant/App.tsx +++ b/examples/snippets/tenant/App.tsx @@ -1,4 +1,4 @@ -import { createClient } from "rivetkit/client"; +import { createClient } from "@rivetkit/worker/client"; import { createReactRivetKit } from "@rivetkit/react"; import { useState, useEffect } from "react"; import type { Registry } from "../workers/registry"; diff --git a/examples/snippets/tenant/actor-json.ts b/examples/snippets/tenant/actor-json.ts index 21c071b6d..d09cf4ebb 100644 --- a/examples/snippets/tenant/actor-json.ts +++ b/examples/snippets/tenant/actor-json.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { authenticate } from "./my-utils"; // Simple tenant organization actor diff --git a/examples/snippets/tenant/actor-sqlite.ts b/examples/snippets/tenant/actor-sqlite.ts index 629d402b0..eab708652 100644 --- a/examples/snippets/tenant/actor-sqlite.ts +++ b/examples/snippets/tenant/actor-sqlite.ts @@ -1,4 +1,4 @@ -import { actor } from "rivetkit"; +import { actor } from "@rivetkit/worker"; import { drizzle } from "@rivetkit/drizzle"; import { members, invoices } from "./schema"; import { authenticate } from "./my-utils"; diff --git a/examples/trpc/package.json b/examples/trpc/package.json index 45aacad42..6da22c94d 100644 --- a/examples/trpc/package.json +++ b/examples/trpc/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@types/node": "^22.13.9", - "rivetkit": "workspace:*", + "@rivetkit/worker": "workspace:*", "tsx": "^3.12.7", "typescript": "^5.5.2" }, @@ -24,4 +24,4 @@ "platforms": ["*"] }, "stableVersion": "0.8.0" -} \ No newline at end of file +} diff --git a/examples/trpc/src/registry.ts b/examples/trpc/src/registry.ts index 11f62e9b9..84f7d059b 100644 --- a/examples/trpc/src/registry.ts +++ b/examples/trpc/src/registry.ts @@ -1,4 +1,4 @@ -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/worker"; export const counter = worker({ onAuth: () => { @@ -17,4 +17,4 @@ export const registry = setup({ workers: { counter }, }); -export type Registry = typeof registry; \ No newline at end of file +export type Registry = typeof registry; diff --git a/packages/core/fixtures/driver-test-suite/action-inputs.ts b/packages/core/fixtures/driver-test-suite/action-inputs.ts index c57d9f4b9..0936bf7d9 100644 --- a/packages/core/fixtures/driver-test-suite/action-inputs.ts +++ b/packages/core/fixtures/driver-test-suite/action-inputs.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export interface State { initialInput?: unknown; diff --git a/packages/core/fixtures/driver-test-suite/action-timeout.ts b/packages/core/fixtures/driver-test-suite/action-timeout.ts index 9127cf20e..c0a5988b4 100644 --- a/packages/core/fixtures/driver-test-suite/action-timeout.ts +++ b/packages/core/fixtures/driver-test-suite/action-timeout.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; // Short timeout worker export const shortTimeoutWorker = worker({ diff --git a/packages/core/fixtures/driver-test-suite/action-types.ts b/packages/core/fixtures/driver-test-suite/action-types.ts index cf280060c..342b8b171 100644 --- a/packages/core/fixtures/driver-test-suite/action-types.ts +++ b/packages/core/fixtures/driver-test-suite/action-types.ts @@ -1,4 +1,4 @@ -import { worker, UserError } from "rivetkit"; +import { worker, UserError } from "@rivetkit/core"; // Worker with synchronous actions export const syncActionWorker = worker({ diff --git a/packages/core/fixtures/driver-test-suite/auth.ts b/packages/core/fixtures/driver-test-suite/auth.ts index f4dd6657e..e558d9e83 100644 --- a/packages/core/fixtures/driver-test-suite/auth.ts +++ b/packages/core/fixtures/driver-test-suite/auth.ts @@ -1,4 +1,4 @@ -import { worker, UserError } from "rivetkit"; +import { worker, UserError } from "@rivetkit/core"; // Basic auth worker - requires API key export const authWorker = worker({ diff --git a/packages/core/fixtures/driver-test-suite/conn-params.ts b/packages/core/fixtures/driver-test-suite/conn-params.ts index 44bc4160d..db0876576 100644 --- a/packages/core/fixtures/driver-test-suite/conn-params.ts +++ b/packages/core/fixtures/driver-test-suite/conn-params.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export const counterWithParams = worker({ onAuth: () => {}, diff --git a/packages/core/fixtures/driver-test-suite/conn-state.ts b/packages/core/fixtures/driver-test-suite/conn-state.ts index 4c5a55e3a..3151905a9 100644 --- a/packages/core/fixtures/driver-test-suite/conn-state.ts +++ b/packages/core/fixtures/driver-test-suite/conn-state.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export type ConnState = { username: string; diff --git a/packages/core/fixtures/driver-test-suite/counter.ts b/packages/core/fixtures/driver-test-suite/counter.ts index bb1aea230..5936b93b0 100644 --- a/packages/core/fixtures/driver-test-suite/counter.ts +++ b/packages/core/fixtures/driver-test-suite/counter.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export const counter = worker({ onAuth: () => {}, diff --git a/packages/core/fixtures/driver-test-suite/error-handling.ts b/packages/core/fixtures/driver-test-suite/error-handling.ts index 1cbdf947d..a6e743c98 100644 --- a/packages/core/fixtures/driver-test-suite/error-handling.ts +++ b/packages/core/fixtures/driver-test-suite/error-handling.ts @@ -1,4 +1,4 @@ -import { worker, UserError } from "rivetkit"; +import { worker, UserError } from "@rivetkit/core"; export const errorHandlingWorker = worker({ onAuth: () => {}, diff --git a/packages/core/fixtures/driver-test-suite/lifecycle.ts b/packages/core/fixtures/driver-test-suite/lifecycle.ts index 2b81da1b6..950e3ac8d 100644 --- a/packages/core/fixtures/driver-test-suite/lifecycle.ts +++ b/packages/core/fixtures/driver-test-suite/lifecycle.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export const counterWithLifecycle = worker({ onAuth: () => {}, diff --git a/packages/core/fixtures/driver-test-suite/metadata.ts b/packages/core/fixtures/driver-test-suite/metadata.ts index 0f3879a0c..c1e94b3ea 100644 --- a/packages/core/fixtures/driver-test-suite/metadata.ts +++ b/packages/core/fixtures/driver-test-suite/metadata.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; // Note: For testing only - metadata API will need to be mocked // in tests since this is implementation-specific diff --git a/packages/core/fixtures/driver-test-suite/registry.ts b/packages/core/fixtures/driver-test-suite/registry.ts index 5c30dba0c..696ddfddc 100644 --- a/packages/core/fixtures/driver-test-suite/registry.ts +++ b/packages/core/fixtures/driver-test-suite/registry.ts @@ -1,4 +1,4 @@ -import { setup } from "rivetkit"; +import { setup } from "@rivetkit/core"; // Import workers from individual files import { counter } from "./counter"; diff --git a/packages/core/fixtures/driver-test-suite/scheduled.ts b/packages/core/fixtures/driver-test-suite/scheduled.ts index 9590b0f49..ee2bc284c 100644 --- a/packages/core/fixtures/driver-test-suite/scheduled.ts +++ b/packages/core/fixtures/driver-test-suite/scheduled.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; export const scheduled = worker({ onAuth: () => {}, diff --git a/packages/core/fixtures/driver-test-suite/vars.ts b/packages/core/fixtures/driver-test-suite/vars.ts index 753e615a1..ee24df1bd 100644 --- a/packages/core/fixtures/driver-test-suite/vars.ts +++ b/packages/core/fixtures/driver-test-suite/vars.ts @@ -1,4 +1,4 @@ -import { worker } from "rivetkit"; +import { worker } from "@rivetkit/core"; // Worker with static vars export const staticVarWorker = worker({ diff --git a/packages/core/package.json b/packages/core/package.json index 88c8bc8f9..14aa6a822 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "rivetkit", + "name": "@rivetkit/core", "version": "0.9.0-rc.1", "license": "Apache-2.0", "keywords": [ diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 2569ffe76..d07004658 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -5,7 +5,7 @@ "paths": { "@/*": ["./src/*"], // Used for test fixtures - "rivetkit": ["./src/mod.ts"] + "@rivetkit/core": ["./src/mod.ts"] } }, "include": ["src/**/*", "tests/**/*", "scripts/**/*", "fixtures/driver-test-suite/**/*"] diff --git a/packages/drivers/file-system/package.json b/packages/drivers/file-system/package.json index 1bd900f02..a80dea00c 100644 --- a/packages/drivers/file-system/package.json +++ b/packages/drivers/file-system/package.json @@ -25,12 +25,12 @@ "test": "vitest run" }, "peerDependencies": { - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { "@types/invariant": "^2", "@types/node": "^22.14.0", - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2", "vitest": "^3.1.1" diff --git a/packages/drivers/file-system/src/global-state.ts b/packages/drivers/file-system/src/global-state.ts index 150e6ba1d..33c80c366 100644 --- a/packages/drivers/file-system/src/global-state.ts +++ b/packages/drivers/file-system/src/global-state.ts @@ -1,7 +1,7 @@ import * as fs from "node:fs/promises"; import * as fsSync from "node:fs"; import * as path from "node:path"; -import type { WorkerKey } from "rivetkit"; +import type { WorkerKey } from "@rivetkit/core"; import { logger } from "./log"; import { getStoragePath, diff --git a/packages/drivers/file-system/src/log.ts b/packages/drivers/file-system/src/log.ts index a782a9076..e583896a8 100644 --- a/packages/drivers/file-system/src/log.ts +++ b/packages/drivers/file-system/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "driver-fs"; diff --git a/packages/drivers/file-system/src/manager.ts b/packages/drivers/file-system/src/manager.ts index 564fbe2ef..aa4fdc70e 100644 --- a/packages/drivers/file-system/src/manager.ts +++ b/packages/drivers/file-system/src/manager.ts @@ -6,12 +6,12 @@ import type { ManagerDriver, WorkerOutput, CreateInput, -} from "rivetkit/driver-helpers"; -import { WorkerAlreadyExists } from "rivetkit/errors"; +} from "@rivetkit/core/driver-helpers"; +import { WorkerAlreadyExists } from "@rivetkit/core/errors"; import { logger } from "./log"; import type { FileSystemGlobalState } from "./global-state"; import { WorkerState } from "./global-state"; -import type { Registry } from "rivetkit"; +import type { Registry } from "@rivetkit/core"; export class FileSystemManagerDriver implements ManagerDriver { #state: FileSystemGlobalState; diff --git a/packages/drivers/file-system/src/worker.ts b/packages/drivers/file-system/src/worker.ts index 93ebf3893..96c5fc160 100644 --- a/packages/drivers/file-system/src/worker.ts +++ b/packages/drivers/file-system/src/worker.ts @@ -1,4 +1,4 @@ -import type { WorkerDriver, AnyWorkerInstance } from "rivetkit/driver-helpers"; +import type { WorkerDriver, AnyWorkerInstance } from "@rivetkit/core/driver-helpers"; import type { FileSystemGlobalState } from "./global-state"; export type WorkerDriverContext = Record; diff --git a/packages/drivers/file-system/tests/driver-tests.test.ts b/packages/drivers/file-system/tests/driver-tests.test.ts index ebc429ae6..93fd1a3b4 100644 --- a/packages/drivers/file-system/tests/driver-tests.test.ts +++ b/packages/drivers/file-system/tests/driver-tests.test.ts @@ -1,7 +1,7 @@ import { runDriverTests, createTestRuntime, -} from "rivetkit/driver-test-suite"; +} from "@rivetkit/core/driver-test-suite"; import { FileSystemWorkerDriver, FileSystemManagerDriver, diff --git a/packages/drivers/memory/package.json b/packages/drivers/memory/package.json index 112cccfe9..ec0f70cc8 100644 --- a/packages/drivers/memory/package.json +++ b/packages/drivers/memory/package.json @@ -25,10 +25,10 @@ "test": "vitest run" }, "peerDependencies": { - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2" }, diff --git a/packages/drivers/memory/src/global-state.ts b/packages/drivers/memory/src/global-state.ts index c9964a30c..deae4f642 100644 --- a/packages/drivers/memory/src/global-state.ts +++ b/packages/drivers/memory/src/global-state.ts @@ -1,4 +1,4 @@ -import type { WorkerKey } from "rivetkit"; +import type { WorkerKey } from "@rivetkit/core"; export interface WorkerState { id: string; diff --git a/packages/drivers/memory/src/log.ts b/packages/drivers/memory/src/log.ts index 09a995f51..25bd1ef8e 100644 --- a/packages/drivers/memory/src/log.ts +++ b/packages/drivers/memory/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "driver-memory"; diff --git a/packages/drivers/memory/src/manager.ts b/packages/drivers/memory/src/manager.ts index ca9ad294e..c6b637efc 100644 --- a/packages/drivers/memory/src/manager.ts +++ b/packages/drivers/memory/src/manager.ts @@ -5,8 +5,8 @@ import type { GetOrCreateWithKeyInput, WorkerOutput, ManagerDriver, -} from "rivetkit/driver-helpers"; -import { WorkerAlreadyExists } from "rivetkit/errors"; +} from "@rivetkit/core/driver-helpers"; +import { WorkerAlreadyExists } from "@rivetkit/core/errors"; import type { MemoryGlobalState } from "./global-state"; import * as crypto from "node:crypto"; diff --git a/packages/drivers/memory/src/mod.ts b/packages/drivers/memory/src/mod.ts index d94cdb853..3a0af05a2 100644 --- a/packages/drivers/memory/src/mod.ts +++ b/packages/drivers/memory/src/mod.ts @@ -1,4 +1,4 @@ -import type { DriverConfig } from "rivetkit"; +import type { DriverConfig } from "@rivetkit/core"; import { MemoryManagerDriver } from "./manager"; import { MemoryGlobalState } from "./global-state"; import { MemoryWorkerDriver } from "./worker"; diff --git a/packages/drivers/memory/src/worker.ts b/packages/drivers/memory/src/worker.ts index f964c4267..1d4214fcd 100644 --- a/packages/drivers/memory/src/worker.ts +++ b/packages/drivers/memory/src/worker.ts @@ -1,4 +1,4 @@ -import type { WorkerDriver, AnyWorkerInstance } from "rivetkit/driver-helpers"; +import type { WorkerDriver, AnyWorkerInstance } from "@rivetkit/core/driver-helpers"; import type { MemoryGlobalState } from "./global-state"; export type WorkerDriverContext = Record; diff --git a/packages/drivers/memory/tests/driver-tests.test.ts b/packages/drivers/memory/tests/driver-tests.test.ts index 387519373..fb1318507 100644 --- a/packages/drivers/memory/tests/driver-tests.test.ts +++ b/packages/drivers/memory/tests/driver-tests.test.ts @@ -1,6 +1,6 @@ import { MemoryGlobalState } from "@/global-state"; import { createMemoryDriver } from "@/mod"; -import { runDriverTests, createTestRuntime } from "rivetkit/driver-test-suite"; +import { runDriverTests, createTestRuntime } from "@rivetkit/core/driver-test-suite"; runDriverTests({ async start(appPath: string) { diff --git a/packages/drivers/redis/package.json b/packages/drivers/redis/package.json index e915063d8..65e6b771b 100644 --- a/packages/drivers/redis/package.json +++ b/packages/drivers/redis/package.json @@ -57,11 +57,11 @@ "test": "vitest run" }, "peerDependencies": { - "rivetkit": "workspace:*" + "@rivetkit/core": "workspace:*" }, "devDependencies": { "@types/node": "^22.13.1", - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2", "vitest": "^3.1.1" diff --git a/packages/drivers/redis/src/coordinate.ts b/packages/drivers/redis/src/coordinate.ts index d5782042c..d20c4781e 100644 --- a/packages/drivers/redis/src/coordinate.ts +++ b/packages/drivers/redis/src/coordinate.ts @@ -5,7 +5,7 @@ import type { NodeMessageCallback, CoordinateDriver, StartWorkerAndAcquireLeaseOutput, -} from "rivetkit/driver-helpers"; +} from "@rivetkit/core/driver-helpers"; import type Redis from "ioredis"; import { KEYS, PUBSUB } from "./keys"; import dedent from "dedent"; diff --git a/packages/drivers/redis/src/log.ts b/packages/drivers/redis/src/log.ts index 7b031ee1d..aceaa7151 100644 --- a/packages/drivers/redis/src/log.ts +++ b/packages/drivers/redis/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "driver-redis"; diff --git a/packages/drivers/redis/src/manager.ts b/packages/drivers/redis/src/manager.ts index 2d91e17c2..784181a51 100644 --- a/packages/drivers/redis/src/manager.ts +++ b/packages/drivers/redis/src/manager.ts @@ -5,12 +5,12 @@ import type { GetOrCreateWithKeyInput, GetWithKeyInput, ManagerDriver, -} from "rivetkit/driver-helpers"; -import { WorkerAlreadyExists } from "rivetkit/errors"; +} from "@rivetkit/core/driver-helpers"; +import { WorkerAlreadyExists } from "@rivetkit/core/errors"; import type Redis from "ioredis"; import * as crypto from "node:crypto"; import { KEYS } from "./keys"; -import type { Registry } from "rivetkit"; +import type { Registry } from "@rivetkit/core"; interface Worker { id: string; diff --git a/packages/drivers/redis/src/worker.ts b/packages/drivers/redis/src/worker.ts index d9df84e14..b68ce49ed 100644 --- a/packages/drivers/redis/src/worker.ts +++ b/packages/drivers/redis/src/worker.ts @@ -1,4 +1,4 @@ -import type { WorkerDriver, AnyWorkerInstance } from "rivetkit/driver-helpers"; +import type { WorkerDriver, AnyWorkerInstance } from "@rivetkit/core/driver-helpers"; import type Redis from "ioredis"; import { KEYS } from "./keys"; diff --git a/packages/drivers/redis/tests/driver-tests.test.ts b/packages/drivers/redis/tests/driver-tests.test.ts index 575652c1a..5c48c318f 100644 --- a/packages/drivers/redis/tests/driver-tests.test.ts +++ b/packages/drivers/redis/tests/driver-tests.test.ts @@ -2,7 +2,7 @@ //import { // runDriverTests, // createTestRuntime, -//} from "rivetkit/driver-test-suite"; +//} from "@rivetkit/core/driver-test-suite"; //import { // RedisWorkerDriver, // RedisCoordinateDriver, @@ -11,7 +11,7 @@ //import Redis from "ioredis"; //import { $ } from "zx"; //import { expect, test } from "vitest"; -//import { getPort } from "rivetkit/test"; +//import { getPort } from "@rivetkit/core/test"; // //async function startValkeyContainer(): Promise<{ // port: number; diff --git a/packages/frameworks/framework-base/lib/mod.ts b/packages/frameworks/framework-base/lib/mod.ts index 3fcbb364b..e40111b03 100644 --- a/packages/frameworks/framework-base/lib/mod.ts +++ b/packages/frameworks/framework-base/lib/mod.ts @@ -1,11 +1,11 @@ import { Derived, Effect, Store, type Updater } from "@tanstack/store"; -import type { AnyWorkerDefinition, Registry } from "rivetkit"; +import type { AnyWorkerDefinition, Registry } from "@rivetkit/core"; import type { Client, ExtractWorkersFromRegistry, WorkerConn, WorkerHandle, -} from "rivetkit/client"; +} from "@rivetkit/core/client"; // biome-ignore lint/suspicious/noExplicitAny: its a generic worker registry export type AnyWorkerRegistry = Registry; diff --git a/packages/frameworks/framework-base/package.json b/packages/frameworks/framework-base/package.json index e751e3460..e2c0131cb 100644 --- a/packages/frameworks/framework-base/package.json +++ b/packages/frameworks/framework-base/package.json @@ -27,10 +27,10 @@ "check-types": "tsc --noEmit" }, "peerDependencies": { - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "typescript": "^5.5.2", "vite": "^6.3.5", "vite-plugin-dts": "^4.5.4", diff --git a/packages/frameworks/react/package.json b/packages/frameworks/react/package.json index f90ef93ef..d6b41188a 100644 --- a/packages/frameworks/react/package.json +++ b/packages/frameworks/react/package.json @@ -28,12 +28,12 @@ "peerDependencies": { "react": "^18 || ^19", "react-dom": "^18 || ^19", - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", - "rivetkit": "workspace:^", + "@rivetkit/core": "workspace:^", "tsup": "^8.4.0", "typescript": "^5.5.2" }, diff --git a/packages/frameworks/react/src/mod.tsx b/packages/frameworks/react/src/mod.tsx index e32167eac..ad32e255b 100644 --- a/packages/frameworks/react/src/mod.tsx +++ b/packages/frameworks/react/src/mod.tsx @@ -5,10 +5,10 @@ import { type WorkerOptions, createRivetKit as createVanillaRivetKit, } from "@rivetkit/framework-base"; -import type { Client, ExtractWorkersFromRegistry } from "rivetkit/client"; +import type { Client, ExtractWorkersFromRegistry } from "@rivetkit/core/client"; import { useEffect } from "react"; -export { createClient } from "rivetkit/client"; +export { createClient } from "@rivetkit/core/client"; export function createRivetKit( client: Client, diff --git a/packages/platforms/cloudflare-workers/package.json b/packages/platforms/cloudflare-workers/package.json index 3b92b9894..3981e8de1 100644 --- a/packages/platforms/cloudflare-workers/package.json +++ b/packages/platforms/cloudflare-workers/package.json @@ -28,13 +28,13 @@ "test": "vitest run tests" }, "peerDependencies": { - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { "@cloudflare/workers-types": "^4.20250129.0", "@types/invariant": "^2", "@types/node": "^24.0.3", - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2", "vitest": "^3.1.1", diff --git a/packages/platforms/cloudflare-workers/src/config.ts b/packages/platforms/cloudflare-workers/src/config.ts index 3ad481223..b20a3abe9 100644 --- a/packages/platforms/cloudflare-workers/src/config.ts +++ b/packages/platforms/cloudflare-workers/src/config.ts @@ -1,4 +1,4 @@ -import { RunConfigSchema } from "rivetkit/driver-helpers"; +import { RunConfigSchema } from "@rivetkit/core/driver-helpers"; import { z } from "zod"; export const ConfigSchema = RunConfigSchema.omit({ driver: true, getUpgradeWebSocket: true }).default({}); diff --git a/packages/platforms/cloudflare-workers/src/handler.ts b/packages/platforms/cloudflare-workers/src/handler.ts index 920127f28..89ff6f9c0 100644 --- a/packages/platforms/cloudflare-workers/src/handler.ts +++ b/packages/platforms/cloudflare-workers/src/handler.ts @@ -4,22 +4,22 @@ import { createWorkerDurableObject, } from "./worker-handler-do"; import { ConfigSchema, type InputConfig } from "./config"; -import { assertUnreachable } from "rivetkit/utils"; +import { assertUnreachable } from "@rivetkit/core/utils"; import { HEADER_AUTH_DATA, HEADER_CONN_PARAMS, HEADER_ENCODING, HEADER_EXPOSE_INTERNAL_ERROR, -} from "rivetkit/driver-helpers"; +} from "@rivetkit/core/driver-helpers"; import type { Hono } from "hono"; -import { PartitionTopologyManager } from "rivetkit/topologies/partition"; +import { PartitionTopologyManager } from "@rivetkit/core/topologies/partition"; import { logger } from "./log"; import { CloudflareWorkersManagerDriver } from "./manager-driver"; -import { Encoding, Registry, RunConfig } from "rivetkit"; +import { Encoding, Registry, RunConfig } from "@rivetkit/core"; import { upgradeWebSocket } from "./websocket"; import invariant from "invariant"; import { AsyncLocalStorage } from "node:async_hooks"; -import { InternalError } from "rivetkit/errors"; +import { InternalError } from "@rivetkit/core/errors"; /** Cloudflare Workers env */ export interface Bindings { diff --git a/packages/platforms/cloudflare-workers/src/log.ts b/packages/platforms/cloudflare-workers/src/log.ts index c5771efff..0f64c76ec 100644 --- a/packages/platforms/cloudflare-workers/src/log.ts +++ b/packages/platforms/cloudflare-workers/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "driver-cloudflare-workers"; diff --git a/packages/platforms/cloudflare-workers/src/manager-driver.ts b/packages/platforms/cloudflare-workers/src/manager-driver.ts index 3e5f54325..1a575ab92 100644 --- a/packages/platforms/cloudflare-workers/src/manager-driver.ts +++ b/packages/platforms/cloudflare-workers/src/manager-driver.ts @@ -5,8 +5,8 @@ import type { WorkerOutput, CreateInput, GetOrCreateWithKeyInput, -} from "rivetkit/driver-helpers"; -import { WorkerAlreadyExists } from "rivetkit/errors"; +} from "@rivetkit/core/driver-helpers"; +import { WorkerAlreadyExists } from "@rivetkit/core/errors"; import { Bindings } from "./mod"; import { logger } from "./log"; import { serializeNameAndKey, serializeKey } from "./util"; diff --git a/packages/platforms/cloudflare-workers/src/worker-driver.ts b/packages/platforms/cloudflare-workers/src/worker-driver.ts index 89a3b6a33..11054e212 100644 --- a/packages/platforms/cloudflare-workers/src/worker-driver.ts +++ b/packages/platforms/cloudflare-workers/src/worker-driver.ts @@ -1,4 +1,4 @@ -import { WorkerDriver, AnyWorkerInstance } from "rivetkit/driver-helpers"; +import { WorkerDriver, AnyWorkerInstance } from "@rivetkit/core/driver-helpers"; import invariant from "invariant"; import { KEYS } from "./worker-handler-do"; diff --git a/packages/platforms/cloudflare-workers/src/worker-handler-do.ts b/packages/platforms/cloudflare-workers/src/worker-handler-do.ts index 3767aaca6..0654b4c9d 100644 --- a/packages/platforms/cloudflare-workers/src/worker-handler-do.ts +++ b/packages/platforms/cloudflare-workers/src/worker-handler-do.ts @@ -1,7 +1,7 @@ import { DurableObject } from "cloudflare:workers"; -import type { Registry, RunConfig, WorkerKey } from "rivetkit"; +import type { Registry, RunConfig, WorkerKey } from "@rivetkit/core"; import { logger } from "./log"; -import { PartitionTopologyWorker } from "rivetkit/topologies/partition"; +import { PartitionTopologyWorker } from "@rivetkit/core/topologies/partition"; import { CloudflareDurableObjectGlobalState, CloudflareWorkersWorkerDriver, diff --git a/packages/platforms/cloudflare-workers/tests/driver-tests.test.ts b/packages/platforms/cloudflare-workers/tests/driver-tests.test.ts index 08415e3f3..da3e15e3f 100644 --- a/packages/platforms/cloudflare-workers/tests/driver-tests.test.ts +++ b/packages/platforms/cloudflare-workers/tests/driver-tests.test.ts @@ -1,11 +1,11 @@ -import { runDriverTests } from "rivetkit/driver-test-suite"; +import { runDriverTests } from "@rivetkit/core/driver-test-suite"; import fs from "node:fs/promises"; import path from "node:path"; import os from "node:os"; import { spawn, exec } from "node:child_process"; import crypto from "node:crypto"; import { promisify } from "node:util"; -import { getPort } from "rivetkit/test"; +import { getPort } from "@rivetkit/core/test"; const execPromise = promisify(exec); diff --git a/packages/platforms/nodejs/package.json b/packages/platforms/nodejs/package.json index 961562c67..8bc48b3e9 100644 --- a/packages/platforms/nodejs/package.json +++ b/packages/platforms/nodejs/package.json @@ -34,13 +34,13 @@ "peerDependencies": { "@rivetkit/file-system": "*", "@rivetkit/memory": "*", - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { "@rivetkit/file-system": "workspace:*", "@rivetkit/memory": "workspace:*", "hono": "^4.8.0", - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2" }, diff --git a/packages/platforms/nodejs/src/log.ts b/packages/platforms/nodejs/src/log.ts index 6d4105f9d..cea6d275d 100644 --- a/packages/platforms/nodejs/src/log.ts +++ b/packages/platforms/nodejs/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "nodejs"; diff --git a/packages/platforms/nodejs/src/mod.ts b/packages/platforms/nodejs/src/mod.ts index 82575b75e..09889e6b1 100644 --- a/packages/platforms/nodejs/src/mod.ts +++ b/packages/platforms/nodejs/src/mod.ts @@ -1,11 +1,11 @@ import { serve as honoServe, type ServerType } from "@hono/node-server"; import { logger } from "./log"; -import type { Registry } from "rivetkit"; +import type { Registry } from "@rivetkit/core"; import { z } from "zod"; -import type { Client } from "rivetkit/client"; +import type { Client } from "@rivetkit/core/client"; import { createNodeWebSocket, type NodeWebSocket } from "@hono/node-ws"; -import { RunConfigSchema } from "rivetkit/driver-helpers"; -import { RegistryWorkers } from "rivetkit"; +import { RunConfigSchema } from "@rivetkit/core/driver-helpers"; +import { RegistryWorkers } from "@rivetkit/core"; import { Hono } from "hono"; const ConfigSchema = RunConfigSchema.extend({ @@ -24,7 +24,7 @@ export type InputConfig = z.input; export function serve( registry: Registry, - inputConfig: InputConfig, + inputConfig?: InputConfig, ): { server: ServerType; client: Client> } { const runConfig = ConfigSchema.parse(inputConfig); diff --git a/packages/platforms/rivet/package.json b/packages/platforms/rivet/package.json index 6247d168a..e6252266c 100644 --- a/packages/platforms/rivet/package.json +++ b/packages/platforms/rivet/package.json @@ -48,7 +48,7 @@ "test": "vitest run" }, "peerDependencies": { - "rivetkit": "*" + "@rivetkit/core": "*" }, "devDependencies": { "@rivet-gg/actor-core": "^25.1.0", @@ -56,7 +56,7 @@ "@types/deno": "^2.0.0", "@types/invariant": "^2", "@types/node": "^22.13.1", - "rivetkit": "workspace:*", + "@rivetkit/core": "workspace:*", "tsup": "^8.4.0", "typescript": "^5.5.2", "vitest": "^3.1.1" diff --git a/packages/platforms/rivet/src/config.ts b/packages/platforms/rivet/src/config.ts index c98a03918..082a0b2db 100644 --- a/packages/platforms/rivet/src/config.ts +++ b/packages/platforms/rivet/src/config.ts @@ -1,4 +1,4 @@ -import { RunConfigSchema } from "rivetkit/driver-helpers"; +import { RunConfigSchema } from "@rivetkit/core/driver-helpers"; import { z } from "zod"; export const ConfigSchema = RunConfigSchema.omit({ diff --git a/packages/platforms/rivet/src/log.ts b/packages/platforms/rivet/src/log.ts index 1ad9a2899..1d4dc4b9a 100644 --- a/packages/platforms/rivet/src/log.ts +++ b/packages/platforms/rivet/src/log.ts @@ -1,4 +1,4 @@ -import { getLogger } from "rivetkit/log"; +import { getLogger } from "@rivetkit/core/log"; export const LOGGER_NAME = "driver-rivet"; diff --git a/packages/platforms/rivet/src/manager-driver.ts b/packages/platforms/rivet/src/manager-driver.ts index 33dae4fef..d18edcb75 100644 --- a/packages/platforms/rivet/src/manager-driver.ts +++ b/packages/platforms/rivet/src/manager-driver.ts @@ -1,5 +1,5 @@ -import { assertUnreachable } from "rivetkit/utils"; -import { WorkerAlreadyExists, InternalError } from "rivetkit/errors"; +import { assertUnreachable } from "@rivetkit/core/utils"; +import { WorkerAlreadyExists, InternalError } from "@rivetkit/core/errors"; import type { ManagerDriver, GetForIdInput, @@ -7,7 +7,7 @@ import type { WorkerOutput, GetOrCreateWithKeyInput, CreateInput, -} from "rivetkit/driver-helpers"; +} from "@rivetkit/core/driver-helpers"; import { logger } from "./log"; import { RivetActor, diff --git a/packages/platforms/rivet/src/manager.ts b/packages/platforms/rivet/src/manager.ts index 8c0014b31..f7d939bb3 100644 --- a/packages/platforms/rivet/src/manager.ts +++ b/packages/platforms/rivet/src/manager.ts @@ -1,14 +1,14 @@ -import { setupLogging } from "rivetkit/log"; +import { setupLogging } from "@rivetkit/core/log"; import { serve as honoServe } from "@hono/node-server"; import { createNodeWebSocket, NodeWebSocket } from "@hono/node-ws"; import { logger } from "./log"; import { GetWorkerMeta, RivetManagerDriver } from "./manager-driver"; import type { RivetClientConfig } from "./rivet-client"; -import { PartitionTopologyManager } from "rivetkit/topologies/partition"; +import { PartitionTopologyManager } from "@rivetkit/core/topologies/partition"; import { proxy } from "hono/proxy"; import invariant from "invariant"; import { ConfigSchema, InputConfig } from "./config"; -import type { Registry, RunConfig } from "rivetkit"; +import type { Registry, RunConfig } from "@rivetkit/core"; import { createWebSocketProxy } from "./ws-proxy"; import { flushCache, getWorkerMeta } from "./worker-meta"; import { @@ -16,8 +16,8 @@ import { HEADER_CONN_PARAMS, HEADER_ENCODING, HEADER_EXPOSE_INTERNAL_ERROR, -} from "rivetkit/driver-helpers"; -import { importWebSocket } from "rivetkit/driver-helpers/websocket"; +} from "@rivetkit/core/driver-helpers"; +import { importWebSocket } from "@rivetkit/core/driver-helpers/websocket"; import { RivetWorkerDriver } from "./worker-driver"; export async function startManager( diff --git a/packages/platforms/rivet/src/rivet-client.ts b/packages/platforms/rivet/src/rivet-client.ts index 4e39cbe0a..812059b37 100644 --- a/packages/platforms/rivet/src/rivet-client.ts +++ b/packages/platforms/rivet/src/rivet-client.ts @@ -1,4 +1,4 @@ -import { httpUserAgent } from "rivetkit/utils"; +import { httpUserAgent } from "@rivetkit/core/utils"; export interface RivetClientConfig { endpoint: string; diff --git a/packages/platforms/rivet/src/worker-driver.ts b/packages/platforms/rivet/src/worker-driver.ts index 6a1bad62e..f6453fb56 100644 --- a/packages/platforms/rivet/src/worker-driver.ts +++ b/packages/platforms/rivet/src/worker-driver.ts @@ -1,5 +1,5 @@ import { ActorContext } from "@rivet-gg/actor-core"; -import type { WorkerDriver, AnyWorkerInstance } from "rivetkit/driver-helpers"; +import type { WorkerDriver, AnyWorkerInstance } from "@rivetkit/core/driver-helpers"; export interface WorkerDriverContext { ctx: ActorContext; diff --git a/packages/platforms/rivet/src/worker-meta.ts b/packages/platforms/rivet/src/worker-meta.ts index ebe8e1f50..f3d570926 100644 --- a/packages/platforms/rivet/src/worker-meta.ts +++ b/packages/platforms/rivet/src/worker-meta.ts @@ -1,4 +1,4 @@ -import { assertUnreachable } from "rivetkit/utils"; +import { assertUnreachable } from "@rivetkit/core/utils"; import { RivetActor, RivetClientConfig, rivetRequest } from "./rivet-client"; import { deserializeKeyFromTag, convertKeyToRivetTags } from "./util"; import invariant from "invariant"; diff --git a/packages/platforms/rivet/src/worker.ts b/packages/platforms/rivet/src/worker.ts index d53317fde..2c67c8b6e 100644 --- a/packages/platforms/rivet/src/worker.ts +++ b/packages/platforms/rivet/src/worker.ts @@ -1,14 +1,14 @@ -import { setupLogging } from "rivetkit/log"; +import { setupLogging } from "@rivetkit/core/log"; import { upgradeWebSocket } from "hono/deno"; import { logger } from "./log"; import { deserializeKeyFromTag, type RivetHandler } from "./util"; -import { PartitionTopologyWorker } from "rivetkit/topologies/partition"; +import { PartitionTopologyWorker } from "@rivetkit/core/topologies/partition"; import { RivetWorkerDriver } from "./worker-driver"; import invariant from "invariant"; import type { ActorContext } from "@rivet-gg/actor-core"; -import { Registry, RunConfig } from "rivetkit"; +import { Registry, RunConfig } from "@rivetkit/core"; import { type Config, ConfigSchema, type InputConfig } from "./config"; -import { stringifyError } from "rivetkit/utils"; +import { stringifyError } from "@rivetkit/core/utils"; import { RivetManagerDriver } from "./manager-driver"; import { RivetClientConfig } from "./rivet-client"; diff --git a/packages/platforms/rivet/src/ws-proxy.ts b/packages/platforms/rivet/src/ws-proxy.ts index 12b75d094..e14d92608 100644 --- a/packages/platforms/rivet/src/ws-proxy.ts +++ b/packages/platforms/rivet/src/ws-proxy.ts @@ -2,7 +2,7 @@ import { WSContext } from "hono/ws"; import { logger } from "./log"; import invariant from "invariant"; import type { WebSocket, CloseEvent } from "ws"; -import { importWebSocket } from "rivetkit/driver-helpers/websocket"; +import { importWebSocket } from "@rivetkit/core/driver-helpers/websocket"; /** * Creates a WebSocket proxy to forward connections to a target endpoint diff --git a/packages/platforms/rivet/tests/deployment.test.ts b/packages/platforms/rivet/tests/deployment.test.ts index b8be2e214..f01cd0a3f 100644 --- a/packages/platforms/rivet/tests/deployment.test.ts +++ b/packages/platforms/rivet/tests/deployment.test.ts @@ -10,7 +10,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); // Simple counter worker definition to deploy const COUNTER_WORKER = ` -import { worker, setup } from "rivetkit"; +import { worker, setup } from "@rivetkit/core"; const counter = worker({ state: { count: 0 }, diff --git a/packages/platforms/rivet/tests/driver-tests.test.ts b/packages/platforms/rivet/tests/driver-tests.test.ts index ed0dfa74a..7036edf86 100644 --- a/packages/platforms/rivet/tests/driver-tests.test.ts +++ b/packages/platforms/rivet/tests/driver-tests.test.ts @@ -1,4 +1,4 @@ -import { runDriverTests } from "rivetkit/driver-test-suite"; +import { runDriverTests } from "@rivetkit/core/driver-test-suite"; import { deployToRivet, rivetClientConfig } from "./rivet-deploy"; import { RivetClientConfig, rivetRequest } from "../src/rivet-client"; import invariant from "invariant"; diff --git a/packages/rivetkit/README.md b/packages/rivetkit/README.md new file mode 100644 index 000000000..d3c3689d1 --- /dev/null +++ b/packages/rivetkit/README.md @@ -0,0 +1,13 @@ +# RivetKit + +_Lightweight Libraries for Backends_ + +**This is not the RivetKit you are looking for. See [`@rivetkit/worker`](https://www.npmjs.com/package/@rivetkit/core).** + +[Learn More →](https://github.com/rivet-gg/rivetkit) + +[Discord](https://rivet.gg/discord) — [Documentation](https://rivetkit.org) — [Issues](https://github.com/rivet-gg/rivetkit/issues) + +## License + +Apache 2.0 diff --git a/packages/rivetkit/package.json b/packages/rivetkit/package.json new file mode 100644 index 000000000..cca365769 --- /dev/null +++ b/packages/rivetkit/package.json @@ -0,0 +1,9 @@ +{ + "name": "rivetkit", + "version": "0.9.0-rc.1", + "description": "", + "keywords": [], + "author": "", + "license": "Apache-2.0", + "packageManager": "pnpm@10.7.1" +} diff --git a/packages/worker/package.json b/packages/worker/package.json new file mode 100644 index 000000000..12a7a1876 --- /dev/null +++ b/packages/worker/package.json @@ -0,0 +1,74 @@ +{ + "name": "@rivetkit/worker", + "version": "0.9.0-rc.1", + "keywords": ["rivetkit"], + "files": ["src", "dist", "package.json"], + "type": "module", + "exports": { + ".": { + "import": { + "types": "./dist/mod.d.ts", + "default": "./dist/mod.js" + }, + "require": { + "types": "./dist/mod.d.cts", + "default": "./dist/mod.cjs" + } + }, + "./client": { + "import": { + "types": "./dist/client.d.ts", + "default": "./dist/client.js" + }, + "require": { + "types": "./dist/client.d.cts", + "default": "./dist/client.cjs" + } + }, + "./log": { + "import": { + "types": "./dist/log.d.ts", + "default": "./dist/log.js" + }, + "require": { + "types": "./dist/log.d.cts", + "default": "./dist/log.cjs" + } + }, + "./errors": { + "import": { + "types": "./dist/errors.d.ts", + "default": "./dist/errors.js" + }, + "require": { + "types": "./dist/errors.d.cts", + "default": "./dist/errors.cjs" + } + }, + "./test": { + "import": { + "types": "./dist/test.d.ts", + "default": "./dist/test.js" + }, + "require": { + "types": "./dist/test.d.cts", + "default": "./dist/test.cjs" + } + } + }, + "sideEffects": false, + "scripts": { + "build": "tsup src/mod.ts src/client.ts src/log.ts src/errors.ts src/test.ts", + "check-types": "tsc --noEmit", + "test": "vitest run" + }, + "devDependencies": { + "@types/node": "^22.14.0", + "tsup": "^8.4.0", + "typescript": "^5.5.2" + }, + "dependencies": { + "@rivetkit/core": "workspace:*" + }, + "stableVersion": "0.8.0" +} diff --git a/packages/worker/src/client.ts b/packages/worker/src/client.ts new file mode 100644 index 000000000..d4603cb52 --- /dev/null +++ b/packages/worker/src/client.ts @@ -0,0 +1 @@ +export * from "@rivetkit/core/client"; diff --git a/packages/worker/src/errors.ts b/packages/worker/src/errors.ts new file mode 100644 index 000000000..ef2b8676a --- /dev/null +++ b/packages/worker/src/errors.ts @@ -0,0 +1 @@ +export * from "@rivetkit/core/errors"; diff --git a/packages/worker/src/log.ts b/packages/worker/src/log.ts new file mode 100644 index 000000000..dd1ff77fe --- /dev/null +++ b/packages/worker/src/log.ts @@ -0,0 +1 @@ +export * from "@rivetkit/core/log"; diff --git a/packages/worker/src/mod.ts b/packages/worker/src/mod.ts new file mode 100644 index 000000000..d00787ee2 --- /dev/null +++ b/packages/worker/src/mod.ts @@ -0,0 +1 @@ +export * from "@rivetkit/core"; diff --git a/packages/worker/src/test.ts b/packages/worker/src/test.ts new file mode 100644 index 000000000..1356b6872 --- /dev/null +++ b/packages/worker/src/test.ts @@ -0,0 +1 @@ +export * from "@rivetkit/core/test"; diff --git a/packages/worker/tsconfig.json b/packages/worker/tsconfig.json new file mode 100644 index 000000000..85dfb2317 --- /dev/null +++ b/packages/worker/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["src/**/*", "test/**/*"] +} diff --git a/packages/worker/tsup.config.ts b/packages/worker/tsup.config.ts new file mode 100644 index 000000000..0eea6200a --- /dev/null +++ b/packages/worker/tsup.config.ts @@ -0,0 +1,4 @@ +import defaultConfig from "../../tsup.base.ts"; +import { defineConfig } from "tsup"; + +export default defineConfig(defaultConfig); diff --git a/packages/worker/turbo.json b/packages/worker/turbo.json new file mode 100644 index 000000000..95960709b --- /dev/null +++ b/packages/worker/turbo.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6900a7393..1d12afb07 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,6 +73,9 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.3.1) devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 @@ -88,9 +91,6 @@ importers: concurrently: specifier: ^8.2.2 version: 8.2.2 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -110,6 +110,9 @@ importers: specifier: workspace:* version: link:../../packages/platforms/nodejs devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 @@ -119,9 +122,6 @@ importers: prompts: specifier: ^2.4.2 version: 2.4.2 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -141,12 +141,12 @@ importers: '@cloudflare/workers-types': specifier: ^4.20250129.0 version: 4.20250619.0 + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -163,12 +163,12 @@ importers: specifier: workspace:* version: link:../../packages/platforms/nodejs devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -197,12 +197,12 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.3.1) devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core typescript: specifier: ^5.5.2 version: 5.8.3 @@ -225,15 +225,15 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.3.1) devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/express': specifier: ^4.17.21 version: 4.17.23 '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -253,12 +253,12 @@ importers: specifier: ^4.7.0 version: 4.8.0 devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -287,6 +287,9 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.3.1) devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 @@ -302,9 +305,6 @@ importers: concurrently: specifier: ^8.2.2 version: 8.2.2 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -327,12 +327,12 @@ importers: specifier: workspace:0.9.0-rc.1 version: link:../../packages/platforms/nodejs devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -358,6 +358,9 @@ importers: specifier: ^18.2.0 version: 18.2.0(react@18.3.1) devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 @@ -373,9 +376,6 @@ importers: concurrently: specifier: ^8.2.2 version: 8.2.2 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -394,9 +394,9 @@ importers: '@rivetkit/rivet': specifier: https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/rivet@65c3659 version: https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/rivet@65c3659(rivetkit@https://pkg.pr.new/rivet-gg/rivetkit@65c3659(@hono/node-server@1.14.4(hono@4.8.0))(@hono/node-ws@1.1.7(@hono/node-server@1.14.4(hono@4.8.0))(hono@4.8.0))(eventsource@3.0.7)(ws@8.18.2)) - rivetkit: + '@rivetkit/worker': specifier: https://pkg.pr.new/rivet-gg/rivetkit@65c3659 - version: https://pkg.pr.new/rivet-gg/rivetkit@65c3659(@hono/node-server@1.14.4(hono@4.8.0))(@hono/node-ws@1.1.7(@hono/node-server@1.14.4(hono@4.8.0))(hono@4.8.0))(eventsource@3.0.7)(ws@8.18.2) + version: rivetkit@https://pkg.pr.new/rivet-gg/rivetkit@65c3659(@hono/node-server@1.14.4(hono@4.8.0))(@hono/node-ws@1.1.7(@hono/node-server@1.14.4(hono@4.8.0))(hono@4.8.0))(eventsource@3.0.7)(ws@8.18.2) devDependencies: '@types/node': specifier: ^22.13.9 @@ -423,12 +423,12 @@ importers: specifier: ^3.24.1 version: 3.25.67 devDependencies: + '@rivetkit/worker': + specifier: workspace:* + version: link:../../packages/worker '@types/node': specifier: ^22.13.9 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../packages/core tsx: specifier: ^3.12.7 version: 3.14.0 @@ -512,15 +512,15 @@ importers: specifier: ^2.2.4 version: 2.2.4 devDependencies: + '@rivetkit/core': + specifier: workspace:* + version: link:../../core '@types/invariant': specifier: ^2 version: 2.2.37 '@types/node': specifier: ^22.14.0 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../core tsup: specifier: ^8.4.0 version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@22.15.32))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) @@ -543,7 +543,7 @@ importers: specifier: ^3.1.1 version: 3.2.4(@types/node@22.15.32)(@vitest/ui@3.1.1)(tsx@4.20.3)(yaml@2.8.0) devDependencies: - rivetkit: + '@rivetkit/core': specifier: workspace:* version: link:../../core tsup: @@ -574,7 +574,7 @@ importers: specifier: ^7.2.3 version: 7.2.3 devDependencies: - rivetkit: + '@rivetkit/core': specifier: workspace:* version: link:../../core tsup: @@ -593,7 +593,7 @@ importers: specifier: ^0.7.1 version: 0.7.1 devDependencies: - rivetkit: + '@rivetkit/core': specifier: workspace:* version: link:../../core typescript: @@ -624,15 +624,15 @@ importers: specifier: ^19.0.0 version: 19.1.0(react@19.1.0) devDependencies: + '@rivetkit/core': + specifier: workspace:^ + version: link:../../core '@types/react': specifier: ^19.1.8 version: 19.1.8 '@types/react-dom': specifier: ^19.1.6 version: 19.1.6(@types/react@19.1.8) - rivetkit: - specifier: workspace:^ - version: link:../../core tsup: specifier: ^8.4.0 version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@24.0.3))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) @@ -677,15 +677,15 @@ importers: '@cloudflare/workers-types': specifier: ^4.20250129.0 version: 4.20250619.0 + '@rivetkit/core': + specifier: workspace:* + version: link:../../core '@types/invariant': specifier: ^2 version: 2.2.37 '@types/node': specifier: ^24.0.3 version: 24.0.3 - rivetkit: - specifier: workspace:* - version: link:../../core tsup: specifier: ^8.4.0 version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@24.0.3))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) @@ -714,6 +714,9 @@ importers: specifier: ^3.24.2 version: 3.25.67 devDependencies: + '@rivetkit/core': + specifier: workspace:* + version: link:../../core '@rivetkit/file-system': specifier: workspace:* version: link:../../drivers/file-system @@ -723,9 +726,6 @@ importers: hono: specifier: ^4.7.0 version: 4.8.0 - rivetkit: - specifier: workspace:* - version: link:../../core tsup: specifier: ^8.4.0 version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@24.0.3))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) @@ -757,6 +757,9 @@ importers: '@rivet-gg/api': specifier: ^25.4.2 version: 25.4.2 + '@rivetkit/core': + specifier: workspace:* + version: link:../../core '@types/deno': specifier: ^2.0.0 version: 2.3.0 @@ -766,9 +769,6 @@ importers: '@types/node': specifier: ^22.13.1 version: 22.15.32 - rivetkit: - specifier: workspace:* - version: link:../../core tsup: specifier: ^8.4.0 version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@22.15.32))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) @@ -779,6 +779,24 @@ importers: specifier: ^3.1.1 version: 3.2.4(@types/node@22.15.32)(@vitest/ui@3.1.1)(tsx@4.20.3)(yaml@2.8.0) + packages/rivetkit: {} + + packages/worker: + dependencies: + '@rivetkit/core': + specifier: workspace:* + version: link:../core + devDependencies: + '@types/node': + specifier: ^22.14.0 + version: 22.15.32 + tsup: + specifier: ^8.4.0 + version: 8.5.0(@microsoft/api-extractor@7.52.8(@types/node@22.15.32))(postcss@8.5.6)(tsx@4.20.3)(typescript@5.8.3)(yaml@2.8.0) + typescript: + specifier: ^5.5.2 + version: 5.8.3 + packages: '@ampproject/remapping@2.3.0':