Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@partyserver/fixture-*"]
"ignore": ["@partyserver/fixture-*"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
33 changes: 0 additions & 33 deletions .github/workflows/opencode.yml

This file was deleted.

4 changes: 2 additions & 2 deletions fixtures/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"nanoid": "^5.1.6",
"partyserver": "^0.2.0",
"partysocket": "^1.1.14",
"partyserver": "^0.3.0",
"partysocket": "^1.1.15",
"react": "^19.2.3",
"react-dom": "^19.2.3"
},
Expand Down
4 changes: 2 additions & 2 deletions fixtures/globe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"cobe": "^0.6.5",
"partyserver": "^0.2.0",
"partysocket": "^1.1.14",
"partyserver": "^0.3.0",
"partysocket": "^1.1.15",
"react": "^19.2.3",
"react-dom": "^19.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion fixtures/globe/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1", // Should be unique for each entry
"new_classes": ["Globe"]
"new_sqlite_classes": ["Globe"]
}
]
}
6 changes: 3 additions & 3 deletions fixtures/hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
},
"dependencies": {
"hono": "^4.11.1",
"hono-party": "^2.0.0",
"partyserver": "^0.2.0",
"partysocket": "^1.1.14",
"hono-party": "^2.0.1",
"partyserver": "^0.3.0",
"partysocket": "^1.1.15",
"react": "^19.2.3",
"react-dom": "^19.2.3"
},
Expand Down
24 changes: 21 additions & 3 deletions fixtures/hono/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ import { Server } from "partyserver";

import type { Connection, WSMessage } from "partyserver";

// Multiple party servers
type Bindings = {
Chat: DurableObjectNamespace;
};

export class Chat extends Server {
onMessage(connection: Connection, message: WSMessage): void | Promise<void> {
console.log("onMessage", message);
this.broadcast(message, [connection.id]);
}
}

const app = new Hono();
app.use("*", partyserverMiddleware());
const app = new Hono<{ Bindings: Bindings }>();

app.use(
"*",
partyserverMiddleware<{ Bindings: Bindings }>({
options: {
onBeforeConnect(req, _lobby, c) {
const url = new URL(req.url);
const token = url.searchParams.get("token");
if (!token) {
return new Response("Unauthorized", { status: 401 });
}
console.log("env bindings available:", Object.keys(c.env));
}
}
})
);

app.get("/", (c) => c.text("Hello from Hono!"));

Expand Down
2 changes: 1 addition & 1 deletion fixtures/hono/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1", // Should be unique for each entry
"new_classes": ["Chat"]
"new_sqlite_classes": ["Chat"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/lexical-yjs/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1",
"new_classes": ["LexicalDocument"]
"new_sqlite_classes": ["LexicalDocument"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/monaco-yjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"monaco-editor": "^0.55.1",
"partysocket": "^1.1.14",
"partysocket": "^1.1.15",
"y-monaco": "^0.1.6"
}
}
2 changes: 1 addition & 1 deletion fixtures/monaco-yjs/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1",
"new_classes": ["MonacoServer"]
"new_sqlite_classes": ["MonacoServer"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"types": "wrangler types env.d.ts --include-runtime false"
},
"dependencies": {
"partysocket": "^1.1.14"
"partysocket": "^1.1.15"
}
}
2 changes: 1 addition & 1 deletion fixtures/node/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"migrations": [
{
"tag": "v1",
"new_classes": ["MyServer"]
"new_sqlite_classes": ["MyServer"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"dependencies": {
"nanoid": "^5.1.6",
"partysocket": "^1.1.14"
"partysocket": "^1.1.15"
}
}
2 changes: 1 addition & 1 deletion fixtures/pubsub/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1",
"new_classes": ["PubSubServer"]
"new_sqlite_classes": ["PubSubServer"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/rpc-sanity/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"migrations": [
{
"tag": "v1",
"new_classes": ["MyServer"]
"new_sqlite_classes": ["MyServer"]
}
]
}
2 changes: 1 addition & 1 deletion fixtures/tiptap-yjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@tiptap/extension-collaboration": "^3.14.0",
"@tiptap/react": "^3.14.0",
"@tiptap/starter-kit": "^3.14.0",
"partyserver": "^0.2.0",
"partyserver": "^0.3.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"tailwindcss": "^4.1.18",
Expand Down
4 changes: 2 additions & 2 deletions fixtures/tldraw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"start": "vite dev"
},
"dependencies": {
"partyserver": "^0.2.0",
"partysocket": "^1.1.14",
"partyserver": "^0.3.0",
"partysocket": "^1.1.15",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"tldraw": "^4.2.1"
Expand Down
2 changes: 1 addition & 1 deletion fixtures/tldraw/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"migrations": [
{
"tag": "v1", // Should be unique for each entry
"new_classes": ["Tldraw"]
"new_sqlite_classes": ["Tldraw"]
}
]
}
4 changes: 2 additions & 2 deletions fixtures/todo-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"nanoid": "^5.1.6",
"partyserver": "^0.2.0",
"partysocket": "^1.1.14",
"partyserver": "^0.3.0",
"partysocket": "^1.1.15",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"valibot": "^1.2.0"
Expand Down
Loading
Loading