Comparing version 2.0.0-alpha.59 to 2.0.0-alpha.60
@@ -25,3 +25,3 @@ "use strict"; | ||
.alias('start') | ||
.option('--debug [names]', 'specify debug names') | ||
.option('--debug [namespace]', 'specify debug namespace') | ||
.option('--level [level]', 'specify log level (default: 2)') | ||
@@ -28,0 +28,0 @@ .action((file, options) => { |
@@ -41,3 +41,7 @@ "use strict"; | ||
} | ||
const cacheMap = {}; | ||
function loadEcosystem(type, name) { | ||
const cache = cacheMap[`${type}_${name}`]; | ||
if (cache) | ||
return cache; | ||
const modules = [path_1.resolve(configDir, name), name]; | ||
@@ -49,6 +53,6 @@ const prefix = `koishi-${type}-`; | ||
} | ||
for (const name of modules) { | ||
logger.debug('resolving %c', name); | ||
for (const path of modules) { | ||
logger.debug('resolving %c', path); | ||
try { | ||
return require(name); | ||
return cacheMap[`${type}_${name}`] = require(path); | ||
} | ||
@@ -55,0 +59,0 @@ catch (error) { |
{ | ||
"name": "koishi", | ||
"description": "A QQ bot framework based on CQHTTP", | ||
"version": "2.0.0-alpha.59", | ||
"version": "2.0.0-alpha.60", | ||
"main": "dist/index.js", | ||
@@ -40,8 +40,8 @@ "typings": "dist/index.d.ts", | ||
"kleur": "^4.0.2", | ||
"koishi-core": "^2.0.0-alpha.34", | ||
"koishi-plugin-common": "^3.0.0-alpha.37", | ||
"koishi-plugin-recorder": "^2.0.0-alpha.34", | ||
"koishi-plugin-schedule": "^2.0.0-alpha.38", | ||
"koishi-plugin-status": "^2.0.0-alpha.36", | ||
"koishi-plugin-teach": "^1.0.0-alpha.54", | ||
"koishi-core": "^2.0.0-alpha.35", | ||
"koishi-plugin-common": "^3.0.0-alpha.38", | ||
"koishi-plugin-recorder": "^2.0.0-alpha.35", | ||
"koishi-plugin-schedule": "^2.0.0-alpha.39", | ||
"koishi-plugin-status": "^2.0.0-alpha.37", | ||
"koishi-plugin-teach": "^1.0.0-alpha.55", | ||
"koishi-utils": "^2.1.1", | ||
@@ -48,0 +48,0 @@ "prompts": "^2.3.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
33736
17
369