diff --git a/packages/entity/trait/trait-components.scwp.js b/packages/entity/trait/trait-components.scwp.js index 49f947e..3f2c2a6 100644 --- a/packages/entity/trait/trait-components.scwp.js +++ b/packages/entity/trait/trait-components.scwp.js @@ -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; +}; diff --git a/packages/entity/trait/traits.scwp.js b/packages/entity/trait/traits.scwp.js index 39ed5f2..490d095 100644 --- a/packages/entity/trait/traits.scwp.js +++ b/packages/entity/trait/traits.scwp.js @@ -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'); +}; diff --git a/packages/net/packet/packets.scwp.js b/packages/net/packet/packets.scwp.js index 122f75c..389ab2c 100644 --- a/packages/net/packet/packets.scwp.js +++ b/packages/net/packet/packets.scwp.js @@ -1,8 +1,3 @@ module.exports = (scwp) => { - scwp.enterSelf(); - scwp.loadSelf('scwp/autoreg', { - paths: scwp.paths, - root: scwp.root, - type: 'packet', - }); + scwp.autoreg('packet'); }; diff --git a/packages/net/s13n/s13n.scwp.js b/packages/net/s13n/s13n.scwp.js index 21da608..1f6bc01 100644 --- a/packages/net/s13n/s13n.scwp.js +++ b/packages/net/s13n/s13n.scwp.js @@ -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'); +};