@pluv/platform-node 0.32.4 → 0.32.6

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,18 +1,18 @@
1
1
 
2
- > @pluv/platform-node@0.32.4 build /home/runner/work/pluv/pluv/packages/platform-node
2
+ > @pluv/platform-node@0.32.6 build /home/runner/work/pluv/pluv/packages/platform-node
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.3.0
7
+ CLI tsup v8.3.5
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  ESM dist/index.mjs 8.13 KB
12
- ESM ⚡️ Build success in 108ms
12
+ ESM ⚡️ Build success in 86ms
13
13
  CJS dist/index.js 9.89 KB
14
- CJS ⚡️ Build success in 109ms
14
+ CJS ⚡️ Build success in 86ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 5762ms
17
- DTS dist/index.d.mts 4.22 KB
18
- DTS dist/index.d.ts 4.22 KB
16
+ DTS ⚡️ Build success in 5825ms
17
+ DTS dist/index.d.mts 4.17 KB
18
+ DTS dist/index.d.ts 4.17 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pluv/platform-node
2
2
 
3
+ ## 0.32.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c0956e7]
8
+ - @pluv/io@0.32.6
9
+ - @pluv/types@0.32.6
10
+
11
+ ## 0.32.5
12
+
13
+ ### Patch Changes
14
+
15
+ - 98d7585: Update `meta` type on platform contexts to allow for nested json types.
16
+ - @pluv/io@0.32.5
17
+ - @pluv/types@0.32.5
18
+
3
19
  ## 0.32.4
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WebSocket, Server as Server$1 } from 'ws';
2
2
  export { WebSocket } from 'ws';
3
3
  import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer, InferInitContextType } from '@pluv/io';
4
- import { JsonObject, JsonPrimitive, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
4
+ import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
5
5
  import { IncomingMessage, Server, ServerResponse } from 'node:http';
6
6
 
7
7
  type NodeWebSocketConfig = AbstractWebSocketConfig;
@@ -20,12 +20,12 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
20
20
  terminate(): void;
21
21
  }
22
22
 
23
- type NodePlatformRoomContext<TMeta extends Record<string, JsonPrimitive>> = keyof TMeta extends never ? {
23
+ type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never ? {
24
24
  meta?: undefined;
25
25
  } : {
26
26
  meta: TMeta;
27
27
  };
28
- type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
28
+ type NodePlatformConfig<TMeta extends Record<string, Json>> = {
29
29
  mode?: WebSocketRegistrationMode;
30
30
  } & ({
31
31
  persistence?: undefined;
@@ -36,7 +36,7 @@ type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
36
36
  }) & {
37
37
  context?: NodePlatformRoomContext<TMeta>;
38
38
  };
39
- declare class NodePlatform<TMeta extends Record<string, JsonPrimitive> = {}> extends AbstractPlatform<NodeWebSocket, {
39
+ declare class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<NodeWebSocket, {
40
40
  req: IncomingMessage;
41
41
  }, NodePlatformRoomContext<TMeta>> {
42
42
  readonly _registrationMode: WebSocketRegistrationMode;
@@ -78,6 +78,6 @@ interface CreatePluvHandlerResult {
78
78
  }
79
79
  declare const createPluvHandler: <TPluvServer extends PluvServer<NodePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer>) => CreatePluvHandlerResult;
80
80
 
81
- declare const platformNode: <TMeta extends Record<string, JsonPrimitive> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
81
+ declare const platformNode: <TMeta extends Record<string, Json> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
82
82
 
83
83
  export { type AuthorizeFunction, type AuthorizeFunctionContext, type CreatePluvHandlerConfig, NodePlatform, type NodePlatformConfig, createPluvHandler, platformNode };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { WebSocket, Server as Server$1 } from 'ws';
2
2
  export { WebSocket } from 'ws';
3
3
  import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer, InferInitContextType } from '@pluv/io';
4
- import { JsonObject, JsonPrimitive, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
4
+ import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
5
5
  import { IncomingMessage, Server, ServerResponse } from 'node:http';
6
6
 
7
7
  type NodeWebSocketConfig = AbstractWebSocketConfig;
@@ -20,12 +20,12 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
20
20
  terminate(): void;
21
21
  }
22
22
 
23
- type NodePlatformRoomContext<TMeta extends Record<string, JsonPrimitive>> = keyof TMeta extends never ? {
23
+ type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never ? {
24
24
  meta?: undefined;
25
25
  } : {
26
26
  meta: TMeta;
27
27
  };
28
- type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
28
+ type NodePlatformConfig<TMeta extends Record<string, Json>> = {
29
29
  mode?: WebSocketRegistrationMode;
30
30
  } & ({
31
31
  persistence?: undefined;
@@ -36,7 +36,7 @@ type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
36
36
  }) & {
37
37
  context?: NodePlatformRoomContext<TMeta>;
38
38
  };
39
- declare class NodePlatform<TMeta extends Record<string, JsonPrimitive> = {}> extends AbstractPlatform<NodeWebSocket, {
39
+ declare class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<NodeWebSocket, {
40
40
  req: IncomingMessage;
41
41
  }, NodePlatformRoomContext<TMeta>> {
42
42
  readonly _registrationMode: WebSocketRegistrationMode;
@@ -78,6 +78,6 @@ interface CreatePluvHandlerResult {
78
78
  }
79
79
  declare const createPluvHandler: <TPluvServer extends PluvServer<NodePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer>) => CreatePluvHandlerResult;
80
80
 
81
- declare const platformNode: <TMeta extends Record<string, JsonPrimitive> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
81
+ declare const platformNode: <TMeta extends Record<string, Json> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
82
82
 
83
83
  export { type AuthorizeFunction, type AuthorizeFunctionContext, type CreatePluvHandlerConfig, NodePlatform, type NodePlatformConfig, createPluvHandler, platformNode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-node",
3
- "version": "0.32.4",
3
+ "version": "0.32.6",
4
4
  "description": "@pluv/io adapter for node.js",
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.7.8",
20
+ "@types/node": "^22.8.1",
21
21
  "@types/ws": "^8.5.12",
22
22
  "path-to-regexp": "^8.2.0",
23
- "@pluv/io": "^0.32.4",
24
- "@pluv/types": "^0.32.4"
23
+ "@pluv/io": "^0.32.6",
24
+ "@pluv/types": "^0.32.6"
25
25
  },
26
26
  "devDependencies": {
27
27
  "eslint": "^8.57.0",
28
- "tsup": "^8.3.0",
28
+ "tsup": "^8.3.5",
29
29
  "typescript": "^5.6.3",
30
30
  "ws": "^8.18.0",
31
- "@pluv/tsconfig": "^0.32.4",
32
- "eslint-config-pluv": "^0.32.4"
31
+ "@pluv/tsconfig": "^0.32.6",
32
+ "eslint-config-pluv": "^0.32.6"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "ws": "^8.0.0"
@@ -7,23 +7,23 @@ import type {
7
7
  WebSocketSerializedState,
8
8
  } from "@pluv/io";
9
9
  import { AbstractPlatform } from "@pluv/io";
10
- import type { JsonPrimitive } from "@pluv/types";
10
+ import type { Json } from "@pluv/types";
11
11
  import crypto from "node:crypto";
12
12
  import type { IncomingMessage } from "node:http";
13
13
  import { TextDecoder } from "node:util";
14
14
  import type { WebSocket } from "ws";
15
15
  import { NodeWebSocket } from "./NodeWebSocket";
16
16
 
17
- export type NodePlatformRoomContext<TMeta extends Record<string, JsonPrimitive>> = keyof TMeta extends never
17
+ export type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never
18
18
  ? { meta?: undefined }
19
19
  : { meta: TMeta };
20
20
 
21
- export type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = { mode?: WebSocketRegistrationMode } & (
21
+ export type NodePlatformConfig<TMeta extends Record<string, Json>> = { mode?: WebSocketRegistrationMode } & (
22
22
  | { persistence?: undefined; pubSub?: undefined }
23
23
  | { persistence: AbstractPersistence; pubSub: AbstractPubSub }
24
24
  ) & { context?: NodePlatformRoomContext<TMeta> };
25
25
 
26
- export class NodePlatform<TMeta extends Record<string, JsonPrimitive> = {}> extends AbstractPlatform<
26
+ export class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<
27
27
  NodeWebSocket,
28
28
  { req: IncomingMessage },
29
29
  NodePlatformRoomContext<TMeta>
@@ -1,8 +1,8 @@
1
- import type { JsonPrimitive } from "@pluv/types";
1
+ import type { Json } from "@pluv/types";
2
2
  import type { NodePlatformConfig } from "./NodePlatform";
3
3
  import { NodePlatform } from "./NodePlatform";
4
4
 
5
- export const platformNode = <TMeta extends Record<string, JsonPrimitive> = {}>(
5
+ export const platformNode = <TMeta extends Record<string, Json> = {}>(
6
6
  config: NodePlatformConfig<TMeta> = {},
7
7
  ): NodePlatform<TMeta> => {
8
8
  return new NodePlatform<TMeta>(config);