diff --git a/.npmrc b/.npmrc index cffe8cd..43c97e7 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -save-exact=true +package-lock=false diff --git a/package.json b/package.json index cba4563..db86ddb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-redis", - "version": "1.1.0", + "version": "2.0.0", "description": "Plugin used to centralize management of Redis connections in Strapi", "strapi": { "displayName": "Redis", @@ -11,8 +11,11 @@ }, "dependencies": { "chalk": "4.1.2", - "debug": "4.3.4", - "ioredis": "5.2.4" + "debug": "4.3.5", + "ioredis": "5.4.1" + }, + "peerDependencies": { + "@strapi/strapi": "^5.0.0-rc.4" }, "scripts": {}, "author": { diff --git a/server/register.js b/server/register.js index e00dd74..ed3b633 100644 --- a/server/register.js +++ b/server/register.js @@ -1,6 +1,6 @@ -'use strict' +'use strict'; -const debug = require('debug') +const debug = require('debug'); module.exports = async ({ strapi }) => { // Load plugin Config @@ -8,12 +8,12 @@ module.exports = async ({ strapi }) => { // Configure plugin debug if (coreConfig.settings.debug === true) { - debug.enable('strapi:strapi-plugin-redis') + debug.enable('strapi:strapi-plugin-redis'); } // Allow plugin + ioredis debug if (coreConfig.settings.debug === true && coreConfig.settings.debugIORedis === true) { - debug.enable('strapi:strapi-plugin-redis,ioredis:*') + debug.enable('strapi:strapi-plugin-redis,ioredis:*'); } // Construct Redis API @@ -26,14 +26,15 @@ module.exports = async ({ strapi }) => { await strapi.plugin('redis').service('connection').buildAll(coreConfig); // Construct Admin Permissions - const actions = [ - { - section: 'settings', - category: 'redis', - displayName: 'Access the Redis Overview page', - uid: 'settings.read', - pluginName: 'redis', - }, - ]; - await strapi.admin.services.permission.actionProvider.registerMany(actions); + // Commenting this since it's not needed for now, there is no admin panel for this plugin + // const actions = [ + // { + // section: 'settings', + // category: 'redis', + // displayName: 'Access the Redis Overview page', + // uid: 'settings.read', + // pluginName: 'redis', + // }, + // ]; + // await strapi.admin.services.permission.actionProvider.registerMany(actions); }; diff --git a/server/services/connection.js b/server/services/connection.js index 1ec416b..728e3ca 100644 --- a/server/services/connection.js +++ b/server/services/connection.js @@ -24,7 +24,7 @@ module.exports = ({ strapi }) => ({ debug(`${chalk.red('Failed to build')} ${name} connection - ${chalk.blue('cluster')}`); } - // Check for sentinel config + // Check for sentinel config } else if (nameConfig.connection.sentinels) { delete nameConfig.connection.host; delete nameConfig.connection.port; @@ -37,7 +37,7 @@ module.exports = ({ strapi }) => ({ debug(`${chalk.red('Failed to build')} ${name} connection - ${chalk.yellow('sentinel')}`); } - // Check for regular single connection + // Check for regular single connection } else { try { strapi.redis.connections[name] = { diff --git a/yarn.lock b/yarn.lock index f696346..c9bda95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,14 +39,21 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -debug@4.3.4, debug@^4.3.4: +debug@4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + dependencies: + ms "2.1.2" + +debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -denque@^2.0.1: +denque@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw== @@ -56,15 +63,15 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -ioredis@5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.2.4.tgz#9e262a668bc29bae98f2054c1e0d7efd86996b96" - integrity sha512-qIpuAEt32lZJQ0XyrloCRdlEdUUNGG9i0UOk6zgzK6igyudNWqEBxfH6OlbnOOoBBvr1WB02mm8fR55CnikRng== +ioredis@5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.4.1.tgz#1c56b70b759f01465913887375ed809134296f40" + integrity sha512-2YZsvl7jopIa1gaePkeMtd9rAcSjOOjPtpcLlOeusyO+XH2SK5ZcT+UCrElPP+WVIInh2TzeI4XW9ENaSLVVHA== dependencies: "@ioredis/commands" "^1.1.1" cluster-key-slot "^1.1.0" debug "^4.3.4" - denque "^2.0.1" + denque "^2.1.0" lodash.defaults "^4.2.0" lodash.isarguments "^3.1.0" redis-errors "^1.2.0"