@pluv/io 1.0.2 → 2.0.1

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,9 +1,9 @@
1
1
 
2
- > @pluv/io@1.0.2 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@2.0.1 build /home/runner/work/pluv/pluv/packages/io
3
3
  > pnpm run version && tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
 
6
- > @pluv/io@1.0.2 version /home/runner/work/pluv/pluv/packages/io
6
+ > @pluv/io@2.0.1 version /home/runner/work/pluv/pluv/packages/io
7
7
  > genversion ./src/version.generated.ts --esm
8
8
 
9
9
  CLI Building entry: src/index.ts
@@ -13,10 +13,10 @@
13
13
  ESM Build start
14
14
  CJS Build start
15
15
  ESM dist/index.mjs 51.32 KB
16
- ESM ⚡️ Build success in 143ms
16
+ ESM ⚡️ Build success in 116ms
17
17
  CJS dist/index.js 53.49 KB
18
- CJS ⚡️ Build success in 146ms
18
+ CJS ⚡️ Build success in 130ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 3112ms
21
- DTS dist/index.d.mts 32.20 KB
22
- DTS dist/index.d.ts 32.20 KB
20
+ DTS ⚡️ Build success in 3973ms
21
+ DTS dist/index.d.mts 32.19 KB
22
+ DTS dist/index.d.ts 32.19 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@2.0.1
8
+ - @pluv/types@2.0.1
9
+
10
+ ## 2.0.0
11
+
12
+ ### Patch Changes
13
+
14
+ - 047a1d8: Moved several internal types to `@pluv/types`.
15
+ - Updated dependencies [047a1d8]
16
+ - @pluv/types@2.0.0
17
+ - @pluv/crdt@2.0.0
18
+
3
19
  ## 1.0.2
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -58,8 +58,8 @@ Create your frontend client with your backend types
58
58
  const types = infer((i) => ({ io: i<typeof ioServer> }));
