@softarc/native-federation-orchestrator 4.5.1 → 4.5.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.
- package/README.md +2 -2
- package/fesm2022/@softarc/native-federation-orchestrator.mjs +405 -159
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +4 -4
- package/fesm2022/module-federation.mjs +25 -20
- package/fesm2022/module-federation.mjs.map +2 -2
- package/fesm2022/node.mjs +401 -156
- package/fesm2022/node.mjs.map +3 -3
- package/fesm2022/options.mjs +5 -10
- package/fesm2022/options.mjs.map +2 -2
- package/package.json +2 -2
- package/quickstart.mjs +15 -13
- package/types/lib/core/1.domain/externals/basis.d.ts +7 -0
- package/types/lib/core/1.domain/remote-entry/remote-entry.contract.d.ts +1 -0
- package/types/lib/core/2.app/config/mode.contract.d.ts +2 -0
- package/types/lib/core/2.app/driving-ports/for-shared-externals-storage.port.d.ts +1 -1
- package/types/lib/core/2.app/steps/pooling/pool.types.d.ts +1 -20
- package/types/lib/core/2.app/steps/pooling/pool.util.d.ts +1 -2
- package/types/lib/core/2.app/steps/store-remote-entry.d.ts +15 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SharedVersion, SharedVersionMeta } from './version.contract';
|
|
2
|
+
export declare function isBetterBasis(candidate: SharedVersionMeta, basis: SharedVersionMeta): boolean;
|
|
3
|
+
export declare function addRemoteToVersion(version: SharedVersion, remote: SharedVersionMeta, isHost?: boolean): void;
|
|
4
|
+
export declare function versionDemands(version: SharedVersion): SharedVersionMeta[];
|
|
5
|
+
export declare function findVersionForTag(versions: SharedVersion[], tag: string): SharedVersion | undefined;
|
|
6
|
+
export declare function uncoveredEntrypoints(remote: SharedVersionMeta, basis: Record<string, string>): string[];
|
|
7
|
+
export declare function countUncoveredEntrypoints(remote: SharedVersionMeta, basis: Record<string, string>): number;
|
|
@@ -11,5 +11,6 @@ type RemoteEntry = Omit<FederationInfo, 'shared'> & {
|
|
|
11
11
|
type SharedInfoActions = Record<string, {
|
|
12
12
|
action: SharedVersionAction;
|
|
13
13
|
override?: Record<string, string>;
|
|
14
|
+
covered?: string[];
|
|
14
15
|
}>;
|
|
15
16
|
export { RawRemoteEntry, RemoteEntry, FederationInfo, ExposesInfo, SharedInfo, DenseSharedInfo, SharedInfoActions, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type ModeProfileConfig = {
|
|
2
2
|
latestSharedExternal: boolean;
|
|
3
3
|
skipInvalidExternalVersions: boolean;
|
|
4
|
+
scopeUncoveredEntrypoints: boolean;
|
|
4
5
|
overrideCachedRemotes: 'always' | 'never' | 'init-only';
|
|
5
6
|
overrideCachedRemotesIfURLMatches: boolean;
|
|
6
7
|
cacheTag?: string;
|
|
@@ -15,6 +16,7 @@ export type ModeStrictnessConfig = {
|
|
|
15
16
|
strictExternalSameVersionCompatibility: boolean;
|
|
16
17
|
strictExternalVersion: boolean;
|
|
17
18
|
strictImportMap: boolean;
|
|
19
|
+
strictEntryPointCoverage: boolean;
|
|
18
20
|
};
|
|
19
21
|
export type ModeConfig = {
|
|
20
22
|
strict: ModeStrictnessConfig;
|
|
@@ -7,7 +7,7 @@ export type ForSharedExternalsStorage = {
|
|
|
7
7
|
includeGlobal: boolean;
|
|
8
8
|
}) => string[];
|
|
9
9
|
scopeType: (shareScope?: string) => 'global' | 'strict' | 'shareScope';
|
|
10
|
-
removeFromAllScopes: (
|
|
10
|
+
removeFromAllScopes: (remoteNames: ReadonlySet<RemoteName>) => void;
|
|
11
11
|
addOrUpdate: (name: string, external: SharedExternal, shareScope?: string) => ForSharedExternalsStorage;
|
|
12
12
|
markPoolTagPresent: () => void;
|
|
13
13
|
hasPoolTag: () => boolean;
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import type { ExternalName,
|
|
1
|
+
import type { ExternalName, SharedExternal } from '../../../1.domain';
|
|
2
2
|
export type PoolName = string;
|
|
3
3
|
export type PoolMember = {
|
|
4
4
|
name: ExternalName;
|
|
5
5
|
external: SharedExternal;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* The remote chosen to serve a whole pool, plus the version tag it provides for each member.
|
|
9
|
-
* The anchor may be partial: members absent from `tagPerMember` are orphans (no coherent shared
|
|
10
|
-
* build exists) and resolve scoped-only.
|
|
11
|
-
*/
|
|
12
|
-
export type PoolAnchor = {
|
|
13
|
-
anchorRemote: RemoteName;
|
|
14
|
-
tagPerMember: Partial<Record<ExternalName, VersionName>>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* How a remote is placed relative to the anchor, decided once for the whole pool:
|
|
18
|
-
* - `follow` — every member it uses is compatible with the anchor tag;
|
|
19
|
-
* - `scope-incompat` — strict-incompatible on ≥1 member; the whole family scopes with no dedup
|
|
20
|
-
* (deduping would inject a foreign build via a shared intermediary).
|
|
21
|
-
* Dominates `scope-coverage`;
|
|
22
|
-
* - `scope-coverage` — compatible where the anchor covers, but uses ≥1 member it does not provide;
|
|
23
|
-
* scoped for coverage, may still dedup same-version members.
|
|
24
|
-
*/
|
|
25
|
-
export type RemoteClassification = 'follow' | 'scope-incompat' | 'scope-coverage';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RemoteName
|
|
1
|
+
import type { RemoteName } from '../../../1.domain';
|
|
2
2
|
import type { PoolMember } from './pool.types';
|
|
3
|
-
export declare function versionForRemote(member: PoolMember, remote: RemoteName): SharedVersion | undefined;
|
|
4
3
|
export declare function remotesInPool(members: PoolMember[]): RemoteName[];
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { type RemoteEntry, type SharedExternal, type DenseSharedInfo, type SharedVersion, type SharedVersionMeta } from '../../1.domain';
|
|
1
|
+
import { type RemoteEntry, type RemoteName, type SharedExternal, type DenseSharedInfo, type SharedVersion, type SharedVersionMeta } from '../../1.domain';
|
|
2
2
|
import type { DrivingContract } from '../driving-ports/driving.contract';
|
|
3
3
|
import type { LoggingConfig } from '../config/log.contract';
|
|
4
4
|
import type { ModeConfig } from '../config/mode.contract';
|
|
5
5
|
export type StoreRemoteEntry = (remoteEntry: RemoteEntry, onSharedExternal: SharedExternalHandler) => void;
|
|
6
|
+
export type RemoveCachedRemoteEntries = (remoteNames: ReadonlySet<RemoteName>) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Evict overridden remotes before their replacements are merged in. Kept out of `storeRemoteEntry`
|
|
9
|
+
* because `removeFromAllScopes` costs a full traversal of the shared-externals graph: the init
|
|
10
|
+
* pipeline evicts its whole override set at once, the dynamic pipeline passes a single name.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createRemoveCachedRemoteEntries(ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo'>): RemoveCachedRemoteEntries;
|
|
6
13
|
export type SharedExternalHandler = (remoteEntry: RemoteEntry, external: DenseSharedInfo, ctx: SharedExternalContext) => void;
|
|
7
14
|
export type SharedExternalContext = {
|
|
8
15
|
tag: string;
|
|
@@ -13,11 +20,12 @@ export type SharedExternalContext = {
|
|
|
13
20
|
commit: () => void;
|
|
14
21
|
};
|
|
15
22
|
/**
|
|
16
|
-
* Not a pipeline step but the template both storage steps specialize: it owns the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
23
|
+
* Not a pipeline step but the template both storage steps specialize: it owns the merge sequence
|
|
24
|
+
* for a remoteEntry, and only the resolution of a singleton external differs between the init
|
|
25
|
+
* pipeline (process-remote-entries, step 2) and the dynamic pipeline (update-cache, step 8),
|
|
26
|
+
* injected per call. Evicting an overridden remote is the caller's job, see
|
|
27
|
+
* `createRemoveCachedRemoteEntries` — every entry reaching here is merged additively. The
|
|
28
|
+
* pipelines must not be merged, see docs/version-resolver.md "Dynamic Init". If a change ever
|
|
29
|
+
* needs a flag or parameter here to serve only one caller, inline this back into the steps instead.
|
|
22
30
|
*/
|
|
23
31
|
export declare function createStoreRemoteEntry(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>, logStep: number): StoreRemoteEntry;
|