@module-federation/enhanced 0.0.0-perf-devtools-20260107043700 → 0.0.0-perf-website-code-usage-20260914033703

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 (289) hide show
  1. package/README.md +1 -1
  2. package/dist/CHANGELOG.md +2678 -0
  3. package/dist/README.md +213 -0
  4. package/dist/rstestmigrate.md +140 -0
  5. package/dist/src/_virtual/_rolldown/runtime.js +47 -0
  6. package/dist/src/index.d.ts +22 -18
  7. package/dist/src/index.js +47 -41
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/lib/Constants.js +136 -116
  10. package/dist/src/lib/Constants.js.map +1 -1
  11. package/dist/src/lib/container/AsyncBoundaryPlugin.d.ts +20 -16
  12. package/dist/src/lib/container/AsyncBoundaryPlugin.js +137 -196
  13. package/dist/src/lib/container/AsyncBoundaryPlugin.js.map +1 -1
  14. package/dist/src/lib/container/ContainerEntryDependency.d.ts +25 -23
  15. package/dist/src/lib/container/ContainerEntryDependency.js +37 -39
  16. package/dist/src/lib/container/ContainerEntryDependency.js.map +1 -1
  17. package/dist/src/lib/container/ContainerEntryModule.d.ts +104 -79
  18. package/dist/src/lib/container/ContainerEntryModule.js +213 -234
  19. package/dist/src/lib/container/ContainerEntryModule.js.map +1 -1
  20. package/dist/src/lib/container/ContainerEntryModuleFactory.d.ts +15 -10
  21. package/dist/src/lib/container/ContainerEntryModuleFactory.js +21 -25
  22. package/dist/src/lib/container/ContainerEntryModuleFactory.js.map +1 -1
  23. package/dist/src/lib/container/ContainerExposedDependency.d.ts +26 -23
  24. package/dist/src/lib/container/ContainerExposedDependency.js +47 -47
  25. package/dist/src/lib/container/ContainerExposedDependency.js.map +1 -1
  26. package/dist/src/lib/container/ContainerPlugin.d.ts +12 -8
  27. package/dist/src/lib/container/ContainerPlugin.js +144 -213
  28. package/dist/src/lib/container/ContainerPlugin.js.map +1 -1
  29. package/dist/src/lib/container/ContainerReferencePlugin.d.ts +16 -12
  30. package/dist/src/lib/container/ContainerReferencePlugin.js +72 -101
  31. package/dist/src/lib/container/ContainerReferencePlugin.js.map +1 -1
  32. package/dist/src/lib/container/FallbackDependency.d.ts +24 -19
  33. package/dist/src/lib/container/FallbackDependency.js +46 -44
  34. package/dist/src/lib/container/FallbackDependency.js.map +1 -1
  35. package/dist/src/lib/container/FallbackItemDependency.d.ts +13 -8
  36. package/dist/src/lib/container/FallbackItemDependency.js +24 -24
  37. package/dist/src/lib/container/FallbackItemDependency.js.map +1 -1
  38. package/dist/src/lib/container/FallbackModule.d.ts +82 -71
  39. package/dist/src/lib/container/FallbackModule.js +133 -145
  40. package/dist/src/lib/container/FallbackModule.js.map +1 -1
  41. package/dist/src/lib/container/FallbackModuleFactory.d.ts +15 -10
  42. package/dist/src/lib/container/FallbackModuleFactory.js +20 -24
  43. package/dist/src/lib/container/FallbackModuleFactory.js.map +1 -1
  44. package/dist/src/lib/container/HoistContainerReferencesPlugin.d.ts +11 -7
  45. package/dist/src/lib/container/HoistContainerReferencesPlugin.js +124 -188
  46. package/dist/src/lib/container/HoistContainerReferencesPlugin.js.map +1 -1
  47. package/dist/src/lib/container/ModuleFederationPlugin.d.ts +20 -16
  48. package/dist/src/lib/container/ModuleFederationPlugin.js +151 -170
  49. package/dist/src/lib/container/ModuleFederationPlugin.js.map +1 -1
  50. package/dist/src/lib/container/RemoteModule.d.ts +83 -74
  51. package/dist/src/lib/container/RemoteModule.js +149 -153
  52. package/dist/src/lib/container/RemoteModule.js.map +1 -1
  53. package/dist/src/lib/container/RemoteRuntimeModule.d.ts +12 -7
  54. package/dist/src/lib/container/RemoteRuntimeModule.js +86 -120
  55. package/dist/src/lib/container/RemoteRuntimeModule.js.map +1 -1
  56. package/dist/src/lib/container/RemoteToExternalDependency.d.ts +13 -8
  57. package/dist/src/lib/container/RemoteToExternalDependency.js +25 -23
  58. package/dist/src/lib/container/RemoteToExternalDependency.js.map +1 -1
  59. package/dist/src/lib/container/constant.d.ts +3 -0
  60. package/dist/src/lib/container/constant.js +11 -14
  61. package/dist/src/lib/container/constant.js.map +1 -1
  62. package/dist/src/lib/container/options.d.ts +12 -3
  63. package/dist/src/lib/container/options.js +51 -69
  64. package/dist/src/lib/container/options.js.map +1 -1
  65. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.d.ts +14 -9
  66. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js +56 -64
  67. package/dist/src/lib/container/runtime/EmbedFederationRuntimeModule.js.map +1 -1
  68. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.d.ts +23 -19
  69. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js +70 -101
  70. package/dist/src/lib/container/runtime/EmbedFederationRuntimePlugin.js.map +1 -1
  71. package/dist/src/lib/container/runtime/FederationModulesPlugin.d.ts +20 -16
  72. package/dist/src/lib/container/runtime/FederationModulesPlugin.js +38 -46
  73. package/dist/src/lib/container/runtime/FederationModulesPlugin.js.map +1 -1
  74. package/dist/src/lib/container/runtime/FederationRuntimeDependency.d.ts +9 -4
  75. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js +16 -12
  76. package/dist/src/lib/container/runtime/FederationRuntimeDependency.js.map +1 -1
  77. package/dist/src/lib/container/runtime/FederationRuntimeModule.d.ts +16 -11
  78. package/dist/src/lib/container/runtime/FederationRuntimeModule.js +39 -46
  79. package/dist/src/lib/container/runtime/FederationRuntimeModule.js.map +1 -1
  80. package/dist/src/lib/container/runtime/FederationRuntimePlugin.d.ts +31 -18
  81. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js +263 -293
  82. package/dist/src/lib/container/runtime/FederationRuntimePlugin.js.map +1 -1
  83. package/dist/src/lib/container/runtime/getFederationGlobal.d.ts +9 -4
  84. package/dist/src/lib/container/runtime/getFederationGlobal.js +43 -41
  85. package/dist/src/lib/container/runtime/getFederationGlobal.js.map +1 -1
  86. package/dist/src/lib/container/runtime/normalizeToPosixPath.d.ts +5 -0
  87. package/dist/src/lib/container/runtime/normalizeToPosixPath.js +20 -0
  88. package/dist/src/lib/container/runtime/normalizeToPosixPath.js.map +1 -0
  89. package/dist/src/lib/container/runtime/utils.d.ts +22 -7
  90. package/dist/src/lib/container/runtime/utils.js +80 -102
  91. package/dist/src/lib/container/runtime/utils.js.map +1 -1
  92. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.d.ts +15 -10
  93. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js +27 -25
  94. package/dist/src/lib/sharing/ConsumeSharedFallbackDependency.js.map +1 -1
  95. package/dist/src/lib/sharing/ConsumeSharedModule.d.ts +77 -67
  96. package/dist/src/lib/sharing/ConsumeSharedModule.js +190 -214
  97. package/dist/src/lib/sharing/ConsumeSharedModule.js.map +1 -1
  98. package/dist/src/lib/sharing/ConsumeSharedPlugin.d.ts +13 -9
  99. package/dist/src/lib/sharing/ConsumeSharedPlugin.js +308 -472
  100. package/dist/src/lib/sharing/ConsumeSharedPlugin.js.map +1 -1
  101. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.d.ts +16 -11
  102. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js +108 -123
  103. package/dist/src/lib/sharing/ConsumeSharedRuntimeModule.js.map +1 -1
  104. package/dist/src/lib/sharing/ProvideForSharedDependency.d.ts +14 -9
  105. package/dist/src/lib/sharing/ProvideForSharedDependency.js +25 -25
  106. package/dist/src/lib/sharing/ProvideForSharedDependency.js.map +1 -1
  107. package/dist/src/lib/sharing/ProvideSharedDependency.d.ts +44 -38
  108. package/dist/src/lib/sharing/ProvideSharedDependency.js +72 -74
  109. package/dist/src/lib/sharing/ProvideSharedDependency.js.map +1 -1
  110. package/dist/src/lib/sharing/ProvideSharedModule.d.ts +91 -81
  111. package/dist/src/lib/sharing/ProvideSharedModule.js +177 -181
  112. package/dist/src/lib/sharing/ProvideSharedModule.js.map +1 -1
  113. package/dist/src/lib/sharing/ProvideSharedModuleFactory.d.ts +14 -9
  114. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js +19 -25
  115. package/dist/src/lib/sharing/ProvideSharedModuleFactory.js.map +1 -1
  116. package/dist/src/lib/sharing/ProvideSharedPlugin.d.ts +27 -21
  117. package/dist/src/lib/sharing/ProvideSharedPlugin.js +341 -548
  118. package/dist/src/lib/sharing/ProvideSharedPlugin.js.map +1 -1
  119. package/dist/src/lib/sharing/SharePlugin.d.ts +55 -12
  120. package/dist/src/lib/sharing/SharePlugin.js +91 -91
  121. package/dist/src/lib/sharing/SharePlugin.js.map +1 -1
  122. package/dist/src/lib/sharing/ShareRuntimeModule.d.ts +12 -7
  123. package/dist/src/lib/sharing/ShareRuntimeModule.js +81 -99
  124. package/dist/src/lib/sharing/ShareRuntimeModule.js.map +1 -1
  125. package/dist/src/lib/sharing/resolveMatchedConfigs.d.ts +11 -7
  126. package/dist/src/lib/sharing/resolveMatchedConfigs.js +58 -71
  127. package/dist/src/lib/sharing/resolveMatchedConfigs.js.map +1 -1
  128. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.d.ts +25 -0
  129. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js +85 -0
  130. package/dist/src/lib/sharing/tree-shaking/CollectSharedEntryPlugin.js.map +1 -0
  131. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.d.ts +41 -0
  132. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js +227 -0
  133. package/dist/src/lib/sharing/tree-shaking/IndependentSharedPlugin.js.map +1 -0
  134. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.d.ts +26 -0
  135. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js +32 -0
  136. package/dist/src/lib/sharing/tree-shaking/IndependentSharedRuntimeModule.js.map +1 -0
  137. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.d.ts +32 -0
  138. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js +94 -0
  139. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedContainerPlugin.js.map +1 -0
  140. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.d.ts +31 -0
  141. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js +49 -0
  142. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedDependency.js.map +1 -0
  143. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.d.ts +22 -0
  144. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js +35 -0
  145. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryDependency.js.map +1 -0
  146. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.d.ts +87 -0
  147. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js +144 -0
  148. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModule.js.map +1 -0
  149. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.d.ts +16 -0
  150. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js +23 -0
  151. package/dist/src/lib/sharing/tree-shaking/SharedContainerPlugin/SharedEntryModuleFactory.js.map +1 -0
  152. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.d.ts +23 -0
  153. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js +163 -0
  154. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerPlugin.js.map +1 -0
  155. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.d.ts +22 -0
  156. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js +28 -0
  157. package/dist/src/lib/sharing/tree-shaking/SharedUsedExportsOptimizerRuntimeModule.js.map +1 -0
  158. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.d.ts +20 -0
  159. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js +44 -0
  160. package/dist/src/lib/sharing/tree-shaking/TreeShakingSharedPlugin.js.map +1 -0
  161. package/dist/src/lib/sharing/utils.d.ts +27 -23
  162. package/dist/src/lib/sharing/utils.js +224 -366
  163. package/dist/src/lib/sharing/utils.js.map +1 -1
  164. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.d.ts +11 -7
  165. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js +56 -75
  166. package/dist/src/lib/startup/MfStartupChunkDependenciesPlugin.js.map +1 -1
  167. package/dist/src/lib/startup/StartupHelpers.d.ts +11 -6
  168. package/dist/src/lib/startup/StartupHelpers.js +128 -178
  169. package/dist/src/lib/startup/StartupHelpers.js.map +1 -1
  170. package/dist/src/rspack.d.ts +3 -2
  171. package/dist/src/rspack.js +35 -10
  172. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.d.ts +8 -4
  173. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js +19 -16
  174. package/dist/src/runtime/AddRuntimeRequirementToPromiseExternalPlugin.js.map +1 -1
  175. package/dist/src/runtime.d.ts +1 -1
  176. package/dist/src/runtime.js +11 -18
  177. package/dist/src/runtime.mjs +3 -0
  178. package/dist/src/schemas/container/ContainerPlugin.check.d.ts +13 -5
  179. package/dist/src/schemas/container/ContainerPlugin.check.js +767 -1220
  180. package/dist/src/schemas/container/ContainerPlugin.check.js.map +1 -1
  181. package/dist/src/schemas/container/ContainerPlugin.d.ts +267 -268
  182. package/dist/src/schemas/container/ContainerPlugin.js +269 -361
  183. package/dist/src/schemas/container/ContainerPlugin.js.map +1 -1
  184. package/dist/src/schemas/container/ContainerReferencePlugin.check.d.ts +13 -5
  185. package/dist/src/schemas/container/ContainerReferencePlugin.check.js +335 -443
  186. package/dist/src/schemas/container/ContainerReferencePlugin.check.js.map +1 -1
  187. package/dist/src/schemas/container/ContainerReferencePlugin.d.ts +102 -99
  188. package/dist/src/schemas/container/ContainerReferencePlugin.js +122 -162
  189. package/dist/src/schemas/container/ContainerReferencePlugin.js.map +1 -1
  190. package/dist/src/schemas/container/ExternalsType.check.d.ts +13 -5
  191. package/dist/src/schemas/container/ExternalsType.check.js +36 -62
  192. package/dist/src/schemas/container/ExternalsType.check.js.map +1 -1
  193. package/dist/src/schemas/container/ExternalsType.d.ts +5 -2
  194. package/dist/src/schemas/container/ExternalsType.js +8 -11
  195. package/dist/src/schemas/container/ExternalsType.js.map +1 -1
  196. package/dist/src/schemas/container/ModuleFederationPlugin.check.js +3020 -4301
  197. package/dist/src/schemas/container/ModuleFederationPlugin.check.js.map +1 -1
  198. package/dist/src/schemas/container/ModuleFederationPlugin.d.ts +828 -758
  199. package/dist/src/schemas/container/ModuleFederationPlugin.js +788 -993
  200. package/dist/src/schemas/container/ModuleFederationPlugin.js.map +1 -1
  201. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.d.ts +13 -5
  202. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js +568 -739
  203. package/dist/src/schemas/sharing/ConsumeSharedPlugin.check.js.map +1 -1
  204. package/dist/src/schemas/sharing/ConsumeSharedPlugin.d.ts +197 -189
  205. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js +212 -233
  206. package/dist/src/schemas/sharing/ConsumeSharedPlugin.js.map +1 -1
  207. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.d.ts +13 -5
  208. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js +598 -775
  209. package/dist/src/schemas/sharing/ProvideSharedPlugin.check.js.map +1 -1
  210. package/dist/src/schemas/sharing/ProvideSharedPlugin.d.ts +184 -176
  211. package/dist/src/schemas/sharing/ProvideSharedPlugin.js +196 -224
  212. package/dist/src/schemas/sharing/ProvideSharedPlugin.js.map +1 -1
  213. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.d.ts +12 -4
  214. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js +285 -482
  215. package/dist/src/schemas/sharing/ProviderSharedPlugin.check.js.map +1 -1
  216. package/dist/src/schemas/sharing/ProviderSharedPlugin.d.ts +103 -100
  217. package/dist/src/schemas/sharing/ProviderSharedPlugin.js +104 -126
  218. package/dist/src/schemas/sharing/ProviderSharedPlugin.js.map +1 -1
  219. package/dist/src/schemas/sharing/SharePlugin.check.d.ts +13 -5
  220. package/dist/src/schemas/sharing/SharePlugin.check.js +749 -794
  221. package/dist/src/schemas/sharing/SharePlugin.check.js.map +1 -1
  222. package/dist/src/schemas/sharing/SharePlugin.d.ts +245 -205
  223. package/dist/src/schemas/sharing/SharePlugin.js +256 -253
  224. package/dist/src/schemas/sharing/SharePlugin.js.map +1 -1
  225. package/dist/src/utils.d.ts +3 -0
  226. package/dist/src/utils.js +35 -26
  227. package/dist/src/utils.js.map +1 -1
  228. package/dist/src/webpack.d.ts +2 -2
  229. package/dist/src/webpack.js +6 -40
  230. package/dist/src/wrapper/AsyncBoundaryPlugin.d.ts +9 -7
  231. package/dist/src/wrapper/AsyncBoundaryPlugin.js +13 -17
  232. package/dist/src/wrapper/AsyncBoundaryPlugin.js.map +1 -1
  233. package/dist/src/wrapper/BaseWrapperPlugin.d.ts +32 -0
  234. package/dist/src/wrapper/BaseWrapperPlugin.js +43 -0
  235. package/dist/src/wrapper/BaseWrapperPlugin.js.map +1 -0
  236. package/dist/src/wrapper/ConsumeSharedPlugin.d.ts +10 -7
  237. package/dist/src/wrapper/ConsumeSharedPlugin.js +13 -17
  238. package/dist/src/wrapper/ConsumeSharedPlugin.js.map +1 -1
  239. package/dist/src/wrapper/ContainerPlugin.d.ts +9 -7
  240. package/dist/src/wrapper/ContainerPlugin.js +13 -17
  241. package/dist/src/wrapper/ContainerPlugin.js.map +1 -1
  242. package/dist/src/wrapper/ContainerReferencePlugin.d.ts +9 -7
  243. package/dist/src/wrapper/ContainerReferencePlugin.js +13 -17
  244. package/dist/src/wrapper/ContainerReferencePlugin.js.map +1 -1
  245. package/dist/src/wrapper/FederationModulesPlugin.d.ts +18 -10
  246. package/dist/src/wrapper/FederationModulesPlugin.js +20 -21
  247. package/dist/src/wrapper/FederationModulesPlugin.js.map +1 -1
  248. package/dist/src/wrapper/FederationRuntimePlugin.d.ts +11 -8
  249. package/dist/src/wrapper/FederationRuntimePlugin.js +19 -20
  250. package/dist/src/wrapper/FederationRuntimePlugin.js.map +1 -1
  251. package/dist/src/wrapper/HoistContainerReferencesPlugin.d.ts +8 -5
  252. package/dist/src/wrapper/HoistContainerReferencesPlugin.js +13 -16
  253. package/dist/src/wrapper/HoistContainerReferencesPlugin.js.map +1 -1
  254. package/dist/src/wrapper/ModuleFederationPlugin.d.ts +12 -9
  255. package/dist/src/wrapper/ModuleFederationPlugin.js +71 -104
  256. package/dist/src/wrapper/ModuleFederationPlugin.js.map +1 -1
  257. package/dist/src/wrapper/ProvideSharedPlugin.d.ts +10 -7
  258. package/dist/src/wrapper/ProvideSharedPlugin.js +13 -17
  259. package/dist/src/wrapper/ProvideSharedPlugin.js.map +1 -1
  260. package/dist/src/wrapper/SharePlugin.d.ts +10 -7
  261. package/dist/src/wrapper/SharePlugin.js +13 -17
  262. package/dist/src/wrapper/SharePlugin.js.map +1 -1
  263. package/dist/src/wrapper/TreeShakingSharedPlugin.d.ts +10 -0
  264. package/dist/src/wrapper/TreeShakingSharedPlugin.js +15 -0
  265. package/dist/src/wrapper/TreeShakingSharedPlugin.js.map +1 -0
  266. package/package.json +27 -29
  267. package/dist/package.json +0 -110
  268. package/dist/src/declarations/plugins/container/AsyncDependenciesBlock.d.ts +0 -57
  269. package/dist/src/declarations/plugins/container/ModuleFactory.d.ts +0 -33
  270. package/dist/src/declarations/plugins/container/ObjectDeserializerContext.d.ts +0 -4
  271. package/dist/src/declarations/plugins/container/StaticExportsDependency.d.ts +0 -28
  272. package/dist/src/declarations/plugins/container/Template.d.ts +0 -198
  273. package/dist/src/declarations/plugins/container/WebpackError.d.ts +0 -33
  274. package/dist/src/declarations/plugins/sharing/ConsumeSharedModule.d.ts +0 -82
  275. package/dist/src/declarations/plugins/sharing/ConsumeSharedPlugin.d.ts +0 -96
  276. package/dist/src/declarations/plugins/sharing/ProvideSharedPlugin.d.ts +0 -98
  277. package/dist/src/declarations/plugins/sharing/SharePlugin.d.ts +0 -108
  278. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.d.ts +0 -20
  279. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js +0 -219
  280. package/dist/src/lib/container/runtime/ChildCompilationRuntimePlugin.js.map +0 -1
  281. package/dist/src/prefetch.d.ts +0 -2
  282. package/dist/src/prefetch.js +0 -8
  283. package/dist/src/prefetch.js.map +0 -1
  284. package/dist/src/rspack.js.map +0 -1
  285. package/dist/src/runtime.js.map +0 -1
  286. package/dist/src/types/runtime.d.ts +0 -10
  287. package/dist/src/types/runtime.js +0 -3
  288. package/dist/src/types/runtime.js.map +0 -1
  289. package/dist/src/webpack.js.map +0 -1
