@tramvai/module-common 2.70.1 → 2.72.3

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.
Files changed (123) hide show
  1. package/lib/CommonModule.browser.js +100 -0
  2. package/lib/CommonModule.es.js +100 -0
  3. package/lib/CommonModule.js +106 -0
  4. package/lib/actions/ActionModule.browser.js +79 -0
  5. package/lib/actions/ActionModule.es.js +79 -0
  6. package/lib/actions/ActionModule.js +82 -0
  7. package/lib/actions/actionChecker.browser.js +52 -0
  8. package/lib/actions/actionChecker.es.js +52 -0
  9. package/lib/actions/actionChecker.js +56 -0
  10. package/lib/actions/actionExecution.browser.js +107 -0
  11. package/lib/actions/actionExecution.es.js +107 -0
  12. package/lib/actions/actionExecution.js +118 -0
  13. package/lib/actions/actionPageRunner.browser.browser.js +33 -0
  14. package/lib/actions/actionPageRunner.es.js +61 -0
  15. package/lib/actions/actionPageRunner.js +65 -0
  16. package/lib/actions/actionRegistry.browser.js +33 -0
  17. package/lib/actions/actionRegistry.es.js +33 -0
  18. package/lib/actions/actionRegistry.js +45 -0
  19. package/lib/actions/actionTramvaiReducer.browser.js +10 -0
  20. package/lib/actions/actionTramvaiReducer.es.js +10 -0
  21. package/lib/actions/actionTramvaiReducer.js +15 -0
  22. package/lib/actions/conditions/always.browser.js +10 -0
  23. package/lib/actions/conditions/always.es.js +10 -0
  24. package/lib/actions/conditions/always.js +14 -0
  25. package/lib/actions/conditions/helpers.browser.js +4 -0
  26. package/lib/actions/conditions/helpers.es.js +4 -0
  27. package/lib/actions/conditions/helpers.js +9 -0
  28. package/lib/actions/conditions/onlyBrowser.browser.js +12 -0
  29. package/lib/actions/conditions/onlyBrowser.es.js +12 -0
  30. package/lib/actions/conditions/onlyBrowser.js +16 -0
  31. package/lib/actions/conditions/onlyServer.browser.js +12 -0
  32. package/lib/actions/conditions/onlyServer.es.js +12 -0
  33. package/lib/actions/conditions/onlyServer.js +16 -0
  34. package/lib/actions/conditions/pageBrowser.browser.js +13 -0
  35. package/lib/actions/conditions/pageBrowser.es.js +13 -0
  36. package/lib/actions/conditions/pageBrowser.js +17 -0
  37. package/lib/actions/conditions/pageServer.browser.js +13 -0
  38. package/lib/actions/conditions/pageServer.es.js +13 -0
  39. package/lib/actions/conditions/pageServer.js +17 -0
  40. package/lib/actions/constants.browser.js +9 -0
  41. package/lib/actions/constants.es.js +9 -0
  42. package/lib/actions/constants.js +13 -0
  43. package/lib/bundleManager/bundleManager.browser.js +105 -0
  44. package/lib/bundleManager/bundleManager.es.js +105 -0
  45. package/lib/bundleManager/bundleManager.js +115 -0
  46. package/lib/cache/CacheModule.browser.js +58 -0
  47. package/lib/cache/CacheModule.es.js +58 -0
  48. package/lib/cache/CacheModule.js +62 -0
  49. package/lib/cache/cacheFactory.browser.js +7 -0
  50. package/lib/cache/cacheFactory.es.js +7 -0
  51. package/lib/cache/cacheFactory.js +15 -0
  52. package/lib/cache/clientProviders.browser.js +3 -0
  53. package/lib/cache/papi.es.js +18 -0
  54. package/lib/cache/papi.js +22 -0
  55. package/lib/cache/serverProviders.es.js +18 -0
  56. package/lib/cache/serverProviders.js +22 -0
  57. package/lib/child-app/ChildAppModule.browser.js +38 -0
  58. package/lib/child-app/ChildAppModule.es.js +38 -0
  59. package/lib/child-app/ChildAppModule.js +40 -0
  60. package/lib/child-app/actions.browser.js +19 -0
  61. package/lib/child-app/actions.es.js +19 -0
  62. package/lib/child-app/actions.js +23 -0
  63. package/lib/child-app/clientProviders.browser.js +18 -0
  64. package/lib/child-app/command.browser.js +35 -0
  65. package/lib/child-app/command.es.js +35 -0
  66. package/lib/child-app/command.js +40 -0
  67. package/lib/child-app/serverProviders.es.js +3 -0
  68. package/lib/child-app/serverProviders.js +7 -0
  69. package/lib/child-app/state.browser.js +13 -0
  70. package/lib/child-app/state.es.js +13 -0
  71. package/lib/child-app/state.js +17 -0
  72. package/lib/command/CommandModule.browser.js +52 -0
  73. package/lib/command/CommandModule.es.js +52 -0
  74. package/lib/command/CommandModule.js +54 -0
  75. package/lib/command/commandLineRunner.browser.js +147 -0
  76. package/lib/command/commandLineRunner.es.js +147 -0
  77. package/lib/command/commandLineRunner.js +151 -0
  78. package/lib/command/defaultLines.browser.js +25 -0
  79. package/lib/command/defaultLines.es.js +25 -0
  80. package/lib/command/defaultLines.js +29 -0
  81. package/lib/componentRegistry/componentRegistry.browser.js +25 -0
  82. package/lib/componentRegistry/componentRegistry.es.js +25 -0
  83. package/lib/componentRegistry/componentRegistry.js +34 -0
  84. package/lib/createConsumerContext/createConsumerContext.browser.js +62 -0
  85. package/lib/createConsumerContext/createConsumerContext.es.js +62 -0
  86. package/lib/createConsumerContext/createConsumerContext.js +67 -0
  87. package/lib/executionContext/executionContextManager.browser.js +57 -0
  88. package/lib/executionContext/executionContextManager.es.js +57 -0
  89. package/lib/executionContext/executionContextManager.js +61 -0
  90. package/lib/index.browser.js +13 -1300
  91. package/lib/index.es.js +13 -1318
  92. package/lib/index.js +38 -1341
  93. package/lib/providers/clientProviders.browser.js +22 -0
  94. package/lib/providers/serverProviders.es.js +3 -0
  95. package/lib/providers/serverProviders.js +7 -0
  96. package/lib/pubsub/PubSubModule.browser.js +44 -0
  97. package/lib/pubsub/PubSubModule.es.js +44 -0
  98. package/lib/pubsub/PubSubModule.js +46 -0
  99. package/lib/requestManager/RequestManagerModule.browser.browser.js +38 -0
  100. package/lib/requestManager/RequestManagerModule.es.js +35 -0
  101. package/lib/requestManager/RequestManagerModule.js +37 -0
  102. package/lib/requestManager/RequestManagerStore.browser.js +8 -0
  103. package/lib/requestManager/RequestManagerStore.es.js +8 -0
  104. package/lib/requestManager/RequestManagerStore.js +13 -0
  105. package/lib/requestManager/requestManager.browser.js +57 -0
  106. package/lib/requestManager/requestManager.es.js +57 -0
  107. package/lib/requestManager/requestManager.js +61 -0
  108. package/lib/requestManager/sharedProviders.browser.js +23 -0
  109. package/lib/requestManager/sharedProviders.es.js +23 -0
  110. package/lib/requestManager/sharedProviders.js +27 -0
  111. package/lib/responseManager/ResponseManagerModule.browser.browser.js +21 -0
  112. package/lib/responseManager/ResponseManagerModule.es.js +13 -0
  113. package/lib/responseManager/ResponseManagerModule.js +15 -0
  114. package/lib/responseManager/responseManager.browser.js +52 -0
  115. package/lib/responseManager/responseManager.es.js +52 -0
  116. package/lib/responseManager/responseManager.js +61 -0
  117. package/lib/responseManager/sharedProviders.browser.js +13 -0
  118. package/lib/responseManager/sharedProviders.es.js +13 -0
  119. package/lib/responseManager/sharedProviders.js +17 -0
  120. package/lib/state/StateModule.browser.js +54 -0
  121. package/lib/state/StateModule.es.js +54 -0
  122. package/lib/state/StateModule.js +60 -0
  123. package/package.json +24 -25
