refactor: gatherFlat

This commit is contained in:
cha0s 2021-04-06 15:43:23 -05:00
parent 4ed7ebd5f6
commit c58b405669
15 changed files with 20 additions and 19 deletions

View File

@ -1,3 +1,4 @@
- entities should probably belong to room instead of layer
- don't tick entities without any ticking traits
- ~~production build~~
- Trait::initializeStateProperties should be rolled into ::load()

View File

@ -1,4 +1,4 @@
import {gatherWithLatus} from '@latus/core';
import {gatherFlat} from '@latus/core';
import Condition from './components/condition';
import Expression from './components/expression';
@ -22,7 +22,7 @@ export default {
literal: Literal,
});
},
'@avocado/traits/components': gatherWithLatus(
'@avocado/traits/components': gatherFlat(
require.context('./traits', false, /\.jsx$/),
),
},

View File

@ -160,4 +160,4 @@ Behaved.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Behaved;
export default Behaved;

View File

@ -1,4 +1,4 @@
import {gatherWithLatus} from '@latus/core';
import {gatherFlat} from '@latus/core';
import EntityController from './controllers/entity';
@ -11,7 +11,7 @@ export default {
'@avocado/resource/persea.controllers': () => [
EntityController,
],
'@avocado/traits/components': gatherWithLatus(
'@avocado/traits/components': gatherFlat(
require.context('./traits', false, /\.jsx$/),
),
},

View File

@ -1,5 +1,4 @@
import './alive.scss';
import {join} from 'path';
import {Number} from '@avocado/persea';
@ -91,4 +90,4 @@ Alive.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Alive;
export default Alive;

View File

@ -67,4 +67,4 @@ Directional.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Directional;
export default Directional;

View File

@ -23,6 +23,7 @@
"@avocado/entity": "^2.0.0",
"@avocado/graphics": "^2.0.0",
"@avocado/math": "^2.0.0",
"@avocado/persea": "^1.0.0",
"@avocado/react": "^1.0.0",
"@avocado/resource": "^2.0.0",
"@avocado/s13n": "^2.0.0",

View File

@ -1,8 +1,8 @@
import {gatherWithLatus} from '@latus/core';
import {gatherFlat} from '@latus/core';
export default {
hooks: {
'@avocado/traits/components': gatherWithLatus(
'@avocado/traits/components': gatherFlat(
require.context('./traits', false, /\.jsx$/),
),
},

View File

@ -140,4 +140,4 @@ Collider.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Collider;
export default Collider;

View File

@ -179,4 +179,4 @@ Emitted.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Emitted;
export default Emitted;

View File

@ -54,4 +54,4 @@ Emitter.propTypes = {
path: PropTypes.string.isRequired,
};
export default () => Emitter;
export default Emitter;

View File

@ -1,4 +1,4 @@
import {gatherWithLatus} from '@latus/core';
import {gatherFlat} from '@latus/core';
import AudioController from './controllers/audio';
import SoundController from './controllers/sound';
@ -14,7 +14,7 @@ export default {
AudioController,
SoundController,
],
'@avocado/traits/components': gatherWithLatus(
'@avocado/traits/components': gatherFlat(
require.context('./traits', false, /\.jsx$/),
),
},

View File

@ -105,4 +105,4 @@ Audible.propTypes = {
};
Audible.propTypes = {};
export default () => Audible;
export default Audible;

View File

@ -1,4 +1,4 @@
import {gatherWithLatus} from '@latus/core';
import {gatherFlat} from '@latus/core';
import AnimationController from './controllers/animation';
@ -11,7 +11,7 @@ export default {
'@avocado/resource/persea.controllers': () => [
AnimationController,
],
'@avocado/traits/components': gatherWithLatus(
'@avocado/traits/components': gatherFlat(
require.context('./traits', false, /\.jsx$/),
),
},

View File

@ -80,4 +80,4 @@ Animated.propTypes = {
};
Animated.propTypes = {};
export default () => Animated;
export default Animated;