@module-federation/enhanced 2.0.1 → 2.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.
Files changed (285) hide show
  1. package/dist/CHANGELOG.md +2357 -0
  2. package/dist/README.md +213 -0
  3. package/dist/rstestmigrate.md +140 -0
  4. package/dist/src/_virtual/_rolldown/runtime.js +47 -0
  5. package/dist/src/index.d.ts +22 -19
  6. package/dist/src/index.js +47 -43
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/lib/Constants.d.ts +25 -29
  9. package/dist/src/lib/Constants.js +136 -116
  10. package/dist/src/lib/Constants.js.map +1 -1
  11. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -16
  12. package/dist/src/lib/container/AsyncBoundaryPlugin.js +137 -196
  13. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
  14. package/dist/src/lib/container/ContainerEntryDependency.d.ts +28 -23
  15. package/dist/src/lib/container/ContainerEntryDependency.js +39 -39
  16. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  17. package/dist/src/lib/container/ContainerEntryModule.d.ts +93 -84
  18. package/dist/src/lib/container/ContainerEntryModule.js +219 -234
  19. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
  20. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -10
  21. package/dist/src/lib/container/ContainerEntryModuleFactory.js +21 -25
  22. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
  23. package/dist/src/lib/container/ContainerExposedDependency.d.ts +29 -24
  24. package/dist/src/lib/container/ContainerExposedDependency.js +47 -47
  25. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -1
  26. package/dist/src/lib/container/ContainerPlugin.d.ts +12 -8
  27. package/dist/src/lib/container/ContainerPlugin.js +147 -211
  28. package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
  29. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +16 -12
  30. package/dist/src/lib/container/ContainerReferencePlugin.js +74 -102
  31. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
  32. package/dist/src/lib/container/FallbackDependency.d.ts +24 -19
  33. package/dist/src/lib/container/FallbackDependency.js +46 -44
  34. package/dist/src/lib/container/FallbackDependency.js.map +1 -1
  35. package/dist/src/lib/container/FallbackItemDependency.d.ts +13 -8
  36. package/dist/src/lib/container/FallbackItemDependency.js +24 -24
  37. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -1
  38. package/dist/src/lib/container/FallbackModule.d.ts +82 -71
  39. package/dist/src/lib/container/FallbackModule.js +133 -145
  40. package/dist/src/lib/container/FallbackModule.js.map +1 -1
  41. package/dist/src/lib/container/FallbackModuleFactory.d.ts +15 -10
  42. package/dist/src/lib/container/FallbackModuleFactory.js +20 -24
  43. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -1
  44. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +11 -7
  45. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +125 -188
  46. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
  47. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +20 -16
  48. package/dist/src/lib/container/ModuleFederationPlugin.js +143 -180
  49. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  50. package/dist/src/lib/container/RemoteModule.d.ts +79 -74
  51. package/dist/src/lib/container/RemoteModule.js +143 -153
  52. package/dist/src/lib/container/RemoteModule.js.map +1 -1
  53. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -7
  54. package/dist/src/lib/container/RemoteRuntimeModule.js +86 -120
  55. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
  56. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +13 -8
  57. package/dist/src/lib/container/RemoteToExternalDependency.js +25 -23
  58. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -1
  59. package/dist/src/lib/container/constant.d.ts +3 -0
  60. package/dist/src/lib/container/constant.js +11 -14
  61. package/dist/src/lib/container/constant.js.map +1 -1
  62. package/dist/src/lib/container/options.d.ts +7 -3
  63. package/dist/src/lib/container/options.js +51 -69
  64. package/dist/src/lib/container/options.js.map +1 -1
  65. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.d.ts +14 -9
  66. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js +56 -64
  67. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js.map +1 -1
  68. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.d.ts +23 -19
  69. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js +71 -101
  70. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js.map +1 -1
  71. package/dist/src/lib/container/runtime/FederationModulesPlugin.d.ts +20 -16
  72. package/dist/src/lib/container/runtime/FederationModulesPlugin.js +55 -47
  73. package/dist/src/lib/container/runtime/FederationModulesPlugin.js.map +1 -1
  74. package/dist/src/lib/container/runtime/FederationRuntimeDependency.d.ts +9 -4
  75. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js +16 -12
  76. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js.map +1 -1
  77. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +16 -11
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +39 -46
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -1
  80. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +31 -18
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +266 -345
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
  83. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +9 -4
  84. package/dist/src/lib/container/runtime/getFederationGlobal.js +43 -41
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -1
  86. package/dist/src/lib/container/runtime/utils.d.ts +24 -13
  87. package/dist/src/lib/container/runtime/utils.js +83 -101
  88. package/dist/src/lib/container/runtime/utils.js.map +1 -1
  89. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
  90. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
  91. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
  92. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -68
  93. package/dist/src/lib/sharing/ConsumeSharedModule.js +186 -214
  94. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  95. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
  96. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -475
  97. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  98. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
  99. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +107 -125
  100. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  101. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
  102. package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
  103. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
  104. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -39
  105. package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -76
  106. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  107. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -82
  108. package/dist/src/lib/sharing/ProvideSharedModule.js +177 -184
  109. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  110. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
  111. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
  112. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  113. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
  114. package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -550
  115. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  116. package/dist/src/lib/sharing/SharePlugin.d.ts +53 -49
  117. package/dist/src/lib/sharing/SharePlugin.js +86 -100
  118. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  119. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  120. package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -100
  121. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  122. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
  123. package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
  124. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
  125. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +18 -14
  126. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +74 -128
  127. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -1
  128. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +39 -34
  129. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +234 -322
  130. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -1
  131. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +16 -11
  132. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +30 -28
  133. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -1
  134. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +28 -24
  135. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +91 -95
  136. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -1
  137. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +29 -24
  138. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +47 -43
  139. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -1
  140. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +20 -15
  141. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +33 -29
  142. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -1
  143. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +85 -77
  144. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +141 -153
  145. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -1
  146. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +15 -10
  147. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +20 -24
  148. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -1
  149. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +21 -16
  150. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +157 -231
  151. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -1
  152. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +14 -9
  153. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +26 -27
  154. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -1
  155. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +18 -13
  156. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +41 -49
  157. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -1
  158. package/dist/src/lib/sharing/utils.d.ts +27 -24
  159. package/dist/src/lib/sharing/utils.js +224 -367
  160. package/dist/src/lib/sharing/utils.js.map +1 -1
  161. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
  162. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
  163. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
  164. package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
  165. package/dist/src/lib/startup/StartupHelpers.js +128 -178
  166. package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
  167. package/dist/src/prefetch.d.ts +3 -2
  168. package/dist/src/prefetch.js +17 -8
  169. package/dist/src/rspack.d.ts +3 -2
  170. package/dist/src/rspack.js +35 -11
  171. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
  172. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
  173. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
  174. package/dist/src/runtime.d.ts +1 -1
  175. package/dist/src/runtime.js +11 -18
  176. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
  177. package/dist/src/schemas/container/ContainerPlugin.check.js +958 -1218
  178. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
  179. package/dist/src/schemas/container/ContainerPlugin.d.ts +271 -268
  180. package/dist/src/schemas/container/ContainerPlugin.js +273 -361
  181. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
  182. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
  183. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
  184. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
  185. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
  186. package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
  187. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
  188. package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
  189. package/dist/src/schemas/container/ExternalsType.check.js +36 -62
  190. package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
  191. package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
  192. package/dist/src/schemas/container/ExternalsType.js +8 -11
  193. package/dist/src/schemas/container/ExternalsType.js.map +1 -1
  194. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3001 -4812
  195. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  196. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +819 -814
  197. package/dist/src/schemas/container/ModuleFederationPlugin.js +780 -1053
  198. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  199. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
  200. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -768
  201. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
  202. package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -194
  203. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -238
  204. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
  205. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
  206. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -804
  207. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
  208. package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -181
  209. package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -229
  210. package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
  211. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
  212. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
  213. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
  214. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
  215. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
  216. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
  217. package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
  218. package/dist/src/schemas/sharing/SharePlugin.check.js +749 -965
  219. package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
  220. package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -242
  221. package/dist/src/schemas/sharing/SharePlugin.js +256 -293
  222. package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
  223. package/dist/src/utils.d.ts +3 -0
  224. package/dist/src/utils.js +35 -26
  225. package/dist/src/utils.js.map +1 -1
  226. package/dist/src/webpack.d.ts +2 -2
  227. package/dist/src/webpack.js +6 -40
  228. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -4
  229. package/dist/src/wrapper/AsyncBoundaryPlugin.js +12 -11
  230. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
  231. package/dist/src/wrapper/BaseWrapperPlugin.d.ts +18 -13
  232. package/dist/src/wrapper/BaseWrapperPlugin.js +39 -39
  233. package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -1
  234. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -4
  235. package/dist/src/wrapper/ConsumeSharedPlugin.js +12 -11
  236. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
  237. package/dist/src/wrapper/ContainerPlugin.d.ts +9 -4
  238. package/dist/src/wrapper/ContainerPlugin.js +12 -11
  239. package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
  240. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -4
  241. package/dist/src/wrapper/ContainerReferencePlugin.js +12 -11
  242. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
  243. package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
  244. package/dist/src/wrapper/FederationModulesPlugin.js +19 -19
  245. package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
  246. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -6
  247. package/dist/src/wrapper/FederationRuntimePlugin.js +18 -17
  248. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
  249. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -3
  250. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +12 -11
  251. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
  252. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -7
  253. package/dist/src/wrapper/ModuleFederationPlugin.js +73 -99
  254. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
  255. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -4
  256. package/dist/src/wrapper/ProvideSharedPlugin.js +12 -11
  257. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
  258. package/dist/src/wrapper/SharePlugin.d.ts +10 -4
  259. package/dist/src/wrapper/SharePlugin.js +12 -11
  260. package/dist/src/wrapper/SharePlugin.js.map +1 -1
  261. package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +9 -4
  262. package/dist/src/wrapper/TreeShakingSharedPlugin.js +12 -11
  263. package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -1
  264. package/package.json +21 -14
  265. package/dist/package.json +0 -110
  266. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
  267. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
  268. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
  269. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
  270. package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
  271. package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
  272. package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -86
  273. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -100
  274. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -102
  275. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -116
  276. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
  277. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
  278. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
  279. package/dist/src/prefetch.js.map +0 -1
  280. package/dist/src/rspack.js.map +0 -1
  281. package/dist/src/runtime.js.map +0 -1
  282. package/dist/src/types/runtime.d.ts +0 -10
  283. package/dist/src/types/runtime.js +0 -3
  284. package/dist/src/types/runtime.js.map +0 -1
  285. package/dist/src/webpack.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FederationRuntimePlugin.js","sourceRoot":"","sources":["../../../../../src/lib/container/runtime/FederationRuntimePlugin.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,gDAAyB;AAOzB,0FAAqF;AACrF,8DAAsE;AAEtE,wFAAgE;AAChE,mCAKiB;AACjB,0CAAuC;AACvC,kGAA0E;AAC1E,wFAAgE;AAChE,uGAAyE;AACzE,gGAAwE;AAExE,MAAM,gBAAgB,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,2CAA2C,CAAC,CACJ,CAAC;AAEhE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,OAAO,CAC1C,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAC5B,IAAA,6CAAoB,EAAC,qBAAqB,CAAC,CACJ,CAAC;AAE1C,SAAS,aAAa,CACpB,UAAoB,EACpB,OAAsC;IAEtC,IAAI,SAAkB,CAAC;IACvB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QAAC,O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AAQ,CAAC,CAAC;QAEnD,IAAI,wCAAwB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/C,2CAA2C;QAC3C,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAC5B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC7B,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YAC/B,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAED,kBAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"FederationRuntimePlugin.js","names":["getFederationGlobalScope","normalizeToPosixPath","PrefetchPlugin","createHash","TEMP_DIR","FederationRuntimeDependency","FederationModulesPlugin","normalizeRuntimeInitOptionsWithOutShared","FederationRuntimeModule","EmbedFederationRuntimePlugin","HoistContainerReferences"],"sources":["../../../../../src/lib/container/runtime/FederationRuntimePlugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport pBtoa from 'btoa';\nimport type {\n Compiler,\n WebpackPluginInstance,\n Compilation,\n Chunk,\n} from 'webpack';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport { PrefetchPlugin } from '@module-federation/data-prefetch/cli';\nimport { moduleFederationPlugin } from '@module-federation/sdk';\nimport FederationRuntimeModule from './FederationRuntimeModule';\nimport {\n getFederationGlobalScope,\n normalizeRuntimeInitOptionsWithOutShared,\n createHash,\n normalizeToPosixPath,\n} from './utils';\nimport { TEMP_DIR } from '../constant';\nimport EmbedFederationRuntimePlugin from './EmbedFederationRuntimePlugin';\nimport FederationModulesPlugin from './FederationModulesPlugin';\nimport HoistContainerReferences from '../HoistContainerReferencesPlugin';\nimport FederationRuntimeDependency from './FederationRuntimeDependency';\n\nconst ModuleDependency = require(\n normalizeWebpackPath('webpack/lib/dependencies/ModuleDependency'),\n) as typeof import('webpack/lib/dependencies/ModuleDependency');\n\nconst { RuntimeGlobals, Template } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst { mkdirpSync } = require(\n normalizeWebpackPath('webpack/lib/util/fs'),\n) as typeof import('webpack/lib/util/fs');\n\ntype ResolveFn = typeof require.resolve;\ntype RuntimeEntrySpec = {\n bundler: string;\n esm: string;\n cjs: string;\n};\n\nfunction resolveRuntimeEntry(\n spec: RuntimeEntrySpec,\n implementation: string | undefined,\n resolve: ResolveFn = require.resolve,\n) {\n const candidates = [spec.bundler, spec.esm, spec.cjs];\n const modulePaths = implementation ? [implementation] : undefined;\n let lastError: unknown;\n\n for (const candidate of candidates) {\n try {\n return modulePaths\n ? resolve(candidate, { paths: modulePaths })\n : resolve(candidate);\n } catch (error) {\n lastError = error;\n }\n }\n\n throw lastError;\n}\n\nfunction resolveRuntimeEntryWithFallback(\n spec: RuntimeEntrySpec,\n implementation: string | undefined,\n resolve: ResolveFn = require.resolve,\n) {\n if (implementation) {\n try {\n return resolveRuntimeEntry(spec, implementation, resolve);\n } catch {\n // Fall back to the workspace runtime packages when a custom\n // implementation hasn't published the newer subpath yet.\n }\n }\n\n return resolveRuntimeEntry(spec, undefined, resolve);\n}\nexport function resolveRuntimePaths(\n implementation?: string,\n resolve: ResolveFn = require.resolve,\n) {\n // Prefer the dedicated bundler subpath so webpack can tree-shake across the\n // runtime package boundary. Fall back to the legacy dist contract for older\n // custom implementations that have not published /bundler yet.\n const runtimeToolsPath = resolveRuntimeEntryWithFallback(\n {\n bundler: '@module-federation/runtime-tools/bundler',\n esm: '@module-federation/runtime-tools/dist/index.js',\n cjs: '@module-federation/runtime-tools/dist/index.cjs',\n },\n implementation,\n resolve,\n );\n const moduleBase = implementation || runtimeToolsPath;\n\n return {\n runtimeToolsPath,\n bundlerRuntimePath: resolveRuntimeEntry(\n {\n bundler: '@module-federation/webpack-bundler-runtime/bundler',\n esm: '@module-federation/webpack-bundler-runtime/dist/index.js',\n cjs: '@module-federation/webpack-bundler-runtime/dist/index.cjs',\n },\n moduleBase,\n resolve,\n ),\n runtimePath: resolveRuntimeEntry(\n {\n bundler: '@module-federation/runtime/bundler',\n esm: '@module-federation/runtime/dist/index.js',\n cjs: '@module-federation/runtime/dist/index.cjs',\n },\n moduleBase,\n resolve,\n ),\n };\n}\n\nconst {\n runtimeToolsPath: RuntimeToolsPath,\n bundlerRuntimePath: BundlerRuntimePath,\n runtimePath: RuntimePath,\n} = resolveRuntimePaths();\nconst federationGlobal = getFederationGlobalScope(RuntimeGlobals);\n\nconst onceForCompiler = new WeakSet<Compiler>();\nconst onceForCompilerEntryMap = new WeakMap<Compiler, string>();\n\nclass FederationRuntimePlugin {\n options?: moduleFederationPlugin.ModuleFederationPluginOptions;\n entryFilePath: string;\n bundlerRuntimePath: string;\n runtimePath: string;\n runtimeToolsPath: string;\n federationRuntimeDependency?: FederationRuntimeDependency; // Add this line\n\n constructor(options?: moduleFederationPlugin.ModuleFederationPluginOptions) {\n this.options = options ? { ...options } : undefined;\n this.entryFilePath = '';\n this.bundlerRuntimePath = BundlerRuntimePath;\n this.runtimePath = RuntimePath;\n this.runtimeToolsPath = RuntimeToolsPath;\n this.federationRuntimeDependency = undefined; // Initialize as undefined\n }\n\n static getTemplate(\n compiler: Compiler,\n options: moduleFederationPlugin.ModuleFederationPluginOptions,\n bundlerRuntimePath?: string,\n ) {\n // internal runtime plugin\n const runtimePlugins = options.runtimePlugins;\n const normalizedBundlerRuntimePath = normalizeToPosixPath(\n bundlerRuntimePath || BundlerRuntimePath,\n );\n\n let runtimePluginTemplates = '';\n const runtimePluginCalls: string[] = [];\n\n if (Array.isArray(runtimePlugins)) {\n runtimePlugins.forEach((runtimePlugin, index) => {\n if (!runtimePlugin) {\n return;\n }\n const runtimePluginName = `plugin_${index}`;\n const runtimePluginEntry = Array.isArray(runtimePlugin)\n ? runtimePlugin[0]\n : runtimePlugin;\n const runtimePluginPath = normalizeToPosixPath(\n path.isAbsolute(runtimePluginEntry)\n ? runtimePluginEntry\n : path.join(process.cwd(), runtimePluginEntry),\n );\n const paramsStr =\n Array.isArray(runtimePlugin) && runtimePlugin.length > 1\n ? JSON.stringify(runtimePlugin[1])\n : 'undefined';\n runtimePluginTemplates += `import ${runtimePluginName} from '${runtimePluginPath}';\\n`;\n runtimePluginCalls.push(\n `${runtimePluginName} ? (${runtimePluginName}.default || ${runtimePluginName})(${paramsStr}) : false`,\n );\n });\n }\n const embedRuntimeLines = Template.asString([\n `if(!${federationGlobal}.runtime || !${federationGlobal}.bundlerRuntime){`,\n Template.indent([\n `var prevFederation = ${federationGlobal};`,\n `${federationGlobal} = {}`,\n `for(var key in federation){`,\n Template.indent([`${federationGlobal}[key] = federation[key];`]),\n '}',\n `for(var key in prevFederation){`,\n Template.indent([`${federationGlobal}[key] = prevFederation[key];`]),\n '}',\n ]),\n '}',\n ]);\n\n return Template.asString([\n `import federation from '${normalizedBundlerRuntimePath}';`,\n runtimePluginTemplates,\n embedRuntimeLines,\n `if(!${federationGlobal}.instance){`,\n Template.indent([\n runtimePluginCalls.length\n ? Template.asString([\n `var pluginsToAdd = [`,\n Template.indent(\n Template.indent(runtimePluginCalls.map((call) => `${call},`)),\n ),\n `].filter(Boolean);`,\n `${federationGlobal}.initOptions.plugins = ${federationGlobal}.initOptions.plugins ? `,\n `${federationGlobal}.initOptions.plugins.concat(pluginsToAdd) : pluginsToAdd;`,\n ])\n : '',\n // `${federationGlobal}.instance = ${federationGlobal}.runtime.init(${federationGlobal}.initOptions);`,\n `${federationGlobal}.instance = ${federationGlobal}.bundlerRuntime.init({webpackRequire:${RuntimeGlobals.require}});`,\n `if(${federationGlobal}.attachShareScopeMap){`,\n Template.indent([\n `${federationGlobal}.attachShareScopeMap(${RuntimeGlobals.require})`,\n ]),\n '}',\n `if(${federationGlobal}.installInitialConsumes){`,\n Template.indent([`${federationGlobal}.installInitialConsumes()`]),\n '}',\n ]),\n PrefetchPlugin.addRuntime(compiler, {\n name: options.name!,\n }),\n '}',\n ]);\n }\n\n getFilePath(compiler: Compiler) {\n if (!this.options) {\n return '';\n }\n\n const existedFilePath = onceForCompilerEntryMap.get(compiler);\n\n if (existedFilePath) {\n return existedFilePath;\n }\n\n let entryFilePath = '';\n if (!this.options?.virtualRuntimeEntry) {\n const containerName = this.options.name;\n const hash = createHash(\n `${containerName} ${FederationRuntimePlugin.getTemplate(\n compiler,\n this.options,\n this.bundlerRuntimePath,\n )}`,\n );\n entryFilePath = path.join(TEMP_DIR, `entry.${hash}.js`);\n } else {\n entryFilePath = `data:text/javascript;charset=utf-8;base64,${pBtoa(\n FederationRuntimePlugin.getTemplate(\n compiler,\n this.options,\n this.bundlerRuntimePath,\n ),\n )}`;\n }\n\n onceForCompilerEntryMap.set(compiler, entryFilePath);\n\n return entryFilePath;\n }\n\n ensureFile(compiler: Compiler) {\n if (!this.options) {\n return;\n }\n // skip virtual entry\n if (this.options?.virtualRuntimeEntry) {\n return;\n }\n const filePath = this.entryFilePath;\n const outputFs = (compiler as unknown as { outputFileSystem?: unknown })\n .outputFileSystem;\n const fsLike =\n outputFs &&\n typeof (outputFs as typeof fs).readFileSync === 'function' &&\n typeof (outputFs as typeof fs).writeFileSync === 'function'\n ? (outputFs as typeof fs)\n : fs;\n try {\n fsLike.readFileSync(filePath);\n } catch {\n mkdirpSync(fsLike as any, TEMP_DIR);\n fsLike.writeFileSync(\n filePath,\n FederationRuntimePlugin.getTemplate(\n compiler,\n this.options,\n this.bundlerRuntimePath,\n ),\n );\n }\n }\n\n getDependency(compiler: Compiler) {\n if (this.federationRuntimeDependency)\n return this.federationRuntimeDependency;\n\n this.ensureFile(compiler);\n\n this.federationRuntimeDependency = new FederationRuntimeDependency(\n this.entryFilePath,\n );\n return this.federationRuntimeDependency;\n }\n\n prependEntry(compiler: Compiler) {\n if (!this.options?.virtualRuntimeEntry) {\n this.ensureFile(compiler);\n }\n\n compiler.hooks.thisCompilation.tap(\n this.constructor.name,\n (compilation: Compilation, { normalModuleFactory }) => {\n compilation.dependencyFactories.set(\n FederationRuntimeDependency,\n normalModuleFactory,\n );\n compilation.dependencyTemplates.set(\n FederationRuntimeDependency,\n new ModuleDependency.Template(),\n );\n },\n );\n compiler.hooks.make.tapAsync(\n this.constructor.name,\n (compilation: Compilation, callback) => {\n const federationRuntimeDependency = this.getDependency(compiler);\n const hooks = FederationModulesPlugin.getCompilationHooks(compilation);\n compilation.addInclude(\n compiler.context,\n federationRuntimeDependency,\n { name: undefined },\n (err) => {\n if (err) {\n return callback(err);\n }\n hooks.addFederationRuntimeDependency.call(\n federationRuntimeDependency,\n );\n callback();\n },\n );\n },\n );\n }\n\n injectRuntime(compiler: Compiler) {\n if (!this.options || !this.options.name) {\n return;\n }\n const name = this.options.name;\n const initOptionsWithoutShared = normalizeRuntimeInitOptionsWithOutShared(\n this.options,\n );\n const federationGlobal = getFederationGlobalScope(\n RuntimeGlobals || ({} as typeof RuntimeGlobals),\n );\n\n compiler.hooks.thisCompilation.tap(\n this.constructor.name,\n (compilation: Compilation) => {\n const handler = (chunk: Chunk, runtimeRequirements: Set<string>) => {\n if (runtimeRequirements.has(federationGlobal)) return;\n runtimeRequirements.add(federationGlobal);\n runtimeRequirements.add(RuntimeGlobals.interceptModuleExecution);\n runtimeRequirements.add(RuntimeGlobals.moduleCache);\n runtimeRequirements.add(RuntimeGlobals.compatGetDefaultExport);\n\n compilation.addRuntimeModule(\n chunk,\n new FederationRuntimeModule(\n runtimeRequirements,\n name,\n initOptionsWithoutShared,\n ),\n );\n };\n\n compilation.hooks.additionalTreeRuntimeRequirements.tap(\n this.constructor.name,\n (chunk: Chunk, runtimeRequirements: Set<string>) => {\n if (!chunk.hasRuntime()) return;\n if (runtimeRequirements.has(RuntimeGlobals.initializeSharing))\n return;\n if (runtimeRequirements.has(RuntimeGlobals.currentRemoteGetScope))\n return;\n if (runtimeRequirements.has(RuntimeGlobals.shareScopeMap)) return;\n if (runtimeRequirements.has(federationGlobal)) return;\n handler(chunk, runtimeRequirements);\n },\n );\n\n // if federation runtime requirements exist\n // attach runtime module to the chunk\n compilation.hooks.runtimeRequirementInTree\n .for(RuntimeGlobals.initializeSharing)\n .tap(this.constructor.name, handler);\n compilation.hooks.runtimeRequirementInTree\n .for(RuntimeGlobals.currentRemoteGetScope)\n .tap(this.constructor.name, handler);\n compilation.hooks.runtimeRequirementInTree\n .for(RuntimeGlobals.shareScopeMap)\n .tap(this.constructor.name, handler);\n compilation.hooks.runtimeRequirementInTree\n .for(federationGlobal)\n .tap(this.constructor.name, handler);\n },\n );\n }\n\n getRuntimeAlias(compiler: Compiler) {\n const { implementation } = this.options || {};\n const alias: any = compiler.options.resolve.alias || {};\n\n const resolvedPaths = resolveRuntimePaths(implementation);\n\n this.runtimeToolsPath = resolvedPaths.runtimeToolsPath;\n this.bundlerRuntimePath = resolvedPaths.bundlerRuntimePath;\n\n if (alias['@module-federation/runtime$']) {\n this.runtimePath = alias['@module-federation/runtime$'];\n return this.runtimePath;\n }\n\n this.runtimePath = resolvedPaths.runtimePath;\n\n return this.runtimePath;\n }\n\n setRuntimeAlias(compiler: Compiler) {\n const { implementation } = this.options || {};\n const alias: any = compiler.options.resolve.alias || {};\n const runtimePath = this.getRuntimeAlias(compiler);\n alias['@module-federation/runtime$'] =\n alias['@module-federation/runtime$'] || runtimePath;\n alias['@module-federation/runtime-tools$'] =\n alias['@module-federation/runtime-tools$'] ||\n implementation ||\n this.runtimeToolsPath;\n\n // Set up aliases for the federation runtime and tools\n // This ensures that the correct versions are used throughout the project\n compiler.options.resolve.alias = alias;\n }\n\n apply(compiler: Compiler) {\n const useSharedContainerPlugin = compiler.options.plugins.find(\n (p): p is WebpackPluginInstance & { _options?: any } => {\n if (typeof p !== 'object' || !p) {\n return false;\n }\n return p['name'] === 'SharedContainerPlugin';\n },\n );\n // share container plugin should not inject mf runtime\n if (useSharedContainerPlugin) {\n return;\n }\n const useModuleFederationPlugin = compiler.options.plugins.find(\n (p): p is WebpackPluginInstance & { _options?: any } => {\n if (typeof p !== 'object' || !p) {\n return false;\n }\n return p['name'] === 'ModuleFederationPlugin';\n },\n );\n\n if (useModuleFederationPlugin && !this.options) {\n this.options = useModuleFederationPlugin._options;\n }\n\n const useContainerPlugin = compiler.options.plugins.find(\n (p): p is WebpackPluginInstance & { _options?: any } => {\n if (typeof p !== 'object' || !p) {\n return false;\n }\n\n return p['name'] === 'ContainerPlugin';\n },\n );\n\n if (useContainerPlugin && !this.options) {\n this.options = useContainerPlugin._options;\n }\n\n if (!useContainerPlugin && !useModuleFederationPlugin) {\n this.options = {\n remotes: {},\n ...this.options,\n };\n }\n if (this.options && !this.options?.name) {\n //! the instance may get the same one if the name is the same https://github.com/module-federation/core/blob/main/packages/runtime/src/index.ts#L18\n this.options.name =\n compiler.options.output.uniqueName || `container_${Date.now()}`;\n }\n\n const resolvedPaths = resolveRuntimePaths(this.options?.implementation);\n this.bundlerRuntimePath = resolvedPaths.bundlerRuntimePath;\n this.runtimePath = resolvedPaths.runtimePath;\n this.runtimeToolsPath = resolvedPaths.runtimeToolsPath;\n\n this.entryFilePath = this.getFilePath(compiler);\n\n new EmbedFederationRuntimePlugin().apply(compiler);\n\n new HoistContainerReferences().apply(compiler);\n\n // dont run multiple times on every apply()\n if (!onceForCompiler.has(compiler)) {\n this.prependEntry(compiler);\n this.injectRuntime(compiler);\n this.setRuntimeAlias(compiler);\n onceForCompiler.add(compiler);\n }\n }\n}\n\nexport default FederationRuntimePlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;oFAqBgE;AAIhE,MAAM,mBAAmB,gFACF,4CAA4C,CAClE;AAED,MAAM,EAAE,gBAAgB,aAAa,gFACd,UAAU,CAChC;AACD,MAAM,EAAE,eAAe,gFACA,sBAAsB,CAC5C;AASD,SAAS,oBACP,MACA,gBACA,UAAqB,QAAQ,SAC7B;CACA,MAAM,aAAa;EAAC,KAAK;EAAS,KAAK;EAAK,KAAK;EAAI;CACrD,MAAM,cAAc,iBAAiB,CAAC,eAAe,GAAG;CACxD,IAA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,MAAK,UAAU,0BAA0B;EAG3C,MAAM,qBAAqB,SAAS,QAAQ,QAAQ,MACjD,MAAuD;AACtD,OAAI,OAAO,MAAM,YAAY,CAAC,EAC5B,QAAO;AAGT,UAAO,EAAE,YAAY;IAExB;AAED,MAAI,sBAAsB,CAAC,KAAK,QAC9B,MAAK,UAAU,mBAAmB;AAGpC,MAAI,CAAC,sBAAsB,CAAC,0BAC1B,MAAK,UAAU;GACb,SAAS,EAAE;GACX,GAAG,KAAK;GACT;AAEH,MAAI,KAAK,WAAW,CAAC,KAAK,SAAS;;AAEjC,OAAK,QAAQ,OACX,SAAS,QAAQ,OAAO,cAAc,aAAa,KAAK,KAAK;EAGjE,MAAM,gBAAgB,oBAAoB,KAAK,SAAS,eAAe;AACvE,OAAK,qBAAqB,cAAc;AACxC,OAAK,cAAc,cAAc;AACjC,OAAK,mBAAmB,cAAc;AAEtC,OAAK,gBAAgB,KAAK,YAAY,SAAS;AAE/C,MAAIC,oEAA8B,CAAC,MAAM,SAAS;AAElD,MAAIC,8DAA0B,CAAC,MAAM,SAAS;AAG9C,MAAI,CAAC,gBAAgB,IAAI,SAAS,EAAE;AAClC,QAAK,aAAa,SAAS;AAC3B,QAAK,cAAc,SAAS;AAC5B,QAAK,gBAAgB,SAAS;AAC9B,mBAAgB,IAAI,SAAS"}
