@softarc/native-federation-orchestrator 4.2.2 → 4.3.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.
Files changed (156) hide show
  1. package/fesm2022/@softarc/native-federation-orchestrator.mjs +884 -917
  2. package/fesm2022/@softarc/native-federation-orchestrator.mjs.map +4 -4
  3. package/fesm2022/audit.mjs +2 -2
  4. package/fesm2022/audit.mjs.map +2 -2
  5. package/fesm2022/node.mjs +424 -444
  6. package/fesm2022/node.mjs.map +4 -4
  7. package/fesm2022/options.mjs +13 -13
  8. package/fesm2022/options.mjs.map +3 -3
  9. package/fesm2022/registry.mjs +2 -2
  10. package/fesm2022/registry.mjs.map +3 -3
  11. package/fesm2022/sdk.mjs +2 -2
  12. package/fesm2022/sdk.mjs.map +2 -2
  13. package/init-registry.mjs +1 -1
  14. package/node-loader/loader.mjs +1 -1
  15. package/node-loader/loader.mjs.map +1 -1
  16. package/package.json +2 -5
  17. package/quickstart.mjs +13 -13
  18. package/types/lib/audit/externals-audit.d.ts +4 -0
  19. package/types/lib/{2.app/driver-ports/audit → audit}/for-auditing-externals.port.d.ts +1 -1
  20. package/types/lib/audit.index.d.ts +2 -2
  21. package/types/lib/{2.app → core/2.app}/driver-ports/init/drivers.contract.d.ts +6 -0
  22. package/types/lib/core/2.app/driver-ports/init/flow.contract.d.ts +14 -0
  23. package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-getting-remote-entry.port.d.ts +1 -1
  24. package/types/lib/{2.app → core/2.app}/driver-ports/init/index.d.ts +3 -0
  25. package/types/lib/{2.app → core/2.app}/driving-ports/for-remote-info-storage.port.d.ts +1 -1
  26. package/types/lib/{2.app → core/2.app}/driving-ports/for-scoped-externals-storage.port.d.ts +1 -1
  27. package/types/lib/{2.app → core/2.app}/driving-ports/for-shared-chunks-storage.port.d.ts +1 -1
  28. package/types/lib/{2.app → core/2.app}/driving-ports/for-shared-externals-storage.port.d.ts +1 -1
  29. package/types/lib/core/2.app/flows/init-remote-entry.flow.d.ts +4 -0
  30. package/types/lib/core/2.app/flows/init.flow.d.ts +4 -0
  31. package/types/lib/core/2.app/steps/commit-changes.d.ts +4 -0
  32. package/types/lib/core/2.app/steps/convert-to-import-map.d.ts +4 -0
  33. package/types/lib/core/2.app/steps/determine-shared-externals.d.ts +5 -0
  34. package/types/lib/core/2.app/steps/expose-module-loader.d.ts +4 -0
  35. package/types/lib/core/2.app/steps/generate-import-map.d.ts +5 -0
  36. package/types/lib/core/2.app/steps/get-remote-entries.d.ts +6 -0
  37. package/types/lib/core/2.app/steps/get-remote-entry.d.ts +5 -0
  38. package/types/lib/core/2.app/steps/process-remote-entries.d.ts +5 -0
  39. package/types/lib/core/2.app/steps/store-remote-entry.d.ts +23 -0
  40. package/types/lib/core/2.app/steps/update-cache.d.ts +5 -0
  41. package/types/lib/{3.adapters → core/3.adapters}/browser/sse-handler.d.ts +1 -1
  42. package/types/lib/core/5.di/federation-result.factory.d.ts +12 -0
  43. package/types/lib/core/5.di/init.factory.d.ts +12 -0
  44. package/types/lib/{init-federation.contract.d.ts → core/init-federation.contract.d.ts} +1 -1
  45. package/types/lib/index.d.ts +10 -8
  46. package/types/lib/{3.adapters/node → node/adapters}/fs-manifest-provider.d.ts +1 -1
  47. package/types/lib/{3.adapters/node → node/adapters}/fs-remote-entry-provider.d.ts +1 -1
  48. package/types/lib/{3.adapters/node → node/adapters}/node-loader.client.d.ts +1 -1
  49. package/types/lib/node/adapters/noop-sse.d.ts +3 -0
  50. package/types/lib/{init-federation.node.d.ts → node/init-federation.node.d.ts} +5 -5
  51. package/types/lib/{4.config/import-map → node}/resolve-host-instances.d.ts +3 -3
  52. package/types/lib/{4.config/import-map → node}/use-node.d.ts +2 -2
  53. package/types/lib/{utils/node → node/utils}/to-url.d.ts +1 -1
  54. package/types/lib/node.index.d.ts +5 -5
  55. package/types/lib/options.index.d.ts +5 -5
  56. package/types/lib/registry/for-managing-events.port.d.ts +2 -0
  57. package/types/lib/registry/setup-registry.d.ts +3 -0
  58. package/types/lib/registry.index.d.ts +5 -4
  59. package/types/lib/sdk.index.d.ts +4 -5
  60. package/types/lib/testing/handlers/log.handler.d.ts +3 -0
  61. package/types/lib/utils/clone-entry.d.ts +1 -1
  62. package/types/{init-registry.d.ts → scripts/init-registry.d.ts} +1 -1
  63. package/types/lib/1.domain/registry/index.d.ts +0 -2
  64. package/types/lib/2.app/driver-ports/audit/index.d.ts +0 -1
  65. package/types/lib/2.app/driver-ports/dynamic-init/drivers.contract.d.ts +0 -13
  66. package/types/lib/2.app/driver-ports/dynamic-init/flow.contract.d.ts +0 -8
  67. package/types/lib/2.app/driver-ports/dynamic-init/index.d.ts +0 -5
  68. package/types/lib/2.app/driver-ports/init/flow.contract.d.ts +0 -6
  69. package/types/lib/2.app/driver-ports/registry/for-managing-events.port.d.ts +0 -2
  70. package/types/lib/2.app/flows/audit/externals-audit.d.ts +0 -4
  71. package/types/lib/2.app/flows/dynamic-init/convert-to-import-map.d.ts +0 -4
  72. package/types/lib/2.app/flows/dynamic-init/get-remote-entry.d.ts +0 -5
  73. package/types/lib/2.app/flows/dynamic-init/update-cache.d.ts +0 -5
  74. package/types/lib/2.app/flows/init/commit-changes.d.ts +0 -4
  75. package/types/lib/2.app/flows/init/determine-shared-externals.d.ts +0 -5
  76. package/types/lib/2.app/flows/init/expose-module-loader.d.ts +0 -4
  77. package/types/lib/2.app/flows/init/generate-import-map.d.ts +0 -5
  78. package/types/lib/2.app/flows/init/get-remote-entries.d.ts +0 -6
  79. package/types/lib/2.app/flows/init/process-remote-entries.d.ts +0 -5
  80. package/types/lib/2.app/flows/registry/setup-registry.d.ts +0 -3
  81. package/types/lib/3.adapters/node/noop-sse.d.ts +0 -3
  82. package/types/lib/5.di/flows/dynamic-init.factory.d.ts +0 -14
  83. package/types/lib/5.di/flows/init.factory.d.ts +0 -14
  84. package/types/lib/6.mocks/handlers/log.handler.d.ts +0 -2
  85. /package/types/lib/{1.domain → core/1.domain}/externals/chunks.contract.d.ts +0 -0
  86. /package/types/lib/{1.domain → core/1.domain}/externals/external.contract.d.ts +0 -0
  87. /package/types/lib/{1.domain → core/1.domain}/externals/version.contract.d.ts +0 -0
  88. /package/types/lib/{1.domain → core/1.domain}/import-map/import-map.contract.d.ts +0 -0
  89. /package/types/lib/{1.domain → core/1.domain}/index.d.ts +0 -0
  90. /package/types/lib/{1.domain → core/1.domain}/remote/remote-info.contract.d.ts +0 -0
  91. /package/types/lib/{1.domain → core/1.domain}/remote/remote-module.contract.d.ts +0 -0
  92. /package/types/lib/{1.domain → core/1.domain}/remote-entry/manifest.contract.d.ts +0 -0
  93. /package/types/lib/{1.domain → core/1.domain}/remote-entry/remote-entry.contract.d.ts +0 -0
  94. /package/types/lib/{2.app → core/2.app}/config/config.contract.d.ts +0 -0
  95. /package/types/lib/{2.app → core/2.app}/config/host.contract.d.ts +0 -0
  96. /package/types/lib/{2.app → core/2.app}/config/import-map.contract.d.ts +0 -0
  97. /package/types/lib/{2.app → core/2.app}/config/index.d.ts +0 -0
  98. /package/types/lib/{2.app → core/2.app}/config/log.contract.d.ts +0 -0
  99. /package/types/lib/{2.app → core/2.app}/config/mode.contract.d.ts +0 -0
  100. /package/types/lib/{2.app → core/2.app}/config/storage.contract.d.ts +0 -0
  101. /package/types/lib/{2.app → core/2.app}/driver-ports/flow-factory.contract.d.ts +0 -0
  102. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-committing-changes.port.d.ts +0 -0
  103. /package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-converting-to-import-map.d.ts +0 -0
  104. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-determining-shared-externals.port.d.ts +0 -0
  105. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-exposing-module-loader.port.d.ts +0 -0
  106. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-generating-import-map.d.ts +0 -0
  107. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-getting-remote-entries.port.d.ts +0 -0
  108. /package/types/lib/{2.app → core/2.app}/driver-ports/init/for-processing-remote-entries.port.d.ts +0 -0
  109. /package/types/lib/{2.app/driver-ports/dynamic-init → core/2.app/driver-ports/init}/for-updating-cache.d.ts +0 -0
  110. /package/types/lib/{2.app → core/2.app}/driving-ports/driving.contract.d.ts +0 -0
  111. /package/types/lib/{2.app → core/2.app}/driving-ports/for-browser-tasks.d.ts +0 -0
  112. /package/types/lib/{2.app → core/2.app}/driving-ports/for-providing-manifest.port.d.ts +0 -0
  113. /package/types/lib/{2.app → core/2.app}/driving-ports/for-providing-remote-entries.port.d.ts +0 -0
  114. /package/types/lib/{2.app → core/2.app}/driving-ports/for-sse.port.d.ts +0 -0
  115. /package/types/lib/{2.app → core/2.app}/driving-ports/for-version-checking.port.d.ts +0 -0
  116. /package/types/lib/{2.app → core/2.app}/driving-ports/index.d.ts +0 -0
  117. /package/types/lib/{3.adapters → core/3.adapters}/browser/browser.d.ts +0 -0
  118. /package/types/lib/{3.adapters → core/3.adapters}/checks/version.check.d.ts +0 -0
  119. /package/types/lib/{3.adapters → core/3.adapters}/http/manifest-provider.d.ts +0 -0
  120. /package/types/lib/{3.adapters → core/3.adapters}/http/remote-entry-provider.d.ts +0 -0
  121. /package/types/lib/{3.adapters → core/3.adapters}/storage/chunk.repository.d.ts +0 -0
  122. /package/types/lib/{3.adapters → core/3.adapters}/storage/remote-info.repository.d.ts +0 -0
  123. /package/types/lib/{3.adapters → core/3.adapters}/storage/scoped-externals.repository.d.ts +0 -0
  124. /package/types/lib/{3.adapters → core/3.adapters}/storage/shared-externals.repository.d.ts +0 -0
  125. /package/types/lib/{4.config → core/4.config}/host/host.config.d.ts +0 -0
  126. /package/types/lib/{4.config → core/4.config}/import-map/import-map.config.d.ts +0 -0
  127. /package/types/lib/{4.config → core/4.config}/import-map/index.d.ts +0 -0
  128. /package/types/lib/{4.config → core/4.config}/import-map/replace-in-dom.d.ts +0 -0
  129. /package/types/lib/{4.config → core/4.config}/import-map/trusted-types.d.ts +0 -0
  130. /package/types/lib/{4.config → core/4.config}/import-map/use-default.d.ts +0 -0
  131. /package/types/lib/{4.config → core/4.config}/import-map/use-import-shim.d.ts +0 -0
  132. /package/types/lib/{4.config → core/4.config}/logging/console.logger.d.ts +0 -0
  133. /package/types/lib/{4.config → core/4.config}/logging/index.d.ts +0 -0
  134. /package/types/lib/{4.config → core/4.config}/logging/log.config.d.ts +0 -0
  135. /package/types/lib/{4.config → core/4.config}/logging/log.handler.d.ts +0 -0
  136. /package/types/lib/{4.config → core/4.config}/logging/noop.logger.d.ts +0 -0
  137. /package/types/lib/{4.config → core/4.config}/mode/caching.profile.d.ts +0 -0
  138. /package/types/lib/{4.config → core/4.config}/mode/default.profile.d.ts +0 -0
  139. /package/types/lib/{4.config → core/4.config}/mode/index.d.ts +0 -0
  140. /package/types/lib/{4.config → core/4.config}/mode/mode.config.d.ts +0 -0
  141. /package/types/lib/{4.config → core/4.config}/storage/global-this.storage.d.ts +0 -0
  142. /package/types/lib/{4.config → core/4.config}/storage/index.d.ts +0 -0
  143. /package/types/lib/{4.config → core/4.config}/storage/local.storage.d.ts +0 -0
  144. /package/types/lib/{4.config → core/4.config}/storage/session.storage.d.ts +0 -0
  145. /package/types/lib/{4.config → core/4.config}/storage/storage.config.d.ts +0 -0
  146. /package/types/lib/{5.di → core/5.di}/config.factory.d.ts +0 -0
  147. /package/types/lib/{5.di → core/5.di}/driving.factory.d.ts +0 -0
  148. /package/types/lib/{init-federation.d.ts → core/init-federation.d.ts} +0 -0
  149. /package/types/lib/{native-federation.error.d.ts → core/native-federation.error.d.ts} +0 -0
  150. /package/types/lib/{3.adapters/node → node/adapters}/loader-url.d.ts +0 -0
  151. /package/types/lib/{utils/node → node/utils}/read-source.d.ts +0 -0
  152. /package/types/lib/{1.domain/registry → registry}/event-registry.contract.d.ts +0 -0
  153. /package/types/lib/{1.domain/registry → registry}/event.contract.d.ts +0 -0
  154. /package/types/lib/{2.app/config → registry}/registry.contract.d.ts +0 -0
  155. /package/types/{node-loader.d.ts → scripts/node-loader.d.ts} +0 -0
  156. /package/types/{quickstart.d.ts → scripts/quickstart.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
1
  import type { RemoteEntry } from '../../../1.domain/remote-entry/remote-entry.contract';
2
- import type { Optional } from '../../../utils/optional';
2
+ import type { Optional } from '../../../../utils/optional';
3
3
  import type { RemoteRef } from './flow.contract';
4
4
  export type ForGettingRemoteEntry = (remoteEntryUrl: string, remote?: RemoteRef) => Promise<Optional<RemoteEntry>>;
@@ -4,5 +4,8 @@ export * from './for-determining-shared-externals.port';
4
4
  export * from './for-generating-import-map';
5
5
  export * from './for-committing-changes.port';
6
6
  export * from './for-exposing-module-loader.port';
7
+ export * from './for-getting-remote-entry.port';
8
+ export * from './for-updating-cache';
9
+ export * from './for-converting-to-import-map';
7
10
  export * from './flow.contract';
8
11
  export * from './drivers.contract';
@@ -1,5 +1,5 @@
1
1
  import type { RemoteInfo, RemoteName, Remotes } from '../../1.domain/remote/remote-info.contract';
2
- import type { Optional } from '../../utils/optional';
2
+ import type { Optional } from '../../../utils/optional';
3
3
  export type ForRemoteInfoStorage = {
4
4
  contains: (remoteName: RemoteName) => boolean;
5
5
  tryGet: (remoteName: RemoteName) => Optional<RemoteInfo>;
@@ -1,5 +1,5 @@
1
1
  import type { RemoteName, ScopedExternal, ScopedExternals, ScopedVersion } from '../../1.domain';
2
- import type { Optional } from '../../utils/optional';
2
+ import type { Optional } from '../../../utils/optional';
3
3
  export type ForScopedExternalsStorage = {
4
4
  addExternal: (remoteName: RemoteName, external: string, version: ScopedVersion) => ForScopedExternalsStorage;
5
5
  remove: (remoteName: RemoteName) => ForScopedExternalsStorage;
@@ -1,4 +1,4 @@
1
- import type { Optional } from '../../sdk.index';
1
+ import type { Optional } from '../../../utils/optional';
2
2
  export type ForSharedChunksStorage = {
3
3
  addOrReplace: (remote: string, bundleName: string, chunks: string[]) => ForSharedChunksStorage;
4
4
  commit: () => ForSharedChunksStorage;
@@ -1,5 +1,5 @@
1
1
  import type { RemoteName, SharedExternal, shareScope } from '../../1.domain';
2
- import type { Optional } from '../../utils/optional';
2
+ import type { Optional } from '../../../utils/optional';
3
3
  export type ForSharedExternalsStorage = {
4
4
  tryGet: (external: string, shareScope?: string) => Optional<SharedExternal>;
5
5
  getFromScope: (shareScope?: string) => shareScope;
@@ -0,0 +1,4 @@
1
+ import type { FLOW_FACTORY } from '../driver-ports/flow-factory.contract';
2
+ import type { InitDriversContract } from '../driver-ports/init/drivers.contract';
3
+ import type { InitRemoteEntryFlow } from '../driver-ports/init/flow.contract';
4
+ export declare const createInitRemoteEntryFlow: ({ flow, }: FLOW_FACTORY<InitDriversContract>) => InitRemoteEntryFlow;
@@ -0,0 +1,4 @@
1
+ import type { FLOW_FACTORY } from '../driver-ports/flow-factory.contract';
2
+ import type { InitDriversContract } from '../driver-ports/init/drivers.contract';
3
+ import type { InitFlow } from '../driver-ports/init/flow.contract';
4
+ export declare const createInitFlow: ({ flow, adapters, config, }: FLOW_FACTORY<InitDriversContract>) => InitFlow;
@@ -0,0 +1,4 @@
1
+ import type { DrivingContract } from '../driving-ports/driving.contract';
2
+ import type { ForCommittingChanges } from '../driver-ports/init/for-committing-changes.port';
3
+ import type { LoggingConfig } from '../config';
4
+ export declare function createCommitChanges(config: LoggingConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo' | 'browser'>): ForCommittingChanges;
@@ -0,0 +1,4 @@
1
+ import type { LoggingConfig } from '../config/log.contract';
2
+ import type { ForConvertingToImportMap } from '../driver-ports/init/for-converting-to-import-map';
3
+ import type { DrivingContract } from '../driving-ports/driving.contract';
4
+ export declare function createConvertToImportMap({ log }: LoggingConfig, ports: Pick<DrivingContract, 'sharedChunksRepo'>): ForConvertingToImportMap;
@@ -0,0 +1,5 @@
1
+ import type { ForDeterminingSharedExternals } from '../driver-ports/init/for-determining-shared-externals.port';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
5
+ export declare function createDetermineSharedExternals(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'versionCheck' | 'sharedExternalsRepo'>): ForDeterminingSharedExternals;
@@ -0,0 +1,4 @@
1
+ import type { DrivingContract } from '../driving-ports/driving.contract';
2
+ import type { ForExposingModuleLoader } from '../driver-ports/init/for-exposing-module-loader.port';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ export declare function createExposeModuleLoader(config: LoggingConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'browser'>): ForExposingModuleLoader;
@@ -0,0 +1,5 @@
1
+ import type { ForGeneratingImportMap } from '../driver-ports/init/for-generating-import-map';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
5
+ export declare function createGenerateImportMap(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'sharedExternalsRepo'>): ForGeneratingImportMap;
@@ -0,0 +1,6 @@
1
+ import type { ForGettingRemoteEntries } from '../driver-ports/init/for-getting-remote-entries.port';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
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;
@@ -0,0 +1,5 @@
1
+ import type { DrivingContract } from '../driving-ports/driving.contract';
2
+ import type { LoggingConfig } from '../config/log.contract';
3
+ import type { ModeConfig } from '../config/mode.contract';
4
+ import type { ForGettingRemoteEntry } from '../driver-ports/init/for-getting-remote-entry.port';
5
+ export declare function createGetRemoteEntry(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteEntryProvider' | 'remoteInfoRepo' | 'sse'>): ForGettingRemoteEntry;
@@ -0,0 +1,5 @@
1
+ import type { ForProcessingRemoteEntries } from '../driver-ports/init/for-processing-remote-entries.port';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
5
+ export declare function createProcessRemoteEntries(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'sharedExternalsRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>): ForProcessingRemoteEntries;
@@ -0,0 +1,23 @@
1
+ import type { RemoteEntry, SharedExternal, SharedInfo, SharedVersion, SharedVersionMeta } from '../../1.domain';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
5
+ export type StoreRemoteEntry = (remoteEntry: RemoteEntry, onSharedExternal: SharedExternalHandler) => void;
6
+ export type SharedExternalHandler = (remoteEntry: RemoteEntry, external: SharedInfo, ctx: SharedExternalContext) => void;
7
+ export type SharedExternalContext = {
8
+ tag: string;
9
+ remote: SharedVersionMeta;
10
+ cached: SharedExternal;
11
+ scopeType: 'global' | 'strict' | 'shareScope';
12
+ assertSameVersionCompatibility: (matchingVersion: SharedVersion) => void;
13
+ commit: () => void;
14
+ };
15
+ /**
16
+ * Not a pipeline step but the template both storage steps specialize: it owns the full
17
+ * storage sequence for a remoteEntry, and only the resolution of a singleton external
18
+ * differs between the init pipeline (process-remote-entries, step 2) and the dynamic
19
+ * pipeline (update-cache, step 8), injected per call. The pipelines must not be merged,
20
+ * see docs/version-resolver.md "Dynamic Init". If a change ever needs a flag or
21
+ * parameter here to serve only one caller, inline this back into the steps instead.
22
+ */
23
+ export declare function createStoreRemoteEntry(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>, logStep: number): StoreRemoteEntry;
@@ -0,0 +1,5 @@
1
+ import type { ForUpdatingCache } from '../driver-ports/init/for-updating-cache';
2
+ import type { DrivingContract } from '../driving-ports/driving.contract';
3
+ import type { LoggingConfig } from '../config/log.contract';
4
+ import type { ModeConfig } from '../config/mode.contract';
5
+ export declare function createUpdateCache(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'sharedExternalsRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>): ForUpdatingCache;
@@ -1,6 +1,6 @@
1
1
  import type { ImportMapConfig } from '../../2.app/config/import-map.contract';
2
2
  import type { ForSSE } from '../../2.app/driving-ports/for-sse.port';
3
- import type { LoggingConfig } from '../../options.index';
3
+ import type { LoggingConfig } from '../../2.app/config/log.contract';
4
4
  /**
5
5
  * Watches for federation build completion events and automatically reloads the page.
6
6
  *
@@ -0,0 +1,12 @@
1
+ import type { ConfigContract } from '../2.app/config/config.contract';
2
+ import type { DrivingContract } from '../2.app/driving-ports/driving.contract';
3
+ import type { InitRemoteEntryFlow } from '../2.app/driver-ports/init/flow.contract';
4
+ import type { LoadRemoteModule, NativeFederationResult } from '../init-federation.contract';
5
+ export declare const createStateDump: (config: ConfigContract, adapters: DrivingContract) => (msg: string) => void;
6
+ export declare const createFederationResult: ({ config, adapters, loadRemoteModule, initRemoteEntryFlow, afterInitRemoteEntry, }: {
7
+ config: ConfigContract;
8
+ adapters: DrivingContract;
9
+ loadRemoteModule: LoadRemoteModule;
10
+ initRemoteEntryFlow: InitRemoteEntryFlow;
11
+ afterInitRemoteEntry?: () => Promise<unknown>;
12
+ }) => NativeFederationResult;
@@ -0,0 +1,12 @@
1
+ import type { FLOW_FACTORY } from '../2.app/driver-ports/flow-factory.contract';
2
+ import type { InitDriversContract } from '../2.app/driver-ports/init/drivers.contract';
3
+ import type { DrivingContract } from '../2.app/driving-ports/driving.contract';
4
+ import type { ConfigContract } from '../2.app/config/config.contract';
5
+ export declare const createInitDrivers: ({ config, adapters, }: {
6
+ config: ConfigContract;
7
+ adapters: DrivingContract;
8
+ }) => InitDriversContract;
9
+ export declare const INIT_FLOW_FACTORY: ({ config, adapters, }: {
10
+ config: ConfigContract;
11
+ adapters: DrivingContract;
12
+ }) => FLOW_FACTORY<InitDriversContract>;
@@ -1,6 +1,6 @@
1
1
  import type { ConfigContract } from './2.app/config/config.contract';
2
2
  import type { DrivingContract } from './2.app/driving-ports/driving.contract';
3
- import type { DynamicInitResult } from './2.app/driver-ports/dynamic-init/flow.contract';
3
+ import type { DynamicInitResult } from './2.app/driver-ports/init/flow.contract';
4
4
  export type LoadRemoteModule = <TModule = unknown>(remoteName: string, exposedModule: string) => Promise<TModule>;
5
5
  export type LoadRemoteModuleOf<TModule> = (remoteName: string, exposedModule: string) => Promise<TModule>;
6
6
  export type NativeFederationResult = DynamicInitResult<{
@@ -1,8 +1,10 @@
1
- export { initFederation } from './init-federation';
2
- export { NFError } from './native-federation.error';
3
- export { LoadRemoteModule, LoadRemoteModuleOf, NativeFederationResult, } from './init-federation.contract';
4
- export { FederationManifest } from './1.domain/remote-entry/manifest.contract';
5
- export { createConfigHandlers } from './5.di/config.factory';
6
- export { createDriving } from './5.di/driving.factory';
7
- export { createDynamicInitDrivers, DYNAMIC_INIT_FLOW_FACTORY, createDynamicInitFlow, } from './5.di/flows/dynamic-init.factory';
8
- export { createInitDrivers, INIT_FLOW_FACTORY, createInitFlow } from './5.di/flows/init.factory';
1
+ export { initFederation } from './core/init-federation';
2
+ export { NFError } from './core/native-federation.error';
3
+ export { LoadRemoteModule, LoadRemoteModuleOf, NativeFederationResult, } from './core/init-federation.contract';
4
+ export { FederationManifest } from './core/1.domain/remote-entry/manifest.contract';
5
+ export { createConfigHandlers } from './core/5.di/config.factory';
6
+ export { createDriving } from './core/5.di/driving.factory';
7
+ export { createInitDrivers, INIT_FLOW_FACTORY } from './core/5.di/init.factory';
8
+ export { createInitFlow } from './core/2.app/flows/init.flow';
9
+ export { createInitRemoteEntryFlow } from './core/2.app/flows/init-remote-entry.flow';
10
+ export { createFederationResult, createStateDump } from './core/5.di/federation-result.factory';
@@ -1,3 +1,3 @@
1
- import type { ForProvidingManifest } from '../../2.app/driving-ports/for-providing-manifest.port';
1
+ import type { ForProvidingManifest } from '../../core/2.app/driving-ports/for-providing-manifest.port';
2
2
  declare const createFsManifestProvider: () => ForProvidingManifest;
3
3
  export { createFsManifestProvider };
@@ -1,3 +1,3 @@
1
- import type { ForProvidingRemoteEntries } from '../../2.app/driving-ports/for-providing-remote-entries.port';
1
+ import type { ForProvidingRemoteEntries } from '../../core/2.app/driving-ports/for-providing-remote-entries.port';
2
2
  declare const createFsRemoteEntryProvider: () => ForProvidingRemoteEntries;
3
3
  export { createFsRemoteEntryProvider };
@@ -1,4 +1,4 @@
1
- import type { ImportMap } from '../../1.domain';
1
+ import type { ImportMap } from '../../core/1.domain';
2
2
  /** Per-specifier list of export names to bridge from the host's instances. */
3
3
  export type HostInstanceKeys = Record<string, string[]>;
4
4
  export type NodeLoaderClient = {
@@ -0,0 +1,3 @@
1
+ import type { ForSSE } from '../../core/2.app/driving-ports/for-sse.port';
2
+ declare const createNoopSSE: () => ForSSE;
3
+ export { createNoopSSE };
@@ -1,8 +1,8 @@
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
- import { type HostInstancesOption } from './4.config/import-map/resolve-host-instances';
5
- export type { HostInstancesOption, HostInstancesAuto } from './4.config/import-map/resolve-host-instances';
1
+ import type { FederationManifest } from '../core/1.domain';
2
+ import type { NFOptions } from '../core/2.app/config/config.contract';
3
+ import type { NativeFederationResult } from '../core/init-federation.contract';
4
+ import { type HostInstancesOption } from './resolve-host-instances';
5
+ export type { HostInstancesOption, HostInstancesAuto } from './resolve-host-instances';
6
6
  export type InitNodeFederationOptions = NFOptions & {
7
7
  /**
8
8
  * Bridge specifiers to instances already loaded in the host process (dev).
@@ -1,6 +1,6 @@
1
- import type { HostOptions } from '../../2.app/config/host.contract';
2
- import type { LogHandler } from '../../2.app/config/log.contract';
3
- import type { ForProvidingRemoteEntries } from '../../2.app/driving-ports/for-providing-remote-entries.port';
1
+ import type { HostOptions } from '../core/2.app/config/host.contract';
2
+ import type { LogHandler } from '../core/2.app/config/log.contract';
3
+ import type { ForProvidingRemoteEntries } from '../core/2.app/driving-ports/for-providing-remote-entries.port';
4
4
  /** Specifier → module namespace object to bridge into remotes (the host's own instances). */
5
5
  export type HostInstanceMap = Record<string, object>;
6
6
  /**
@@ -1,5 +1,5 @@
1
- import type { ImportMapConfig } from '../../2.app/config/import-map.contract';
2
- import { type NodeLoaderClient, type HostInstanceKeys } from '../../3.adapters/node/node-loader.client';
1
+ import type { ImportMapConfig } from '../core/2.app/config/import-map.contract';
2
+ import { type NodeLoaderClient, type HostInstanceKeys } from './adapters/node-loader.client';
3
3
  type NodeImportMapConfig = ImportMapConfig & {
4
4
  nodeLoader: NodeLoaderClient;
5
5
  setHostInstancesFn: (keys: HostInstanceKeys) => Promise<HostInstanceKeys>;
@@ -1,3 +1,3 @@
1
- import type { HostOptions } from '../../2.app/config/host.contract';
1
+ import type { HostOptions } from '../../core/2.app/config/host.contract';
2
2
  export declare const toUrl: (pathOrUrl: string) => string;
3
3
  export declare const normalizeHostRemoteEntry: (hostRemoteEntry: HostOptions["hostRemoteEntry"]) => HostOptions["hostRemoteEntry"];
@@ -1,5 +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';
1
+ export { initNodeFederation } from './node/init-federation.node';
2
+ export type { InitNodeFederationOptions, HostInstancesOption, HostInstancesAuto, } from './node/init-federation.node';
3
+ export { NFError } from './core/native-federation.error';
4
+ export type { LoadRemoteModule, LoadRemoteModuleOf, NativeFederationResult, } from './core/init-federation.contract';
5
+ export type { FederationManifest } from './core/1.domain/remote-entry/manifest.contract';
@@ -1,5 +1,5 @@
1
- export * from './2.app/config';
2
- export * from './4.config/logging';
3
- export * from './4.config/storage';
4
- export * from './4.config/import-map';
5
- export * from './4.config/mode';
1
+ export * from './core/2.app/config';
2
+ export * from './core/4.config/logging';
3
+ export * from './core/4.config/storage';
4
+ export * from './core/4.config/import-map';
5
+ export * from './core/4.config/mode';
@@ -0,0 +1,2 @@
1
+ import type { NFEventRegistry } from './event-registry.contract';
2
+ export type ForManagingEvents = () => NFEventRegistry;
@@ -0,0 +1,3 @@
1
+ import type { ForManagingEvents } from './for-managing-events.port';
2
+ import type { NFEventRegistryOptions } from './registry.contract';
3
+ export declare function createRegistry(opts: NFEventRegistryOptions): ForManagingEvents;
@@ -1,4 +1,5 @@
1
- export * from './1.domain/registry';
2
- export { NFEventRegistryConfig, NFEventRegistryOptions } from './2.app/config/registry.contract';
3
- export { ForManagingEvents } from './2.app/driver-ports/registry/for-managing-events.port';
4
- export { createRegistry } from './2.app/flows/registry/setup-registry';
1
+ export { NFEventRegistry } from './registry/event-registry.contract';
2
+ export { NFEventProvider, NFEventConsumer, NFEventErrorHandler, NFEventData, NFEventUnsubscribe, NFEventStream, } from './registry/event.contract';
3
+ export { NFEventRegistryConfig, NFEventRegistryOptions } from './registry/registry.contract';
4
+ export { ForManagingEvents } from './registry/for-managing-events.port';
5
+ export { createRegistry } from './registry/setup-registry';
@@ -1,8 +1,7 @@
1
- export * from './1.domain';
2
- export * from './2.app/driving-ports';
3
- export * from './2.app/driver-ports/init';
4
- export * from './2.app/driver-ports/dynamic-init';
5
- export { FLOW_FACTORY } from './2.app/driver-ports/flow-factory.contract';
1
+ export * from './core/1.domain';
2
+ export * from './core/2.app/driving-ports';
3
+ export * from './core/2.app/driver-ports/init';
4
+ export { FLOW_FACTORY } from './core/2.app/driver-ports/flow-factory.contract';
6
5
  export { Optional } from './utils/optional';
7
6
  export * as _path from './utils/path';
8
7
  export { cloneEntry } from './utils/clone-entry';
@@ -0,0 +1,3 @@
1
+ import type { Mocked } from 'vitest';
2
+ import type { LogHandler, LogType } from '../../core/2.app/config/log.contract';
3
+ export declare const createMockLogHandler: (level?: LogType) => Mocked<LogHandler>;
@@ -1,4 +1,4 @@
1
- import type { StorageEntryKey } from '../2.app/config/storage.contract';
1
+ import type { StorageEntryKey } from '../core/2.app/config/storage.contract';
2
2
  type CloneEntry = <T>(name: StorageEntryKey, raw: T) => T;
3
3
  declare const cloneEntry: CloneEntry;
4
4
  export { CloneEntry, cloneEntry };
@@ -1,4 +1,4 @@
1
- import type { NFEventRegistry } from './lib/1.domain/registry/event-registry.contract';
1
+ import type { NFEventRegistry } from '../lib/registry/event-registry.contract';
2
2
  declare global {
3
3
  interface Window {
4
4
  __NF_REGISTRY__: NFEventRegistry;
@@ -1,2 +0,0 @@
1
- export { NFEventRegistry } from './event-registry.contract';
2
- export { NFEventProvider, NFEventConsumer, NFEventErrorHandler } from './event.contract';
@@ -1 +0,0 @@
1
- export * from './for-auditing-externals.port';
@@ -1,13 +0,0 @@
1
- import type { ConfigContract } from '../../config';
2
- import type { ForConvertingToImportMap } from './for-converting-to-import-map';
3
- import type { ForGettingRemoteEntry } from './for-getting-remote-entry.port';
4
- import type { ForUpdatingCache } from './for-updating-cache';
5
- import type { DrivingContract } from '../../driving-ports/driving.contract';
6
- import type { ForCommittingChanges } from '../init';
7
- export type DynamicInitDriversContract = {
8
- getRemoteEntry: ForGettingRemoteEntry;
9
- updateCache: ForUpdatingCache;
10
- convertToImportMap: ForConvertingToImportMap;
11
- commitChanges: ForCommittingChanges;
12
- };
13
- export type DynamicInitDriversFactory = (config: ConfigContract, adapters: DrivingContract) => DynamicInitDriversContract;
@@ -1,8 +0,0 @@
1
- export type RemoteRef = string | {
2
- name?: string;
3
- integrity?: string;
4
- };
5
- export type DynamicInitResult<TFederationResult = {}> = TFederationResult & {
6
- initRemoteEntry: (remoteEntryUrl: string, remote?: RemoteRef) => Promise<DynamicInitResult<TFederationResult>>;
7
- };
8
- export type DynamicInitFlow = (remoteEntryUrl: string, remote?: RemoteRef) => Promise<DynamicInitResult>;
@@ -1,5 +0,0 @@
1
- export * from './drivers.contract';
2
- export * from './for-converting-to-import-map';
3
- export * from './for-getting-remote-entry.port';
4
- export * from './for-updating-cache';
5
- export * from './flow.contract';
@@ -1,6 +0,0 @@
1
- import type { FederationManifest } from '../../../1.domain';
2
- import type { LoadRemoteModule } from '../../../init-federation.contract';
3
- export type InitResult = {
4
- loadRemoteModule: LoadRemoteModule;
5
- };
6
- export type InitFlow = (remotesOrManifestUrl: string | FederationManifest) => Promise<InitResult>;
@@ -1,2 +0,0 @@
1
- import type { NFEventRegistry } from '../../../1.domain/registry/event-registry.contract';
2
- export type ForManagingEvents = () => NFEventRegistry;
@@ -1,4 +0,0 @@
1
- import type { LoggingConfig, ModeConfig } from '../../config';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { ForAuditingExternals } from '../../driver-ports/audit/for-auditing-externals.port';
4
- export declare function createExternalsAudit(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'versionCheck' | 'sharedExternalsRepo' | 'scopedExternalsRepo'>): ForAuditingExternals;
@@ -1,4 +0,0 @@
1
- import type { LoggingConfig } from '../../config/log.contract';
2
- import type { ForConvertingToImportMap } from '../../driver-ports/dynamic-init/for-converting-to-import-map';
3
- import type { DrivingContract } from '../../../sdk.index';
4
- export declare function createConvertToImportMap({ log }: LoggingConfig, ports: Pick<DrivingContract, 'sharedChunksRepo'>): ForConvertingToImportMap;
@@ -1,5 +0,0 @@
1
- import type { DrivingContract } from '../../driving-ports/driving.contract';
2
- import type { LoggingConfig } from '../../config/log.contract';
3
- import type { ModeConfig } from '../../config/mode.contract';
4
- import type { ForGettingRemoteEntry } from '../../driver-ports/dynamic-init/for-getting-remote-entry.port';
5
- export declare function createGetRemoteEntry(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteEntryProvider' | 'remoteInfoRepo' | 'sse'>): ForGettingRemoteEntry;
@@ -1,5 +0,0 @@
1
- import type { ForUpdatingCache } from '../../driver-ports/dynamic-init/for-updating-cache';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- import type { ModeConfig } from '../../config/mode.contract';
5
- export declare function createUpdateCache(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'sharedExternalsRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>): ForUpdatingCache;
@@ -1,4 +0,0 @@
1
- import type { DrivingContract } from '../../driving-ports/driving.contract';
2
- import type { ForCommittingChanges } from '../../driver-ports/init/for-committing-changes.port';
3
- import type { LoggingConfig } from '../../config';
4
- export declare function createCommitChanges(config: LoggingConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedExternalsRepo' | 'sharedChunksRepo' | 'browser'>): ForCommittingChanges;
@@ -1,5 +0,0 @@
1
- import type { ForDeterminingSharedExternals } from '../../driver-ports/init/for-determining-shared-externals.port';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- import type { ModeConfig } from '../../config/mode.contract';
5
- export declare function createDetermineSharedExternals(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'versionCheck' | 'sharedExternalsRepo'>): ForDeterminingSharedExternals;
@@ -1,4 +0,0 @@
1
- import type { DrivingContract } from '../../driving-ports/driving.contract';
2
- import type { ForExposingModuleLoader } from '../../driver-ports/init/for-exposing-module-loader.port';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- export declare function createExposeModuleLoader(config: LoggingConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'browser'>): ForExposingModuleLoader;
@@ -1,5 +0,0 @@
1
- import type { ForGeneratingImportMap } from '../../driver-ports/init/for-generating-import-map';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- import type { ModeConfig } from '../../config/mode.contract';
5
- export declare function createGenerateImportMap(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'sharedExternalsRepo'>): ForGeneratingImportMap;
@@ -1,6 +0,0 @@
1
- import type { ForGettingRemoteEntries } from '../../driver-ports/init/for-getting-remote-entries.port';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- import type { ModeConfig } from '../../config/mode.contract';
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;
@@ -1,5 +0,0 @@
1
- import type { ForProcessingRemoteEntries } from '../../driver-ports/init/for-processing-remote-entries.port';
2
- import type { DrivingContract } from '../../driving-ports/driving.contract';
3
- import type { LoggingConfig } from '../../config/log.contract';
4
- import type { ModeConfig } from '../../config/mode.contract';
5
- export declare function createProcessRemoteEntries(config: LoggingConfig & ModeConfig, ports: Pick<DrivingContract, 'remoteInfoRepo' | 'sharedExternalsRepo' | 'scopedExternalsRepo' | 'sharedChunksRepo' | 'versionCheck'>): ForProcessingRemoteEntries;
@@ -1,3 +0,0 @@
1
- import type { ForManagingEvents } from '../../driver-ports/registry/for-managing-events.port';
2
- import type { NFEventRegistryOptions } from '../../config/registry.contract';
3
- export declare function createRegistry(opts: NFEventRegistryOptions): ForManagingEvents;
@@ -1,3 +0,0 @@
1
- import type { ForSSE } from '../../2.app/driving-ports/for-sse.port';
2
- declare const createNoopSSE: () => ForSSE;
3
- export { createNoopSSE };
@@ -1,14 +0,0 @@
1
- import type { DynamicInitFlow } from '../../2.app/driver-ports/dynamic-init/flow.contract';
2
- import type { FLOW_FACTORY } from '../../2.app/driver-ports/flow-factory.contract';
3
- import type { DynamicInitDriversContract } from '../../audit.index';
4
- import type { DrivingContract } from '../../2.app/driving-ports/driving.contract';
5
- import type { ConfigContract } from '../../2.app/config/config.contract';
6
- export declare const createDynamicInitDrivers: ({ config, adapters, }: {
7
- config: ConfigContract;
8
- adapters: DrivingContract;
9
- }) => DynamicInitDriversContract;
10
- export declare const DYNAMIC_INIT_FLOW_FACTORY: ({ config, adapters, }: {
11
- config: ConfigContract;
12
- adapters: DrivingContract;
13
- }) => FLOW_FACTORY<DynamicInitDriversContract>;
14
- export declare const createDynamicInitFlow: ({ flow, adapters, config, }: FLOW_FACTORY<DynamicInitDriversContract>) => DynamicInitFlow;
@@ -1,14 +0,0 @@
1
- import type { FLOW_FACTORY } from '../../2.app/driver-ports/flow-factory.contract';
2
- import type { InitDriversContract } from '../../2.app/driver-ports/init/drivers.contract';
3
- import type { InitFlow } from '../../2.app/driver-ports/init/flow.contract';
4
- import type { DrivingContract } from '../../2.app/driving-ports/driving.contract';
5
- import type { ConfigContract } from '../../2.app/config/config.contract';
6
- export declare const createInitDrivers: ({ config, adapters, }: {
7
- config: ConfigContract;
8
- adapters: DrivingContract;
9
- }) => InitDriversContract;
10
- export declare const INIT_FLOW_FACTORY: ({ config, adapters, }: {
11
- config: ConfigContract;
12
- adapters: DrivingContract;
13
- }) => FLOW_FACTORY<InitDriversContract>;
14
- export declare const createInitFlow: ({ flow, adapters, config, }: FLOW_FACTORY<InitDriversContract>) => InitFlow;
@@ -1,2 +0,0 @@
1
- import type { LogHandler, LogType } from '../../2.app/config/log.contract';
2
- export declare const createMockLogHandler: (level?: LogType) => jest.Mocked<LogHandler>;