@pluv/addon-indexeddb 1.0.1 → 2.0.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/addon-indexeddb@1.0.1 build /home/runner/work/pluv/pluv/packages/addon-indexeddb
2
+ > @pluv/addon-indexeddb@2.0.0 build /home/runner/work/pluv/pluv/packages/addon-indexeddb
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
  CJS dist/index.js 4.79 KB
12
- CJS ⚡️ Build success in 88ms
12
+ CJS ⚡️ Build success in 64ms
13
13
  ESM dist/index.mjs 3.75 KB
14
- ESM ⚡️ Build success in 94ms
14
+ ESM ⚡️ Build success in 68ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3772ms
17
- DTS dist/index.d.mts 771.00 B
18
- DTS dist/index.d.ts 771.00 B
16
+ DTS ⚡️ Build success in 3651ms
17
+ DTS dist/index.d.mts 726.00 B
18
+ DTS dist/index.d.ts 726.00 B
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @pluv/addon-indexeddb
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [047a1d8]
8
+ - Updated dependencies [0806212]
9
+ - Updated dependencies [3a34dbb]
10
+ - @pluv/client@2.0.0
11
+ - @pluv/crdt@2.0.0
12
+
13
+ ## 1.0.2
14
+
15
+ ### Patch Changes
16
+
17
+ - d87159c: Restored `@pluv/addon-indexeddb` functionality, and fixed `@pluv/addon-indexeddb` sometimes duplicating storage operations based on `initialStorage` values.
18
+ - Updated dependencies [d87159c]
19
+ - @pluv/client@1.0.2
20
+ - @pluv/crdt@1.0.2
21
+
3
22
  ## 1.0.1
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { PluvRoom, PluvRoomAddon } from '@pluv/client';
2
- import { CrdtType } from '@pluv/crdt';
2
+ import { AbstractCrdtDocFactory } from '@pluv/crdt';
3
3
  import { IOLike, JsonObject } from '@pluv/types';
4
4
 
5
- interface AddonIndexedDBConfig<TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
6
- enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TStorage>) => boolean);
5
+ interface AddonIndexedDBConfig<TIO extends IOLike<any, any>, TMetadata extends JsonObject, TPresence extends JsonObject, TCrdt extends AbstractCrdtDocFactory<any>> {
6
+ enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TCrdt>) => boolean);
7
7
  }
8
- declare const addonIndexedDB: <TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}>(config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TStorage>) => PluvRoomAddon<TIO, TMetadata, TPresence, TStorage>;
8
+ declare const addonIndexedDB: <TIO extends IOLike<any, any>, TMetadata extends JsonObject, TPresence extends JsonObject, TCrdt extends AbstractCrdtDocFactory<any>>(config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TCrdt>) => PluvRoomAddon<TIO, TMetadata, TPresence, TCrdt>;
9
9
 
10
10
  export { addonIndexedDB };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { PluvRoom, PluvRoomAddon } from '@pluv/client';
2
- import { CrdtType } from '@pluv/crdt';
2
+ import { AbstractCrdtDocFactory } from '@pluv/crdt';
3
3
  import { IOLike, JsonObject } from '@pluv/types';
4
4
 
5
- interface AddonIndexedDBConfig<TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}> {
6
- enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TStorage>) => boolean);
5
+ interface AddonIndexedDBConfig<TIO extends IOLike<any, any>, TMetadata extends JsonObject, TPresence extends JsonObject, TCrdt extends AbstractCrdtDocFactory<any>> {
6
+ enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TCrdt>) => boolean);
7
7
  }
8
- declare const addonIndexedDB: <TIO extends IOLike<any, any>, TMetadata extends JsonObject = {}, TPresence extends JsonObject = {}, TStorage extends Record<string, CrdtType<any, any>> = {}>(config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TStorage>) => PluvRoomAddon<TIO, TMetadata, TPresence, TStorage>;
8
+ declare const addonIndexedDB: <TIO extends IOLike<any, any>, TMetadata extends JsonObject, TPresence extends JsonObject, TCrdt extends AbstractCrdtDocFactory<any>>(config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TCrdt>) => PluvRoomAddon<TIO, TMetadata, TPresence, TCrdt>;
9
9
 
10
10
  export { addonIndexedDB };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/addon-indexeddb",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "@pluv/io indexeddb for client storage persistence",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,16 +18,16 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "idb": "^8.0.2",
21
- "@pluv/client": "^1.0.1",
22
- "@pluv/crdt": "^1.0.1"
21
+ "@pluv/crdt": "^2.0.0",
22
+ "@pluv/client": "^2.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "eslint": "^9.25.1",
26
26
  "tsup": "^8.4.0",
27
27
  "typescript": "^5.8.3",
28
- "@pluv/tsconfig": "^1.0.1",
29
- "@pluv/types": "^1.0.1",
30
- "eslint-config-pluv": "^1.0.1"
28
+ "@pluv/types": "^2.0.0",
29
+ "@pluv/tsconfig": "^2.0.0",
30
+ "eslint-config-pluv": "^2.0.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -1,25 +1,25 @@
1
1
  import type { PluvRoom, PluvRoomAddon } from "@pluv/client";
2
- import type { CrdtType } from "@pluv/crdt";
2
+ import type { AbstractCrdtDocFactory, CrdtType } from "@pluv/crdt";
3
3
  import type { IOLike, JsonObject } from "@pluv/types";
4
4
  import { IndexedDBStorage } from "./IndexedDBStorage";
5
5
 
6
6
  export interface AddonIndexedDBConfig<
7
7
  TIO extends IOLike<any, any>,
8
- TMetadata extends JsonObject = {},
9
- TPresence extends JsonObject = {},
10
- TStorage extends Record<string, CrdtType<any, any>> = {},
8
+ TMetadata extends JsonObject,
9
+ TPresence extends JsonObject,
10
+ TCrdt extends AbstractCrdtDocFactory<any>,
11
11
  > {
12
- enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TStorage>) => boolean);
12
+ enabled?: boolean | ((room: PluvRoom<TIO, TMetadata, TPresence, TCrdt>) => boolean);
13
13
  }
14
14
 
15
15
  export const addonIndexedDB = <
16
16
  TIO extends IOLike<any, any>,
17
- TMetadata extends JsonObject = {},
18
- TPresence extends JsonObject = {},
19
- TStorage extends Record<string, CrdtType<any, any>> = {},
17
+ TMetadata extends JsonObject,
18
+ TPresence extends JsonObject,
19
+ TCrdt extends AbstractCrdtDocFactory<any>,
20
20
  >(
21
- config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TStorage>,
22
- ): PluvRoomAddon<TIO, TMetadata, TPresence, TStorage> => {
21
+ config?: AddonIndexedDBConfig<TIO, TMetadata, TPresence, TCrdt>,
22
+ ): PluvRoomAddon<TIO, TMetadata, TPresence, TCrdt> => {
23
23
  const { enabled = true } = config ?? {};
24
24
 
25
25
  return ({ room }) => {