@@ -1,5 +1,10 @@
1
- import type RuntimeGlobals from 'webpack/lib/RuntimeGlobals';
2
- import { NormalizedRuntimeInitOptionsWithOutShared } from '../../../types/runtime';
3
- declare const Template: typeof import("webpack").Template;
1
+ import { NormalizedRuntimeInitOptionsWithOutShared } from "./utils.js";
2
+ import * as webpack$1 from "webpack";
3
+ import RuntimeGlobals from "webpack/lib/RuntimeGlobals";
4
+
5
+ //#region src/lib/container/runtime/getFederationGlobal.d.ts
6
+ declare const Template: typeof webpack$1.Template;
4
7
  declare function getFederationGlobal(template: typeof Template, runtimeGlobals: typeof RuntimeGlobals, matcher: string | boolean, rootOutputDir: string | undefined, initOptionsWithoutShared: NormalizedRuntimeInitOptionsWithOutShared): string;
5
- export default getFederationGlobal;
8
+ //#endregion
9
+ export { getFederationGlobal as default };
10
+ //# sourceMappingURL=getFederationGlobal.d.ts.map
@@ -1,45 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
4
- const utils_1 = require("./utils");
5
- const { Template } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
3
+ const require_lib_container_runtime_utils = require('./utils.js');
4
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
5
+
6
+ //#region src/lib/container/runtime/getFederationGlobal.ts
7
+ const { Template } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
6
8
  function getFederationGlobal(template, runtimeGlobals, matcher, rootOutputDir, initOptionsWithoutShared) {
7
- const federationGlobal = (0, utils_1.getFederationGlobalScope)(runtimeGlobals);
8
- const initOptionsStrWithoutShared = JSON.stringify({
9
- ...initOptionsWithoutShared,
10
- remotes: initOptionsWithoutShared.remotes.filter((remote) => remote.externalType === 'script'),
11
- });
12
- const remoteInfos = JSON.stringify(initOptionsWithoutShared.remotes.reduce((acc, remote) => {
13
- const item = {
14
- alias: remote.alias || '',
15
- name: remote.name,
16
- // @ts-ignore
17
- entry: remote.entry || '',
18
- // @ts-ignore
19
- shareScope: remote.shareScope,
20
- externalType: remote.externalType,
21
- };
22
- const key = remote.name || remote.alias || '';
23
- acc[key] ||= [];
24
- acc[key].push(item);
25
- return acc;
26
- }, {}));
27
- return template.asString([
28
- `if(!${federationGlobal}){`,
29
- template.indent([
30
- `${federationGlobal} = {`,
31
- template.indent([
32
- `initOptions: ${initOptionsStrWithoutShared},`,
33
- `chunkMatcher: function(chunkId) {return ${matcher}},`,
34
- `rootOutputDir: ${JSON.stringify(rootOutputDir || '')},`,
35
- `bundlerRuntimeOptions: { remotes: { remoteInfos: ${remoteInfos}, webpackRequire: ${runtimeGlobals.require},idToRemoteMap: {}, chunkMapping: {},idToExternalAndNameMapping: {} } }`,
36
- ]),
37
- '};',
38
- ]),
39
- `${runtimeGlobals.require}.consumesLoadingData = {}`,
40
- `${runtimeGlobals.require}.remotesLoadingData = {}`,
41
- '}',
42
- ]);
9
+ const federationGlobal = require_lib_container_runtime_utils.getFederationGlobalScope(runtimeGlobals);
10
+ const initOptionsStrWithoutShared = JSON.stringify({
11
+ ...initOptionsWithoutShared,
12
+ remotes: initOptionsWithoutShared.remotes.filter((remote) => remote.externalType === "script")
13
+ });
14
+ const remoteInfos = JSON.stringify(initOptionsWithoutShared.remotes.reduce((acc, remote) => {
15
+ const item = {
16
+ alias: remote.alias || "",
17
+ name: remote.name,
18
+ entry: remote.entry || "",
19
+ shareScope: remote.shareScope,
20
+ externalType: remote.externalType
21
+ };
22
+ const key = remote.name || remote.alias || "";
23
+ acc[key] ||= [];
24
+ acc[key].push(item);
25
+ return acc;
26
+ }, {}));
27
+ return template.asString([
28
+ `if(!${federationGlobal}){`,
29
+ template.indent([
30
+ `${federationGlobal} = {`,
31
+ template.indent([
32
+ `initOptions: ${initOptionsStrWithoutShared},`,
33
+ `chunkMatcher: function(chunkId) {return ${matcher}},`,
34
+ `rootOutputDir: ${JSON.stringify(rootOutputDir || "")},`,
35
+ `bundlerRuntimeOptions: { remotes: { remoteInfos: ${remoteInfos}, webpackRequire: ${runtimeGlobals.require},idToRemoteMap: {}, chunkMapping: {},idToExternalAndNameMapping: {} } }`
36
+ ]),
37
+ "};"
38
+ ]),
39
+ `${runtimeGlobals.require}.consumesLoadingData = {}`,
40
+ `${runtimeGlobals.require}.remotesLoadingData = {}`,
41
+ "}"
42
+ ]);
43
43
  }
