@forinda/kickjs-ws 1.2.12 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +14 -4
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @forinda/kickjs-ws
2
+
3
+ WebSocket support with decorators, namespaces, rooms, and DI integration for KickJS.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # Using the KickJS CLI (recommended — auto-installs peer dependencies)
9
+ kick add ws
10
+
11
+ # Manual install
12
+ pnpm add @forinda/kickjs-ws ws
13
+ ```
14
+
15
+ ## Features
16
+
17
+ - `WsAdapter` — lifecycle adapter that attaches a WebSocket server to your app
18
+ - Decorator-driven handlers: `@WsController`, `@OnConnect`, `@OnDisconnect`, `@OnMessage`, `@OnError`
19
+ - `WsContext` — typed context for WebSocket handlers
20
+ - `RoomManager` — built-in room/namespace management
21
+
22
+ ## Quick Example
23
+
24
+ ```typescript
25
+ import { WsAdapter, WsController, OnConnect, OnMessage, WsContext } from '@forinda/kickjs-ws'
26
+
27
+ @WsController('/chat')
28
+ class ChatHandler {
29
+ @OnConnect()
30
+ onConnect(ctx: WsContext) {
31
+ console.log('Client connected')
32
+ }
33
+
34
+ @OnMessage('message')
35
+ onMessage(ctx: WsContext) {
36
+ ctx.broadcast(ctx.data)
37
+ }
38
+ }
39
+
40
+ // In bootstrap
41
+ bootstrap({
42
+ modules,
43
+ adapters: [new WsAdapter()],
44
+ })
45
+ ```
46
+
47
+ ## Documentation
48
+
49
+ [Full documentation](https://forinda.github.io/kick-js/guide/websockets)
50
+
51
+ ## License
52
+
53
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forinda/kickjs-ws",
3
- "version": "1.2.12",
3
+ "version": "1.3.0",
4
4
  "description": "WebSocket support with decorators, namespaces, rooms, and DI integration for KickJS",
5
5
  "keywords": [
6
6
  "kickjs",
@@ -13,10 +13,11 @@
13
13
  "api",
14
14
  "framework",
15
15
  "websocket",
16
- "ws",
16
+ "socket.io",
17
17
  "realtime",
18
18
  "rooms",
19
19
  "namespaces",
20
+ "heartbeat",
20
21
  "@forinda/kickjs-core",
21
22
  "@forinda/kickjs-http",
22
23
  "@forinda/kickjs-config",
@@ -24,7 +25,16 @@
24
25
  "@forinda/kickjs-swagger",
25
26
  "@forinda/kickjs-testing",
26
27
  "@forinda/kickjs-prisma",
27
- "@forinda/kickjs-ws"
28
+ "@forinda/kickjs-drizzle",
29
+ "@forinda/kickjs-otel",
30
+ "@forinda/kickjs-graphql",
31
+ "@forinda/kickjs-auth",
32
+ "@forinda/kickjs-cron",
33
+ "@forinda/kickjs-mailer",
34
+ "@forinda/kickjs-queue",
35
+ "@forinda/kickjs-multi-tenant",
36
+ "@forinda/kickjs-devtools",
37
+ "@forinda/kickjs-notifications"
28
38
  ],
29
39
  "type": "module",
30
40
  "main": "dist/index.js",
@@ -41,7 +51,7 @@
41
51
  "dependencies": {
42
52
  "reflect-metadata": "^0.2.2",
43
53
  "ws": "^8.18.0",
44
- "@forinda/kickjs-core": "1.2.12"
54
+ "@forinda/kickjs-core": "1.3.0"
45
55
  },
46
56
  "devDependencies": {
47
57
  "@swc/core": "^1.7.28",