@pluv/persistence-redis 0.44.2 → 1.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.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +24 -0
- package/package.json +5 -5
- package/src/PersistenceRedis.ts +8 -2
- package/src/utils/partitionByLength.ts +4 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/persistence-redis@0.
|
|
2
|
+
> @pluv/persistence-redis@1.0.1 build /home/runner/work/pluv/pluv/packages/persistence-redis
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m4.81 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 91ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.js [22m[32m5.83 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 105ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m4.81 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 105ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4402ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m1.17 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.17 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @pluv/persistence-redis
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [c583be9]
|
|
8
|
+
- @pluv/io@1.0.1
|
|
9
|
+
- @pluv/types@1.0.1
|
|
10
|
+
|
|
11
|
+
## 1.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- af94706: pluv.io is now stable and production ready!
|
|
16
|
+
|
|
17
|
+
With this v1 release, pluv.io will now follow [semantic versioning](https://semver.org/) with more comprehensive release notes for future changes to the library.
|
|
18
|
+
|
|
19
|
+
Checkout the [full documentation here](https://pluv.io/docs/introduction) to get started today!
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [af94706]
|
|
24
|
+
- @pluv/io@1.0.0
|
|
25
|
+
- @pluv/types@1.0.0
|
|
26
|
+
|
|
3
27
|
## 0.44.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/persistence-redis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "@pluv/io crdt storage persistence for node.js",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@types/node": "^22.15.3",
|
|
21
|
-
"@pluv/io": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/io": "^1.0.1",
|
|
22
|
+
"@pluv/types": "^1.0.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"ioredis": "^5.0.0"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"ioredis": "^5.6.1",
|
|
30
30
|
"tsup": "^8.4.0",
|
|
31
31
|
"typescript": "^5.8.3",
|
|
32
|
-
"@pluv/tsconfig": "^0.
|
|
33
|
-
"eslint-config-pluv": "^0.
|
|
32
|
+
"@pluv/tsconfig": "^1.0.1",
|
|
33
|
+
"eslint-config-pluv": "^1.0.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PersistenceRedis.ts
CHANGED
|
@@ -26,7 +26,11 @@ export class PersistenceRedis extends AbstractPersistence {
|
|
|
26
26
|
this._client = client;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
public async addUser(
|
|
29
|
+
public async addUser(
|
|
30
|
+
room: string,
|
|
31
|
+
connectionId: string,
|
|
32
|
+
user: JsonObject | null,
|
|
33
|
+
): Promise<void> {
|
|
30
34
|
if (!this._initialized) return;
|
|
31
35
|
|
|
32
36
|
await this._initialized;
|
|
@@ -108,7 +112,9 @@ export class PersistenceRedis extends AbstractPersistence {
|
|
|
108
112
|
return !data ? null : JSON.parse(data);
|
|
109
113
|
}
|
|
110
114
|
|
|
111
|
-
public async getUsers(
|
|
115
|
+
public async getUsers(
|
|
116
|
+
room: string,
|
|
117
|
+
): Promise<Map<[connectionId: string][0], JsonObject | null>> {
|
|
112
118
|
if (!this._initialized) return new Map();
|
|
113
119
|
|
|
114
120
|
await this._initialized;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export const partitionByLength = <T>(
|
|
1
|
+
export const partitionByLength = <T>(
|
|
2
|
+
arr: readonly T[] | T[],
|
|
3
|
+
length: number,
|
|
4
|
+
): readonly (readonly T[])[] => {
|
|
2
5
|
if (!arr.length) return [];
|
|
3
6
|
|
|
4
7
|
const head = arr.slice(0, length);
|