44
+
45
+ //#endregion
44
46
  exports.default = getFederationGlobal;
45
47
  //# sourceMappingURL=getFederationGlobal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFederationGlobal.js","sourceRoot":"","sources":["../../../../../src/lib/container/runtime/getFederationGlobal.ts"],"names":[],"mappings":";;AAAA,0FAAqF;AACrF,mCAAmD;AAKnD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAC1B,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAE9B,SAAS,mBAAmB,CAC1B,QAAyB,EACzB,cAAqC,EACrC,OAAyB,EACzB,aAAiC,EACjC,wBAAmE;IAEnE,MAAM,gBAAgB,GAAG,IAAA,gCAAwB,EAAC,cAAc,CAAC,CAAC;IAClE,MAAM,2BAA2B,GAAG,IAAI,CAAC,SAAS,CAAC;QACjD,GAAG,wBAAwB;QAC3B,OAAO,EAAE,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAC9C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,KAAK,QAAQ,CAC7C;KACF,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAChC,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACtD,MAAM,IAAI,GAA2B;YACnC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,aAAa;YACb,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;YACzB,aAAa;YACb,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC;QACF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9C,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAChB,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAiB,CAAC,CACtB,CAAC;IAEF,OAAO,QAAQ,CAAC,QAAQ,CAAC;QACvB,OAAO,gBAAgB,IAAI;QAC3B,QAAQ,CAAC,MAAM,CAAC;YACd,GAAG,gBAAgB,MAAM;YACzB,QAAQ,CAAC,MAAM,CAAC;gBACd,gBAAgB,2BAA2B,GAAG;gBAC9C,2CAA2C,OAAO,IAAI;gBACtD,kBAAkB,IAAI,CAAC,SAAS,CAAC,aAAa,IAAI,EAAE,CAAC,GAAG;gBACxD,oDAAoD,WAAW,qBAAqB,cAAc,CAAC,OAAO,yEAAyE;aACpL,CAAC;YACF,IAAI;SACL,CAAC;QACF,GAAG,cAAc,CAAC,OAAO,2BAA2B;QACpD,GAAG,cAAc,CAAC,OAAO,0BAA0B;QACnD,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"getFederationGlobal.js","names":["getFederationGlobalScope"],"sources":["../../../../../src/lib/container/runtime/getFederationGlobal.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport { getFederationGlobalScope } from './utils';\nimport type RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport type { NormalizedRuntimeInitOptionsWithOutShared } from './utils';\nimport type { RemoteInfos } from '@module-federation/webpack-bundler-runtime';\n\nconst { Template } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\nfunction getFederationGlobal(\n template: typeof Template,\n runtimeGlobals: typeof RuntimeGlobals,\n matcher: string | boolean,\n rootOutputDir: string | undefined,\n initOptionsWithoutShared: NormalizedRuntimeInitOptionsWithOutShared,\n): string {\n const federationGlobal = getFederationGlobalScope(runtimeGlobals);\n const initOptionsStrWithoutShared = JSON.stringify({\n ...initOptionsWithoutShared,\n remotes: initOptionsWithoutShared.remotes.filter(\n (remote) => remote.externalType === 'script',\n ),\n });\n const remoteInfos = JSON.stringify(\n initOptionsWithoutShared.remotes.reduce((acc, remote) => {\n const item: RemoteInfos[string][0] = {\n alias: remote.alias || '',\n name: remote.name,\n // @ts-ignore\n entry: remote.entry || '',\n // @ts-ignore\n shareScope: remote.shareScope,\n externalType: remote.externalType,\n };\n const key = remote.name || remote.alias || '';\n acc[key] ||= [];\n acc[key].push(item);\n return acc;\n }, {} as RemoteInfos),\n );\n\n return template.asString([\n `if(!${federationGlobal}){`,\n template.indent([\n `${federationGlobal} = {`,\n template.indent([\n `initOptions: ${initOptionsStrWithoutShared},`,\n `chunkMatcher: function(chunkId) {return ${matcher}},`,\n `rootOutputDir: ${JSON.stringify(rootOutputDir || '')},`,\n `bundlerRuntimeOptions: { remotes: { remoteInfos: ${remoteInfos}, webpackRequire: ${runtimeGlobals.require},idToRemoteMap: {}, chunkMapping: {},idToExternalAndNameMapping: {} } }`,\n ]),\n '};',\n ]),\n `${runtimeGlobals.require}.consumesLoadingData = {}`,\n `${runtimeGlobals.require}.remotesLoadingData = {}`,\n '}',\n ]);\n}\n\nexport default getFederationGlobal;\n"],"mappings":";;;;;;AAMA,MAAM,EAAE,aAAa,gFACE,UAAU,CAChC;AAED,SAAS,oBACP,UACA,gBACA,SACA,eACA,0BACQ;CACR,MAAM,mBAAmBA,6DAAyB,eAAe;CACjE,MAAM,8BAA8B,KAAK,UAAU;EACjD,GAAG;EACH,SAAS,yBAAyB,QAAQ,QACvC,WAAW,OAAO,iBAAiB,SACrC;EACF,CAAC;CACF,MAAM,cAAc,KAAK,UACvB,yBAAyB,QAAQ,QAAQ,KAAK,WAAW;EACvD,MAAM,OAA+B;GACnC,OAAO,OAAO,SAAS;GACvB,MAAM,OAAO;GAEb,OAAO,OAAO,SAAS;GAEvB,YAAY,OAAO;GACnB,cAAc,OAAO;GACtB;EACD,MAAM,MAAM,OAAO,QAAQ,OAAO,SAAS;AAC3C,MAAI,SAAS,EAAE;AACf,MAAI,KAAK,KAAK,KAAK;AACnB,SAAO;IACN,EAAE,CAAgB,CACtB;AAED,QAAO,SAAS,SAAS;EACvB,OAAO,iBAAiB;EACxB,SAAS,OAAO;GACd,GAAG,iBAAiB;GACpB,SAAS,OAAO;IACd,gBAAgB,4BAA4B;IAC5C,2CAA2C,QAAQ;IACnD,kBAAkB,KAAK,UAAU,iBAAiB,GAAG,CAAC;IACtD,oDAAoD,YAAY,oBAAoB,eAAe,QAAQ;IAC5G,CAAC;GACF;GACD,CAAC;EACF,GAAG,eAAe,QAAQ;EAC1B,GAAG,eAAe,QAAQ;EAC1B;EACD,CAAC"}
