Skip to content

Commit

Permalink
refactor: add /adapters/uws
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 24, 2024
1 parent b67bef0 commit b51b01c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
"types": "./dist/adapters/node.d.ts",
"import": "./dist/adapters/node.mjs",
"require": "./dist/adapters/node.cjs"
},
"./adapters/uws": {
"types": "./dist/adapters/uws.d.ts",
"import": "./dist/adapters/uws.mjs",
"require": "./dist/adapters/uws.cjs"
}
},
"main": "./dist/index.cjs",
Expand All @@ -61,18 +66,21 @@
],
"scripts": {
"build": "unbuild",
"play:ws": "jiti playground/node-ws.ts",
"play:uws": "jiti playground/node-uws.ts",
"play:bun": "bun playground/bun.ts",
"play:deno": "deno run -A playground/deno.ts",
"play:cf": "wrangler dev --port 3001",
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src",
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src -w",
"prepack": "pnpm run build",
"play:bun": "bun playground/bun.ts",
"play:cf": "wrangler dev --port 3001",
"play:deno": "deno run -A playground/deno.ts",
"play:node": "jiti playground/node.ts",
"play:uws": "jiti playground/uws.ts",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types",
"test:types": "tsc --noEmit --skipLibCheck"
},
"resolutions": {
"crossws": "workspace:*"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240117.0",
"@deno/types": "^0.0.1",
Expand All @@ -94,8 +102,5 @@
"wrangler": "^3.25.0",
"ws": "^8.16.0"
},
"resolutions": {
"crossws": "workspace:*"
},
"packageManager": "pnpm@8.15.0"
}
File renamed without changes.
6 changes: 3 additions & 3 deletions playground/node-uws.ts → playground/uws.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// You can run this demo using `npm run play:node-uws` in repo

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

const adapter = createDemo(nodeAdapter);
const adapter = createDemo(uwsAdapter);

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

Expand Down
File renamed without changes.

0 comments on commit b51b01c

Please sign in to comment.