@adaas/a-concept 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.container.d.ts +5 -2
- package/dist/src/base/A-Config/A-Config.container.js +7 -2
- package/dist/src/base/A-Config/A-Config.container.js.map +1 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js +1 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
- package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +1 -1
- package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -1
- package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
- package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.d.ts → A-Abstraction-Extend.decorator.d.ts} +1 -1
- package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.js → A-Abstraction-Extend.decorator.js} +6 -6
- package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js.map +1 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +1 -1
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +1 -1
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +3 -3
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +20 -4
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +3 -2
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +23 -2
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +3 -3
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +40 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +113 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +13 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js +11 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -0
- package/dist/src/global/A-Channel/A-Channel.class.js +0 -1
- package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -1
- package/dist/src/global/A-Channel/A-Channel.types.d.ts +2 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +5 -30
- package/dist/src/global/A-Component/A-Component.class.js +6 -10
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +9 -2
- package/dist/src/global/A-Component/A-Component.meta.js +10 -1
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +16 -17
- package/dist/src/global/A-Concept/A_Concept.class.js +31 -65
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.meta.d.ts +10 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js +20 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +2 -2
- package/dist/src/global/A-Container/A-Container.class.d.ts +7 -50
- package/dist/src/global/A-Container/A-Container.class.js +9 -19
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +15 -0
- package/dist/src/global/A-Container/A-Container.meta.js +20 -0
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +20 -20
- package/dist/src/global/A-Context/A-Context.class.js +57 -15
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -18
- package/dist/src/global/A-Entity/A-Entity.class.js +21 -31
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +3 -2
- package/dist/src/global/A-Entity/A-Entity.types.js +1 -0
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +2 -1
- package/dist/src/global/A-Feature/A-Feature.class.js +14 -4
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +9 -0
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +1 -3
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +1 -0
- package/dist/src/global/A-Meta/A-Meta.class.js +3 -6
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +4 -2
- package/dist/src/global/A-Scope/A-Scope.class.js +23 -16
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -8
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +3 -3
- package/dist/src/global/A-Stage/A-Stage.class.js +11 -10
- package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +1 -1
- package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -1
- package/dist/src/helpers/StepsManager.class.d.ts +1 -0
- package/dist/src/helpers/StepsManager.class.js +10 -7
- package/dist/src/helpers/StepsManager.class.js.map +1 -1
- package/docs/a-concept-logo.png +0 -0
- package/docs/a-logo-docs.png +0 -0
- package/examples/fe-be/channels/Test.channel.ts +6 -3
- package/examples/multi-container/containers/Schedule.container.ts +1 -6
- package/examples/simple/components/A.component.ts +7 -0
- package/examples/simple/components/B.component.ts +9 -0
- package/examples/simple/concept.ts +38 -60
- package/examples/simple/containers/Main.container.ts +24 -11
- package/examples/simple/entities/EntityA.entity.ts +3 -5
- package/examples/simple-http-server/components/http-request-handler.component.ts +6 -4
- package/examples/simple-http-server/concept.ts +24 -21
- package/examples/simple-http-server/containers/http-server.container.ts +4 -3
- package/index.ts +4 -1
- package/package.json +6 -2
- package/src/base/A-Config/A-Config.container.ts +12 -4
- package/src/base/A-Config/components/ConfigReader.component.ts +4 -5
- package/src/base/A-Config/components/FileConfigReader.component.ts +0 -2
- package/src/base/A-Errors/A-Error.entity.ts +1 -1
- package/src/base/A-Errors/A-Errors.context.ts +2 -1
- package/src/base/A-Logger/A-Logger.component.ts +0 -1
- package/src/decorators/A-Abstraction/{A-Abstraction.decorator.ts → A-Abstraction-Extend.decorator.ts} +5 -6
- package/src/decorators/A-Abstraction/A-Abstraction.decorator.types.ts +1 -1
- package/src/decorators/A-Connect/A-Connect.decorator.ts +1 -1
- package/src/decorators/A-Entity/A-Entity.decorator.types.ts +1 -1
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +37 -10
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +12 -12
- package/src/decorators/A-Inject/A-Inject.decorator.ts +31 -4
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +4 -3
- package/src/global/A-Abstraction/A-Abstraction.class.ts +130 -0
- package/src/global/A-Abstraction/A-Abstraction.types.ts +22 -0
- package/src/global/A-Channel/A-Channel.class.ts +0 -2
- package/src/global/A-Channel/A-Channel.types.ts +2 -1
- package/src/global/A-Component/A-Component.class.ts +12 -52
- package/src/global/A-Component/A-Component.meta.ts +19 -2
- package/src/global/A-Concept/A_Concept.class.ts +45 -126
- package/src/global/A-Concept/A_Concept.meta.ts +68 -0
- package/src/global/A-Concept/A_Concept.types.ts +2 -2
- package/src/global/A-Container/A-Container.class.ts +11 -90
- package/src/global/A-Container/A-Container.meta.ts +33 -0
- package/src/global/A-Context/A-Context.class.ts +134 -56
- package/src/global/A-Entity/A-Entity.class.ts +22 -69
- package/src/global/A-Entity/A-Entity.meta.ts +3 -2
- package/src/global/A-Entity/A-Entity.types.ts +2 -1
- package/src/global/A-Feature/A-Feature.class.ts +18 -7
- package/src/global/A-Feature/A-Feature.types.ts +10 -2
- package/src/global/A-Fragment/A-Fragment.class.ts +1 -1
- package/src/global/A-Meta/A-Meta.class.ts +5 -8
- package/src/global/A-Scope/A-Scope.class.ts +38 -21
- package/src/global/A-Scope/A-Scope.types.ts +2 -2
- package/src/global/A-Stage/A-Stage.class.ts +20 -20
- package/src/global/A-Stage/A-Stage.types.ts +2 -3
- package/src/helpers/StepsManager.class.ts +11 -7
- package/trace-require.js +46 -0
- package/tsconfig.build.json +57 -0
- package/dist/examples/fe-be/channels/Test.channel.d.ts +0 -6
- package/dist/examples/fe-be/channels/Test.channel.js +0 -14
- package/dist/examples/fe-be/channels/Test.channel.js.map +0 -1
- package/dist/examples/fe-be/components/BE-Controller.component.d.ts +0 -4
- package/dist/examples/fe-be/components/BE-Controller.component.js +0 -24
- package/dist/examples/fe-be/components/BE-Controller.component.js.map +0 -1
- package/dist/examples/fe-be/components/FE.component.d.ts +0 -4
- package/dist/examples/fe-be/components/FE.component.js +0 -31
- package/dist/examples/fe-be/components/FE.component.js.map +0 -1
- package/dist/examples/fe-be/components/UserActions.component.d.ts +0 -5
- package/dist/examples/fe-be/components/UserActions.component.js +0 -25
- package/dist/examples/fe-be/components/UserActions.component.js.map +0 -1
- package/dist/examples/fe-be/concept.d.ts +0 -0
- package/dist/examples/fe-be/concept.js +0 -2
- package/dist/examples/fe-be/concept.js.map +0 -1
- package/dist/examples/fe-be/containers/ServerApp.container.d.ts +0 -3
- package/dist/examples/fe-be/containers/ServerApp.container.js +0 -8
- package/dist/examples/fe-be/containers/ServerApp.container.js.map +0 -1
- package/dist/examples/fe-be/containers/WebApp.container.d.ts +0 -3
- package/dist/examples/fe-be/containers/WebApp.container.js +0 -8
- package/dist/examples/fe-be/containers/WebApp.container.js.map +0 -1
- package/dist/examples/multi-container/channels/Direct.channel.d.ts +0 -9
- package/dist/examples/multi-container/channels/Direct.channel.js +0 -32
- package/dist/examples/multi-container/channels/Direct.channel.js.map +0 -1
- package/dist/examples/multi-container/concept.d.ts +0 -0
- package/dist/examples/multi-container/concept.js +0 -2
- package/dist/examples/multi-container/concept.js.map +0 -1
- package/dist/examples/multi-container/containers/Command.container.d.ts +0 -11
- package/dist/examples/multi-container/containers/Command.container.js +0 -51
- package/dist/examples/multi-container/containers/Command.container.js.map +0 -1
- package/dist/examples/multi-container/containers/Schedule.container.d.ts +0 -15
- package/dist/examples/multi-container/containers/Schedule.container.js +0 -67
- package/dist/examples/multi-container/containers/Schedule.container.js.map +0 -1
- package/dist/examples/sdk/concept.d.ts +0 -0
- package/dist/examples/sdk/concept.js +0 -21
- package/dist/examples/sdk/concept.js.map +0 -1
- package/dist/examples/sdk/orders.api.d.ts +0 -0
- package/dist/examples/sdk/orders.api.js +0 -16
- package/dist/examples/sdk/orders.api.js.map +0 -1
- package/dist/examples/sdk/users.api.d.ts +0 -0
- package/dist/examples/sdk/users.api.js +0 -16
- package/dist/examples/sdk/users.api.js.map +0 -1
- package/dist/examples/simple/components/A.component.d.ts +0 -9
- package/dist/examples/simple/components/A.component.js +0 -60
- package/dist/examples/simple/components/A.component.js.map +0 -1
- package/dist/examples/simple/components/B.component.d.ts +0 -13
- package/dist/examples/simple/components/B.component.js +0 -88
- package/dist/examples/simple/components/B.component.js.map +0 -1
- package/dist/examples/simple/concept.d.ts +0 -1
- package/dist/examples/simple/concept.js +0 -82
- package/dist/examples/simple/concept.js.map +0 -1
- package/dist/examples/simple/containers/Main.container.d.ts +0 -11
- package/dist/examples/simple/containers/Main.container.js +0 -86
- package/dist/examples/simple/containers/Main.container.js.map +0 -1
- package/dist/examples/simple/context/Fragment_A.context.d.ts +0 -6
- package/dist/examples/simple/context/Fragment_A.context.js +0 -16
- package/dist/examples/simple/context/Fragment_A.context.js.map +0 -1
- package/dist/examples/simple/context/Fragment_B.context.d.ts +0 -6
- package/dist/examples/simple/context/Fragment_B.context.js +0 -16
- package/dist/examples/simple/context/Fragment_B.context.js.map +0 -1
- package/dist/examples/simple/entities/EntityA.entity.d.ts +0 -8
- package/dist/examples/simple/entities/EntityA.entity.js +0 -22
- package/dist/examples/simple/entities/EntityA.entity.js.map +0 -1
- package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +0 -10
- package/dist/examples/simple-http-server/components/http-error-handler.component.js +0 -65
- package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +0 -1
- package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +0 -3
- package/dist/examples/simple-http-server/components/http-request-handler.component.js +0 -8
- package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +0 -1
- package/dist/examples/simple-http-server/concept.d.ts +0 -1
- package/dist/examples/simple-http-server/concept.js +0 -35
- package/dist/examples/simple-http-server/concept.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.container.d.ts +0 -11
- package/dist/examples/simple-http-server/containers/http-server.container.js +0 -73
- package/dist/examples/simple-http-server/containers/http-server.container.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.controller.d.ts +0 -7
- package/dist/examples/simple-http-server/containers/http-server.controller.js +0 -37
- package/dist/examples/simple-http-server/containers/http-server.controller.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.router.d.ts +0 -6
- package/dist/examples/simple-http-server/containers/http-server.router.js +0 -39
- package/dist/examples/simple-http-server/containers/http-server.router.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +0 -12
- package/dist/examples/simple-http-server/contexts/http-request.context.js +0 -49
- package/dist/examples/simple-http-server/contexts/http-request.context.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -2
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +0 -10
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js +0 -26
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js.map +0 -1
- package/dist/examples/simple-http-server/controllers/orders.controller.d.ts +0 -5
- package/dist/examples/simple-http-server/controllers/orders.controller.js +0 -32
- package/dist/examples/simple-http-server/controllers/orders.controller.js.map +0 -1
- package/dist/examples/simple-http-server/controllers/users.controller.d.ts +0 -0
- package/dist/examples/simple-http-server/controllers/users.controller.js +0 -87
- package/dist/examples/simple-http-server/controllers/users.controller.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.context.d.ts +0 -5
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js +0 -25
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.module.d.ts +0 -16
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js +0 -8
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.types.d.ts +0 -2
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js +0 -3
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js.map +0 -1
- package/dist/examples/simple-http-server/test.d.ts +0 -68
- package/dist/examples/simple-http-server/test.js +0 -162
- package/dist/examples/simple-http-server/test.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.container.d.ts +0 -7
- package/dist/src/containers/A-Config/A-Config.container.js +0 -65
- package/dist/src/containers/A-Config/A-Config.container.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.namespace.d.ts +0 -28
- package/dist/src/containers/A-Config/A-Config.namespace.js +0 -54
- package/dist/src/containers/A-Config/A-Config.namespace.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.types.d.ts +0 -12
- package/dist/src/containers/A-Config/A-Config.types.js +0 -3
- package/dist/src/containers/A-Config/A-Config.types.js.map +0 -1
- package/dist/src/containers/A-Config/components/ConfigReader.component.d.ts +0 -18
- package/dist/src/containers/A-Config/components/ConfigReader.component.js +0 -37
- package/dist/src/containers/A-Config/components/ConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.d.ts +0 -10
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js +0 -37
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Config/components/FileConfigReader.component.d.ts +0 -11
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js +0 -47
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.container.d.ts +0 -5
- package/dist/src/containers/A-Errors/A-Errors.container.js +0 -32
- package/dist/src/containers/A-Errors/A-Errors.container.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +0 -40
- package/dist/src/containers/A-Errors/A-Errors.namespace.js +0 -76
- package/dist/src/containers/A-Errors/A-Errors.namespace.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.types.d.ts +0 -5
- package/dist/src/containers/A-Errors/A-Errors.types.js +0 -3
- package/dist/src/containers/A-Errors/A-Errors.types.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.container.d.ts +0 -6
- package/dist/src/containers/A-Logger/A-Logger.container.js +0 -41
- package/dist/src/containers/A-Logger/A-Logger.container.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +0 -17
- package/dist/src/containers/A-Logger/A-Logger.namespace.js +0 -22
- package/dist/src/containers/A-Logger/A-Logger.namespace.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.types.d.ts +0 -0
- package/dist/src/containers/A-Logger/A-Logger.types.js +0 -2
- package/dist/src/containers/A-Logger/A-Logger.types.js.map +0 -1
- package/dist/src/containers/A-Logger/components/Logger.component.d.ts +0 -29
- package/dist/src/containers/A-Logger/components/Logger.component.js +0 -128
- package/dist/src/containers/A-Logger/components/Logger.component.js.map +0 -1
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.d.ts +0 -34
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.d.ts +0 -11
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js +0 -36
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.d.ts +0 -7
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.d.ts +0 -17
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js +0 -42
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/index.d.ts +0 -7
- package/dist/src/decorators/A-ConceptLifecycle/index.js +0 -11
- package/dist/src/decorators/A-ConceptLifecycle/index.js.map +0 -1
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +0 -16
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +0 -36
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +0 -1
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +0 -3
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +0 -14
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +0 -24
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +0 -1
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +0 -3
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Define/index.d.ts +0 -7
- package/dist/src/decorators/A-Define/index.js +0 -10
- package/dist/src/decorators/A-Define/index.js.map +0 -1
- package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +0 -18
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js +0 -37
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +0 -1
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +0 -21
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +0 -3
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.d.ts +0 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js +0 -11
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js.map +0 -1
- package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +0 -13
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js +0 -52
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +0 -1
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +0 -2
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +0 -3
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +0 -1
- package/dist/src/decorators/A_ConceptMethods.decorator.d.ts +0 -0
- package/dist/src/decorators/A_ConceptMethods.decorator.js +0 -2
- package/dist/src/decorators/A_ConceptMethods.decorator.js.map +0 -1
- package/dist/src/decorators/A_Lazy.decorator.d.ts +0 -5
- package/dist/src/decorators/A_Lazy.decorator.js +0 -20
- package/dist/src/decorators/A_Lazy.decorator.js.map +0 -1
- package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +0 -12
- package/dist/src/global/A-Context/A-ContextFragment.class.js +0 -19
- package/dist/src/global/A-Context/A-ContextFragment.class.js.map +0 -1
- package/dist/src/global/A-Namespace/A_Namespace.class.d.ts +0 -47
- package/dist/src/global/A-Namespace/A_Namespace.class.js +0 -112
- package/dist/src/global/A-Namespace/A_Namespace.class.js.map +0 -1
- package/dist/src/global/A-Namespace/A_Namespace.types.d.ts +0 -19
- package/dist/src/global/A-Namespace/A_Namespace.types.js +0 -3
- package/dist/src/global/A-Namespace/A_Namespace.types.js.map +0 -1
- package/dist/src/managers/A_DependencyManager.class.d.ts +0 -24
- package/dist/src/managers/A_DependencyManager.class.js +0 -129
- package/dist/src/managers/A_DependencyManager.class.js.map +0 -1
- package/dist/src/storage/A_Component.storage.d.ts +0 -10
- package/dist/src/storage/A_Component.storage.js +0 -17
- package/dist/src/storage/A_Component.storage.js.map +0 -1
- package/dist/src/storage/A_Concept.storage.d.ts +0 -19
- package/dist/src/storage/A_Concept.storage.js +0 -29
- package/dist/src/storage/A_Concept.storage.js.map +0 -1
- package/dist/src/storage/A_Container.storage.d.ts +0 -8
- package/dist/src/storage/A_Container.storage.js +0 -17
- package/dist/src/storage/A_Container.storage.js.map +0 -1
- package/dist/src/storage/A_Inject.storage.d.ts +0 -9
- package/dist/src/storage/A_Inject.storage.js +0 -13
- package/dist/src/storage/A_Inject.storage.js.map +0 -1
- package/dist/src/types/A_DependencyManager.types.d.ts +0 -15
- package/dist/src/types/A_DependencyManager.types.js +0 -3
- package/dist/src/types/A_DependencyManager.types.js.map +0 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
A_CommonHelper,
|
|
3
|
-
A_Error,
|
|
3
|
+
A_Error,
|
|
4
4
|
ASEID
|
|
5
5
|
} from "@adaas/a-utils";
|
|
6
6
|
import {
|
|
7
7
|
A_TYPES__Entity_JSON,
|
|
8
|
-
A_TYPES__EntityBaseMethod,
|
|
9
|
-
A_TYPES__EntityBaseMethods,
|
|
10
|
-
A_TYPES__EntityCallParams,
|
|
11
8
|
A_TYPES__IEntity
|
|
12
9
|
} from "./A-Entity.types";
|
|
13
10
|
import { A_CONSTANTS__DEFAULT_ERRORS } from "@adaas/a-utils/dist/src/constants/errors.constants";
|
|
14
11
|
import { A_Context } from "../A-Context/A-Context.class";
|
|
15
|
-
import {
|
|
12
|
+
import { A_TYPES__FeatureCallParams } from "../A-Feature/A-Feature.types";
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
|
|
@@ -25,8 +22,7 @@ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
|
25
22
|
*/
|
|
26
23
|
export class A_Entity<
|
|
27
24
|
_ConstructorType = any,
|
|
28
|
-
_SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON
|
|
29
|
-
_FeatureNames extends Array<string | A_TYPES__EntityBaseMethod> = A_TYPES__EntityBaseMethods
|
|
25
|
+
_SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON
|
|
30
26
|
>
|
|
31
27
|
implements A_TYPES__IEntity {
|
|
32
28
|
|
|
@@ -57,7 +53,7 @@ export class A_Entity<
|
|
|
57
53
|
)
|
|
58
54
|
constructor(props: string | ASEID | _SerializedType | _ConstructorType) {
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
|
|
61
57
|
switch (true) {
|
|
62
58
|
case (typeof props === 'string' && ASEID.isASEID(props)):
|
|
63
59
|
this.aseid = new ASEID(props);
|
|
@@ -139,43 +135,12 @@ export class A_Entity<
|
|
|
139
135
|
* @param lifecycleMethod
|
|
140
136
|
* @param args
|
|
141
137
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
async call(
|
|
149
|
-
/**
|
|
150
|
-
* A-Feature name to be called
|
|
151
|
-
*/
|
|
152
|
-
params: A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
|
|
153
|
-
): Promise<any>
|
|
154
|
-
async call(
|
|
155
|
-
/**
|
|
156
|
-
* A-Feature method name to be called
|
|
157
|
-
*/
|
|
158
|
-
feature: _FeatureNames[number],
|
|
159
|
-
/**
|
|
160
|
-
* Parameters to provide additional data to the feature
|
|
161
|
-
*/
|
|
162
|
-
params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>,
|
|
163
|
-
): Promise<any>
|
|
164
|
-
|
|
165
|
-
async call(
|
|
166
|
-
param1: _FeatureNames[number] | A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
|
|
167
|
-
param2?: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>
|
|
168
|
-
): Promise<any> {
|
|
169
|
-
|
|
170
|
-
const feature: string = typeof param1 === 'string'
|
|
171
|
-
? param1
|
|
172
|
-
: param1.name;
|
|
173
|
-
const params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>> = typeof param1 === 'string'
|
|
174
|
-
? param2 || {}
|
|
175
|
-
: param1;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
console.log('WTF???? ', A_Context.scope(this))
|
|
138
|
+
async call(
|
|
139
|
+
feature: string,
|
|
140
|
+
params: Partial<A_TYPES__FeatureCallParams> = {}
|
|
141
|
+
) {
|
|
142
|
+
params.entities = params.entities || [this];
|
|
143
|
+
|
|
179
144
|
|
|
180
145
|
const newFeature = A_Context.feature(A_Context.scope(this), this, feature, params);
|
|
181
146
|
|
|
@@ -188,33 +153,21 @@ export class A_Entity<
|
|
|
188
153
|
// ====================================================================
|
|
189
154
|
|
|
190
155
|
|
|
191
|
-
async load() {
|
|
192
|
-
await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
|
|
193
|
-
entities: [
|
|
194
|
-
this
|
|
195
|
-
]
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
async destroy() {
|
|
202
|
-
await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
|
|
203
|
-
entities: [
|
|
204
|
-
this
|
|
205
|
-
],
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
156
|
|
|
157
|
+
/**
|
|
158
|
+
* The default method that can be called and extended to load entity data.
|
|
159
|
+
*/
|
|
160
|
+
async load() { }
|
|
209
161
|
|
|
162
|
+
/**
|
|
163
|
+
* The default method that can be called and extended to destroy entity data.
|
|
164
|
+
*/
|
|
165
|
+
async destroy() { }
|
|
210
166
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
167
|
+
/**
|
|
168
|
+
* The default method that can be called and extended to save entity data.
|
|
169
|
+
*/
|
|
170
|
+
async save() { }
|
|
218
171
|
|
|
219
172
|
|
|
220
173
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types";
|
|
1
2
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
|
-
import { A_TYPES__EntityMeta } from "./A-Entity.types";
|
|
3
|
+
import { A_TYPES__EntityMeta, A_TYPES__EntityMetaKey } from "./A-Entity.types";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
}
|
|
@@ -9,7 +9,7 @@ import { A_TYPES__ContainerMeta_FeatureItem } from "../A-Container/A-Container.t
|
|
|
9
9
|
export type A_TYPES__EntityCallParams<T extends string> = {
|
|
10
10
|
name: T,
|
|
11
11
|
fragments: Array<A_Fragment>,
|
|
12
|
-
entities: Array<A_Entity<any, any
|
|
12
|
+
entities: Array<A_Entity<any, any>>,
|
|
13
13
|
components: Array<{ new(...args: any[]): any }>
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -73,6 +73,7 @@ export type A_TYPES__EntityMeta = {
|
|
|
73
73
|
export enum A_TYPES__EntityMetaKey {
|
|
74
74
|
EXTENSIONS = 'a-component-extensions',
|
|
75
75
|
FEATURES = 'a-component-features',
|
|
76
|
+
ABSTRACTIONS = 'a-component-abstractions',
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { A_Context } from "../A-Context/A-Context.class";
|
|
1
2
|
import { A_Feature_Define } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Define.decorator";
|
|
2
3
|
import { A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Extend.decorator";
|
|
3
4
|
import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState, } from "./A-Feature.types";
|
|
4
5
|
import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
|
|
5
|
-
import { A_Context } from "../A-Context/A-Context.class";
|
|
6
6
|
import { A_TYPES__A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
|
|
7
7
|
import { A_Stage } from "../A-Stage/A-Stage.class";
|
|
8
|
-
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
9
8
|
import { StepsManager } from "@adaas/a-concept/helpers/StepsManager.class";
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
10
|
/**
|
|
14
11
|
* A_Feature is representing a feature that can be executed across multiple components
|
|
15
12
|
* This class stores the steps of the feature and executes them in order of appearance
|
|
@@ -48,10 +45,12 @@ export class A_Feature {
|
|
|
48
45
|
result?: any
|
|
49
46
|
error?: A_Error
|
|
50
47
|
|
|
48
|
+
readonly name: string;
|
|
51
49
|
|
|
52
50
|
constructor(
|
|
53
51
|
params: A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>
|
|
54
52
|
) {
|
|
53
|
+
this.name = params.name || this.constructor.name;
|
|
55
54
|
|
|
56
55
|
this.SM = new StepsManager(params.steps);
|
|
57
56
|
|
|
@@ -175,11 +174,23 @@ export class A_Feature {
|
|
|
175
174
|
*
|
|
176
175
|
*/
|
|
177
176
|
async process() {
|
|
178
|
-
this.
|
|
177
|
+
if (this.isDone()) {
|
|
178
|
+
return this.result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
this.state = A_TYPES__FeatureState.PROCESSING;
|
|
183
|
+
|
|
184
|
+
for (const stage of this.stages) {
|
|
185
|
+
await stage.process();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
await this.completed();
|
|
179
189
|
|
|
180
|
-
|
|
181
|
-
await
|
|
190
|
+
} catch (error) {
|
|
191
|
+
await this.failed(error);
|
|
182
192
|
}
|
|
193
|
+
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Injectable, A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types"
|
|
2
|
-
import { A_Component } from "../A-Component/A-Component.class"
|
|
3
1
|
import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types"
|
|
4
2
|
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types"
|
|
3
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class"
|
|
4
|
+
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class"
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export type A_TYPES__FeatureIteratorReturn<T extends any = any> = () => Promise<T>
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
export type A_TYPES__FeatureCallParams = {
|
|
11
|
+
fragments: Array<A_Fragment>,
|
|
12
|
+
entities: Array<A_Entity<any, any>>,
|
|
13
|
+
components: Array<{ new(...args: any[]): any }>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
10
18
|
export type A_TYPES__FeatureConstructor = {
|
|
11
19
|
steps: A_TYPES__A_StageStep[]
|
|
12
20
|
} & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
1
|
/**
|
|
10
2
|
* A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
|
|
11
3
|
*
|
|
@@ -185,4 +177,9 @@ export class A_Meta<
|
|
|
185
177
|
clear(): void {
|
|
186
178
|
this.meta.clear();
|
|
187
179
|
}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
|
|
183
|
+
return Array.from(this.meta.entries());
|
|
184
|
+
}
|
|
188
185
|
}
|
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
} from "../A-Component/A-Component.types";
|
|
8
8
|
import { A_Component } from "../A-Component/A-Component.class";
|
|
9
9
|
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
A_TYPES__A_InjectDecorator_EntityInjectionInstructions,
|
|
12
|
+
A_TYPES__A_InjectDecorator_Injectable
|
|
13
|
+
} from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types";
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
*
|
|
@@ -24,13 +28,13 @@ import { A_TYPES__A_InjectDecorator_EntityInjectionInstructions, A_TYPES__A_Inje
|
|
|
24
28
|
*/
|
|
25
29
|
export class A_Scope {
|
|
26
30
|
|
|
27
|
-
name: string = '';
|
|
31
|
+
readonly name: string = '';
|
|
28
32
|
|
|
29
33
|
private _components: WeakMap<typeof A_Component.constructor, any> = new WeakMap();
|
|
30
34
|
private _fragments: WeakMap<typeof A_Fragment.constructor, any> = new WeakMap();
|
|
31
35
|
private _entities: Map<string, A_Entity> = new Map();
|
|
32
36
|
|
|
33
|
-
private
|
|
37
|
+
private _parent?: A_Scope;
|
|
34
38
|
|
|
35
39
|
protected params!: A_TYPES__ScopeConstructor
|
|
36
40
|
|
|
@@ -47,8 +51,8 @@ export class A_Scope {
|
|
|
47
51
|
components: [],
|
|
48
52
|
fragments: [],
|
|
49
53
|
entities: [],
|
|
50
|
-
import: [],
|
|
51
|
-
export: [],
|
|
54
|
+
// import: [],
|
|
55
|
+
// export: [],
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
|
|
@@ -62,7 +66,7 @@ export class A_Scope {
|
|
|
62
66
|
this.initEntities(params.entities || []);
|
|
63
67
|
|
|
64
68
|
if (config.parent) {
|
|
65
|
-
this.
|
|
69
|
+
this._parent = config.parent;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -92,6 +96,19 @@ export class A_Scope {
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
|
|
99
|
+
parent(setValue: A_Scope): void
|
|
100
|
+
parent(): A_Scope
|
|
101
|
+
parent(
|
|
102
|
+
setValue?: A_Scope
|
|
103
|
+
): A_Scope | undefined {
|
|
104
|
+
if (setValue) {
|
|
105
|
+
this._parent = setValue;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return this._parent;
|
|
110
|
+
}
|
|
111
|
+
|
|
95
112
|
|
|
96
113
|
/**
|
|
97
114
|
* This method is used to check if the component is available in the scope
|
|
@@ -118,8 +135,8 @@ export class A_Scope {
|
|
|
118
135
|
case A_CommonHelper.isInheritedFrom(entity, A_Component): {
|
|
119
136
|
const found = this.params.components.includes(entity as { new(...args: any[]): A_Component });
|
|
120
137
|
|
|
121
|
-
if (!found && !!this.
|
|
122
|
-
return this.
|
|
138
|
+
if (!found && !!this._parent)
|
|
139
|
+
return this._parent.has(entity as any);
|
|
123
140
|
|
|
124
141
|
return found;
|
|
125
142
|
}
|
|
@@ -135,8 +152,8 @@ export class A_Scope {
|
|
|
135
152
|
case A_CommonHelper.isInheritedFrom(entity, A_Fragment): {
|
|
136
153
|
const found = this._fragments.has(entity);
|
|
137
154
|
|
|
138
|
-
if (!found && !!this.
|
|
139
|
-
return this.
|
|
155
|
+
if (!found && !!this._parent)
|
|
156
|
+
return this._parent.has(entity as any);
|
|
140
157
|
|
|
141
158
|
return found;
|
|
142
159
|
}
|
|
@@ -200,6 +217,8 @@ export class A_Scope {
|
|
|
200
217
|
component: T,
|
|
201
218
|
instructions?: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions>
|
|
202
219
|
): InstanceType<T> {
|
|
220
|
+
|
|
221
|
+
|
|
203
222
|
switch (true) {
|
|
204
223
|
case A_CommonHelper.isInheritedFrom(component, A_Entity): {
|
|
205
224
|
return this.resolveEntity(component as typeof A_Entity, instructions) as InstanceType<T>;
|
|
@@ -243,8 +262,8 @@ export class A_Scope {
|
|
|
243
262
|
case !!found:
|
|
244
263
|
return found as InstanceType<T>;
|
|
245
264
|
|
|
246
|
-
case !found && !!this.
|
|
247
|
-
return this.
|
|
265
|
+
case !found && !!this._parent:
|
|
266
|
+
return this._parent.resolveEntity(entity, instructions);
|
|
248
267
|
|
|
249
268
|
default:
|
|
250
269
|
throw new Error(`Fragment ${entity.name} not found in the scope ${this.name}`);
|
|
@@ -292,8 +311,8 @@ export class A_Scope {
|
|
|
292
311
|
case fragmentInstancePresented && !this._fragments.has(fragment):
|
|
293
312
|
return this.fragments.find(fr => fr instanceof fragment) as InstanceType<T>;
|
|
294
313
|
|
|
295
|
-
case !fragmentInstancePresented && !!this.
|
|
296
|
-
return this.
|
|
314
|
+
case !fragmentInstancePresented && !!this._parent:
|
|
315
|
+
return this._parent.resolveFragment(fragment);
|
|
297
316
|
|
|
298
317
|
default:
|
|
299
318
|
throw new Error(`Fragment ${fragment.name} not found in the scope ${this.name}`);
|
|
@@ -310,11 +329,9 @@ export class A_Scope {
|
|
|
310
329
|
new(...args: any[]): T
|
|
311
330
|
}): T {
|
|
312
331
|
|
|
313
|
-
// The idea here that in case when Scope has no exact component we have to resolve it from the
|
|
314
|
-
// BUT: if it's not presented in
|
|
332
|
+
// The idea here that in case when Scope has no exact component we have to resolve it from the _parent
|
|
333
|
+
// BUT: if it's not presented in _parent we have to check for inheritance
|
|
315
334
|
// That means that we should ensure that there's no components that are children of the required component
|
|
316
|
-
|
|
317
|
-
|
|
318
335
|
switch (true) {
|
|
319
336
|
// In case when the component is available and exists in the scope
|
|
320
337
|
case this.components.includes(component) && this._components.has(component): {
|
|
@@ -354,9 +371,9 @@ export class A_Scope {
|
|
|
354
371
|
return this.resolveComponent<T>(found as any);
|
|
355
372
|
}
|
|
356
373
|
|
|
357
|
-
// In case when the component is not available in the scope but the
|
|
358
|
-
case !this.components.includes(component) && !!this.
|
|
359
|
-
return this.
|
|
374
|
+
// In case when the component is not available in the scope but the _parent is available
|
|
375
|
+
case !this.components.includes(component) && !!this._parent: {
|
|
376
|
+
return this._parent.resolveComponent(component);
|
|
360
377
|
}
|
|
361
378
|
|
|
362
379
|
default:
|
|
@@ -28,11 +28,11 @@ export type A_TYPES__ScopeConstructor = {
|
|
|
28
28
|
/**
|
|
29
29
|
* A list of Features/Lifecycle Hooks available in the Scope
|
|
30
30
|
*/
|
|
31
|
-
import: Array<string>,
|
|
31
|
+
// import: Array<string>,
|
|
32
32
|
/**
|
|
33
33
|
* A list of Features/Lifecycle Hooks available to be exported from the Scope
|
|
34
34
|
*/
|
|
35
|
-
export: Array<string>
|
|
35
|
+
// export: Array<string>
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
|
|
@@ -5,7 +5,6 @@ import { A_TYPES__A_Stage_JSON, A_TYPES__A_Stage_Status, A_TYPES__A_StageStep }
|
|
|
5
5
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* A_Stage is a set of A_Functions within A_Feature that should be run in a specific order.
|
|
11
10
|
* Each stage may contain one or more functions.
|
|
@@ -53,21 +52,20 @@ export class A_Stage {
|
|
|
53
52
|
* @returns
|
|
54
53
|
*/
|
|
55
54
|
protected async getStepArgs(step: A_TYPES__A_StageStep) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
step.handler
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
55
|
+
return Promise
|
|
56
|
+
.all(A_Context
|
|
57
|
+
.meta(
|
|
58
|
+
step.component instanceof A_Container
|
|
59
|
+
? step.component.constructor
|
|
60
|
+
: step.component
|
|
61
|
+
)
|
|
62
|
+
.injections(step.handler)
|
|
63
|
+
.map(async arg =>
|
|
64
|
+
// In case if the target is a feature step then pass the current feature
|
|
65
|
+
A_CommonHelper.isInheritedFrom(arg.target, A_Feature)
|
|
66
|
+
? this.feature
|
|
67
|
+
: A_Context.scope(this.feature).resolve(arg.target)
|
|
68
|
+
));
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
|
|
@@ -95,6 +93,7 @@ export class A_Stage {
|
|
|
95
93
|
protected getStepInstance(step: A_TYPES__A_StageStep) {
|
|
96
94
|
const { component, handler } = step;
|
|
97
95
|
|
|
96
|
+
|
|
98
97
|
// TODO: probably would be better to do it another way. let's think about it
|
|
99
98
|
const instance = component instanceof A_Container
|
|
100
99
|
? component
|
|
@@ -117,11 +116,12 @@ export class A_Stage {
|
|
|
117
116
|
* @param step
|
|
118
117
|
* @returns
|
|
119
118
|
*/
|
|
120
|
-
protected async
|
|
119
|
+
protected async callStepHandler(step: A_TYPES__A_StageStep) {
|
|
121
120
|
|
|
122
|
-
const instance = this.getStepInstance(step);
|
|
121
|
+
const instance = await this.getStepInstance(step);
|
|
123
122
|
const callArgs = await this.getStepArgs(step);
|
|
124
123
|
|
|
124
|
+
|
|
125
125
|
return instance[step.handler](...callArgs);
|
|
126
126
|
|
|
127
127
|
}
|
|
@@ -148,14 +148,14 @@ export class A_Stage {
|
|
|
148
148
|
.all([
|
|
149
149
|
|
|
150
150
|
// Run async steps that are independent of each other
|
|
151
|
-
...asyncSteps.map(step => this.
|
|
151
|
+
...asyncSteps.map(step => this.callStepHandler(step)),
|
|
152
152
|
|
|
153
153
|
// Run sync steps that are dependent on each other
|
|
154
154
|
new Promise<void>(
|
|
155
155
|
async (r, j) => {
|
|
156
156
|
try {
|
|
157
157
|
for (const step of syncSteps) {
|
|
158
|
-
await this.
|
|
158
|
+
await this.callStepHandler(step);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
return r();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types"
|
|
2
1
|
import { A_Component } from "../A-Component/A-Component.class"
|
|
3
2
|
import { A_Container } from "../A-Container/A-Container.class"
|
|
4
|
-
import { A_TYPES__A_ExtendDecorator_BehaviorConfig
|
|
3
|
+
import { A_TYPES__A_ExtendDecorator_BehaviorConfig } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types"
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
|
|
@@ -66,7 +65,7 @@ export type A_TYPES__A_StageStep = {
|
|
|
66
65
|
/**
|
|
67
66
|
* The component to be called
|
|
68
67
|
*/
|
|
69
|
-
component: typeof A_Component
|
|
68
|
+
component: typeof A_Component | A_Container
|
|
70
69
|
|
|
71
70
|
/**
|
|
72
71
|
* The method to be called on the component
|
|
@@ -17,11 +17,16 @@ export class StepsManager {
|
|
|
17
17
|
this.visited = new Set();
|
|
18
18
|
this.tempMark = new Set();
|
|
19
19
|
this.sortedEntities = [];
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private ID(step: A_TYPES__A_StageStep) {
|
|
24
|
+
return `${step.component.name}.${step.handler}`;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
private buildGraph() {
|
|
23
28
|
// Initialize graph nodes
|
|
24
|
-
this.entities.forEach(entity => this.graph.set(entity
|
|
29
|
+
this.entities.forEach(entity => this.graph.set(this.ID(entity), new Set()));
|
|
25
30
|
|
|
26
31
|
// Add directed edges based on 'before' and 'after'
|
|
27
32
|
this.entities.forEach(entity => {
|
|
@@ -51,8 +56,8 @@ export class StepsManager {
|
|
|
51
56
|
private matchEntities(pattern) {
|
|
52
57
|
const regex = new RegExp(`^${pattern}$`);
|
|
53
58
|
return this.entities
|
|
54
|
-
.filter(entity => regex.test(entity
|
|
55
|
-
.map(entity => entity
|
|
59
|
+
.filter(entity => regex.test(this.ID(entity)))
|
|
60
|
+
.map(entity => this.ID(entity));
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
// Topological sort with cycle detection
|
|
@@ -74,16 +79,15 @@ export class StepsManager {
|
|
|
74
79
|
|
|
75
80
|
// Start topological sort
|
|
76
81
|
this.entities.forEach(entity => {
|
|
77
|
-
if (!this.visited.has(entity
|
|
82
|
+
if (!this.visited.has(this.ID(entity))) this.visit(this.ID(entity));
|
|
78
83
|
});
|
|
79
84
|
|
|
80
85
|
const stages: A_Stage[] = [];
|
|
81
86
|
|
|
82
87
|
// Map sorted names back to entity objects
|
|
83
88
|
this.sortedEntities
|
|
84
|
-
.map(
|
|
85
|
-
|
|
86
|
-
const step = this.entities.find(entity => entity.name === name)!;
|
|
89
|
+
.map(id => {
|
|
90
|
+
const step = this.entities.find(entity => this.ID(entity) === id)!;
|
|
87
91
|
|
|
88
92
|
let stage = stages.find(stage => {
|
|
89
93
|
return stage.after.every(after => step.after.includes(after))
|
package/trace-require.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const Module = require("module");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
// Colors (ANSI escape codes)
|
|
5
|
+
const colors = {
|
|
6
|
+
reset: "\x1b[0m",
|
|
7
|
+
gray: "\x1b[90m",
|
|
8
|
+
green: "\x1b[32m",
|
|
9
|
+
cyan: "\x1b[36m",
|
|
10
|
+
yellow: "\x1b[33m",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Indent helper
|
|
14
|
+
function indent(level) {
|
|
15
|
+
return " ".repeat(level);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const originalLoad = Module._load;
|
|
19
|
+
let stack = [];
|
|
20
|
+
|
|
21
|
+
Module._load = function (request, parent, isMain) {
|
|
22
|
+
const resolved = Module._resolveFilename(request, parent);
|
|
23
|
+
const parentFile = parent && parent.filename ? parent.filename : "<root>";
|
|
24
|
+
const depth = stack.length;
|
|
25
|
+
|
|
26
|
+
let color = colors.gray;
|
|
27
|
+
let label = resolved;
|
|
28
|
+
|
|
29
|
+
if (resolved.includes("/src/")) {
|
|
30
|
+
color = colors.green; // project source
|
|
31
|
+
label = path.relative(process.cwd(), resolved);
|
|
32
|
+
} else if (resolved.includes("node_modules")) {
|
|
33
|
+
color = colors.cyan; // external deps
|
|
34
|
+
label = path.relative(process.cwd(), resolved);
|
|
35
|
+
} else {
|
|
36
|
+
color = colors.yellow; // stdlib / others
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log(indent(depth) + color + label + colors.reset);
|
|
40
|
+
|
|
41
|
+
stack.push(resolved);
|
|
42
|
+
const result = originalLoad.apply(this, arguments);
|
|
43
|
+
stack.pop();
|
|
44
|
+
|
|
45
|
+
return result;
|
|
46
|
+
};
|