chore: cleanup, node14 and new admin default
This commit is contained in:
parent
c7c18633d7
commit
89bb9a8f25
244 changed files with 3957 additions and 39487 deletions
|
|
@ -13,7 +13,7 @@ const pluginCodes = {
|
|||
ZERO_CONF: 'zero-conf'
|
||||
}
|
||||
|
||||
module.exports = _.assign({load, loadSchemas}, pluginCodes)
|
||||
module.exports = _.assign({load}, pluginCodes)
|
||||
|
||||
function load (type, pluginCode) {
|
||||
if (!_.includes(type, _.values(pluginCodes))) {
|
||||
|
|
@ -28,11 +28,3 @@ function load (type, pluginCode) {
|
|||
|
||||
return require(`./plugins/${type}/${pluginCode}/${pluginCode}`)
|
||||
}
|
||||
|
||||
function loadSchemas () {
|
||||
const schemasRoot = path.resolve(__dirname, '..', 'schemas')
|
||||
const schemaFiles = fs.readdirSync(schemasRoot)
|
||||
const stripJson = fileName => fileName.slice(0, -5)
|
||||
const readSchema = fileName => JSON.parse(fs.readFileSync(path.resolve(schemasRoot, fileName)))
|
||||
return _.zipObject(_.map(stripJson, schemaFiles), _.map(readSchema, schemaFiles))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue