Skip to content

Commit 05c0f06

Browse files
authored
chore: update srvx version & usage (#178)
1 parent 440a088 commit 05c0f06

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"jiti": "^2.4.2",
8888
"listhen": "^1.9.0",
8989
"prettier": "^3.5.3",
90-
"srvx": "^0.7.1",
90+
"srvx": "^0.10.1",
9191
"typescript": "^5.8.3",
9292
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.44.0",
9393
"unbuild": "^3.5.0",
@@ -111,6 +111,12 @@
111111
"esbuild",
112112
"sharp",
113113
"workerd"
114+
],
115+
"onlyBuiltDependencies": [
116+
"@parcel/watcher",
117+
"esbuild",
118+
"sharp",
119+
"workerd"
114120
]
115121
}
116122
}

pnpm-lock.yaml

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/_types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import type {
2-
Server,
3-
ServerPlugin,
4-
ServerOptions,
5-
ServerRequest,
6-
} from "srvx/types";
1+
import type { Server, ServerPlugin, ServerOptions, ServerRequest } from "srvx";
72

83
import type { Hooks } from "../hooks";
94

src/server/bun.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { serve as srvxServe } from "srvx/bun";
22
import adapter from "../adapters/bun";
33

4-
import type { Server, ServerPlugin } from "srvx/types";
4+
import type { Server, ServerPlugin } from "srvx";
55
import type { WSOptions, ServerWithWSOptions } from "./_types";
66

77
export function plugin(wsOpts: WSOptions): ServerPlugin {
@@ -23,11 +23,9 @@ export function plugin(wsOpts: WSOptions): ServerPlugin {
2323
});
2424

2525
server.options.bun ??= {};
26-
// @ts-expect-error
2726
if (server.options.bun.websocket) {
2827
throw new Error("websocket handlers for bun already set!");
2928
}
30-
// @ts-expect-error
3129
server.options.bun.websocket = ws.websocket;
3230
};
3331
}

src/server/cloudflare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { serve as srvxServe } from "srvx/cloudflare";
22
import adapter from "../adapters/cloudflare";
33

4-
import type { Server, ServerPlugin } from "srvx/types";
4+
import type { Server, ServerPlugin } from "srvx";
55
import type { WSOptions, ServerWithWSOptions } from "./_types";
66

77
export function plugin(wsOpts: WSOptions): ServerPlugin {

src/server/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { serve as srvxServe } from "srvx";
22
import adapter from "../adapters/sse";
33

4-
import type { Server, ServerPlugin } from "srvx/types";
4+
import type { Server, ServerPlugin } from "srvx";
55
import type { WSOptions, ServerWithWSOptions } from "./_types";
66

77
export function plugin(wsOpts: WSOptions): ServerPlugin {

src/server/deno.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { serve as srvxServe } from "srvx/deno";
22
import adapter from "../adapters/deno";
33

4-
import type { Server, ServerPlugin } from "srvx/types";
4+
import type { Server, ServerPlugin } from "srvx";
55
import type { WSOptions, ServerWithWSOptions } from "./_types";
66

77
export function plugin(wsOpts: WSOptions): ServerPlugin {

src/server/node.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { serve as srvxServe, NodeRequest } from "srvx/node";
22
import adapter from "../adapters/node";
33

4-
import type { Server, ServerPlugin } from "srvx/types";
4+
import type { Server, ServerPlugin } from "srvx";
55
import type { WSOptions, ServerWithWSOptions } from "./_types";
66

77
export function plugin(wsOpts: WSOptions): ServerPlugin {
@@ -11,9 +11,7 @@ export function plugin(wsOpts: WSOptions): ServerPlugin {
1111
resolve: wsOpts.resolve,
1212
...wsOpts.options?.deno,
1313
});
14-
// @ts-expect-error
1514
const originalServe = server.serve;
16-
// @ts-expect-error
1715
server.serve = () => {
1816
server.node?.server!.on("upgrade", (req, socket, head) => {
1917
ws.handleUpgrade(

0 commit comments

Comments
 (0)