Skip to content

Commit b51b01c

Browse files
committed
refactor: add /adapters/uws
1 parent b67bef0 commit b51b01c

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
"types": "./dist/adapters/node.d.ts",
5050
"import": "./dist/adapters/node.mjs",
5151
"require": "./dist/adapters/node.cjs"
52+
},
53+
"./adapters/uws": {
54+
"types": "./dist/adapters/uws.d.ts",
55+
"import": "./dist/adapters/uws.mjs",
56+
"require": "./dist/adapters/uws.cjs"
5257
}
5358
},
5459
"main": "./dist/index.cjs",
@@ -61,18 +66,21 @@
6166
],
6267
"scripts": {
6368
"build": "unbuild",
64-
"play:ws": "jiti playground/node-ws.ts",
65-
"play:uws": "jiti playground/node-uws.ts",
66-
"play:bun": "bun playground/bun.ts",
67-
"play:deno": "deno run -A playground/deno.ts",
68-
"play:cf": "wrangler dev --port 3001",
6969
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src",
7070
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src -w",
7171
"prepack": "pnpm run build",
72+
"play:bun": "bun playground/bun.ts",
73+
"play:cf": "wrangler dev --port 3001",
74+
"play:deno": "deno run -A playground/deno.ts",
75+
"play:node": "jiti playground/node.ts",
76+
"play:uws": "jiti playground/uws.ts",
7277
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
7378
"test": "pnpm lint && pnpm test:types",
7479
"test:types": "tsc --noEmit --skipLibCheck"
7580
},
81+
"resolutions": {
82+
"crossws": "workspace:*"
83+
},
7684
"devDependencies": {
7785
"@cloudflare/workers-types": "^4.20240117.0",
7886
"@deno/types": "^0.0.1",
@@ -94,8 +102,5 @@
94102
"wrangler": "^3.25.0",
95103
"ws": "^8.16.0"
96104
},
97-
"resolutions": {
98-
"crossws": "workspace:*"
99-
},
100105
"packageManager": "pnpm@8.15.0"
101106
}
File renamed without changes.

playground/node-uws.ts renamed to playground/uws.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// You can run this demo using `npm run play:node-uws` in repo
22

33
import { App } from "uWebSockets.js";
4-
import nodeAdapter from "../src/adapters/node-uws.ts";
5-
import { createDemo, getIndexHTML } from "./_common";
4+
import uwsAdapter from "../src/adapters/uws.ts";
5+
import { createDemo, getIndexHTML } from "./_common.ts";
66

7-
const adapter = createDemo(nodeAdapter);
7+
const adapter = createDemo(uwsAdapter);
88

99
const app = App().ws("/*", adapter.websocket);
1010

File renamed without changes.

0 commit comments

Comments
 (0)