@tramvai/module-common 3.41.1 → 3.41.4
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.
|
@@ -3,18 +3,6 @@ import { COMMAND_LINE_TIMING_INFO_TOKEN } from '@tramvai/tokens-core-private';
|
|
|
3
3
|
import { createChildContainer } from '@tinkoff/dippy';
|
|
4
4
|
import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
|
|
5
5
|
|
|
6
|
-
const resolveDi = (type, status, diContainer, providers) => {
|
|
7
|
-
let di = diContainer;
|
|
8
|
-
if (status === 'customer' && type !== 'client') {
|
|
9
|
-
di = createChildContainer(di);
|
|
10
|
-
}
|
|
11
|
-
if (providers) {
|
|
12
|
-
providers.forEach((item) => {
|
|
13
|
-
return di.register(item);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return di;
|
|
17
|
-
};
|
|
18
6
|
class CommandLineRunner {
|
|
19
7
|
constructor({ lines, rootDi, logger, executionContextManager, executionEndHandlers }) {
|
|
20
8
|
this.executionContextByDi = new WeakMap();
|
|
@@ -26,7 +14,7 @@ class CommandLineRunner {
|
|
|
26
14
|
this.executionEndHandlers = executionEndHandlers;
|
|
27
15
|
}
|
|
28
16
|
run(type, status, providers, customDi, key) {
|
|
29
|
-
const di = customDi !== null && customDi !== void 0 ? customDi : resolveDi(type, status, this.rootDi, providers);
|
|
17
|
+
const di = customDi !== null && customDi !== void 0 ? customDi : this.resolveDi(type, status, this.rootDi, providers);
|
|
30
18
|
const rootExecutionContext = di.get({ token: ROOT_EXECUTION_CONTEXT_TOKEN, optional: true });
|
|
31
19
|
this.log.debug({
|
|
32
20
|
event: 'command-run',
|
|
@@ -66,6 +54,18 @@ class CommandLineRunner {
|
|
|
66
54
|
})
|
|
67
55
|
.then(() => di));
|
|
68
56
|
}
|
|
57
|
+
resolveDi(type, status, rootDi, providers) {
|
|
58
|
+
let di = rootDi;
|
|
59
|
+
if (status === 'customer' && type !== 'client') {
|
|
60
|
+
di = createChildContainer(di);
|
|
61
|
+
}
|
|
62
|
+
if (providers) {
|
|
63
|
+
providers.forEach((item) => {
|
|
64
|
+
return di.register(item);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return di;
|
|
68
|
+
}
|
|
69
69
|
resolveExecutionContextFromDi(di) {
|
|
70
70
|
var _a;
|
|
71
71
|
return (_a = this.executionContextByDi.get(di)) !== null && _a !== void 0 ? _a : null;
|
|
@@ -19,6 +19,7 @@ export declare class CommandLineRunner implements Interface {
|
|
|
19
19
|
private abortControllerByDi;
|
|
20
20
|
constructor({ lines, rootDi, logger, executionContextManager, executionEndHandlers }: Deps);
|
|
21
21
|
run(type: keyof CommandLines, status: keyof CommandLineDescription, providers?: Provider[], customDi?: Container, key?: string | number): Promise<Container>;
|
|
22
|
+
resolveDi(type: keyof CommandLines, status: keyof CommandLineDescription, rootDi: Container, providers?: Provider[]): Container;
|
|
22
23
|
resolveExecutionContextFromDi(di: Container): ExecutionContext | null;
|
|
23
24
|
private createLineChain;
|
|
24
25
|
private instanceExecute;
|
|
@@ -3,18 +3,6 @@ import { COMMAND_LINE_TIMING_INFO_TOKEN } from '@tramvai/tokens-core-private';
|
|
|
3
3
|
import { createChildContainer } from '@tinkoff/dippy';
|
|
4
4
|
import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
|
|
5
5
|
|
|
6
|
-
const resolveDi = (type, status, diContainer, providers) => {
|
|
7
|
-
let di = diContainer;
|
|
8
|
-
if (status === 'customer' && type !== 'client') {
|
|
9
|
-
di = createChildContainer(di);
|
|
10
|
-
}
|
|
11
|
-
if (providers) {
|
|
12
|
-
providers.forEach((item) => {
|
|
13
|
-
return di.register(item);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return di;
|
|
17
|
-
};
|
|
18
6
|
class CommandLineRunner {
|
|
19
7
|
constructor({ lines, rootDi, logger, executionContextManager, executionEndHandlers }) {
|
|
20
8
|
this.executionContextByDi = new WeakMap();
|
|
@@ -26,7 +14,7 @@ class CommandLineRunner {
|
|
|
26
14
|
this.executionEndHandlers = executionEndHandlers;
|
|
27
15
|
}
|
|
28
16
|
run(type, status, providers, customDi, key) {
|
|
29
|
-
const di = customDi !== null && customDi !== void 0 ? customDi : resolveDi(type, status, this.rootDi, providers);
|
|
17
|
+
const di = customDi !== null && customDi !== void 0 ? customDi : this.resolveDi(type, status, this.rootDi, providers);
|
|
30
18
|
const rootExecutionContext = di.get({ token: ROOT_EXECUTION_CONTEXT_TOKEN, optional: true });
|
|
31
19
|
this.log.debug({
|
|
32
20
|
event: 'command-run',
|
|
@@ -66,6 +54,18 @@ class CommandLineRunner {
|
|
|
66
54
|
})
|
|
67
55
|
.then(() => di));
|
|
68
56
|
}
|
|
57
|
+
resolveDi(type, status, rootDi, providers) {
|
|
58
|
+
let di = rootDi;
|
|
59
|
+
if (status === 'customer' && type !== 'client') {
|
|
60
|
+
di = createChildContainer(di);
|
|
61
|
+
}
|
|
62
|
+
if (providers) {
|
|
63
|
+
providers.forEach((item) => {
|
|
64
|
+
return di.register(item);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return di;
|
|
68
|
+
}
|
|
69
69
|
resolveExecutionContextFromDi(di) {
|
|
70
70
|
var _a;
|
|
71
71
|
return (_a = this.executionContextByDi.get(di)) !== null && _a !== void 0 ? _a : null;
|
|
@@ -7,18 +7,6 @@ var tokensCorePrivate = require('@tramvai/tokens-core-private');
|
|
|
7
7
|
var dippy = require('@tinkoff/dippy');
|
|
8
8
|
var tokensCommon = require('@tramvai/tokens-common');
|
|
9
9
|
|
|
10
|
-
const resolveDi = (type, status, diContainer, providers) => {
|
|
11
|
-
let di = diContainer;
|
|
12
|
-
if (status === 'customer' && type !== 'client') {
|
|
13
|
-
di = dippy.createChildContainer(di);
|
|
14
|
-
}
|
|
15
|
-
if (providers) {
|
|
16
|
-
providers.forEach((item) => {
|
|
17
|
-
return di.register(item);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return di;
|
|
21
|
-
};
|
|
22
10
|
class CommandLineRunner {
|
|
23
11
|
constructor({ lines, rootDi, logger, executionContextManager, executionEndHandlers }) {
|
|
24
12
|
this.executionContextByDi = new WeakMap();
|
|
@@ -30,7 +18,7 @@ class CommandLineRunner {
|
|
|
30
18
|
this.executionEndHandlers = executionEndHandlers;
|
|
31
19
|
}
|
|
32
20
|
run(type, status, providers, customDi, key) {
|
|
33
|
-
const di = customDi !== null && customDi !== void 0 ? customDi : resolveDi(type, status, this.rootDi, providers);
|
|
21
|
+
const di = customDi !== null && customDi !== void 0 ? customDi : this.resolveDi(type, status, this.rootDi, providers);
|
|
34
22
|
const rootExecutionContext = di.get({ token: tokensCommon.ROOT_EXECUTION_CONTEXT_TOKEN, optional: true });
|
|
35
23
|
this.log.debug({
|
|
36
24
|
event: 'command-run',
|
|
@@ -70,6 +58,18 @@ class CommandLineRunner {
|
|
|
70
58
|
})
|
|
71
59
|
.then(() => di));
|
|
72
60
|
}
|
|
61
|
+
resolveDi(type, status, rootDi, providers) {
|
|
62
|
+
let di = rootDi;
|
|
63
|
+
if (status === 'customer' && type !== 'client') {
|
|
64
|
+
di = dippy.createChildContainer(di);
|
|
65
|
+
}
|
|
66
|
+
if (providers) {
|
|
67
|
+
providers.forEach((item) => {
|
|
68
|
+
return di.register(item);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return di;
|
|
72
|
+
}
|
|
73
73
|
resolveExecutionContextFromDi(di) {
|
|
74
74
|
var _a;
|
|
75
75
|
return (_a = this.executionContextByDi.get(di)) !== null && _a !== void 0 ? _a : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-common",
|
|
3
|
-
"version": "3.41.
|
|
3
|
+
"version": "3.41.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -37,29 +37,29 @@
|
|
|
37
37
|
"@tinkoff/pubsub": "0.6.1",
|
|
38
38
|
"@tinkoff/url": "0.9.2",
|
|
39
39
|
"@tramvai/safe-strings": "0.6.3",
|
|
40
|
-
"@tramvai/experiments": "3.41.
|
|
41
|
-
"@tramvai/module-cookie": "3.41.
|
|
42
|
-
"@tramvai/module-environment": "3.41.
|
|
43
|
-
"@tramvai/module-log": "3.41.
|
|
44
|
-
"@tramvai/tokens-child-app": "3.41.
|
|
45
|
-
"@tramvai/tokens-core-private": "3.41.
|
|
46
|
-
"@tramvai/tokens-common": "3.41.
|
|
47
|
-
"@tramvai/tokens-render": "3.41.
|
|
48
|
-
"@tramvai/tokens-router": "3.41.
|
|
49
|
-
"@tramvai/tokens-server-private": "3.41.
|
|
50
|
-
"@tramvai/types-actions-state-context": "3.41.
|
|
40
|
+
"@tramvai/experiments": "3.41.4",
|
|
41
|
+
"@tramvai/module-cookie": "3.41.4",
|
|
42
|
+
"@tramvai/module-environment": "3.41.4",
|
|
43
|
+
"@tramvai/module-log": "3.41.4",
|
|
44
|
+
"@tramvai/tokens-child-app": "3.41.4",
|
|
45
|
+
"@tramvai/tokens-core-private": "3.41.4",
|
|
46
|
+
"@tramvai/tokens-common": "3.41.4",
|
|
47
|
+
"@tramvai/tokens-render": "3.41.4",
|
|
48
|
+
"@tramvai/tokens-router": "3.41.4",
|
|
49
|
+
"@tramvai/tokens-server-private": "3.41.4",
|
|
50
|
+
"@tramvai/types-actions-state-context": "3.41.4",
|
|
51
51
|
"hoist-non-react-statics": "^3.3.1",
|
|
52
52
|
"node-abort-controller": "^3.0.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tinkoff/dippy": "0.9.4",
|
|
56
56
|
"@tinkoff/utils": "^2.1.2",
|
|
57
|
-
"@tramvai/cli": "3.41.
|
|
58
|
-
"@tramvai/core": "3.41.
|
|
59
|
-
"@tramvai/papi": "3.41.
|
|
60
|
-
"@tramvai/react": "3.41.
|
|
61
|
-
"@tramvai/state": "3.41.
|
|
62
|
-
"@tramvai/tokens-server": "3.41.
|
|
57
|
+
"@tramvai/cli": "3.41.4",
|
|
58
|
+
"@tramvai/core": "3.41.4",
|
|
59
|
+
"@tramvai/papi": "3.41.4",
|
|
60
|
+
"@tramvai/react": "3.41.4",
|
|
61
|
+
"@tramvai/state": "3.41.4",
|
|
62
|
+
"@tramvai/tokens-server": "3.41.4",
|
|
63
63
|
"react": ">=16.14.0",
|
|
64
64
|
"tslib": "^2.4.0"
|
|
65
65
|
},
|