refactor: autoreg

This commit is contained in:
cha0s 2020-06-20 19:54:41 -05:00
parent 87d138e8c0
commit 5f701f1525
4 changed files with 10 additions and 35 deletions

View File

@ -1,11 +1,5 @@
function traitComponents(scwp) {
module.exports = function traitComponents(scwp) {
if (process.env.SIDE && 'client' === process.env.SIDE.toLowerCase()) {
scwp.enterSelf();
scwp.loadSelf('scwp/autoreg', {
paths: scwp.paths,
root: scwp.root,
type: 'trait-component',
});
scwp.autoreg('trait-component');
}
}
module.exports = traitComponents;
};

View File

@ -1,9 +1,3 @@
function traits(scwp) {
scwp.enterSelf();
scwp.loadSelf('scwp/autoreg', {
paths: scwp.paths,
root: scwp.root,
type: 'trait',
});
}
module.exports = traits;
module.exports = function traits(scwp) {
scwp.autoreg('trait');
};

View File

@ -1,8 +1,3 @@
module.exports = (scwp) => {
scwp.enterSelf();
scwp.loadSelf('scwp/autoreg', {
paths: scwp.paths,
root: scwp.root,
type: 'packet',
});
scwp.autoreg('packet');
};

View File

@ -1,11 +1,3 @@
const {join} = require('path');
function s13n(scwp) {
scwp.enterSelf();
scwp.loadSelf('scwp/autoreg', {
paths: scwp.paths,
root: scwp.root,
type: 'synchronized',
});
}
module.exports = s13n;
module.exports = function s13n(scwp) {
scwp.autoreg('synchronized');
};