mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
feature(cloudcmd) remove plugins
This commit is contained in:
parent
b93e759ba6
commit
a61eb22b62
7 changed files with 2 additions and 181 deletions
|
|
@ -20,7 +20,6 @@ const rest = require(DIR + 'rest');
|
|||
const route = require(DIR + 'route');
|
||||
const validate = require(DIR + 'validate');
|
||||
const prefixer = require(DIR + 'prefixer');
|
||||
const pluginer = require(DIR + 'plugins');
|
||||
const terminal = require(DIR + 'terminal');
|
||||
const distribute = require(DIR + 'distribute');
|
||||
|
||||
|
|
@ -53,15 +52,10 @@ module.exports = (params) => {
|
|||
configPath,
|
||||
});
|
||||
|
||||
const {
|
||||
modules,
|
||||
plugins,
|
||||
} = p;
|
||||
const {modules} = p;
|
||||
|
||||
const keys = Object.keys(options);
|
||||
|
||||
checkPlugins(plugins);
|
||||
|
||||
for (const name of keys) {
|
||||
let value = options[name];
|
||||
|
||||
|
|
@ -90,7 +84,6 @@ module.exports = (params) => {
|
|||
});
|
||||
|
||||
return cloudcmd({
|
||||
plugins,
|
||||
modules,
|
||||
config,
|
||||
});
|
||||
|
|
@ -181,7 +174,7 @@ function listen({prefixSocket, socket, config}) {
|
|||
distribute.export(config, socket);
|
||||
}
|
||||
|
||||
function cloudcmd({plugins, modules, config}) {
|
||||
function cloudcmd({modules, config}) {
|
||||
const online = apart(config, 'online');
|
||||
const cache = false;
|
||||
const diff = apart(config, 'diff');
|
||||
|
|
@ -256,7 +249,6 @@ function cloudcmd({plugins, modules, config}) {
|
|||
html: defaultHtml,
|
||||
}),
|
||||
|
||||
pluginer(plugins),
|
||||
ponseStatic,
|
||||
]);
|
||||
|
||||
|
|
@ -297,11 +289,3 @@ function setSW(req, res, next) {
|
|||
next();
|
||||
}
|
||||
|
||||
function checkPlugins(plugins) {
|
||||
if (typeof plugins === 'undefined')
|
||||
return;
|
||||
|
||||
if (!Array.isArray(plugins))
|
||||
throw Error('plugins should be an array!');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue