@softarc/native-federation-orchestrator 4.8.0 → 4.9.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/fesm2022/@softarc/native-federation-orchestrator.mjs +399 -235
- package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +3 -3
- package/fesm2022/module-federation.mjs +78 -21
- package/fesm2022/module-federation.mjs.map +3 -3
- package/fesm2022/node.mjs +468 -238
- package/fesm2022/node.mjs.map +3 -3
- package/fesm2022/options.mjs +4 -2
- package/fesm2022/options.mjs.map +2 -2
- package/package.json +1 -1
- package/quickstart.mjs +14 -14
- package/types/lib/core/1.domain/externals/claims.d.ts +1 -2
- package/types/lib/core/1.domain/externals/serving.d.ts +2 -2
- package/types/lib/core/1.domain/externals/specifier.d.ts +11 -6
- package/types/lib/core/1.domain/externals/version.contract.d.ts +1 -0
- package/types/lib/core/1.domain/pooling/builds.d.ts +2 -2
- package/types/lib/core/1.domain/pooling/election.d.ts +2 -1
- package/types/lib/core/1.domain/pooling/gate.d.ts +4 -2
- package/types/lib/core/1.domain/pooling/membership.d.ts +4 -2
- package/types/lib/core/1.domain/pooling/plan.d.ts +2 -0
- package/types/lib/core/1.domain/remote-entry/mark-dense.d.ts +2 -0
- package/types/lib/core/1.domain/remote-entry/remote-entry.contract.d.ts +5 -2
- package/types/lib/core/2.app/config/mode.contract.d.ts +1 -0
- package/types/lib/core/2.app/steps/get-remote-entries.d.ts +1 -1
- package/types/lib/core/2.app/steps/store-remote-entry.d.ts +3 -3
- package/types/lib/core/3.adapters/remote-entry/normalize-remote-entry.d.ts +4 -0
- package/types/lib/core/4.config/storage/storage.config.d.ts +2 -1
- package/types/lib/node/adapters/fs-remote-entry-provider.d.ts +2 -1
- package/types/lib/utils/union-find.d.ts +4 -0
|
@@ -2,7 +2,7 @@ import type { DeepReadonly } from '../../../utils/deep-readonly';
|
|
|
2
2
|
import type { RemoteName } from '../remote/remote-info.contract';
|
|
3
3
|
import { type ExternalName, type SharedExternal } from './external.contract';
|
|
4
4
|
import type { SharedVersion, SharedVersionMeta, VersionName } from './version.contract';
|
|
5
|
-
import {
|
|
5
|
+
import type { Specifier } from './specifier';
|
|
6
6
|
export type Claim = {
|
|
7
7
|
external: ExternalName;
|
|
8
8
|
tag: VersionName;
|
|
@@ -18,5 +18,4 @@ export declare function committedClaims(externals: Iterable<readonly [ExternalNa
|
|
|
18
18
|
shareScope: string;
|
|
19
19
|
without?: RemoteName;
|
|
20
20
|
}): Map<Specifier, Claim>;
|
|
21
|
-
export declare const claimsByPackage: (claims: ReadonlyMap<Specifier, Claim>) => Map<ExternalName, [Specifier, Claim][]>;
|
|
22
21
|
export declare function versionClaims(version: DeepReadonly<SharedVersion>, servingBuild: RemoteName | undefined): Map<Specifier, SharedVersionMeta>;
|
|
@@ -23,7 +23,7 @@ type Placed = {
|
|
|
23
23
|
export declare const byServingRank: (a: ServingCandidate, b: ServingCandidate) => number;
|
|
24
24
|
export declare const packagesOf: (scope: DeepReadonly<shareScope>) => Map<ExternalName, ExternalName[]>;
|
|
25
25
|
export declare const isPooled: (externals: PackageExternals) => boolean;
|
|
26
|
-
export declare function servingBuildOf(externals: PackageExternals, accepts: AcceptsTag): ServingBuild | undefined;
|
|
26
|
+
export declare function servingBuildOf(pkg: ExternalName, externals: PackageExternals, accepts: AcceptsTag): ServingBuild | undefined;
|
|
27
27
|
export declare function shareServingCopies(external: SharedExternal, serving: ServingBuild): void;
|
|
28
28
|
export type ServingObjector = {
|
|
29
29
|
copy: SharedVersionMeta;
|
|
@@ -43,7 +43,7 @@ export declare function strictObjectorOf(externals: PackageExternals, serving: S
|
|
|
43
43
|
external: ExternalName;
|
|
44
44
|
}) | undefined;
|
|
45
45
|
export declare const SCANNED_SURFACES_PER_TAG = 8;
|
|
46
|
-
export declare function loadSplitsPackage(copies: readonly {
|
|
46
|
+
export declare function loadSplitsPackage(pkg: ExternalName, copies: readonly {
|
|
47
47
|
tag: VersionName;
|
|
48
48
|
copy: SharedVersionMeta;
|
|
49
49
|
}[], claims: readonly (readonly [Specifier, {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { DeepReadonly } from '../../../utils/deep-readonly';
|
|
2
|
+
import type { ExternalName, shareScope } from './external.contract';
|
|
3
|
+
import type { SharedVersionMeta, VersionName } from './version.contract';
|
|
3
4
|
export type Specifier = string;
|
|
4
|
-
export declare function
|
|
5
|
-
export
|
|
5
|
+
export declare function npmPackageOf(name: ExternalName): ExternalName;
|
|
6
|
+
export type PackageOf = (specifier: Specifier) => ExternalName;
|
|
7
|
+
type StoredCopy = readonly [ExternalName, DeepReadonly<SharedVersionMeta>];
|
|
8
|
+
export declare function packageOfIn(scope: DeepReadonly<shareScope>, loading?: readonly StoredCopy[]): PackageOf;
|
|
6
9
|
export declare class SpecifierTags extends Map<Specifier, VersionName> {
|
|
10
|
+
private readonly packageOf;
|
|
7
11
|
private readonly packages;
|
|
8
|
-
constructor(entries?: Iterable<readonly [Specifier, VersionName]>);
|
|
12
|
+
constructor(packageOf: PackageOf, entries?: Iterable<readonly [Specifier, VersionName]>);
|
|
9
13
|
set(specifier: Specifier, tag: VersionName): this;
|
|
10
14
|
clear(): void;
|
|
11
15
|
pinnedTag(specifier: Specifier): VersionName | undefined;
|
|
12
16
|
}
|
|
13
|
-
export declare function groupByPackage<T>(items: Iterable<T>, nameOf: (item: T) => ExternalName): Map<ExternalName, T[]>;
|
|
17
|
+
export declare function groupByPackage<T>(items: Iterable<T>, nameOf: (item: T) => ExternalName, packageOf: PackageOf): Map<ExternalName, T[]>;
|
|
18
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExternalName, RemoteName, VersionName } from '..';
|
|
2
|
-
import { type Specifier, SpecifierTags } from '../externals/specifier';
|
|
2
|
+
import { type PackageOf, type Specifier, SpecifierTags } from '../externals/specifier';
|
|
3
3
|
import type { PoolMember } from './membership';
|
|
4
4
|
export type Copy = {
|
|
5
5
|
member: ExternalName;
|
|
@@ -17,4 +17,4 @@ export type Build = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare function copiesByRemote(members: readonly PoolMember[]): Map<RemoteName, Copy[]>;
|
|
19
19
|
export declare const specifierCount: (copies: readonly Copy[]) => number;
|
|
20
|
-
export declare function buildOf(owner: RemoteName, copies: readonly Copy[]): Build;
|
|
20
|
+
export declare function buildOf(owner: RemoteName, copies: readonly Copy[], packageOf: PackageOf): Build;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ExternalName, PoolCause, RemoteName, VersionName } from '..';
|
|
2
2
|
import type { AcceptsTag } from '../externals/compatibility';
|
|
3
|
-
import { type Specifier, SpecifierTags } from '../externals/specifier';
|
|
3
|
+
import { type PackageOf, type Specifier, SpecifierTags } from '../externals/specifier';
|
|
4
4
|
import type { PoolMember } from './membership';
|
|
5
5
|
type ElectionInput = {
|
|
6
6
|
members: readonly PoolMember[];
|
|
7
|
+
packageOf: PackageOf;
|
|
7
8
|
acceptsTag: AcceptsTag;
|
|
8
9
|
compare: (a: VersionName, b: VersionName) => number;
|
|
9
10
|
previousWinner?: RemoteName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ExternalName, type RemoteName, type VersionName } from '..';
|
|
2
2
|
import type { LoadActions } from '../remote-entry/load-actions.contract';
|
|
3
3
|
import type { AcceptsTag } from '../externals/compatibility';
|
|
4
|
-
import { type Specifier } from '../externals/specifier';
|
|
4
|
+
import { type PackageOf, type Specifier } from '../externals/specifier';
|
|
5
5
|
import { type Build, type Copy } from './builds';
|
|
6
6
|
import type { PoolMember } from './membership';
|
|
7
7
|
type Served = {
|
|
@@ -10,6 +10,7 @@ type Served = {
|
|
|
10
10
|
file: string;
|
|
11
11
|
};
|
|
12
12
|
type CommittedView = {
|
|
13
|
+
packageOf: PackageOf;
|
|
13
14
|
builds: Map<RemoteName, Build>;
|
|
14
15
|
global: Map<Specifier, Served>;
|
|
15
16
|
runsOffMap: Map<RemoteName, Map<Specifier, Served>>;
|
|
@@ -39,9 +40,10 @@ type MapPolicy = {
|
|
|
39
40
|
shareScope: string;
|
|
40
41
|
scopeUrlOf: (remote: RemoteName) => string | undefined;
|
|
41
42
|
};
|
|
42
|
-
export declare function committedView(members: PoolMember[], shipped: ReadonlyMap<RemoteName, readonly Copy[]>, recordOrder: ExternalName[], { shareScope, without }: {
|
|
43
|
+
export declare function committedView(members: PoolMember[], shipped: ReadonlyMap<RemoteName, readonly Copy[]>, recordOrder: ExternalName[], { shareScope, without, packageOf, }: {
|
|
43
44
|
shareScope: string;
|
|
44
45
|
without?: RemoteName;
|
|
46
|
+
packageOf: PackageOf;
|
|
45
47
|
}): CommittedView;
|
|
46
48
|
export declare function judgeRemote(copies: readonly Copy[], view: CommittedView, accepts: AcceptsTag): 'global' | GateMiss;
|
|
47
49
|
type Binding = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExternalName, SharedExternal, shareScope } from '..';
|
|
2
|
+
import { type PackageOf } from '../externals/specifier';
|
|
2
3
|
import type { DeepReadonly } from '../../../utils/deep-readonly';
|
|
3
4
|
export type PoolName = string;
|
|
4
5
|
export type PoolMember = {
|
|
@@ -8,10 +9,11 @@ export type PoolMember = {
|
|
|
8
9
|
export type Membership = {
|
|
9
10
|
pools: Map<PoolName, PoolMember[]>;
|
|
10
11
|
labelledAlone: ExternalName[];
|
|
12
|
+
packageOf: PackageOf;
|
|
11
13
|
};
|
|
12
14
|
export type LabelledCopy = {
|
|
13
15
|
name: ExternalName;
|
|
14
16
|
pool?: string;
|
|
15
17
|
};
|
|
16
|
-
export declare function buildPools(sharedExternals: DeepReadonly<shareScope
|
|
17
|
-
export declare function pooledPackagesWith(sharedExternals: DeepReadonly<shareScope>, copies: readonly LabelledCopy[]): Set<ExternalName>;
|
|
18
|
+
export declare function buildPools(sharedExternals: DeepReadonly<shareScope>, packageOf?: PackageOf): Membership;
|
|
19
|
+
export declare function pooledPackagesWith(sharedExternals: DeepReadonly<shareScope>, copies: readonly LabelledCopy[], packageOf: PackageOf): Set<ExternalName>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ExternalName, SharedExternal, shareScope } from '../externals/external.contract';
|
|
2
2
|
import { type PoolMember, type PoolName } from './membership';
|
|
3
3
|
import type { DeepReadonly } from '../../../utils/deep-readonly';
|
|
4
|
+
import { type PackageOf } from '../externals/specifier';
|
|
4
5
|
export type ElectionPlan = {
|
|
5
6
|
pools: Map<PoolName, PoolMember[]>;
|
|
6
7
|
stripped: Map<ExternalName, SharedExternal>;
|
|
7
8
|
labelledAlone: ExternalName[];
|
|
9
|
+
packageOf: PackageOf;
|
|
8
10
|
};
|
|
9
11
|
export declare function planElection(scope: DeepReadonly<shareScope>, poolable: boolean): ElectionPlan;
|
|
@@ -2,8 +2,11 @@ import type { SharedVersionAction } from '../externals/version.contract';
|
|
|
2
2
|
import type { RemoteEntryUrl } from './manifest.contract';
|
|
3
3
|
import type { DenseSharedInfo, ExposesInfo, FederationInfo, SharedInfo } from '@softarc/native-federation/domain';
|
|
4
4
|
type RawRemoteEntry = FederationInfo;
|
|
5
|
+
type RemoteSharedInfo = DenseSharedInfo & {
|
|
6
|
+
dense?: true;
|
|
7
|
+
};
|
|
5
8
|
type RemoteEntry = Omit<FederationInfo, 'shared'> & {
|
|
6
|
-
shared:
|
|
9
|
+
shared: RemoteSharedInfo[];
|
|
7
10
|
url: RemoteEntryUrl;
|
|
8
11
|
host?: boolean;
|
|
9
12
|
override?: boolean;
|
|
@@ -12,4 +15,4 @@ type SharedInfoActions = Record<string, {
|
|
|
12
15
|
action: SharedVersionAction;
|
|
13
16
|
override?: Record<string, string>;
|
|
14
17
|
}>;
|
|
15
|
-
export { RawRemoteEntry, RemoteEntry, FederationInfo, ExposesInfo, SharedInfo, DenseSharedInfo, SharedInfoActions, };
|
|
18
|
+
export { RawRemoteEntry, RemoteEntry, FederationInfo, ExposesInfo, SharedInfo, DenseSharedInfo, RemoteSharedInfo, SharedInfoActions, };
|
|
@@ -3,4 +3,4 @@ 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
|
import type { HostConfig } from '../config/host.contract';
|
|
6
|
-
export declare function createGetRemoteEntries(config: LoggingConfig & ModeConfig & HostConfig, ports: Pick<DrivingContract, 'remoteEntryProvider' | 'manifestProvider' | 'remoteInfoRepo' | 'sse'>): ForGettingRemoteEntries;
|
|
6
|
+
export declare function createGetRemoteEntries(config: LoggingConfig & ModeConfig & HostConfig, ports: Pick<DrivingContract, 'remoteEntryProvider' | 'manifestProvider' | 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo' | 'sse'>): ForGettingRemoteEntries;
|
|
@@ -5,9 +5,9 @@ import type { ModeConfig } from '../config/mode.contract';
|
|
|
5
5
|
export type StoreRemoteEntry = (remoteEntry: RemoteEntry, onSharedExternal: SharedExternalHandler) => void;
|
|
6
6
|
export type RemoveCachedRemoteEntries = (remoteNames: ReadonlySet<RemoteName>) => void;
|
|
7
7
|
/**
|
|
8
|
-
* Evict
|
|
9
|
-
* because `removeFromAllScopes` costs a full traversal of the
|
|
10
|
-
*
|
|
8
|
+
* Evict stored remotes: overridden ones before their replacements are merged in, and ones the manifest
|
|
9
|
+
* doesn't list. Kept out of `storeRemoteEntry` because `removeFromAllScopes` costs a full traversal of the
|
|
10
|
+
* shared-externals graph, so each caller evicts its whole set at once.
|
|
11
11
|
*/
|
|
12
12
|
export declare function createRemoveCachedRemoteEntries(ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo'>): RemoveCachedRemoteEntries;
|
|
13
13
|
export type SharedExternalHandler = (remoteEntry: RemoteEntry, external: DenseSharedInfo, ctx: SharedExternalContext) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RawRemoteEntry, RemoteEntry } from '../../1.domain/remote-entry/remote-entry.contract';
|
|
2
|
+
import type { ModeConfig } from '../../2.app/config/mode.contract';
|
|
3
|
+
declare const normalizeRemoteEntry: (raw: RawRemoteEntry, remoteEntryUrl: string, config: ModeConfig) => RemoteEntry;
|
|
4
|
+
export { normalizeRemoteEntry };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { type StorageConfig, type StorageOptions } from '../../2.app/config/storage.contract';
|
|
2
|
-
|
|
2
|
+
import type { LogHandler } from '../../2.app/config/log.contract';
|
|
3
|
+
export declare const createStorageConfig: (override: StorageOptions, log: LogHandler) => StorageConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModeConfig } from '../../core/2.app/config/mode.contract';
|
|
1
2
|
import type { ForProvidingRemoteEntries } from '../../core/2.app/driving-ports/for-providing-remote-entries.port';
|
|
2
|
-
declare const createFsRemoteEntryProvider: () => ForProvidingRemoteEntries;
|
|
3
|
+
declare const createFsRemoteEntryProvider: (config: ModeConfig) => ForProvidingRemoteEntries;
|
|
3
4
|
export { createFsRemoteEntryProvider };
|