@@ -0,0 +1,58 @@
1
+ import { __decorate } from 'tslib';
2
+ import { createToken } from '@tinkoff/dippy';
3
+ import { Module, Scope, IS_DI_CHILD_CONTAINER_TOKEN } from '@tramvai/core';
4
+ import { CREATE_CACHE_TOKEN, CLEAR_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN } from '@tramvai/tokens-common';
5
+ import { cacheFactory } from './cacheFactory.browser.js';
6
+ import { providers } from './clientProviders.browser.js';
7
+
8
+ const cachesToken = createToken('_cachesList');
9
+ let CacheModule = class CacheModule {
10
+ };
11
+ CacheModule = __decorate([
12
+ Module({
13
+ providers: [
14
+ ...providers,
15
+ {
16
+ provide: cachesToken,
17
+ scope: Scope.SINGLETON,
18
+ useValue: [],
19
+ },
20
+ {
21
+ provide: CREATE_CACHE_TOKEN,
22
+ useFactory: ({ caches, isChildDi }) => {
23
+ if (isChildDi) {
24
+ return cacheFactory;
25
+ }
26
+ return (type, ...args) => {
27
+ const cache = cacheFactory(type, ...args);
28
+ caches.push(cache);
29
+ return cache;
30
+ };
31
+ },
32
+ deps: {
33
+ caches: cachesToken,
34
+ isChildDi: { token: IS_DI_CHILD_CONTAINER_TOKEN, optional: true },
35
+ },
36
+ },
37
+ {
38
+ provide: CLEAR_CACHE_TOKEN,
39
+ scope: Scope.SINGLETON,
40
+ useFactory: ({ caches, cachesClear }) => {
41
+ return (type) => {
42
+ caches.forEach((cache) => cache.clear());
43
+ if (cachesClear) {
44
+ return Promise.all(cachesClear.map((clear) => clear(type)));
45
+ }
46
+ return Promise.resolve();
47
+ };
48
+ },
49
+ deps: {
50
+ caches: cachesToken,
51
+ cachesClear: { token: REGISTER_CLEAR_CACHE_TOKEN, optional: true },
52
+ },
53
+ },
54
+ ],
55
+ })
56
+ ], CacheModule);
57
+
58
+ export { CacheModule, cachesToken };
@@ -0,0 +1,58 @@
1
+ import { __decorate } from 'tslib';
2
+ import { createToken } from '@tinkoff/dippy';
3
+ import { Module, Scope, IS_DI_CHILD_CONTAINER_TOKEN } from '@tramvai/core';
4
+ import { CREATE_CACHE_TOKEN, CLEAR_CACHE_TOKEN, REGISTER_CLEAR_CACHE_TOKEN } from '@tramvai/tokens-common';
5
+ import { cacheFactory } from './cacheFactory.es.js';
6
+ import { providers } from './serverProviders.es.js';
7
+
8
+ const cachesToken = createToken('_cachesList');
9
+ let CacheModule = class CacheModule {
10
+ };
11
+ CacheModule = __decorate([
12
+ Module({
13
+ providers: [
14
+ ...providers,
15
+ {
16
+ provide: cachesToken,
17
+ scope: Scope.SINGLETON,
18
+ useValue: [],
19
+ },
20
+ {
21
+ provide: CREATE_CACHE_TOKEN,
22
+ useFactory: ({ caches, isChildDi }) => {
23
+ if (isChildDi) {
24
+ return cacheFactory;
25
+ }
26
+ return (type, ...args) => {
27
+ const cache = cacheFactory(type, ...args);
28
+ caches.push(cache);
29
+ return cache;
30
+ };
31
+ },
32
+ deps: {
33
+ caches: cachesToken,
34
+ isChildDi: { token: IS_DI_CHILD_CONTAINER_TOKEN, optional: true },
35
+ },
36
+ },
37
+ {
38
+ provide: CLEAR_CACHE_TOKEN,
39
+ scope: Scope.SINGLETON,
40
+ useFactory: ({ caches, cachesClear }) => {
41
+ return (type) => {
42
+ caches.forEach((cache) => cache.clear());
43
+ if (cachesClear) {
44
+ return Promise.all(cachesClear.map((clear) => clear(type)));
45
+ }
46
+ return Promise.resolve();
47
+ };
48
+ },
49
+ deps: {
50
+ caches: cachesToken,
51
+ cachesClear: { token: REGISTER_CLEAR_CACHE_TOKEN, optional: true },
52
+ },
53
+ },
54
+ ],
55
+ })
56
+ ], CacheModule);
57
+
58
+ export { CacheModule, cachesToken };
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+ var dippy = require('@tinkoff/dippy');
7
+ var core = require('@tramvai/core');
8
+ var tokensCommon = require('@tramvai/tokens-common');
9
+ var cacheFactory = require('./cacheFactory.js');
10
+ var serverProviders = require('./serverProviders.js');
11
+
12
+ const cachesToken = dippy.createToken('_cachesList');
13
+ exports.CacheModule = class CacheModule {
14
+ };
15
+ exports.CacheModule = tslib.__decorate([
16
+ core.Module({
17
+ providers: [
18
+ ...serverProviders.providers,
19
+ {
20
+ provide: cachesToken,
21
+ scope: core.Scope.SINGLETON,
22
+ useValue: [],
23
+ },
24
+ {
25
+ provide: tokensCommon.CREATE_CACHE_TOKEN,
26
+ useFactory: ({ caches, isChildDi }) => {
27
+ if (isChildDi) {
28
+ return cacheFactory.cacheFactory;
29
+ }
30
+ return (type, ...args) => {
31
+ const cache = cacheFactory.cacheFactory(type, ...args);
32
+ caches.push(cache);
33
+ return cache;
34
+ };
35
+ },
36
+ deps: {
37
+ caches: cachesToken,
38
+ isChildDi: { token: core.IS_DI_CHILD_CONTAINER_TOKEN, optional: true },
39
+ },
40
+ },
41
+ {
42
+ provide: tokensCommon.CLEAR_CACHE_TOKEN,
43
+ scope: core.Scope.SINGLETON,
44
+ useFactory: ({ caches, cachesClear }) => {
45
+ return (type) => {
46
+ caches.forEach((cache) => cache.clear());
47
+ if (cachesClear) {
48
+ return Promise.all(cachesClear.map((clear) => clear(type)));
49
+ }
50
+ return Promise.resolve();
51
+ };
52
+ },
53
+ deps: {
54
+ caches: cachesToken,
55
+ cachesClear: { token: tokensCommon.REGISTER_CLEAR_CACHE_TOKEN, optional: true },
56
+ },
57
+ },
58
+ ],
59
+ })
60
+ ], exports.CacheModule);
61
+
62
+ exports.cachesToken = cachesToken;
@@ -0,0 +1,7 @@
1
+ import LRU from '@tinkoff/lru-cache-nano';
2
+
3
+ const cacheFactory = (type, options = { max: 100 }) => {
4
+ return new LRU(options);
5
+ };
6
+
7
+ export { cacheFactory };
@@ -0,0 +1,7 @@
1
+ import LRU from '@tinkoff/lru-cache-nano';
2
+
3
+ const cacheFactory = (type, options = { max: 100 }) => {
4
+ return new LRU(options);
5
+ };
6
+
7
+ export { cacheFactory };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var LRU = require('@tinkoff/lru-cache-nano');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var LRU__default = /*#__PURE__*/_interopDefaultLegacy(LRU);
10
+
11
+ const cacheFactory = (type, options = { max: 100 }) => {
12
+ return new LRU__default["default"](options);
13
+ };
14
+
15
+ exports.cacheFactory = cacheFactory;
@@ -0,0 +1,3 @@
1
+ const providers = [];
2
+
3
+ export { providers };
@@ -0,0 +1,18 @@
1
+ import { createPapiMethod } from '@tramvai/papi';
2
+
3
+ const papiClearCache = ({ clearCache, logger, }) => {
4
+ const log = logger('cache:papi-clear-cache');
5
+ return createPapiMethod({
6
+ method: 'post',
7
+ path: '/clear-cache',
8
+ async handler({ responseManager }) {
9
+ await clearCache();
10
+ // DEVOPS-1661
11
+ responseManager.setStatus(404);
12
+ responseManager.setHeader('X-Status', 'done');
13
+ log.info('SERVER:CLEAR:CACHE:INTERNAL');
14
+ },
15
+ });
16
+ };
17
+
18
+ export { papiClearCache };
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var papi = require('@tramvai/papi');
6
+
7
+ const papiClearCache = ({ clearCache, logger, }) => {
8
+ const log = logger('cache:papi-clear-cache');
9
+ return papi.createPapiMethod({
10
+ method: 'post',
11
+ path: '/clear-cache',
12
+ async handler({ responseManager }) {
13
+ await clearCache();
14
+ // DEVOPS-1661
15
+ responseManager.setStatus(404);
16
+ responseManager.setHeader('X-Status', 'done');
17
+ log.info('SERVER:CLEAR:CACHE:INTERNAL');
18
+ },
19
+ });
20
+ };
21
+
22
+ exports.papiClearCache = papiClearCache;
@@ -0,0 +1,18 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { SERVER_MODULE_PAPI_PRIVATE_ROUTE } from '@tramvai/tokens-server';
3
+ import { CLEAR_CACHE_TOKEN, LOGGER_TOKEN } from '@tramvai/tokens-common';
4
+ import { papiClearCache } from './papi.es.js';
5
+
6
+ const providers = [
7
+ provide({
8
+ provide: SERVER_MODULE_PAPI_PRIVATE_ROUTE,
9
+ multi: true,
10
+ useFactory: papiClearCache,
11
+ deps: {
12
+ clearCache: CLEAR_CACHE_TOKEN,
13
+ logger: LOGGER_TOKEN,
14
+ },
15
+ }),
16
+ ];
17
+
18
+ export { providers };
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@tramvai/core');
6
+ var tokensServer = require('@tramvai/tokens-server');
7
+ var tokensCommon = require('@tramvai/tokens-common');
8
+ var papi = require('./papi.js');
9
+
10
+ const providers = [
11
+ core.provide({
12
+ provide: tokensServer.SERVER_MODULE_PAPI_PRIVATE_ROUTE,
13
+ multi: true,
14
+ useFactory: papi.papiClearCache,
15
+ deps: {
16
+ clearCache: tokensCommon.CLEAR_CACHE_TOKEN,
17
+ logger: tokensCommon.LOGGER_TOKEN,
18
+ },
19
+ }),
20
+ ];
21
+
22
+ exports.providers = providers;
@@ -0,0 +1,38 @@
1
+ import { __decorate } from 'tslib';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Module, provide } from '@tramvai/core';
4
+ import { Provider } from '@tramvai/state';
5
+ import { CONTEXT_TOKEN } from '@tramvai/tokens-common';
6
+ import { EXTEND_RENDER } from '@tramvai/tokens-render';
7
+ import { providers } from './clientProviders.browser.js';
8
+ import { stateProviders } from './state.browser.js';
9
+ import { commandProviders } from './command.browser.js';
10
+ import { actionsProviders } from './actions.browser.js';
11
+
12
+ let CommonChildAppModule = class CommonChildAppModule {
13
+ };
14
+ CommonChildAppModule = __decorate([
15
+ Module({
16
+ providers: [
17
+ ...providers,
18
+ ...stateProviders,
19
+ ...commandProviders,
20
+ ...actionsProviders,
21
+ provide({
22
+ provide: EXTEND_RENDER,
23
+ multi: true,
24
+ useFactory: ({ context }) => {
25
+ const serverState = typeof window !== 'undefined' ? context.getState() : undefined;
26
+ return (render) => {
27
+ return (jsx(Provider, { context: context, serverState: serverState, children: render }));
28
+ };
29
+ },
30
+ deps: {
31
+ context: CONTEXT_TOKEN,
32
+ },
33
+ }),
34
+ ],
35
+ })
36
+ ], CommonChildAppModule);
37
+
38
+ export { CommonChildAppModule };
@@ -0,0 +1,38 @@
1
+ import { __decorate } from 'tslib';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Module, provide } from '@tramvai/core';
4
+ import { Provider } from '@tramvai/state';
5
+ import { CONTEXT_TOKEN } from '@tramvai/tokens-common';
6
+ import { EXTEND_RENDER } from '@tramvai/tokens-render';
7
+ import { providers } from './serverProviders.es.js';
8
+ import { stateProviders } from './state.es.js';
9
+ import { commandProviders } from './command.es.js';
10
+ import { actionsProviders } from './actions.es.js';
11
+
12
+ let CommonChildAppModule = class CommonChildAppModule {
13
+ };
14
+ CommonChildAppModule = __decorate([
15
+ Module({
16
+ providers: [
17
+ ...providers,
18
+ ...stateProviders,
19
+ ...commandProviders,
20
+ ...actionsProviders,
21
+ provide({
22
+ provide: EXTEND_RENDER,
23
+ multi: true,
24
+ useFactory: ({ context }) => {
25
+ const serverState = typeof window !== 'undefined' ? context.getState() : undefined;
26
+ return (render) => {
27
+ return (jsx(Provider, { context: context, serverState: serverState, children: render }));
28
+ };
29
+ },
30
+ deps: {
31
+ context: CONTEXT_TOKEN,
32
+ },
33
+ }),
34
+ ],
35
+ })
36
+ ], CommonChildAppModule);
37
+
38
+ export { CommonChildAppModule };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var core = require('@tramvai/core');
8
+ var state$1 = require('@tramvai/state');
9
+ var tokensCommon = require('@tramvai/tokens-common');
10
+ var tokensRender = require('@tramvai/tokens-render');
11
+ var serverProviders = require('./serverProviders.js');
12
+ var state = require('./state.js');
13
+ var command = require('./command.js');
14
+ var actions = require('./actions.js');
15
+
16
+ exports.CommonChildAppModule = class CommonChildAppModule {
17
+ };
18
+ exports.CommonChildAppModule = tslib.__decorate([
19
+ core.Module({
20
+ providers: [
21
+ ...serverProviders.providers,
22
+ ...state.stateProviders,
23
+ ...command.commandProviders,
24
+ ...actions.actionsProviders,
25
+ core.provide({
26
+ provide: tokensRender.EXTEND_RENDER,
27
+ multi: true,
28
+ useFactory: ({ context }) => {
29
+ const serverState = typeof window !== 'undefined' ? context.getState() : undefined;
30
+ return (render) => {
31
+ return (jsxRuntime.jsx(state$1.Provider, { context: context, serverState: serverState, children: render }));
32
+ };
33
+ },
34
+ deps: {
35
+ context: tokensCommon.CONTEXT_TOKEN,
36
+ },
37
+ }),
38
+ ],
39
+ })
40
+ ], exports.CommonChildAppModule);
@@ -0,0 +1,19 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+ import { ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, COMBINE_REDUCERS } from '@tramvai/tokens-common';
4
+ import { actionTramvaiReducer } from '../actions/actionTramvaiReducer.browser.js';
5
+
6
+ const actionsProviders = [
7
+ provide({
8
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
9
+ multi: true,
10
+ useValue: [ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN],
11
+ }),
12
+ provide({
13
+ provide: COMBINE_REDUCERS,
14
+ multi: true,
15
+ useValue: actionTramvaiReducer,
16
+ }),
17
+ ];
18
+
19
+ export { actionsProviders };
@@ -0,0 +1,19 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+ import { ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN, COMBINE_REDUCERS } from '@tramvai/tokens-common';
4
+ import { actionTramvaiReducer } from '../actions/actionTramvaiReducer.es.js';
5
+
6
+ const actionsProviders = [
7
+ provide({
8
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
9
+ multi: true,
10
+ useValue: [ACTION_EXECUTION_TOKEN, ACTION_PAGE_RUNNER_TOKEN],
11
+ }),
12
+ provide({
13
+ provide: COMBINE_REDUCERS,
14
+ multi: true,
15
+ useValue: actionTramvaiReducer,
16
+ }),
17
+ ];
18
+
19
+ export { actionsProviders };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@tramvai/core');
6
+ var tokensChildApp = require('@tramvai/tokens-child-app');
7
+ var tokensCommon = require('@tramvai/tokens-common');
8
+ var actionTramvaiReducer = require('../actions/actionTramvaiReducer.js');
9
+
10
+ const actionsProviders = [
11
+ core.provide({
12
+ provide: tokensChildApp.CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
13
+ multi: true,
14
+ useValue: [tokensCommon.ACTION_EXECUTION_TOKEN, tokensCommon.ACTION_PAGE_RUNNER_TOKEN],
15
+ }),
16
+ core.provide({
17
+ provide: tokensCommon.COMBINE_REDUCERS,
18
+ multi: true,
19
+ useValue: actionTramvaiReducer.actionTramvaiReducer,
20
+ }),
21
+ ];
22
+
23
+ exports.actionsProviders = actionsProviders;
@@ -0,0 +1,18 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { INITIAL_APP_STATE_TOKEN } from '@tramvai/tokens-common';
3
+ import { CHILD_APP_COMMON_INITIAL_STATE_TOKEN, CHILD_APP_INTERNAL_CONFIG_TOKEN } from '@tramvai/tokens-child-app';
4
+
5
+ const providers = [
6
+ provide({
7
+ provide: INITIAL_APP_STATE_TOKEN,
8
+ useFactory: ({ commonState, config }) => {
9
+ return commonState[`${config.key}`];
10
+ },
11
+ deps: {
12
+ commonState: CHILD_APP_COMMON_INITIAL_STATE_TOKEN,
13
+ config: CHILD_APP_INTERNAL_CONFIG_TOKEN,
14
+ },
15
+ }),
16
+ ];
17
+
18
+ export { providers };
@@ -0,0 +1,35 @@
1
+ import { provide, COMMAND_LINE_RUNNER_TOKEN, COMMAND_LINES_TOKEN, Scope } from '@tramvai/core';
2
+ import { commandLineListTokens, CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+
4
+ const command = {
5
+ customer: [
6
+ commandLineListTokens.customerStart,
7
+ commandLineListTokens.resolveUserDeps,
8
+ commandLineListTokens.resolvePageDeps,
9
+ ],
10
+ clear: [commandLineListTokens.clear],
11
+ spa: [
12
+ commandLineListTokens.resolveUserDeps,
13
+ commandLineListTokens.resolvePageDeps,
14
+ commandLineListTokens.spaTransition,
15
+ ],
16
+ afterSpa: [commandLineListTokens.afterSpaTransition],
17
+ };
18
+ const lines = {
19
+ server: command,
20
+ client: command,
21
+ };
22
+ const commandProviders = [
23
+ provide({
24
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
25
+ multi: true,
26
+ useValue: COMMAND_LINE_RUNNER_TOKEN,
27
+ }),
28
+ provide({
29
+ provide: COMMAND_LINES_TOKEN,
30
+ scope: Scope.SINGLETON,
31
+ useValue: lines,
32
+ }),
33
+ ];
34
+
35
+ export { commandProviders, lines };
@@ -0,0 +1,35 @@
1
+ import { provide, COMMAND_LINE_RUNNER_TOKEN, COMMAND_LINES_TOKEN, Scope } from '@tramvai/core';
2
+ import { commandLineListTokens, CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+
4
+ const command = {
5
+ customer: [
6
+ commandLineListTokens.customerStart,
7
+ commandLineListTokens.resolveUserDeps,
8
+ commandLineListTokens.resolvePageDeps,
9
+ ],
10
+ clear: [commandLineListTokens.clear],
11
+ spa: [
12
+ commandLineListTokens.resolveUserDeps,
13
+ commandLineListTokens.resolvePageDeps,
14
+ commandLineListTokens.spaTransition,
15
+ ],
16
+ afterSpa: [commandLineListTokens.afterSpaTransition],
17
+ };
18
+ const lines = {
19
+ server: command,
20
+ client: command,
21
+ };
22
+ const commandProviders = [
23
+ provide({
24
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
25
+ multi: true,
26
+ useValue: COMMAND_LINE_RUNNER_TOKEN,
27
+ }),
28
+ provide({
29
+ provide: COMMAND_LINES_TOKEN,
30
+ scope: Scope.SINGLETON,
31
+ useValue: lines,
32
+ }),
33
+ ];
34
+
35
+ export { commandProviders, lines };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@tramvai/core');
6
+ var tokensChildApp = require('@tramvai/tokens-child-app');
7
+
8
+ const command = {
9
+ customer: [
10
+ tokensChildApp.commandLineListTokens.customerStart,
11
+ tokensChildApp.commandLineListTokens.resolveUserDeps,
12
+ tokensChildApp.commandLineListTokens.resolvePageDeps,
13
+ ],
14
+ clear: [tokensChildApp.commandLineListTokens.clear],
15
+ spa: [
16
+ tokensChildApp.commandLineListTokens.resolveUserDeps,
17
+ tokensChildApp.commandLineListTokens.resolvePageDeps,
18
+ tokensChildApp.commandLineListTokens.spaTransition,
19
+ ],
20
+ afterSpa: [tokensChildApp.commandLineListTokens.afterSpaTransition],
21
+ };
22
+ const lines = {
23
+ server: command,
24
+ client: command,
25
+ };
26
+ const commandProviders = [
27
+ core.provide({
28
+ provide: tokensChildApp.CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
29
+ multi: true,
30
+ useValue: core.COMMAND_LINE_RUNNER_TOKEN,
31
+ }),
32
+ core.provide({
33
+ provide: core.COMMAND_LINES_TOKEN,
34
+ scope: core.Scope.SINGLETON,
35
+ useValue: lines,
36
+ }),
37
+ ];
38
+
39
+ exports.commandProviders = commandProviders;
40
+ exports.lines = lines;
@@ -0,0 +1,3 @@
1
+ const providers = [];
2
+
3
+ export { providers };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const providers = [];
6
+
7
+ exports.providers = providers;
@@ -0,0 +1,13 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+ import { DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
+
5
+ const stateProviders = [
6
+ provide({
7
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
8
+ multi: true,
9
+ useValue: [DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN],
10
+ }),
11
+ ];
12
+
13
+ export { stateProviders };
@@ -0,0 +1,13 @@
1
+ import { provide } from '@tramvai/core';
2
+ import { CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN } from '@tramvai/tokens-child-app';
3
+ import { DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
+
5
+ const stateProviders = [
6
+ provide({
7
+ provide: CHILD_APP_INTERNAL_ROOT_DI_BORROW_TOKEN,
8
+ multi: true,
9
+ useValue: [DISPATCHER_TOKEN, STORE_TOKEN, CONTEXT_TOKEN],
10
+ }),
11
+ ];
12
+
13
+ export { stateProviders };