@pluv/client 3.2.1 → 3.2.2

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/client@3.2.1 build /home/runner/work/pluv/pluv/packages/client
2
+ > @pluv/client@3.2.2 build /home/runner/work/pluv/pluv/packages/client
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 64.01 KB
12
- ESM ⚡️ Build success in 121ms
13
- CJS dist/index.js 65.75 KB
14
- CJS ⚡️ Build success in 121ms
11
+ CJS dist/index.js 65.76 KB
12
+ CJS ⚡️ Build success in 119ms
13
+ ESM dist/index.mjs 64.03 KB
14
+ ESM ⚡️ Build success in 132ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4493ms
17
- DTS dist/index.d.mts 19.14 KB
18
- DTS dist/index.d.ts 19.14 KB
16
+ DTS ⚡️ Build success in 4648ms
17
+ DTS dist/index.d.mts 19.23 KB
18
+ DTS dist/index.d.ts 19.23 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @pluv/client
2
2
 
3
+ ## 3.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8665dbe: Updated types of `createClient` so that the types inferred from `createClient` are flattened and no-longer depend on `@pluv/server`.
8
+ - Updated dependencies [8665dbe]
9
+ - @pluv/types@3.2.2
10
+ - @pluv/crdt@3.2.2
11
+
3
12
  ## 3.2.1
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AbstractCrdtDocFactory, InferDocLike, NoopCrdtDocFactory, InferStorage, InferDoc, InferCrdtJson } from '@pluv/crdt';
2
2
  export { CrdtType, InferCrdtJson } from '@pluv/crdt';
3
- import { IOLike, JsonObject, EventRecord, CrdtDocLike, UserInfo, MaybePromise, Id, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, InferIOAuthorize, BaseUser, RoomLike, InferIOOutput, InferIOInput, RoomEventListenerMap, BroadcastProxy, WebSocketConnection, SubscribeProxy, UpdateMyPresenceAction, InferIOCrdtKind, MergeEvents } from '@pluv/types';
3
+ import { IOLike, InferIOAuthorize, InferIOCrdt, InferIOEvents, JsonObject, EventRecord, CrdtDocLike, UserInfo, MaybePromise, Id, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, BaseUser, RoomLike, InferIOOutput, InferIOInput, RoomEventListenerMap, BroadcastProxy, WebSocketConnection, SubscribeProxy, UpdateMyPresenceAction, InferIOCrdtKind, MergeEvents } from '@pluv/types';
4
4
  export { BaseUser, ConnectionState, EventMessage, EventNotifierSubscriptionCallback, EventRecord, IOEventMessage, MergeEvents, RoomLike, UserInfo, WebSocketConnection, WebSocketState } from '@pluv/types';
5
5
 
