@tramvai/core 5.16.0 → 5.17.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ACTION_PARAMETERS } from '@tramvai/types-actions-state-context';
|
|
2
|
-
import { AbortController } from 'node-abort-controller';
|
|
3
2
|
|
|
4
3
|
function declareAction(action) {
|
|
5
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -30,6 +29,7 @@ function declareAction(action) {
|
|
|
30
29
|
// { ...action, tramvaiActionVersion: 2 }
|
|
31
30
|
return Object.assign(fn, {
|
|
32
31
|
...action,
|
|
32
|
+
name: action.name,
|
|
33
33
|
tramvaiActionVersion: 2,
|
|
34
34
|
// fallback to support compatibility with createAction
|
|
35
35
|
// @ts-ignore
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var typesActionsStateContext = require('@tramvai/types-actions-state-context');
|
|
6
|
-
var nodeAbortController = require('node-abort-controller');
|
|
7
6
|
|
|
8
7
|
function declareAction(action) {
|
|
9
8
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -13,7 +12,7 @@ function declareAction(action) {
|
|
|
13
12
|
}
|
|
14
13
|
// fallback to support compatibility with createAction
|
|
15
14
|
const fn = (context, payload, deps) => {
|
|
16
|
-
const abortController = new
|
|
15
|
+
const abortController = new AbortController();
|
|
17
16
|
return action.fn.apply({
|
|
18
17
|
executeAction: context.executeAction,
|
|
19
18
|
dispatch: context.dispatch,
|
|
@@ -34,6 +33,7 @@ function declareAction(action) {
|
|
|
34
33
|
// { ...action, tramvaiActionVersion: 2 }
|
|
35
34
|
return Object.assign(fn, {
|
|
36
35
|
...action,
|
|
36
|
+
name: action.name,
|
|
37
37
|
tramvaiActionVersion: 2,
|
|
38
38
|
// fallback to support compatibility with createAction
|
|
39
39
|
// @ts-ignore
|
package/lib/createApp.es.js
CHANGED
|
@@ -71,7 +71,18 @@ class App {
|
|
|
71
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
|
+
const error = new Error('`COMMAND_LINE_RUNNER_TOKEN` is not defined, have you added `@tramvai/module-common` to your dependency list?');
|
|
75
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
76
|
+
try {
|
|
77
|
+
this.di.get(COMMAND_LINE_RUNNER_TOKEN);
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
if (e?.message) {
|
|
81
|
+
error.message += `\n\nProvider resolve error:\n${e.message}`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
75
86
|
}
|
|
76
87
|
log?.warn({
|
|
77
88
|
event: 'tramvai-app-init',
|
package/lib/createApp.js
CHANGED
|
@@ -75,7 +75,18 @@ class App {
|
|
|
75
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
|
+
const error = new Error('`COMMAND_LINE_RUNNER_TOKEN` is not defined, have you added `@tramvai/module-common` to your dependency list?');
|
|
79
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
80
|
+
try {
|
|
81
|
+
this.di.get(tokensCore.COMMAND_LINE_RUNNER_TOKEN);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
if (e?.message) {
|
|
85
|
+
error.message += `\n\nProvider resolve error:\n${e.message}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
79
90
|
}
|
|
80
91
|
log?.warn({
|
|
81
92
|
event: 'tramvai-app-init',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -19,11 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tinkoff/utils": "^2.1.2",
|
|
22
|
-
"@tramvai/tokens-common": "5.
|
|
23
|
-
"@tramvai/tokens-core": "5.
|
|
24
|
-
"@tramvai/types-actions-state-context": "5.
|
|
22
|
+
"@tramvai/tokens-common": "5.17.0",
|
|
23
|
+
"@tramvai/tokens-core": "5.17.0",
|
|
24
|
+
"@tramvai/types-actions-state-context": "5.17.0",
|
|
25
25
|
"@tinkoff/dippy": "0.11.3",
|
|
26
|
-
"node-abort-controller": "^3.0.1",
|
|
27
26
|
"tslib": "^2.4.0"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|