@pluv/io 0.10.2 → 0.10.3

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/io@0.10.2 build /home/runner/work/pluv/pluv/packages/io
2
+ > @pluv/io@0.10.3 build /home/runner/work/pluv/pluv/packages/io
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 29.16 KB
12
- ESM ⚡️ Build success in 76ms
13
- CJS dist/index.js 31.22 KB
14
- CJS ⚡️ Build success in 77ms
11
+ ESM dist/index.mjs 29.29 KB
12
+ ESM ⚡️ Build success in 73ms
13
+ CJS dist/index.js 31.35 KB
14
+ CJS ⚡️ Build success in 78ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3540ms
17
- DTS dist/index.d.mts 17.07 KB
18
- DTS dist/index.d.ts 17.07 KB
16
+ DTS ⚡️ Build success in 3387ms
17
+ DTS dist/index.d.mts 17.12 KB
18
+ DTS dist/index.d.ts 17.12 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pluv/io
2
2
 
3
+ ## 0.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - a7d3ad1: Exposed context and getInitialProps from @pluv/io.
8
+ - @pluv/crdt-yjs@0.10.3
9
+ - @pluv/types@0.10.3
10
+
3
11
  ## 0.10.2
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
257
257
  debug?: boolean;
258
258
  } & InferPlatformRoomContextType<TPlatform>;