@@ -1,414 +1,272 @@
1
- "use strict";
2
- /*
3
- MIT License http://www.opensource.org/licenses/mit-license.php
4
- Author Tobias Koppers @sokra
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeVersion = normalizeVersion;
8
- exports.getDescriptionFile = getDescriptionFile;
9
- exports.getRequiredVersionFromDescriptionFile = getRequiredVersionFromDescriptionFile;
10
- exports.normalizeConsumeShareOptions = normalizeConsumeShareOptions;
11
- exports.addSingletonFilterWarning = addSingletonFilterWarning;
12
- exports.testRequestFilters = testRequestFilters;
13
- exports.createLookupKeyForSharing = createLookupKeyForSharing;
14
- exports.extractPathAfterNodeModules = extractPathAfterNodeModules;
15
- const sdk_1 = require("@module-federation/sdk");
16
- const normalize_webpack_path_1 = require("@module-federation/sdk/normalize-webpack-path");
17
- const { join, dirname, readJson } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack/lib/util/fs'));
18
- const { WebpackError } = require((0, normalize_webpack_path_1.normalizeWebpackPath)('webpack'));
19
- // Extreme shorthand only for github. eg: foo/bar
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
3
+ let _module_federation_sdk = require("@module-federation/sdk");
4
+ let _module_federation_sdk_normalize_webpack_path = require("@module-federation/sdk/normalize-webpack-path");
5
+
6
+ //#region src/lib/sharing/utils.ts
7
+ const { join, dirname, readJson } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack/lib/util/fs"));
8
+ const { WebpackError } = require((0, _module_federation_sdk_normalize_webpack_path.normalizeWebpackPath)("webpack"));
20
9
  const RE_URL_GITHUB_EXTREME_SHORT = /^[^/@:.\s][^/@:\s]*\/[^@:\s]*[^/@:\s]#\S+/;
21
- // Short url with specific protocol. eg: github:foo/bar
22
10
  const RE_GIT_URL_SHORT = /^(github|gitlab|bitbucket|gist):\/?[^/.]+\/?/i;
23
- // Currently supported protocols
24
11
  const RE_PROTOCOL = /^((git\+)?(ssh|https?|file)|git|github|gitlab|bitbucket|gist):$/i;
25
- // Has custom protocol
26
12
  const RE_CUSTOM_PROTOCOL = /^((git\+)?(ssh|https?|file)|git):\/\//i;
27
- // Valid hash format for npm / yarn ...
28
13
  const RE_URL_HASH_VERSION = /#(?:semver:)?(.+)/;
29
- // Simple hostname validate
30
14
  const RE_HOSTNAME = /^(?:[^/.]+(\.[^/]+)+|localhost)$/;
31
- // For hostname with colon. eg: ssh://user@github.com:foo/bar
32
15
  const RE_HOSTNAME_WITH_COLON = /([^/@#:.]+(?:\.[^/@#:.]+)+|localhost):([^#/0-9]+)/;
33
- // Reg for url without protocol
34
16
  const RE_NO_PROTOCOL = /^([^/@#:.]+(?:\.[^/@#:.]+)+)/;
35
- // Specific protocol for short url without normal hostname
36
17
  const PROTOCOLS_FOR_SHORT = [
37
- 'github:',
38
- 'gitlab:',
39
- 'bitbucket:',
40
- 'gist:',
41
- 'file:',
18
+ "github:",
19
+ "gitlab:",
20
+ "bitbucket:",
21
+ "gist:",
22
+ "file:"
42
23
  ];
43
- // Default protocol for git url
44
- const DEF_GIT_PROTOCOL = 'git+ssh://';
45
- // thanks to https://github.com/npm/hosted-git-info/blob/latest/git-host-info.js
24
+ const DEF_GIT_PROTOCOL = "git+ssh://";
46
25
  const extractCommithashByDomain = {
47
- /**
48
- * @param {string} pathname pathname
49
- * @param {string} hash hash
50
- * @returns {string | undefined} hash
51
- */
52
- 'github.com': (pathname, hash) => {
53
- const [, user, project, type, commithash] = pathname.split('/', 5);
54
- if (type && type !== 'tree') {
55
- return;
56
- }
57
- let commithashResult = commithash;
58
- if (!type) {
59
- commithashResult = hash;
60
- }
61
- else {
62
- commithashResult = '#' + commithash;
63
- }
64
- let projectResult = project;
65
- if (project && project.endsWith('.git')) {
66
- projectResult = project.slice(0, -4);
67
- }
68
- if (!user || !projectResult) {
69
- return;
70
- }
71
- return commithashResult;
72
- },
73
- /**
74
- * @param {string} pathname pathname
75
- * @param {string} hash hash
76
- * @returns {string | undefined} hash
77
- */
78
- 'gitlab.com': (pathname, hash) => {
79
- const path = pathname.slice(1);
80
- if (path.includes('/-/') || path.includes('/archive.tar.gz')) {
81
- return;
82
- }
83
- const segments = path.split('/');
84
- let project = segments.pop();
85
- if (project && project.endsWith('.git')) {
86
- project = project.slice(0, -4);
87
- }
88
- const user = segments.join('/');
89
- if (!user || !project) {
90
- return;
91
- }
92
- return hash;
93
- },
94
- /**
95
- * @param {string} pathname pathname
96
- * @param {string} hash hash
97
- * @returns {string | undefined} hash
98
- */
99
- 'bitbucket.org': (pathname, hash) => {
100
- const [, user, project, aux] = pathname.split('/', 4);
101
- if (['get'].includes(aux)) {
102
- return;
103
- }
104
- let projectResult = project;
105
- if (project && project.endsWith('.git')) {
106
- projectResult = project.slice(0, -4);
107
- }
108
- if (!user || !projectResult) {
109
- return;
110
- }
111
- return hash;
112
- },
113
- /**
114
- * @param {string} pathname pathname
115
- * @param {string} hash hash
116
- * @returns {string | undefined} hash
117
- */
118
- 'gist.github.com': (pathname, hash) => {
119
- const [, user, project, aux] = pathname.split('/', 4);
120
- if (aux === 'raw') {
121
- return;
122
- }
123
- let projectResult = project;
124
- if (!projectResult) {
125
- if (!user) {
126
- return;
127
- }
128
- projectResult = user;
129
- }
130
- if (projectResult.endsWith('.git')) {
131
- projectResult = projectResult.slice(0, -4);
132
- }
133
- return hash;
134
- },
26
+ "github.com": (pathname, hash) => {
27
+ const [, user, project, type, commithash] = pathname.split("/", 5);
28
+ if (type && type !== "tree") return;
29
+ let commithashResult = commithash;
30
+ if (!type) commithashResult = hash;
31
+ else commithashResult = "#" + commithash;
32
+ let projectResult = project;
33
+ if (project && project.endsWith(".git")) projectResult = project.slice(0, -4);
34
+ if (!user || !projectResult) return;
35
+ return commithashResult;
36
+ },
37
+ "gitlab.com": (pathname, hash) => {
38
+ const path = pathname.slice(1);
39
+ if (path.includes("/-/") || path.includes("/archive.tar.gz")) return;
40
+ const segments = path.split("/");
41
+ let project = segments.pop();
42
+ if (project && project.endsWith(".git")) project = project.slice(0, -4);
43
+ if (!segments.join("/") || !project) return;
44
+ return hash;
45
+ },
46
+ "bitbucket.org": (pathname, hash) => {
47
+ const [, user, project, aux] = pathname.split("/", 4);
48
+ if (["get"].includes(aux)) return;
49
+ let projectResult = project;
50
+ if (project && project.endsWith(".git")) projectResult = project.slice(0, -4);
51
+ if (!user || !projectResult) return;
52
+ return hash;
53
+ },
54
+ "gist.github.com": (pathname, hash) => {
55
+ const [, user, project, aux] = pathname.split("/", 4);
56
+ if (aux === "raw") return;
57
+ let projectResult = project;
58
+ if (!projectResult) {
59
+ if (!user) return;
60
+ projectResult = user;
61
+ }
62
+ if (projectResult.endsWith(".git")) projectResult = projectResult.slice(0, -4);
63
+ return hash;
64
+ }
135
65
  };
