@softarc/native-federation-orchestrator 4.1.0 → 4.2.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.
- package/README.md +4 -0
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +46 -46
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +3 -3
- package/fesm2022/node.mjs +2973 -0
- package/fesm2022/node.mjs.map +7 -0
- package/node-loader/loader.mjs +92 -0
- package/node-loader/loader.mjs.map +7 -0
- package/package.json +12 -4
- package/quickstart.mjs +10 -10
- package/types/lib/1.domain/remote-entry/manifest.contract.d.ts +1 -1
- package/types/lib/2.app/driver-ports/init/flow.contract.d.ts +2 -2
- package/types/lib/2.app/driver-ports/init/for-getting-remote-entries.port.d.ts +2 -2
- package/types/lib/2.app/driving-ports/for-providing-manifest.port.d.ts +3 -3
- package/types/lib/3.adapters/node/fs-manifest-provider.d.ts +3 -0
- package/types/lib/3.adapters/node/fs-remote-entry-provider.d.ts +3 -0
- package/types/lib/3.adapters/node/loader-url.d.ts +8 -0
- package/types/lib/3.adapters/node/node-loader.client.d.ts +9 -0
- package/types/lib/3.adapters/node/noop-sse.d.ts +3 -0
- package/types/lib/4.config/import-map/use-node.d.ts +6 -0
- package/types/lib/index.d.ts +1 -0
- package/types/lib/init-federation.d.ts +2 -1
- package/types/lib/init-federation.node.d.ts +6 -0
- package/types/lib/node.index.d.ts +5 -0
- package/types/lib/utils/node/read-source.d.ts +1 -0
- package/types/lib/utils/node/to-url.d.ts +3 -0
- package/types/node-loader.d.ts +41 -0
package/types/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { initFederation } from './init-federation';
|
|
2
2
|
export { NFError } from './native-federation.error';
|
|
3
3
|
export { LoadRemoteModule, LoadRemoteModuleOf, NativeFederationResult, } from './init-federation.contract';
|
|
4
|
+
export { FederationManifest } from './1.domain/remote-entry/manifest.contract';
|
|
4
5
|
export { createConfigHandlers } from './5.di/config.factory';
|
|
5
6
|
export { createDriving } from './5.di/driving.factory';
|
|
6
7
|
export { createDynamicInitDrivers, DYNAMIC_INIT_FLOW_FACTORY, createDynamicInitFlow, } from './5.di/flows/dynamic-init.factory';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NativeFederationResult } from './init-federation.contract';
|
|
2
2
|
import type { NFOptions } from './2.app/config/config.contract';
|
|
3
|
-
|
|
3
|
+
import type { FederationManifest } from './1.domain';
|
|
4
|
+
declare const initFederation: (remotesOrManifestUrl: string | FederationManifest, options?: NFOptions) => Promise<NativeFederationResult>;
|
|
4
5
|
export { initFederation };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FederationManifest } from './1.domain';
|
|
2
|
+
import type { NFOptions } from './2.app/config/config.contract';
|
|
3
|
+
import type { NativeFederationResult } from './init-federation.contract';
|
|
4
|
+
export type InitNodeFederationOptions = NFOptions;
|
|
5
|
+
declare const initNodeFederation: (remotesOrManifestUrl: string | FederationManifest, options?: InitNodeFederationOptions) => Promise<NativeFederationResult>;
|
|
6
|
+
export { initNodeFederation };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { initNodeFederation } from './init-federation.node';
|
|
2
|
+
export type { InitNodeFederationOptions } from './init-federation.node';
|
|
3
|
+
export { NFError } from './native-federation.error';
|
|
4
|
+
export type { LoadRemoteModule, LoadRemoteModuleOf, NativeFederationResult, } from './init-federation.contract';
|
|
5
|
+
export type { FederationManifest } from './1.domain/remote-entry/manifest.contract';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readSourceBytes: (input: string) => Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js module customization hooks for native-federation.
|
|
3
|
+
*
|
|
4
|
+
* Registered via `module.register(<this file>, import.meta.url, { data: { port }, transferList: [port] })`
|
|
5
|
+
* from the orchestrator. The main thread posts the resolved import map over the
|
|
6
|
+
* MessagePort whenever it changes; this loader rewrites `import` specifiers
|
|
7
|
+
* accordingly and fetches http(s) modules into the loader as source text.
|
|
8
|
+
*/
|
|
9
|
+
import type { MessagePort } from 'node:worker_threads';
|
|
10
|
+
type Imports = Record<string, string>;
|
|
11
|
+
type Scopes = Record<string, Imports>;
|
|
12
|
+
type ImportMap = {
|
|
13
|
+
imports: Imports;
|
|
14
|
+
scopes?: Scopes;
|
|
15
|
+
};
|
|
16
|
+
type InitData = {
|
|
17
|
+
port?: MessagePort;
|
|
18
|
+
initialImportMap?: ImportMap;
|
|
19
|
+
};
|
|
20
|
+
export declare function initialize(data?: InitData): void;
|
|
21
|
+
type ResolveContext = {
|
|
22
|
+
parentURL?: string;
|
|
23
|
+
};
|
|
24
|
+
type ResolveResult = {
|
|
25
|
+
url: string;
|
|
26
|
+
format?: string | null;
|
|
27
|
+
shortCircuit?: boolean;
|
|
28
|
+
};
|
|
29
|
+
type NextResolve = (specifier: string, context?: ResolveContext) => Promise<ResolveResult>;
|
|
30
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
31
|
+
type LoadContext = {
|
|
32
|
+
format?: string | null;
|
|
33
|
+
};
|
|
34
|
+
type LoadResult = {
|
|
35
|
+
format: string;
|
|
36
|
+
source?: string | ArrayBuffer | Uint8Array;
|
|
37
|
+
shortCircuit?: boolean;
|
|
38
|
+
};
|
|
39
|
+
type NextLoad = (url: string, context?: LoadContext) => Promise<LoadResult>;
|
|
40
|
+
export declare function load(url: string, context: LoadContext, nextLoad: NextLoad): Promise<LoadResult>;
|
|
41
|
+
export {};
|