diff --git a/package.json b/package.json index 0d115b3..5cdd734 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "autoprefixer": "^10.4.20", "debug": "^4.3.6", "express": "^4.19.2", - "ioredis": "^4.28.5", + "ioredis": "^5.4.2", "next": "^15.1.3", "next-themes": "^0.4.4", "next-view-transitions": "^0.3.4", @@ -57,7 +57,6 @@ }, "devDependencies": { "@types/debug": "^4.1.12", - "@types/ioredis": "^4.28.10", "@types/node": "^22.10.2", "@types/react": "^19.0.2", "@typescript-eslint/eslint-plugin": "^8.18.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ab7890..e91e3b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ dependencies: specifier: ^4.19.2 version: 4.21.2 ioredis: - specifier: ^4.28.5 - version: 4.28.5 + specifier: ^5.4.2 + version: 5.4.2 next: specifier: ^15.1.3 version: 15.1.3(react-dom@19.0.0)(react@19.0.0) @@ -73,9 +73,6 @@ devDependencies: '@types/debug': specifier: ^4.1.12 version: 4.1.12 - '@types/ioredis': - specifier: ^4.28.10 - version: 4.28.10 '@types/node': specifier: ^22.10.2 version: 22.10.5 @@ -406,6 +403,10 @@ packages: dev: false optional: true + /@ioredis/commands@1.2.0: + resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==} + dev: false + /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -641,12 +642,6 @@ packages: resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} dev: false - /@types/ioredis@4.28.10: - resolution: {integrity: sha512-69LyhUgrXdgcNDv7ogs1qXZomnfOEnSmrmMFqKgt1XMJxmoOSG/u3wYy13yACIfKuMJ8IhKgHafDO3sx19zVQQ==} - dependencies: - '@types/node': 22.10.5 - dev: true - /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true @@ -1452,8 +1447,8 @@ packages: object-keys: 1.1.1 dev: true - /denque@1.5.1: - resolution: {integrity: sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==} + /denque@2.1.0: + resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} dev: false @@ -2507,18 +2502,16 @@ packages: side-channel: 1.1.0 dev: true - /ioredis@4.28.5: - resolution: {integrity: sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A==} - engines: {node: '>=6'} + /ioredis@5.4.2: + resolution: {integrity: sha512-0SZXGNGZ+WzISQ67QDyZ2x0+wVxjjUndtD8oSeik/4ajifeiRufed8fCb8QW8VMyi4MXcS+UO1k/0NGhvq1PAg==} + engines: {node: '>=12.22.0'} dependencies: + '@ioredis/commands': 1.2.0 cluster-key-slot: 1.1.2 debug: 4.4.0(supports-color@5.5.0) - denque: 1.5.1 + denque: 2.1.0 lodash.defaults: 4.2.0 - lodash.flatten: 4.4.0 lodash.isarguments: 3.1.0 - p-map: 2.1.0 - redis-commands: 1.7.0 redis-errors: 1.2.0 redis-parser: 3.0.0 standard-as-callback: 2.1.0 @@ -2988,10 +2981,6 @@ packages: resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} dev: false - /lodash.flatten@4.4.0: - resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} - dev: false - /lodash.isarguments@3.1.0: resolution: {integrity: sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==} dev: false @@ -3385,11 +3374,6 @@ packages: p-limit: 3.1.0 dev: true - /p-map@2.1.0: - resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} - engines: {node: '>=6'} - dev: false - /package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} dev: false @@ -3695,10 +3679,6 @@ packages: picomatch: 2.3.1 dev: false - /redis-commands@1.7.0: - resolution: {integrity: sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==} - dev: false - /redis-errors@1.2.0: resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==} engines: {node: '>=4'} diff --git a/src/channel.ts b/src/channel.ts index 8d7568c..c22c352 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -209,7 +209,7 @@ export class MemoryChannelRepo implements ChannelRepo { } export class RedisChannelRepo implements ChannelRepo { - client: Redis.Redis + client: Redis constructor() { this.client = getRedisClient() diff --git a/src/redisClient.ts b/src/redisClient.ts index 6bf3aaa..6383758 100644 --- a/src/redisClient.ts +++ b/src/redisClient.ts @@ -2,11 +2,13 @@ import Redis from 'ioredis' export { Redis } -let redisClient: Redis.Redis | null = null +let redisClient: Redis | null = null -export function getRedisClient(): Redis.Redis { +export function getRedisClient(): Redis { if (!redisClient) { - redisClient = new Redis(process.env.REDIS_URL) + redisClient = process.env.REDIS_URL + ? new Redis(process.env.REDIS_URL) + : new Redis() } return redisClient }