136
66
  /**
137
- * extract commit hash from parsed url
138
- *
139
- * @inner
140
- * @param {URL} urlParsed parsed url
141
- * @returns {string} commithash
142
- */
67
+ * extract commit hash from parsed url
68
+ *
69
+ * @inner
70
+ * @param {URL} urlParsed parsed url
71
+ * @returns {string} commithash
72
+ */
143
73
  function getCommithash(urlParsed) {
144
- const { hostname, pathname, hash } = urlParsed;
145
- const hostnameResult = hostname.replace(/^www\./, '');
146
- let hashResult = hash;
147
- try {
148
- hashResult = decodeURIComponent(hash);
149
- // eslint-disable-next-line no-empty
150
- }
151
- catch (e) { }
152
- if (
153
- /** @type {keyof extractCommithashByDomain} */ extractCommithashByDomain[hostnameResult]) {
154
- return (extractCommithashByDomain
155
- /** @type {keyof extractCommithashByDomain} */ [hostnameResult](pathname, hashResult) || '');
156
- }
157
- return hashResult;
74
+ const { hostname, pathname, hash } = urlParsed;
75
+ const hostnameResult = hostname.replace(/^www\./, "");
76
+ let hashResult = hash;
77
+ try {
78
+ hashResult = decodeURIComponent(hash);
79
+ } catch (e) {}
80
+ if (extractCommithashByDomain[hostnameResult]) return extractCommithashByDomain[hostnameResult](pathname, hashResult) || "";
81
+ return hashResult;
158
82
  }
