@softarc/native-federation-orchestrator 4.3.1 → 4.4.1
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 +3 -2
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +20 -10
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +3 -3
- package/fesm2022/module-federation.mjs +56 -0
- package/fesm2022/module-federation.mjs.map +7 -0
- package/fesm2022/node.mjs +19 -9
- package/fesm2022/node.mjs.map +3 -3
- package/package.json +5 -1
- package/quickstart.mjs +11 -11
- package/types/lib/core/2.app/config/mode.contract.d.ts +1 -0
- package/types/lib/core/2.app/driver-ports/init/for-committing-changes.port.d.ts +5 -1
- package/types/lib/module-federation/get-shared.d.ts +7 -0
- package/types/lib/module-federation/share-infos.contract.d.ts +45 -0
- package/types/lib/module-federation.index.d.ts +2 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The object shapes webpack Module Federation expects for its `shared` config
|
|
3
|
+
* (the input to `init({ shared })` / `createInstance({ shared })`).
|
|
4
|
+
*
|
|
5
|
+
* The type names mirror Module Federation's own (`ShareInfos`, `Shared`,
|
|
6
|
+
* `SharedConfig`), so what `getShared()` returns lines up with the types a
|
|
7
|
+
* consumer already sees on the MF side.
|
|
8
|
+
*/
|
|
9
|
+
/** The per-package config flags — MF's `SharedConfig`. */
|
|
10
|
+
export type SharedConfig = {
|
|
11
|
+
singleton?: boolean;
|
|
12
|
+
requiredVersion: string;
|
|
13
|
+
strictVersion?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** A single shared descriptor — MF's `Shared`. */
|
|
16
|
+
export type Shared = {
|
|
17
|
+
version: string;
|
|
18
|
+
/**
|
|
19
|
+
* The Module Federation share scope. Omitted for native federation's global
|
|
20
|
+
* scope (MF then uses its `'default'` scope); set to the share-scope name for
|
|
21
|
+
* externals native federation grouped under a custom `shareScope` (or
|
|
22
|
+
* `'strict'`).
|
|
23
|
+
*/
|
|
24
|
+
scope?: string;
|
|
25
|
+
get: () => Promise<() => unknown>;
|
|
26
|
+
shareConfig?: SharedConfig;
|
|
27
|
+
};
|
|
28
|
+
/** The whole `shared` map (package name → descriptors) — MF's `ShareInfos`. */
|
|
29
|
+
export type ShareInfos = {
|
|
30
|
+
[packageName: string]: Array<Shared>;
|
|
31
|
+
};
|
|
32
|
+
export type GetSharedOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* Marks the emitted externals as Module Federation singletons. When omitted,
|
|
35
|
+
* externals in the global and custom share scopes are singletons; the `strict`
|
|
36
|
+
* scope's versions are not (it shares several exact versions side by side).
|
|
37
|
+
*/
|
|
38
|
+
singleton?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When set, the `requiredVersion` is built as `prefix + version` (the v3
|
|
41
|
+
* behaviour). When omitted, the bridge uses the `requiredVersion` negotiated
|
|
42
|
+
* by native federation, falling back to a caret range.
|
|
43
|
+
*/
|
|
44
|
+
requiredVersionPrefix?: '^' | '~' | '>' | '>=' | '';
|
|
45
|
+
};
|