@module-federation/enhanced 0.2.0-canary.4 → 0.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 (393) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +169 -0
  3. package/dist/package.json +83 -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/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -0
  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 +128 -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/getFederationGlobal.d.ts +5 -0
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js +26 -0
  86. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -0
  87. package/dist/src/lib/container/runtime/utils.d.ts +16 -0
  88. package/dist/src/lib/container/runtime/utils.js +83 -0
  89. package/dist/src/lib/container/runtime/utils.js.map +1 -0
  90. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +3 -0
  91. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +26 -0
  92. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -0
  93. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +99 -0
  94. package/dist/src/lib/sharing/ConsumeSharedModule.js +206 -0
  95. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -0
  96. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +30 -0
  97. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +245 -0
  98. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -0
  99. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +31 -0
  100. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +124 -0
  101. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -0
  102. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +3 -0
  103. package/dist/src/lib/sharing/ProvideForSharedDependency.js +27 -0
  104. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -0
  105. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +36 -0
  106. package/dist/src/lib/sharing/ProvideSharedDependency.js +70 -0
  107. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -0
  108. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +67 -0
  109. package/dist/src/lib/sharing/ProvideSharedModule.js +186 -0
  110. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -0
  111. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +18 -0
  112. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +30 -0
  113. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -0
  114. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +47 -0
  115. package/dist/src/lib/sharing/ProvideSharedPlugin.js +195 -0
  116. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -0
  117. package/dist/src/lib/sharing/SharePlugin.d.ts +41 -0
  118. package/dist/src/lib/sharing/SharePlugin.js +79 -0
  119. package/dist/src/lib/sharing/SharePlugin.js.map +1 -0
  120. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +14 -0
  121. package/dist/src/lib/sharing/ShareRuntimeModule.js +102 -0
  122. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -0
  123. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +12 -0
  124. package/dist/src/lib/sharing/resolveMatchedConfigs.js +66 -0
  125. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -0
  126. package/dist/src/lib/sharing/utils.d.ts +37 -0
  127. package/{src → dist/src}/lib/sharing/utils.js +109 -81
  128. package/dist/src/lib/sharing/utils.js.map +1 -0
  129. package/dist/src/rspack.d.ts +1 -0
  130. package/dist/src/rspack.js +6 -0
  131. package/dist/src/rspack.js.map +1 -0
  132. package/{src → dist/src}/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +1 -1
  133. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -0
  134. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -0
  135. package/dist/src/runtime.d.ts +1 -0
  136. package/dist/src/runtime.js +18 -0
  137. package/dist/src/runtime.js.map +1 -0
  138. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +7 -0
  139. package/dist/src/schemas/container/ContainerPlugin.check.js +2318 -0
  140. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -0
  141. package/dist/src/schemas/container/ContainerPlugin.d.ts +289 -0
  142. package/dist/src/schemas/container/ContainerPlugin.js +326 -0
  143. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -0
  144. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +7 -0
  145. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +939 -0
  146. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -0
  147. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +87 -0
  148. package/dist/src/schemas/container/ContainerReferencePlugin.js +132 -0
  149. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -0
  150. package/dist/src/schemas/container/ModuleFederationPlugin.check.d.ts +9 -0
  151. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +4001 -0
  152. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -0
  153. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.d.ts +197 -4
  154. package/{src → dist/src}/schemas/container/ModuleFederationPlugin.js +349 -177
  155. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -0
  156. package/{src/schemas/container/ModuleFederationPlugin.check.d.ts → dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts} +2 -2
  157. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +434 -0
  158. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -0
  159. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +104 -0
  160. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +119 -0
  161. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -0
  162. package/dist/src/types/runtime.d.ts +7 -0
  163. package/dist/src/types/runtime.js +3 -0
  164. package/dist/src/types/runtime.js.map +1 -0
  165. package/dist/src/webpack.d.ts +2 -0
  166. package/dist/src/webpack.js +9 -0
  167. package/dist/src/webpack.js.map +1 -0
  168. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +8 -0
  169. package/dist/src/wrapper/AsyncBoundaryPlugin.js +19 -0
  170. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -0
  171. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +8 -0
  172. package/dist/src/wrapper/ConsumeSharedPlugin.js +19 -0
  173. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -0
  174. package/dist/src/wrapper/ContainerPlugin.d.ts +8 -0
  175. package/dist/src/wrapper/ContainerPlugin.js +19 -0
  176. package/dist/src/wrapper/ContainerPlugin.js.map +1 -0
  177. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +8 -0
  178. package/dist/src/wrapper/ContainerReferencePlugin.js +19 -0
  179. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -0
  180. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +9 -0
  181. package/dist/src/wrapper/FederationRuntimePlugin.js +22 -0
  182. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -0
  183. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +7 -0
  184. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +19 -0
  185. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -0
  186. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +8 -0
  187. package/dist/src/wrapper/ModuleFederationPlugin.js +39 -0
  188. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -0
  189. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +8 -0
  190. package/dist/src/wrapper/ProvideSharedPlugin.js +19 -0
  191. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -0
  192. package/dist/src/wrapper/SharePlugin.d.ts +8 -0
  193. package/dist/src/wrapper/SharePlugin.js +19 -0
  194. package/dist/src/wrapper/SharePlugin.js.map +1 -0
  195. package/package.json +73 -7
  196. package/global.d.js +0 -14
  197. package/global.d.js.map +0 -1
  198. package/pullts.d.ts +0 -1
  199. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js +0 -14
  200. package/src/declarations/plugins/container/AsyncDependenciesBlock.d.js.map +0 -1
  201. package/src/declarations/plugins/container/ContainerPlugin.d.js +0 -12
  202. package/src/declarations/plugins/container/ContainerPlugin.d.js.map +0 -1
  203. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js +0 -12
  204. package/src/declarations/plugins/container/ContainerReferencePlugin.d.js.map +0 -1
  205. package/src/declarations/plugins/container/Dependency.d.js +0 -14
  206. package/src/declarations/plugins/container/Dependency.d.js.map +0 -1
  207. package/src/declarations/plugins/container/Module.d.js +0 -3
  208. package/src/declarations/plugins/container/Module.d.js.map +0 -1
  209. package/src/declarations/plugins/container/ModuleFactory.d.js +0 -3
  210. package/src/declarations/plugins/container/ModuleFactory.d.js.map +0 -1
  211. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js +0 -12
  212. package/src/declarations/plugins/container/ModuleFederationPlugin.d.js.map +0 -1
  213. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js +0 -6
  214. package/src/declarations/plugins/container/ObjectDeserializerContext.d.js.map +0 -1
  215. package/src/declarations/plugins/container/StaticExportsDependency.d.js +0 -14
  216. package/src/declarations/plugins/container/StaticExportsDependency.d.js.map +0 -1
  217. package/src/declarations/plugins/container/Template.d.js +0 -4
  218. package/src/declarations/plugins/container/Template.d.js.map +0 -1
  219. package/src/declarations/plugins/container/WebpackError.d.js +0 -3
  220. package/src/declarations/plugins/container/WebpackError.d.js.map +0 -1
  221. package/src/declarations/plugins/container/WebpackOptions.d.js +0 -6
  222. package/src/declarations/plugins/container/WebpackOptions.d.js.map +0 -1
  223. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js +0 -12
  224. package/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  225. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js +0 -12
  226. package/src/declarations/plugins/sharing/ProvideSharedPlugin.d.js.map +0 -1
  227. package/src/declarations/plugins/sharing/SharePlugin.d.js +0 -12
  228. package/src/declarations/plugins/sharing/SharePlugin.d.js.map +0 -1
  229. package/src/index.d.ts +0 -7
  230. package/src/index.js +0 -47
  231. package/src/index.js.map +0 -1
  232. package/src/lib/Constants.js +0 -103
  233. package/src/lib/Constants.js.map +0 -1
  234. package/src/lib/RuntimeGlobals.d.ts +0 -1
  235. package/src/lib/RuntimeGlobals.js.map +0 -1
  236. package/src/lib/container/AsyncBoundaryPlugin.d.ts +0 -16
  237. package/src/lib/container/AsyncBoundaryPlugin.js +0 -141
  238. package/src/lib/container/AsyncBoundaryPlugin.js.map +0 -1
  239. package/src/lib/container/ContainerEntryDependency.d.js +0 -4
  240. package/src/lib/container/ContainerEntryDependency.d.js.map +0 -1
  241. package/src/lib/container/ContainerEntryDependency.d.ts +0 -20
  242. package/src/lib/container/ContainerEntryDependency.js +0 -47
  243. package/src/lib/container/ContainerEntryDependency.js.map +0 -1
  244. package/src/lib/container/ContainerEntryModule.d.js +0 -14
  245. package/src/lib/container/ContainerEntryModule.d.js.map +0 -1
  246. package/src/lib/container/ContainerEntryModule.d.ts +0 -85
  247. package/src/lib/container/ContainerEntryModule.js +0 -281
  248. package/src/lib/container/ContainerEntryModule.js.map +0 -1
  249. package/src/lib/container/ContainerEntryModuleFactory.d.js +0 -4
  250. package/src/lib/container/ContainerEntryModuleFactory.d.js.map +0 -1
  251. package/src/lib/container/ContainerEntryModuleFactory.d.ts +0 -10
  252. package/src/lib/container/ContainerEntryModuleFactory.js +0 -37
  253. package/src/lib/container/ContainerEntryModuleFactory.js.map +0 -1
  254. package/src/lib/container/ContainerExposedDependency.d.js +0 -4
  255. package/src/lib/container/ContainerExposedDependency.d.js.map +0 -1
  256. package/src/lib/container/ContainerExposedDependency.d.ts +0 -26
  257. package/src/lib/container/ContainerExposedDependency.js +0 -57
  258. package/src/lib/container/ContainerExposedDependency.js.map +0 -1
  259. package/src/lib/container/ContainerPlugin.d.js +0 -4
  260. package/src/lib/container/ContainerPlugin.d.js.map +0 -1
  261. package/src/lib/container/ContainerPlugin.d.ts +0 -11
  262. package/src/lib/container/ContainerPlugin.js +0 -92
  263. package/src/lib/container/ContainerPlugin.js.map +0 -1
  264. package/src/lib/container/ContainerReferencePlugin.d.js +0 -4
  265. package/src/lib/container/ContainerReferencePlugin.d.js.map +0 -1
  266. package/src/lib/container/ContainerReferencePlugin.js +0 -141
  267. package/src/lib/container/ContainerReferencePlugin.js.map +0 -1
  268. package/src/lib/container/FallbackDependency.d.js +0 -14
  269. package/src/lib/container/FallbackDependency.d.js.map +0 -1
  270. package/src/lib/container/FallbackDependency.d.ts +0 -25
  271. package/src/lib/container/FallbackDependency.js +0 -59
  272. package/src/lib/container/FallbackDependency.js.map +0 -1
  273. package/src/lib/container/FallbackItemDependency.d.js +0 -4
  274. package/src/lib/container/FallbackItemDependency.d.js.map +0 -1
  275. package/src/lib/container/FallbackItemDependency.d.ts +0 -10
  276. package/src/lib/container/FallbackItemDependency.js +0 -37
  277. package/src/lib/container/FallbackItemDependency.js.map +0 -1
  278. package/src/lib/container/FallbackModule.d.js +0 -4
  279. package/src/lib/container/FallbackModule.d.js.map +0 -1
  280. package/src/lib/container/FallbackModule.d.ts +0 -73
  281. package/src/lib/container/FallbackModule.js +0 -153
  282. package/src/lib/container/FallbackModule.js.map +0 -1
  283. package/src/lib/container/FallbackModuleFactory.d.js +0 -4
  284. package/src/lib/container/FallbackModuleFactory.d.js.map +0 -1
  285. package/src/lib/container/FallbackModuleFactory.d.ts +0 -10
  286. package/src/lib/container/FallbackModuleFactory.js +0 -35
  287. package/src/lib/container/FallbackModuleFactory.js.map +0 -1
  288. package/src/lib/container/HoistContainerReferencesPlugin.d.ts +0 -19
  289. package/src/lib/container/HoistContainerReferencesPlugin.js +0 -78
  290. package/src/lib/container/HoistContainerReferencesPlugin.js.map +0 -1
  291. package/src/lib/container/ModuleFederationPlugin.d.js +0 -4
  292. package/src/lib/container/ModuleFederationPlugin.d.js.map +0 -1
  293. package/src/lib/container/ModuleFederationPlugin.d.ts +0 -16
  294. package/src/lib/container/ModuleFederationPlugin.js +0 -85
  295. package/src/lib/container/ModuleFederationPlugin.js.map +0 -1
  296. package/src/lib/container/ModuleFederationPluginTypes.d.js +0 -12
  297. package/src/lib/container/ModuleFederationPluginTypes.d.js.map +0 -1
  298. package/src/lib/container/RemoteModule.d.js +0 -13
  299. package/src/lib/container/RemoteModule.d.js.map +0 -1
  300. package/src/lib/container/RemoteModule.d.ts +0 -76
  301. package/src/lib/container/RemoteModule.js +0 -151
  302. package/src/lib/container/RemoteModule.js.map +0 -1
  303. package/src/lib/container/RemoteRuntimeModule.d.js +0 -13
  304. package/src/lib/container/RemoteRuntimeModule.d.js.map +0 -1
  305. package/src/lib/container/RemoteRuntimeModule.d.ts +0 -9
  306. package/src/lib/container/RemoteRuntimeModule.js +0 -124
  307. package/src/lib/container/RemoteRuntimeModule.js.map +0 -1
  308. package/src/lib/container/RemoteToExternalDependency.d.js +0 -19
  309. package/src/lib/container/RemoteToExternalDependency.d.js.map +0 -1
  310. package/src/lib/container/RemoteToExternalDependency.js +0 -37
  311. package/src/lib/container/RemoteToExternalDependency.js.map +0 -1
  312. package/src/lib/container/options.d.js +0 -6
  313. package/src/lib/container/options.d.js.map +0 -1
  314. package/src/lib/container/options.js.map +0 -1
  315. package/src/lib/inversion/ContainerInversionPlugin.d.ts +0 -1
  316. package/src/lib/inversion/ContainerInversionPlugin.js +0 -3
  317. package/src/lib/inversion/ContainerInversionPlugin.js.map +0 -1
  318. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js +0 -4
  319. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.js.map +0 -1
  320. package/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +0 -10
  321. package/src/lib/sharing/ConsumeSharedFallbackDependency.js +0 -37
  322. package/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +0 -1
  323. package/src/lib/sharing/ConsumeSharedModule.d.js +0 -4
  324. package/src/lib/sharing/ConsumeSharedModule.d.js.map +0 -1
  325. package/src/lib/sharing/ConsumeSharedModule.d.ts +0 -106
  326. package/src/lib/sharing/ConsumeSharedModule.js +0 -235
  327. package/src/lib/sharing/ConsumeSharedModule.js.map +0 -1
  328. package/src/lib/sharing/ConsumeSharedPlugin.d.js +0 -4
  329. package/src/lib/sharing/ConsumeSharedPlugin.d.js.map +0 -1
  330. package/src/lib/sharing/ConsumeSharedPlugin.d.ts +0 -8
  331. package/src/lib/sharing/ConsumeSharedPlugin.js +0 -274
  332. package/src/lib/sharing/ConsumeSharedPlugin.js.map +0 -1
  333. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js +0 -4
  334. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.js.map +0 -1
  335. package/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +0 -13
  336. package/src/lib/sharing/ConsumeSharedRuntimeModule.js +0 -294
  337. package/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +0 -1
  338. package/src/lib/sharing/ProvideForSharedDependency.d.js +0 -4
  339. package/src/lib/sharing/ProvideForSharedDependency.d.js.map +0 -1
  340. package/src/lib/sharing/ProvideForSharedDependency.d.ts +0 -11
  341. package/src/lib/sharing/ProvideForSharedDependency.js +0 -38
  342. package/src/lib/sharing/ProvideForSharedDependency.js.map +0 -1
  343. package/src/lib/sharing/ProvideSharedDependency.d.js +0 -14
  344. package/src/lib/sharing/ProvideSharedDependency.d.js.map +0 -1
  345. package/src/lib/sharing/ProvideSharedDependency.d.ts +0 -32
  346. package/src/lib/sharing/ProvideSharedDependency.js +0 -69
  347. package/src/lib/sharing/ProvideSharedDependency.js.map +0 -1
  348. package/src/lib/sharing/ProvideSharedModule.d.js +0 -4
  349. package/src/lib/sharing/ProvideSharedModule.d.js.map +0 -1
  350. package/src/lib/sharing/ProvideSharedModule.d.ts +0 -79
  351. package/src/lib/sharing/ProvideSharedModule.js +0 -203
  352. package/src/lib/sharing/ProvideSharedModule.js.map +0 -1
  353. package/src/lib/sharing/ProvideSharedModuleFactory.d.js +0 -4
  354. package/src/lib/sharing/ProvideSharedModuleFactory.d.js.map +0 -1
  355. package/src/lib/sharing/ProvideSharedModuleFactory.d.ts +0 -11
  356. package/src/lib/sharing/ProvideSharedModuleFactory.js +0 -36
  357. package/src/lib/sharing/ProvideSharedModuleFactory.js.map +0 -1
  358. package/src/lib/sharing/ProvideSharedPlugin.d.js +0 -4
  359. package/src/lib/sharing/ProvideSharedPlugin.d.js.map +0 -1
  360. package/src/lib/sharing/ProvideSharedPlugin.d.ts +0 -34
  361. package/src/lib/sharing/ProvideSharedPlugin.js +0 -182
  362. package/src/lib/sharing/ProvideSharedPlugin.js.map +0 -1
  363. package/src/lib/sharing/SharePlugin.d.js +0 -4
  364. package/src/lib/sharing/SharePlugin.d.js.map +0 -1
  365. package/src/lib/sharing/SharePlugin.d.ts +0 -15
  366. package/src/lib/sharing/SharePlugin.js +0 -77
  367. package/src/lib/sharing/SharePlugin.js.map +0 -1
  368. package/src/lib/sharing/ShareRuntimeModule.d.js +0 -4
  369. package/src/lib/sharing/ShareRuntimeModule.d.js.map +0 -1
  370. package/src/lib/sharing/ShareRuntimeModule.d.ts +0 -9
  371. package/src/lib/sharing/ShareRuntimeModule.js +0 -161
  372. package/src/lib/sharing/ShareRuntimeModule.js.map +0 -1
  373. package/src/lib/sharing/resolveMatchedConfigs.d.js +0 -6
  374. package/src/lib/sharing/resolveMatchedConfigs.d.js.map +0 -1
  375. package/src/lib/sharing/resolveMatchedConfigs.d.ts +0 -8
  376. package/src/lib/sharing/resolveMatchedConfigs.js +0 -73
  377. package/src/lib/sharing/resolveMatchedConfigs.js.map +0 -1
  378. package/src/lib/sharing/utils.d.js +0 -6
  379. package/src/lib/sharing/utils.d.js.map +0 -1
  380. package/src/lib/sharing/utils.d.ts +0 -33
  381. package/src/lib/sharing/utils.js.map +0 -1
  382. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +0 -34
  383. package/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +0 -1
  384. package/src/runtime/ModuleInfoRuntimeModule.d.ts +0 -16
  385. package/src/runtime/ModuleInfoRuntimeModule.js +0 -88
  386. package/src/runtime/ModuleInfoRuntimeModule.js.map +0 -1
  387. package/src/runtime/ModuleInfoRuntimePlugin.d.ts +0 -5
  388. package/src/runtime/ModuleInfoRuntimePlugin.js +0 -29
  389. package/src/runtime/ModuleInfoRuntimePlugin.js.map +0 -1
  390. package/src/schemas/container/ModuleFederationPlugin.check.js +0 -2245
  391. package/src/schemas/container/ModuleFederationPlugin.check.js.map +0 -1
  392. package/src/schemas/container/ModuleFederationPlugin.js.map +0 -1
  393. /package/{src → dist/src}/lib/Constants.d.ts +0 -0