159
83
  /**
160
- * make url right for URL parse
161
- *
162
- * @inner
163
- * @param {string} gitUrl git url
164
- * @returns {string} fixed url
165
- */
84
+ * make url right for URL parse
85
+ *
86
+ * @inner
87
+ * @param {string} gitUrl git url
88
+ * @returns {string} fixed url
89
+ */
166
90
  function correctUrl(gitUrl) {
167
- // like:
168
- // proto://hostname.com:user/repo -> proto://hostname.com/user/repo
169
- return gitUrl.replace(RE_HOSTNAME_WITH_COLON, '$1/$2');
91
+ return gitUrl.replace(RE_HOSTNAME_WITH_COLON, "$1/$2");
170
92
  }
171
93
  /**
172
- * make url protocol right for URL parse
173
- *
174
- * @inner
175
- * @param {string} gitUrl git url
176
- * @returns {string} fixed url
177
- */
94
+ * make url protocol right for URL parse
95
+ *
96
+ * @inner
97
+ * @param {string} gitUrl git url
98
+ * @returns {string} fixed url
99
+ */
178
100
  function correctProtocol(gitUrl) {
179
- // eg: github:foo/bar#v1.0. Should not add double slash, in case of error parsed `pathname`
180
- if (RE_GIT_URL_SHORT.test(gitUrl)) {
181
- return gitUrl;
182
- }
183
- // eg: user@github.com:foo/bar
184
- if (!RE_CUSTOM_PROTOCOL.test(gitUrl)) {
185
- return `${DEF_GIT_PROTOCOL}${gitUrl}`;
186
- }
187
- return gitUrl;
101
+ if (RE_GIT_URL_SHORT.test(gitUrl)) return gitUrl;
102
+ if (!RE_CUSTOM_PROTOCOL.test(gitUrl)) return `${DEF_GIT_PROTOCOL}${gitUrl}`;
103
+ return gitUrl;
188
104
  }