6
6
  declare abstract class AbstractStorageStore {
@@ -19,7 +19,7 @@ declare const identity: <T extends unknown>(x: T) => T;
19
19
  type InferCallback<TIO extends IOLike<any, any, any>> = (i: typeof identity) => {
20
20
  io: (io: TIO) => TIO;
21
21
  };
22
- declare const infer: <TIO extends IOLike<any, any, any>>(callback: InferCallback<TIO>) => InferCallback<TIO>;
22
+ declare const infer: <TIO extends IOLike<any, any, any>>(callback: InferCallback<TIO>) => InferCallback<IOLike<InferIOAuthorize<TIO>, InferIOCrdt<TIO>, InferIOEvents<TIO>>>;
23
23
 
24
24
  type EventResolver<TIO extends IOLike, TInput extends JsonObject, TOutput extends EventRecord<string, any>, TPresence extends Record<string, any>, TDocLike extends CrdtDocLike<any, any>> = (data: TInput, context: EventResolverContext<TIO, TPresence, TDocLike>) => MaybePromise<TOutput | void>;
25
25
  interface EventResolverContext<TIO extends IOLike, TPresence extends Record<string, any>, TDocLike extends CrdtDocLike<any, any>> {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AbstractCrdtDocFactory, InferDocLike, NoopCrdtDocFactory, InferStorage, InferDoc, InferCrdtJson } from '@pluv/crdt';
2
2
  export { CrdtType, InferCrdtJson } from '@pluv/crdt';
3
- import { IOLike, JsonObject, EventRecord, CrdtDocLike, UserInfo, MaybePromise, Id, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, InferIOAuthorize, BaseUser, RoomLike, InferIOOutput, InferIOInput, RoomEventListenerMap, BroadcastProxy, WebSocketConnection, SubscribeProxy, UpdateMyPresenceAction, InferIOCrdtKind, MergeEvents } from '@pluv/types';
3
+ import { IOLike, InferIOAuthorize, InferIOCrdt, InferIOEvents, JsonObject, EventRecord, CrdtDocLike, UserInfo, MaybePromise, Id, ProcedureLike, InputZodLike, IORouterLike, InferIOAuthorizeUser, BaseUser, RoomLike, InferIOOutput, InferIOInput, RoomEventListenerMap, BroadcastProxy, WebSocketConnection, SubscribeProxy, UpdateMyPresenceAction, InferIOCrdtKind, MergeEvents } from '@pluv/types';
4
4
  export { BaseUser, ConnectionState, EventMessage, EventNotifierSubscriptionCallback, EventRecord, IOEventMessage, MergeEvents, RoomLike, UserInfo, WebSocketConnection, WebSocketState } from '@pluv/types';
5
5
 
6
6
  declare abstract class AbstractStorageStore {
@@ -19,7 +19,7 @@ declare const identity: <T extends unknown>(x: T) => T;
19
19
  type InferCallback<TIO extends IOLike<any, any, any>> = (i: typeof identity) => {
20
20
  io: (io: TIO) => TIO;
21
21
  };
22
- declare const infer: <TIO extends IOLike<any, any, any>>(callback: InferCallback<TIO>) => InferCallback<TIO>;
22
+ declare const infer: <TIO extends IOLike<any, any, any>>(callback: InferCallback<TIO>) => InferCallback<IOLike<InferIOAuthorize<TIO>, InferIOCrdt<TIO>, InferIOEvents<TIO>>>;
23
23
 
24
24
  type EventResolver<TIO extends IOLike, TInput extends JsonObject, TOutput extends EventRecord<string, any>, TPresence extends Record<string, any>, TDocLike extends CrdtDocLike<any, any>> = (data: TInput, context: EventResolverContext<TIO, TPresence, TDocLike>) => MaybePromise<TOutput | void>;
25
25
  interface EventResolverContext<TIO extends IOLike, TPresence extends Record<string, any>, TDocLike extends CrdtDocLike<any, any>> {
package/dist/index.js CHANGED
@@ -1671,7 +1671,9 @@ var createClient = (options) => {
1671
1671
  };
1672
1672
 
1673
1673
  // src/infer.ts
1674
- var infer = (callback) => callback;
1674
+ var infer = (callback) => {
1675
+ return callback;
1676
+ };
1675
1677
 
1676
1678
  // src/MockedRoom.ts
1677
1679
  var import_types2 = require("@pluv/types");
package/dist/index.mjs CHANGED
@@ -1643,7 +1643,9 @@ var createClient = (options) => {
1643
1643
  };
1644
1644
 
1645
1645
  // src/infer.ts
1646
- var infer = (callback) => callback;
1646
+ var infer = (callback) => {
1647
+ return callback;
1648
+ };
1647
1649
 
1648
1650
  // src/MockedRoom.ts
1649
1651
  import { ConnectionState as ConnectionState2, StorageState as StorageState2 } from "@pluv/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/client",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "@pluv/io frontend client",
5
5
  "author": {
6
6
  "email": "david@pluv.io",
@@ -22,15 +22,15 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "wonka": "^6.3.5",
25
- "@pluv/crdt": "^3.2.1",
26
- "@pluv/types": "^3.2.1"
25
+ "@pluv/crdt": "^3.2.2",
26
+ "@pluv/types": "^3.2.2"
27
27
  },
28
28
  "devDependencies": {
29
29
  "eslint": "^9.31.0",
30
30
  "tsup": "^8.5.0",
31
31
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^3.2.1",
33
- "eslint-config-pluv": "^3.2.1"
32
+ "@pluv/tsconfig": "^3.2.2",
33
+ "eslint-config-pluv": "^3.2.2"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/infer.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IOLike } from "@pluv/types";
1
+ import type { InferIOAuthorize, InferIOCrdt, InferIOEvents, IOLike } from "@pluv/types";
2
2
  import type { identity } from "./utils";
3
3
 
4
4
  export type InferCallback<TIO extends IOLike<any, any, any>> = (i: typeof identity) => {
@@ -7,4 +7,6 @@ export type InferCallback<TIO extends IOLike<any, any, any>> = (i: typeof identi
7
7
 
8
8
  export const infer = <TIO extends IOLike<any, any, any>>(
9
9
  callback: InferCallback<TIO>,
10
- ): InferCallback<TIO> => callback;
10
+ ): InferCallback<IOLike<InferIOAuthorize<TIO>, InferIOCrdt<TIO>, InferIOEvents<TIO>>> => {
11
+ return callback as any;
12
+ };