@module-federation/enhanced 0.2.0-canary.5 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +169 -0
  3. package/dist/package.json +85 -0
  4. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +57 -0
  5. package/dist/src/declarations/plugins/container/Dependency.d.ts +285 -0
  6. package/dist/src/declarations/plugins/container/Module.d.ts +138 -0
  7. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +33 -0
  8. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +4 -0
  9. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +28 -0
  10. package/dist/src/declarations/plugins/container/Template.d.ts +198 -0
  11. package/dist/src/declarations/plugins/container/WebpackError.d.ts +32 -0
  12. package/dist/src/declarations/plugins/container/WebpackOptions.d.ts +140 -0
  13. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +74 -0
  14. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +67 -0
  15. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +78 -0
  16. package/dist/src/index.d.ts +14 -0
  17. package/dist/src/index.js +37 -0
  18. package/dist/src/index.js.map +1 -0
  19. package/dist/src/lib/Constants.js +125 -0
  20. package/dist/src/lib/Constants.js.map +1 -0
  21. package/dist/src/lib/RuntimeGlobals.d.ts +0 -0
  22. package/{src → dist/src}/lib/RuntimeGlobals.js +144 -74
  23. package/dist/src/lib/RuntimeGlobals.js.map +1 -0
  24. package/{src → dist/src}/lib/container/AsyncBoundaryPlugin.d.ts +3 -4
  25. package/dist/src/lib/container/AsyncBoundaryPlugin.js +198 -0
  26. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -0
  27. package/dist/src/lib/container/ContainerEntryDependency.d.ts +24 -0
  28. package/dist/src/lib/container/ContainerEntryDependency.js +39 -0
  29. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -0
  30. package/dist/src/lib/container/ContainerEntryModule.d.ts +75 -0
  31. package/dist/src/lib/container/ContainerEntryModule.js +240 -0
  32. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -0
  33. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -0
  34. package/dist/src/lib/container/ContainerEntryModuleFactory.js +30 -0
  35. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -0
  36. package/dist/src/lib/container/ContainerExposedDependency.d.ts +19 -0
  37. package/dist/src/lib/container/ContainerExposedDependency.js +49 -0
  38. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -0
  39. package/dist/src/lib/container/ContainerPlugin.d.ts +13 -0
  40. package/dist/src/lib/container/ContainerPlugin.js +188 -0
  41. package/dist/src/lib/container/ContainerPlugin.js.map +1 -0
  42. package/{src → dist/src}/lib/container/ContainerReferencePlugin.d.ts +3 -3
  43. package/dist/src/lib/container/ContainerReferencePlugin.js +102 -0
  44. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -0
  45. package/dist/src/lib/container/FallbackDependency.d.ts +15 -0
  46. package/dist/src/lib/container/FallbackDependency.js +47 -0
  47. package/dist/src/lib/container/FallbackDependency.js.map +1 -0
  48. package/dist/src/lib/container/FallbackItemDependency.d.ts +3 -0
  49. package/dist/src/lib/container/FallbackItemDependency.js +26 -0
  50. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -0
  51. package/dist/src/lib/container/FallbackModule.d.ts +54 -0
  52. package/dist/src/lib/container/FallbackModule.js +152 -0
  53. package/dist/src/lib/container/FallbackModule.js.map +1 -0
  54. package/dist/src/lib/container/FallbackModuleFactory.d.ts +11 -0
  55. package/dist/src/lib/container/FallbackModuleFactory.js +28 -0
  56. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -0
  57. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +14 -0
  58. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +64 -0
  59. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -0
  60. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +17 -0
  61. package/dist/src/lib/container/ModuleFederationPlugin.js +133 -0
  62. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -0
  63. package/dist/src/lib/container/RemoteModule.d.ts +90 -0
  64. package/dist/src/lib/container/RemoteModule.js +148 -0
  65. package/dist/src/lib/container/RemoteModule.js.map +1 -0
  66. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -0
  67. package/dist/src/lib/container/RemoteRuntimeModule.js +101 -0
  68. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -0
  69. package/{src → dist/src}/lib/container/RemoteToExternalDependency.d.ts +3 -9
  70. package/dist/src/lib/container/RemoteToExternalDependency.js +26 -0
  71. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -0
  72. package/dist/src/lib/container/constant.d.ts +3 -0
  73. package/dist/src/lib/container/constant.js +12 -0
  74. package/dist/src/lib/container/constant.js.map +1 -0
  75. package/{src → dist/src}/lib/container/options.d.ts +12 -4
  76. package/{src → dist/src}/lib/container/options.js +32 -42
  77. package/dist/src/lib/container/options.js.map +1 -0
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +13 -0
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +49 -0
  80. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -0
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +17 -0
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +209 -0
  83. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -0
  84. package/dist/src/lib/container/runtime/RemoteEntryPlugin.d.ts +8 -0
  85. package/dist/src/lib/container/runtime/RemoteEntryPlugin.js +32 -0
  86. package/dist/src/lib/container/runtime/RemoteEntryPlugin.js.map +1 -0
  87. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +5 -0
  88. package/dist/src/lib/container/runtime/getFederationGlobal.js +26 -0
  89. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
  90. package/dist/src/lib/container/runtime/utils.d.ts +16 -0
  91. package/dist/src/lib/container/runtime/utils.js +83 -0
  92. package/dist/src/lib/container/runtime/utils.js.map +1 -0
  93. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -0
  94. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +26 -0
  95. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -0
  96. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +99 -0
  97. package/dist/src/lib/sharing/ConsumeSharedModule.js +206 -0
  98. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -0
  99. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +30 -0
  100. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +245 -0
  101. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -0
  102. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +31 -0
  103. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +124 -0
  104. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -0
  105. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -0
  106. package/dist/src/lib/sharing/ProvideForSharedDependency.js +27 -0
  107. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -0
  108. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +36 -0
  109. package/dist/src/lib/sharing/ProvideSharedDependency.js +70 -0
  110. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -0
  111. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +67 -0
  112. package/dist/src/lib/sharing/ProvideSharedModule.js +186 -0
  113. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -0
  114. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +18 -0
  115. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +30 -0
  116. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -0
  117. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +47 -0
  118. package/dist/src/lib/sharing/ProvideSharedPlugin.js +195 -0
  119. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -0
  120. package/dist/src/lib/sharing/SharePlugin.d.ts +41 -0
  121. package/dist/src/lib/sharing/SharePlugin.js +79 -0
  122. package/dist/src/lib/sharing/SharePlugin.js.map +1 -0
  123. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +14 -0
  124. package/dist/src/lib/sharing/ShareRuntimeModule.js +102 -0
  125. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -0
  126. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -0
  127. package/dist/src/lib/sharing/resolveMatchedConfigs.js +66 -0
  128. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -0
  129. package/dist/src/lib/sharing/utils.d.ts +37 -0
  130. package/{src → dist/src}/lib/sharing/utils.js +109 -81
  131. package/dist/src/lib/sharing/utils.js.map +1 -0
  132. package/dist/src/rspack.d.ts +1 -0
  133. package/dist/src/rspack.js +6 -0
  134. package/dist/src/rspack.js.map +1 -0
  135. package/{src → dist/src}/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +1 -1
  136. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
  137. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
  138. package/dist/src/runtime.d.ts +1 -0
  139. package/dist/src/runtime.js +18 -0
  140. package/dist/src/runtime.js.map +1 -0
  141. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
  142. package/dist/src/schemas/container/ContainerPlugin.check.js +2318 -0
  143. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
  144. package/dist/src/schemas/container/ContainerPlugin.d.ts +289 -0
  145. package/dist/src/schemas/container/ContainerPlugin.js +326 -0
  146. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
  147. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
  148. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
  149. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
  150. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
  151. package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
  152. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
  153. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -0
  154. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +4001 -0
  155. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
  156. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.d.ts +197 -4
  157. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.js +349 -177
  158. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
  159. package/{src/schemas/container/ModuleFederationPlugin.check.d.ts → dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts} +2 -2
  160. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
  161. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
  162. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
  163. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
  164. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
  165. package/dist/src/types/runtime.d.ts +7 -0
  166. package/dist/src/types/runtime.js +3 -0
  167. package/dist/src/types/runtime.js.map +1 -0
  168. package/dist/src/webpack.d.ts +2 -0
  169. package/dist/src/webpack.js +9 -0
  170. package/dist/src/webpack.js.map +1 -0
  171. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
  172. package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
  173. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
  174. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
  175. package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
  176. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
  177. package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
  178. package/dist/src/wrapper/ContainerPlugin.js +19 -0
  179. package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
  180. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
  181. package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
  182. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
  183. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
  184. package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
  185. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
  186. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +7 -0
  187. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +19 -0
  188. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
  189. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
  190. package/dist/src/wrapper/ModuleFederationPlugin.js +39 -0
  191. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
  192. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
  193. package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
  194. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
  195. package/dist/src/wrapper/SharePlugin.d.ts +8 -0
  196. package/dist/src/wrapper/SharePlugin.js +19 -0
  197. package/dist/src/wrapper/SharePlugin.js.map +1 -0
  198. package/package.json +75 -7
  199. package/global.d.js +0 -14
  200. package/global.d.js.map +0 -1
  201. package/pullts.d.ts +0 -1
  202. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js +0 -14
  203. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js.map +0 -1
  204. package/src/declarations/plugins/container/ContainerPlugin.d.js +0 -12
  205. package/src/declarations/plugins/container/ContainerPlugin.d.js.map +0 -1
  206. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js +0 -12
  207. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js.map +0 -1
  208. package/src/declarations/plugins/container/Dependency.d.js +0 -14
  209. package/src/declarations/plugins/container/Dependency.d.js.map +0 -1
  210. package/src/declarations/plugins/container/Module.d.js +0 -3
  211. package/src/declarations/plugins/container/Module.d.js.map +0 -1
  212. package/src/declarations/plugins/container/ModuleFactory.d.js +0 -3
  213. package/src/declarations/plugins/container/ModuleFactory.d.js.map +0 -1
  214. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js +0 -12
  215. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js.map +0 -1
  216. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js +0 -6
  217. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js.map +0 -1
  218. package/src/declarations/plugins/container/StaticExportsDependency.d.js +0 -14
  219. package/src/declarations/plugins/container/StaticExportsDependency.d.js.map +0 -1
  220. package/src/declarations/plugins/container/Template.d.js +0 -4
  221. package/src/declarations/plugins/container/Template.d.js.map +0 -1
  222. package/src/declarations/plugins/container/WebpackError.d.js +0 -3
  223. package/src/declarations/plugins/container/WebpackError.d.js.map +0 -1
  224. package/src/declarations/plugins/container/WebpackOptions.d.js +0 -6
  225. package/src/declarations/plugins/container/WebpackOptions.d.js.map +0 -1
  226. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js +0 -12
  227. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  228. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js +0 -12
  229. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js.map +0 -1
  230. package/src/declarations/plugins/sharing/SharePlugin.d.js +0 -12
  231. package/src/declarations/plugins/sharing/SharePlugin.d.js.map +0 -1
  232. package/src/index.d.ts +0 -7
  233. package/src/index.js +0 -47
  234. package/src/index.js.map +0 -1
  235. package/src/lib/Constants.js +0 -103
  236. package/src/lib/Constants.js.map +0 -1
  237. package/src/lib/RuntimeGlobals.d.ts +0 -1
  238. package/src/lib/RuntimeGlobals.js.map +0 -1
  239. package/src/lib/container/AsyncBoundaryPlugin.js +0 -184
  240. package/src/lib/container/AsyncBoundaryPlugin.js.map +0 -1
  241. package/src/lib/container/ContainerEntryDependency.d.js +0 -4
  242. package/src/lib/container/ContainerEntryDependency.d.js.map +0 -1
  243. package/src/lib/container/ContainerEntryDependency.d.ts +0 -20
  244. package/src/lib/container/ContainerEntryDependency.js +0 -47
  245. package/src/lib/container/ContainerEntryDependency.js.map +0 -1
  246. package/src/lib/container/ContainerEntryModule.d.js +0 -14
  247. package/src/lib/container/ContainerEntryModule.d.js.map +0 -1
  248. package/src/lib/container/ContainerEntryModule.d.ts +0 -85
  249. package/src/lib/container/ContainerEntryModule.js +0 -281
  250. package/src/lib/container/ContainerEntryModule.js.map +0 -1
  251. package/src/lib/container/ContainerEntryModuleFactory.d.js +0 -4
  252. package/src/lib/container/ContainerEntryModuleFactory.d.js.map +0 -1
  253. package/src/lib/container/ContainerEntryModuleFactory.d.ts +0 -10
  254. package/src/lib/container/ContainerEntryModuleFactory.js +0 -37
  255. package/src/lib/container/ContainerEntryModuleFactory.js.map +0 -1
  256. package/src/lib/container/ContainerExposedDependency.d.js +0 -4
  257. package/src/lib/container/ContainerExposedDependency.d.js.map +0 -1
  258. package/src/lib/container/ContainerExposedDependency.d.ts +0 -26
  259. package/src/lib/container/ContainerExposedDependency.js +0 -57
  260. package/src/lib/container/ContainerExposedDependency.js.map +0 -1
  261. package/src/lib/container/ContainerPlugin.d.js +0 -4
  262. package/src/lib/container/ContainerPlugin.d.js.map +0 -1
  263. package/src/lib/container/ContainerPlugin.d.ts +0 -11
  264. package/src/lib/container/ContainerPlugin.js +0 -92
  265. package/src/lib/container/ContainerPlugin.js.map +0 -1
  266. package/src/lib/container/ContainerReferencePlugin.d.js +0 -4
  267. package/src/lib/container/ContainerReferencePlugin.d.js.map +0 -1
  268. package/src/lib/container/ContainerReferencePlugin.js +0 -141
  269. package/src/lib/container/ContainerReferencePlugin.js.map +0 -1
  270. package/src/lib/container/FallbackDependency.d.js +0 -14
  271. package/src/lib/container/FallbackDependency.d.js.map +0 -1
  272. package/src/lib/container/FallbackDependency.d.ts +0 -25
  273. package/src/lib/container/FallbackDependency.js +0 -59
  274. package/src/lib/container/FallbackDependency.js.map +0 -1
  275. package/src/lib/container/FallbackItemDependency.d.js +0 -4
  276. package/src/lib/container/FallbackItemDependency.d.js.map +0 -1
  277. package/src/lib/container/FallbackItemDependency.d.ts +0 -10
  278. package/src/lib/container/FallbackItemDependency.js +0 -37
  279. package/src/lib/container/FallbackItemDependency.js.map +0 -1
  280. package/src/lib/container/FallbackModule.d.js +0 -4
  281. package/src/lib/container/FallbackModule.d.js.map +0 -1
  282. package/src/lib/container/FallbackModule.d.ts +0 -73
  283. package/src/lib/container/FallbackModule.js +0 -153
  284. package/src/lib/container/FallbackModule.js.map +0 -1
  285. package/src/lib/container/FallbackModuleFactory.d.js +0 -4
  286. package/src/lib/container/FallbackModuleFactory.d.js.map +0 -1
  287. package/src/lib/container/FallbackModuleFactory.d.ts +0 -10
  288. package/src/lib/container/FallbackModuleFactory.js +0 -35
  289. package/src/lib/container/FallbackModuleFactory.js.map +0 -1
  290. package/src/lib/container/HoistContainerReferencesPlugin.d.ts +0 -19
  291. package/src/lib/container/HoistContainerReferencesPlugin.js +0 -78
  292. package/src/lib/container/HoistContainerReferencesPlugin.js.map +0 -1
  293. package/src/lib/container/ModuleFederationPlugin.d.js +0 -4
  294. package/src/lib/container/ModuleFederationPlugin.d.js.map +0 -1
  295. package/src/lib/container/ModuleFederationPlugin.d.ts +0 -16
  296. package/src/lib/container/ModuleFederationPlugin.js +0 -85
  297. package/src/lib/container/ModuleFederationPlugin.js.map +0 -1
  298. package/src/lib/container/ModuleFederationPluginTypes.d.js +0 -12
  299. package/src/lib/container/ModuleFederationPluginTypes.d.js.map +0 -1
  300. package/src/lib/container/RemoteModule.d.js +0 -13
  301. package/src/lib/container/RemoteModule.d.js.map +0 -1
  302. package/src/lib/container/RemoteModule.d.ts +0 -76
  303. package/src/lib/container/RemoteModule.js +0 -151
  304. package/src/lib/container/RemoteModule.js.map +0 -1
  305. package/src/lib/container/RemoteRuntimeModule.d.js +0 -13
  306. package/src/lib/container/RemoteRuntimeModule.d.js.map +0 -1
  307. package/src/lib/container/RemoteRuntimeModule.d.ts +0 -9
  308. package/src/lib/container/RemoteRuntimeModule.js +0 -124
  309. package/src/lib/container/RemoteRuntimeModule.js.map +0 -1
  310. package/src/lib/container/RemoteToExternalDependency.d.js +0 -19
  311. package/src/lib/container/RemoteToExternalDependency.d.js.map +0 -1
  312. package/src/lib/container/RemoteToExternalDependency.js +0 -37
  313. package/src/lib/container/RemoteToExternalDependency.js.map +0 -1
  314. package/src/lib/container/options.d.js +0 -6
  315. package/src/lib/container/options.d.js.map +0 -1
  316. package/src/lib/container/options.js.map +0 -1
  317. package/src/lib/inversion/ContainerInversionPlugin.d.ts +0 -1
  318. package/src/lib/inversion/ContainerInversionPlugin.js +0 -3
  319. package/src/lib/inversion/ContainerInversionPlugin.js.map +0 -1
  320. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js +0 -4
  321. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js.map +0 -1
  322. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +0 -10
  323. package/src/lib/sharing/ConsumeSharedFallbackDependency.js +0 -37
  324. package/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +0 -1
  325. package/src/lib/sharing/ConsumeSharedModule.d.js +0 -4
  326. package/src/lib/sharing/ConsumeSharedModule.d.js.map +0 -1
  327. package/src/lib/sharing/ConsumeSharedModule.d.ts +0 -106
  328. package/src/lib/sharing/ConsumeSharedModule.js +0 -235
  329. package/src/lib/sharing/ConsumeSharedModule.js.map +0 -1
  330. package/src/lib/sharing/ConsumeSharedPlugin.d.js +0 -4
  331. package/src/lib/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  332. package/src/lib/sharing/ConsumeSharedPlugin.d.ts +0 -8
  333. package/src/lib/sharing/ConsumeSharedPlugin.js +0 -274
  334. package/src/lib/sharing/ConsumeSharedPlugin.js.map +0 -1
  335. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js +0 -4
  336. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js.map +0 -1
  337. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +0 -13
  338. package/src/lib/sharing/ConsumeSharedRuntimeModule.js +0 -294
  339. package/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +0 -1
  340. package/src/lib/sharing/ProvideForSharedDependency.d.js +0 -4
  341. package/src/lib/sharing/ProvideForSharedDependency.d.js.map +0 -1
  342. package/src/lib/sharing/ProvideForSharedDependency.d.ts +0 -11
  343. package/src/lib/sharing/ProvideForSharedDependency.js +0 -38
  344. package/src/lib/sharing/ProvideForSharedDependency.js.map +0 -1
  345. package/src/lib/sharing/ProvideSharedDependency.d.js +0 -14
  346. package/src/lib/sharing/ProvideSharedDependency.d.js.map +0 -1
  347. package/src/lib/sharing/ProvideSharedDependency.d.ts +0 -32
  348. package/src/lib/sharing/ProvideSharedDependency.js +0 -69
  349. package/src/lib/sharing/ProvideSharedDependency.js.map +0 -1
  350. package/src/lib/sharing/ProvideSharedModule.d.js +0 -4
  351. package/src/lib/sharing/ProvideSharedModule.d.js.map +0 -1
  352. package/src/lib/sharing/ProvideSharedModule.d.ts +0 -79
  353. package/src/lib/sharing/ProvideSharedModule.js +0 -203
  354. package/src/lib/sharing/ProvideSharedModule.js.map +0 -1
  355. package/src/lib/sharing/ProvideSharedModuleFactory.d.js +0 -4
  356. package/src/lib/sharing/ProvideSharedModuleFactory.d.js.map +0 -1
  357. package/src/lib/sharing/ProvideSharedModuleFactory.d.ts +0 -11
  358. package/src/lib/sharing/ProvideSharedModuleFactory.js +0 -36
  359. package/src/lib/sharing/ProvideSharedModuleFactory.js.map +0 -1
  360. package/src/lib/sharing/ProvideSharedPlugin.d.js +0 -4
  361. package/src/lib/sharing/ProvideSharedPlugin.d.js.map +0 -1
  362. package/src/lib/sharing/ProvideSharedPlugin.d.ts +0 -34
  363. package/src/lib/sharing/ProvideSharedPlugin.js +0 -182
  364. package/src/lib/sharing/ProvideSharedPlugin.js.map +0 -1
  365. package/src/lib/sharing/SharePlugin.d.js +0 -4
  366. package/src/lib/sharing/SharePlugin.d.js.map +0 -1
  367. package/src/lib/sharing/SharePlugin.d.ts +0 -15
  368. package/src/lib/sharing/SharePlugin.js +0 -77
  369. package/src/lib/sharing/SharePlugin.js.map +0 -1
  370. package/src/lib/sharing/ShareRuntimeModule.d.js +0 -4
  371. package/src/lib/sharing/ShareRuntimeModule.d.js.map +0 -1
  372. package/src/lib/sharing/ShareRuntimeModule.d.ts +0 -9
  373. package/src/lib/sharing/ShareRuntimeModule.js +0 -161
  374. package/src/lib/sharing/ShareRuntimeModule.js.map +0 -1
  375. package/src/lib/sharing/resolveMatchedConfigs.d.js +0 -6
  376. package/src/lib/sharing/resolveMatchedConfigs.d.js.map +0 -1
  377. package/src/lib/sharing/resolveMatchedConfigs.d.ts +0 -8
  378. package/src/lib/sharing/resolveMatchedConfigs.js +0 -73
  379. package/src/lib/sharing/resolveMatchedConfigs.js.map +0 -1
  380. package/src/lib/sharing/utils.d.js +0 -6
  381. package/src/lib/sharing/utils.d.js.map +0 -1
  382. package/src/lib/sharing/utils.d.ts +0 -33
  383. package/src/lib/sharing/utils.js.map +0 -1
  384. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -34
  385. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
  386. package/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -16
  387. package/src/runtime/ModuleInfoRuntimeModule.js +0 -88
  388. package/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
  389. package/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
  390. package/src/runtime/ModuleInfoRuntimePlugin.js +0 -29
  391. package/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
  392. package/src/schemas/container/ModuleFederationPlugin.check.js +0 -2245
  393. package/src/schemas/container/ModuleFederationPlugin.check.js.map +0 -1
  394. package/src/schemas/container/ModuleFederationPlugin.js.map +0 -1
  395. /package/{src → dist/src}/lib/Constants.d.ts +0 -0