189
105
  /**
190
- * extract git dep version from hash
191
- *
192
- * @inner
193
- * @param {string} hash hash
194
- * @returns {string} git dep version
195
- */
106
+ * extract git dep version from hash
107
+ *
108
+ * @inner
109
+ * @param {string} hash hash
110
+ * @returns {string} git dep version
111
+ */
196
112
  function getVersionFromHash(hash) {
197
- const matched = hash.match(RE_URL_HASH_VERSION);
198
- return (matched && matched[1]) || '';
113
+ const matched = hash.match(RE_URL_HASH_VERSION);
114
+ return matched && matched[1] || "";
199
115
  }
200
116
  /**
201
- * if string can be decoded
202
- *
203
- * @inner
204
- * @param {string} str str to be checked
205
- * @returns {boolean} if can be decoded
206
- */
117
+ * if string can be decoded
118
+ *
119
+ * @inner
120
+ * @param {string} str str to be checked
121
+ * @returns {boolean} if can be decoded
122
+ */
207
123
  function canBeDecoded(str) {
208
- try {
209
- decodeURIComponent(str);
210
- }
211
- catch (e) {
212
- return false;
213
- }
214
- return true;
124
+ return true;
215
125
  }
216
126
  /**
217
- * get right dep version from git url
218
- *
219
- * @inner
220
- * @param {string} gitUrl git url
221
- * @returns {string} dep version
222
- */
127
+ * get right dep version from git url
128
+ *
129
+ * @inner
130
+ * @param {string} gitUrl git url
131
+ * @returns {string} dep version
132
+ */
223
133
  function getGitUrlVersion(gitUrl) {
224
- const oriGitUrl = gitUrl;
225
- // github extreme shorthand
226
- if (RE_URL_GITHUB_EXTREME_SHORT.test(gitUrl)) {
227
- gitUrl = 'github:' + gitUrl;
228
- }
229
- else {
230
- gitUrl = correctProtocol(gitUrl);
231
- }
232
- gitUrl = correctUrl(gitUrl);
233
- let parsed;
234
- try {
235
- parsed = new URL(gitUrl);
236
- // eslint-disable-next-line no-empty
237
- }
238
- catch (e) { }
239
- if (!parsed) {
240
- return '';
241
- }
242
- const { protocol, hostname, pathname, username, password } = parsed;
243
- if (!RE_PROTOCOL.test(protocol)) {
244
- return '';
245
- }
246
- // pathname shouldn't be empty or URL malformed
247
- if (!pathname || !canBeDecoded(pathname)) {
248
- return '';
249
- }
250
- // without protocol, there should have auth info
251
- if (RE_NO_PROTOCOL.test(oriGitUrl) && !username && !password) {
252
- return '';
253
- }
254
- if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {
255
- if (!RE_HOSTNAME.test(hostname)) {
256
- return '';
257
- }
258
- const commithash = getCommithash(parsed);
259
- return getVersionFromHash(commithash) || commithash;
260
- }
261
- // for protocol short
262
- return getVersionFromHash(gitUrl);
134
+ const oriGitUrl = gitUrl;
135
+ if (RE_URL_GITHUB_EXTREME_SHORT.test(gitUrl)) gitUrl = "github:" + gitUrl;
136
+ else gitUrl = correctProtocol(gitUrl);
137
+ gitUrl = correctUrl(gitUrl);
138
+ let parsed;
139
+ try {
140
+ parsed = new URL(gitUrl);
141
+ } catch (e) {}
142
+ if (!parsed) return "";
143
+ const { protocol, hostname, pathname, username, password } = parsed;
144
+ if (!RE_PROTOCOL.test(protocol)) return "";
145
+ if (!pathname || !canBeDecoded(pathname)) return "";
146
+ if (RE_NO_PROTOCOL.test(oriGitUrl) && !username && !password) return "";
147
+ if (!PROTOCOLS_FOR_SHORT.includes(protocol.toLowerCase())) {
148
+ if (!RE_HOSTNAME.test(hostname)) return "";
149
+ const commithash = getCommithash(parsed);
150
+ return getVersionFromHash(commithash) || commithash;
151
+ }
152
+ return getVersionFromHash(gitUrl);
263
153
  }
