@celljs/core 4.1.0 → 4.2.0
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 +49 -62
- package/esm/browser/static-module.d.ts +1 -1
- package/esm/common/annotation/aspect.d.ts +2 -1
- package/esm/common/annotation/aspect.js.map +1 -1
- package/esm/common/annotation/autowired-provider.d.ts +0 -2
- package/esm/common/annotation/autowired-provider.js +4 -13
- package/esm/common/annotation/autowired-provider.js.map +1 -1
- package/esm/common/annotation/autowired.d.ts +1 -1
- package/esm/common/annotation/autowired.js +11 -3
- package/esm/common/annotation/autowired.js.map +1 -1
- package/esm/common/annotation/component.d.ts +4 -8
- package/esm/common/annotation/component.js +0 -6
- package/esm/common/annotation/component.js.map +1 -1
- package/esm/common/annotation/constant.d.ts +1 -1
- package/esm/common/annotation/constant.js +6 -3
- package/esm/common/annotation/constant.js.map +1 -1
- package/esm/common/annotation/detached/autowired-provider.js +2 -2
- package/esm/common/annotation/detached/autowired-provider.js.map +1 -1
- package/esm/common/annotation/index.d.ts +0 -6
- package/esm/common/annotation/index.js +0 -6
- package/esm/common/annotation/index.js.map +1 -1
- package/esm/common/annotation/named.d.ts +2 -1
- package/esm/common/annotation/named.js +5 -1
- package/esm/common/annotation/named.js.map +1 -1
- package/esm/common/annotation/optional.d.ts +2 -1
- package/esm/common/annotation/optional.js +5 -1
- package/esm/common/annotation/optional.js.map +1 -1
- package/esm/common/annotation/post-construct.d.ts +2 -1
- package/esm/common/annotation/post-construct.js +5 -1
- package/esm/common/annotation/post-construct.js.map +1 -1
- package/esm/common/annotation/tagged.d.ts +2 -1
- package/esm/common/annotation/tagged.js +6 -1
- package/esm/common/annotation/tagged.js.map +1 -1
- package/esm/common/annotation/value.d.ts +3 -2
- package/esm/common/annotation/value.js +7 -10
- package/esm/common/annotation/value.js.map +1 -1
- package/esm/common/aop/aop-proxy-factory.d.ts +6 -2
- package/esm/common/aop/aop-proxy-factory.js +44 -28
- package/esm/common/aop/aop-proxy-factory.js.map +1 -1
- package/esm/common/aop/class-filter.js +6 -6
- package/esm/common/aop/class-filter.js.map +1 -1
- package/esm/common/application/application-factory.d.ts +1 -1
- package/esm/common/application/application-factory.js +4 -4
- package/esm/common/application/application-factory.js.map +1 -1
- package/esm/common/container/auto-bind.d.ts +7 -3
- package/esm/common/container/auto-bind.js +49 -80
- package/esm/common/container/auto-bind.js.map +1 -1
- package/esm/common/container/container-error.d.ts +21 -0
- package/esm/common/container/container-error.js +22 -0
- package/esm/common/container/container-error.js.map +1 -0
- package/esm/common/container/container-provider.d.ts +5 -4
- package/esm/common/container/container-provider.js +2 -1
- package/esm/common/container/container-provider.js.map +1 -1
- package/esm/common/container/container-util.d.ts +5 -7
- package/esm/common/container/container-util.js +8 -19
- package/esm/common/container/container-util.js.map +1 -1
- package/esm/common/container/container.d.ts +104 -0
- package/esm/common/container/container.js +299 -0
- package/esm/common/container/container.js.map +1 -0
- package/esm/common/container/dynamic-container.d.ts +1 -1
- package/esm/common/container/dynamic-container.js +2 -2
- package/esm/common/container/dynamic-container.js.map +1 -1
- package/esm/common/container/index.d.ts +5 -6
- package/esm/common/container/index.js +5 -3
- package/esm/common/container/index.js.map +1 -1
- package/esm/common/container/injection.d.ts +40 -0
- package/esm/common/container/injection.js +109 -0
- package/esm/common/container/injection.js.map +1 -0
- package/esm/common/container/scope.d.ts +2 -3
- package/esm/common/container/scope.js +2 -3
- package/esm/common/container/scope.js.map +1 -1
- package/esm/common/el/application-expression-engine.d.ts +7 -0
- package/esm/common/{provider/provider-creator.js → el/application-expression-engine.js} +11 -11
- package/esm/common/el/application-expression-engine.js.map +1 -0
- package/esm/common/el/core-context-initializer.d.ts +3 -2
- package/esm/common/el/core-context-initializer.js +10 -8
- package/esm/common/el/core-context-initializer.js.map +1 -1
- package/esm/common/el/expression-compiler.d.ts +5 -4
- package/esm/common/el/expression-compiler.js +7 -6
- package/esm/common/el/expression-compiler.js.map +1 -1
- package/esm/common/el/expression-engine.d.ts +61 -0
- package/esm/common/el/expression-engine.js +459 -0
- package/esm/common/el/expression-engine.js.map +1 -0
- package/esm/common/el/expression-handler.d.ts +1 -2
- package/esm/common/el/expression-handler.js +1 -5
- package/esm/common/el/expression-handler.js.map +1 -1
- package/esm/common/el/expression-protocol.d.ts +3 -5
- package/esm/common/el/expression-protocol.js +0 -1
- package/esm/common/el/expression-protocol.js.map +1 -1
- package/esm/common/el/expression-util.d.ts +9 -8
- package/esm/common/el/expression-util.js +8 -9
- package/esm/common/el/expression-util.js.map +1 -1
- package/esm/common/el/index.d.ts +2 -1
- package/esm/common/el/index.js +2 -1
- package/esm/common/el/index.js.map +1 -1
- package/esm/common/provider/index.d.ts +0 -1
- package/esm/common/provider/index.js +0 -1
- package/esm/common/provider/index.js.map +1 -1
- package/esm/common/provider/provider-protocol.d.ts +5 -9
- package/esm/common/provider/provider-protocol.js +0 -1
- package/esm/common/provider/provider-protocol.js.map +1 -1
- package/esm/common/provider/provider-util.d.ts +1 -1
- package/esm/common/provider/provider-util.js +2 -2
- package/esm/common/provider/provider-util.js.map +1 -1
- package/esm/common/provider/provider.d.ts +7 -6
- package/esm/common/provider/provider.js +15 -26
- package/esm/common/provider/provider.js.map +1 -1
- package/esm/common/static-module.d.ts +1 -1
- package/esm/common/static-module.js +1 -1
- package/esm/common/static-module.js.map +1 -1
- package/esm/common/test/mock-logger.js +2 -13
- package/esm/common/test/mock-logger.js.map +1 -1
- package/esm/common/test/test-module.d.ts +1 -1
- package/esm/common/test/test-module.js +1 -1
- package/esm/common/test/test-module.js.map +1 -1
- package/esm/common/utils/annotation-util.js +2 -1
- package/esm/common/utils/annotation-util.js.map +1 -1
- package/esm/common/utils/proxy-util.d.ts +5 -2
- package/esm/common/utils/proxy-util.js +10 -28
- package/esm/common/utils/proxy-util.js.map +1 -1
- package/esm/node/static-module.d.ts +1 -1
- package/lib/browser/static-module.d.ts +1 -1
- package/lib/common/annotation/aspect.d.ts +2 -1
- package/lib/common/annotation/aspect.d.ts.map +1 -1
- package/lib/common/annotation/aspect.js.map +1 -1
- package/lib/common/annotation/autowired-provider.d.ts +0 -2
- package/lib/common/annotation/autowired-provider.d.ts.map +1 -1
- package/lib/common/annotation/autowired-provider.js +4 -14
- package/lib/common/annotation/autowired-provider.js.map +1 -1
- package/lib/common/annotation/autowired.d.ts +1 -1
- package/lib/common/annotation/autowired.d.ts.map +1 -1
- package/lib/common/annotation/autowired.js +11 -3
- package/lib/common/annotation/autowired.js.map +1 -1
- package/lib/common/annotation/component.d.ts +4 -8
- package/lib/common/annotation/component.d.ts.map +1 -1
- package/lib/common/annotation/component.js +0 -6
- package/lib/common/annotation/component.js.map +1 -1
- package/lib/common/annotation/constant.d.ts +1 -1
- package/lib/common/annotation/constant.d.ts.map +1 -1
- package/lib/common/annotation/constant.js +6 -3
- package/lib/common/annotation/constant.js.map +1 -1
- package/lib/common/annotation/detached/autowired-provider.js +2 -2
- package/lib/common/annotation/detached/autowired-provider.js.map +1 -1
- package/lib/common/annotation/index.d.ts +0 -6
- package/lib/common/annotation/index.d.ts.map +1 -1
- package/lib/common/annotation/index.js +0 -6
- package/lib/common/annotation/index.js.map +1 -1
- package/lib/common/annotation/named.d.ts +2 -1
- package/lib/common/annotation/named.d.ts.map +1 -1
- package/lib/common/annotation/named.js +6 -2
- package/lib/common/annotation/named.js.map +1 -1
- package/lib/common/annotation/optional.d.ts +2 -1
- package/lib/common/annotation/optional.d.ts.map +1 -1
- package/lib/common/annotation/optional.js +6 -2
- package/lib/common/annotation/optional.js.map +1 -1
- package/lib/common/annotation/post-construct.d.ts +2 -1
- package/lib/common/annotation/post-construct.d.ts.map +1 -1
- package/lib/common/annotation/post-construct.js +6 -2
- package/lib/common/annotation/post-construct.js.map +1 -1
- package/lib/common/annotation/tagged.d.ts +2 -1
- package/lib/common/annotation/tagged.d.ts.map +1 -1
- package/lib/common/annotation/tagged.js +7 -2
- package/lib/common/annotation/tagged.js.map +1 -1
- package/lib/common/annotation/value.d.ts +3 -2
- package/lib/common/annotation/value.d.ts.map +1 -1
- package/lib/common/annotation/value.js +7 -10
- package/lib/common/annotation/value.js.map +1 -1
- package/lib/common/aop/aop-proxy-factory.d.ts +6 -2
- package/lib/common/aop/aop-proxy-factory.d.ts.map +1 -1
- package/lib/common/aop/aop-proxy-factory.js +45 -29
- package/lib/common/aop/aop-proxy-factory.js.map +1 -1
- package/lib/common/aop/class-filter.js +7 -7
- package/lib/common/aop/class-filter.js.map +1 -1
- package/lib/common/application/application-factory.d.ts +1 -1
- package/lib/common/application/application-factory.d.ts.map +1 -1
- package/lib/common/application/application-factory.js +4 -4
- package/lib/common/application/application-factory.js.map +1 -1
- package/lib/common/container/assembly.spec.js +11 -11
- package/lib/common/container/assembly.spec.js.map +1 -1
- package/lib/common/container/auto-bind.d.ts +7 -3
- package/lib/common/container/auto-bind.d.ts.map +1 -1
- package/lib/common/container/auto-bind.js +49 -81
- package/lib/common/container/auto-bind.js.map +1 -1
- package/lib/common/container/container-error.d.ts +22 -0
- package/lib/common/container/container-error.d.ts.map +1 -0
- package/lib/common/container/container-error.js +26 -0
- package/lib/common/container/container-error.js.map +1 -0
- package/lib/common/container/container-provider.d.ts +5 -4
- package/lib/common/container/container-provider.d.ts.map +1 -1
- package/lib/common/container/container-provider.js +3 -2
- package/lib/common/container/container-provider.js.map +1 -1
- package/lib/common/container/container-util.d.ts +5 -7
- package/lib/common/container/container-util.d.ts.map +1 -1
- package/lib/common/container/container-util.js +8 -19
- package/lib/common/container/container-util.js.map +1 -1
- package/lib/common/container/container.d.ts +105 -0
- package/lib/common/container/container.d.ts.map +1 -0
- package/lib/common/container/container.js +305 -0
- package/lib/common/container/container.js.map +1 -0
- package/lib/common/container/container.spec.d.ts +2 -0
- package/lib/common/container/container.spec.d.ts.map +1 -0
- package/lib/common/container/container.spec.js +334 -0
- package/lib/common/container/container.spec.js.map +1 -0
- package/lib/common/container/dynamic-container.d.ts +1 -1
- package/lib/common/container/dynamic-container.d.ts.map +1 -1
- package/lib/common/container/dynamic-container.js +3 -3
- package/lib/common/container/dynamic-container.js.map +1 -1
- package/lib/common/container/index.d.ts +5 -6
- package/lib/common/container/index.d.ts.map +1 -1
- package/lib/common/container/index.js +5 -3
- package/lib/common/container/index.js.map +1 -1
- package/lib/common/container/injection.d.ts +41 -0
- package/lib/common/container/injection.d.ts.map +1 -0
- package/lib/common/container/injection.js +112 -0
- package/lib/common/container/injection.js.map +1 -0
- package/lib/common/container/scope.d.ts +2 -3
- package/lib/common/container/scope.d.ts.map +1 -1
- package/lib/common/container/scope.js +2 -3
- package/lib/common/container/scope.js.map +1 -1
- package/lib/common/el/application-expression-engine.d.ts +8 -0
- package/lib/common/el/application-expression-engine.d.ts.map +1 -0
- package/lib/common/el/application-expression-engine.js +22 -0
- package/lib/common/el/application-expression-engine.js.map +1 -0
- package/lib/common/el/core-context-initializer.d.ts +3 -2
- package/lib/common/el/core-context-initializer.d.ts.map +1 -1
- package/lib/common/el/core-context-initializer.js +9 -7
- package/lib/common/el/core-context-initializer.js.map +1 -1
- package/lib/common/el/expression-compiler.d.ts +5 -4
- package/lib/common/el/expression-compiler.d.ts.map +1 -1
- package/lib/common/el/expression-compiler.js +6 -5
- package/lib/common/el/expression-compiler.js.map +1 -1
- package/lib/common/el/expression-engine.d.ts +62 -0
- package/lib/common/el/expression-engine.d.ts.map +1 -0
- package/lib/common/el/expression-engine.js +465 -0
- package/lib/common/el/expression-engine.js.map +1 -0
- package/lib/common/el/expression-engine.spec.d.ts +2 -0
- package/lib/common/el/expression-engine.spec.d.ts.map +1 -0
- package/lib/common/el/expression-engine.spec.js +100 -0
- package/lib/common/el/expression-engine.spec.js.map +1 -0
- package/lib/common/el/expression-handler.d.ts +1 -2
- package/lib/common/el/expression-handler.d.ts.map +1 -1
- package/lib/common/el/expression-handler.js +0 -4
- package/lib/common/el/expression-handler.js.map +1 -1
- package/lib/common/el/expression-handler.spec.js +5 -6
- package/lib/common/el/expression-handler.spec.js.map +1 -1
- package/lib/common/el/expression-protocol.d.ts +3 -5
- package/lib/common/el/expression-protocol.d.ts.map +1 -1
- package/lib/common/el/expression-protocol.js +1 -2
- package/lib/common/el/expression-protocol.js.map +1 -1
- package/lib/common/el/expression-util.d.ts +9 -8
- package/lib/common/el/expression-util.d.ts.map +1 -1
- package/lib/common/el/expression-util.js +8 -9
- package/lib/common/el/expression-util.js.map +1 -1
- package/lib/common/el/index.d.ts +2 -1
- package/lib/common/el/index.d.ts.map +1 -1
- package/lib/common/el/index.js +2 -1
- package/lib/common/el/index.js.map +1 -1
- package/lib/common/el/value-and-el.spec.js +2 -2
- package/lib/common/el/value-and-el.spec.js.map +1 -1
- package/lib/common/provider/index.d.ts +0 -1
- package/lib/common/provider/index.d.ts.map +1 -1
- package/lib/common/provider/index.js +0 -1
- package/lib/common/provider/index.js.map +1 -1
- package/lib/common/provider/provider-protocol.d.ts +5 -9
- package/lib/common/provider/provider-protocol.d.ts.map +1 -1
- package/lib/common/provider/provider-protocol.js +1 -2
- package/lib/common/provider/provider-protocol.js.map +1 -1
- package/lib/common/provider/provider-util.d.ts +1 -1
- package/lib/common/provider/provider-util.d.ts.map +1 -1
- package/lib/common/provider/provider-util.js +2 -2
- package/lib/common/provider/provider-util.js.map +1 -1
- package/lib/common/provider/provider.d.ts +7 -6
- package/lib/common/provider/provider.d.ts.map +1 -1
- package/lib/common/provider/provider.js +16 -26
- package/lib/common/provider/provider.js.map +1 -1
- package/lib/common/static-module.d.ts +1 -1
- package/lib/common/static-module.js +2 -2
- package/lib/common/static-module.js.map +1 -1
- package/lib/common/test/mock-logger.d.ts.map +1 -1
- package/lib/common/test/mock-logger.js +2 -12
- package/lib/common/test/mock-logger.js.map +1 -1
- package/lib/common/test/test-module.d.ts +1 -1
- package/lib/common/test/test-module.d.ts.map +1 -1
- package/lib/common/test/test-module.js +2 -2
- package/lib/common/test/test-module.js.map +1 -1
- package/lib/common/utils/annotation-util.js +2 -1
- package/lib/common/utils/annotation-util.js.map +1 -1
- package/lib/common/utils/proxy-util.d.ts +5 -2
- package/lib/common/utils/proxy-util.d.ts.map +1 -1
- package/lib/common/utils/proxy-util.js +12 -30
- package/lib/common/utils/proxy-util.js.map +1 -1
- package/lib/node/static-module.d.ts +1 -1
- package/package.json +4 -6
- package/src/common/annotation/aspect.ts +2 -1
- package/src/common/annotation/autowired-provider.ts +4 -17
- package/src/common/annotation/autowired.ts +14 -6
- package/src/common/annotation/component.ts +6 -26
- package/src/common/annotation/constant.ts +10 -7
- package/src/common/annotation/detached/autowired-provider.ts +2 -2
- package/src/common/annotation/index.ts +0 -6
- package/src/common/annotation/named.ts +7 -1
- package/src/common/annotation/optional.ts +6 -1
- package/src/common/annotation/post-construct.ts +6 -1
- package/src/common/annotation/tagged.ts +8 -1
- package/src/common/annotation/value.ts +9 -11
- package/src/common/aop/aop-proxy-factory.ts +52 -30
- package/src/common/aop/class-filter.ts +6 -6
- package/src/common/application/application-factory.ts +4 -5
- package/src/common/container/assembly.spec.ts +7 -12
- package/src/common/container/auto-bind.ts +54 -85
- package/src/common/container/container-error.ts +31 -0
- package/src/common/container/container-provider.ts +9 -7
- package/src/common/container/container-util.ts +8 -19
- package/src/common/container/container.spec.ts +262 -0
- package/src/common/container/container.ts +363 -0
- package/src/common/container/dynamic-container.ts +2 -2
- package/src/common/container/index.ts +5 -7
- package/src/common/container/injection.ts +135 -0
- package/src/common/container/scope.ts +2 -1
- package/src/common/el/application-expression-engine.ts +9 -0
- package/src/common/el/core-context-initializer.ts +9 -8
- package/src/common/el/expression-compiler.ts +7 -6
- package/src/common/el/expression-engine.spec.ts +107 -0
- package/src/common/el/expression-engine.ts +487 -0
- package/src/common/el/expression-handler.spec.ts +6 -7
- package/src/common/el/expression-handler.ts +2 -5
- package/src/common/el/expression-protocol.ts +4 -8
- package/src/common/el/expression-util.ts +12 -13
- package/src/common/el/index.ts +3 -2
- package/src/common/el/value-and-el.spec.ts +2 -2
- package/src/common/provider/index.ts +0 -2
- package/src/common/provider/provider-protocol.ts +5 -11
- package/src/common/provider/provider-util.ts +3 -3
- package/src/common/provider/provider.ts +17 -29
- package/src/common/static-module.ts +1 -1
- package/src/common/test/mock-logger.ts +0 -2
- package/src/common/test/test-module.ts +1 -1
- package/src/common/utils/annotation-util.ts +2 -2
- package/src/common/utils/proxy-util.ts +8 -28
- package/esm/common/annotation/decorate.d.ts +0 -1
- package/esm/common/annotation/decorate.js +0 -2
- package/esm/common/annotation/decorate.js.map +0 -1
- package/esm/common/annotation/inject.d.ts +0 -1
- package/esm/common/annotation/inject.js +0 -2
- package/esm/common/annotation/inject.js.map +0 -1
- package/esm/common/annotation/injectable.d.ts +0 -1
- package/esm/common/annotation/injectable.js +0 -2
- package/esm/common/annotation/injectable.js.map +0 -1
- package/esm/common/annotation/pre-destroy.d.ts +0 -1
- package/esm/common/annotation/pre-destroy.js +0 -2
- package/esm/common/annotation/pre-destroy.js.map +0 -1
- package/esm/common/annotation/target-name.d.ts +0 -1
- package/esm/common/annotation/target-name.js +0 -2
- package/esm/common/annotation/target-name.js.map +0 -1
- package/esm/common/annotation/unmanaged.d.ts +0 -1
- package/esm/common/annotation/unmanaged.js +0 -2
- package/esm/common/annotation/unmanaged.js.map +0 -1
- package/esm/common/container/container-factory.d.ts +0 -4
- package/esm/common/container/container-factory.js +0 -9
- package/esm/common/container/container-factory.js.map +0 -1
- package/esm/common/el/jexl-engine-provider.d.ts +0 -5
- package/esm/common/el/jexl-engine-provider.js +0 -22
- package/esm/common/el/jexl-engine-provider.js.map +0 -1
- package/esm/common/provider/provider-creator.d.ts +0 -6
- package/esm/common/provider/provider-creator.js.map +0 -1
- package/lib/common/annotation/decorate.d.ts +0 -2
- package/lib/common/annotation/decorate.d.ts.map +0 -1
- package/lib/common/annotation/decorate.js +0 -6
- package/lib/common/annotation/decorate.js.map +0 -1
- package/lib/common/annotation/inject.d.ts +0 -2
- package/lib/common/annotation/inject.d.ts.map +0 -1
- package/lib/common/annotation/inject.js +0 -6
- package/lib/common/annotation/inject.js.map +0 -1
- package/lib/common/annotation/injectable.d.ts +0 -2
- package/lib/common/annotation/injectable.d.ts.map +0 -1
- package/lib/common/annotation/injectable.js +0 -6
- package/lib/common/annotation/injectable.js.map +0 -1
- package/lib/common/annotation/pre-destroy.d.ts +0 -2
- package/lib/common/annotation/pre-destroy.d.ts.map +0 -1
- package/lib/common/annotation/pre-destroy.js +0 -6
- package/lib/common/annotation/pre-destroy.js.map +0 -1
- package/lib/common/annotation/target-name.d.ts +0 -2
- package/lib/common/annotation/target-name.d.ts.map +0 -1
- package/lib/common/annotation/target-name.js +0 -6
- package/lib/common/annotation/target-name.js.map +0 -1
- package/lib/common/annotation/unmanaged.d.ts +0 -2
- package/lib/common/annotation/unmanaged.d.ts.map +0 -1
- package/lib/common/annotation/unmanaged.js +0 -6
- package/lib/common/annotation/unmanaged.js.map +0 -1
- package/lib/common/container/container-factory.d.ts +0 -5
- package/lib/common/container/container-factory.d.ts.map +0 -1
- package/lib/common/container/container-factory.js +0 -13
- package/lib/common/container/container-factory.js.map +0 -1
- package/lib/common/el/jexl-engine-provider.d.ts +0 -6
- package/lib/common/el/jexl-engine-provider.d.ts.map +0 -1
- package/lib/common/el/jexl-engine-provider.js +0 -25
- package/lib/common/el/jexl-engine-provider.js.map +0 -1
- package/lib/common/provider/provider-creator.d.ts +0 -7
- package/lib/common/provider/provider-creator.d.ts.map +0 -1
- package/lib/common/provider/provider-creator.js +0 -22
- package/lib/common/provider/provider-creator.js.map +0 -1
- package/src/common/annotation/decorate.ts +0 -1
- package/src/common/annotation/inject.ts +0 -1
- package/src/common/annotation/injectable.ts +0 -1
- package/src/common/annotation/pre-destroy.ts +0 -1
- package/src/common/annotation/target-name.ts +0 -1
- package/src/common/annotation/unmanaged.ts +0 -1
- package/src/common/container/container-factory.ts +0 -9
- package/src/common/el/jexl-engine-provider.ts +0 -18
- package/src/common/provider/provider-creator.ts +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/common/provider/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/common/provider/provider.ts"],"names":[],"mappings":";;;;AACA,2DAAwE;AACxE,4DAAyD;AACzD,yEAAoE;AAEpE,MAAM,oBAAoB,GAAwC,KAAK,CAAC,EAAE;IACtE,IAAI,KAAK,EAAE,CAAC;QACR,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC,QAAQ,CAAC;QAC1B,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC,KAAK,CAAC;QACvB,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC;AACL,CAAC,CAAC;AAEF;IAII,YACuB,WAA2B,EAC3B,SAAoB;2BADpB,WAAW;yBACX,SAAS;IAC5B,CAAC;IAEL,GAAG;QACC,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,2CAAuB,CAAC;gBAClE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAA0B,2CAAuB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC9G,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,WAAW,GAAsC,oBAAoB;QAC1E,IAAI,CAAC,UAAU,GAAG,+BAAc,CAAC,iBAAiB,CAAI,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjG,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAW,GAAkC,oBAAoB;QACxE,MAAM,MAAM,GAAG,MAAM,+BAAc,CAAC,aAAa,CAAI,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;QAC9E,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,CAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ;;AAED,+GAA+G;AAC/G,+BAAsC,IAA2C;IAC7E,IAAI,CAAC,6BAAQ,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAK,CAAC,2BAAM,CAAwB,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AACrI,CAAC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("./index");
|
|
4
4
|
const value_1 = require("./annotation/value");
|
|
5
|
-
const
|
|
5
|
+
const provider_1 = require("./provider/provider");
|
|
6
6
|
const auto_bind_1 = require("./container/auto-bind");
|
|
7
7
|
exports.default = (0, auto_bind_1.autoBind)(bind => {
|
|
8
8
|
(0, value_1.bindValue)(bind);
|
|
9
|
-
(0,
|
|
9
|
+
(0, provider_1.bindAutowiredProvider)(bind);
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=static-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-module.js","sourceRoot":"","sources":["../../src/common/static-module.ts"],"names":[],"mappings":";;AAAA,mBAAiB;AACjB,8CAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"static-module.js","sourceRoot":"","sources":["../../src/common/static-module.ts"],"names":[],"mappings":";;AAAA,mBAAiB;AACjB,8CAA+C;AAC/C,kDAA4D;AAC5D,qDAAiD;kBAElC,IAAA,oBAAQ,EAAC,IAAI,CAAC,EAAE;IAC3B,IAAA,iBAAS,EAAC,IAAI,CAAC,CAAC;IAChB,IAAA,gCAAqB,EAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-logger.d.ts","sourceRoot":"","sources":["../../../src/common/test/mock-logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock-logger.d.ts","sourceRoot":"","sources":["../../../src/common/test/mock-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,qBAAa,UAAW,YAAW,MAAM;IACrC,KAAK,EAAE,QAAQ,CAAU;IACzB,SAAS,CAAC,QAAQ,CAAC,YAAY,sBAA6B;IAC5D,KAAK,uCAA2B;IAChC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAExB;IACD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3D;IACD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAEjC;IACD,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAEzC;IACD,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1C;IACD,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAEzC;IACD,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1C;IACD,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAElC;CACJ"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.MockLogger = void 0;
|
|
10
|
-
const annotation_1 = require("../annotation");
|
|
11
4
|
const utils_1 = require("../utils");
|
|
12
|
-
|
|
5
|
+
class MockLogger {
|
|
13
6
|
constructor() {
|
|
14
7
|
this.level = 'info';
|
|
15
8
|
this.onLogEmitter = new utils_1.Emitter();
|
|
@@ -39,9 +32,6 @@ let MockLogger = class MockLogger {
|
|
|
39
32
|
isEnabled(level) {
|
|
40
33
|
return false;
|
|
41
34
|
}
|
|
42
|
-
}
|
|
35
|
+
}
|
|
43
36
|
exports.MockLogger = MockLogger;
|
|
44
|
-
exports.MockLogger = MockLogger = __decorate([
|
|
45
|
-
(0, annotation_1.Injectable)()
|
|
46
|
-
], MockLogger);
|
|
47
37
|
//# sourceMappingURL=mock-logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-logger.js","sourceRoot":"","sources":["../../../src/common/test/mock-logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock-logger.js","sourceRoot":"","sources":["../../../src/common/test/mock-logger.ts"],"names":[],"mappings":";;;AACA,oCAAmC;AAEnC;IAAA;QACI,UAAK,GAAa,MAAM,CAAC;QACN,iBAAY,GAAG,IAAI,eAAO,EAAc,CAAC;QAC5D,UAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IAyBpC,CAAC;IAxBG,IAAI,CAAC,KAAa;QACd,aAAa;IACjB,CAAC;IACD,OAAO,CAAC,KAAa,EAAE,OAAgB;QACnC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,UAAU,CAAC,OAAgB;QACvB,aAAa;IACjB,CAAC;IACD,IAAI,CAAC,OAAY,EAAE,OAAgB;QAC/B,aAAa;IACjB,CAAC;IACD,KAAK,CAAC,OAAY,EAAE,OAAgB;QAChC,aAAa;IACjB,CAAC;IACD,IAAI,CAAC,OAAY,EAAE,OAAgB;QAC/B,aAAa;IACjB,CAAC;IACD,KAAK,CAAC,OAAY,EAAE,OAAgB;QAChC,aAAa;IACjB,CAAC;IACD,SAAS,CAAC,KAAe;QACrB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-module.d.ts","sourceRoot":"","sources":["../../../src/common/test/test-module.ts"],"names":[],"mappings":"AAKA,OAAO,UAAU,CAAC;AAElB,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"test-module.d.ts","sourceRoot":"","sources":["../../../src/common/test/test-module.ts"],"names":[],"mappings":"AAKA,OAAO,UAAU,CAAC;AAElB,eAAO,MAAM,cAAc,wCAIzB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.coreTestModule = void 0;
|
|
4
|
-
const autowired_provider_1 = require("../annotation/autowired-provider");
|
|
5
4
|
const value_1 = require("../annotation/value");
|
|
5
|
+
const provider_1 = require("../provider/provider");
|
|
6
6
|
const container_1 = require("../container");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const mock_logger_1 = require("./mock-logger");
|
|
9
9
|
require("../index");
|
|
10
10
|
exports.coreTestModule = (0, container_1.autoBind)((bind, unbind, isBound, rebind) => {
|
|
11
11
|
(0, value_1.bindValue)(bind);
|
|
12
|
-
(0,
|
|
12
|
+
(0, provider_1.bindAutowiredProvider)(bind);
|
|
13
13
|
rebind(logger_1.Logger).to(mock_logger_1.MockLogger).inSingletonScope();
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=test-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-module.js","sourceRoot":"","sources":["../../../src/common/test/test-module.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"test-module.js","sourceRoot":"","sources":["../../../src/common/test/test-module.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,mDAA6D;AAC7D,4CAAwC;AACxC,sCAAmC;AACnC,+CAA2C;AAC3C,oBAAkB;AAEL,QAAA,cAAc,GAAG,IAAA,oBAAQ,EAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACrE,IAAA,iBAAS,EAAC,IAAI,CAAC,CAAC;IAChB,IAAA,gCAAqB,EAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,CAAC,eAAM,CAAC,CAAC,EAAE,CAAC,wBAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
|
@@ -15,8 +15,9 @@ var AnnotationUtil;
|
|
|
15
15
|
}
|
|
16
16
|
AnnotationUtil.getValueOrOption = getValueOrOption;
|
|
17
17
|
function getType(target, targetKey, index) {
|
|
18
|
+
var _a;
|
|
18
19
|
if (index !== undefined) {
|
|
19
|
-
return Reflect.getMetadata('design:paramtypes', target, targetKey)[index];
|
|
20
|
+
return (_a = Reflect.getMetadata('design:paramtypes', target, targetKey)) === null || _a === void 0 ? void 0 : _a[index];
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
22
23
|
return Reflect.getMetadata('design:type', target, targetKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotation-util.js","sourceRoot":"","sources":["../../../src/common/utils/annotation-util.ts"],"names":[],"mappings":";;;AAAA,IAAiB,cAAc,CAoB9B;AApBD,WAAiB,cAAc;IAE3B,SAAgB,gBAAgB,CAAI,aAAmB,EAAE,eAAe,GAAG,IAAI;QAC3E,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACrE,MAAM,GAAG,aAAa,CAAC;QAC3B,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACvB,MAAM,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC;QAClD,CAAC;QACD,OAAO,MAAW,CAAC;IACvB,CAAC;IARe,eAAA,gBAAgB,mBAQ/B,CAAA;IAED,SAAgB,OAAO,CAAC,MAAW,EAAE,SAA0B,EAAE,KAAc
|
|
1
|
+
{"version":3,"file":"annotation-util.js","sourceRoot":"","sources":["../../../src/common/utils/annotation-util.ts"],"names":[],"mappings":";;;AAAA,IAAiB,cAAc,CAoB9B;AApBD,WAAiB,cAAc;IAE3B,SAAgB,gBAAgB,CAAI,aAAmB,EAAE,eAAe,GAAG,IAAI;QAC3E,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACrE,MAAM,GAAG,aAAa,CAAC;QAC3B,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACvB,MAAM,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC;QAClD,CAAC;QACD,OAAO,MAAW,CAAC;IACvB,CAAC;IARe,eAAA,gBAAgB,mBAQ/B,CAAA;IAED,SAAgB,OAAO,CAAC,MAAW,EAAE,SAA0B,EAAE,KAAc;;QAC3E,IAAI,KAAK,KAAK,SAAS,EAAG,CAAC;YACvB,OAAO,MAAA,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,EAAE,SAAS,CAAC,0CAAG,KAAK,CAAC,CAAC;QAChF,CAAC;aAAM,CAAC;YACJ,OAAO,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;IANe,eAAA,OAAO,UAMtB,CAAA;AAEL,CAAC,EApBgB,cAAc,aAAd,cAAc,GAAd,cAAc,QAoB9B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
1
|
+
/** What a proxy of a component (AOP) answers with the object it wraps. */
|
|
2
|
+
export declare const PROXY_TARGET: unique symbol;
|
|
3
|
+
/** The object behind a component proxy, or the object itself. */
|
|
3
4
|
export declare function getTarget(obj: any): any;
|
|
5
|
+
/** The class of the object behind a component proxy, or of the object itself. */
|
|
6
|
+
export declare function getTargetClass(obj: any): any;
|
|
4
7
|
export declare function isProxy(obj: any): boolean;
|
|
5
8
|
//# sourceMappingURL=proxy-util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-util.d.ts","sourceRoot":"","sources":["../../../src/common/utils/proxy-util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy-util.d.ts","sourceRoot":"","sources":["../../../src/common/utils/proxy-util.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,YAAY,eAA0C,CAAC;AAEpE,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAEvC;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAE5C;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAEzC"}
|
|
@@ -1,40 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.getTargetClass = getTargetClass;
|
|
3
|
+
exports.PROXY_TARGET = void 0;
|
|
5
4
|
exports.getTarget = getTarget;
|
|
5
|
+
exports.getTargetClass = getTargetClass;
|
|
6
6
|
exports.isProxy = isProxy;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/** What a proxy of a component (AOP) answers with the object it wraps. */
|
|
8
|
+
exports.PROXY_TARGET = Symbol.for('@celljs/core/proxy-target');
|
|
9
|
+
/** The object behind a component proxy, or the object itself. */
|
|
10
|
+
function getTarget(obj) {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = obj === null || obj === void 0 ? void 0 : obj[exports.PROXY_TARGET]) !== null && _a !== void 0 ? _a : obj;
|
|
10
13
|
}
|
|
14
|
+
/** The class of the object behind a component proxy, or of the object itself. */
|
|
11
15
|
function getTargetClass(obj) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const target = obj.target;
|
|
15
|
-
return target ? target.constructor : obj.constructor;
|
|
16
|
-
}
|
|
17
|
-
finally {
|
|
18
|
-
resolveMode = false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function getTarget(obj) {
|
|
22
|
-
try {
|
|
23
|
-
resolveMode = true;
|
|
24
|
-
const target = obj.target;
|
|
25
|
-
return target || obj;
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
resolveMode = false;
|
|
29
|
-
}
|
|
16
|
+
var _a;
|
|
17
|
+
return (_a = getTarget(obj)) === null || _a === void 0 ? void 0 : _a.constructor;
|
|
30
18
|
}
|
|
31
19
|
function isProxy(obj) {
|
|
32
|
-
|
|
33
|
-
resolveMode = true;
|
|
34
|
-
return !!obj.target;
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
resolveMode = false;
|
|
38
|
-
}
|
|
20
|
+
return (obj === null || obj === void 0 ? void 0 : obj[exports.PROXY_TARGET]) !== undefined;
|
|
39
21
|
}
|
|
40
22
|
//# sourceMappingURL=proxy-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-util.js","sourceRoot":"","sources":["../../../src/common/utils/proxy-util.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"proxy-util.js","sourceRoot":"","sources":["../../../src/common/utils/proxy-util.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA0E;AAC7D,QAAA,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAEpE,iEAAiE;AACjE,mBAA0B,GAAQ;;IAC9B,aAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAG,QAAA,YAAY,CAAC,mCAAI,GAAG,CAAC;AACtC,CAAC;AAED,iFAAiF;AACjF,wBAA+B,GAAQ;;IACnC,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,0CAAE,WAAW,CAAC;AACvC,CAAC;AAED,iBAAwB,GAAQ;IAC5B,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAG,QAAA,YAAY,CAAC,MAAK,SAAS,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/cellbang/cell.git"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
17
20
|
"main": "lib/common/index.js",
|
|
18
21
|
"typings": "lib/common/index.d.ts",
|
|
19
22
|
"files": [
|
|
@@ -30,13 +33,8 @@
|
|
|
30
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"inversify": "6.1.4",
|
|
34
|
-
"jexl": "2.3.0",
|
|
35
36
|
"reflect-metadata": "^0.1.13"
|
|
36
37
|
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@types/jexl": "^2.2.0"
|
|
39
|
-
},
|
|
40
38
|
"publishConfig": {
|
|
41
39
|
"access": "public"
|
|
42
40
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AOP_TAG } from '../aop/aop-protocol';
|
|
2
|
-
import { ComponentOption, applyComponentDecorator, COMPONENT_TAG,
|
|
2
|
+
import { ComponentOption, applyComponentDecorator, COMPONENT_TAG, parseComponentOption } from './component';
|
|
3
|
+
import type { ComponentId } from '../container/container';
|
|
3
4
|
|
|
4
5
|
export interface AspectOption extends ComponentOption {
|
|
5
6
|
id: ComponentId;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { interfaces } from 'inversify';
|
|
2
1
|
import { applyAutowiredDecorator, DoInject, parseAutowiredOption, IdOrAutowiredOptionWithoutMulti } from './autowired';
|
|
3
|
-
import {
|
|
4
|
-
import { Tagged } from './tagged';
|
|
5
|
-
import { ProviderCreator } from '../provider/provider-protocol';
|
|
6
|
-
import { ComponentId } from './component';
|
|
2
|
+
import { InjectionUtil } from '../container/injection';
|
|
7
3
|
|
|
8
4
|
export const PROVIDER = Symbol('PROVIDER');
|
|
9
5
|
export const ID_KEY = Symbol('ID_KEY');
|
|
@@ -16,16 +12,7 @@ export const AutowiredProvider = function (idOrOption?: IdOrAutowiredOptionWitho
|
|
|
16
12
|
};
|
|
17
13
|
|
|
18
14
|
export const doInjectForAutowiredProvider: DoInject = (option, t, k, i) => {
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const point = InjectionUtil.point(t, k, i);
|
|
16
|
+
point.id = PROVIDER;
|
|
17
|
+
point.tags = { ...point.tags, [ID_KEY]: option.id };
|
|
21
18
|
};
|
|
22
|
-
|
|
23
|
-
export function bindAutowiredProvider(bind: interfaces.Bind): any {
|
|
24
|
-
bind(PROVIDER).toDynamicValue(ctx => {
|
|
25
|
-
const id = ctx.currentRequest.target.getCustomTags()?.find(m => m.key === ID_KEY)!.value as ComponentId;
|
|
26
|
-
const providerCreator = ctx.container.get<ProviderCreator<any>>(ProviderCreator);
|
|
27
|
-
|
|
28
|
-
return providerCreator.create(id, ctx.container);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentId } from '
|
|
1
|
+
import { ContainerUtil } from '../container/container-util';
|
|
2
|
+
import { InjectionUtil } from '../container/injection';
|
|
3
|
+
import type { ComponentId } from '../container/container';
|
|
4
4
|
import { AnnotationUtil } from '../utils';
|
|
5
5
|
|
|
6
6
|
export interface AutowiredOption {
|
|
@@ -44,18 +44,26 @@ export function parseAutowiredOption(target: any, targetKey: string, index?: num
|
|
|
44
44
|
return { ...defaultAutowiredOption, ...option };
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
const doInjectDefault: DoInject = ({ id, multi }, t, k, i) => {
|
|
48
|
+
const point = InjectionUtil.point(t, k, i);
|
|
49
|
+
point.id = id;
|
|
50
|
+
point.multi = multi;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const doGetValueDefault: DoGetValue = ({ id, multi }) => multi ? ContainerUtil.getAll(id!) : ContainerUtil.get(id!);
|
|
54
|
+
|
|
47
55
|
export function applyAutowiredDecorator(option: AutowiredOption, target: any, targetKey: string, index?: number,
|
|
48
|
-
doInject: DoInject =
|
|
49
|
-
doGetValue: DoGetValue = ({ id, multi }, t, property) => multi ? ContainerUtil.getAll(id!) : ContainerUtil.get(id!)) {
|
|
56
|
+
doInject: DoInject = doInjectDefault, doGetValue: DoGetValue = doGetValueDefault) {
|
|
50
57
|
|
|
51
58
|
if (option.detached) {
|
|
52
59
|
if (index !== undefined) {
|
|
53
60
|
throw new Error(`The ${target.constructor.name} itself is not injected into the container, so the parameter injection of the constructor is not supported.`);
|
|
54
61
|
}
|
|
62
|
+
// The value comes from the getter: the container leaves the property alone.
|
|
63
|
+
InjectionUtil.remove(target, targetKey);
|
|
55
64
|
createAutowiredProperty(option, doGetValue, target, targetKey);
|
|
56
65
|
} else {
|
|
57
66
|
doInject(option, target, targetKey, index);
|
|
58
|
-
|
|
59
67
|
}
|
|
60
68
|
return option;
|
|
61
69
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { decorate, injectable, interfaces, METADATA_KEY as inversify_METADATA_KEY } from 'inversify';
|
|
2
1
|
import { METADATA_KEY } from '../constants';
|
|
3
2
|
import { ConfigUtil } from '../config/config-util';
|
|
4
3
|
import { AnnotationUtil } from '../utils';
|
|
5
4
|
import { Scope } from '../container/scope';
|
|
6
|
-
|
|
7
|
-
export type ComponentId<T = any> = interfaces.ServiceIdentifier<T>;
|
|
5
|
+
import type { ActivationHandler, ComponentId } from '../container/container';
|
|
8
6
|
|
|
9
7
|
export const COMPONENT_TAG = 'Component';
|
|
10
8
|
|
|
@@ -14,24 +12,22 @@ export interface ComponentOption {
|
|
|
14
12
|
name?: string | number | symbol;
|
|
15
13
|
tag?: { tag: string | number | symbol, value: any };
|
|
16
14
|
default?: boolean;
|
|
17
|
-
when?: (request: interfaces.Request) => boolean;
|
|
18
15
|
rebind?: boolean;
|
|
19
16
|
proxy?: boolean;
|
|
20
17
|
sysTags?: string[];
|
|
21
|
-
onActivation?:
|
|
18
|
+
onActivation?: ActivationHandler;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
export interface ComponentMetadata {
|
|
25
|
-
ids:
|
|
22
|
+
ids: ComponentId[];
|
|
26
23
|
scope: Scope;
|
|
27
24
|
name?: string | number | symbol;
|
|
28
25
|
tag?: { tag: string | number | symbol, value: any },
|
|
29
26
|
default?: boolean;
|
|
30
|
-
when?: (request: interfaces.Request) => boolean
|
|
31
27
|
rebind: boolean;
|
|
32
28
|
proxy: boolean;
|
|
33
29
|
sysTags: string[]
|
|
34
|
-
onActivation?:
|
|
30
|
+
onActivation?: ActivationHandler;
|
|
35
31
|
target: any;
|
|
36
32
|
}
|
|
37
33
|
|
|
@@ -81,13 +77,6 @@ export function parseComponentOption(target: any, idOrOption: any) {
|
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
export function applyComponentDecorator(option: ComponentOption, target: any) {
|
|
84
|
-
|
|
85
|
-
const isAlreadyDecorated = Reflect.hasOwnMetadata(inversify_METADATA_KEY.PARAM_TYPES, target);
|
|
86
|
-
|
|
87
|
-
if (!isAlreadyDecorated) {
|
|
88
|
-
decorate(injectable(), target);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
80
|
const metadata: ComponentMetadata = {
|
|
92
81
|
target,
|
|
93
82
|
ids: Array.isArray(option.id) ? option.id : [ option.id || target ],
|
|
@@ -98,22 +87,13 @@ export function applyComponentDecorator(option: ComponentOption, target: any) {
|
|
|
98
87
|
name: option.name,
|
|
99
88
|
tag: option.tag,
|
|
100
89
|
default: option.default,
|
|
101
|
-
when: option.when,
|
|
102
90
|
onActivation: option.onActivation
|
|
103
91
|
};
|
|
104
92
|
|
|
105
|
-
let metadatas: ComponentMetadata[] = Reflect.getMetadata(
|
|
106
|
-
METADATA_KEY.component,
|
|
107
|
-
Reflect
|
|
108
|
-
);
|
|
109
|
-
|
|
93
|
+
let metadatas: ComponentMetadata[] = Reflect.getMetadata(METADATA_KEY.component, Reflect);
|
|
110
94
|
if (!metadatas) {
|
|
111
95
|
metadatas = [];
|
|
112
|
-
Reflect.defineMetadata(
|
|
113
|
-
METADATA_KEY.component,
|
|
114
|
-
metadatas,
|
|
115
|
-
Reflect
|
|
116
|
-
);
|
|
96
|
+
Reflect.defineMetadata(METADATA_KEY.component, metadatas, Reflect);
|
|
117
97
|
}
|
|
118
98
|
metadatas.push(metadata);
|
|
119
99
|
return metadata;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { METADATA_KEY } from '../constants';
|
|
2
|
-
import { ComponentId } from '
|
|
2
|
+
import type { ComponentId } from '../container/container';
|
|
3
3
|
|
|
4
4
|
export interface ConstantOption {
|
|
5
5
|
id: ComponentId | ComponentId[];
|
|
@@ -8,13 +8,16 @@ export interface ConstantOption {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const Constant = function (id: ComponentId | ComponentId[], constantValue: any, rebind = false): ClassDecorator {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
11
|
+
return (t: any) => {
|
|
12
|
+
applyConstantDecorator({ id, constantValue, rebind }, t);
|
|
14
13
|
};
|
|
14
|
+
};
|
|
15
15
|
|
|
16
16
|
export function applyConstantDecorator(option: ConstantOption, target: any): void {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
let metadata: ConstantOption[] = Reflect.getMetadata(METADATA_KEY.constantValue, Reflect);
|
|
18
|
+
if (!metadata) {
|
|
19
|
+
metadata = [];
|
|
20
|
+
Reflect.defineMetadata(METADATA_KEY.constantValue, metadata, Reflect);
|
|
21
|
+
}
|
|
22
|
+
metadata.push(option);
|
|
20
23
|
}
|
|
@@ -6,8 +6,8 @@ export const AutowiredProvider = function (idOrOption?: IdOrAutowiredOptionWitho
|
|
|
6
6
|
return (target: any, targetKey: string, index?: number) => {
|
|
7
7
|
const option = parseAutowiredOption(target, targetKey, index, idOrOption);
|
|
8
8
|
option.detached = true;
|
|
9
|
-
applyAutowiredDecorator(option, target, targetKey, index, doInjectForAutowiredProvider,
|
|
9
|
+
applyAutowiredDecorator(option, target, targetKey, index, doInjectForAutowiredProvider, doGetValueForProvider);
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const doGetValueForProvider: DoGetValue = option => ContainerUtil.get(PROVIDER, { tags: { [ID_KEY]: option.id } });
|
|
@@ -6,12 +6,6 @@ export * from './constant';
|
|
|
6
6
|
export * from './named';
|
|
7
7
|
export * from './tagged';
|
|
8
8
|
export * from './post-construct';
|
|
9
|
-
export * from './pre-destroy';
|
|
10
|
-
export * from './target-name';
|
|
11
|
-
export * from './injectable';
|
|
12
|
-
export * from './inject';
|
|
13
9
|
export * from './aspect';
|
|
14
10
|
export * from './service';
|
|
15
|
-
export * from './unmanaged';
|
|
16
|
-
export * from './decorate';
|
|
17
11
|
export * from './autowired-provider';
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { InjectionUtil } from '../container/injection';
|
|
2
|
+
|
|
3
|
+
/** Injects the binding with this name (`@Component({ id, name })`, `whenTargetNamed`). */
|
|
4
|
+
export const Named = (name: string | number | symbol): PropertyDecorator & ParameterDecorator =>
|
|
5
|
+
(target: any, key: string | symbol | undefined, index?: number) => {
|
|
6
|
+
InjectionUtil.point(target, key, index).name = name;
|
|
7
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { InjectionUtil } from '../container/injection';
|
|
2
|
+
|
|
3
|
+
/** The parameter or property gets `undefined` (or `[]` for an array) when nothing is bound. */
|
|
4
|
+
export const Optional = (): PropertyDecorator & ParameterDecorator => (target: any, key: string | symbol | undefined, index?: number) => {
|
|
5
|
+
InjectionUtil.point(target, key, index).optional = true;
|
|
6
|
+
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { InjectionUtil } from '../container/injection';
|
|
2
|
+
|
|
3
|
+
/** Called once the container has injected the properties; one method per class, subclasses inherit it. */
|
|
4
|
+
export const PostConstruct = (): MethodDecorator => (target: any, key: string | symbol) => {
|
|
5
|
+
InjectionUtil.setPostConstruct(target, key);
|
|
6
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { InjectionUtil } from '../container/injection';
|
|
2
|
+
|
|
3
|
+
/** Injects the binding with this tag (`@Component({ id, tag })`, `whenTargetTagged`). */
|
|
4
|
+
export const Tagged = (key: string | number | symbol, value: unknown): PropertyDecorator & ParameterDecorator =>
|
|
5
|
+
(target: any, propertyKey: string | symbol | undefined, index?: number) => {
|
|
6
|
+
const point = InjectionUtil.point(target, propertyKey, index);
|
|
7
|
+
point.tags = { ...point.tags, [key]: value };
|
|
8
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { inject, named, interfaces } from 'inversify';
|
|
2
1
|
import { ConfigUtil } from '../config/config-util';
|
|
3
2
|
import { AnnotationUtil } from '../utils';
|
|
4
3
|
import { ConfigProvider } from '../config/config-protocol';
|
|
4
|
+
import { InjectionUtil } from '../container/injection';
|
|
5
|
+
import type { Binding, ComponentId } from '../container/container';
|
|
5
6
|
|
|
6
7
|
export const VALUE = Symbol('Value');
|
|
7
8
|
|
|
@@ -34,13 +35,14 @@ export function applyValueDecorator(option: ValueOption, target: any, targetKey:
|
|
|
34
35
|
if (index !== undefined) {
|
|
35
36
|
throw new Error(`The ${target.constructor.name} itself is not injected into the container, so the parameter injection of the constructor is not supported.`);
|
|
36
37
|
}
|
|
38
|
+
InjectionUtil.remove(target, targetKey);
|
|
37
39
|
createValueProperty(option, target, targetKey);
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const point = InjectionUtil.point(target, targetKey, index);
|
|
44
|
+
point.id = VALUE;
|
|
45
|
+
point.name = option.el!;
|
|
44
46
|
return option;
|
|
45
47
|
}
|
|
46
48
|
|
|
@@ -54,11 +56,7 @@ export function createValueProperty(option: ValueOption, target: any, property:
|
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const el = namedMetadata!.value.toString();
|
|
61
|
-
const configProvider = ctx.container.get<ConfigProvider>(ConfigProvider);
|
|
62
|
-
return configProvider.get(el);
|
|
63
|
-
});
|
|
59
|
+
/** `@Value('a.b')` is an injection of `VALUE` named `a.b`: the configuration value of that key. */
|
|
60
|
+
export function bindValue(bind: <T>(id: ComponentId<T>) => Binding<T>): void {
|
|
61
|
+
bind(VALUE).toDynamicValue(ctx => ctx.container.get<ConfigProvider>(ConfigProvider).get(String(ctx.target.name)));
|
|
64
62
|
}
|