@tramvai/module-child-app 1.46.5
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/README.md +256 -0
- package/lib/browser/child/providers.d.ts +3 -0
- package/lib/browser/loader.d.ts +16 -0
- package/lib/browser/preload.d.ts +23 -0
- package/lib/browser/providers.d.ts +7 -0
- package/lib/browser/render.d.ts +20 -0
- package/lib/browser.d.ts +3 -0
- package/lib/export.d.ts +2 -0
- package/lib/server/child/providers.d.ts +3 -0
- package/lib/server/loader.d.ts +16 -0
- package/lib/server/preload.d.ts +25 -0
- package/lib/server/providers.d.ts +2 -0
- package/lib/server/render-slots.d.ts +8 -0
- package/lib/server/render.d.ts +24 -0
- package/lib/server/stateManager.d.ts +13 -0
- package/lib/server.browser.js +793 -0
- package/lib/server.d.ts +3 -0
- package/lib/server.es.js +920 -0
- package/lib/server.js +935 -0
- package/lib/shared/child/providers.d.ts +3 -0
- package/lib/shared/child/stubs.d.ts +4 -0
- package/lib/shared/command.d.ts +15 -0
- package/lib/shared/di.d.ts +17 -0
- package/lib/shared/loader.d.ts +9 -0
- package/lib/shared/providers.d.ts +2 -0
- package/lib/shared/react/component.d.ts +2 -0
- package/lib/shared/react/render-context.d.ts +2 -0
- package/lib/shared/render.d.ts +5 -0
- package/lib/shared/singletonDi.d.ts +17 -0
- package/lib/shared/store.d.ts +5 -0
- package/lib/shared/types/module.d.ts +4 -0
- package/lib/shared/webpack/moduleFederation.d.ts +15 -0
- package/package.json +52 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandLineDescription, CommandLines } from '@tramvai/core';
|
|
2
|
+
import { COMMAND_LINE_RUNNER_TOKEN } from '@tramvai/core';
|
|
3
|
+
import type { ChildAppCommandLineRunner, ChildAppDiManager, ChildAppFinalConfig } from '@tramvai/tokens-child-app';
|
|
4
|
+
import type { LOGGER_TOKEN } from '@tramvai/tokens-common';
|
|
5
|
+
export declare class CommandLineRunner implements ChildAppCommandLineRunner {
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly rootCommandLineRunner;
|
|
8
|
+
private readonly diManager;
|
|
9
|
+
constructor({ logger, rootCommandLineRunner, diManager, }: {
|
|
10
|
+
logger: typeof LOGGER_TOKEN;
|
|
11
|
+
rootCommandLineRunner: typeof COMMAND_LINE_RUNNER_TOKEN;
|
|
12
|
+
diManager: ChildAppDiManager;
|
|
13
|
+
});
|
|
14
|
+
run(type: keyof CommandLines, status: keyof CommandLineDescription, config: ChildAppFinalConfig): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Container } from '@tinkoff/dippy';
|
|
2
|
+
import { ChildContainer } from '@tinkoff/dippy';
|
|
3
|
+
import type { ChildAppDiManager, ChildAppLoader, ChildAppFinalConfig } from '@tramvai/tokens-child-app';
|
|
4
|
+
export declare class DiManager implements ChildAppDiManager {
|
|
5
|
+
private appDi;
|
|
6
|
+
private loader;
|
|
7
|
+
private singletonDiManager;
|
|
8
|
+
private cache;
|
|
9
|
+
constructor({ appDi, loader, singletonDiManager, }: {
|
|
10
|
+
appDi: Container;
|
|
11
|
+
loader: ChildAppLoader;
|
|
12
|
+
singletonDiManager: ChildAppDiManager;
|
|
13
|
+
});
|
|
14
|
+
getChildDi(config: ChildAppFinalConfig): Container | ChildContainer;
|
|
15
|
+
forEachChildDi(cb: (di: Container) => void): void;
|
|
16
|
+
private resolveDi;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChildApp } from '@tramvai/child-app-core';
|
|
2
|
+
import type { ChildAppFinalConfig, ChildAppLoader } from '@tramvai/tokens-child-app';
|
|
3
|
+
import type { ChildAppModuleWrapper } from './types/module';
|
|
4
|
+
export declare abstract class Loader implements ChildAppLoader {
|
|
5
|
+
abstract get(config: ChildAppFinalConfig): ChildApp | void;
|
|
6
|
+
abstract load(config: ChildAppFinalConfig): Promise<ChildApp | void>;
|
|
7
|
+
abstract init(config: ChildAppFinalConfig): Promise<void>;
|
|
8
|
+
protected resolve(entry: ChildAppModuleWrapper): ChildApp;
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ChildAppReactConfig } from '@tramvai/tokens-child-app';
|
|
2
|
+
export declare const ChildApp: ({ name, version, tag, props }: ChildAppReactConfig) => import("react").ReactElement<import("@tramvai/tokens-child-app").WrapperProps<any>, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EXTEND_RENDER } from '@tramvai/tokens-render';
|
|
2
|
+
import type { ChildAppRenderManager } from '@tramvai/tokens-child-app';
|
|
3
|
+
export declare const extendRender: ({ renderManager, }: {
|
|
4
|
+
renderManager: ChildAppRenderManager;
|
|
5
|
+
}) => typeof EXTEND_RENDER[number];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Container } from '@tinkoff/dippy';
|
|
2
|
+
import type { ChildAppDiManager, ChildAppFinalConfig, ChildAppLoader } from '@tramvai/tokens-child-app';
|
|
3
|
+
import type { LOGGER_TOKEN } from '@tramvai/tokens-common';
|
|
4
|
+
export declare class SingletonDiManager implements ChildAppDiManager {
|
|
5
|
+
private readonly log;
|
|
6
|
+
private appDi;
|
|
7
|
+
private loader;
|
|
8
|
+
private cache;
|
|
9
|
+
constructor({ logger, appDi, loader, }: {
|
|
10
|
+
logger: typeof LOGGER_TOKEN;
|
|
11
|
+
appDi: Container;
|
|
12
|
+
loader: ChildAppLoader;
|
|
13
|
+
});
|
|
14
|
+
getChildDi(config: ChildAppFinalConfig): Container;
|
|
15
|
+
forEachChildDi(cb: (di: Container) => void): void;
|
|
16
|
+
private resolveDi;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChildAppRequestConfig } from '@tramvai/tokens-child-app';
|
|
2
|
+
export declare const setPreloaded: import("@tramvai/types-actions-state-context").EventCreator1<ChildAppRequestConfig[], ChildAppRequestConfig[]>;
|
|
3
|
+
export declare const ChildAppStore: import("@tramvai/state").Reducer<{
|
|
4
|
+
preloaded: ChildAppRequestConfig[];
|
|
5
|
+
}, "child-app">;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __webpack_init_sharing__: (name: string) => Promise<void>;
|
|
3
|
+
var __webpack_share_scopes__: ModuleFederationSharedScope;
|
|
4
|
+
}
|
|
5
|
+
interface ModuleFederationSharedScope {
|
|
6
|
+
default: Record<string, any>;
|
|
7
|
+
[index: string]: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface ModuleFederationContainer {
|
|
10
|
+
init(scope: ModuleFederationSharedScope[string]): Promise<void>;
|
|
11
|
+
get<T = unknown>(name: string): Promise<T>;
|
|
12
|
+
}
|
|
13
|
+
export declare const initModuleFederation: (container?: ModuleFederationContainer, scope?: string) => Promise<void>;
|
|
14
|
+
export declare const getModuleFederation: (container: ModuleFederationContainer, name?: string) => Promise<unknown>;
|
|
15
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tramvai/module-child-app",
|
|
3
|
+
"version": "1.46.5",
|
|
4
|
+
"description": "Module for child apps",
|
|
5
|
+
"browser": {
|
|
6
|
+
"./lib/server.js": "./lib/browser.js",
|
|
7
|
+
"./lib/server/child/providers.js": "./lib/browser/child/providers.js",
|
|
8
|
+
"./lib/server.es.js": "./lib/server.browser.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "lib/server.js",
|
|
11
|
+
"typings": "lib/server.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git@github.com:TinkoffCreditSystems/tramvai.git"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tramvai-build --for-publish",
|
|
23
|
+
"watch": "tsc -w",
|
|
24
|
+
"build-for-publish": "true"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@tinkoff/env-validators": "0.0.2",
|
|
31
|
+
"@tinkoff/module-loader-client": "0.3.25",
|
|
32
|
+
"@tinkoff/module-loader-server": "0.4.40",
|
|
33
|
+
"@tramvai/child-app-core": "1.46.5",
|
|
34
|
+
"@tramvai/safe-strings": "0.4.3",
|
|
35
|
+
"@tramvai/tokens-child-app": "1.46.5"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@tinkoff/dippy": "0.7.36",
|
|
40
|
+
"@tinkoff/utils": "^2.1.2",
|
|
41
|
+
"@tramvai/core": "1.46.5",
|
|
42
|
+
"@tramvai/state": "1.46.5",
|
|
43
|
+
"@tramvai/react": "1.46.5",
|
|
44
|
+
"@tramvai/tokens-common": "1.46.5",
|
|
45
|
+
"@tramvai/tokens-render": "1.46.5",
|
|
46
|
+
"react": ">=16.8.0",
|
|
47
|
+
"react-dom": ">=16.8.0",
|
|
48
|
+
"object-assign": "^4.1.1",
|
|
49
|
+
"tslib": "^2.0.3"
|
|
50
|
+
},
|
|
51
|
+
"module": "lib/server.es.js"
|
|
52
|
+
}
|