@@ -1,16 +1,27 @@
1
- import type webpack from 'webpack';
2
- import type RuntimeGlobals from 'webpack/lib/RuntimeGlobals';
3
- import type { moduleFederationPlugin } from '@module-federation/sdk';
4
- import { NormalizedRuntimeInitOptionsWithOutShared } from '../../../types/runtime';
1
+ import { moduleFederationPlugin } from "@module-federation/sdk";
2
+ import webpack from "webpack";
3
+ import RuntimeGlobals from "webpack/lib/RuntimeGlobals";
4
+ import { init } from "@module-federation/runtime-tools";
5
+
6
+ //#region src/lib/container/runtime/utils.d.ts
7
+ type Remotes = Parameters<typeof init>[0]['remotes'];
8
+ interface NormalizedRuntimeInitOptionsWithOutShared {
9
+ name: string;
10
+ remotes: Array<Remotes[0] & {
11
+ externalType: moduleFederationPlugin.ExternalsType;
12
+ }>;
13
+ }
5
14
  type EntryStaticNormalized = Awaited<ReturnType<Extract<webpack.WebpackOptionsNormalized['entry'], () => any>>>;
6
15
  interface ModifyEntryOptions {
7
- compiler: webpack.Compiler;
8
- prependEntry?: (entry: EntryStaticNormalized) => void;
9
- staticEntry?: EntryStaticNormalized;
16
+ compiler: webpack.Compiler;
17
+ prependEntry?: (entry: EntryStaticNormalized) => void;
18
+ staticEntry?: EntryStaticNormalized;
10
19
  }
