4 Commits

Author SHA1 Message Date
cef6ce750e v1.1.2
Some checks failed
Default (tags) / security (push) Successful in 32s
Default (tags) / test (push) Failing after 35s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-03 23:53:47 +00:00
d341fc270d fix(deps): Bump dependency versions for build and runtime tools 2025-12-03 23:53:47 +00:00
a9972ad0ce v1.1.1
Some checks failed
Default (tags) / security (push) Successful in 38s
Default (tags) / test (push) Failing after 36s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-12-03 23:47:46 +00:00
b3c77eb675 fix(adapters): Attach WebSocket peer to typedRouter request localData and add ws dependency 2025-12-03 23:47:46 +00:00
7 changed files with 384 additions and 344 deletions

View File

@@ -1,5 +1,18 @@
# Changelog
## 2025-12-03 - 1.1.2 - fix(deps)
Bump dependency versions for build and runtime tools
- Update devDependency @git.zone/tsbundle from ^2.0.5 to ^2.6.3
- Update devDependency @types/node from ^20.8.7 to ^24.10.1
- Update dependency @api.global/typedrequest from ^3.0.0 to ^3.1.11
## 2025-12-03 - 1.1.1 - fix(adapters)
Attach WebSocket peer to typedRouter request localData and add ws dependency
- When routing incoming WebSocket messages through TypedRouter (node/deno/bun), the connection peer is now attached to requestObj.localData so typed handlers can access the active connection.
- Add runtime dependency on "ws" to enable WebSocket support in the Node adapter (used by dynamic import in the adapter).
## 2025-12-02 - 1.1.0 - feat(websocket)
Add TypedRouter WebSocket integration, connection registry, peer tagging and broadcast APIs

View File

@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartserve",
"version": "1.1.0",
"version": "1.1.2",
"private": false,
"description": "a cross platform server module for Node, Deno and Bun",
"exports": {
@@ -16,19 +16,20 @@
},
"devDependencies": {
"@git.zone/tsbuild": "^3.1.2",
"@git.zone/tsbundle": "^2.0.5",
"@git.zone/tsbundle": "^2.6.3",
"@git.zone/tsrun": "^2.0.0",
"@git.zone/tstest": "^3.1.3",
"@push.rocks/tapbundle": "^6.0.3",
"@types/node": "^20.8.7",
"@types/node": "^24.10.1",
"@types/ws": "^8.18.1"
},
"dependencies": {
"@api.global/typedrequest": "^3.0.0",
"@api.global/typedrequest": "^3.1.11",
"@push.rocks/lik": "^6.2.2",
"@push.rocks/smartenv": "^6.0.0",
"@push.rocks/smartlog": "^3.1.10",
"@push.rocks/smartpath": "^6.0.0"
"@push.rocks/smartpath": "^6.0.0",
"ws": "^8.18.0"
},
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
"repository": {

696
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartserve',
version: '1.1.0',
version: '1.1.2',
description: 'a cross platform server module for Node, Deno and Bun'
}

View File

@@ -137,6 +137,8 @@ export class BunAdapter extends BaseAdapter {
if (typedRouter && typeof message === 'string') {
try {
const requestObj = JSON.parse(message);
// Attach peer to localData so TypedHandlers can access the connection
requestObj.localData = { ...requestObj.localData, peer };
const response = await typedRouter.routeAndAddResponse(requestObj);
if (response) {
peer.send(JSON.stringify(response));

View File

@@ -115,6 +115,8 @@ export class DenoAdapter extends BaseAdapter {
if (typedRouter && typeof event.data === 'string') {
try {
const requestObj = JSON.parse(event.data);
// Attach peer to localData so TypedHandlers can access the connection
requestObj.localData = { ...requestObj.localData, peer };
const response = await typedRouter.routeAndAddResponse(requestObj);
if (response) {
peer.send(JSON.stringify(response));

View File

@@ -283,6 +283,8 @@ export class NodeAdapter extends BaseAdapter {
try {
const messageText = typeof data === 'string' ? data : data.toString('utf8');
const requestObj = JSON.parse(messageText);
// Attach peer to localData so TypedHandlers can access the connection
requestObj.localData = { ...requestObj.localData, peer };
const response = await typedRouter.routeAndAddResponse(requestObj);
if (response) {
peer.send(JSON.stringify(response));