@pluv/platform-node 3.0.0 → 3.1.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-node@3.0.0 build /home/runner/work/pluv/pluv/packages/platform-node
2
+ > @pluv/platform-node@3.1.0 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
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  ESM dist/index.mjs 5.92 KB
12
- ESM ⚡️ Build success in 85ms
12
+ ESM ⚡️ Build success in 112ms
13
13
  CJS dist/index.js 7.57 KB
14
- CJS ⚡️ Build success in 86ms
14
+ CJS ⚡️ Build success in 116ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4681ms
17
- DTS dist/index.d.mts 4.99 KB
18
- DTS dist/index.d.ts 4.99 KB
16
+ DTS ⚡️ Build success in 4220ms
17
+ DTS dist/index.d.mts 5.22 KB
18
+ DTS dist/index.d.ts 5.22 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @pluv/platform-node
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [a40f4dc]
8
+ - @pluv/io@3.1.0
9
+ - @pluv/crdt@3.1.0
10
+ - @pluv/types@3.1.0
11
+
3
12
  ## 3.0.0
4
13
 
5
14
  ### Major Changes
package/dist/index.d.mts CHANGED
@@ -3,6 +3,7 @@ export { WebSocket } from 'ws';
3
3
  import { Json, IOAuthorize, JsonObject, InferIOAuthorizeUser, BaseUser, Id } from '@pluv/types';
4
4
  import { AbstractWebSocket, WebSocketSession, WebSocketSerializedState, AbstractWebSocketConfig, AbstractEventMap, AbstractListener, AbstractPlatform, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, ConvertWebSocketConfig, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
5
5
  import { IncomingMessage } from 'node:http';
6
+ import { CrdtLibraryType, NoopCrdtDocFactory } from '@pluv/crdt';
6
7
 
7
8
  declare const identity: <T extends unknown>(x: T) => T;
8
9
 
@@ -95,11 +96,11 @@ declare class NodePlatform<TAuthorize extends IOAuthorize<any, any> | null = nul
95
96
  setSerializedState(webSocket: NodeWebSocket<TAuthorize>, state: WebSocketSerializedState): WebSocketSerializedState;
96
97
  }
97
98
 
98
- type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>, "authorize" | "context" | "platform"> & {
99
+ type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>, "authorize" | "context" | "platform"> & {
99
100
  authorize?: PluvIOAuthorize<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TUser, InferInitContextType<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>>>;
100
101
  context?: PluvContext<NodePlatform<IOAuthorize<TUser, any>, TMeta>, TContext>;
101
102
  types?: InferCallback<TMeta>;
102
103
  }>;
103
- declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>;
104
+ declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>;
104
105
 
105
106
  export { type InferCallback, NodePlatform, type NodePlatformConfig, type PlatformNodeCreateIOParams, infer, platformNode };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { WebSocket } from 'ws';
3
3
  import { Json, IOAuthorize, JsonObject, InferIOAuthorizeUser, BaseUser, Id } from '@pluv/types';
4
4
  import { AbstractWebSocket, WebSocketSession, WebSocketSerializedState, AbstractWebSocketConfig, AbstractEventMap, AbstractListener, AbstractPlatform, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, ConvertWebSocketConfig, AbstractPlatformConfig, CreateIOParams, PluvIOAuthorize, InferInitContextType, PluvContext } from '@pluv/io';
5
5
  import { IncomingMessage } from 'node:http';
6
+ import { CrdtLibraryType, NoopCrdtDocFactory } from '@pluv/crdt';
6
7
 
7
8
  declare const identity: <T extends unknown>(x: T) => T;
8
9
 
@@ -95,11 +96,11 @@ declare class NodePlatform<TAuthorize extends IOAuthorize<any, any> | null = nul
95
96
  setSerializedState(webSocket: NodeWebSocket<TAuthorize>, state: WebSocketSerializedState): WebSocketSerializedState;
96
97
  }
97
98
 
