Add @snowluma/websocket TS package and integrate

Introduce an in-tree TypeScript WebSocket package (@snowluma/websocket): move JS websocket implementation into packages/websocket/src (client, server, websocket, extensions, native, index) and add package.json + tsconfig. Replace direct 'ws' dependency in core with the workspace package and update runtime manifest/description. Implement a native addon loader for platform-specific binaries, add typings/refinements across client/server/websocket (more strict types, handshake parsing, permessage-deflate plumbing, buffer/raw data handling), and wire WebSocketClient as the package default export while exposing internal types. Update vite config to bundle the new package and copy only platform-target native binaries into dist/native. Remove legacy JS entrypoints and native loader, and adjust imports/usages in core (ws-transport) to accept broader raw data types.
This commit is contained in:
手瓜一十雪 committed 2026-05-03 15:49:42 +08:00
1 parent 5fb969da7c
commit 252a65b833
15 files changed
+645 -436

No files matched your search

+1 -2
View File
@@ -14,13 +14,12 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"ws": "^8.20.0"
"@snowluma/websocket": "workspace:*"
},
"devDependencies": {
"@hono/node-server": "^1.19.14",
"@rollup/plugin-node-resolve": "^16.0.3",
"@types/node": "^24.12.2",
"@types/ws": "^8.18.1",
"cross-env": "^10.1.0",
"hono": "^4.12.14",
"tsx": "^4.21.0",