11
- export declare function getFederationGlobalScope(runtimeGlobals: typeof RuntimeGlobals): string;
12
- export declare function normalizeRuntimeInitOptionsWithOutShared(options: moduleFederationPlugin.ModuleFederationPluginOptions): NormalizedRuntimeInitOptionsWithOutShared;
13
- export declare function modifyEntry(options: ModifyEntryOptions): void;
14
- export declare function createHash(contents: string): string;
15
- export declare const normalizeToPosixPath: (p: string) => string;
16
- export {};
20
+ declare function getFederationGlobalScope(runtimeGlobals: typeof RuntimeGlobals): string;
21
+ declare function normalizeRuntimeInitOptionsWithOutShared(options: moduleFederationPlugin.ModuleFederationPluginOptions): NormalizedRuntimeInitOptionsWithOutShared;
22
+ declare function modifyEntry(options: ModifyEntryOptions): void;
23
+ declare function createHash(contents: string): string;
24
+ declare const normalizeToPosixPath: (p: string) => string;
25
+ //#endregion
26
+ export { NormalizedRuntimeInitOptionsWithOutShared, createHash, getFederationGlobalScope, modifyEntry, normalizeRuntimeInitOptionsWithOutShared, normalizeToPosixPath };
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -1,111 +1,93 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.normalizeToPosixPath = void 0;
7
- exports.getFederationGlobalScope = getFederationGlobalScope;
8
- exports.normalizeRuntimeInitOptionsWithOutShared = normalizeRuntimeInitOptionsWithOutShared;
9
- exports.modifyEntry = modifyEntry;
10
- exports.createHash = createHash;
11
- /*
12
- MIT License http://www.opensource.org/licenses/mit-license.php
13
- Author Zackary Jackson @ScriptedAlchemy
14
- */
15
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
16
- const upath_1 = __importDefault(require("upath"));
17
- const path_1 = __importDefault(require("path"));
18
- const crypto_1 = __importDefault(require("crypto"));
19
- const options_1 = require("../options");
20
- const extractUrlAndGlobal = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/extractUrlAndGlobal'));
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
3
+ const require_lib_container_options = require('../options.js');
4
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
5
+ let path = require("path");
6
+ path = require_runtime.__toESM(path);
7
+ let upath = require("upath");
8
+ upath = require_runtime.__toESM(upath);
9
+ let crypto = require("crypto");
10
+ crypto = require_runtime.__toESM(crypto);
11
+
12
+ //#region src/lib/container/runtime/utils.ts
13
+ const extractUrlAndGlobal = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/extractUrlAndGlobal"));
21
14
  function getFederationGlobalScope(runtimeGlobals) {
22
- return `${runtimeGlobals.require || '__webpack_require__'}.federation`;
15
+ return `${runtimeGlobals.require || "__webpack_require__"}.federation`;
23
16
  }
