New sub-path export @alkdev/pubsub/call providing:
- CallEventSchema (TypeBox schemas) for call.requested/responded/part/completed/aborted/error
- PendingRequestMap with call() (request/response) and subscribe() (streaming via Repeater)
- CallError class and CallErrorCode constants
- Scoped topic subscriptions (call.responded:{requestId}) to avoid O(n) fanout
- subscribe() yields call.part events until call.completed or call.error,
with automatic call.aborted on consumer break
Also adds @alkdev/typebox as runtime dependency and architecture doc.
88 lines
1.9 KiB
JSON
88 lines
1.9 KiB
JSON
{
|
|
"name": "@alkdev/pubsub",
|
|
"version": "0.1.0",
|
|
"description": "Type-safe publish/subscribe with pluggable event target adapters (in-process, Redis, WebSocket, Iroh)",
|
|
"type": "module",
|
|
"main": "./dist/index.cjs",
|
|
"module": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"import": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"require": {
|
|
"types": "./dist/index.d.cts",
|
|
"default": "./dist/index.cjs"
|
|
}
|
|
},
|
|
"./event-target-redis": {
|
|
"import": {
|
|
"types": "./dist/event-target-redis.d.ts",
|
|
"default": "./dist/event-target-redis.js"
|
|
},
|
|
"require": {
|
|
"types": "./dist/event-target-redis.d.cts",
|
|
"default": "./dist/event-target-redis.cjs"
|
|
}
|
|
},
|
|
"./call": {
|
|
"import": {
|
|
"types": "./dist/call.d.ts",
|
|
"default": "./dist/call.js"
|
|
},
|
|
"require": {
|
|
"types": "./dist/call.d.cts",
|
|
"default": "./dist/call.cjs"
|
|
}
|
|
}
|
|
},
|
|
"publishConfig": {
|
|
"access": "public"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"scripts": {
|
|
"build": "tsup",
|
|
"build:tsc": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:coverage": "vitest run --coverage",
|
|
"lint": "tsc --noEmit",
|
|
"prepublishOnly": "npm run build"
|
|
},
|
|
"keywords": [
|
|
"pubsub",
|
|
"typed-event-target",
|
|
"redis",
|
|
"websocket",
|
|
"iroh",
|
|
"quic"
|
|
],
|
|
"license": "MIT OR Apache-2.0",
|
|
"dependencies": {
|
|
"@alkdev/typebox": "^0.34.49"
|
|
},
|
|
"peerDependencies": {
|
|
"ioredis": "^5.0.0"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"ioredis": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"@vitest/coverage-v8": "^3.2.4",
|
|
"ioredis": "^5.10.1",
|
|
"tsup": "^8.5.1",
|
|
"typescript": "^5.7.0",
|
|
"vitest": "^3.1.0"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
}
|
|
}
|