@adaas/a-concept 0.0.49 → 0.0.50
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/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.d.ts +1 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +25 -6
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +26 -7
- package/examples/simple/components/A.component.ts +5 -2
- package/examples/simple/concept.ts +18 -2
- package/examples/simple/containers/Secondary.container.ts +26 -0
- package/package.json +1 -1
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +36 -12
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +24 -5
|
@@ -30,3 +30,4 @@ export declare function A_Feature_Extend(config: Partial<A_TYPES__A_ExtendDecora
|
|
|
30
30
|
* [!] AND it will be applicable for ANY element where the name is the same as the name of the function
|
|
31
31
|
*/
|
|
32
32
|
export declare function A_Feature_Extend(): any;
|
|
33
|
+
export declare function buildTargetRegexp(param1: any, include: any[], exclude: any[], propertyKey: string): RegExp;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.A_Feature_Extend = A_Feature_Extend;
|
|
4
|
+
exports.buildTargetRegexp = buildTargetRegexp;
|
|
4
5
|
const A_Component_types_1 = require("../../global/A-Component/A-Component.types");
|
|
5
6
|
const A_Context_class_1 = require("../../global/A-Context/A-Context.class");
|
|
6
7
|
const A_Meta_class_1 = require("../../global/A-Meta/A-Meta.class");
|
|
@@ -10,16 +11,22 @@ function A_Feature_Extend(param1) {
|
|
|
10
11
|
let behavior = 'sync';
|
|
11
12
|
let before = [];
|
|
12
13
|
let after = [];
|
|
14
|
+
let include = [];
|
|
15
|
+
let exclude = [];
|
|
13
16
|
// Check if the config is a RegExp
|
|
14
17
|
if (param1 instanceof RegExp) {
|
|
15
18
|
targetRegexp = param1;
|
|
16
19
|
}
|
|
17
|
-
else if (!!param1) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
else if (!!param1 && typeof param1 === 'object') {
|
|
21
|
+
if (Array.isArray(param1.scope))
|
|
22
|
+
include = param1.scope;
|
|
23
|
+
else if (!!param1.scope && typeof param1.scope === 'object') {
|
|
24
|
+
if (Array.isArray(param1.scope.include))
|
|
25
|
+
include = param1.scope.include;
|
|
26
|
+
if (Array.isArray(param1.scope.exclude))
|
|
27
|
+
exclude = param1.scope.exclude;
|
|
28
|
+
}
|
|
29
|
+
targetRegexp = buildTargetRegexp(param1, include, exclude, propertyKey);
|
|
23
30
|
behavior = param1.behavior || behavior;
|
|
24
31
|
before = param1.before || before;
|
|
25
32
|
after = param1.after || after;
|
|
@@ -59,4 +66,16 @@ function A_Feature_Extend(param1) {
|
|
|
59
66
|
.set(A_Component_types_1.A_TYPES__ComponentMetaKey.EXTENSIONS, existedMeta);
|
|
60
67
|
};
|
|
61
68
|
}
|
|
69
|
+
function buildTargetRegexp(param1, include, exclude, propertyKey) {
|
|
70
|
+
const includePart = include.length
|
|
71
|
+
? `(${include.map(el => el.name).join('|')})`
|
|
72
|
+
: `.*`;
|
|
73
|
+
const excludePart = exclude.length
|
|
74
|
+
? `(?!${exclude.map(el => el.name).join('|')})`
|
|
75
|
+
: ``;
|
|
76
|
+
const pattern = param1.scope
|
|
77
|
+
? `^${excludePart}${includePart}\\.${param1.name || propertyKey}$`
|
|
78
|
+
: `.*\\.${param1.name || propertyKey}$`;
|
|
79
|
+
return new RegExp(pattern);
|
|
80
|
+
}
|
|
62
81
|
//# sourceMappingURL=A-Feature-Extend.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature-Extend.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Extend.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"A-Feature-Extend.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Extend.decorator.ts"],"names":[],"mappings":"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"}
|
|
@@ -38,15 +38,34 @@ export type A_TYPES__A_ExtendDecoratorConfig = {
|
|
|
38
38
|
*
|
|
39
39
|
* [!] If not provided will be applied to all containers with the same name.
|
|
40
40
|
* [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
|
|
41
|
+
*
|
|
42
|
+
* [!!!] In case if you need to exclude some containers, entities or components, please use "exclude" property
|
|
43
|
+
*
|
|
44
|
+
* Example:
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* @A_Feature.Extend({
|
|
48
|
+
* name: 'load',
|
|
49
|
+
* scope: {
|
|
50
|
+
* include: [A_Container1, A_Entity1],
|
|
51
|
+
* exclude: [A_Component1]
|
|
52
|
+
* }
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
41
55
|
*/
|
|
42
|
-
scope: Array<
|
|
43
|
-
new (...args: any[]): A_Container;
|
|
44
|
-
} | {
|
|
45
|
-
new (...args: any[]): A_Entity;
|
|
46
|
-
} | {
|
|
47
|
-
new (...args: any[]): A_Component;
|
|
48
|
-
}>;
|
|
56
|
+
scope: Array<A_TYPES__A_ExtendDecorator_ScopeItem> | Partial<A_TYPES__A_ExtendDecorator_ScopeConfig>;
|
|
49
57
|
} & A_TYPES__A_ExtendDecorator_BehaviorConfig;
|
|
58
|
+
export type A_TYPES__A_ExtendDecorator_ScopeItem = {
|
|
59
|
+
new (...args: any[]): A_Container;
|
|
60
|
+
} | {
|
|
61
|
+
new (...args: any[]): A_Entity;
|
|
62
|
+
} | {
|
|
63
|
+
new (...args: any[]): A_Component;
|
|
64
|
+
};
|
|
65
|
+
export type A_TYPES__A_ExtendDecorator_ScopeConfig = {
|
|
66
|
+
include?: Array<A_TYPES__A_ExtendDecorator_ScopeItem>;
|
|
67
|
+
exclude?: Array<A_TYPES__A_ExtendDecorator_ScopeItem>;
|
|
68
|
+
};
|
|
50
69
|
export type A_TYPES__A_ExtendDecorator_BehaviorConfig = {
|
|
51
70
|
/**
|
|
52
71
|
* The behavior of the method.
|
|
@@ -4,6 +4,7 @@ import { ContextFragmentB } from "../context/Fragment_B.context";
|
|
|
4
4
|
import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
|
|
5
5
|
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
6
6
|
import { A_Logger } from "@adaas/a-concept/base/A-Logger/A-Logger.component";
|
|
7
|
+
import { SecondaryContainer } from "../containers/Secondary.container";
|
|
7
8
|
|
|
8
9
|
export class ComponentA extends A_Component {
|
|
9
10
|
|
|
@@ -13,7 +14,7 @@ export class ComponentA extends A_Component {
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
@A_Feature.Define()
|
|
17
|
+
@A_Feature.Define()
|
|
17
18
|
async method_A(
|
|
18
19
|
@A_Inject(ContextFragmentA) fragmentA: ContextFragmentA,
|
|
19
20
|
@A_Inject(A_Logger) logger: A_Logger,
|
|
@@ -45,7 +46,9 @@ export class ComponentA extends A_Component {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
@A_Feature.Extend(
|
|
49
|
+
@A_Feature.Extend({
|
|
50
|
+
scope: [SecondaryContainer]
|
|
51
|
+
})
|
|
49
52
|
async method_C(
|
|
50
53
|
@A_Inject(A_Logger) logger: A_Logger
|
|
51
54
|
) {
|
|
@@ -10,6 +10,7 @@ import { ENVConfigReader } from "@adaas/a-concept/base/A-Config/components/ENVCo
|
|
|
10
10
|
import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
|
|
11
11
|
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
|
|
12
12
|
import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
|
|
13
|
+
import { SecondaryContainer } from "./containers/Secondary.container";
|
|
13
14
|
|
|
14
15
|
console.log('Simple concept loaded', A_Concept);
|
|
15
16
|
|
|
@@ -28,6 +29,19 @@ console.log('Simple concept loaded', A_Concept);
|
|
|
28
29
|
]
|
|
29
30
|
})
|
|
30
31
|
|
|
32
|
+
const second = new SecondaryContainer({
|
|
33
|
+
name: 'SecondaryContainer',
|
|
34
|
+
components: [
|
|
35
|
+
A_Logger,
|
|
36
|
+
ComponentA,
|
|
37
|
+
ComponentB
|
|
38
|
+
],
|
|
39
|
+
fragments: [
|
|
40
|
+
new ContextFragmentA(),
|
|
41
|
+
new ContextFragmentB()
|
|
42
|
+
]
|
|
43
|
+
})
|
|
44
|
+
|
|
31
45
|
const concept = new A_Concept({
|
|
32
46
|
name: 'test-simple',
|
|
33
47
|
fragments: [
|
|
@@ -44,7 +58,8 @@ console.log('Simple concept loaded', A_Concept);
|
|
|
44
58
|
ENVConfigReader
|
|
45
59
|
]
|
|
46
60
|
}),
|
|
47
|
-
main
|
|
61
|
+
main,
|
|
62
|
+
second
|
|
48
63
|
]
|
|
49
64
|
});
|
|
50
65
|
|
|
@@ -58,7 +73,8 @@ console.log('Simple concept loaded', A_Concept);
|
|
|
58
73
|
// await main.method_C();
|
|
59
74
|
|
|
60
75
|
try {
|
|
61
|
-
await main.call('
|
|
76
|
+
await main.call('method_C')
|
|
77
|
+
await second.call('method_C')
|
|
62
78
|
|
|
63
79
|
} catch (error) {
|
|
64
80
|
console.error('Error occurred:', error);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { A_Logger } from "@adaas/a-concept/base/A-Logger/A-Logger.component";
|
|
2
|
+
import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
|
|
3
|
+
import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
|
|
4
|
+
import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
|
|
5
|
+
import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export class SecondaryContainer extends A_Container {
|
|
10
|
+
|
|
11
|
+
@A_Concept.Load()
|
|
12
|
+
async load(
|
|
13
|
+
@A_Inject(A_Logger) logger: A_Logger
|
|
14
|
+
|
|
15
|
+
) {
|
|
16
|
+
logger.log('Secondary container loaded');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@A_Concept.Start()
|
|
20
|
+
async start(
|
|
21
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
22
|
+
@A_Inject(A_Logger) logger: A_Logger
|
|
23
|
+
) {
|
|
24
|
+
await this.call('method_C');
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-concept",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.50",
|
|
4
4
|
"description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
2
2
|
import {
|
|
3
|
+
A_TYPES__A_ExtendDecorator_ScopeItem,
|
|
3
4
|
A_TYPES__A_ExtendDecoratorConfig,
|
|
4
5
|
A_TYPES__A_ExtendDecoratorDescriptor,
|
|
5
6
|
} from "./A-Feature.decorator.types";
|
|
@@ -58,25 +59,31 @@ export function A_Feature_Extend(
|
|
|
58
59
|
let behavior: 'sync' | 'async' = 'sync';
|
|
59
60
|
let before: string[] = [];
|
|
60
61
|
let after: string[] = [];
|
|
61
|
-
|
|
62
|
+
let include: Array<A_TYPES__A_ExtendDecorator_ScopeItem> = [];
|
|
63
|
+
let exclude: Array<A_TYPES__A_ExtendDecorator_ScopeItem> = [];
|
|
62
64
|
|
|
63
65
|
// Check if the config is a RegExp
|
|
64
66
|
if (param1 instanceof RegExp) {
|
|
65
67
|
targetRegexp = param1;
|
|
66
68
|
}
|
|
67
|
-
else if (!!param1) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
else if (!!param1 && typeof param1 === 'object') {
|
|
70
|
+
|
|
71
|
+
if (Array.isArray(param1.scope))
|
|
72
|
+
include = param1.scope;
|
|
73
|
+
else if (!!param1.scope && typeof param1.scope === 'object') {
|
|
74
|
+
if (Array.isArray(param1.scope.include))
|
|
75
|
+
include = param1.scope.include;
|
|
76
|
+
if (Array.isArray(param1.scope.exclude))
|
|
77
|
+
exclude = param1.scope.exclude;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
targetRegexp = buildTargetRegexp(param1, include, exclude, propertyKey);
|
|
74
82
|
|
|
75
83
|
behavior = param1.behavior || behavior;
|
|
76
84
|
before = param1.before || before;
|
|
77
85
|
after = param1.after || after;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
86
|
+
} else {
|
|
80
87
|
targetRegexp = new RegExp(`^.*\\.${propertyKey}$`);
|
|
81
88
|
}
|
|
82
89
|
|
|
@@ -93,8 +100,8 @@ export function A_Feature_Extend(
|
|
|
93
100
|
|| new A_Meta();
|
|
94
101
|
|
|
95
102
|
|
|
96
|
-
if (existedDefinitions
|
|
97
|
-
&& existedDefinitions.size()
|
|
103
|
+
if (existedDefinitions
|
|
104
|
+
&& existedDefinitions.size()
|
|
98
105
|
&& existedDefinitions.has(propertyKey)
|
|
99
106
|
&& existedDefinitions.get(propertyKey)!.invoke
|
|
100
107
|
) {
|
|
@@ -125,3 +132,20 @@ export function A_Feature_Extend(
|
|
|
125
132
|
};
|
|
126
133
|
}
|
|
127
134
|
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export function buildTargetRegexp(param1: any, include: any[], exclude: any[], propertyKey: string) {
|
|
138
|
+
const includePart = include.length
|
|
139
|
+
? `(${include.map(el => el.name).join('|')})`
|
|
140
|
+
: `.*`;
|
|
141
|
+
|
|
142
|
+
const excludePart = exclude.length
|
|
143
|
+
? `(?!${exclude.map(el => el.name).join('|')})`
|
|
144
|
+
: ``;
|
|
145
|
+
|
|
146
|
+
const pattern = param1.scope
|
|
147
|
+
? `^${excludePart}${includePart}\\.${param1.name || propertyKey}$`
|
|
148
|
+
: `.*\\.${param1.name || propertyKey}$`;
|
|
149
|
+
|
|
150
|
+
return new RegExp(pattern);
|
|
151
|
+
}
|
|
@@ -73,14 +73,33 @@ export type A_TYPES__A_ExtendDecoratorConfig = {
|
|
|
73
73
|
*
|
|
74
74
|
* [!] If not provided will be applied to all containers with the same name.
|
|
75
75
|
* [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
|
|
76
|
+
*
|
|
77
|
+
* [!!!] In case if you need to exclude some containers, entities or components, please use "exclude" property
|
|
78
|
+
*
|
|
79
|
+
* Example:
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* @A_Feature.Extend({
|
|
83
|
+
* name: 'load',
|
|
84
|
+
* scope: {
|
|
85
|
+
* include: [A_Container1, A_Entity1],
|
|
86
|
+
* exclude: [A_Component1]
|
|
87
|
+
* }
|
|
88
|
+
* })
|
|
89
|
+
* ```
|
|
76
90
|
*/
|
|
77
|
-
scope: Array<
|
|
78
|
-
{ new(...args: any[]): A_Container }
|
|
79
|
-
| { new(...args: any[]): A_Entity }
|
|
80
|
-
| { new(...args: any[]): A_Component }
|
|
81
|
-
>
|
|
91
|
+
scope: Array<A_TYPES__A_ExtendDecorator_ScopeItem> | Partial<A_TYPES__A_ExtendDecorator_ScopeConfig>,
|
|
82
92
|
} & A_TYPES__A_ExtendDecorator_BehaviorConfig
|
|
83
93
|
|
|
94
|
+
export type A_TYPES__A_ExtendDecorator_ScopeItem = { new(...args: any[]): A_Container }
|
|
95
|
+
| { new(...args: any[]): A_Entity }
|
|
96
|
+
| { new(...args: any[]): A_Component }
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
export type A_TYPES__A_ExtendDecorator_ScopeConfig = {
|
|
100
|
+
include?: Array<A_TYPES__A_ExtendDecorator_ScopeItem>,
|
|
101
|
+
exclude?: Array<A_TYPES__A_ExtendDecorator_ScopeItem>
|
|
102
|
+
}
|
|
84
103
|
|
|
85
104
|
export type A_TYPES__A_ExtendDecorator_BehaviorConfig = {
|
|
86
105
|
/**
|