24
17
  function normalizeRuntimeInitOptionsWithOutShared(options) {
25
- const parsedOptions = (0, options_1.parseOptions)(options.remotes || [], (item) => ({
26
- external: Array.isArray(item) ? item : [item],
27
- shareScope: options.shareScope || 'default',
28
- }), (item) => ({
29
- external: Array.isArray(item.external) ? item.external : [item.external],
30
- shareScope: item.shareScope || options.shareScope || 'default',
31
- }));
32
- const remoteOptions = [];
33
- parsedOptions.forEach((parsedOption) => {
34
- const [alias, remoteInfos] = parsedOption;
35
- const { external, shareScope } = remoteInfos;
36
- external.forEach((externalItem) => {
37
- try {
38
- const entry = externalItem;
39
- if (/\s/.test(entry)) {
40
- return;
41
- }
42
- const [url, globalName] = extractUrlAndGlobal(externalItem);
43
- remoteOptions.push({
44
- alias,
45
- name: globalName,
46
- entry: url,
47
- shareScope: shareScope,
48
- externalType: 'script',
49
- });
50
- }
51
- catch (err) {
52
- const getExternalTypeFromExternal = (external) => {
53
- if (/^[a-z0-9-]+ /.test(external)) {
54
- const idx = external.indexOf(' ');
55
- return [
56
- external.slice(0, idx),
57
- external.slice(idx + 1),
58
- ];
59
- }
60
- return null;
61
- };
62
- remoteOptions.push({
63
- alias,
64
- name: '',
65
- entry: '',
66
- shareScope: shareScope,
67
- // @ts-ignore
68
- externalType: getExternalTypeFromExternal(externalItem) || 'unknown',
69
- });
70
- return;
71
- }
72
- });
73
- });
74
- const initOptionsWithoutShared = {
75
- name: options.name,
76
- remotes: remoteOptions,
77
- shareStrategy: options.shareStrategy || 'version-first',
78
- };
79
- return initOptionsWithoutShared;
18
+ const parsedOptions = require_lib_container_options.parseOptions(options.remotes || [], (item) => ({
19
+ external: Array.isArray(item) ? item : [item],
20
+ shareScope: options.shareScope || "default"
21
+ }), (item) => ({
22
+ external: Array.isArray(item.external) ? item.external : [item.external],
23
+ shareScope: item.shareScope || options.shareScope || "default"
24
+ }));
25
+ const remoteOptions = [];
26
+ parsedOptions.forEach((parsedOption) => {
27
+ const [alias, remoteInfos] = parsedOption;
28
+ const { external, shareScope } = remoteInfos;
29
+ external.forEach((externalItem) => {
30
+ try {
31
+ const entry = externalItem;
32
+ if (/\s/.test(entry)) return;
33
+ const [url, globalName] = extractUrlAndGlobal(externalItem);
34
+ remoteOptions.push({
35
+ alias,
36
+ name: globalName,
37
+ entry: url,
38
+ shareScope,
39
+ externalType: "script"
40
+ });
41
+ } catch (err) {
42
+ const getExternalTypeFromExternal = (external) => {
43
+ if (/^[a-z0-9-]+ /.test(external)) {
44
+ const idx = external.indexOf(" ");
45
+ return [external.slice(0, idx), external.slice(idx + 1)];
46
+ }
47
+ return null;
48
+ };
49
+ remoteOptions.push({
50
+ alias,
51
+ name: "",
52
+ entry: "",
53
+ shareScope,
54
+ externalType: getExternalTypeFromExternal(externalItem) || "unknown"
55
+ });
56
+ return;
57
+ }
58
+ });
59
+ });
60
+ return {
61
+ name: options.name,
62
+ remotes: remoteOptions,
63
+ shareStrategy: options.shareStrategy || "version-first"
64
+ };
80
65
  }
