@tramvai/core 5.10.0 → 5.14.10
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.
|
@@ -2,7 +2,6 @@ import { ACTION_PARAMETERS } from '@tramvai/types-actions-state-context';
|
|
|
2
2
|
import { AbortController } from 'node-abort-controller';
|
|
3
3
|
|
|
4
4
|
function declareAction(action) {
|
|
5
|
-
var _a;
|
|
6
5
|
if (process.env.NODE_ENV !== 'production') {
|
|
7
6
|
if (!action.name) {
|
|
8
7
|
throw new Error('"name" attribute must be provided. Provide name manually or use babel plugin for autogeneration (enable "experiments.enableFillDeclareActionNamePlugin" option in tramvai.json configuration file).');
|
|
@@ -36,7 +35,7 @@ function declareAction(action) {
|
|
|
36
35
|
// @ts-ignore
|
|
37
36
|
[ACTION_PARAMETERS]: {
|
|
38
37
|
...action,
|
|
39
|
-
conditions:
|
|
38
|
+
conditions: action.conditions ?? {},
|
|
40
39
|
},
|
|
41
40
|
});
|
|
42
41
|
}
|
|
@@ -6,7 +6,6 @@ var typesActionsStateContext = require('@tramvai/types-actions-state-context');
|
|
|
6
6
|
var nodeAbortController = require('node-abort-controller');
|
|
7
7
|
|
|
8
8
|
function declareAction(action) {
|
|
9
|
-
var _a;
|
|
10
9
|
if (process.env.NODE_ENV !== 'production') {
|
|
11
10
|
if (!action.name) {
|
|
12
11
|
throw new Error('"name" attribute must be provided. Provide name manually or use babel plugin for autogeneration (enable "experiments.enableFillDeclareActionNamePlugin" option in tramvai.json configuration file).');
|
|
@@ -40,7 +39,7 @@ function declareAction(action) {
|
|
|
40
39
|
// @ts-ignore
|
|
41
40
|
[typesActionsStateContext.ACTION_PARAMETERS]: {
|
|
42
41
|
...action,
|
|
43
|
-
conditions:
|
|
42
|
+
conditions: action.conditions ?? {},
|
|
44
43
|
},
|
|
45
44
|
});
|
|
46
45
|
}
|
package/lib/createApp.es.js
CHANGED
|
@@ -68,22 +68,22 @@ class App {
|
|
|
68
68
|
]);
|
|
69
69
|
}
|
|
70
70
|
const logger = this.di.get({ token: LOGGER_TOKEN, optional: true });
|
|
71
|
-
const log = logger
|
|
71
|
+
const log = logger?.('tramvai-core');
|
|
72
72
|
const commandLineRunner = this.di.get({ token: COMMAND_LINE_RUNNER_TOKEN, optional: true });
|
|
73
73
|
if (!commandLineRunner) {
|
|
74
74
|
throw new Error('`COMMAND_LINE_RUNNER_TOKEN` is not defined, have you added `@tramvai/module-common` to your dependency list?');
|
|
75
75
|
}
|
|
76
|
-
log
|
|
76
|
+
log?.warn({
|
|
77
77
|
event: 'tramvai-app-init',
|
|
78
78
|
message: 'Initializing. Run CommandLineRunner.',
|
|
79
79
|
});
|
|
80
80
|
const di = await commandLineRunner.run(env, type);
|
|
81
|
-
log
|
|
81
|
+
log?.warn({
|
|
82
82
|
event: 'tramvai-app-init',
|
|
83
83
|
message: 'CommandLineRunner executed successfully. Resolving modules.',
|
|
84
84
|
});
|
|
85
85
|
this.resolveModules();
|
|
86
|
-
log
|
|
86
|
+
log?.warn({
|
|
87
87
|
event: 'tramvai-app-init',
|
|
88
88
|
message: 'Modules resolved successfully. Tramvai App initialized',
|
|
89
89
|
});
|
package/lib/createApp.js
CHANGED
|
@@ -72,22 +72,22 @@ class App {
|
|
|
72
72
|
]);
|
|
73
73
|
}
|
|
74
74
|
const logger = this.di.get({ token: tokensCommon.LOGGER_TOKEN, optional: true });
|
|
75
|
-
const log = logger
|
|
75
|
+
const log = logger?.('tramvai-core');
|
|
76
76
|
const commandLineRunner = this.di.get({ token: tokensCore.COMMAND_LINE_RUNNER_TOKEN, optional: true });
|
|
77
77
|
if (!commandLineRunner) {
|
|
78
78
|
throw new Error('`COMMAND_LINE_RUNNER_TOKEN` is not defined, have you added `@tramvai/module-common` to your dependency list?');
|
|
79
79
|
}
|
|
80
|
-
log
|
|
80
|
+
log?.warn({
|
|
81
81
|
event: 'tramvai-app-init',
|
|
82
82
|
message: 'Initializing. Run CommandLineRunner.',
|
|
83
83
|
});
|
|
84
84
|
const di = await commandLineRunner.run(env, type);
|
|
85
|
-
log
|
|
85
|
+
log?.warn({
|
|
86
86
|
event: 'tramvai-app-init',
|
|
87
87
|
message: 'CommandLineRunner executed successfully. Resolving modules.',
|
|
88
88
|
});
|
|
89
89
|
this.resolveModules();
|
|
90
|
-
log
|
|
90
|
+
log?.warn({
|
|
91
91
|
event: 'tramvai-app-init',
|
|
92
92
|
message: 'Modules resolved successfully. Tramvai App initialized',
|
|
93
93
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/core",
|
|
3
|
-
"version": "5.10
|
|
3
|
+
"version": "5.14.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tinkoff/utils": "^2.1.2",
|
|
22
|
-
"@tramvai/tokens-common": "5.10
|
|
23
|
-
"@tramvai/tokens-core": "5.10
|
|
24
|
-
"@tramvai/types-actions-state-context": "5.10
|
|
22
|
+
"@tramvai/tokens-common": "5.14.10",
|
|
23
|
+
"@tramvai/tokens-core": "5.14.10",
|
|
24
|
+
"@tramvai/types-actions-state-context": "5.14.10",
|
|
25
25
|
"@tinkoff/dippy": "0.11.3",
|
|
26
26
|
"node-abort-controller": "^3.0.1",
|
|
27
27
|
"tslib": "^2.4.0"
|