@@ -1,35 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
4
- */ 'use strict';
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return FallbackModuleFactory;
12
- }
13
- });
14
- const _ModuleFactory = /*#__PURE__*/ _interop_require_default(require("webpack/lib/ModuleFactory"));
15
- const _FallbackModule = /*#__PURE__*/ _interop_require_default(require("./FallbackModule"));
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- var FallbackModuleFactory;
22
- FallbackModuleFactory = class FallbackModuleFactory extends _ModuleFactory.default {
23
- /**
24
- * @param {ModuleFactoryCreateData} data data object
25
- * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
26
- * @returns {void}
27
- */ create(data, callback) {
28
- const dependency = data.dependencies[0];
29
- callback(null, {
30
- module: new _FallbackModule.default(dependency.requests)
31
- });
32
- }
33
- };
34
-
35
- //# sourceMappingURL=FallbackModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/FallbackModuleFactory.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr\n*/\n\n'use strict';\nimport {\n ModuleFactoryCreateData,\n ModuleFactoryResult,\n} from 'webpack/lib/ModuleFactory';\nimport ModuleFactory from 'webpack/lib/ModuleFactory';\nimport FallbackModule from './FallbackModule';\nimport FallbackDependency from './FallbackDependency';\n\nexport default class FallbackModuleFactory extends ModuleFactory {\n /**\n * @param {ModuleFactoryCreateData} data data object\n * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback\n * @returns {void}\n */\n override create(\n data: ModuleFactoryCreateData,\n callback: (error: Error | null, result?: ModuleFactoryResult) => void,\n ): void {\n const dependency = data.dependencies[0] as FallbackDependency;\n callback(null, {\n module: new FallbackModule(dependency.requests),\n });\n }\n}\n"],"names":["FallbackModuleFactory","ModuleFactory","create","data","callback","dependency","dependencies","module","FallbackModule","requests"],"mappings":"AAAA;;;AAGA,GAEA;;;;;;;eASqBA;;;sEAJK;uEACC;;;;;;IAGNA;AAAAA,wBAAN,MAAMA,8BAA8BC,sBAAa;IAC9D;;;;GAIC,GACD,AAASC,OACPC,IAA6B,EAC7BC,QAAqE,EAC/D;QACN,MAAMC,aAAaF,KAAKG,YAAY,CAAC,EAAE;QACvCF,SAAS,MAAM;YACbG,QAAQ,IAAIC,uBAAc,CAACH,WAAWI,QAAQ;QAChD;IACF;AACF"}
@@ -1,19 +0,0 @@
1
- import Compiler from 'webpack/lib/Compiler';
2
- /**
3
- * @typedef {import("webpack").Compiler} Compiler
4
- * @typedef {import("webpack").Compilation} Compilation
5
- * @typedef {import("webpack").Chunk} Chunk
6
- * @typedef {import("webpack").Module} Module
7
- */
8
- /**
9
- * This class is used to hoist container references in the code.
10
- * @constructor
11
- */
12
- export declare class HoistContainerReferences {
13
- /**
14
- * @function apply
15
- * @param {Compiler} compiler The webpack compiler object
16
- */
17
- apply(compiler: Compiler): void;
18
- }
19
- export default HoistContainerReferences;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- HoistContainerReferences: function() {
13
- return HoistContainerReferences;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- let HoistContainerReferences = class HoistContainerReferences {
20
- /**
21
- * @function apply
22
- * @param {Compiler} compiler The webpack compiler object
23
- */ apply(compiler) {
24
- // Hook into the compilation process
25
- compiler.hooks.thisCompilation.tap('HoistContainerReferences', (compilation)=>{
26
- // After chunks are optimized, perform the hoisting
27
- compilation.hooks.afterOptimizeChunks.tap('HoistContainerReferences', (chunks, chunkGroups)=>{
28
- // Create a map to store chunks by their id or name
29
- /** @type {Map<(string|number), Chunk>} */ const chunkSet = new Map();
30
- // Create a set to store external module requests
31
- /** @type {Set<Module>} */ const externalRequests = new Set();
32
- // Populate the chunkSet with chunks
33
- for (const chunk of chunks){
34
- const ident = chunk.id || chunk.name;
35
- if (ident) {
36
- chunkSet.set(ident, chunk);
37
- }
38
- }
39
- // Iterate over chunks again to handle remote modules
40
- for (const chunk of chunks){
41
- // Get iterable of remote modules for the chunk
42
- const remoteModules = compilation.chunkGraph.getChunkModulesIterableBySourceType(chunk, 'remote');
43
- if (!remoteModules) continue;
44
- // Iterate over remote modules
45
- for (const remoteModule of remoteModules){
46
- // Iterate over dependencies of the remote module
47
- for (const dep of remoteModule.dependencies){
48
- // Get the module associated with the dependency
49
- const mod = compilation.moduleGraph.getModule(dep);
50
- // If the module exists and the chunk has a runtime, add the module to externalRequests
51
- if (mod !== null && chunk.runtime) {
52
- externalRequests.add(mod);
53
- // Get the runtime chunk(s) associated with the chunk
54
- const runtimeChunk = typeof chunk.runtime === 'string' || typeof chunk.runtime === 'number' ? [
55
- chunk.runtime
56
- ] : [
57
- ...chunk.runtime
58
- ];
59
- // Iterate over runtime chunks
60
- for (const runtimeChunkId of runtimeChunk){
61
- // Get the runtime chunk from the chunkSet
62
- const runtimeChunk = chunkSet.get(runtimeChunkId);
63
- // If the runtime chunk exists, connect it with the module in the chunk graph
64
- if (runtimeChunk) {
65
- compilation.chunkGraph.connectChunkAndModule(runtimeChunk, mod);
66
- }
67
- }
68
- }
69
- }
70
- }
71
- }
72
- });
73
- });
74
- }
75
- };
76
- const _default = HoistContainerReferences;
77
-
78
- //# sourceMappingURL=HoistContainerReferencesPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/HoistContainerReferencesPlugin.ts"],"sourcesContent":["import Compiler from 'webpack/lib/Compiler';\nimport Module from 'webpack/lib/Module';\nimport Chunk from 'webpack/lib/Chunk';\nimport Compilation from 'webpack/lib/Compilation';\nimport ChunkGroup from 'webpack/lib/ChunkGroup';\n\n/**\n * @typedef {import(\"webpack\").Compiler} Compiler\n * @typedef {import(\"webpack\").Compilation} Compilation\n * @typedef {import(\"webpack\").Chunk} Chunk\n * @typedef {import(\"webpack\").Module} Module\n */\n\n/**\n * This class is used to hoist container references in the code.\n * @constructor\n */\nexport class HoistContainerReferences {\n /**\n * @function apply\n * @param {Compiler} compiler The webpack compiler object\n */\n apply(compiler: Compiler): void {\n // Hook into the compilation process\n compiler.hooks.thisCompilation.tap(\n 'HoistContainerReferences',\n (compilation: Compilation) => {\n // After chunks are optimized, perform the hoisting\n compilation.hooks.afterOptimizeChunks.tap(\n 'HoistContainerReferences',\n (chunks: Iterable<Chunk>, chunkGroups: ChunkGroup[]) => {\n // Create a map to store chunks by their id or name\n /** @type {Map<(string|number), Chunk>} */\n const chunkSet = new Map<string | number, Chunk>();\n // Create a set to store external module requests\n /** @type {Set<Module>} */\n const externalRequests = new Set<Module>();\n // Populate the chunkSet with chunks\n for (const chunk of chunks) {\n const ident = chunk.id || chunk.name;\n if (ident) {\n chunkSet.set(ident, chunk);\n }\n }\n // Iterate over chunks again to handle remote modules\n for (const chunk of chunks) {\n // Get iterable of remote modules for the chunk\n const remoteModules =\n compilation.chunkGraph.getChunkModulesIterableBySourceType(\n chunk,\n 'remote',\n );\n if (!remoteModules) continue;\n // Iterate over remote modules\n for (const remoteModule of remoteModules) {\n // Iterate over dependencies of the remote module\n for (const dep of remoteModule.dependencies) {\n // Get the module associated with the dependency\n const mod = compilation.moduleGraph.getModule(dep);\n // If the module exists and the chunk has a runtime, add the module to externalRequests\n if (mod !== null && chunk.runtime) {\n externalRequests.add(mod);\n // Get the runtime chunk(s) associated with the chunk\n const runtimeChunk =\n typeof chunk.runtime === 'string' ||\n typeof chunk.runtime === 'number'\n ? [chunk.runtime]\n : [...chunk.runtime];\n // Iterate over runtime chunks\n for (const runtimeChunkId of runtimeChunk) {\n // Get the runtime chunk from the chunkSet\n const runtimeChunk = chunkSet.get(runtimeChunkId);\n // If the runtime chunk exists, connect it with the module in the chunk graph\n if (runtimeChunk) {\n compilation.chunkGraph.connectChunkAndModule(\n runtimeChunk,\n mod,\n );\n }\n }\n }\n }\n }\n }\n },\n );\n },\n );\n }\n}\nexport default HoistContainerReferences;\n"],"names":["HoistContainerReferences","apply","compiler","hooks","thisCompilation","tap","compilation","afterOptimizeChunks","chunks","chunkGroups","chunkSet","Map","externalRequests","Set","chunk","ident","id","name","set","remoteModules","chunkGraph","getChunkModulesIterableBySourceType","remoteModule","dep","dependencies","mod","moduleGraph","getModule","runtime","add","runtimeChunk","runtimeChunkId","get","connectChunkAndModule"],"mappings":";;;;;;;;;;;IAiBaA,wBAAwB;eAAxBA;;IAyEb,OAAwC;eAAxC;;;AAzEO,IAAA,AAAMA,2BAAN,MAAMA;IACX;;;GAGC,GACDC,MAAMC,QAAkB,EAAQ;QAC9B,oCAAoC;QACpCA,SAASC,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,4BACA,CAACC;YACC,mDAAmD;YACnDA,YAAYH,KAAK,CAACI,mBAAmB,CAACF,GAAG,CACvC,4BACA,CAACG,QAAyBC;gBACxB,mDAAmD;gBACnD,wCAAwC,GACxC,MAAMC,WAAW,IAAIC;gBACrB,iDAAiD;gBACjD,wBAAwB,GACxB,MAAMC,mBAAmB,IAAIC;gBAC7B,oCAAoC;gBACpC,KAAK,MAAMC,SAASN,OAAQ;oBAC1B,MAAMO,QAAQD,MAAME,EAAE,IAAIF,MAAMG,IAAI;oBACpC,IAAIF,OAAO;wBACTL,SAASQ,GAAG,CAACH,OAAOD;oBACtB;gBACF;gBACA,qDAAqD;gBACrD,KAAK,MAAMA,SAASN,OAAQ;oBAC1B,+CAA+C;oBAC/C,MAAMW,gBACJb,YAAYc,UAAU,CAACC,mCAAmC,CACxDP,OACA;oBAEJ,IAAI,CAACK,eAAe;oBACpB,8BAA8B;oBAC9B,KAAK,MAAMG,gBAAgBH,cAAe;wBACxC,iDAAiD;wBACjD,KAAK,MAAMI,OAAOD,aAAaE,YAAY,CAAE;4BAC3C,gDAAgD;4BAChD,MAAMC,MAAMnB,YAAYoB,WAAW,CAACC,SAAS,CAACJ;4BAC9C,uFAAuF;4BACvF,IAAIE,QAAQ,QAAQX,MAAMc,OAAO,EAAE;gCACjChB,iBAAiBiB,GAAG,CAACJ;gCACrB,qDAAqD;gCACrD,MAAMK,eACJ,OAAOhB,MAAMc,OAAO,KAAK,YACzB,OAAOd,MAAMc,OAAO,KAAK,WACrB;oCAACd,MAAMc,OAAO;iCAAC,GACf;uCAAId,MAAMc,OAAO;iCAAC;gCACxB,8BAA8B;gCAC9B,KAAK,MAAMG,kBAAkBD,aAAc;oCACzC,0CAA0C;oCAC1C,MAAMA,eAAepB,SAASsB,GAAG,CAACD;oCAClC,6EAA6E;oCAC7E,IAAID,cAAc;wCAChBxB,YAAYc,UAAU,CAACa,qBAAqB,CAC1CH,cACAL;oCAEJ;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QAEJ;IAEJ;AACF;MACA,WAAezB"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- module.exports = ModuleFederationPlugin;
3
-
4
- //# sourceMappingURL=ModuleFederationPlugin.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPlugin.d.ts"],"sourcesContent":["export = ModuleFederationPlugin;\ndeclare class ModuleFederationPlugin {\n /**\n * @param {ModuleFederationPluginOptions} options options\n */\n constructor(options: any);\n _options: any;\n /**\n * Apply the plugin\n * @param {Compiler} compiler the compiler instance\n * @returns {void}\n */\n apply(compiler: Compiler): void;\n}\ndeclare namespace ModuleFederationPlugin {\n export { ExternalsType, ModuleFederationPluginOptions, Shared, Compiler };\n}\ntype Compiler = import('webpack/lib/Compiler');\ntype ExternalsType = any;\ntype ModuleFederationPluginOptions = any;\ntype Shared = any;\n"],"names":["ModuleFederationPlugin"],"mappings":";iBAASA"}
@@ -1,16 +0,0 @@
1
- import type Compiler from 'webpack/lib/Compiler';
2
- import type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';
3
- declare class ModuleFederationPlugin {
4
- private _options;
5
- /**
6
- * @param {ModuleFederationPluginOptions} options options
7
- */
8
- constructor(options: ModuleFederationPluginOptions);
9
- /**
10
- * Apply the plugin
11
- * @param {Compiler} compiler the compiler instance
12
- * @returns {void}
13
- */
14
- apply(compiler: Compiler): void;
15
- }
16
- export default ModuleFederationPlugin;
@@ -1,85 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
4
- */ 'use strict';
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return _default;
12
- }
13
- });
14
- const _ExternalsTypecheck = /*#__PURE__*/ _interop_require_default(require("webpack/schemas/plugins/container/ExternalsType.check.js"));
15
- const _SharePlugin = /*#__PURE__*/ _interop_require_default(require("../sharing/SharePlugin"));
16
- const _createschemavalidation = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/create-schema-validation"));
17
- const _ContainerPlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerPlugin"));
18
- const _ContainerReferencePlugin = /*#__PURE__*/ _interop_require_default(require("./ContainerReferencePlugin"));
19
- const _ModuleFederationPlugincheck = /*#__PURE__*/ _interop_require_default(require("webpack/schemas/plugins/container/ModuleFederationPlugin.check.js"));
20
- const _ModuleFederationPlugin = /*#__PURE__*/ _interop_require_default(require("../../schemas/container/ModuleFederationPlugin"));
21
- function _interop_require_default(obj) {
22
- return obj && obj.__esModule ? obj : {
23
- default: obj
24
- };
25
- }
26
- const validate = (0, _createschemavalidation.default)(//eslint-disable-next-line
27
- _ModuleFederationPlugincheck.default, ()=>_ModuleFederationPlugin.default, {
28
- name: 'Module Federation Plugin',
29
- baseDataPath: 'options'
30
- });
31
- let ModuleFederationPlugin = class ModuleFederationPlugin {
32
- /**
33
- * Apply the plugin
34
- * @param {Compiler} compiler the compiler instance
35
- * @returns {void}
36
- */ apply(compiler) {
37
- var _compiler_options_output_enabledLibraryTypes;
38
- const { _options: options } = this;
39
- const library = options.library || {
40
- type: 'var',
41
- name: options.name
42
- };
43
- const remoteType = options.remoteType || (options.library && (0, _ExternalsTypecheck.default)(options.library.type) ? options.library.type : 'script');
44
- if (library && !((_compiler_options_output_enabledLibraryTypes = compiler.options.output.enabledLibraryTypes) == null ? void 0 : _compiler_options_output_enabledLibraryTypes.includes(library.type))) {
45
- var _compiler_options_output_enabledLibraryTypes1;
46
- (_compiler_options_output_enabledLibraryTypes1 = compiler.options.output.enabledLibraryTypes) == null ? void 0 : _compiler_options_output_enabledLibraryTypes1.push(library.type);
47
- }
48
- compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', ()=>{
49
- if (options.exposes && (Array.isArray(options.exposes) ? options.exposes.length > 0 : Object.keys(options.exposes).length > 0)) {
50
- new _ContainerPlugin.default({
51
- //@ts-ignore
52
- name: options.name,
53
- library,
54
- filename: options.filename,
55
- runtime: options.runtime,
56
- shareScope: options.shareScope,
57
- exposes: options.exposes
58
- }).apply(compiler);
59
- }
60
- if (options.remotes && (Array.isArray(options.remotes) ? options.remotes.length > 0 : Object.keys(options.remotes).length > 0)) {
61
- new _ContainerReferencePlugin.default({
62
- //@ts-ignore
63
- remoteType,
64
- shareScope: options.shareScope,
65
- remotes: options.remotes
66
- }).apply(compiler);
67
- }
68
- if (options.shared) {
69
- new _SharePlugin.default({
70
- shared: options.shared,
71
- shareScope: options.shareScope
72
- }).apply(compiler);
73
- }
74
- });
75
- }
76
- /**
77
- * @param {ModuleFederationPluginOptions} options options
78
- */ constructor(options){
79
- validate(options);
80
- this._options = options;
81
- }
82
- };
83
- const _default = ModuleFederationPlugin;
84
-
85
- //# sourceMappingURL=ModuleFederationPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPlugin.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy\n*/\n\n'use strict';\n\nimport type Compiler from 'webpack/lib/Compiler';\nimport isValidExternalsType from 'webpack/schemas/plugins/container/ExternalsType.check.js';\nimport type { ModuleFederationPluginOptions } from './ModuleFederationPluginTypes';\nimport SharePlugin from '../sharing/SharePlugin';\nimport createSchemaValidation from 'webpack/lib/util/create-schema-validation';\nimport ContainerPlugin from './ContainerPlugin';\nimport ContainerReferencePlugin from './ContainerReferencePlugin';\nimport checkOptions from 'webpack/schemas/plugins/container/ModuleFederationPlugin.check.js';\nimport schema from '../../schemas/container/ModuleFederationPlugin';\n\nconst validate = createSchemaValidation(\n //eslint-disable-next-line\n checkOptions,\n () => schema,\n {\n name: 'Module Federation Plugin',\n baseDataPath: 'options',\n },\n);\n\nclass ModuleFederationPlugin {\n private _options: ModuleFederationPluginOptions;\n /**\n * @param {ModuleFederationPluginOptions} options options\n */\n constructor(options: ModuleFederationPluginOptions) {\n validate(options);\n\n this._options = options;\n }\n\n /**\n * Apply the plugin\n * @param {Compiler} compiler the compiler instance\n * @returns {void}\n */\n apply(compiler: Compiler): void {\n const { _options: options } = this;\n const library = options.library || { type: 'var', name: options.name };\n const remoteType =\n options.remoteType ||\n (options.library && isValidExternalsType(options.library.type)\n ? options.library.type\n : 'script');\n if (\n library &&\n !compiler.options.output.enabledLibraryTypes?.includes(library.type)\n ) {\n compiler.options.output.enabledLibraryTypes?.push(library.type);\n }\n compiler.hooks.afterPlugins.tap('ModuleFederationPlugin', () => {\n if (\n options.exposes &&\n (Array.isArray(options.exposes)\n ? options.exposes.length > 0\n : Object.keys(options.exposes).length > 0)\n ) {\n new ContainerPlugin({\n //@ts-ignore\n name: options.name,\n library,\n filename: options.filename,\n runtime: options.runtime,\n shareScope: options.shareScope,\n exposes: options.exposes,\n }).apply(compiler);\n }\n if (\n options.remotes &&\n (Array.isArray(options.remotes)\n ? options.remotes.length > 0\n : Object.keys(options.remotes).length > 0)\n ) {\n new ContainerReferencePlugin({\n //@ts-ignore\n remoteType,\n shareScope: options.shareScope,\n remotes: options.remotes,\n }).apply(compiler);\n }\n if (options.shared) {\n new SharePlugin({\n shared: options.shared,\n shareScope: options.shareScope,\n }).apply(compiler);\n }\n });\n }\n}\n\nexport default ModuleFederationPlugin;\n"],"names":["validate","createSchemaValidation","checkOptions","schema","name","baseDataPath","ModuleFederationPlugin","apply","compiler","_options","options","library","type","remoteType","isValidExternalsType","output","enabledLibraryTypes","includes","push","hooks","afterPlugins","tap","exposes","Array","isArray","length","Object","keys","ContainerPlugin","filename","runtime","shareScope","remotes","ContainerReferencePlugin","shared","SharePlugin","constructor"],"mappings":"AAAA;;;AAGA,GAEA;;;;+BA4FA;;;eAAA;;;2EAzFiC;oEAET;+EACW;wEACP;iFACS;oFACZ;+EACN;;;;;;AAEnB,MAAMA,WAAWC,IAAAA,+BAAsB,EACrC,0BAA0B;AAC1BC,oCAAY,EACZ,IAAMC,+BAAM,EACZ;IACEC,MAAM;IACNC,cAAc;AAChB;AAGF,IAAA,AAAMC,yBAAN,MAAMA;IAWJ;;;;GAIC,GACDC,MAAMC,QAAkB,EAAQ;YAU3BA;QATH,MAAM,EAAEC,UAAUC,OAAO,EAAE,GAAG,IAAI;QAClC,MAAMC,UAAUD,QAAQC,OAAO,IAAI;YAAEC,MAAM;YAAOR,MAAMM,QAAQN,IAAI;QAAC;QACrE,MAAMS,aACJH,QAAQG,UAAU,IACjBH,CAAAA,QAAQC,OAAO,IAAIG,IAAAA,2BAAoB,EAACJ,QAAQC,OAAO,CAACC,IAAI,IACzDF,QAAQC,OAAO,CAACC,IAAI,GACpB,QAAO;QACb,IACED,WACA,GAACH,+CAAAA,SAASE,OAAO,CAACK,MAAM,CAACC,mBAAmB,qBAA3CR,6CAA6CS,QAAQ,CAACN,QAAQC,IAAI,IACnE;gBACAJ;aAAAA,gDAAAA,SAASE,OAAO,CAACK,MAAM,CAACC,mBAAmB,qBAA3CR,8CAA6CU,IAAI,CAACP,QAAQC,IAAI;QAChE;QACAJ,SAASW,KAAK,CAACC,YAAY,CAACC,GAAG,CAAC,0BAA0B;YACxD,IACEX,QAAQY,OAAO,IACdC,CAAAA,MAAMC,OAAO,CAACd,QAAQY,OAAO,IAC1BZ,QAAQY,OAAO,CAACG,MAAM,GAAG,IACzBC,OAAOC,IAAI,CAACjB,QAAQY,OAAO,EAAEG,MAAM,GAAG,CAAA,GAC1C;gBACA,IAAIG,wBAAe,CAAC;oBAClB,YAAY;oBACZxB,MAAMM,QAAQN,IAAI;oBAClBO;oBACAkB,UAAUnB,QAAQmB,QAAQ;oBAC1BC,SAASpB,QAAQoB,OAAO;oBACxBC,YAAYrB,QAAQqB,UAAU;oBAC9BT,SAASZ,QAAQY,OAAO;gBAC1B,GAAGf,KAAK,CAACC;YACX;YACA,IACEE,QAAQsB,OAAO,IACdT,CAAAA,MAAMC,OAAO,CAACd,QAAQsB,OAAO,IAC1BtB,QAAQsB,OAAO,CAACP,MAAM,GAAG,IACzBC,OAAOC,IAAI,CAACjB,QAAQsB,OAAO,EAAEP,MAAM,GAAG,CAAA,GAC1C;gBACA,IAAIQ,iCAAwB,CAAC;oBAC3B,YAAY;oBACZpB;oBACAkB,YAAYrB,QAAQqB,UAAU;oBAC9BC,SAAStB,QAAQsB,OAAO;gBAC1B,GAAGzB,KAAK,CAACC;YACX;YACA,IAAIE,QAAQwB,MAAM,EAAE;gBAClB,IAAIC,oBAAW,CAAC;oBACdD,QAAQxB,QAAQwB,MAAM;oBACtBH,YAAYrB,QAAQqB,UAAU;gBAChC,GAAGxB,KAAK,CAACC;YACX;QACF;IACF;IAjEA;;GAEC,GACD4B,YAAY1B,OAAsC,CAAE;QAClDV,SAASU;QAET,IAAI,CAACD,QAAQ,GAAGC;IAClB;AA2DF;MAEA,WAAeJ"}
@@ -1,12 +0,0 @@
1
- /*
2
- * This file was automatically generated.
3
- * DO NOT MODIFY BY HAND.
4
- * Run `yarn special-lint-fix` to update
5
- */ /**
6
- * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
7
- */ "use strict";
8
- Object.defineProperty(exports, "__esModule", {
9
- value: true
10
- });
11
-
12
- //# sourceMappingURL=ModuleFederationPluginTypes.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/ModuleFederationPluginTypes.d.ts"],"sourcesContent":["/*\n * This file was automatically generated.\n * DO NOT MODIFY BY HAND.\n * Run `yarn special-lint-fix` to update\n */\n\n/**\n * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\n */\nexport type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;\n/**\n * Module that should be exposed by this container.\n */\nexport type ExposesItem = string;\n/**\n * Modules that should be exposed by this container.\n */\nexport type ExposesItems = ExposesItem[];\n/**\n * Add a container for define/require functions in the AMD module.\n */\nexport type AmdContainer = string;\n/**\n * Add a comment in the UMD wrapper.\n */\nexport type AuxiliaryComment = string | LibraryCustomUmdCommentObject;\n/**\n * Specify which export should be exposed as library.\n */\nexport type LibraryExport = string[] | string;\n/**\n * The name of the library (some types allow unnamed libraries too).\n */\nexport type LibraryName = string[] | string | LibraryCustomUmdObject;\n/**\n * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\n */\nexport type LibraryType =\n | (\n | 'var'\n | 'module'\n | 'assign'\n | 'assign-properties'\n | 'this'\n | 'window'\n | 'self'\n | 'global'\n | 'commonjs'\n | 'commonjs2'\n | 'commonjs-module'\n | 'commonjs-static'\n | 'amd'\n | 'amd-require'\n | 'umd'\n | 'umd2'\n | 'jsonp'\n | 'system'\n )\n | string;\n/**\n * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\n */\nexport type UmdNamedDefine = boolean;\n/**\n * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).\n */\nexport type ExternalsType =\n | 'var'\n | 'module'\n | 'assign'\n | 'this'\n | 'window'\n | 'self'\n | 'global'\n | 'commonjs'\n | 'commonjs2'\n | 'commonjs-module'\n | 'commonjs-static'\n | 'amd'\n | 'amd-require'\n | 'umd'\n | 'umd2'\n | 'jsonp'\n | 'system'\n | 'promise'\n | 'import'\n | 'script'\n | 'node-commonjs';\n/**\n * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\n */\nexport type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;\n/**\n * Container location from which modules should be resolved and loaded at runtime.\n */\nexport type RemotesItem = string;\n/**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\nexport type RemotesItems = RemotesItem[];\n/**\n * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\n */\nexport type EntryRuntime = false | string;\n/**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\nexport type Shared = (SharedItem | SharedObject)[] | SharedObject;\n/**\n * A module that should be shared in the share scope.\n */\nexport type SharedItem = string;\n\nexport interface ModuleFederationPluginOptions {\n /**\n * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.\n */\n exposes?: Exposes;\n /**\n * The filename of the container as relative path inside the `output.path` directory.\n */\n filename?: string;\n /**\n * Options for library.\n */\n library?: LibraryOptions;\n /**\n * The name of the container.\n */\n name?: string;\n /**\n * The external type of the remote containers.\n */\n remoteType?: ExternalsType;\n /**\n * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.\n */\n remotes?: Remotes;\n /**\n * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.\n */\n runtime?: EntryRuntime;\n /**\n * Share scope name used for all shared modules (defaults to 'default').\n */\n shareScope?: string;\n /**\n * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.\n */\n shared?: Shared;\n}\n/**\n * Modules that should be exposed by this container. Property names are used as public paths.\n */\nexport interface ExposesObject {\n /**\n * Modules that should be exposed by this container.\n */\n [k: string]: ExposesConfig | ExposesItem | ExposesItems;\n}\n/**\n * Advanced configuration for modules that should be exposed by this container.\n */\nexport interface ExposesConfig {\n /**\n * Request to a module that should be exposed by this container.\n */\n import: ExposesItem | ExposesItems;\n /**\n * Custom chunk name for the exposed module.\n */\n name?: string;\n}\n/**\n * Options for library.\n */\nexport interface LibraryOptions {\n /**\n * Add a container for define/require functions in the AMD module.\n */\n amdContainer?: AmdContainer;\n /**\n * Add a comment in the UMD wrapper.\n */\n auxiliaryComment?: AuxiliaryComment;\n /**\n * Specify which export should be exposed as library.\n */\n export?: LibraryExport;\n /**\n * The name of the library (some types allow unnamed libraries too).\n */\n name?: LibraryName;\n /**\n * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).\n */\n type: LibraryType;\n /**\n * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.\n */\n umdNamedDefine?: UmdNamedDefine;\n}\n/**\n * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.\n */\nexport interface LibraryCustomUmdCommentObject {\n /**\n * Set comment for `amd` section in UMD.\n */\n amd?: string;\n /**\n * Set comment for `commonjs` (exports) section in UMD.\n */\n commonjs?: string;\n /**\n * Set comment for `commonjs2` (module.exports) section in UMD.\n */\n commonjs2?: string;\n /**\n * Set comment for `root` (global variable) section in UMD.\n */\n root?: string;\n}\n/**\n * Description object for all UMD variants of the library name.\n */\nexport interface LibraryCustomUmdObject {\n /**\n * Name of the exposed AMD library in the UMD.\n */\n amd?: string;\n /**\n * Name of the exposed commonjs export in the UMD.\n */\n commonjs?: string;\n /**\n * Name of the property exposed globally by a UMD library.\n */\n root?: string[] | string;\n}\n/**\n * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.\n */\nexport interface RemotesObject {\n /**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\n [k: string]: RemotesConfig | RemotesItem | RemotesItems;\n}\n/**\n * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.\n */\nexport interface RemotesConfig {\n /**\n * Container locations from which modules should be resolved and loaded at runtime.\n */\n external: RemotesItem | RemotesItems;\n /**\n * The name of the share scope shared with this remote.\n */\n shareScope?: string;\n}\n/**\n * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.\n */\nexport interface SharedObject {\n /**\n * Modules that should be shared in the share scope.\n */\n [k: string]: SharedConfig | SharedItem;\n}\n/**\n * Advanced configuration for modules that should be shared in the share scope.\n */\nexport interface SharedConfig {\n /**\n * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.\n */\n eager?: boolean;\n /**\n * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.\n */\n import?: false | SharedItem;\n /**\n * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.\n */\n packageName?: string;\n /**\n * Version requirement from module in share scope.\n */\n requiredVersion?: false | string;\n /**\n * Module is looked up under this key from the share scope.\n */\n shareKey?: string;\n /**\n * Share scope name.\n */\n shareScope?: string;\n /**\n * Allow only a single version of the shared module in share scope (disabled by default).\n */\n singleton?: boolean;\n /**\n * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).\n */\n strictVersion?: boolean;\n /**\n * Version of the provided module. Will replace lower matching versions, but not higher.\n */\n version?: false | string;\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC,GAED;;CAEC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- const _default = RemoteModule;
12
-
13
- //# sourceMappingURL=RemoteModule.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/RemoteModule.d.ts"],"sourcesContent":["export default RemoteModule;\ndeclare class RemoteModule extends Module {\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {RemoteModule} deserialized module\n */\n static deserialize(context: ObjectDeserializerContext): RemoteModule;\n /**\n * @param {string} request request string\n * @param {string[]} externalRequests list of external requests to containers\n * @param {string} internalRequest name of exposed module in container\n * @param {string} shareScope the used share scope name\n */\n constructor(\n request: string,\n externalRequests: string[],\n internalRequest: string,\n shareScope: string,\n );\n request: string;\n externalRequests: string[];\n internalRequest: string;\n shareScope: string;\n _identifier: string;\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n needBuild(\n context: NeedBuildContext,\n callback: (\n arg0: (WebpackError | null) | undefined,\n arg1: boolean | undefined,\n ) => void,\n ): void;\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError=): void} callback callback function\n * @returns {void}webpack\n */\n build(\n options: WebpackOptions,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (arg0: WebpackError | undefined) => void,\n ): void;\n}\ndeclare namespace RemoteModule {\n export {\n WebpackOptionsohunkGraph,\n ChunkGroup,\n Compilation,\n CodeGenerationContext,\n CodeGenerationResult,\n LibIdentOptions,\n NeedBuildContext,\n RequestShortener,\n ResolverWithOptions,\n WebpackError,\n ObjectDeserializerContext,\n ObjectSerializerContext,\n Hash,\n InputFileSystem,\n };\n}\nimport Module = require('webpack/lib/Module');\ntype NeedBuildContext = import('webpack/lib/Module').NeedBuildContext;\ntype WebpackError = import('webpack/lib/WebpackError');\ntype WebpackOptions =\n import('webpack/declarations/WebpackOptions').WebpackOptionsNormalized;\ntype Compilation = import('webpack/lib/Compilation');\ntype ResolverWithOptions =\n import('webpack/lib/ResolverFactory').ResolverWithOptions;\ntype InputFileSystem = import('webpack/lib/util/fs').InputFileSystem;\ntype ObjectDeserializerContext =\n import('webpack/lib/serialization/ObjectMiddleware').ObjectDeserializerContext;\ntype ChunkGraph = import('webpack/lib/ChunkGraph');\ntype ChunkGroup = import('webpack/lib/ChunkGroup');\ntype CodeGenerationContext = import('webpack/lib/Module').CodeGenerationContext;\ntype CodeGenerationResult = import('webpack/lib/Module').CodeGenerationResult;\ntype LibIdentOptions = import('webpack/lib/Module').LibIdentOptions;\ntype RequestShortener = import('webpack/lib/RequestShortener');\ntype ObjectSerializerContext =\n import('webpack/lib/serialization/ObjectMiddleware').ObjectSerializerContext;\ntype Hash = import('webpack/lib/util/Hash');\n"],"names":["RemoteModule"],"mappings":";;;;+BAAA;;;eAAA;;;MAAA,WAAeA"}
@@ -1,76 +0,0 @@
1
- import type { CodeGenerationContext, CodeGenerationResult, LibIdentOptions, NeedBuildContext, WebpackError } from 'webpack/lib/Module';
2
- import Module from 'webpack/lib/Module';
3
- import type Compilation from 'webpack/lib/Compilation';
4
- import type { ResolverWithOptions } from 'webpack/lib/ResolverFactory';
5
- import type { InputFileSystem } from 'webpack/lib/FileSystemInfo';
6
- import type { RequestShortener } from 'webpack/lib/RuntimeModule';
7
- import type { WebpackOptionsNormalized } from 'webpack/lib/WebpackOptionsDefaulter';
8
- import type { ObjectDeserializerContext } from 'webpack/lib/serialization/ObjectMiddleware';
9
- declare class RemoteModule extends Module {
10
- private _identifier;
11
- request: string;
12
- externalRequests: string[];
13
- internalRequest: string;
14
- shareScope: string;
15
- /**
16
- * @param {string} request request string
17
- * @param {string[]} externalRequests list of external requests to containers
18
- * @param {string} internalRequest name of exposed module in container
19
- * @param {string} shareScope the used share scope name
20
- */
21
- constructor(request: string, externalRequests: string[], internalRequest: string, shareScope: string);
22
- /**
23
- * @returns {string} a unique identifier of the module
24
- */
25
- identifier(): string;
26
- /**
27
- * @param {RequestShortener} requestShortener the request shortener
28
- * @returns {string} a user readable identifier of the module
29
- */
30
- readableIdentifier(requestShortener: RequestShortener): string;
31
- /**
32
- * @param {LibIdentOptions} options options
33
- * @returns {string | null} an identifier for library inclusion
34
- */
35
- libIdent(options: LibIdentOptions): string | null;
36
- /**
37
- * @param {NeedBuildContext} context context info
38
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
39
- * @returns {void}
40
- */
41
- needBuild(context: NeedBuildContext, callback: (err: WebpackError | null, needsRebuild?: boolean) => void): void;
42
- /**
43
- * @param {WebpackOptions} options webpack options
44
- * @param {Compilation} compilation the compilation
45
- * @param {ResolverWithOptions} resolver the resolver
46
- * @param {InputFileSystem} fs the file system
47
- * @param {function(WebpackError=): void} callback callback function
48
- * @returns {void}
49
- */
50
- build(options: WebpackOptionsNormalized, compilation: Compilation, resolver: ResolverWithOptions, fs: InputFileSystem, callback: (err?: WebpackError | undefined) => void): void;
51
- /**
52
- * @param {string=} type the source type for which the size should be estimated
53
- * @returns {number} the estimated size of the module (must be non-zero)
54
- */
55
- size(type?: string): number;
56
- /**
57
- * @returns {Set<string>} types available (do not mutate)
58
- */
59
- getSourceTypes(): Set<string>;
60
- /**
61
- * @returns {string | null} absolute path which should be used for condition matching (usually the resource path)
62
- */
63
- nameForCondition(): string | null;
64
- /**
65
- * @param {CodeGenerationContext} context context for code generation
66
- * @returns {CodeGenerationResult} result
67
- */
68
- codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
69
- serialize(context: any): void;
70
- /**
71
- * @param {ObjectDeserializerContext} context context
72
- * @returns {RemoteModule} deserialized module
73
- */
74
- static deserialize(context: ObjectDeserializerContext): RemoteModule;
75
- }
76
- export default RemoteModule;
@@ -1,151 +0,0 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy
4
- */ "use strict";
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function() {
11
- return _default;
12
- }
13
- });
14
- const _webpacksources = require("webpack-sources");
15
- const _Module = /*#__PURE__*/ _interop_require_default(require("webpack/lib/Module"));
16
- const _RuntimeGlobals = /*#__PURE__*/ _interop_require_default(require("webpack/lib/RuntimeGlobals"));
17
- const _makeSerializable = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/makeSerializable"));
18
- const _FallbackDependency = /*#__PURE__*/ _interop_require_default(require("./FallbackDependency"));
19
- const _RemoteToExternalDependency = /*#__PURE__*/ _interop_require_default(require("./RemoteToExternalDependency"));
20
- const _ModuleTypeConstants = require("webpack/lib/ModuleTypeConstants");
21
- function _interop_require_default(obj) {
22
- return obj && obj.__esModule ? obj : {
23
- default: obj
24
- };
25
- }
26
- const TYPES = new Set([
27
- 'remote',
28
- 'share-init'
29
- ]);
30
- const RUNTIME_REQUIREMENTS = new Set([
31
- _RuntimeGlobals.default.module
32
- ]);
33
- let RemoteModule = class RemoteModule extends _Module.default {
34
- /**
35
- * @returns {string} a unique identifier of the module
36
- */ identifier() {
37
- return this._identifier;
38
- }
39
- /**
40
- * @param {RequestShortener} requestShortener the request shortener
41
- * @returns {string} a user readable identifier of the module
42
- */ readableIdentifier(requestShortener) {
43
- return `remote ${this.request}`;
44
- }
45
- /**
46
- * @param {LibIdentOptions} options options
47
- * @returns {string | null} an identifier for library inclusion
48
- */ libIdent(options) {
49
- return `${this.layer ? `(${this.layer})/` : ''}webpack/container/remote/${this.request}`;
50
- }
51
- /**
52
- * @param {NeedBuildContext} context context info
53
- * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild
54
- * @returns {void}
55
- */ needBuild(context, callback) {
56
- callback(null, !this.buildInfo);
57
- }
58
- /**
59
- * @param {WebpackOptions} options webpack options
60
- * @param {Compilation} compilation the compilation
61
- * @param {ResolverWithOptions} resolver the resolver
62
- * @param {InputFileSystem} fs the file system
63
- * @param {function(WebpackError=): void} callback callback function
64
- * @returns {void}
65
- */ build(options, compilation, resolver, fs, callback) {
66
- this.buildMeta = {};
67
- this.buildInfo = {
68
- strict: true
69
- };
70
- this.clearDependenciesAndBlocks();
71
- if (this.externalRequests.length === 1) {
72
- this.addDependency(new _RemoteToExternalDependency.default(this.externalRequests[0]));
73
- } else {
74
- this.addDependency(new _FallbackDependency.default(this.externalRequests));
75
- }
76
- callback();
77
- }
78
- /**
79
- * @param {string=} type the source type for which the size should be estimated
80
- * @returns {number} the estimated size of the module (must be non-zero)
81
- */ size(type) {
82
- return 6;
83
- }
84
- /**
85
- * @returns {Set<string>} types available (do not mutate)
86
- */ getSourceTypes() {
87
- return TYPES;
88
- }
89
- /**
90
- * @returns {string | null} absolute path which should be used for condition matching (usually the resource path)
91
- */ nameForCondition() {
92
- return this.request;
93
- }
94
- /**
95
- * @param {CodeGenerationContext} context context for code generation
96
- * @returns {CodeGenerationResult} result
97
- */ codeGeneration(context) {
98
- const { runtimeTemplate, moduleGraph, chunkGraph } = context;
99
- const module = moduleGraph.getModule(this.dependencies[0]);
100
- const id = module && chunkGraph.getModuleId(module);
101
- const sources = new Map();
102
- sources.set('remote', new _webpacksources.RawSource(''));
103
- const data = new Map();
104
- data.set('share-init', [
105
- {
106
- shareScope: this.shareScope,
107
- initStage: 20,
108
- init: id === undefined ? '' : `initExternal(${JSON.stringify(id)});`
109
- }
110
- ]);
111
- return {
112
- sources,
113
- data,
114
- runtimeRequirements: RUNTIME_REQUIREMENTS
115
- };
116
- }
117
- serialize(context) {
118
- const { write } = context;
119
- write(this.request);
120
- write(this.externalRequests);
121
- write(this.internalRequest);
122
- write(this.shareScope);
123
- super.serialize(context);
124
- }
125
- /**
126
- * @param {ObjectDeserializerContext} context context
127
- * @returns {RemoteModule} deserialized module
128
- */ static deserialize(context) {
129
- const { read } = context;
130
- const obj = new RemoteModule(read(), read(), read(), read());
131
- obj.deserialize(context);
132
- return obj;
133
- }
134
- /**
135
- * @param {string} request request string
136
- * @param {string[]} externalRequests list of external requests to containers
137
- * @param {string} internalRequest name of exposed module in container
138
- * @param {string} shareScope the used share scope name
139
- */ constructor(request, externalRequests, internalRequest, shareScope){
140
- super(_ModuleTypeConstants.WEBPACK_MODULE_TYPE_REMOTE);
141
- this.request = request;
142
- this.externalRequests = externalRequests;
143
- this.internalRequest = internalRequest;
144
- this.shareScope = shareScope;
145
- this._identifier = `remote (${shareScope}) ${this.externalRequests.join(' ')} ${this.internalRequest}`;
146
- }
147
- };
148
- (0, _makeSerializable.default)(RemoteModule, 'enhanced/lib/container/RemoteModule');
149
- const _default = RemoteModule;
150
-
151
- //# sourceMappingURL=RemoteModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/RemoteModule.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy\n*/\n\nimport { RawSource } from 'webpack-sources';\nimport type {\n CodeGenerationContext,\n CodeGenerationResult,\n LibIdentOptions,\n NeedBuildContext,\n WebpackError,\n} from 'webpack/lib/Module';\nimport Module from 'webpack/lib/Module';\nimport RuntimeGlobals from 'webpack/lib/RuntimeGlobals';\nimport makeSerializable from 'webpack/lib/util/makeSerializable';\nimport FallbackDependency from './FallbackDependency';\nimport RemoteToExternalDependency from './RemoteToExternalDependency';\nimport type Compilation from 'webpack/lib/Compilation';\nimport type { ResolverWithOptions } from 'webpack/lib/ResolverFactory';\nimport type { InputFileSystem } from 'webpack/lib/FileSystemInfo';\nimport type { RequestShortener } from 'webpack/lib/RuntimeModule';\nimport { WEBPACK_MODULE_TYPE_REMOTE } from 'webpack/lib/ModuleTypeConstants';\nimport type { WebpackOptionsNormalized } from 'webpack/lib/WebpackOptionsDefaulter';\nimport type { ObjectDeserializerContext } from 'webpack/lib/serialization/ObjectMiddleware';\n\nconst TYPES: Set<string> = new Set(['remote', 'share-init']);\nconst RUNTIME_REQUIREMENTS: Set<string> = new Set([RuntimeGlobals.module]);\n\nclass RemoteModule extends Module {\n private _identifier: string;\n public request: string;\n public externalRequests: string[];\n public internalRequest: string;\n public shareScope: string;\n\n /**\n * @param {string} request request string\n * @param {string[]} externalRequests list of external requests to containers\n * @param {string} internalRequest name of exposed module in container\n * @param {string} shareScope the used share scope name\n */\n constructor(\n request: string,\n externalRequests: string[],\n internalRequest: string,\n shareScope: string,\n ) {\n super(WEBPACK_MODULE_TYPE_REMOTE);\n this.request = request;\n this.externalRequests = externalRequests;\n this.internalRequest = internalRequest;\n this.shareScope = shareScope;\n this._identifier = `remote (${shareScope}) ${this.externalRequests.join(\n ' ',\n )} ${this.internalRequest}`;\n }\n\n /**\n * @returns {string} a unique identifier of the module\n */\n override identifier(): string {\n return this._identifier;\n }\n\n /**\n * @param {RequestShortener} requestShortener the request shortener\n * @returns {string} a user readable identifier of the module\n */\n override readableIdentifier(requestShortener: RequestShortener): string {\n return `remote ${this.request}`;\n }\n\n /**\n * @param {LibIdentOptions} options options\n * @returns {string | null} an identifier for library inclusion\n */\n override libIdent(options: LibIdentOptions): string | null {\n return `${this.layer ? `(${this.layer})/` : ''}webpack/container/remote/${\n this.request\n }`;\n }\n\n /**\n * @param {NeedBuildContext} context context info\n * @param {function((WebpackError | null)=, boolean=): void} callback callback function, returns true, if the module needs a rebuild\n * @returns {void}\n */\n override needBuild(\n context: NeedBuildContext,\n callback: (err: WebpackError | null, needsRebuild?: boolean) => void,\n ): void {\n callback(null, !this.buildInfo);\n }\n\n /**\n * @param {WebpackOptions} options webpack options\n * @param {Compilation} compilation the compilation\n * @param {ResolverWithOptions} resolver the resolver\n * @param {InputFileSystem} fs the file system\n * @param {function(WebpackError=): void} callback callback function\n * @returns {void}\n */\n override build(\n options: WebpackOptionsNormalized,\n compilation: Compilation,\n resolver: ResolverWithOptions,\n fs: InputFileSystem,\n callback: (err?: WebpackError | undefined) => void,\n ): void {\n this.buildMeta = {};\n this.buildInfo = {\n strict: true,\n };\n\n this.clearDependenciesAndBlocks();\n if (this.externalRequests.length === 1) {\n this.addDependency(\n new RemoteToExternalDependency(this.externalRequests[0]),\n );\n } else {\n this.addDependency(new FallbackDependency(this.externalRequests));\n }\n\n callback();\n }\n\n /**\n * @param {string=} type the source type for which the size should be estimated\n * @returns {number} the estimated size of the module (must be non-zero)\n */\n override size(type?: string): number {\n return 6;\n }\n\n /**\n * @returns {Set<string>} types available (do not mutate)\n */\n override getSourceTypes(): Set<string> {\n return TYPES;\n }\n\n /**\n * @returns {string | null} absolute path which should be used for condition matching (usually the resource path)\n */\n override nameForCondition(): string | null {\n return this.request;\n }\n\n /**\n * @param {CodeGenerationContext} context context for code generation\n * @returns {CodeGenerationResult} result\n */\n override codeGeneration(\n context: CodeGenerationContext,\n ): CodeGenerationResult {\n const { runtimeTemplate, moduleGraph, chunkGraph } = context;\n const module = moduleGraph.getModule(this.dependencies[0]);\n const id = module && chunkGraph.getModuleId(module);\n const sources = new Map();\n sources.set('remote', new RawSource(''));\n const data = new Map();\n data.set('share-init', [\n {\n shareScope: this.shareScope,\n initStage: 20,\n init: id === undefined ? '' : `initExternal(${JSON.stringify(id)});`,\n },\n ]);\n return { sources, data, runtimeRequirements: RUNTIME_REQUIREMENTS };\n }\n override serialize(context: any) {\n const { write } = context;\n write(this.request);\n write(this.externalRequests);\n write(this.internalRequest);\n write(this.shareScope);\n super.serialize(context);\n }\n\n /**\n * @param {ObjectDeserializerContext} context context\n * @returns {RemoteModule} deserialized module\n */\n static deserialize(context: ObjectDeserializerContext): RemoteModule {\n const { read } = context;\n const obj = new RemoteModule(read(), read(), read(), read());\n obj.deserialize(context);\n return obj;\n }\n}\n\nmakeSerializable(RemoteModule, 'enhanced/lib/container/RemoteModule');\n\nexport default RemoteModule;\n"],"names":["TYPES","Set","RUNTIME_REQUIREMENTS","RuntimeGlobals","module","RemoteModule","Module","identifier","_identifier","readableIdentifier","requestShortener","request","libIdent","options","layer","needBuild","context","callback","buildInfo","build","compilation","resolver","fs","buildMeta","strict","clearDependenciesAndBlocks","externalRequests","length","addDependency","RemoteToExternalDependency","FallbackDependency","size","type","getSourceTypes","nameForCondition","codeGeneration","runtimeTemplate","moduleGraph","chunkGraph","getModule","dependencies","id","getModuleId","sources","Map","set","RawSource","data","shareScope","initStage","init","undefined","JSON","stringify","runtimeRequirements","serialize","write","internalRequest","deserialize","read","obj","constructor","WEBPACK_MODULE_TYPE_REMOTE","join","makeSerializable"],"mappings":"AAAA;;;AAGA;;;;+BA+LA;;;eAAA;;;gCA7L0B;+DAQP;uEACQ;yEACE;2EACE;mFACQ;qCAKI;;;;;;AAI3C,MAAMA,QAAqB,IAAIC,IAAI;IAAC;IAAU;CAAa;AAC3D,MAAMC,uBAAoC,IAAID,IAAI;IAACE,uBAAc,CAACC,MAAM;CAAC;AAEzE,IAAA,AAAMC,eAAN,MAAMA,qBAAqBC,eAAM;IA6B/B;;GAEC,GACD,AAASC,aAAqB;QAC5B,OAAO,IAAI,CAACC,WAAW;IACzB;IAEA;;;GAGC,GACD,AAASC,mBAAmBC,gBAAkC,EAAU;QACtE,OAAO,CAAC,OAAO,EAAE,IAAI,CAACC,OAAO,CAAC,CAAC;IACjC;IAEA;;;GAGC,GACD,AAASC,SAASC,OAAwB,EAAiB;QACzD,OAAO,CAAC,EAAE,IAAI,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,CAACA,KAAK,CAAC,EAAE,CAAC,GAAG,GAAG,yBAAyB,EACtE,IAAI,CAACH,OAAO,CACb,CAAC;IACJ;IAEA;;;;GAIC,GACD,AAASI,UACPC,OAAyB,EACzBC,QAAoE,EAC9D;QACNA,SAAS,MAAM,CAAC,IAAI,CAACC,SAAS;IAChC;IAEA;;;;;;;GAOC,GACD,AAASC,MACPN,OAAiC,EACjCO,WAAwB,EACxBC,QAA6B,EAC7BC,EAAmB,EACnBL,QAAkD,EAC5C;QACN,IAAI,CAACM,SAAS,GAAG,CAAC;QAClB,IAAI,CAACL,SAAS,GAAG;YACfM,QAAQ;QACV;QAEA,IAAI,CAACC,0BAA0B;QAC/B,IAAI,IAAI,CAACC,gBAAgB,CAACC,MAAM,KAAK,GAAG;YACtC,IAAI,CAACC,aAAa,CAChB,IAAIC,mCAA0B,CAAC,IAAI,CAACH,gBAAgB,CAAC,EAAE;QAE3D,OAAO;YACL,IAAI,CAACE,aAAa,CAAC,IAAIE,2BAAkB,CAAC,IAAI,CAACJ,gBAAgB;QACjE;QAEAT;IACF;IAEA;;;GAGC,GACD,AAASc,KAAKC,IAAa,EAAU;QACnC,OAAO;IACT;IAEA;;GAEC,GACD,AAASC,iBAA8B;QACrC,OAAOjC;IACT;IAEA;;GAEC,GACD,AAASkC,mBAAkC;QACzC,OAAO,IAAI,CAACvB,OAAO;IACrB;IAEA;;;GAGC,GACD,AAASwB,eACPnB,OAA8B,EACR;QACtB,MAAM,EAAEoB,eAAe,EAAEC,WAAW,EAAEC,UAAU,EAAE,GAAGtB;QACrD,MAAMZ,SAASiC,YAAYE,SAAS,CAAC,IAAI,CAACC,YAAY,CAAC,EAAE;QACzD,MAAMC,KAAKrC,UAAUkC,WAAWI,WAAW,CAACtC;QAC5C,MAAMuC,UAAU,IAAIC;QACpBD,QAAQE,GAAG,CAAC,UAAU,IAAIC,yBAAS,CAAC;QACpC,MAAMC,OAAO,IAAIH;QACjBG,KAAKF,GAAG,CAAC,cAAc;YACrB;gBACEG,YAAY,IAAI,CAACA,UAAU;gBAC3BC,WAAW;gBACXC,MAAMT,OAAOU,YAAY,KAAK,CAAC,aAAa,EAAEC,KAAKC,SAAS,CAACZ,IAAI,EAAE,CAAC;YACtE;SACD;QACD,OAAO;YAAEE;YAASI;YAAMO,qBAAqBpD;QAAqB;IACpE;IACSqD,UAAUvC,OAAY,EAAE;QAC/B,MAAM,EAAEwC,KAAK,EAAE,GAAGxC;QAClBwC,MAAM,IAAI,CAAC7C,OAAO;QAClB6C,MAAM,IAAI,CAAC9B,gBAAgB;QAC3B8B,MAAM,IAAI,CAACC,eAAe;QAC1BD,MAAM,IAAI,CAACR,UAAU;QACrB,KAAK,CAACO,UAAUvC;IAClB;IAEA;;;GAGC,GACD,OAAO0C,YAAY1C,OAAkC,EAAgB;QACnE,MAAM,EAAE2C,IAAI,EAAE,GAAG3C;QACjB,MAAM4C,MAAM,IAAIvD,aAAasD,QAAQA,QAAQA,QAAQA;QACrDC,IAAIF,WAAW,CAAC1C;QAChB,OAAO4C;IACT;IAzJA;;;;;GAKC,GACDC,YACElD,OAAe,EACfe,gBAA0B,EAC1B+B,eAAuB,EACvBT,UAAkB,CAClB;QACA,KAAK,CAACc,+CAA0B;QAChC,IAAI,CAACnD,OAAO,GAAGA;QACf,IAAI,CAACe,gBAAgB,GAAGA;QACxB,IAAI,CAAC+B,eAAe,GAAGA;QACvB,IAAI,CAACT,UAAU,GAAGA;QAClB,IAAI,CAACxC,WAAW,GAAG,CAAC,QAAQ,EAAEwC,WAAW,EAAE,EAAE,IAAI,CAACtB,gBAAgB,CAACqC,IAAI,CACrE,KACA,CAAC,EAAE,IAAI,CAACN,eAAe,CAAC,CAAC;IAC7B;AAsIF;AAEAO,IAAAA,yBAAgB,EAAC3D,cAAc;MAE/B,WAAeA"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- const _default = RemoteRuntimeModule;
12
-
13
- //# sourceMappingURL=RemoteRuntimeModule.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/container/RemoteRuntimeModule.d.ts"],"sourcesContent":["export default RemoteRuntimeModule;\n/** @typedef {import(\"webpack/lib/Chunk\")} Chunk */\n/** @typedef {import(\"./RemoteModule\")} RemoteModule */\ndeclare class RemoteRuntimeModule extends RuntimeModule {\n constructor();\n}\ndeclare namespace RemoteRuntimeModule {\n export { Chunk, RemoteModule };\n}\nimport RuntimeModule = require('webpack/lib/RuntimeModule');\ntype Chunk = import('webpack/lib/Chunk');\ntype RemoteModule = import('./RemoteModule');\n"],"names":["RemoteRuntimeModule"],"mappings":";;;;+BAAA;;;eAAA;;;MAAA,WAAeA"}
@@ -1,9 +0,0 @@
1
- import RuntimeModule from 'webpack/lib/RuntimeModule';
2
- declare class RemoteRuntimeModule extends RuntimeModule {
3
- constructor();
4
- /**
5
- * @returns {string | null} runtime code
6
- */
7
- generate(): string | null;
8
- }
9
- export default RemoteRuntimeModule;