81
66
  function modifyEntry(options) {
82
- const { compiler, staticEntry, prependEntry } = options;
83
- const operator = (oriEntry, newEntry) => Object.assign(oriEntry, newEntry);
84
- if (typeof compiler.options.entry === 'function') {
85
- const prevEntryFn = compiler.options.entry;
86
- compiler.options.entry = async () => {
87
- let res = await prevEntryFn();
88
- if (staticEntry) {
89
- res = operator(res, staticEntry);
90
- }
91
- if (prependEntry) {
92
- prependEntry(res);
93
- }
94
- return res;
95
- };
96
- }
97
- else {
98
- if (staticEntry) {
99
- compiler.options.entry = operator(compiler.options.entry, staticEntry);
100
- }
101
- if (prependEntry) {
102
- prependEntry(compiler.options.entry);
103
- }
104
- }
67
+ const { compiler, staticEntry, prependEntry } = options;
68
+ const operator = (oriEntry, newEntry) => Object.assign(oriEntry, newEntry);
69
+ if (typeof compiler.options.entry === "function") {
70
+ const prevEntryFn = compiler.options.entry;
71
+ compiler.options.entry = async () => {
72
+ let res = await prevEntryFn();
73
+ if (staticEntry) res = operator(res, staticEntry);
74
+ if (prependEntry) prependEntry(res);
75
+ return res;
76
+ };
77
+ } else {
78
+ if (staticEntry) compiler.options.entry = operator(compiler.options.entry, staticEntry);
79
+ if (prependEntry) prependEntry(compiler.options.entry);
80
+ }
105
81
  }
106
82
  function createHash(contents) {
107
- return crypto_1.default.createHash('md5').update(contents).digest('hex');
83
+ return crypto.default.createHash("md5").update(contents).digest("hex");
108
84
  }
109
- const normalizeToPosixPath = (p) => upath_1.default.normalizeSafe(path_1.default.normalize(p || ''));
85
+ const normalizeToPosixPath = (p) => upath.default.normalizeSafe(path.default.normalize(p || ""));
86
+
87
+ //#endregion
88
+ exports.createHash = createHash;
89
+ exports.getFederationGlobalScope = getFederationGlobalScope;
90
+ exports.modifyEntry = modifyEntry;
91
+ exports.normalizeRuntimeInitOptionsWithOutShared = normalizeRuntimeInitOptionsWithOutShared;
110
92
  exports.normalizeToPosixPath = normalizeToPosixPath;