@@ -1,73 +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, "resolveMatchedConfigs", {
9
- enumerable: true,
10
- get: function() {
11
- return resolveMatchedConfigs;
12
- }
13
- });
14
- const _ModuleNotFoundError = /*#__PURE__*/ _interop_require_default(require("webpack/lib/ModuleNotFoundError"));
15
- const _LazySet = /*#__PURE__*/ _interop_require_default(require("webpack/lib/util/LazySet"));
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
21
- const RESOLVE_OPTIONS = {
22
- dependencyType: 'esm'
23
- };
24
- async function resolveMatchedConfigs(compilation, configs) {
25
- const resolved = new Map();
26
- const unresolved = new Map();
27
- const prefixed = new Map();
28
- const resolveContext = {
29
- fileDependencies: new _LazySet.default(),
30
- contextDependencies: new _LazySet.default(),
31
- missingDependencies: new _LazySet.default()
32
- };
33
- const resolver = compilation.resolverFactory.get('normal', RESOLVE_OPTIONS);
34
- const context = compilation.compiler.context;
35
- await Promise.all(//@ts-ignore
36
- configs.map(([request, config])=>{
37
- if (/^\.\.?(\/|$)/.test(request)) {
38
- // relative request
39
- return new Promise((resolve)=>{
40
- resolver.resolve({}, context, request, resolveContext, (err, result)=>{
41
- if (err || result === false) {
42
- err = err || new Error(`Can't resolve ${request}`);
43
- compilation.errors.push(new _ModuleNotFoundError.default(null, err, {
44
- name: `shared module ${request}`
45
- }));
46
- return resolve();
47
- }
48
- resolved.set(result, config);
49
- resolve();
50
- });
51
- });
52
- } else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
53
- // absolute path
54
- resolved.set(request, config);
55
- } else if (request.endsWith('/')) {
56
- // module request prefix
57
- prefixed.set(request, config);
58
- } else {
59
- // module request
60
- unresolved.set(request, config);
61
- }
62
- }));
63
- compilation.contextDependencies.addAll(resolveContext.contextDependencies);
64
- compilation.fileDependencies.addAll(resolveContext.fileDependencies);
65
- compilation.missingDependencies.addAll(resolveContext.missingDependencies);
66
- return {
67
- resolved,
68
- unresolved,
69
- prefixed
70
- };
71
- }
72
-
73
- //# sourceMappingURL=resolveMatchedConfigs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/sharing/resolveMatchedConfigs.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy\n*/\nimport type Compilation from 'webpack/lib/Compilation';\nimport type { ResolveOptionsWithDependencyType } from 'webpack/lib/ResolverFactory';\nimport ModuleNotFoundError from 'webpack/lib/ModuleNotFoundError';\nimport LazySet from 'webpack/lib/util/LazySet';\n\ninterface MatchedConfigs<T> {\n resolved: Map<string, T>;\n unresolved: Map<string, T>;\n prefixed: Map<string, T>;\n}\n\nconst RESOLVE_OPTIONS: ResolveOptionsWithDependencyType = {\n dependencyType: 'esm',\n};\n\nexport async function resolveMatchedConfigs<T>(\n compilation: Compilation,\n configs: [string, T][],\n): Promise<MatchedConfigs<T>> {\n const resolved = new Map<string, T>();\n const unresolved = new Map<string, T>();\n const prefixed = new Map<string, T>();\n const resolveContext = {\n fileDependencies: new LazySet<string>(),\n contextDependencies: new LazySet<string>(),\n missingDependencies: new LazySet<string>(),\n };\n const resolver = compilation.resolverFactory.get('normal', RESOLVE_OPTIONS);\n const context = compilation.compiler.context;\n\n await Promise.all(\n //@ts-ignore\n configs.map(([request, config]) => {\n if (/^\\.\\.?(\\/|$)/.test(request)) {\n // relative request\n return new Promise<void>((resolve) => {\n resolver.resolve(\n {},\n context,\n request,\n resolveContext,\n (err, result) => {\n if (err || result === false) {\n err = err || new Error(`Can't resolve ${request}`);\n compilation.errors.push(\n new ModuleNotFoundError(null, err, {\n name: `shared module ${request}`,\n }),\n );\n return resolve();\n }\n resolved.set(result as string, config);\n resolve();\n },\n );\n });\n } else if (/^(\\/|[A-Za-z]:\\\\|\\\\\\\\)/.test(request)) {\n // absolute path\n resolved.set(request, config);\n } else if (request.endsWith('/')) {\n // module request prefix\n prefixed.set(request, config);\n } else {\n // module request\n unresolved.set(request, config);\n }\n }),\n );\n compilation.contextDependencies.addAll(resolveContext.contextDependencies);\n compilation.fileDependencies.addAll(resolveContext.fileDependencies);\n compilation.missingDependencies.addAll(resolveContext.missingDependencies);\n return { resolved, unresolved, prefixed };\n}\n"],"names":["resolveMatchedConfigs","RESOLVE_OPTIONS","dependencyType","compilation","configs","resolved","Map","unresolved","prefixed","resolveContext","fileDependencies","LazySet","contextDependencies","missingDependencies","resolver","resolverFactory","get","context","compiler","Promise","all","map","request","config","test","resolve","err","result","Error","errors","push","ModuleNotFoundError","name","set","endsWith","addAll"],"mappings":"AAAA;;;AAGA;;;;+BAgBsBA;;;eAAAA;;;4EAbU;gEACZ;;;;;;AAQpB,MAAMC,kBAAoD;IACxDC,gBAAgB;AAClB;AAEO,eAAeF,sBACpBG,WAAwB,EACxBC,OAAsB;IAEtB,MAAMC,WAAW,IAAIC;IACrB,MAAMC,aAAa,IAAID;IACvB,MAAME,WAAW,IAAIF;IACrB,MAAMG,iBAAiB;QACrBC,kBAAkB,IAAIC,gBAAO;QAC7BC,qBAAqB,IAAID,gBAAO;QAChCE,qBAAqB,IAAIF,gBAAO;IAClC;IACA,MAAMG,WAAWX,YAAYY,eAAe,CAACC,GAAG,CAAC,UAAUf;IAC3D,MAAMgB,UAAUd,YAAYe,QAAQ,CAACD,OAAO;IAE5C,MAAME,QAAQC,GAAG,CACf,YAAY;IACZhB,QAAQiB,GAAG,CAAC,CAAC,CAACC,SAASC,OAAO;QAC5B,IAAI,eAAeC,IAAI,CAACF,UAAU;YAChC,mBAAmB;YACnB,OAAO,IAAIH,QAAc,CAACM;gBACxBX,SAASW,OAAO,CACd,CAAC,GACDR,SACAK,SACAb,gBACA,CAACiB,KAAKC;oBACJ,IAAID,OAAOC,WAAW,OAAO;wBAC3BD,MAAMA,OAAO,IAAIE,MAAM,CAAC,cAAc,EAAEN,QAAQ,CAAC;wBACjDnB,YAAY0B,MAAM,CAACC,IAAI,CACrB,IAAIC,4BAAmB,CAAC,MAAML,KAAK;4BACjCM,MAAM,CAAC,cAAc,EAAEV,QAAQ,CAAC;wBAClC;wBAEF,OAAOG;oBACT;oBACApB,SAAS4B,GAAG,CAACN,QAAkBJ;oBAC/BE;gBACF;YAEJ;QACF,OAAO,IAAI,yBAAyBD,IAAI,CAACF,UAAU;YACjD,gBAAgB;YAChBjB,SAAS4B,GAAG,CAACX,SAASC;QACxB,OAAO,IAAID,QAAQY,QAAQ,CAAC,MAAM;YAChC,wBAAwB;YACxB1B,SAASyB,GAAG,CAACX,SAASC;QACxB,OAAO;YACL,iBAAiB;YACjBhB,WAAW0B,GAAG,CAACX,SAASC;QAC1B;IACF;IAEFpB,YAAYS,mBAAmB,CAACuB,MAAM,CAAC1B,eAAeG,mBAAmB;IACzET,YAAYO,gBAAgB,CAACyB,MAAM,CAAC1B,eAAeC,gBAAgB;IACnEP,YAAYU,mBAAmB,CAACsB,MAAM,CAAC1B,eAAeI,mBAAmB;IACzE,OAAO;QAAER;QAAUE;QAAYC;IAAS;AAC1C"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=utils.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/sharing/utils.d.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- import { InputFileSystem } from 'webpack/lib/util/fs';
2
- /**
3
- * @param {string} str maybe required version
4
- * @returns {boolean} true, if it looks like a version
5
- */
6
- declare function isRequiredVersion(str: string): boolean;
7
- export { isRequiredVersion };
8
- /**
9
- * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies
10
- * @param {string} versionDesc version to be normalized
11
- * @returns {string} normalized version
12
- */
13
- declare function normalizeVersion(versionDesc: string): string;
14
- export { normalizeVersion };
15
- /**
16
- *
17
- * @param {InputFileSystem} fs file system
18
- * @param {string} directory directory to start looking into
19
- * @param {string[]} descriptionFiles possible description filenames
20
- * @param {function((Error | null)=, {data: object, path: string}=): void} callback callback
21
- */
22
- declare const getDescriptionFile: (fs: InputFileSystem, directory: string, descriptionFiles: string[], callback: (err: Error | null, data?: {
23
- data: object;
24
- path: string;
25
- } | undefined) => void) => void;
26
- export { getDescriptionFile };
27
- /**
28
- * Get required version from description file
29
- * @param {Record<string, any>} data - The data object
30
- * @param {string} packageName - The package name
31
- * @returns {string | undefined} The normalized version
32
- */
33
- export declare function getRequiredVersionFromDescriptionFile(data: Record<string, any>, packageName: string): string | undefined | void;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../packages/enhanced/src/lib/sharing/utils.ts"],"sourcesContent":["/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nimport { join, dirname, readJson, InputFileSystem } from 'webpack/lib/util/fs';\n\n// Extreme shorthand only for github. eg: foo/bar\nconst RE_URL_GITHUB_EXTREME_SHORT: RegExp =\n /^[^/@:.\\s][^/@:\\s]*\\/[^@:\\s]*[^/@:\\s]#\\S+/;\n\n// Short url with specific protocol. eg: github:foo/bar\nconst RE_GIT_URL_SHORT: RegExp =\n /^(github|gitlab|bitbucket|gist):\\/?[^/.]+\\/?/i;\n\n// Currently supported protocols\nconst RE_PROTOCOL: RegExp =\n /^((git\\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;\n\n// Has custom protocol\nconst RE_CUSTOM_PROTOCOL: RegExp = /^((git\\+)?(ssh|https?|file)|git):\\/\\//i;\n\n// Valid hash format for npm / yarn ...\nconst RE_URL_HASH_VERSION: RegExp = /#(?:semver:)?(.+)/;\n\n// Simple hostname validate\nconst RE_HOSTNAME: RegExp = /^(?:[^/.]+(\\.[^/]+)+|localhost)$/;\n\n// For hostname with colon. eg: ssh://user@github.com:foo/bar\nconst RE_HOSTNAME_WITH_COLON: RegExp =\n /([^/@#:.]+(?:\\.[^/@#:.]+)+|localhost):([^#/0-9]+)/;\n\n// Reg for url without protocol\nconst RE_NO_PROTOCOL: RegExp = /^([^/@#:.]+(?:\\.[^/@#:.]+)+)/;\n\n// RegExp for version string\nconst VERSION_PATTERN_REGEXP: RegExp = /^([\\d^=v<>~]|[*xX]$)/;\n\n// Specific protocol for short url without normal hostname\nconst PROTOCOLS_FOR_SHORT: string[] = [\n 'github:',\n 'gitlab:',\n 'bitbucket:',\n 'gist:',\n 'file:',\n];\n\n// Default protocol for git url\nconst DEF_GIT_PROTOCOL: string = 'git+ssh://';\n\n// thanks to https://github.com/npm/hosted-git-info/blob/latest/git-host-info.js\nconst extractCommithashByDomain: {\n [key: string]: (pathname: string, hash: string) => string | undefined;\n} = {\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'github.com': (pathname: string, hash: string) => {\n const [, user, project, type, commithash] = pathname.split('/', 5);\n if (type && type !== 'tree') {\n return;\n }\n\n let commithashResult = commithash;\n if (!type) {\n commithashResult = hash;\n } else {\n commithashResult = '#' + commithash;\n }\n\n let projectResult = project;\n if (project && project.endsWith('.git')) {\n projectResult = project.slice(0, -4);\n }\n\n if (!user || !projectResult) {\n return;\n }\n\n return commithashResult;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'gitlab.com': (pathname: string, hash: string) => {\n const path = pathname.slice(1);\n if (path.includes('/-/') || path.includes('/archive.tar.gz')) {\n return;\n }\n\n const segments = path.split('/');\n let project = segments.pop();\n if (project && project.endsWith('.git')) {\n project = project.slice(0, -4);\n }\n\n const user = segments.join('/');\n if (!user || !project) {\n return;\n }\n\n return hash;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'bitbucket.org': (pathname: string, hash: string) => {\n const [, user, project, aux] = pathname.split('/', 4);\n if (['get'].includes(aux)) {\n return;\n }\n\n let projectResult = project;\n if (project && project.endsWith('.git')) {\n projectResult = project.slice(0, -4);\n }\n\n if (!user || !projectResult) {\n return;\n }\n\n return hash;\n },\n /**\n * @param {string} pathname pathname\n * @param {string} hash hash\n * @returns {string | undefined} hash\n */\n 'gist.github.com': (pathname: string, hash: string) => {\n const [, user, project, aux] = pathname.split('/', 4);\n if (aux === 'raw') {\n return;\n }\n\n let projectResult = project;\n if (!projectResult) {\n if (!user) {\n return;\n }\n\n projectResult = user;\n }\n\n if (projectResult.endsWith('.git')) {\n projectResult = projectResult.slice(0, -4);\n }\n\n return hash;\n },\n};\n\n/**\n * extract commit hash from parsed url\n *\n * @inner\n * @param {URL} urlParsed parsed url\n * @returns {string} commithash\n */\nfunction getCommithash(urlParsed: URL): string {\n const { hostname, pathname, hash } = urlParsed;\n const hostnameResult = hostname.replace(/^www\\./, '');\n\n let hashResult = hash;\n try {\n hashResult = decodeURIComponent(hash);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n if (\n /** @type {keyof extractCommithashByDomain} */ extractCommithashByDomain[\n hostnameResult\n ]\n ) {\n return (\n extractCommithashByDomain\n /** @type {keyof extractCommithashByDomain} */ [hostnameResult](\n pathname,\n hashResult,\n ) || ''\n );\n }\n\n return hashResult;\n}\n\n/**\n * make url right for URL parse\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} fixed url\n */\nfunction correctUrl(gitUrl: string): string {\n // like:\n // proto://hostname.com:user/repo -> proto://hostname.com/user/repo\n return gitUrl.replace(RE_HOSTNAME_WITH_COLON, '$1/$2');\n}\n\n/**\n * make url protocol right for URL parse\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} fixed url\n */\nfunction correctProtocol(gitUrl: string): string {\n // eg: github:foo/bar#v1.0. Should not add double slash, in case of error parsed `pathname`\n if (RE_GIT_URL_SHORT.test(gitUrl)) {\n return gitUrl;\n }\n\n // eg: user@github.com:foo/bar\n if (!RE_CUSTOM_PROTOCOL.test(gitUrl)) {\n return `${DEF_GIT_PROTOCOL}${gitUrl}`;\n }\n\n return gitUrl;\n}\n\n/**\n * extract git dep version from hash\n *\n * @inner\n * @param {string} hash hash\n * @returns {string} git dep version\n */\nfunction getVersionFromHash(hash: string): string {\n const matched = hash.match(RE_URL_HASH_VERSION);\n\n return (matched && matched[1]) || '';\n}\n\n/**\n * if string can be decoded\n *\n * @inner\n * @param {string} str str to be checked\n * @returns {boolean} if can be decoded\n */\nfunction canBeDecoded(str: string): boolean {\n try {\n decodeURIComponent(str);\n } catch (e) {\n return false;\n }\n\n return true;\n}\n\n/**\n * get right dep version from git url\n *\n * @inner\n * @param {string} gitUrl git url\n * @returns {string} dep version\n */\nfunction getGitUrlVersion(gitUrl: string): string {\n const oriGitUrl = gitUrl;\n // github extreme shorthand\n if (RE_URL_GITHUB_EXTREME_SHORT.test(gitUrl)) {\n gitUrl = 'github:' + gitUrl;\n } else {\n gitUrl = correctProtocol(gitUrl);\n }\n\n gitUrl = correctUrl(gitUrl);\n\n let parsed;\n try {\n parsed = new URL(gitUrl);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n\n if (!parsed) {\n return '';\n }\n\n const { protocol, hostname, pathname, username, password } = parsed;\n if (!RE_PROTOCOL.test(protocol)) {\n return '';\n }\n\n // pathname shouldn't be empty or URL malformed\n if (!pathname || !canBeDecoded(pathname)) {\n return '';\n }\n\n // without protocol, there should have auth info\n if (RE_NO_PROTOCOL.test(oriGitUrl) && !username && !password) {\n return '';\n }\n\n if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {\n if (!RE_HOSTNAME.test(hostname)) {\n return '';\n }\n\n const commithash = getCommithash(parsed);\n return getVersionFromHash(commithash) || commithash;\n }\n\n // for protocol short\n return getVersionFromHash(gitUrl);\n}\n\n/**\n * @param {string} str maybe required version\n * @returns {boolean} true, if it looks like a version\n */\nfunction isRequiredVersion(str: string): boolean {\n return VERSION_PATTERN_REGEXP.test(str);\n}\n\nexport { isRequiredVersion };\n\n/**\n * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies\n * @param {string} versionDesc version to be normalized\n * @returns {string} normalized version\n */\nfunction normalizeVersion(versionDesc: string): string {\n versionDesc = (versionDesc && versionDesc.trim()) || '';\n\n if (isRequiredVersion(versionDesc)) {\n return versionDesc;\n }\n\n // add handle for URL Dependencies\n return getGitUrlVersion(versionDesc.toLowerCase());\n}\n\nexport { normalizeVersion };\n\n/**\n *\n * @param {InputFileSystem} fs file system\n * @param {string} directory directory to start looking into\n * @param {string[]} descriptionFiles possible description filenames\n * @param {function((Error | null)=, {data: object, path: string}=): void} callback callback\n */\nconst getDescriptionFile = (\n fs: InputFileSystem,\n directory: string,\n descriptionFiles: string[],\n callback: (err: Error | null, data?: { data: object; path: string }) => void,\n) => {\n let i = 0;\n const tryLoadCurrent = () => {\n if (i >= descriptionFiles.length) {\n const parentDirectory = dirname(fs, directory);\n if (!parentDirectory || parentDirectory === directory) {\n //@ts-ignore\n return callback();\n }\n return getDescriptionFile(\n fs,\n parentDirectory,\n descriptionFiles,\n callback,\n );\n }\n const filePath = join(fs, directory, descriptionFiles[i]);\n readJson(fs, filePath, (err, data: object) => {\n if (err) {\n if ('code' in err && err.code === 'ENOENT') {\n i++;\n return tryLoadCurrent();\n }\n return callback(err);\n }\n if (!data || typeof data !== 'object' || Array.isArray(data)) {\n return callback(\n new Error(`Description file ${filePath} is not an object`),\n );\n }\n callback(null, { data, path: filePath });\n });\n };\n tryLoadCurrent();\n};\nexport { getDescriptionFile };\n/**\n * Get required version from description file\n * @param {Record<string, any>} data - The data object\n * @param {string} packageName - The package name\n * @returns {string | undefined} The normalized version\n */\nexport function getRequiredVersionFromDescriptionFile(\n data: Record<string, any>,\n packageName: string,\n): string | undefined | void {\n if (\n data['optionalDependencies'] &&\n typeof data['optionalDependencies'] === 'object' &&\n packageName in data['optionalDependencies']\n ) {\n return normalizeVersion(data['optionalDependencies'][packageName]);\n }\n if (\n data['dependencies'] &&\n typeof data['dependencies'] === 'object' &&\n packageName in data['dependencies']\n ) {\n return normalizeVersion(data['dependencies'][packageName]);\n }\n if (\n data['peerDependencies'] &&\n typeof data['peerDependencies'] === 'object' &&\n packageName in data['peerDependencies']\n ) {\n return normalizeVersion(data['peerDependencies'][packageName]);\n }\n if (\n data['devDependencies'] &&\n typeof data['devDependencies'] === 'object' &&\n packageName in data['devDependencies']\n ) {\n return normalizeVersion(data['devDependencies'][packageName]);\n }\n}\n"],"names":["getDescriptionFile","getRequiredVersionFromDescriptionFile","isRequiredVersion","normalizeVersion","RE_URL_GITHUB_EXTREME_SHORT","RE_GIT_URL_SHORT","RE_PROTOCOL","RE_CUSTOM_PROTOCOL","RE_URL_HASH_VERSION","RE_HOSTNAME","RE_HOSTNAME_WITH_COLON","RE_NO_PROTOCOL","VERSION_PATTERN_REGEXP","PROTOCOLS_FOR_SHORT","DEF_GIT_PROTOCOL","extractCommithashByDomain","pathname","hash","user","project","type","commithash","split","commithashResult","projectResult","endsWith","slice","path","includes","segments","pop","join","aux","getCommithash","urlParsed","hostname","hostnameResult","replace","hashResult","decodeURIComponent","e","correctUrl","gitUrl","correctProtocol","test","getVersionFromHash","matched","match","canBeDecoded","str","getGitUrlVersion","oriGitUrl","parsed","URL","protocol","username","password","toLowerCase","versionDesc","trim","fs","directory","descriptionFiles","callback","i","tryLoadCurrent","length","parentDirectory","dirname","filePath","readJson","err","data","code","Array","isArray","Error","packageName"],"mappings":"AAAA;;;AAGA;;;;;;;;;;;IA+XSA,kBAAkB;eAAlBA;;IAOOC,qCAAqC;eAArCA;;IA1EPC,iBAAiB;eAAjBA;;IAkBAC,gBAAgB;eAAhB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oBACA,OAAOC;gBACT;gBACA,OAAOF,SAASQ;YAClB;YACA,IAAI,CAACC,QAAQ,OAAOA,SAAS,YAAYE,MAAMC,OAAO,CAACH,OAAO;gBAC5D,OAAOT,SACL,IAAIa,MAAM,CAAC,iBAAiB,EAAEP,SAAS,iBAAiB,CAAC;YAE7D;YACAN,SAAS,MAAM;gBAAES;gBAAM7C,MAAM0C;YAAS;QACxC;IACF;IACAJ;AACF;AAQO,SAAShE,sCACduE,IAAyB,EACzBK,WAAmB;IAEnB,IACEL,IAAI,CAAC,uBAAuB,IAC5B,OAAOA,IAAI,CAAC,uBAAuB,KAAK,YACxCK,eAAeL,IAAI,CAAC,uBAAuB,EAC3C;QACA,OAAOrE,iBAAiBqE,IAAI,CAAC,uBAAuB,CAACK,YAAY;IACnE;IACA,IACEL,IAAI,CAAC,eAAe,IACpB,OAAOA,IAAI,CAAC,eAAe,KAAK,YAChCK,eAAeL,IAAI,CAAC,eAAe,EACnC;QACA,OAAOrE,iBAAiBqE,IAAI,CAAC,eAAe,CAACK,YAAY;IAC3D;IACA,IACEL,IAAI,CAAC,mBAAmB,IACxB,OAAOA,IAAI,CAAC,mBAAmB,KAAK,YACpCK,eAAeL,IAAI,CAAC,mBAAmB,EACvC;QACA,OAAOrE,iBAAiBqE,IAAI,CAAC,mBAAmB,CAACK,YAAY;IAC/D;IACA,IACEL,IAAI,CAAC,kBAAkB,IACvB,OAAOA,IAAI,CAAC,kBAAkB,KAAK,YACnCK,eAAeL,IAAI,CAAC,kBAAkB,EACtC;QACA,OAAOrE,iBAAiBqE,IAAI,CAAC,kBAAkB,CAACK,YAAY;IAC9D;AACF"}
@@ -1,34 +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
- AddRuntimeRequirementToPromiseExternal: function() {
13
- return AddRuntimeRequirementToPromiseExternal;
14
- },
15
- default: function() {
16
- return _default;
17
- }
18
- });
19
- let AddRuntimeRequirementToPromiseExternal = class AddRuntimeRequirementToPromiseExternal {
20
- apply(compiler) {
21
- compiler.hooks.compilation.tap('AddRuntimeRequirementToPromiseExternal', (compilation)=>{
22
- const { RuntimeGlobals } = compiler.webpack;
23
- compilation.hooks.additionalModuleRuntimeRequirements.tap('AddRuntimeRequirementToPromiseExternal', (module, set)=>{
24
- if (module.externalType === 'promise') {
25
- set.add(RuntimeGlobals.loadScript);
26
- set.add(RuntimeGlobals.require);
27
- }
28
- });
29
- });
30
- }
31
- };
32
- const _default = AddRuntimeRequirementToPromiseExternal;
33
-
34
- //# sourceMappingURL=AddRuntimeRequirementToPromiseExternalPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../packages/enhanced/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.ts"],"sourcesContent":["import { Compiler } from 'webpack';\n\nexport class AddRuntimeRequirementToPromiseExternal {\n apply(compiler: Compiler) {\n compiler.hooks.compilation.tap(\n 'AddRuntimeRequirementToPromiseExternal',\n (compilation) => {\n const { RuntimeGlobals } = compiler.webpack;\n compilation.hooks.additionalModuleRuntimeRequirements.tap(\n 'AddRuntimeRequirementToPromiseExternal',\n (module, set) => {\n if ((module as any).externalType === 'promise') {\n set.add(RuntimeGlobals.loadScript);\n set.add(RuntimeGlobals.require);\n }\n },\n );\n },\n );\n }\n}\n\nexport default AddRuntimeRequirementToPromiseExternal;\n"],"names":["AddRuntimeRequirementToPromiseExternal","apply","compiler","hooks","compilation","tap","RuntimeGlobals","webpack","additionalModuleRuntimeRequirements","module","set","externalType","add","loadScript","require"],"mappings":";;;;;;;;;;;IAEaA,sCAAsC;eAAtCA;;IAoBb,OAAsD;eAAtD;;;AApBO,IAAA,AAAMA,yCAAN,MAAMA;IACXC,MAAMC,QAAkB,EAAE;QACxBA,SAASC,KAAK,CAACC,WAAW,CAACC,GAAG,CAC5B,0CACA,CAACD;YACC,MAAM,EAAEE,cAAc,EAAE,GAAGJ,SAASK,OAAO;YAC3CH,YAAYD,KAAK,CAACK,mCAAmC,CAACH,GAAG,CACvD,0CACA,CAACI,QAAQC;gBACP,IAAI,AAACD,OAAeE,YAAY,KAAK,WAAW;oBAC9CD,IAAIE,GAAG,CAACN,eAAeO,UAAU;oBACjCH,IAAIE,GAAG,CAACN,eAAeQ,OAAO;gBAChC;YACF;QAEJ;IAEJ;AACF;MAEA,WAAed"}
@@ -1,16 +0,0 @@
1
- import { RuntimeModule } from 'webpack';
2
- /**
3
- * Class representing a runtime module for federation module info.
4
- * @extends RuntimeModule
5
- */
6
- export declare class ModuleInfoRuntimeModule extends RuntimeModule {
7
- /**
8
- * Create a ModuleInfoRuntimeModule.
9
- */
10
- constructor();
11
- /**
12
- * Generate runtime code.
13
- * @returns {string} The generated runtime code.
14
- */
15
- generate(): string;
16
- }
@@ -1,88 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ModuleInfoRuntimeModule", {
6
- enumerable: true,
7
- get: function() {
8
- return ModuleInfoRuntimeModule;
9
- }
10
- });
11
- const _webpack = require("webpack");
12
- let ModuleInfoRuntimeModule = class ModuleInfoRuntimeModule extends _webpack.RuntimeModule {
13
- /**
14
- * Generate runtime code.
15
- * @returns {string} The generated runtime code.
16
- */ generate() {
17
- return _webpack.Template.asString([
18
- `${_webpack.RuntimeGlobals.require}.federation = {`,
19
- _webpack.Template.indent([
20
- `cache: {},`,
21
- `remotes: {},`,
22
- `moduleInfo: {}, `
23
- ]),
24
- `};`,
25
- 'var createProxyGetter = function() {',
26
- _webpack.Template.indent([
27
- 'return function(target, prop, receiver) {',
28
- _webpack.Template.indent([
29
- 'var result;',
30
- "if (prop === '_config') {",
31
- _webpack.Template.indent('result = target.remotes;'),
32
- "} else if (prop === 'moduleInfo') {",
33
- _webpack.Template.indent('result = target[prop];'),
34
- '} else {',
35
- _webpack.Template.indent('result = target.cache[prop];'),
36
- '}',
37
- 'return result;'
38
- ]),
39
- '};'
40
- ]),
41
- '};',
42
- 'var createProxySetter = function() {',
43
- _webpack.Template.indent([
44
- 'return function(target, prop, value) {',
45
- _webpack.Template.indent([
46
- "if (prop === '_config') {",
47
- _webpack.Template.indent([
48
- 'target.remotes = value;'
49
- ]),
50
- '} else {',
51
- _webpack.Template.indent([
52
- 'target.cache[prop] = value;'
53
- ]),
54
- '}',
55
- 'return true;'
56
- ]),
57
- '};'
58
- ]),
59
- '};',
60
- 'let oldScope = globalThis.__remote_scope__ || {};',
61
- `if(${_webpack.RuntimeGlobals.runtimeId} === 'webpack-runtime' && globalThis.__remote_scope__) {`,
62
- 'globalThis.__remote_scope__ = {}',
63
- `}`,
64
- 'if (!globalThis.__remote_scope__ || !globalThis.__remote_scope__.moduleInfo) {',
65
- `globalThis.__remote_scope__ = new Proxy(${_webpack.RuntimeGlobals.require}.federation, {`,
66
- 'get: createProxyGetter(),',
67
- 'set: createProxySetter()',
68
- `});`,
69
- 'if(!oldScope.moduleInfo) {',
70
- 'for (let key in oldScope._config) {',
71
- 'globalThis.__remote_scope__._config[key] = oldScope[key];',
72
- '}',
73
- 'for (let key in oldScope) {',
74
- "if(key === '_config' || !oldScope[key]) continue;",
75
- 'globalThis.__remote_scope__[key] = oldScope[key];',
76
- '}',
77
- '}',
78
- '}'
79
- ]);
80
- }
81
- /**
82
- * Create a ModuleInfoRuntimeModule.
83
- */ constructor(){
84
- super('federation module info runtime', _webpack.RuntimeModule.STAGE_BASIC);
85
- }
86
- };
87
-
88
- //# sourceMappingURL=ModuleInfoRuntimeModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../packages/enhanced/src/runtime/ModuleInfoRuntimeModule.ts"],"sourcesContent":["'use strict';\n\nimport { RuntimeGlobals, RuntimeModule, Template } from 'webpack';\n\n/**\n * Class representing a runtime module for federation module info.\n * @extends RuntimeModule\n */\nexport class ModuleInfoRuntimeModule extends RuntimeModule {\n /**\n * Create a ModuleInfoRuntimeModule.\n */\n constructor() {\n super('federation module info runtime', RuntimeModule.STAGE_BASIC);\n }\n\n /**\n * Generate runtime code.\n * @returns {string} The generated runtime code.\n */\n override generate(): string {\n return Template.asString([\n `${RuntimeGlobals.require}.federation = {`,\n Template.indent([`cache: {},`, `remotes: {},`, `moduleInfo: {}, `]),\n `};`,\n 'var createProxyGetter = function() {',\n Template.indent([\n 'return function(target, prop, receiver) {',\n Template.indent([\n 'var result;',\n \"if (prop === '_config') {\",\n Template.indent('result = target.remotes;'),\n \"} else if (prop === 'moduleInfo') {\",\n Template.indent('result = target[prop];'),\n '} else {',\n Template.indent('result = target.cache[prop];'),\n '}',\n 'return result;',\n ]),\n '};',\n ]),\n '};',\n 'var createProxySetter = function() {',\n Template.indent([\n 'return function(target, prop, value) {',\n Template.indent([\n \"if (prop === '_config') {\",\n Template.indent(['target.remotes = value;']),\n '} else {',\n Template.indent(['target.cache[prop] = value;']),\n '}',\n 'return true;',\n ]),\n '};',\n ]),\n '};',\n 'let oldScope = globalThis.__remote_scope__ || {};',\n `if(${RuntimeGlobals.runtimeId} === 'webpack-runtime' && globalThis.__remote_scope__) {`,\n 'globalThis.__remote_scope__ = {}',\n `}`,\n 'if (!globalThis.__remote_scope__ || !globalThis.__remote_scope__.moduleInfo) {',\n `globalThis.__remote_scope__ = new Proxy(${RuntimeGlobals.require}.federation, {`,\n 'get: createProxyGetter(),',\n 'set: createProxySetter()',\n `});`,\n 'if(!oldScope.moduleInfo) {',\n 'for (let key in oldScope._config) {',\n 'globalThis.__remote_scope__._config[key] = oldScope[key];',\n '}',\n 'for (let key in oldScope) {',\n \"if(key === '_config' || !oldScope[key]) continue;\",\n 'globalThis.__remote_scope__[key] = oldScope[key];',\n '}',\n '}',\n '}',\n ]);\n }\n}\n"],"names":["ModuleInfoRuntimeModule","RuntimeModule","generate","Template","asString","RuntimeGlobals","require","indent","runtimeId","constructor","STAGE_BASIC"],"mappings":"AAAA;;;;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leInfoRuntimePlugin {
3
- apply(compiler: Compiler): void;
4
- }
5
- export { ModuleInfoRuntimePlugin };
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ModuleInfoRuntimePlugin", {
6
- enumerable: true,
7
- get: function() {
8
- return ModuleInfoRuntimePlugin;
9
- }
10
- });
11
- const _webpack = require("webpack");
12
- const _ModuleInfoRuntimeModule = require("./ModuleInfoRuntimeModule");
13
- let ModuleInfoRuntimePlugin = class ModuleInfoRuntimePlugin {
14
- apply(compiler) {
15
- compiler.hooks.thisCompilation.tap('ModuleInfoPlugin', (compilation)=>{
16
- compilation.hooks.additionalTreeRuntimeRequirements.tap('ModuleInfoRuntimeModule', (chunk, set)=>{
17
- //workaround
18
- if (set.has('__webpack_require__.federation')) return;
19
- //TODO: this should be added as a handler, so one can push requirements in and we call the for tap to add module once.
20
- set.add('__webpack_require__.federation');
21
- set.add(_webpack.RuntimeGlobals.global);
22
- set.add(_webpack.RuntimeGlobals.runtimeId);
23
- compilation.addRuntimeModule(chunk, new _ModuleInfoRuntimeModule.ModuleInfoRuntimeModule());
24
- });
25
- });
26
- }
27
- };
28
-
29
- //# sourceMappingURL=ModuleInfoRuntimePlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../packages/enhanced/src/runtime/ModuleInfoRuntimePlugin.ts"],"sourcesContent":["import { Compilation, RuntimeGlobals, Compiler } from 'webpack';\nimport { ModuleInfoRuntimeModule } from './ModuleInfoRuntimeModule';\n\nclass ModuleInfoRuntimePlugin {\n apply(compiler: Compiler) {\n compiler.hooks.thisCompilation.tap(\n 'ModuleInfoPlugin',\n (compilation: Compilation) => {\n compilation.hooks.additionalTreeRuntimeRequirements.tap(\n 'ModuleInfoRuntimeModule',\n (chunk, set) => {\n //workaround\n if (set.has('__webpack_require__.federation')) return;\n //TODO: this should be added as a handler, so one can push requirements in and we call the for tap to add module once.\n set.add('__webpack_require__.federation');\n\n set.add(RuntimeGlobals.global);\n\n set.add(RuntimeGlobals.runtimeId);\n compilation.addRuntimeModule(chunk, new ModuleInfoRuntimeModule());\n },\n );\n },\n );\n }\n}\n\nexport { ModuleInfoRuntimePlugin };\n"],"names":["ModuleInfoRuntimePlugin","apply","compiler","hooks","thisCompilation","tap","compilation","additionalTreeRuntimeRequirements","chunk","set","has","add","RuntimeGlobals","global","runtimeId","addRuntimeModule","ModuleInfoRuntimeModule"],"mappings":";;;;+BA2BSA;;;eAAAA;;;yBA3B6C;yCACd;AAExC,IAAA,AAAMA,0BAAN,MAAMA;IACJC,MAAMC,QAAkB,EAAE;QACxBA,SAASC,KAAK,CAACC,eAAe,CAACC,GAAG,CAChC,oBACA,CAACC;YACCA,YAAYH,KAAK,CAACI,iCAAiC,CAACF,GAAG,CACrD,2BACA,CAACG,OAAOC;gBACN,YAAY;gBACZ,IAAIA,IAAIC,GAAG,CAAC,mCAAmC;gBAC/C,sHAAsH;gBACtHD,IAAIE,GAAG,CAAC;gBAERF,IAAIE,GAAG,CAACC,uBAAc,CAACC,MAAM;gBAE7BJ,IAAIE,GAAG,CAACC,uBAAc,CAACE,SAAS;gBAChCR,YAAYS,gBAAgB,CAACP,OAAO,IAAIQ,gDAAuB;YACjE;QAEJ;IAEJ;AACF"}