@pluv/platform-pluv 0.30.1 → 0.31.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/platform-pluv@0.30.1 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@0.31.0 build /home/runner/work/pluv/pluv/packages/platform-pluv
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  ESM dist/index.mjs 3.65 KB
12
- ESM ⚡️ Build success in 55ms
12
+ ESM ⚡️ Build success in 72ms
13
13
  CJS dist/index.js 4.83 KB
14
- CJS ⚡️ Build success in 57ms
14
+ CJS ⚡️ Build success in 72ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6682ms
16
+ DTS ⚡️ Build success in 6981ms
17
17
  DTS dist/index.d.mts 2.29 KB
18
18
  DTS dist/index.d.ts 2.29 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,100 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b3c31d7: **BREAKING**
8
+
9
+ Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
10
+
11
+ ```ts
12
+ // @pluv/platform-node example
13
+
14
+ import { platformNode } from "@pluv/platform-node";
15
+ import { createIO } from "@pluv/io";
16
+ import type { IncomingMessage } from "node:http";
17
+ import { z } from "zod";
18
+
19
+ const io = createIO({
20
+ // If using a function authorize parameter, `req` is now available as a param
21
+ authorize: ({ req }) => ({
22
+ required: true,
23
+ secret: "MY-CUSTOM-SECRET",
24
+ user: z.object({
25
+ id: z.string(),
26
+ }),
27
+ }),
28
+ platformNode(),
29
+ });
30
+
31
+ // Before
32
+ io.createToken({
33
+ room: "my-custom-room",
34
+ user: { id: "abc123" },
35
+ });
36
+
37
+ // After
38
+ io.createToken({
39
+ room: "my-custom-room",
40
+ user: { id: "abc123" },
41
+
42
+ // Previously not required, but now required
43
+ req: req as IncomingMessage,
44
+ });
45
+ ```
46
+
47
+ ```ts
48
+ // @pluv/platform-cloudflare example
49
+
50
+ import { platformCloudflare } from "@pluv/platform-cloudflare";
51
+ import { createIO } from "@pluv/io";
52
+ import { z } from "zod";
53
+
54
+ const io = createIO({
55
+ // If using a function authorize parameter, `env` and `request` are now available as params
56
+ authorize: ({ env, request }) => ({
57
+ required: true,
58
+ secret: "MY-CUSTOM-SECRET",
59
+ user: z.object({
60
+ id: z.string(),
61
+ }),
62
+ }),
63
+ platformCloudflare(),
64
+ });
65
+
66
+ // Before
67
+ io.createToken({
68
+ room: "my-custom-room",
69
+ user: { id: "abc123" },
70
+ });
71
+
72
+ // After
73
+ io.createToken({
74
+ room: "my-custom-room",
75
+ user: { id: "abc123" },
76
+
77
+ // Previously not required, but now required
78
+ env: env as Env,
79
+ request: request as Request,
80
+ });
81
+ ```
82
+
83
+ ### Patch Changes
84
+
85
+ - Updated dependencies [b3c31d7]
86
+ - @pluv/io@0.31.0
87
+ - @pluv/crdt@0.31.0
88
+ - @pluv/types@0.31.0
89
+
90
+ ## 0.30.2
91
+
92
+ ### Patch Changes
93
+
94
+ - @pluv/crdt@0.30.2
95
+ - @pluv/io@0.30.2
96
+ - @pluv/types@0.30.2
97
+
3
98
  ## 0.30.1
4
99
 
5
100
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -11,7 +11,7 @@ declare class PluvPlatform extends AbstractPlatform {
11
11
  getSerializedState(webSocket: any): WebSocketSerializedState | null;
12
12
  getSessionId(webSocket: any): string | null;
13
13
  getWebSockets(): readonly any[];
14
- initialize(config: AbstractPlatformConfig<{}, {}>): this;
14
+ initialize(config: AbstractPlatformConfig<{}>): this;
15
15
  parseData(data: string | ArrayBuffer): Record<string, any>;
16
16
  randomUUID(): string;
17
17
  setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ declare class PluvPlatform extends AbstractPlatform {
11
11
  getSerializedState(webSocket: any): WebSocketSerializedState | null;
12
12
  getSessionId(webSocket: any): string | null;
13
13
  getWebSockets(): readonly any[];
14
- initialize(config: AbstractPlatformConfig<{}, {}>): this;
14
+ initialize(config: AbstractPlatformConfig<{}>): this;
15
15
  parseData(data: string | ArrayBuffer): Record<string, any>;
16
16
  randomUUID(): string;
17
17
  setSerializedState(webSocket: AbstractWebSocket, state: WebSocketSerializedState): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-pluv",
3
- "version": "0.30.1",
3
+ "version": "0.31.0",
4
4
  "description": "@pluv/io adapter for pluv.io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -17,19 +17,19 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@types/node": "^22.5.5",
20
+ "@types/node": "^22.7.4",
21
21
  "hono": "^4.6.3",
22
22
  "zod": "^3.23.8",
23
- "@pluv/crdt": "^0.30.1",
24
- "@pluv/io": "^0.30.1",
25
- "@pluv/types": "^0.30.1"
23
+ "@pluv/crdt": "^0.31.0",
24
+ "@pluv/io": "^0.31.0",
25
+ "@pluv/types": "^0.31.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^8.57.0",
29
29
  "tsup": "^8.3.0",
30
30
  "typescript": "^5.6.2",
31
- "@pluv/tsconfig": "^0.30.1",
32
- "eslint-config-pluv": "^0.30.1"
31
+ "@pluv/tsconfig": "^0.31.0",
32
+ "eslint-config-pluv": "^0.31.0"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -34,7 +34,7 @@ export class PluvPlatform extends AbstractPlatform {
34
34
  throw new Error("Not implemented");
35
35
  }
36
36
 
37
- public initialize(config: AbstractPlatformConfig<{}, {}>): this {
37
+ public initialize(config: AbstractPlatformConfig<{}>): this {
38
38
  throw new Error("Not implemented");
39
39
  }
40
40