111
93
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/lib/container/runtime/utils.ts"],"names":[],"mappings":";;;;;;AA4BA,4DAIC;AAED,4FAgEC;AAED,kCA2BC;AAED,gCAEC;AAnID;;;EAGE;AACF,0FAAqF;AACrF,kDAA0B;AAC1B,gDAAwB;AACxB,oDAA4B;AAC5B,wCAA0C;AAM1C,MAAM,mBAAmB,GAAG,OAAO,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/container/runtime/utils.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Zackary Jackson @ScriptedAlchemy\n*/\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nimport upath from 'upath';\nimport path from 'path';\nimport crypto from 'crypto';\nimport { parseOptions } from '../options';\nimport type webpack from 'webpack';\nimport type RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport type { moduleFederationPlugin } from '@module-federation/sdk';\nimport type { init } from '@module-federation/runtime-tools';\n\ntype Remotes = Parameters<typeof init>[0]['remotes'];\n\nexport interface NormalizedRuntimeInitOptionsWithOutShared {\n name: string;\n remotes: Array<\n Remotes[0] & { externalType: moduleFederationPlugin.ExternalsType }\n >;\n}\n\nconst extractUrlAndGlobal = require(\n normalizeWebpackPath('webpack/lib/util/extractUrlAndGlobal'),\n) as typeof import('webpack/lib/util/extractUrlAndGlobal');\n\ntype EntryStaticNormalized = Awaited<\n ReturnType<Extract<webpack.WebpackOptionsNormalized['entry'], () => any>>\n>;\n\ninterface ModifyEntryOptions {\n compiler: webpack.Compiler;\n prependEntry?: (entry: EntryStaticNormalized) => void;\n staticEntry?: EntryStaticNormalized;\n}\n\nexport function getFederationGlobalScope(\n runtimeGlobals: typeof RuntimeGlobals,\n): string {\n return `${runtimeGlobals.require || '__webpack_require__'}.federation`;\n}\n\nexport function normalizeRuntimeInitOptionsWithOutShared(\n options: moduleFederationPlugin.ModuleFederationPluginOptions,\n): NormalizedRuntimeInitOptionsWithOutShared {\n const parsedOptions = parseOptions(\n options.remotes || [],\n (item) => ({\n external: Array.isArray(item) ? item : [item],\n shareScope: options.shareScope || 'default',\n }),\n (item) => ({\n external: Array.isArray(item.external) ? item.external : [item.external],\n shareScope: item.shareScope || options.shareScope || 'default',\n }),\n );\n const remoteOptions: NormalizedRuntimeInitOptionsWithOutShared['remotes'] =\n [];\n parsedOptions.forEach((parsedOption) => {\n const [alias, remoteInfos] = parsedOption;\n const { external, shareScope } = remoteInfos;\n external.forEach((externalItem) => {\n try {\n const entry = externalItem;\n if (/\\s/.test(entry)) {\n return;\n }\n const [url, globalName] = extractUrlAndGlobal(externalItem);\n remoteOptions.push({\n alias,\n name: globalName,\n entry: url,\n shareScope: shareScope,\n externalType: 'script',\n });\n } catch (err) {\n const getExternalTypeFromExternal = (external: string) => {\n if (/^[a-z0-9-]+ /.test(external)) {\n const idx = external.indexOf(' ');\n return [\n external.slice(0, idx) as moduleFederationPlugin.ExternalsType,\n external.slice(idx + 1),\n ] as const;\n }\n return null;\n };\n remoteOptions.push({\n alias,\n name: '',\n entry: '',\n shareScope: shareScope,\n // @ts-ignore\n externalType: getExternalTypeFromExternal(externalItem) || 'unknown',\n });\n return;\n }\n });\n });\n\n const initOptionsWithoutShared = {\n name: options.name!,\n remotes: remoteOptions,\n shareStrategy: options.shareStrategy || 'version-first',\n };\n\n return initOptionsWithoutShared;\n}\n\nexport function modifyEntry(options: ModifyEntryOptions): void {\n const { compiler, staticEntry, prependEntry } = options;\n const operator = (\n oriEntry: EntryStaticNormalized,\n newEntry: EntryStaticNormalized,\n ): EntryStaticNormalized => Object.assign(oriEntry, newEntry);\n\n if (typeof compiler.options.entry === 'function') {\n const prevEntryFn = compiler.options.entry;\n compiler.options.entry = async () => {\n let res = await prevEntryFn();\n if (staticEntry) {\n res = operator(res, staticEntry);\n }\n if (prependEntry) {\n prependEntry(res);\n }\n return res;\n };\n } else {\n if (staticEntry) {\n compiler.options.entry = operator(compiler.options.entry, staticEntry);\n }\n if (prependEntry) {\n prependEntry(compiler.options.entry);\n }\n }\n}\n\nexport function createHash(contents: string): string {\n return crypto.createHash('md5').update(contents).digest('hex');\n}\n\nexport const normalizeToPosixPath = (p: string) =>\n upath.normalizeSafe(path.normalize(p || ''));\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,sBAAsB,gFACL,uCAAuC,CAC7D;AAYD,SAAgB,yBACd,gBACQ;AACR,QAAO,GAAG,eAAe,WAAW,sBAAsB;;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,QAAQ,QAAQ,YAAY;GACnC,IAAI,MAAM,MAAM,aAAa;AAC7B,OAAI,YACF,OAAM,SAAS,KAAK,YAAY;AAElC,OAAI,aACF,cAAa,IAAI;AAEnB,UAAO;;QAEJ;AACL,MAAI,YACF,UAAS,QAAQ,QAAQ,SAAS,SAAS,QAAQ,OAAO,YAAY;AAExE,MAAI,aACF,cAAa,SAAS,QAAQ,MAAM;;;AAK1C,SAAgB,WAAW,UAA0B;AACnD,QAAO,eAAO,WAAW,MAAM,CAAC,OAAO,SAAS,CAAC,OAAO,MAAM;;AAGhE,MAAa,wBAAwB,MACnC,cAAM,cAAc,aAAK,UAAU,KAAK,GAAG,CAAC"}
@@ -1,12 +1,17 @@
1
- declare const dependencies: typeof import("webpack").dependencies;
1
+ import * as webpack$1 from "webpack";
2
+
3
+ //#region src/lib/sharing/ConsumeSharedFallbackDependency.d.ts
4
+ declare const dependencies: typeof webpack$1.dependencies;
2
5
  declare class ConsumeSharedFallbackDependency extends dependencies.ModuleDependency {
3
- layer?: string | null;
4
- /**
5
- * @param {string} request the request
6
- * @param {string | null} layer the layer for the fallback module
7
- */
8
- constructor(request: string, layer?: string | null);
9
- get type(): string;
10
- get category(): string;
6
+ layer?: string | null;
7
+ /**
8
+ * @param {string} request the request
9
+ * @param {string | null} layer the layer for the fallback module
10
+ */
11
+ constructor(request: string, layer?: string | null);
12
+ get type(): string;
13
+ get category(): string;
11
14
  }
12
- export default ConsumeSharedFallbackDependency;
15
+ //#endregion
16
+ export { ConsumeSharedFallbackDependency as default };
17
+ //# sourceMappingURL=ConsumeSharedFallbackDependency.d.ts.map
@@ -1,28 +1,30 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy
4
- */
5
1
  'use strict';
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
8
- const makeSerializable = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/makeSerializable'));
9
- const { dependencies } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
10
- class ConsumeSharedFallbackDependency extends dependencies.ModuleDependency {
11
- /**
12
- * @param {string} request the request
13
- * @param {string | null} layer the layer for the fallback module
14
- */
15
- constructor(request, layer) {
16
- super(request);
17
- this.layer = layer;
18
- }
19
- get type() {
20
- return 'consume shared fallback';
21
- }
22
- get category() {
23
- return 'esm';
24
- }
25
- }
26
- makeSerializable(ConsumeSharedFallbackDependency, 'enhanced/lib/sharing/ConsumeSharedFallbackDependency');
2
+
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
6
+
7
+ //#region src/lib/sharing/ConsumeSharedFallbackDependency.ts
8
+ const makeSerializable = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/makeSerializable"));
9
+ const { dependencies } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
10
+ var ConsumeSharedFallbackDependency = class extends dependencies.ModuleDependency {
11
+ /**
12
+ * @param {string} request the request
13
+ * @param {string | null} layer the layer for the fallback module
14
+ */
15
+ constructor(request, layer) {
16
+ super(request);
17
+ this.layer = layer;
18
+ }
19
+ get type() {
20
+ return "consume shared fallback";
21
+ }
22
+ get category() {
23
+ return "esm";
24
+ }
25
+ };
26
+ makeSerializable(ConsumeSharedFallbackDependency, "enhanced/lib/sharing/ConsumeSharedFallbackDependency");
27
+
28
+ //#endregion
27
29
  exports.default = ConsumeSharedFallbackDependency;
28
30
  //# sourceMappingURL=ConsumeSharedFallbackDependency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumeSharedFallbackDependency.js","sourceRoot":"","sources":["../../../../src/lib/sharing/ConsumeSharedFallbackDependency.ts"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;AACb,0FAAqF;AACrF,MAAM,gBAAgB,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,mCAAmC,CAAC,CACJ,CAAC;AACxD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAC9B,IAAA,6CAAoB,EAAC,SAAS,CAAC,CACJ,CAAC;AAE9B,MAAM,+BAAgC,SAAQ,YAAY,CAAC,gBAAgB;IAGzE;;;OAGG;IACH,YAAY,OAAe,EAAE,KAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAa,IAAI;QACf,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED,IAAa,QAAQ;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,gBAAgB,CACd,+BAA+B,EAC/B,sDAAsD,CACvD,CAAC;AAEF,kBAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"ConsumeSharedFallbackDependency.js","names":[],"sources":["../../../../src/lib/sharing/ConsumeSharedFallbackDependency.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\nimport { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nconst makeSerializable = require(\n normalizeWebpackPath('webpack/lib/util/makeSerializable'),\n) as typeof import('webpack/lib/util/makeSerializable');\nconst { dependencies } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\n\nclass ConsumeSharedFallbackDependency extends dependencies.ModuleDependency {\n layer?: string | null;\n\n /**\n * @param {string} request the request\n * @param {string | null} layer the layer for the fallback module\n */\n constructor(request: string, layer?: string | null) {\n super(request);\n this.layer = layer;\n }\n\n override get type(): string {\n return 'consume shared fallback';\n }\n\n override get category(): string {\n return 'esm';\n }\n}\n\nmakeSerializable(\n ConsumeSharedFallbackDependency,\n 'enhanced/lib/sharing/ConsumeSharedFallbackDependency',\n);\n\nexport default ConsumeSharedFallbackDependency;\n"],"mappings":";;;;;;;AAOA,MAAM,mBAAmB,gFACF,oCAAoC,CAC1D;AACD,MAAM,EAAE,iBAAiB,gFACF,UAAU,CAChC;AAED,IAAM,kCAAN,cAA8C,aAAa,iBAAiB;;;;;CAO1E,YAAY,SAAiB,OAAuB;AAClD,QAAM,QAAQ;AACd,OAAK,QAAQ;;CAGf,IAAa,OAAe;AAC1B,SAAO;;CAGT,IAAa,WAAmB;AAC9B,SAAO;;;AAIX,iBACE,iCACA,uDACD"}