264
154
  /**
265
- * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies
266
- * @param {string} versionDesc version to be normalized
267
- * @returns {string} normalized version
268
- */
155
+ * @see https://docs.npmjs.com/cli/v7/configuring-npm/package-json#urls-as-dependencies
156
+ * @param {string} versionDesc version to be normalized
157
+ * @returns {string} normalized version
158
+ */
269
159
  function normalizeVersion(versionDesc) {
270
- versionDesc = (versionDesc && versionDesc.trim()) || '';
271
- if ((0, sdk_1.isRequiredVersion)(versionDesc)) {
272
- return versionDesc;
273
- }
274
- // add handle for URL Dependencies
275
- return getGitUrlVersion(versionDesc.toLowerCase());
160
+ versionDesc = versionDesc && versionDesc.trim() || "";
161
+ if ((0, _module_federation_sdk.isRequiredVersion)(versionDesc)) return versionDesc;
162
+ return getGitUrlVersion(versionDesc.toLowerCase());
276
163
  }
277
164
  /**
278
- *
279
- * @param {InputFileSystem} fs file system
280
- * @param {string} directory directory to start looking into
281
- * @param {string[]} descriptionFiles possible description filenames
282
- * @param {function((Error | null)=, {data?: DescriptionFile, path?: string}=, (checkedDescriptionFilePaths: string[])=): void} callback callback
283
- * @param {function({data: DescriptionFile}=): boolean} satisfiesDescriptionFileData file data compliance check
284
- * @param {Set<string>} [checkedFilePaths] optional set to track checked file paths
285
- */
286
- function getDescriptionFile(fs, directory, descriptionFiles, callback, satisfiesDescriptionFileData, checkedFilePaths = new Set()) {
287
- let i = 0;
288
- // Create an object to hold the function and the shared checkedFilePaths
289
- const satisfiesDescriptionFileDataInternal = {
290
- check: satisfiesDescriptionFileData,
291
- checkedFilePaths: checkedFilePaths, // Use the passed Set instance
292
- };
293
- const tryLoadCurrent = () => {
294
- if (i >= descriptionFiles.length) {
295
- const parentDirectory = dirname(fs, directory);
296
- if (!parentDirectory || parentDirectory === directory) {
297
- return callback(null, undefined, Array.from(satisfiesDescriptionFileDataInternal.checkedFilePaths));
298
- }
299
- return getDescriptionFile(fs, parentDirectory, descriptionFiles, callback, satisfiesDescriptionFileDataInternal.check, satisfiesDescriptionFileDataInternal.checkedFilePaths);
300
- }
301
- const filePath = join(fs, directory, descriptionFiles[i]);
302
- readJson(fs, filePath, (err, data) => {
303
- if (err) {
304
- if ('code' in err && err.code === 'ENOENT') {
305
- i++;
306
- return tryLoadCurrent();
307
- }
308
- return callback(err);
309
- }
310
- if (!data || typeof data !== 'object' || Array.isArray(data)) {
311
- return callback(new Error(`Description file ${filePath} is not an object`));
312
- }
313
- if (typeof satisfiesDescriptionFileDataInternal.check === 'function' &&
314
- !satisfiesDescriptionFileDataInternal.check({ data, path: filePath })) {
315
- i++;
316
- satisfiesDescriptionFileDataInternal.checkedFilePaths.add(filePath);
317
- return tryLoadCurrent();
318
- }
319
- callback(null, { data, path: filePath });
320
- });
321
- };
322
- tryLoadCurrent();
165
+ *
166
+ * @param {InputFileSystem} fs file system
167
+ * @param {string} directory directory to start looking into
168
+ * @param {string[]} descriptionFiles possible description filenames
169
+ * @param {function((Error | null)=, {data?: DescriptionFile, path?: string}=, (checkedDescriptionFilePaths: string[])=): void} callback callback
170
+ * @param {function({data: DescriptionFile}=): boolean} satisfiesDescriptionFileData file data compliance check
171
+ * @param {Set<string>} [checkedFilePaths] optional set to track checked file paths
172
+ */
173
+ function getDescriptionFile(fs, directory, descriptionFiles, callback, satisfiesDescriptionFileData, checkedFilePaths = /* @__PURE__ */ new Set()) {
174
+ let i = 0;
175
+ const satisfiesDescriptionFileDataInternal = {
176
+ check: satisfiesDescriptionFileData,
177
+ checkedFilePaths
178
+ };
179
+ const tryLoadCurrent = () => {
180
+ if (i >= descriptionFiles.length) {
181
+ const parentDirectory = dirname(fs, directory);
182
+ if (!parentDirectory || parentDirectory === directory) return callback(null, void 0, Array.from(satisfiesDescriptionFileDataInternal.checkedFilePaths));
183
+ return getDescriptionFile(fs, parentDirectory, descriptionFiles, callback, satisfiesDescriptionFileDataInternal.check, satisfiesDescriptionFileDataInternal.checkedFilePaths);
184
+ }
185
+ const filePath = join(fs, directory, descriptionFiles[i]);
186
+ readJson(fs, filePath, (err, data) => {
187
+ if (err) {
188
+ if ("code" in err && err.code === "ENOENT") {
189
+ i++;
190
+ return tryLoadCurrent();
191
+ }
192
+ return callback(err);
193
+ }
194
+ if (!data || typeof data !== "object" || Array.isArray(data)) return callback(/* @__PURE__ */ new Error(`Description file ${filePath} is not an object`));
195
+ if (typeof satisfiesDescriptionFileDataInternal.check === "function" && !satisfiesDescriptionFileDataInternal.check({
196
+ data,
197
+ path: filePath
198
+ })) {
199
+ i++;
200
+ satisfiesDescriptionFileDataInternal.checkedFilePaths.add(filePath);
201
+ return tryLoadCurrent();
202
+ }
203
+ callback(null, {
204
+ data,
205
+ path: filePath
206
+ });
207
+ });
208
+ };
209
+ tryLoadCurrent();
323
210
  }
324
211
  /**
325
- * Get required version from description file
326
- * @param {Record<string, any>} data - The data object
327
- * @param {string} packageName - The package name
328
- * @returns {string | undefined} The normalized version
329
- */
212
+ * Get required version from description file
213
+ * @param {Record<string, any>} data - The data object
214
+ * @param {string} packageName - The package name
215
+ * @returns {string | undefined} The normalized version
216
+ */
330
217
  function getRequiredVersionFromDescriptionFile(data, packageName) {
331
- if (data['optionalDependencies'] &&
332
- typeof data['optionalDependencies'] === 'object' &&
333
- packageName in data['optionalDependencies']) {
334
- return normalizeVersion(data['optionalDependencies'][packageName]);
335
- }
336
- if (data['dependencies'] &&
337
- typeof data['dependencies'] === 'object' &&
338
- packageName in data['dependencies']) {
339
- return normalizeVersion(data['dependencies'][packageName]);
340
- }
341
- if (data['peerDependencies'] &&
342
- typeof data['peerDependencies'] === 'object' &&
343
- packageName in data['peerDependencies']) {
344
- return normalizeVersion(data['peerDependencies'][packageName]);
345
- }
346
- if (data['devDependencies'] &&
347
- typeof data['devDependencies'] === 'object' &&
348
- packageName in data['devDependencies']) {
349
- return normalizeVersion(data['devDependencies'][packageName]);
350
- }
218
+ if (data["optionalDependencies"] && typeof data["optionalDependencies"] === "object" && packageName in data["optionalDependencies"]) return normalizeVersion(data["optionalDependencies"][packageName]);
219
+ if (data["dependencies"] && typeof data["dependencies"] === "object" && packageName in data["dependencies"]) return normalizeVersion(data["dependencies"][packageName]);
220
+ if (data["peerDependencies"] && typeof data["peerDependencies"] === "object" && packageName in data["peerDependencies"]) return normalizeVersion(data["peerDependencies"][packageName]);
221
+ if (data["devDependencies"] && typeof data["devDependencies"] === "object" && packageName in data["devDependencies"]) return normalizeVersion(data["devDependencies"][packageName]);
351
222
  }
352
223
  function normalizeConsumeShareOptions(consumeOptions) {
353
- const { requiredVersion = false, strictVersion, singleton = false, eager, shareKey, shareScope, layer, } = consumeOptions;
354
- return {
355
- shareConfig: {
356
- fixedDependencies: false,
357
- requiredVersion,
358
- strictVersion,
359
- singleton,
360
- eager,
361
- layer,
362
- },
363
- shareScope,
364
- shareKey,
365
- };
224
+ const { requiredVersion = false, strictVersion, singleton = false, eager, shareKey, shareScope, layer, treeShakingMode } = consumeOptions;
225
+ return {
226
+ shareConfig: {
227
+ fixedDependencies: false,
228
+ requiredVersion,
229
+ strictVersion,
230
+ singleton,
231
+ eager,
232
+ layer
233
+ },
234
+ shareScope,
235
+ shareKey,
236
+ treeShakingMode
237
+ };
366
238
  }
367
- function addSingletonFilterWarning(compilation, shareKey, // The shareKey or a relevant identifier for the shared module
368
- filterType, filterProperty, filterValue, moduleRequest, // original request that led to this shared module
369
- moduleResource) {
370
- if (typeof compilation.warnings.push !== 'function') {
371
- return;
372
- }
373
- const filterValueStr = filterValue instanceof RegExp ? filterValue.toString() : `"${filterValue}"`;
374
- const warningMessage = `"singleton: true" is used together with "${filterType}.${filterProperty}: ${filterValueStr}". This might lead to multiple instances of the shared module "${shareKey}" in the shared scope.`;
375
- const warning = new WebpackError(warningMessage);
376
- if (moduleResource) {
377
- warning.file = `shared module ${moduleRequest} -> ${moduleResource}`;
378
- }
379
- else {
380
- warning.file = `shared module ${moduleRequest}`; // Fallback if resource is not available
381
- }
382
- compilation.warnings.push(warning);
239
+ function addSingletonFilterWarning(compilation, shareKey, filterType, filterProperty, filterValue, moduleRequest, moduleResource) {
240
+ if (typeof compilation.warnings.push !== "function") return;
241
+ const warning = new WebpackError(`"singleton: true" is used together with "${filterType}.${filterProperty}: ${filterValue instanceof RegExp ? filterValue.toString() : `"${filterValue}"`}". This might lead to multiple instances of the shared module "${shareKey}" in the shared scope.`);
242
+ if (moduleResource) warning.file = `shared module ${moduleRequest} -> ${moduleResource}`;
243
+ else warning.file = `shared module ${moduleRequest}`;
244
+ compilation.warnings.push(warning);
383
245
  }
384
246
  function testRequestFilters(remainder, includeRequest, excludeRequest) {
385
- if (includeRequest &&
386
- !(includeRequest instanceof RegExp
387
- ? includeRequest.test(remainder)
388
- : remainder === includeRequest)) {
389
- return false; // Skip if include doesn't match
390
- }
391
- if (excludeRequest &&
392
- (excludeRequest instanceof RegExp
393
- ? excludeRequest.test(remainder)
394
- : remainder === excludeRequest)) {
395
- return false; // Skip if exclude matches
396
- }
397
- return true; // Process if no filters skip it
247
+ if (includeRequest && !(includeRequest instanceof RegExp ? includeRequest.test(remainder) : remainder === includeRequest)) return false;
248
+ if (excludeRequest && (excludeRequest instanceof RegExp ? excludeRequest.test(remainder) : remainder === excludeRequest)) return false;
249
+ return true;
398
250
  }
399
251
  function createLookupKeyForSharing(request, layer) {
400
- if (layer) {
401
- return `(${layer})${request}`;
402
- }
403
- return request;
252
+ if (layer) return `(${layer})${request}`;
253
+ return request;
404
254
  }
405
255
  function extractPathAfterNodeModules(filePath) {
406
- // Fast check for 'node_modules' substring
407
- if (~filePath.indexOf('node_modules')) {
408
- const nodeModulesIndex = filePath.lastIndexOf('node_modules');
409
- const result = filePath.substring(nodeModulesIndex + 13); // 13 = 'node_modules/'.length
410
- return result;
411
- }
412
- return null;
256
+ if (~filePath.indexOf("node_modules")) {
257
+ const nodeModulesIndex = filePath.lastIndexOf("node_modules");
258
+ return filePath.substring(nodeModulesIndex + 13);
259
+ }
260
+ return null;
413
261
  }
262
+
263
+ //#endregion
264
+ exports.addSingletonFilterWarning = addSingletonFilterWarning;
265
+ exports.createLookupKeyForSharing = createLookupKeyForSharing;
266
+ exports.extractPathAfterNodeModules = extractPathAfterNodeModules;
267
+ exports.getDescriptionFile = getDescriptionFile;
268
+ exports.getRequiredVersionFromDescriptionFile = getRequiredVersionFromDescriptionFile;
269
+ exports.normalizeConsumeShareOptions = normalizeConsumeShareOptions;
270
+ exports.normalizeVersion = normalizeVersion;
271
+ exports.testRequestFilters = testRequestFilters;
414
272
  //# sourceMappingURL=utils.js.map