@pluv/platform-pluv 0.30.2 → 0.32.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.2 build /home/runner/work/pluv/pluv/packages/platform-pluv
2
+ > @pluv/platform-pluv@0.32.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 91ms
12
+ ESM ⚡️ Build success in 67ms
13
13
  CJS dist/index.js 4.83 KB
14
- CJS ⚡️ Build success in 90ms
14
+ CJS ⚡️ Build success in 67ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6759ms
16
+ DTS ⚡️ Build success in 6022ms
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,101 @@
1
1
  # @pluv/platform-pluv
2
2
 
3
+ ## 0.32.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cde5305]
8
+ - @pluv/io@0.32.0
9
+ - @pluv/crdt@0.32.0
10
+ - @pluv/types@0.32.0
11
+
12
+ ## 0.31.0
13
+
14
+ ### Minor Changes
15
+
16
+ - b3c31d7: **BREAKING**
17
+
18
+ Fixed platform context types. This will require additional properties when registering a websocket and creating authorization tokens. See example below:
19
+
20
+ ```ts
21
+ // @pluv/platform-node example
22
+
23
+ import { platformNode } from "@pluv/platform-node";
24
+ import { createIO } from "@pluv/io";
25
+ import type { IncomingMessage } from "node:http";
26
+ import { z } from "zod";
27
+
28
+ const io = createIO({
29
+ // If using a function authorize parameter, `req` is now available as a param
30
+ authorize: ({ req }) => ({
31
+ required: true,
32
+ secret: "MY-CUSTOM-SECRET",
33
+ user: z.object({
34
+ id: z.string(),
35
+ }),
36
+ }),
37
+ platformNode(),
38
+ });
39
+
40
+ // Before
41
+ io.createToken({
42
+ room: "my-custom-room",
43
+ user: { id: "abc123" },
44
+ });
45
+
46
+ // After
47
+ io.createToken({
48
+ room: "my-custom-room",
49
+ user: { id: "abc123" },
50
+
51
+ // Previously not required, but now required
52
+ req: req as IncomingMessage,
53
+ });
54
+ ```
55
+
56
+ ```ts
57
+ // @pluv/platform-cloudflare example
58
+
59
+ import { platformCloudflare } from "@pluv/platform-cloudflare";
60
+ import { createIO } from "@pluv/io";
61
+ import { z } from "zod";
62
+
63
+ const io = createIO({
64
+ // If using a function authorize parameter, `env` and `request` are now available as params
65
+ authorize: ({ env, request }) => ({
66
+ required: true,
67
+ secret: "MY-CUSTOM-SECRET",
68
+ user: z.object({
69
+ id: z.string(),
70
+ }),
71
+ }),
72
+ platformCloudflare(),
73
+ });
74
+
75
+ // Before
76
+ io.createToken({
77
+ room: "my-custom-room",
78
+ user: { id: "abc123" },
79
+ });
80
+
81
+ // After
82
+ io.createToken({
83
+ room: "my-custom-room",
84
+ user: { id: "abc123" },
85
+
86
+ // Previously not required, but now required
87
+ env: env as Env,
88
+ request: request as Request,
89
+ });
90
+ ```
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [b3c31d7]
95
+ - @pluv/io@0.31.0
96
+ - @pluv/crdt@0.31.0
97
+ - @pluv/types@0.31.0
98
+
3
99
  ## 0.30.2
4
100
 
5
101
  ### 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.2",
3
+ "version": "0.32.0",
4
4
  "description": "@pluv/io adapter for pluv.io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -20,16 +20,16 @@
20
20
  "@types/node": "^22.7.4",
21
21
  "hono": "^4.6.3",
22
22
  "zod": "^3.23.8",
23
- "@pluv/crdt": "^0.30.2",
24
- "@pluv/io": "^0.30.2",
25
- "@pluv/types": "^0.30.2"
23
+ "@pluv/crdt": "^0.32.0",
24
+ "@pluv/io": "^0.32.0",
25
+ "@pluv/types": "^0.32.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.2",
32
- "eslint-config-pluv": "^0.30.2"
31
+ "@pluv/tsconfig": "^0.32.0",
32
+ "eslint-config-pluv": "^0.32.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