259
259
  declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, any> = BaseIOAuthorize, TContext extends JsonObject = {}, TInput extends EventRecord<string, any> = {}, TOutputBroadcast extends EventRecord<string, any> = {}, TOutputSelf extends EventRecord<string, any> = {}, TOutputSync extends EventRecord<string, any> = {}> implements IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync> {
260
- private _context;
261
- private _getInitialStorage;
262
260
  private _rooms;
263
261
  readonly _authorize: TAuthorize | null;
262
+ readonly _context: TContext;
264
263
  readonly _debug: boolean;
265
264
  readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
265
+ readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
266
266
  readonly _listeners: PluvIOListeners<TPlatform>;
267
267
  readonly _platform: TPlatform;
268
268
  constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
package/dist/index.d.ts CHANGED
@@ -257,12 +257,12 @@ type GetRoomOptions<TPlatform extends AbstractPlatform> = {
257
257
  debug?: boolean;
258
258
  } & InferPlatformRoomContextType<TPlatform>;
259
259
  declare class PluvIO<TPlatform extends AbstractPlatform<any> = AbstractPlatform<any>, TAuthorize extends IOAuthorize<any, any> = BaseIOAuthorize, TContext extends JsonObject = {}, TInput extends EventRecord<string, any> = {}, TOutputBroadcast extends EventRecord<string, any> = {}, TOutputSelf extends EventRecord<string, any> = {}, TOutputSync extends EventRecord<string, any> = {}> implements IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync> {
260
- private _context;
261
- private _getInitialStorage;
262
260
  private _rooms;
263
261
  readonly _authorize: TAuthorize | null;
262
+ readonly _context: TContext;
264
263
  readonly _debug: boolean;
265
264
  readonly _events: InferEventConfig<TPlatform, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>;
265
+ readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null;
266
266
  readonly _listeners: PluvIOListeners<TPlatform>;
267
267
  readonly _platform: TPlatform;
268
268
  constructor(options: PluvIOConfig<TPlatform, TAuthorize, TContext, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>);
package/dist/index.js CHANGED
@@ -732,10 +732,9 @@ var IORoom = class {
732
732
  // src/PluvIO.ts
733
733
  var PluvIO = class _PluvIO {
734
734
  constructor(options) {
735
- this._context = {};
736
- this._getInitialStorage = null;
737
735
  this._rooms = /* @__PURE__ */ new Map();
738
736
  this._authorize = null;
737
+ this._context = {};
739
738
  this._events = {
740
739
  $GET_OTHERS: {
741
740
  resolver: {
@@ -836,6 +835,7 @@ var PluvIO = class _PluvIO {
836
835
  }
837
836
  }
838
837
  };
838
+ this._getInitialStorage = null;
839
839
  const {
840
840
  authorize: authorize2,
841
841
  context,
@@ -941,16 +941,20 @@ var PluvIO = class _PluvIO {
941
941
  static merge(first, second) {
942
942
  var _a;
943
943
  const authorize2 = (_a = first._authorize) != null ? _a : void 0;
944
+ const context = first._context;
944
945
  const debug = first._debug;
945
946
  const platform = first._platform;
947
+ const getInitialStorage = first._getInitialStorage;
946
948
  const events1 = first._events;
947
949
  const events2 = second._events;
948
950
  const { onRoomDeleted, onStorageUpdated } = first._listeners;
949
951
  const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
950
952
  return new _PluvIO({
951
953
  authorize: authorize2,
954
+ context,
952
955
  debug,
953
956
  events,
957
+ getInitialStorage,
954
958
  onRoomDeleted,
955
959
  onStorageUpdated,
956
960
  platform
package/dist/index.mjs CHANGED
@@ -695,10 +695,9 @@ var IORoom = class {
695
695
  // src/PluvIO.ts
696
696
  var PluvIO = class _PluvIO {
697
697
  constructor(options) {
698
- this._context = {};
699
- this._getInitialStorage = null;
700
698
  this._rooms = /* @__PURE__ */ new Map();
701
699
  this._authorize = null;
700
+ this._context = {};
702
701
  this._events = {
703
702
  $GET_OTHERS: {
704
703
  resolver: {
@@ -799,6 +798,7 @@ var PluvIO = class _PluvIO {
799
798
  }
800
799
  }
801
800
  };
801
+ this._getInitialStorage = null;
802
802
  const {
803
803
  authorize: authorize2,
804
804
  context,
@@ -904,16 +904,20 @@ var PluvIO = class _PluvIO {
904
904
  static merge(first, second) {
905
905
  var _a;
906
906
  const authorize2 = (_a = first._authorize) != null ? _a : void 0;
907
+ const context = first._context;
907
908
  const debug = first._debug;
908
909
  const platform = first._platform;
910
+ const getInitialStorage = first._getInitialStorage;
909
911
  const events1 = first._events;
910
912
  const events2 = second._events;
911
913
  const { onRoomDeleted, onStorageUpdated } = first._listeners;
912
914
  const events = Object.assign(/* @__PURE__ */ Object.create(null), events1, events2);
913
915
  return new _PluvIO({
914
916
  authorize: authorize2,
917
+ context,
915
918
  debug,
916
919
  events,
920
+ getInitialStorage,
917
921
  onRoomDeleted,
918
922
  onStorageUpdated,
919
923
  platform
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/io",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "@pluv/io server-side websocket manager",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -21,8 +21,8 @@
21
21
  "jose": "^4.14.4",
22
22
  "kleur": "^4.1.5",
23
23
  "wonka": "^6.3.4",
24
- "@pluv/crdt-yjs": "^0.10.2",
25
- "@pluv/types": "^0.10.2"
24
+ "@pluv/crdt-yjs": "^0.10.3",
25
+ "@pluv/types": "^0.10.3"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "yjs": "^13.0.0"
@@ -32,8 +32,8 @@
32
32
  "tsup": "^7.2.0",
33
33
  "typescript": "^5.1.6",
34
34
  "yjs": "^13.6.7",
35
- "@pluv/tsconfig": "^0.10.2",
36
- "eslint-config-pluv": "^0.10.2"
35
+ "@pluv/tsconfig": "^0.10.3",
36
+ "eslint-config-pluv": "^0.10.3"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/PluvIO.ts CHANGED
@@ -107,8 +107,6 @@ export class PluvIO<
107
107
  > implements
108
108
  IOLike<TAuthorize, TInput, TOutputBroadcast, TOutputSelf, TOutputSync>
109
109
  {
110
- private _context: TContext = {} as TContext;
111
- private _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
112
110
  private _rooms = new Map<
113
111
  string,
114
112
  IORoom<
@@ -123,6 +121,7 @@ export class PluvIO<
123
121
  >();
124
122
 
125
123
  readonly _authorize: TAuthorize | null = null;
124
+ readonly _context: TContext = {} as TContext;
126
125
  readonly _debug: boolean;
127
126
  readonly _events: InferEventConfig<
128
127
  TPlatform,
@@ -274,6 +273,7 @@ export class PluvIO<
274
273
  TOutputSelf,
275
274
  TOutputSync
276
275
  >;
276
+ readonly _getInitialStorage: GetInitialStorageFn<TPlatform> | null = null;
277
277
  readonly _listeners: PluvIOListeners<TPlatform>;
278
278
  readonly _platform: TPlatform;
279
279
 
@@ -492,9 +492,15 @@ export class PluvIO<
492
492
  > {
493
493
  const authorize = (first._authorize ??
494
494
  undefined) as InferIOAuthorize<TIO1>;
495
+ const context = first._context as InferIOContext<TIO1>;
495
496
  const debug = first._debug;
496
497
  const platform = first._platform as InferIOPlatform<TIO1>;
497
498
 
499
+ const getInitialStorage =
500
+ first._getInitialStorage as GetInitialStorageFn<
501
+ InferIOPlatform<TIO1>
502
+ >;
503
+
498
504
  const events1 = first._events;
499
505
  const events2 = second._events;
500
506
 
@@ -504,8 +510,10 @@ export class PluvIO<
504
510
 
505
511
  return new PluvIO({
506
512
  authorize,
513
+ context,
507
514
  debug,
508
515
  events,
516
+ getInitialStorage,
509
517
  onRoomDeleted,
510
518
  onStorageUpdated,
511
519
  platform,