@pluv/persistence-redis 0.0.0-canary-20261027022227
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/LICENSE +21 -0
- package/README.md +18 -0
- package/dist/index.d.mts +28 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +102 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Shoubhit Dash
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## `@pluv/persistence-redis`
|
|
2
|
+
|
|
3
|
+
> Crdt storage persistence for [@pluv/io](https://www.npmjs.com/package/@pluv/io) rooms on distributed systems. Available for [Node.js](https://nodejs.org/) only.
|
|
4
|
+
|
|
5
|
+
**👉 See full documentation on [docs.pluv.io](https://docs.pluv.io/docs). 👈**
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npm install @pluv/persistence-redis ioredis
|
|
12
|
+
|
|
13
|
+
# yarn
|
|
14
|
+
yarn add @pluv/persistence-redis ioredis
|
|
15
|
+
|
|
16
|
+
# pnpm
|
|
17
|
+
pnpm add @pluv/persistence-redis ioredis
|
|
18
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AbstractPersistence } from "@pluv/io";
|
|
2
|
+
import { JsonObject } from "@pluv/types";
|
|
3
|
+
import { Cluster, Redis } from "ioredis";
|
|
4
|
+
type RedisClient = Cluster | Redis;
|
|
5
|
+
interface PersistenceRedisOptions {
|
|
6
|
+
client: RedisClient;
|
|
7
|
+
}
|
|
8
|
+
export declare class PersistenceRedis extends AbstractPersistence {
|
|
9
|
+
private _client;
|
|
10
|
+
private _initialized;
|
|
11
|
+
constructor(options: PersistenceRedisOptions);
|
|
12
|
+
addUser(room: string, connectionId: string, user: JsonObject | null): Promise<void>;
|
|
13
|
+
deleteStorageState(room: string): Promise<void>;
|
|
14
|
+
deleteUser(room: string, connectionId: string): Promise<void>;
|
|
15
|
+
deleteUsers(room: string): Promise<void>;
|
|
16
|
+
getStorageState(room: string): Promise<string | null>;
|
|
17
|
+
setStorageState(room: string, state: string): Promise<void>;
|
|
18
|
+
getUser(room: string, connectionId: string): Promise<JsonObject | null>;
|
|
19
|
+
getUsers(room: string): Promise<Map<[connectionId: string][0], JsonObject | null>>;
|
|
20
|
+
getUsersSize(room: string): Promise<number>;
|
|
21
|
+
initialize(roomContext: {}): typeof this;
|
|
22
|
+
private _getClusterKey;
|
|
23
|
+
private _getRoomStorageKey;
|
|
24
|
+
private _getRoomUsersKey;
|
|
25
|
+
private _getRoomUsersUserKey;
|
|
26
|
+
}
|
|
27
|
+
export type { RedisClient };
|
|
28
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/PersistenceRedis.ts"],"mappings":";;;KAUY,cAAc,UAAU;UAEnB;EACb,QAAQ;;qBAGC,yBAAyB;UAC1B;UACA;EAER,YAAY,SAAS;EASR,QACT,cACA,sBACA,MAAM,oBACP;EAYU,mBAAmB,eAAe;EAQlC,WAAW,cAAc,uBAAuB;EAmBhD,YAAY,eAAe;EAiB3B,gBAAgB,eAAe;EAQ/B,gBAAgB,cAAc,gBAAgB;EAQ9C,QAAQ,cAAc,uBAAuB,QAAQ;EAUrD,SACT,eACD,QAAQ,KAAK,0BAA0B;EAqB7B,aAAa,eAAe;EAQlC,WAAW;UAUV;UAIA;UAIA;UAIA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AbstractPersistence } from "@pluv/io";
|
|
2
|
+
// src/utils/partitionByLength.ts
|
|
3
|
+
const partitionByLength = (arr, length) => {
|
|
4
|
+
if (!arr.length) return [];
|
|
5
|
+
const head = arr.slice(0, length);
|
|
6
|
+
const tail = arr.slice(length);
|
|
7
|
+
return [head, ...partitionByLength(tail, length)];
|
|
8
|
+
};
|
|
9
|
+
// src/PersistenceRedis.ts
|
|
10
|
+
const DELIMITER = ":::";
|
|
11
|
+
const HASH_TAG = "{PluvPersistenceRedis}";
|
|
12
|
+
const GET_USERS_CONCURRENCY = 4;
|
|
13
|
+
var PersistenceRedis = class PersistenceRedis extends AbstractPersistence {
|
|
14
|
+
_client;
|
|
15
|
+
_initialized = null;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super();
|
|
18
|
+
const { client } = options;
|
|
19
|
+
this._client = client;
|
|
20
|
+
this._initialized = options._initialized;
|
|
21
|
+
}
|
|
22
|
+
async addUser(room, connectionId, user) {
|
|
23
|
+
if (!this._initialized) return;
|
|
24
|
+
await this._initialized;
|
|
25
|
+
await this._client.multi().sadd(this._getRoomUsersKey(room), connectionId).set(this._getRoomUsersUserKey(room, connectionId), JSON.stringify(user)).exec();
|
|
26
|
+
}
|
|
27
|
+
async deleteStorageState(room) {
|
|
28
|
+
if (!this._initialized) return;
|
|
29
|
+
await this._initialized;
|
|
30
|
+
await this._client.del(this._getRoomStorageKey(room));
|
|
31
|
+
}
|
|
32
|
+
async deleteUser(room, connectionId) {
|
|
33
|
+
if (!this._initialized) return;
|
|
34
|
+
await this._initialized;
|
|
35
|
+
const size = await this.getUsersSize(room);
|
|
36
|
+
let multi = this._client.multi().srem(this._getRoomUsersKey(room), connectionId).del(this._getRoomUsersUserKey(room, connectionId));
|
|
37
|
+
if (size === 1) multi = multi.del(this._getRoomStorageKey(room)).del(this._getRoomUsersKey(room));
|
|
38
|
+
await multi.exec();
|
|
39
|
+
}
|
|
40
|
+
async deleteUsers(room) {
|
|
41
|
+
if (!this._initialized) return;
|
|
42
|
+
await this._initialized;
|
|
43
|
+
await (await this._client.smembers(this._getRoomUsersKey(room))).reduce((commands, connectionId) => {
|
|
44
|
+
return commands.del(this._getRoomUsersUserKey(room, connectionId));
|
|
45
|
+
}, this._client.multi().del(this._getRoomUsersKey(room))).exec();
|
|
46
|
+
}
|
|
47
|
+
async getStorageState(room) {
|
|
48
|
+
if (!this._initialized) return null;
|
|
49
|
+
await this._initialized;
|
|
50
|
+
return await this._client.get(this._getRoomStorageKey(room));
|
|
51
|
+
}
|
|
52
|
+
async setStorageState(room, state) {
|
|
53
|
+
if (!this._initialized) return;
|
|
54
|
+
await this._initialized;
|
|
55
|
+
await this._client.set(this._getRoomStorageKey(room), state);
|
|
56
|
+
}
|
|
57
|
+
async getUser(room, connectionId) {
|
|
58
|
+
if (!this._initialized) return null;
|
|
59
|
+
await this._initialized;
|
|
60
|
+
const data = await this._client.get(this._getRoomUsersUserKey(room, connectionId));
|
|
61
|
+
return !data ? null : JSON.parse(data);
|
|
62
|
+
}
|
|
63
|
+
async getUsers(room) {
|
|
64
|
+
if (!this._initialized) return /* @__PURE__ */ new Map();
|
|
65
|
+
await this._initialized;
|
|
66
|
+
const members = await this._client.smembers(this._getRoomUsersKey(room));
|
|
67
|
+
return await partitionByLength(members, GET_USERS_CONCURRENCY).reduce(async (promise, partition) => {
|
|
68
|
+
const map = await promise;
|
|
69
|
+
const promises = partition.map(async (connectionId) => {
|
|
70
|
+
map.set(connectionId, await this.getUser(room, connectionId));
|
|
71
|
+
});
|
|
72
|
+
await Promise.all(promises);
|
|
73
|
+
return map;
|
|
74
|
+
}, Promise.resolve(/* @__PURE__ */ new Map()));
|
|
75
|
+
}
|
|
76
|
+
async getUsersSize(room) {
|
|
77
|
+
if (!this._initialized) return 0;
|
|
78
|
+
await this._initialized;
|
|
79
|
+
return await this._client.scard(this._getRoomUsersKey(room));
|
|
80
|
+
}
|
|
81
|
+
initialize(roomContext) {
|
|
82
|
+
return new PersistenceRedis({
|
|
83
|
+
client: this._client,
|
|
84
|
+
_initialized: Promise.resolve(true)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
_getClusterKey(key) {
|
|
88
|
+
return `${HASH_TAG}${key}`;
|
|
89
|
+
}
|
|
90
|
+
_getRoomStorageKey(room) {
|
|
91
|
+
return this._getClusterKey(`room_storage${DELIMITER}${room}`);
|
|
92
|
+
}
|
|
93
|
+
_getRoomUsersKey(room) {
|
|
94
|
+
return this._getClusterKey(`room_users${DELIMITER}${room}`);
|
|
95
|
+
}
|
|
96
|
+
_getRoomUsersUserKey(room, connectionId) {
|
|
97
|
+
return this._getClusterKey(`${this._getRoomUsersKey(room)}${DELIMITER}${connectionId}`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export { PersistenceRedis };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/partitionByLength.ts","../src/PersistenceRedis.ts"],"sourcesContent":["export const partitionByLength = <T>(\n arr: readonly T[] | T[],\n length: number,\n): readonly (readonly T[])[] => {\n if (!arr.length) return [];\n\n const head = arr.slice(0, length);\n const tail = arr.slice(length);\n\n return [head, ...partitionByLength(tail, length)];\n};\n","import { AbstractPersistence } from \"@pluv/io\";\nimport type { JsonObject } from \"@pluv/types\";\nimport type { Cluster, Redis } from \"ioredis\";\nimport { partitionByLength } from \"./utils\";\n\nconst DELIMITER = \":::\";\nconst HASH_TAG = \"{PluvPersistenceRedis}\";\n\nconst GET_USERS_CONCURRENCY = 4;\n\nexport type RedisClient = Cluster | Redis;\n\nexport interface PersistenceRedisOptions {\n client: RedisClient;\n}\n\nexport class PersistenceRedis extends AbstractPersistence {\n private _client: RedisClient;\n private _initialized: Promise<true> | null = null;\n\n constructor(options: PersistenceRedisOptions) {\n super();\n\n const { client } = options;\n\n this._client = client;\n this._initialized = (options as any)._initialized;\n }\n\n public async addUser(\n room: string,\n connectionId: string,\n user: JsonObject | null,\n ): Promise<void> {\n if (!this._initialized) return;\n\n await this._initialized;\n\n await this._client\n .multi()\n .sadd(this._getRoomUsersKey(room), connectionId)\n .set(this._getRoomUsersUserKey(room, connectionId), JSON.stringify(user))\n .exec();\n }\n\n public async deleteStorageState(room: string): Promise<void> {\n if (!this._initialized) return;\n\n await this._initialized;\n\n await this._client.del(this._getRoomStorageKey(room));\n }\n\n public async deleteUser(room: string, connectionId: string): Promise<void> {\n if (!this._initialized) return;\n\n await this._initialized;\n\n const size = await this.getUsersSize(room);\n\n let multi = this._client\n .multi()\n .srem(this._getRoomUsersKey(room), connectionId)\n .del(this._getRoomUsersUserKey(room, connectionId));\n\n if (size === 1) {\n multi = multi.del(this._getRoomStorageKey(room)).del(this._getRoomUsersKey(room));\n }\n\n await multi.exec();\n }\n\n public async deleteUsers(room: string): Promise<void> {\n if (!this._initialized) return;\n\n await this._initialized;\n\n const members = await this._client.smembers(this._getRoomUsersKey(room));\n\n await members\n .reduce(\n (commands, connectionId) => {\n return commands.del(this._getRoomUsersUserKey(room, connectionId));\n },\n this._client.multi().del(this._getRoomUsersKey(room)),\n )\n .exec();\n }\n\n public async getStorageState(room: string): Promise<string | null> {\n if (!this._initialized) return null;\n\n await this._initialized;\n\n return await this._client.get(this._getRoomStorageKey(room));\n }\n\n public async setStorageState(room: string, state: string): Promise<void> {\n if (!this._initialized) return;\n\n await this._initialized;\n\n await this._client.set(this._getRoomStorageKey(room), state);\n }\n\n public async getUser(room: string, connectionId: string): Promise<JsonObject | null> {\n if (!this._initialized) return null;\n\n await this._initialized;\n\n const data = await this._client.get(this._getRoomUsersUserKey(room, connectionId));\n\n return !data ? null : JSON.parse(data);\n }\n\n public async getUsers(\n room: string,\n ): Promise<Map<[connectionId: string][0], JsonObject | null>> {\n if (!this._initialized) return new Map();\n\n await this._initialized;\n\n const members = await this._client.smembers(this._getRoomUsersKey(room));\n const partitions = partitionByLength(members, GET_USERS_CONCURRENCY);\n\n return await partitions.reduce(async (promise, partition) => {\n const map = await promise;\n\n const promises = partition.map(async (connectionId) => {\n map.set(connectionId, await this.getUser(room, connectionId));\n });\n\n await Promise.all(promises);\n\n return map;\n }, Promise.resolve(new Map<string, JsonObject | null>()));\n }\n\n public async getUsersSize(room: string): Promise<number> {\n if (!this._initialized) return 0;\n\n await this._initialized;\n\n return await this._client.scard(this._getRoomUsersKey(room));\n }\n\n public initialize(roomContext: {}): typeof this {\n return new PersistenceRedis({\n client: this._client,\n // Spreading avoids an excess property check, so `_initialized` can be handed to the\n // constructor without exposing it on PersistenceRedisOptions.\n // oxlint-disable-next-line unicorn/no-useless-spread\n ...{ _initialized: Promise.resolve(true as const) },\n }) as typeof this;\n }\n\n private _getClusterKey(key: string): string {\n return `${HASH_TAG}${key}`;\n }\n\n private _getRoomStorageKey(room: string): string {\n return this._getClusterKey(`room_storage${DELIMITER}${room}`);\n }\n\n private _getRoomUsersKey(room: string): string {\n return this._getClusterKey(`room_users${DELIMITER}${room}`);\n }\n\n private _getRoomUsersUserKey(room: string, connectionId: string): string {\n return this._getClusterKey(`${this._getRoomUsersKey(room)}${DELIMITER}${connectionId}`);\n }\n}\n"],"mappings":";;AAAA,MAAa,qBACT,KACA,WAC4B;CAC5B,IAAI,CAAC,IAAI,QAAQ,OAAO,CAAC;CAEzB,MAAM,OAAO,IAAI,MAAM,GAAG,MAAM;CAChC,MAAM,OAAO,IAAI,MAAM,MAAM;CAE7B,OAAO,CAAC,MAAM,GAAG,kBAAkB,MAAM,MAAM,CAAC;AACpD;;ACLA,MAAM,YAAY;AAClB,MAAM,WAAW;AAEjB,MAAM,wBAAwB;AAQ9B,IAAa,mBAAb,MAAa,yBAAyB,oBAAoB;CACtD;CACA,eAA6C;CAE7C,YAAY,SAAkC;EAC1C,MAAM;EAEN,MAAM,EAAE,WAAW;EAEnB,KAAK,UAAU;EACf,KAAK,eAAgB,QAAgB;CACzC;CAEA,MAAa,QACT,MACA,cACA,MACa;EACb,IAAI,CAAC,KAAK,cAAc;EAExB,MAAM,KAAK;EAEX,MAAM,KAAK,QACN,MAAM,CAAC,CACP,KAAK,KAAK,iBAAiB,IAAI,GAAG,YAAY,CAAC,CAC/C,IAAI,KAAK,qBAAqB,MAAM,YAAY,GAAG,KAAK,UAAU,IAAI,CAAC,CAAC,CACxE,KAAK;CACd;CAEA,MAAa,mBAAmB,MAA6B;EACzD,IAAI,CAAC,KAAK,cAAc;EAExB,MAAM,KAAK;EAEX,MAAM,KAAK,QAAQ,IAAI,KAAK,mBAAmB,IAAI,CAAC;CACxD;CAEA,MAAa,WAAW,MAAc,cAAqC;EACvE,IAAI,CAAC,KAAK,cAAc;EAExB,MAAM,KAAK;EAEX,MAAM,OAAO,MAAM,KAAK,aAAa,IAAI;EAEzC,IAAI,QAAQ,KAAK,QACZ,MAAM,CAAC,CACP,KAAK,KAAK,iBAAiB,IAAI,GAAG,YAAY,CAAC,CAC/C,IAAI,KAAK,qBAAqB,MAAM,YAAY,CAAC;EAEtD,IAAI,SAAS,GACT,QAAQ,MAAM,IAAI,KAAK,mBAAmB,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,IAAI,CAAC;EAGpF,MAAM,MAAM,KAAK;CACrB;CAEA,MAAa,YAAY,MAA6B;EAClD,IAAI,CAAC,KAAK,cAAc;EAExB,MAAM,KAAK;EAIX,OAAM,MAFgB,KAAK,QAAQ,SAAS,KAAK,iBAAiB,IAAI,CAAC,EAAA,CAGlE,QACI,UAAU,iBAAiB;GACxB,OAAO,SAAS,IAAI,KAAK,qBAAqB,MAAM,YAAY,CAAC;EACrE,GACA,KAAK,QAAQ,MAAM,CAAC,CAAC,IAAI,KAAK,iBAAiB,IAAI,CAAC,CACxD,CAAC,CACA,KAAK;CACd;CAEA,MAAa,gBAAgB,MAAsC;EAC/D,IAAI,CAAC,KAAK,cAAc,OAAO;EAE/B,MAAM,KAAK;EAEX,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,mBAAmB,IAAI,CAAC;CAC/D;CAEA,MAAa,gBAAgB,MAAc,OAA8B;EACrE,IAAI,CAAC,KAAK,cAAc;EAExB,MAAM,KAAK;EAEX,MAAM,KAAK,QAAQ,IAAI,KAAK,mBAAmB,IAAI,GAAG,KAAK;CAC/D;CAEA,MAAa,QAAQ,MAAc,cAAkD;EACjF,IAAI,CAAC,KAAK,cAAc,OAAO;EAE/B,MAAM,KAAK;EAEX,MAAM,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,qBAAqB,MAAM,YAAY,CAAC;EAEjF,OAAO,CAAC,OAAO,OAAO,KAAK,MAAM,IAAI;CACzC;CAEA,MAAa,SACT,MAC0D;EAC1D,IAAI,CAAC,KAAK,cAAc,uBAAO,IAAI,IAAI;EAEvC,MAAM,KAAK;EAEX,MAAM,UAAU,MAAM,KAAK,QAAQ,SAAS,KAAK,iBAAiB,IAAI,CAAC;EAGvE,OAAO,MAFY,kBAAkB,SAAS,qBAExB,CAAC,CAAC,OAAO,OAAO,SAAS,cAAc;GACzD,MAAM,MAAM,MAAM;GAElB,MAAM,WAAW,UAAU,IAAI,OAAO,iBAAiB;IACnD,IAAI,IAAI,cAAc,MAAM,KAAK,QAAQ,MAAM,YAAY,CAAC;GAChE,CAAC;GAED,MAAM,QAAQ,IAAI,QAAQ;GAE1B,OAAO;EACX,GAAG,QAAQ,wBAAQ,IAAI,IAA+B,CAAC,CAAC;CAC5D;CAEA,MAAa,aAAa,MAA+B;EACrD,IAAI,CAAC,KAAK,cAAc,OAAO;EAE/B,MAAM,KAAK;EAEX,OAAO,MAAM,KAAK,QAAQ,MAAM,KAAK,iBAAiB,IAAI,CAAC;CAC/D;CAEA,WAAkB,aAA8B;EAC5C,OAAO,IAAI,iBAAiB;GACxB,QAAQ,KAAK;GAIR,cAAc,QAAQ,QAAQ,IAAa;EACpD,CAAC;CACL;CAEA,eAAuB,KAAqB;EACxC,OAAO,GAAG,WAAW;CACzB;CAEA,mBAA2B,MAAsB;EAC7C,OAAO,KAAK,eAAe,eAAe,YAAY,MAAM;CAChE;CAEA,iBAAyB,MAAsB;EAC3C,OAAO,KAAK,eAAe,aAAa,YAAY,MAAM;CAC9D;CAEA,qBAA6B,MAAc,cAA8B;EACrE,OAAO,KAAK,eAAe,GAAG,KAAK,iBAAiB,IAAI,IAAI,YAAY,cAAc;CAC1F;AACJ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pluv/persistence-redis",
|
|
3
|
+
"version": "0.0.0-canary-20261027022227",
|
|
4
|
+
"description": "@pluv/io crdt storage persistence for node.js",
|
|
5
|
+
"author": {
|
|
6
|
+
"email": "david@pluv.io",
|
|
7
|
+
"name": "i3dly",
|
|
8
|
+
"url": "https://github.com/i3dly"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "https://github.com/pluv-io/pluv",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/pluv-io/pluv.git",
|
|
15
|
+
"directory": "packages/persistence-redis"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@pluv/io": "^0.0.0-canary-20261027022227",
|
|
27
|
+
"@pluv/types": "^0.0.0-canary-20261027022227",
|
|
28
|
+
"@types/node": "^26.6.5"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"ioredis": "^5.0.0 || ^6.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@pluv/tsconfig": "^0.0.0-canary-20261027022227",
|
|
35
|
+
"ioredis": "^6.0.0",
|
|
36
|
+
"tsdown": "^0.23.2",
|
|
37
|
+
"typescript": "7.1.0-beta"
|
|
38
|
+
},
|
|
39
|
+
"exports": {
|
|
40
|
+
".": "./dist/index.mjs",
|
|
41
|
+
"./*": "./*"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsdown",
|
|
45
|
+
"dev": "tsdown --watch",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
48
|
+
}
|
|
49
|
+
}
|