Skip to content

Commit a61eb22

Browse files
committed
feature(cloudcmd) remove plugins
1 parent b93e759 commit a61eb22

File tree

7 files changed

+2
-181
lines changed

7 files changed

+2
-181
lines changed

HELP.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,6 @@ const config = {
680680
name: 'cloudcmd :)'
681681
};
682682

683-
const plugins = [
684-
__dirname + '/plugin.js'
685-
];
686-
687683
const filePicker = {
688684
data: {
689685
FilePicker: {
@@ -709,7 +705,6 @@ const configManager = createConfigManager({
709705
app.use(prefix, cloudcmd({
710706
socket, // used by Config, Edit (optional) and Console (required)
711707
config, // config data (optional)
712-
plugins, // DEPRECATED, use User Menu instead
713708
modules, // optional
714709
configManager, // optional
715710
));

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ const config = {
9090
name: 'cloudcmd :)',
9191
};
9292

93-
const plugins = [
94-
__dirname + '/plugin.js'
95-
];
96-
9793
const filePicker = {
9894
data: {
9995
FilePicker: {
@@ -119,7 +115,6 @@ const configManager = createConfigManager({
119115
app.use(prefix, cloudcmd({
120116
socket, // used by Config, Edit (optional) and Console (required)
121117
config, // config data (optional)
122-
plugins, // DEPRECATED, use User Menu instead
123118
modules, // optional
124119
configManager, // optional
125120
}));

client/client.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ function CloudCmdProto(DOM) {
141141
const func = bind(exec.series, [
142142
initModules,
143143
baseInit,
144-
loadPlugins,
145144
loadStyle,
146145
exec.with(CloudCmd.route, location.hash),
147146
], noop);
@@ -182,13 +181,6 @@ function CloudCmdProto(DOM) {
182181
load.css(name, callback);
183182
}
184183

185-
function loadPlugins(callback) {
186-
const {prefix} = CloudCmd;
187-
const plugins = prefix + '/plugins.js';
188-
189-
load.js(plugins, callback);
190-
}
191-
192184
this.route = (path) => {
193185
const query = path.split('/');
194186

server/cloudcmd.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const rest = require(DIR + 'rest');
2020
const route = require(DIR + 'route');
2121
const validate = require(DIR + 'validate');
2222
const prefixer = require(DIR + 'prefixer');
23-
const pluginer = require(DIR + 'plugins');
2423
const terminal = require(DIR + 'terminal');
2524
const distribute = require(DIR + 'distribute');
2625

@@ -53,15 +52,10 @@ module.exports = (params) => {
5352
configPath,
5453
});
5554

56-
const {
57-
modules,
58-
plugins,
59-
} = p;
55+
const {modules} = p;
6056

6157
const keys = Object.keys(options);
6258

63-
checkPlugins(plugins);
64-
6559
for (const name of keys) {
6660
let value = options[name];
6761

@@ -90,7 +84,6 @@ module.exports = (params) => {
9084
});
9185

9286
return cloudcmd({
93-
plugins,
9487
modules,
9588
config,
9689
});
@@ -181,7 +174,7 @@ function listen({prefixSocket, socket, config}) {
181174
distribute.export(config, socket);
182175
}
183176

184-
function cloudcmd({plugins, modules, config}) {
177+
function cloudcmd({modules, config}) {
185178
const online = apart(config, 'online');
186179
const cache = false;
187180
const diff = apart(config, 'diff');
@@ -256,7 +249,6 @@ function cloudcmd({plugins, modules, config}) {
256249
html: defaultHtml,
257250
}),
258251

259-
pluginer(plugins),
260252
ponseStatic,
261253
]);
262254

@@ -297,11 +289,3 @@ function setSW(req, res, next) {
297289
next();
298290
}
299291

300-
function checkPlugins(plugins) {
301-
if (typeof plugins === 'undefined')
302-
return;
303-
304-
if (!Array.isArray(plugins))
305-
throw Error('plugins should be an array!');
306-
}
307-

server/cloudcmd.spec.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@ const {request} = require('serve-once')(cloudcmd, {
2323
},
2424
});
2525

26-
test('cloudcmd: args: no', (t) => {
27-
const fn = () => cloudcmd();
28-
29-
t.doesNotThrow(fn, /plugins should be an array!/, 'should throw when plugins not an array');
30-
t.end();
31-
});
32-
33-
test('cloudcmd: args: plugins: error', (t) => {
34-
const fn = () => cloudcmd({
35-
plugins: '',
36-
});
37-
38-
t.throws(fn, /plugins should be an array!/, 'should throw when plugins not an array');
39-
t.end();
40-
});
41-
4226
test('cloudcmd: defaults: config', (t) => {
4327
const configManager = createConfigManager();
4428

server/plugins.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

server/plugins.spec.js

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)