98
- type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>, "authorize" | "context" | "platform"> & {
99
+ type PlatformNodeCreateIOParams<TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>> = Id<NodePlatformConfig<TMeta> & Omit<CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>, "authorize" | "context" | "platform"> & {
99
100
  authorize?: PluvIOAuthorize<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TUser, InferInitContextType<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>>>;
100
101
  context?: PluvContext<NodePlatform<IOAuthorize<TUser, any>, TMeta>, TContext>;
101
102
  types?: InferCallback<TMeta>;
102
103
  }>;
103
- declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>;
104
+ declare const platformNode: <TMeta extends Record<string, Json> = {}, TContext extends Record<string, any> = {}, TUser extends BaseUser | null = null, TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>>(config?: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt>) => CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt>;
104
105
 
105
106
  export { type InferCallback, NodePlatform, type NodePlatformConfig, type PlatformNodeCreateIOParams, infer, platformNode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/platform-node",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "@pluv/io adapter for node.js",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -20,16 +20,17 @@
20
20
  "@types/node": "^22.15.21",
21
21
  "@types/ws": "^8.18.1",
22
22
  "path-to-regexp": "^8.2.0",
23
- "@pluv/io": "^3.0.0",
24
- "@pluv/types": "^3.0.0"
23
+ "@pluv/crdt": "^3.1.0",
24
+ "@pluv/io": "^3.1.0",
25
+ "@pluv/types": "^3.1.0"
25
26
  },
26
27
  "devDependencies": {
27
28
  "eslint": "^9.27.0",
28
29
  "tsup": "^8.5.0",
29
30
  "typescript": "^5.8.3",
30
31
  "ws": "^8.18.2",
31
- "@pluv/tsconfig": "^3.0.0",
32
- "eslint-config-pluv": "^3.0.0"
32
+ "@pluv/tsconfig": "^3.1.0",
33
+ "eslint-config-pluv": "^3.1.0"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "ws": "^8.0.0"
@@ -1,10 +1,5 @@
1
- import type {
2
- CreateIOParams,
3
- InferInitContextType,
4
- PluvContext,
5
- PluvIOAuthorize,
6
- PluvIOLimits,
7
- } from "@pluv/io";
1
+ import type { CrdtLibraryType, NoopCrdtDocFactory } from "@pluv/crdt";
2
+ import type { CreateIOParams, InferInitContextType, PluvContext, PluvIOAuthorize } from "@pluv/io";
8
3
  import type { BaseUser, Id, IOAuthorize, Json } from "@pluv/types";
9
4
  import type { NodePlatformConfig } from "./NodePlatform";
10
5
  import { NodePlatform } from "./NodePlatform";
@@ -14,10 +9,16 @@ export type PlatformNodeCreateIOParams<
14
9
  TMeta extends Record<string, Json> = {},
15
10
  TContext extends Record<string, any> = {},
16
11
  TUser extends BaseUser | null = null,
12
+ TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>,
17
13
  > = Id<
18
14
  NodePlatformConfig<TMeta> &
19
15
  Omit<
20
- CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser>,
16
+ CreateIOParams<
17
+ NodePlatform<IOAuthorize<TUser, TContext>, TMeta>,
18
+ TContext,
19
+ TUser,
20
+ TCrdt
21
+ >,
21
22
  "authorize" | "context" | "platform"
22
23
  > & {
23
24
  authorize?: PluvIOAuthorize<
@@ -34,9 +35,10 @@ export const platformNode = <
34
35
  TMeta extends Record<string, Json> = {},
35
36
  TContext extends Record<string, any> = {},
36
37
  TUser extends BaseUser | null = null,
38
+ TCrdt extends CrdtLibraryType<any> = CrdtLibraryType<NoopCrdtDocFactory>,
37
39
  >(
38
- config: PlatformNodeCreateIOParams<TMeta, TContext, TUser> = {},
39
- ): CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser> => {
40
+ config: PlatformNodeCreateIOParams<TMeta, TContext, TUser, TCrdt> = {},
41
+ ): CreateIOParams<NodePlatform<IOAuthorize<TUser, TContext>, TMeta>, TContext, TUser, TCrdt> => {
40
42
  const { authorize, context, crdt, debug, limits } = config;
41
43
 
42
44
  return {