59
59
  const io = createClient({
60
60
  types,
61
- initialStorage: yjs.doc(() => ({
62
- messages: yjs.array<string>(),
61
+ initialStorage: yjs.doc((t) => ({
62
+ messages: t.array<string>("messages"),
63
63
  })),
64
64
  presence: z.object({
65
65
  selectionId: z.string().nullable()
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { JsonObject, IOAuthorize, InferIOAuthorizeUser, MaybePromise, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, BaseUser, UndefinedProps, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
1
+ import { JsonObject, IOAuthorize, InferIOAuthorizeUser, MaybePromise, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, BaseUser, UndefinedProps, CrdtDocLike, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
2
2
  export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
3
- import { AbstractCrdtDocFactory, AbstractCrdtDoc } from '@pluv/crdt';
3
+ import { AbstractCrdtDocFactory } from '@pluv/crdt';
4
4
 
5
5
  declare abstract class AbstractPersistence {
6
6
  abstract addUser(room: string, connectionId: string, user: JsonObject | null): Promise<void>;
@@ -129,7 +129,7 @@ type EventResolverKind = "broadcast" | "self" | "sync";
129
129
  type EventResolver<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TInput extends JsonObject = {}, TOutput extends EventRecord<string, any> = {}> = (data: TInput, context: EventResolverContext<TKind, TPlatform, TAuthorize, TContext>) => MaybePromise<TOutput | void>;
130
130
  interface EventResolverContext<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}> {
131
131
  context: TContext;
132
- doc: AbstractCrdtDoc<any>;
132
+ doc: CrdtDocLike<any>;
133
133
  garbageCollect: () => Promise<void>;
134
134
  presence: JsonObject | null;
135
135
  room: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { JsonObject, IOAuthorize, InferIOAuthorizeUser, MaybePromise, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, BaseUser, UndefinedProps, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
1
+ import { JsonObject, IOAuthorize, InferIOAuthorizeUser, MaybePromise, IOEventMessage, EventRecord, ProcedureLike, InputZodLike, IORouterLike, BaseUser, UndefinedProps, CrdtDocLike, Id, InferEventMessage, InferEventsOutput, Maybe, IOLike, InferIOOutput, InferIOInput, InferIOAuthorize } from '@pluv/types';
2
2
  export { BaseUser, EventMessage, EventRecord, IOEventMessage } from '@pluv/types';
3
- import { AbstractCrdtDocFactory, AbstractCrdtDoc } from '@pluv/crdt';
3
+ import { AbstractCrdtDocFactory } from '@pluv/crdt';
4
4
 
5
5
  declare abstract class AbstractPersistence {
6
6
  abstract addUser(room: string, connectionId: string, user: JsonObject | null): Promise<void>;
@@ -129,7 +129,7 @@ type EventResolverKind = "broadcast" | "self" | "sync";
129
129
  type EventResolver<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}, TInput extends JsonObject = {}, TOutput extends EventRecord<string, any> = {}> = (data: TInput, context: EventResolverContext<TKind, TPlatform, TAuthorize, TContext>) => MaybePromise<TOutput | void>;
130
130
  interface EventResolverContext<TKind extends EventResolverKind = EventResolverKind, TPlatform extends AbstractPlatform = AbstractPlatform, TAuthorize extends IOAuthorize<any, InferInitContextType<TPlatform>> | null = null, TContext extends Record<string, any> = {}> {
131
131
  context: TContext;
132
- doc: AbstractCrdtDoc<any>;
132
+ doc: CrdtDocLike<any>;
133
133
  garbageCollect: () => Promise<void>;
134
134
  presence: JsonObject | null;
135
135
  room: string;
package/dist/index.js CHANGED
@@ -1156,7 +1156,7 @@ var pickBy = (obj, by) => {
1156
1156
  };
1157
1157
 
1158
1158
  // src/version.generated.ts
1159
- var version = "1.0.2";
1159
+ var version = "2.0.1";
1160
1160
 
1161
1161
  // src/PluvServer.ts
1162
1162
  var PluvServer = class {
package/dist/index.mjs CHANGED
@@ -1114,7 +1114,7 @@ var pickBy = (obj, by) => {
1114
1114
  };
1115
1115
 
1116
1116
  // src/version.generated.ts
1117
- var version = "1.0.2";
1117
+ var version = "2.0.1";
1118
1118
 
1119
1119
  // src/PluvServer.ts
1120
1120
  var PluvServer = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "1.0.2",
3
+ "version": "2.0.1",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -21,16 +21,16 @@
21
21
  "jose": "^5.10.0",
22
22
  "kleur": "^4.1.5",
23
23
  "wonka": "^6.3.5",
24
- "@pluv/crdt": "^1.0.2",
25
- "@pluv/types": "^1.0.2"
24
+ "@pluv/crdt": "^2.0.1",
25
+ "@pluv/types": "^2.0.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "eslint": "^9.25.1",
29
29
  "genversion": "^3.2.0",
30
30
  "tsup": "^8.4.0",
31
31
  "typescript": "^5.8.3",
32
- "@pluv/tsconfig": "^1.0.2",
33
- "eslint-config-pluv": "^1.0.2"
32
+ "@pluv/tsconfig": "^2.0.1",
33
+ "eslint-config-pluv": "^2.0.1"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "pnpm run version && tsup src/index.ts --format esm,cjs --dts",
package/src/IORoom.ts CHANGED
@@ -1,8 +1,9 @@
1
- import type { AbstractCrdtDoc, AbstractCrdtDocFactory } from "@pluv/crdt";
1
+ import type { AbstractCrdtDocFactory } from "@pluv/crdt";
2
2
  import { noop } from "@pluv/crdt";
3
3
  import type {
4
4
  BaseIOEventRecord,
5
5
  BaseUser,
6
+ CrdtDocLike,
6
7
  EventMessage,
7
8
  IOEventMessage,
8
9
  IOLike,
@@ -123,7 +124,7 @@ export class IORoom<
123
124
  {
124
125
  public readonly id: string;
125
126
 
126
- private _doc: Promise<AbstractCrdtDoc<any>>;
127
+ private _doc: Promise<CrdtDocLike<any>>;
127
128
  private _lastGarbageCollectMs: number = -1 * (GARBAGE_COLLECT_INTERVAL_MS + 1);
128
129
  private _uninitialize: Promise<() => Promise<void>> | null = null;
129
130
 
@@ -625,7 +626,7 @@ export class IORoom<
625
626
  }
626
627
  }
627
628
 
628
- private async _getInitialDoc(): Promise<AbstractCrdtDoc<any>> {
629
+ private async _getInitialDoc(): Promise<CrdtDocLike<any>> {
629
630
  const doc = this._docFactory.getEmpty();
630
631
  const encodedState = await this._platform.persistence.getStorageState(this.id);
631
632
 
package/src/types.ts CHANGED
@@ -1,6 +1,7 @@
1
- import type { AbstractCrdtDoc, AbstractCrdtDocFactory } from "@pluv/crdt";
1
+ import type { AbstractCrdtDocFactory } from "@pluv/crdt";
2
2
  import type {
3
3
  BaseUser,
4
+ CrdtDocLike,
4
5
  EventRecord,
5
6
  IOAuthorize,
6
7
  Id,
@@ -53,7 +54,7 @@ export interface EventResolverContext<
53
54
  TContext extends Record<string, any> = {},
54
55
  > {
55
56
  context: TContext;
56
- doc: AbstractCrdtDoc<any>;
57
+ doc: CrdtDocLike<any>;
57
58
  garbageCollect: () => Promise<void>;
58
59
  presence: JsonObject | null;
59
60
  room: string;
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.0.2'
2
+ export const version = '2.0.1'