@zohodesk/react-cli 1.1.28 → 1.1.29-exp.2

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 (566) hide show
  1. package/README.md +0 -18
  2. package/lib/babel/babel-option-utils/babel-preset-react-option.js +0 -3
  3. package/lib/babel/cmjs-plugins-presets.js +1 -8
  4. package/lib/babel/es-plugins-presets.js +1 -8
  5. package/lib/common/buildEs.js +1 -0
  6. package/lib/common/getEntries.js +2 -13
  7. package/lib/common/getPublicPathConfig.js +0 -6
  8. package/lib/common/index.js +1 -6
  9. package/lib/common/runPreProcess.js +6 -15
  10. package/lib/common/splitChunks.js +2 -21
  11. package/lib/common/sslcertUpdater.js +7 -18
  12. package/lib/common/templateParameters.js +0 -2
  13. package/lib/common/testPattern.js +10 -21
  14. package/lib/common/valueReplacer.js +1 -16
  15. package/lib/configs/jest.config.js +2 -11
  16. package/lib/configs/libAlias.js +10 -16
  17. package/lib/configs/resolvers.js +6 -16
  18. package/lib/configs/webpack.component.umd.config.js +1 -6
  19. package/lib/configs/webpack.css.umd.config.js +6 -14
  20. package/lib/configs/webpack.dev.config.js +1 -14
  21. package/lib/configs/webpack.docs.config.js +1 -9
  22. package/lib/configs/webpack.impact.config.js +1 -8
  23. package/lib/configs/webpack.prod.config.js +4 -17
  24. package/lib/constants.js +9 -18
  25. package/lib/deprecationLogger.js +0 -7
  26. package/lib/hooks/docsProptypeHook.js +4 -8
  27. package/lib/jest/commitedFilesResult.js +4 -46
  28. package/lib/jest/coverageCollector.js +1 -12
  29. package/lib/jest/jsonMaker.js +0 -6
  30. package/lib/jest/preProcessors/cssPreprocessor.js +1 -9
  31. package/lib/jest/preProcessors/jsPreprocessor.js +1 -6
  32. package/lib/jest/preProcessors/otherFilesPreprocessor.js +1 -4
  33. package/lib/jest/result.js +1 -23
  34. package/lib/jest/run.js +7 -18
  35. package/lib/jest/setup.js +8 -60
  36. package/lib/loaderUtils/configsAssetsLoaders.js +2 -12
  37. package/lib/loaderUtils/getCSSLoaders.js +10 -22
  38. package/lib/loaderUtils/getDevJsLoaders.js +4 -13
  39. package/lib/loaderUtils/index.js +1 -4
  40. package/lib/loaderUtils/tests/windowsModification.test.js +0 -1
  41. package/lib/loaderUtils/windowsModification.js +2 -3
  42. package/lib/loaders/__test__/markdownLoader.spec.js +0 -1
  43. package/lib/loaders/composeLoader.js +13 -37
  44. package/lib/loaders/docsLoader.js +1 -12
  45. package/lib/loaders/docsPropsLoader.js +4 -8
  46. package/lib/loaders/enhancedReactLiveConverter.js +2 -23
  47. package/lib/loaders/fileBountryLoader.js +1 -3
  48. package/lib/loaders/fileLoader.js +12 -23
  49. package/lib/loaders/markdownLoader.js +14 -19
  50. package/lib/loaders/reactLiveConvertor.js +5 -15
  51. package/lib/loaders/scriptInstrumentLoader.js +7 -16
  52. package/lib/loaders/selectorMappingLoader.js +7 -26
  53. package/lib/loaders/workerLoader.js +9 -24
  54. package/lib/logger.js +0 -4
  55. package/lib/middlewares/HMRMiddleware.js +13 -27
  56. package/lib/middlewares/SSTMiddleware.js +1 -5
  57. package/lib/pluginUtils/configHtmlWebpackPlugins.js +1 -24
  58. package/lib/pluginUtils/getDevPlugins.js +9 -42
  59. package/lib/pluginUtils/getDocsPlugins.js +3 -13
  60. package/lib/pluginUtils/getLibraryImactPlugins.js +5 -6
  61. package/lib/pluginUtils/getLibraryPlugins.js +2 -8
  62. package/lib/pluginUtils/getProdPlugins.js +8 -47
  63. package/lib/pluginUtils/getServerPlugins.js +2 -8
  64. package/lib/pluginUtils/getUMDCSSPlugins.js +2 -10
  65. package/lib/pluginUtils/getUMDComponentPlugins.js +2 -10
  66. package/lib/pluginUtils/index.js +1 -9
  67. package/lib/plugins/CdnChangePlugin.js +2 -18
  68. package/lib/plugins/CleanupStatsPlugin.js +0 -5
  69. package/lib/plugins/CssOrderControlPlugin.js +3 -6
  70. package/lib/plugins/CustomAttributePlugin.js +14 -19
  71. package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +3 -23
  72. package/lib/plugins/EFCPlugin.js +20 -34
  73. package/lib/plugins/EFCTemplatePlugin.js +19 -30
  74. package/lib/plugins/EfcResourceCleanupPlugin.js +0 -3
  75. package/lib/plugins/EventsHandlingPlugin.js +2 -4
  76. package/lib/plugins/I18NInjectIntoIndexPlugin.js +14 -37
  77. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +10 -15
  78. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
  79. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +78 -155
  80. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +198 -81
  81. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +12 -23
  82. package/lib/plugins/I18nSplitPlugin/index.js +13 -24
  83. package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +279 -0
  84. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
  85. package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +51 -0
  86. package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +48 -0
  87. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
  88. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
  89. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +1 -8
  90. package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
  91. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -20
  92. package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +0 -1
  93. package/lib/plugins/ManifestPlugin.js +1 -18
  94. package/lib/plugins/MinifyPlugin.js +1 -10
  95. package/lib/plugins/ModuleStatsPlugin.js +1 -24
  96. package/lib/plugins/OptimizeJSPlugin.js +2 -10
  97. package/lib/plugins/PublicPathCallbackPlugin.js +1 -12
  98. package/lib/plugins/PublicPathChangePlugin.js +6 -39
  99. package/lib/plugins/ReportGeneratePlugin.js +5 -32
  100. package/lib/plugins/RequireVariablePublicPlugin.js +1 -8
  101. package/lib/plugins/ResourceHintsPlugin.js +4 -13
  102. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
  103. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +10 -17
  104. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
  105. package/lib/plugins/ScriptInstrumentPlugin.js +1 -8
  106. package/lib/plugins/SelectorPlugin.js +6 -32
  107. package/lib/plugins/ServiceWorkerPlugin.js +5 -22
  108. package/lib/plugins/ShadowDOMSupportPlugin.js +4 -41
  109. package/lib/plugins/SourceMapHookPlugin.js +2 -12
  110. package/lib/plugins/StatsPlugin.js +0 -14
  111. package/lib/plugins/TPHashMappingPlugin.js +3 -18
  112. package/lib/plugins/UnusedFilesFindPlugin.js +4 -39
  113. package/lib/plugins/VariableConversionCollector.js +15 -42
  114. package/lib/plugins/index.js +1 -20
  115. package/lib/plugins/libraryImpactPlugin.js +1 -33
  116. package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +306 -0
  117. package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +363 -0
  118. package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +694 -0
  119. package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +1258 -0
  120. package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +542 -0
  121. package/lib/plugins/newi18nsplitplugin/18nplugin.js +974 -0
  122. package/lib/plugins/newi18nsplitplugin/ChunkManager.js +131 -0
  123. package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +59 -0
  124. package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +262 -0
  125. package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +166 -0
  126. package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +111 -0
  127. package/lib/plugins/newi18nsplitplugin/KeyCollector.js +163 -0
  128. package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +88 -0
  129. package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +101 -0
  130. package/lib/plugins/newi18nsplitplugin/constants.js +162 -0
  131. package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +78 -0
  132. package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +22 -0
  133. package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +18 -0
  134. package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +580 -0
  135. package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +54 -0
  136. package/lib/plugins/utils/classHandling.js +0 -6
  137. package/lib/plugins/utils/fileHandling.js +6 -15
  138. package/lib/plugins/utils/tests/fileHandling.test.js +0 -4
  139. package/lib/plugins/variableConvertorUtils.js +14 -29
  140. package/lib/plugins/webpackwatchrunplugin.js +0 -5
  141. package/lib/postcss-plugins/EmptyPlugin.js +3 -4
  142. package/lib/postcss-plugins/ExcludePlugin.js +1 -5
  143. package/lib/postcss-plugins/IncludePlugin.js +1 -5
  144. package/lib/postcss-plugins/RTLSplitPlugin.js +14 -27
  145. package/lib/postcss-plugins/SelectorReplace.js +1 -16
  146. package/lib/postcss-plugins/ValueReplacer.js +7 -6
  147. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
  148. package/lib/postcss-plugins/__test__/selectorReplace.test.js +6 -3
  149. package/lib/postcss-plugins/__test__/valueReplacer.spec.js +2 -5
  150. package/lib/postcss-plugins/hoverActivePlugin.js +31 -67
  151. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +0 -7
  152. package/lib/postcss-plugins/variableModificationPlugin/index.js +28 -49
  153. package/lib/schemas/index.js +3 -10
  154. package/lib/servers/clusterHubServer.js +1 -11
  155. package/lib/servers/devBuild.js +14 -26
  156. package/lib/servers/docsServer.js +1 -3
  157. package/lib/servers/docsServerCore.js +1 -22
  158. package/lib/servers/getCliPath.js +0 -9
  159. package/lib/servers/helpServer.js +1 -6
  160. package/lib/servers/httpsOptions.js +2 -8
  161. package/lib/servers/impactServer.js +3 -35
  162. package/lib/servers/mockserver.js +1 -10
  163. package/lib/servers/nowatchserver.js +12 -37
  164. package/lib/servers/requireLocalOrGlobal.js +6 -17
  165. package/lib/servers/scrServer.js +14 -21
  166. package/lib/servers/server.js +6 -36
  167. package/lib/servers/ssServer.js +1 -17
  168. package/lib/templates/CoverageScriptTemplate.js +0 -14
  169. package/lib/templates/WMSTemplate.js +7 -13
  170. package/lib/templates/linterConstant.js +2 -4
  171. package/lib/utils/babelPresets.js +3 -7
  172. package/lib/utils/clean.js +3 -9
  173. package/lib/utils/copy.js +1 -7
  174. package/lib/utils/copyTimezones.js +1 -9
  175. package/lib/utils/createEventStream.js +1 -6
  176. package/lib/utils/cssClassNameGenerate.js +10 -30
  177. package/lib/utils/cssURLReplacer.js +1 -22
  178. package/lib/utils/dependencyPostPublish.js +1 -10
  179. package/lib/utils/deprecationSupport.js +7 -32
  180. package/lib/utils/fileUtils.js +1 -28
  181. package/lib/utils/folderIterator.js +2 -13
  182. package/lib/utils/getComponents.js +0 -21
  183. package/lib/utils/getCurrentBranch.js +0 -5
  184. package/lib/utils/getDependenciesImpactList.js +1 -22
  185. package/lib/utils/getFileType.js +2 -10
  186. package/lib/utils/getHash.js +1 -8
  187. package/lib/utils/getIp.js +0 -2
  188. package/lib/utils/getOptions.js +16 -53
  189. package/lib/utils/getServerURL.js +1 -10
  190. package/lib/utils/index.js +4 -51
  191. package/lib/utils/init.js +0 -1
  192. package/lib/utils/initPreCommitHook.js +7 -30
  193. package/lib/utils/jsonHelper.js +3 -22
  194. package/lib/utils/libraryImpactConfig.js +2 -5
  195. package/lib/utils/lint/addScripts.js +2 -5
  196. package/lib/utils/lint/checkExistingConfig.js +3 -12
  197. package/lib/utils/lint/copyConfigs.js +0 -3
  198. package/lib/utils/lint/index.js +0 -9
  199. package/lib/utils/lint/lintScripts.js +0 -1
  200. package/lib/utils/lint/lintSetup.js +3 -4
  201. package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
  202. package/lib/utils/lint/question.js +0 -7
  203. package/lib/utils/lintReporter.js +0 -20
  204. package/lib/utils/log.js +0 -1
  205. package/lib/utils/mailSender.js +1 -8
  206. package/lib/utils/object-manipulation.js +1 -17
  207. package/lib/utils/pullOrigin.js +0 -4
  208. package/lib/utils/reinstallDependencies.js +1 -29
  209. package/lib/utils/removeAttributes.js +1 -8
  210. package/lib/utils/repoClone.js +3 -28
  211. package/lib/utils/request.js +0 -12
  212. package/lib/utils/rtl.js +5 -17
  213. package/lib/utils/selectorReplacer.js +10 -16
  214. package/lib/utils/setEnvVariables.js +0 -2
  215. package/lib/utils/ssTestHack.js +1 -11
  216. package/lib/utils/switchBranch.js +0 -5
  217. package/lib/utils/typeCheck.js +0 -1
  218. package/lib/utils/urlConcat.js +0 -4
  219. package/lib/utils/useExitCleanup.js +9 -10
  220. package/lib/utils/variableConverter.js +22 -31
  221. package/{npm-shrinkwrap.json → package-lock.json} +2098 -1999
  222. package/package.json +1 -1
  223. package/packages/client_build_tool/lib/allCommandsConfigs.js +0 -25
  224. package/packages/client_build_tool/lib/commands/build/commandExecutor.js +0 -17
  225. package/packages/client_build_tool/lib/commands/build/config.js +0 -12
  226. package/packages/client_build_tool/lib/commands/build/optionsProcessor.js +0 -35
  227. package/packages/client_build_tool/lib/commands/build/preProcessor.js +0 -12
  228. package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +0 -33
  229. package/packages/client_build_tool/lib/commands/buildEs/config.js +0 -12
  230. package/packages/client_build_tool/lib/commands/buildEs/preProcessor.js +0 -17
  231. package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +0 -33
  232. package/packages/client_build_tool/lib/commands/buildLib/config.js +0 -12
  233. package/packages/client_build_tool/lib/commands/buildLib/preProcessor.js +0 -17
  234. package/packages/client_build_tool/lib/commands/mockserver/commandExecutor.js +0 -43
  235. package/packages/client_build_tool/lib/commands/mockserver/config.js +0 -12
  236. package/packages/client_build_tool/lib/commands/pre_process/commandExecutor.js +0 -18
  237. package/packages/client_build_tool/lib/commands/pre_process/config.js +0 -12
  238. package/packages/client_build_tool/lib/commands/start/commandExecutor.js +0 -12
  239. package/packages/client_build_tool/lib/commands/start/config.js +0 -12
  240. package/packages/client_build_tool/lib/commands/start/optionsProcessor.js +0 -30
  241. package/packages/client_build_tool/lib/commands/start/preProcessor.js +0 -12
  242. package/packages/client_build_tool/lib/commands/template/commandExecutor.js +0 -28
  243. package/packages/client_build_tool/lib/commands/template/config.js +0 -12
  244. package/packages/client_build_tool/lib/commands/version/commandExecutor.js +0 -14
  245. package/packages/client_build_tool/lib/commands/version/config.js +0 -12
  246. package/packages/client_build_tool/lib/commandsRouter.js +0 -74
  247. package/packages/client_build_tool/lib/index.js +0 -12
  248. package/packages/client_build_tool/lib/logger.js +0 -34
  249. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/otherTestCases.test.js +0 -234
  250. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingDifferentDataTypesToSchema.test.js +0 -103
  251. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingEmptyObjects.test.js +0 -41
  252. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertArray.test.js +0 -68
  253. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertNumber.test.js +0 -68
  254. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertObject.test.js +0 -141
  255. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertString.test.js +0 -68
  256. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertUndefinedAndNull.test.js +0 -132
  257. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertArray.test.js +0 -71
  258. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertNumber.test.js +0 -71
  259. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertObject.test.js +0 -73
  260. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertString.test.js +0 -71
  261. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertUndefinedAndNull.test.js +0 -138
  262. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/index.js +0 -34
  263. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isObject.js +0 -10
  264. package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isValid.js +0 -14
  265. package/packages/client_build_tool/lib/schemas/cliArgsToObject.js +0 -39
  266. package/packages/client_build_tool/lib/schemas/defaultConfigValues.js +0 -349
  267. package/packages/client_build_tool/lib/schemas/defaultConfigValuesOnly.js +0 -187
  268. package/packages/client_build_tool/lib/schemas/deprecatedOptionsHandler.js +0 -67
  269. package/packages/client_build_tool/lib/schemas/getNpmVersion.js +0 -22
  270. package/packages/client_build_tool/lib/schemas/giveDefaultValue.js +0 -18
  271. package/packages/client_build_tool/lib/schemas/npmConfigToObject.js +0 -35
  272. package/packages/client_build_tool/lib/schemas/readOptions.js +0 -54
  273. package/packages/client_build_tool/lib/schemas/readOptionsForConfigFile.js +0 -42
  274. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Map.test.js +0 -15
  275. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/MathAndNumberMethod.test.js +0 -30
  276. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/ObjectAndModules.test.js +0 -47
  277. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Sets.test.js +0 -18
  278. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Symbol.test.js +0 -25
  279. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/arrowFunction.test.js +0 -34
  280. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/block-scoping.test.js +0 -18
  281. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/classes.test.js +0 -55
  282. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/defaultParameterValues.test.js +0 -18
  283. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/extraFeatures.test.js +0 -82
  284. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/forOf.test.js +0 -20
  285. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/promise.test.js +0 -22
  286. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadOperator.test.js +0 -20
  287. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadParams.test.js +0 -24
  288. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/stringAndArrayMethods.test.js +0 -67
  289. package/packages/client_build_tool/lib/shared/babel/__test__/es2015/variables.test.js +0 -21
  290. package/packages/client_build_tool/lib/shared/babel/__test__/es2016/array-includes.test.js +0 -13
  291. package/packages/client_build_tool/lib/shared/babel/__test__/es2016/exponentationOperator.test.js +0 -20
  292. package/packages/client_build_tool/lib/shared/babel/__test__/es2017/asyncAndawait.test.js +0 -23
  293. package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-entries.test.js +0 -24
  294. package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-getOwnproperties.test.js +0 -24
  295. package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-values.test.js +0 -24
  296. package/packages/client_build_tool/lib/shared/babel/__test__/es2017/stringMethods.test.js +0 -20
  297. package/packages/client_build_tool/lib/shared/babel/__test__/es2018/asynchronous-iterator.test.js +0 -19
  298. package/packages/client_build_tool/lib/shared/babel/__test__/es2018/object-rest-spread.test.js +0 -24
  299. package/packages/client_build_tool/lib/shared/babel/__test__/es2018/promise-finally.test.js +0 -26
  300. package/packages/client_build_tool/lib/shared/babel/__test__/es2018/regularExpressions.test.js +0 -35
  301. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/Json.stringify.test.js +0 -21
  302. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/arrayMethods.test.js +0 -31
  303. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/object-fromEntriesMethod.test.js +0 -13
  304. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/optionalCatchBinding.test.js +0 -23
  305. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/revisedFunctionToString.test.js +0 -17
  306. package/packages/client_build_tool/lib/shared/babel/__test__/es2019/trim-startAndend-method.test.js +0 -20
  307. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/AssignmentOperator.test.js +0 -27
  308. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/Dynamic-Import.test.js +0 -19
  309. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/NullishOperator.test.js +0 -15
  310. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/bigInt.test.js +0 -13
  311. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/chainOperator.test.js +0 -17
  312. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/export-namespace-from.test.js +0 -12
  313. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/promiseAllSettledMathod.test.js +0 -17
  314. package/packages/client_build_tool/lib/shared/babel/__test__/es2020/stringMatchMethod.test.js +0 -13
  315. package/packages/client_build_tool/lib/shared/babel/__test__/es2021/NumericSeparator.test.js +0 -23
  316. package/packages/client_build_tool/lib/shared/babel/__test__/es2021/logicalOperatorAssignments.test.js +0 -25
  317. package/packages/client_build_tool/lib/shared/babel/__test__/es2021/promiseAny.test.js +0 -16
  318. package/packages/client_build_tool/lib/shared/babel/__test__/es2021/stringReplaceMethod.test.js +0 -16
  319. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/Array-atMethod.test.js +0 -13
  320. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjectKeyCheck.test.js +0 -27
  321. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjecthasOwnMethod.test.js +0 -19
  322. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/RegexMatchIndices.test.js +0 -20
  323. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/String-atMethod.test.js +0 -15
  324. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/error.Cause.test.js +0 -23
  325. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/keysCheckinPrivateFields.test.js +0 -27
  326. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/privateMethodsAndFields.test.js +0 -23
  327. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/staticFieldsAndMethod.test.js +0 -54
  328. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/topLevelAwait.test.js +0 -11
  329. package/packages/client_build_tool/lib/shared/babel/__test__/es2022/weakRef.test.js +0 -17
  330. package/packages/client_build_tool/lib/shared/babel/__test__/utilities.js +0 -28
  331. package/packages/client_build_tool/lib/shared/babel/addDefaultPlugins.js +0 -15
  332. package/packages/client_build_tool/lib/shared/babel/babelWebConfig.js +0 -54
  333. package/packages/client_build_tool/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -23
  334. package/packages/client_build_tool/lib/shared/babel/getBabelPlugin.js +0 -37
  335. package/packages/client_build_tool/lib/shared/babel/runBabelForJSFile.js +0 -24
  336. package/packages/client_build_tool/lib/shared/babel/runBabelForTsFile.js +0 -30
  337. package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -57
  338. package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +0 -31
  339. package/packages/client_build_tool/lib/shared/bundler/webpack/common/modeUtils.js +0 -39
  340. package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +0 -105
  341. package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -21
  342. package/packages/client_build_tool/lib/shared/bundler/webpack/configCustomLoaders.js +0 -10
  343. package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +0 -16
  344. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +0 -83
  345. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +0 -119
  346. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +0 -46
  347. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +0 -109
  348. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +0 -112
  349. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  350. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +0 -174
  351. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -76
  352. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +0 -223
  353. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  354. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +0 -73
  355. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -88
  356. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  357. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -29
  358. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -24
  359. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -76
  360. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -39
  361. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +0 -50
  362. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -68
  363. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -23
  364. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -29
  365. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -43
  366. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -77
  367. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/classesAndObject.test.js +0 -56
  368. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/conditionalOperation.test.js +0 -154
  369. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function.test.js +0 -89
  370. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function2.test.js +0 -71
  371. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/loop.test.js +0 -112
  372. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minifyBooleanValues.test.js +0 -43
  373. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minimizeVariableNames.test.js +0 -45
  374. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/promise.test.js +0 -53
  375. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeCommentsAndEmptySpace.test.js +0 -13
  376. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeUnusedStrings.test.js +0 -14
  377. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/variableDeclaration.test.js +0 -30
  378. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -66
  379. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -13
  380. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -19
  381. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -31
  382. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -129
  383. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +0 -60
  384. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/addFilesNamesToManifestJson.test.js +0 -51
  385. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/createInitialEntries.test.js +0 -95
  386. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/removeHashFromFileName.test.js +0 -91
  387. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +0 -30
  388. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +0 -23
  389. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -35
  390. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -18
  391. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -46
  392. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -18
  393. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -1
  394. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +0 -193
  395. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -62
  396. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -84
  397. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  398. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -27
  399. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -73
  400. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -20
  401. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +0 -78
  402. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +0 -51
  403. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +0 -16
  404. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -114
  405. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -13
  406. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +0 -68
  407. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +0 -22
  408. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +0 -55
  409. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifyCss1.test.js +0 -74
  410. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifycss.test.js +0 -64
  411. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/utilities.js +0 -28
  412. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +0 -49
  413. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +0 -62
  414. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +0 -362
  415. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +0 -80
  416. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -14
  417. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +0 -57
  418. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +0 -87
  419. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/classesAndObject.test.js +0 -56
  420. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/conditionalOperation.test.js +0 -154
  421. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function.test.js +0 -89
  422. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function2.test.js +0 -71
  423. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/loop.test.js +0 -112
  424. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minifyBooleanValues.test.js +0 -43
  425. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minimizeVariableNames.test.js +0 -45
  426. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/promise.test.js +0 -53
  427. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeCommentsAndEmptySpace.test.js +0 -13
  428. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeUnusedStrings.test.js +0 -14
  429. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/variableDeclaration.test.js +0 -30
  430. package/packages/client_build_tool/lib/shared/bundler/webpack/defaultVendorPatternList.js +0 -13
  431. package/packages/client_build_tool/lib/shared/bundler/webpack/devtoolConfig.js +0 -13
  432. package/packages/client_build_tool/lib/shared/bundler/webpack/entryConfig.js +0 -28
  433. package/packages/client_build_tool/lib/shared/bundler/webpack/externals.js +0 -17
  434. package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +0 -29
  435. package/packages/client_build_tool/lib/shared/bundler/webpack/getFilenameFromModule.js +0 -24
  436. package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +0 -17
  437. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -12
  438. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -18
  439. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +0 -56
  440. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -18
  441. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +0 -37
  442. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -21
  443. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -86
  444. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -65
  445. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -21
  446. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +0 -7
  447. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +0 -133
  448. package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +0 -56
  449. package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +0 -38
  450. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +0 -40
  451. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -36
  452. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +0 -28
  453. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -27
  454. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +0 -63
  455. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -20
  456. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -76
  457. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -46
  458. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -51
  459. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -56
  460. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -41
  461. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -16
  462. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -44
  463. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -24
  464. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -24
  465. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +0 -21
  466. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -27
  467. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +0 -31
  468. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +0 -28
  469. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -40
  470. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -20
  471. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +0 -32
  472. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +0 -25
  473. package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +0 -58
  474. package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +0 -82
  475. package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +0 -116
  476. package/packages/client_build_tool/lib/shared/bundler/webpack/statsConfig.js +0 -30
  477. package/packages/client_build_tool/lib/shared/bundler/webpack/tsLoaders.js +0 -17
  478. package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js +0 -54
  479. package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/updateArrayWithDefault.test.js +0 -47
  480. package/packages/client_build_tool/lib/shared/bundler/webpack/utils/index.js +0 -31
  481. package/packages/client_build_tool/lib/shared/bundler/webpack/utils/object-manipulation.js +0 -87
  482. package/packages/client_build_tool/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -34
  483. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +0 -27
  484. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +0 -58
  485. package/packages/client_build_tool/lib/shared/commands-utils/doBasicRequirementCheck.js +0 -17
  486. package/packages/client_build_tool/lib/shared/commands-utils/getCliPath.js +0 -39
  487. package/packages/client_build_tool/lib/shared/commands-utils/index.js +0 -29
  488. package/packages/client_build_tool/lib/shared/commands-utils/log.js +0 -13
  489. package/packages/client_build_tool/lib/shared/commands-utils/readArgsFormCommandLine.js +0 -11
  490. package/packages/client_build_tool/lib/shared/commands-utils/readOptionFormCommandLine.js +0 -11
  491. package/packages/client_build_tool/lib/shared/commands-utils/spawnSyncIO.js +0 -38
  492. package/packages/client_build_tool/lib/shared/constants.js +0 -48
  493. package/packages/client_build_tool/lib/shared/fileUtils/copyFile.js +0 -38
  494. package/packages/client_build_tool/lib/shared/fileUtils/directoryIterator.js +0 -21
  495. package/packages/client_build_tool/lib/shared/fileUtils/watchRun.js +0 -112
  496. package/packages/client_build_tool/lib/shared/postcss/__test__/ignoreTestCases.test.js +0 -80
  497. package/packages/client_build_tool/lib/shared/postcss/__test__/postcss-rtl-all-cases.test.js +0 -119
  498. package/packages/client_build_tool/lib/shared/postcss/__test__/postcssRtl.spec.js +0 -34
  499. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +0 -21
  500. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +0 -10
  501. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +0 -66
  502. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +0 -136
  503. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +0 -32
  504. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -20
  505. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +0 -20
  506. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -24
  507. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +0 -43
  508. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -52
  509. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +0 -139
  510. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -90
  511. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +0 -57
  512. package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +0 -347
  513. package/packages/client_build_tool/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +0 -55
  514. package/packages/client_build_tool/lib/shared/postcss/getAllowedPostCssPlugins.js +0 -30
  515. package/packages/client_build_tool/lib/shared/postcss/getSpecificPostCssPlugin.js +0 -58
  516. package/packages/client_build_tool/lib/shared/postcss/runPostCssForCssFile.js +0 -37
  517. package/packages/client_build_tool/lib/shared/pre_process/runPreProcess.js +0 -58
  518. package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +0 -41
  519. package/packages/client_build_tool/lib/shared/server/corsHandling.js +0 -30
  520. package/packages/client_build_tool/lib/shared/server/getIp.js +0 -30
  521. package/packages/client_build_tool/lib/shared/server/getServerURL.js +0 -36
  522. package/packages/client_build_tool/lib/shared/server/httpsOptions.js +0 -46
  523. package/packages/client_build_tool/lib/shared/server/initExpressApp.js +0 -19
  524. package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +0 -99
  525. package/packages/client_build_tool/lib/shared/server/mockApiHandler.js +0 -60
  526. package/packages/client_build_tool/lib/shared/server/mockServer.js +0 -41
  527. package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +0 -27
  528. package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +0 -35
  529. package/packages/client_build_tool/lib/shared/server/startHttpServer.js +0 -26
  530. package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +0 -38
  531. package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +0 -41
  532. package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +0 -44
  533. package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +0 -19
  534. package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +0 -48
  535. package/packages/client_build_tool/lib/shared/server/urlConcat.js +0 -32
  536. package/packages/client_build_tool/lib/shared/utils/requireLocalOrGlobal.js +0 -81
  537. package/packages/client_build_tool/lib/shared/utils/utils.js +0 -1
  538. package/packages/client_build_tool/lib/shared/utils/versionPrint.js +0 -20
  539. package/packages/client_build_tool/node_modules/history/CHANGES.md +0 -395
  540. package/packages/client_build_tool/node_modules/history/DOMUtils.js +0 -3
  541. package/packages/client_build_tool/node_modules/history/ExecutionEnvironment.js +0 -3
  542. package/packages/client_build_tool/node_modules/history/LICENSE +0 -21
  543. package/packages/client_build_tool/node_modules/history/LocationUtils.js +0 -3
  544. package/packages/client_build_tool/node_modules/history/PathUtils.js +0 -3
  545. package/packages/client_build_tool/node_modules/history/README.md +0 -282
  546. package/packages/client_build_tool/node_modules/history/cjs/history.js +0 -933
  547. package/packages/client_build_tool/node_modules/history/cjs/history.min.js +0 -1
  548. package/packages/client_build_tool/node_modules/history/createBrowserHistory.js +0 -3
  549. package/packages/client_build_tool/node_modules/history/createHashHistory.js +0 -3
  550. package/packages/client_build_tool/node_modules/history/createMemoryHistory.js +0 -3
  551. package/packages/client_build_tool/node_modules/history/createTransitionManager.js +0 -3
  552. package/packages/client_build_tool/node_modules/history/es/DOMUtils.js +0 -7
  553. package/packages/client_build_tool/node_modules/history/es/ExecutionEnvironment.js +0 -7
  554. package/packages/client_build_tool/node_modules/history/es/LocationUtils.js +0 -7
  555. package/packages/client_build_tool/node_modules/history/es/PathUtils.js +0 -7
  556. package/packages/client_build_tool/node_modules/history/es/createBrowserHistory.js +0 -7
  557. package/packages/client_build_tool/node_modules/history/es/createHashHistory.js +0 -7
  558. package/packages/client_build_tool/node_modules/history/es/createMemoryHistory.js +0 -7
  559. package/packages/client_build_tool/node_modules/history/es/createTransitionManager.js +0 -7
  560. package/packages/client_build_tool/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
  561. package/packages/client_build_tool/node_modules/history/esm/history.js +0 -904
  562. package/packages/client_build_tool/node_modules/history/index.js +0 -7
  563. package/packages/client_build_tool/node_modules/history/package.json +0 -120
  564. package/packages/client_build_tool/node_modules/history/umd/history.js +0 -1059
  565. package/packages/client_build_tool/node_modules/history/umd/history.min.js +0 -1
  566. package/packages/client_build_tool/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChunkManager = void 0;
7
+
8
+ // ChunkManager.js
9
+ class ChunkManager {
10
+ constructor(options) {
11
+ this.maxChunkSize = options.maxChunkSize;
12
+ this.minChunkSize = options.minChunkSize;
13
+ this.chunkGroups = new Map(); // Track related keys
14
+ }
15
+ splitChunk(chunkId, keys, numChunks) {
16
+ // Group related keys first
17
+ const groups = this.groupRelatedKeys(keys);
18
+ const newChunks = []; // Create new chunks
19
+
20
+ for (let i = 0; i < numChunks; i++) {
21
+ newChunks.push({
22
+ id: `${chunkId}_${i}`,
23
+ keys: [],
24
+ size: 0
25
+ });
26
+ } // Distribute groups to chunks to maintain key locality
27
+
28
+ groups.forEach(group => {
29
+ const targetChunk = this.findBestChunkForGroup(newChunks, group);
30
+ if (targetChunk) {
31
+ targetChunk.keys.push(...group);
32
+ targetChunk.size += group.length;
33
+ }
34
+ }); // Balance remaining individual keys
35
+
36
+ const ungroupedKeys = this.getUngroupedKeys(keys, groups);
37
+ this.distributeKeys(ungroupedKeys, newChunks);
38
+ return newChunks;
39
+ }
40
+ groupRelatedKeys(keys) {
41
+ const groups = [];
42
+ const keyPrefix = new Map(); // Group by common prefixes first
43
+
44
+ keys.forEach(key => {
45
+ const prefix = key.split('.')[0];
46
+ if (!keyPrefix.has(prefix)) {
47
+ keyPrefix.set(prefix, []);
48
+ }
49
+ keyPrefix.get(prefix).push(key);
50
+ }); // Create groups based on size constraints
51
+
52
+ keyPrefix.forEach((prefixKeys, prefix) => {
53
+ if (prefixKeys.length <= this.maxChunkSize) {
54
+ groups.push(prefixKeys);
55
+ } else {
56
+ // Split large prefix groups
57
+ const numSubgroups = Math.ceil(prefixKeys.length / this.maxChunkSize);
58
+ const subgroupSize = Math.ceil(prefixKeys.length / numSubgroups);
59
+ for (let i = 0; i < prefixKeys.length; i += subgroupSize) {
60
+ groups.push(prefixKeys.slice(i, i + subgroupSize));
61
+ }
62
+ }
63
+ });
64
+ return groups;
65
+ }
66
+ findBestChunkForGroup(chunks, group) {
67
+ let bestChunk = null;
68
+ let bestScore = -1;
69
+ chunks.forEach(chunk => {
70
+ const score = this.calculateChunkScore(chunk, group);
71
+ if (score > bestScore) {
72
+ bestScore = score;
73
+ bestChunk = chunk;
74
+ }
75
+ });
76
+ return bestChunk;
77
+ }
78
+ calculateChunkScore(chunk, group) {
79
+ // Score based on:
80
+ // 1. Available space
81
+ // 2. Related keys already in chunk
82
+ // 3. Chunk balance
83
+ const availableSpace = this.maxChunkSize - chunk.size;
84
+ if (availableSpace < group.length) return -1;
85
+ let score = 100 * (availableSpace / this.maxChunkSize); // Check for related keys
86
+
87
+ const relatedKeys = this.countRelatedKeys(chunk.keys, group);
88
+ score += relatedKeys * 10;
89
+ return score;
90
+ }
91
+ countRelatedKeys(existingKeys, newKeys) {
92
+ let count = 0;
93
+ const prefixes = new Set(newKeys.map(key => key.split('.')[0]));
94
+ existingKeys.forEach(key => {
95
+ if (prefixes.has(key.split('.')[0])) count++;
96
+ });
97
+ return count;
98
+ }
99
+ distributeKeys(keys, chunks) {
100
+ // Sort chunks by available space
101
+ chunks.sort((a, b) => this.maxChunkSize - a.size - (this.maxChunkSize - b.size));
102
+ keys.forEach(key => {
103
+ const targetChunk = chunks.find(chunk => chunk.size < this.maxChunkSize);
104
+ if (targetChunk) {
105
+ targetChunk.keys.push(key);
106
+ targetChunk.size++;
107
+ }
108
+ });
109
+ }
110
+ mergeChunks(chunk1Id, chunk2Id) {
111
+ const chunk1 = this.chunkGroups.get(chunk1Id);
112
+ const chunk2 = this.chunkGroups.get(chunk2Id);
113
+ if (!chunk1 || !chunk2) return null;
114
+ const combinedSize = chunk1.size + chunk2.size;
115
+ if (combinedSize > this.maxChunkSize) return null;
116
+ const mergedChunk = {
117
+ id: `${chunk1Id}_${chunk2Id}_merged`,
118
+ keys: [...chunk1.keys, ...chunk2.keys],
119
+ size: combinedSize
120
+ };
121
+ this.chunkGroups.delete(chunk1Id);
122
+ this.chunkGroups.delete(chunk2Id);
123
+ this.chunkGroups.set(mergedChunk.id, mergedChunk);
124
+ return mergedChunk;
125
+ }
126
+ getUngroupedKeys(allKeys, groups) {
127
+ const groupedKeys = new Set(groups.flat());
128
+ return allKeys.filter(key => !groupedKeys.has(key));
129
+ }
130
+ }
131
+ exports.ChunkManager = ChunkManager;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ // GenerateModuleIdToKeysMapPlugin.js (Updated)
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ class GenerateModuleIdToKeysMapPlugin {
7
+ constructor(options = {}) {
8
+ this.moduleToKeysMapPath = options.moduleToKeysMapPath || 'module_to_keys_map.json';
9
+ this.outputPath = options.outputPath || 'module_id_to_keys_map.json';
10
+ }
11
+ apply(compiler) {
12
+ compiler.hooks.emit.tapAsync('GenerateModuleIdToKeysMapPlugin', (compilation, callback) => {
13
+ console.log('[GenerateModuleIdToKeysMapPlugin] Plugin is running.'); // Load the existing module_to_keys_map.json
14
+
15
+ let moduleToKeysMap;
16
+ try {
17
+ const data = fs.readFileSync(this.moduleToKeysMapPath, 'utf8');
18
+ moduleToKeysMap = JSON.parse(data); // console.log('[GenerateModuleIdToKeysMapPlugin] moduleToKeysMap loaded.');
19
+ } catch (error) {
20
+ // console.error(`[GenerateModuleIdToKeysMapPlugin] Error reading ${this.moduleToKeysMapPath}:`, error);
21
+ moduleToKeysMap = {};
22
+ }
23
+ const projectRoot = path.resolve(__dirname, '..'); // Adjust '..' as needed
24
+ // Build a mapping from module relative paths to module IDs
25
+
26
+ const modulePathToIdMap = new Map();
27
+ for (const module of compilation.modules) {
28
+ if (module.resource) {
29
+ const moduleResource = module.resource;
30
+ const relativeModuleResource = path.relative(projectRoot, moduleResource).replace(/\\/g, '/').toLowerCase();
31
+ const moduleId = module.id;
32
+ modulePathToIdMap.set(relativeModuleResource, moduleId);
33
+ }
34
+ } // console.log('[GenerateModuleIdToKeysMapPlugin] Available module paths and IDs:');
35
+
36
+ for (const [modulePath, moduleId] of modulePathToIdMap.entries()) {// console.log(`Module Path: ${modulePath}, Module ID: ${moduleId}`);
37
+ } // Transform module paths in moduleToKeysMap to module IDs
38
+
39
+ const moduleIdToKeysMap = {};
40
+ for (const [modulePath, keysData] of Object.entries(moduleToKeysMap)) {
41
+ const normalizedModulePath = modulePath.replace(/\\/g, '/').toLowerCase();
42
+ const moduleId = modulePathToIdMap.get(normalizedModulePath);
43
+ if (moduleId == null) {
44
+ // console.warn(`[GenerateModuleIdToKeysMapPlugin] Module ID not found for path: ${normalizedModulePath}`);
45
+ continue;
46
+ }
47
+ const moduleIdString = String(moduleId);
48
+ moduleIdToKeysMap[moduleIdString] = keysData;
49
+ } // Write the module_id_to_keys_map.json
50
+
51
+ try {
52
+ fs.writeFileSync(this.outputPath, JSON.stringify(moduleIdToKeysMap, null, 2), 'utf8'); // console.log(`[GenerateModuleIdToKeysMapPlugin] Generated ${this.outputPath}`);
53
+ } catch (error) {// console.error(`[GenerateModuleIdToKeysMapPlugin] Error writing ${this.outputPath}:`, error);
54
+ }
55
+ callback();
56
+ });
57
+ }
58
+ }
59
+ module.exports = GenerateModuleIdToKeysMapPlugin;
@@ -0,0 +1,262 @@
1
+ "use strict";
2
+
3
+ // const { RawSource } = require('webpack-sources');
4
+ // const fs = require('fs');
5
+ // const path = require('path');
6
+ // //const axios = require('axios');
7
+ // class I18nDiffPlugin {
8
+ // constructor(options = {}) {
9
+ // const {
10
+ // localMetaManifestPath,
11
+ // liveMetaManifestUrl,
12
+ // i18nAssetsOutputPath,
13
+ // i18nDataPath,
14
+ // locales = [],
15
+ // } = options;
16
+ // if (!localMetaManifestPath || !liveMetaManifestUrl || !i18nDataPath) {
17
+ // throw new Error('I18nDiffPlugin: Missing required options.');
18
+ // }
19
+ // this.localMetaManifestPath = localMetaManifestPath;
20
+ // this.liveMetaManifestUrl = liveMetaManifestUrl;
21
+ // this.i18nAssetsOutputPath = i18nAssetsOutputPath || 'dist/i18n-diff-chunks';
22
+ // this.i18nDataPath = i18nDataPath;
23
+ // this.locales = locales;
24
+ // }
25
+ // apply(compiler) {
26
+ // compiler.hooks.emit.tapAsync('I18nDiffPlugin', async (compilation, callback) => {
27
+ // try {
28
+ // // Step 1: Fetch the live CDN meta manifest
29
+ // // const liveManifest = await this.fetchLiveManifest();
30
+ // const liveManifest = fs.readFileSync("./metaManifest.json", 'utf-8');
31
+ // // Step 2: Read the local meta manifest
32
+ // const localManifest = this.readLocalManifest();
33
+ // // Step 3: Compare manifests to find new or moved keys
34
+ // const diffKeys = this.compareManifests(localManifest, liveManifest);
35
+ // if (diffKeys.length === 0) {
36
+ // console.log('I18nDiffPlugin: No new or moved i18n keys detected.');
37
+ // return callback();
38
+ // }
39
+ // console.log(`I18nDiffPlugin: Found ${diffKeys.length} new or moved i18n keys.`);
40
+ // // Step 4: Generate i18n chunks for the diff keys
41
+ // await this.generateI18nChunks(compilation, diffKeys);
42
+ // // Step 5: Include chunks in build output (handled by emitting assets)
43
+ // callback();
44
+ // } catch (error) {
45
+ // console.error('I18nDiffPlugin: Error during processing:', error);
46
+ // callback(error);
47
+ // }
48
+ // });
49
+ // }
50
+ // // async fetchLiveManifest() {
51
+ // // console.log('I18nDiffPlugin: Fetching live CDN meta manifest...');
52
+ // // const response = await axios.get(this.liveMetaManifestUrl);
53
+ // // return response.data;
54
+ // // }
55
+ // readLocalManifest() {
56
+ // console.log('I18nDiffPlugin: Reading local meta manifest...');
57
+ // const manifestContent = fs.readFileSync(this.localMetaManifestPath, 'utf-8');
58
+ // return JSON.parse(manifestContent);
59
+ // }
60
+ // compareManifests(localManifest, liveManifest) {
61
+ // const localKeys = new Set(Object.keys(localManifest));
62
+ // const liveKeys = new Set(Object.keys(liveManifest));
63
+ // // Identify keys that are in local but not in live (new or moved keys)
64
+ // const diffKeys = [...localKeys].filter((key) => !liveKeys.has(key));
65
+ // return diffKeys;
66
+ // }
67
+ // async generateI18nChunks(compilation, diffKeys) {
68
+ // console.log('I18nDiffPlugin: Generating i18n chunks for new or moved keys...');
69
+ // for (const locale of this.locales) {
70
+ // const localeData = await this.loadLocaleData(locale);
71
+ // const i18nData = {};
72
+ // for (const key of diffKeys) {
73
+ // if (localeData[key]) {
74
+ // i18nData[key] = localeData[key];
75
+ // } else {
76
+ // console.warn(`I18nDiffPlugin: Key "${key}" not found in locale "${locale}" data.`);
77
+ // }
78
+ // }
79
+ // const chunkContent = `window.loadI18nChunk(${JSON.stringify(i18nData)});`;
80
+ // const chunkFilename = `${this.i18nAssetsOutputPath}/${locale}/i18n-diff-chunk.js`;
81
+ // // Ensure the path exists
82
+ // const outputPath = path.dirname(chunkFilename);
83
+ // if (!fs.existsSync(outputPath)) {
84
+ // fs.mkdirSync(outputPath, { recursive: true });
85
+ // }
86
+ // // Emit the chunk
87
+ // compilation.assets[chunkFilename] = new RawSource(chunkContent);
88
+ // }
89
+ // }
90
+ // async loadLocaleData(locale) {
91
+ // const localeFilePath = path.join(this.i18nDataPath, `${locale}.json`);
92
+ // if (!fs.existsSync(localeFilePath)) {
93
+ // throw new Error(`I18nDiffPlugin: Locale data file not found for "${locale}" at "${localeFilePath}".`);
94
+ // }
95
+ // const content = fs.readFileSync(localeFilePath, 'utf-8');
96
+ // return JSON.parse(content);
97
+ // }
98
+ // }
99
+ // module.exports = I18nDiffPlugin;
100
+ const {
101
+ RawSource
102
+ } = require('webpack-sources');
103
+ const fs = require('fs');
104
+ const path = require('path'); //const getI18nKeysFromModules = require('./utils/getI18nKeysFromModules');
105
+
106
+ const {
107
+ convertUnicode
108
+ } = require('../I18nSplitPlugin/utils/unicodeConversion');
109
+ const pluginName = 'I18nDiffPlugin';
110
+ class I18nDiffPlugin {
111
+ constructor(options = {}) {
112
+ const {
113
+ localMetaManifestPath,
114
+ liveMetaManifestPath,
115
+ i18nAssetsOutputPath,
116
+ i18nDataPath,
117
+ jsonpFunc
118
+ } = options;
119
+ if (!localMetaManifestPath || !liveMetaManifestPath || !i18nDataPath) {
120
+ throw new Error('I18nDiffPlugin: Missing required options.');
121
+ }
122
+ this.localMetaManifestPath = localMetaManifestPath;
123
+ this.liveMetaManifestPath = liveMetaManifestPath;
124
+ this.i18nAssetsOutputPath = i18nAssetsOutputPath || 'dist/i18n-diff-chunks';
125
+ this.i18nDataPath = i18nDataPath;
126
+ this.jsonpFunc = jsonpFunc || 'window.loadI18nChunk';
127
+ this.allI18nObject = {};
128
+ this.locales = [];
129
+ }
130
+ apply(compiler) {
131
+ compiler.hooks.emit.tapAsync(pluginName, (compilation, callback) => {
132
+ try {
133
+ // Step 1: Load the live CDN meta manifest
134
+ // const liveManifest = this.loadManifest(this.liveMetaManifestPath);
135
+ const liveManifest = this.loadManifest("./metaManifest.json"); // Step 2: Read the local meta manifest
136
+
137
+ const localManifest = this.loadManifest(this.localMetaManifestPath); // Step 3: Compare manifests to find new or moved keys
138
+
139
+ const {
140
+ newKeys,
141
+ movedKeys
142
+ } = this.compareManifests(localManifest, liveManifest);
143
+ const diffKeys = [...new Set([...newKeys, ...movedKeys])];
144
+ if (diffKeys.length === 0) {
145
+ console.log('I18nDiffPlugin: No new or moved i18n keys detected.');
146
+ return callback();
147
+ }
148
+ console.log(`I18nDiffPlugin: Found ${diffKeys.length} new or moved i18n keys.`);
149
+ console.log(`New keys: ${newKeys.join(', ')}`);
150
+ console.log(`Moved keys: ${movedKeys.join(', ')}`); // Step 4: Load all i18n data
151
+
152
+ this.loadAllI18nData(); // Step 5: Generate i18n chunks for the diff keys
153
+
154
+ this.generateI18nChunks(compilation, diffKeys);
155
+ callback();
156
+ } catch (error) {
157
+ console.error('I18nDiffPlugin: Error during processing:', error);
158
+ callback(error);
159
+ }
160
+ });
161
+ }
162
+ loadManifest(manifestPath) {
163
+ console.log(`I18nDiffPlugin: Loading manifest from ${manifestPath}...`);
164
+ const manifestContent = fs.readFileSync(manifestPath, 'utf-8');
165
+ return JSON.parse(manifestContent);
166
+ }
167
+ compareManifests(localManifest, liveManifest) {
168
+ const localKeys = Object.keys(localManifest.keyToCacheGroupMap);
169
+ const liveKeys = Object.keys(liveManifest.keyToCacheGroupMap);
170
+ const newKeys = localKeys.filter(key => !liveKeys.includes(key));
171
+ const movedKeys = localKeys.filter(key => {
172
+ if (liveKeys.includes(key)) {
173
+ const localGroups = localManifest.keyToCacheGroupMap[key];
174
+ const liveGroups = liveManifest.keyToCacheGroupMap[key];
175
+ return JSON.stringify(localGroups) !== JSON.stringify(liveGroups);
176
+ }
177
+ return false;
178
+ });
179
+ return {
180
+ newKeys,
181
+ movedKeys
182
+ };
183
+ } // loadAllI18nData() {
184
+ // console.log('I18nDiffPlugin: Loading all i18n data...');
185
+ // const files = fs.readdirSync(this.i18nDataPath);
186
+ // files.forEach((file) => {
187
+ // const locale = path.basename(file, path.extname(file));
188
+ // const localeFilePath = path.join(this.i18nDataPath, file);
189
+ // const content = fs.readFileSync(localeFilePath, 'utf-8');
190
+ // this.allI18nObject[locale] = JSON.parse(content);
191
+ // this.locales.push(locale);
192
+ // });
193
+ // console.log(`I18nDiffPlugin: Locales found: ${this.locales.join(', ')}`);
194
+ // }
195
+
196
+ loadAllI18nData() {
197
+ console.log('I18nDiffPlugin: Loading all i18n data...');
198
+ const files = fs.readdirSync(this.i18nDataPath);
199
+ files.forEach(file => {
200
+ const locale = path.basename(file, path.extname(file));
201
+ const localeFilePath = path.join(this.i18nDataPath, file);
202
+ const content = fs.readFileSync(localeFilePath, 'utf-8'); // Regular expression to match 'var i18n = {...};'
203
+
204
+ const regex = /var\s+i18n\s*=\s*(\{[\s\S]*\});?/;
205
+ const match = content.match(regex);
206
+ if (match && match[1]) {
207
+ const jsonString = match[1];
208
+ try {
209
+ const i18nData = eval('(' + jsonString + ')'); // Use eval carefully
210
+
211
+ this.allI18nObject[locale] = i18nData;
212
+ this.locales.push(locale);
213
+ } catch (err) {
214
+ console.error(`I18nDiffPlugin: Failed to parse i18n data in ${file}:`, err);
215
+ }
216
+ } else {
217
+ console.warn(`I18nDiffPlugin: Could not extract 'i18n' variable from ${file}`);
218
+ }
219
+ });
220
+ console.log(`I18nDiffPlugin: Locales found: ${this.locales.join(', ')}`);
221
+ }
222
+ generateI18nChunks(compilation, diffKeys) {
223
+ console.log('I18nDiffPlugin: Generating i18n chunks for new or moved keys...');
224
+ const chunkName = 'i18n-diff-chunk'; // For each locale, generate the i18n chunk
225
+
226
+ this.locales.forEach(locale => {
227
+ const i18nData = this.getI18nObjectByLocale(diffKeys, locale);
228
+ const moduleSource = this.getTemplateString(i18nData);
229
+ const filename = path.join(this.i18nAssetsOutputPath, locale, `${chunkName}.js`); // Ensure the path exists
230
+
231
+ const outputPath = path.dirname(filename);
232
+ if (!fs.existsSync(outputPath)) {
233
+ fs.mkdirSync(outputPath, {
234
+ recursive: true
235
+ });
236
+ } // Emit the chunk
237
+
238
+ compilation.assets[filename] = new RawSource(moduleSource);
239
+ });
240
+ }
241
+ getI18nObjectByLocale(i18nKeys, locale) {
242
+ const data = {};
243
+ i18nKeys.forEach(key => {
244
+ if (this.allI18nObject[locale][key]) {
245
+ data[key] = this.allI18nObject[locale][key];
246
+ } else {
247
+ console.warn(`I18nDiffPlugin: Key "${key}" not found in locale "${locale}" data.`);
248
+ }
249
+ });
250
+ return data;
251
+ }
252
+ getTemplateString(i18nObject) {
253
+ // const convertedI18nObject = convertUnicode(
254
+ // JSON.stringify(i18nObject, null, 0)
255
+ // );
256
+ const jsonString = JSON.stringify(i18nObject); //console.log('i18nObject:', i18nObject);
257
+
258
+ console.log('jsonString:', jsonString);
259
+ return `${this.jsonpFunc}(${jsonString});`;
260
+ }
261
+ }
262
+ module.exports = I18nDiffPlugin;
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _webpack = require("webpack");
8
+ var _path = _interopRequireDefault(require("path"));
9
+ function _interopRequireDefault(obj) {
10
+ return obj && obj.__esModule ? obj : {
11
+ default: obj
12
+ };
13
+ }
14
+
15
+ // import { Template } from 'webpack';
16
+ // const pluginName = 'I18nDownloadLogic';
17
+ // export default class I18nDownloadLogic {
18
+ // constructor({ localeVarName = 'document.documentElement.lang', publicPath = '' }) {
19
+ // this.options = {
20
+ // localeVarName,
21
+ // publicPath: publicPath.endsWith('/') ? publicPath : publicPath + '/'
22
+ // };
23
+ // }
24
+ // apply(compiler) {
25
+ // compiler.hooks.thisCompilation.tap(pluginName, compilation => {
26
+ // const { mainTemplate } = compilation;
27
+ // mainTemplate.hooks.requireEnsure.tap(pluginName, (source, chunk, hash) => {
28
+ // return Template.asString([
29
+ // source.replace(
30
+ // 'var promise = new Promise(function(resolve, reject) {',
31
+ // 'var originalPromise = new Promise(function(resolve, reject) {'
32
+ // ),
33
+ // '',
34
+ // '// I18n chunk loading logic',
35
+ // '(function(chunkId, promises) {',
36
+ // Template.indent([
37
+ // `var locale = ${this.options.localeVarName};`,
38
+ // 'if (!__webpack_require__.i18n) {',
39
+ // Template.indent([
40
+ // '__webpack_require__.i18n = {',
41
+ // ' loaded: {},',
42
+ // ' manifest: null,',
43
+ // ' manifestLoading: null,',
44
+ // ' loadManifest: function() {',
45
+ // ' var self = this;',
46
+ // ' if (this.manifest) return Promise.resolve(this.manifest);',
47
+ // ' if (this.manifestLoading) return this.manifestLoading;',
48
+ // '',
49
+ // ' console.log("[I18N] Fetching manifest...");',
50
+ // ' this.manifestLoading = fetch(__webpack_require__.p + "i18n-manifest.json")',
51
+ // ' .then(function(res) {',
52
+ // ' if (!res.ok) throw new Error("Failed to load manifest: " + res.status);',
53
+ // ' return res.json();',
54
+ // ' })',
55
+ // ' .then(function(data) {',
56
+ // ' console.log("[I18N] Manifest loaded:", data);',
57
+ // ' self.manifest = data;',
58
+ // ' self.manifestLoading = null;',
59
+ // ' return data;',
60
+ // ' })',
61
+ // ' .catch(function(error) {',
62
+ // ' console.error("[I18N] Manifest load failed:", error);',
63
+ // ' self.manifestLoading = null;',
64
+ // ' throw error;',
65
+ // ' });',
66
+ // '',
67
+ // ' return this.manifestLoading;',
68
+ // ' },',
69
+ // ' getChunkI18nFile: function(chunkId, locale) {',
70
+ // ' try {',
71
+ // ' if (!this.manifest || !this.manifest.locales) return null;',
72
+ // ' var localeData = this.manifest.locales[locale];',
73
+ // ' return localeData && localeData[chunkId];',
74
+ // ' } catch (e) {',
75
+ // ' console.error("[I18N] Error getting chunk file:", e);',
76
+ // ' return null;',
77
+ // ' }',
78
+ // ' },',
79
+ // ' loadChunkI18n: function(chunkId, locale) {',
80
+ // ' var self = this;',
81
+ // ' var key = chunkId + "_" + locale;',
82
+ // '',
83
+ // ' if (this.loaded[key]) {',
84
+ // ' return Promise.resolve();',
85
+ // ' }',
86
+ // '',
87
+ // ' return new Promise(function(resolve, reject) {',
88
+ // ' var i18nFile = self.getChunkI18nFile(chunkId, locale);',
89
+ // ' if (!i18nFile) {',
90
+ // ' // Not an error - this chunk might not have i18n data',
91
+ // ' console.log("[I18N] No i18n file for chunk:", chunkId);',
92
+ // ' resolve();',
93
+ // ' return;',
94
+ // ' }',
95
+ // '',
96
+ // ' var script = document.createElement("script");',
97
+ // ' script.charset = "utf-8";',
98
+ // ' script.setAttribute("data-chunk-id", chunkId);',
99
+ // '',
100
+ // ' script.onload = function() {',
101
+ // ' self.loaded[key] = true;',
102
+ // ' resolve();',
103
+ // ' };',
104
+ // '',
105
+ // ' script.onerror = function(error) {',
106
+ // ' console.error("[I18N] Failed to load chunk i18n:", chunkId, error);',
107
+ // ' // Don\'t reject - we don\'t want to block chunk loading',
108
+ // ' resolve();',
109
+ // ' };',
110
+ // '',
111
+ // ' script.src = __webpack_require__.p + i18nFile;',
112
+ // ' document.head.appendChild(script);',
113
+ // ' });',
114
+ // ' }',
115
+ // '};'
116
+ // ]),
117
+ // '}',
118
+ // '',
119
+ // '// Load i18n data for this chunk if needed',
120
+ // 'if (promises && Array.isArray(promises)) {',
121
+ // ' promises.push(',
122
+ // ' __webpack_require__.i18n.loadManifest()',
123
+ // ' .then(function() {',
124
+ // ' return __webpack_require__.i18n.loadChunkI18n(chunkId, locale);',
125
+ // ' })',
126
+ // ' .catch(function(error) {',
127
+ // ' console.warn("[I18N] Failed to load i18n for chunk:", chunkId, error);',
128
+ // ' })',
129
+ // ' );',
130
+ // '}'
131
+ // ]),
132
+ // '})(__webpack_require__.u ? chunkId : (typeof chunkId === "number" ? "" + chunkId : chunkId), promises);'
133
+ // ]);
134
+ // });
135
+ // });
136
+ // }
137
+ // }
138
+ const pluginName = 'I18nDownloadLogic';
139
+ class I18nDownloadLogic {
140
+ constructor({
141
+ filenameTemplate = 'i18n-chunk/[locale]/[name].[chunkhash].i18n.js',
142
+ publicPath = '',
143
+ localeVarName = 'document.documentElement.lang',
144
+ locales = []
145
+ }) {
146
+ this.locales = locales;
147
+ this.publicPath = publicPath;
148
+ this.options = {
149
+ filenameTemplate,
150
+ localeVarName
151
+ };
152
+ }
153
+ apply(compiler) {
154
+ compiler.hooks.thisCompilation.tap(pluginName, compilation => {
155
+ const {
156
+ mainTemplate
157
+ } = compilation;
158
+ mainTemplate.hooks.requireEnsure.tap(pluginName, (source, chunk, hash) => {
159
+ return _webpack.Template.asString([source, '', '// I18n chunk loading logic', '(function() {', _webpack.Template.indent([
160
+ // Initialize loading state tracking
161
+ 'if (!__webpack_require__.i18n) {', _webpack.Template.indent(['__webpack_require__.i18n = {', ' // Track loaded chunks by locale', ' loaded: {},', '', ' // Current and fallback manifests', ' manifest: null,', ' fallbackManifest: null,', '', ' // Load manifest with fallback support', ' loadManifest: function() {', ' var self = this;', ' if (this.manifest) return Promise.resolve(this.manifest);', '', ' return fetch(__webpack_require__.p + "i18n-manifest.json")', ' .then(function(res) {', ' if (!res.ok) throw new Error("No manifest");', ' return res.json();', ' })', ' .then(function(data) {', ' self.manifest = data;', ' return data;', ' })', ' .catch(function(error) {', ' return fetch(__webpack_require__.p + "i18n-manifest.main.json")', ' .then(function(res) { return res.json(); })', ' .then(function(data) {', ' self.fallbackManifest = data;', ' return self.manifest || data;', ' });', ' });', ' },', '', ' // Find which chunk contains a key', ' findChunkForKey: function(key) {', ' // Check current manifest first', ' if (this.manifest && this.manifest.chunks) {', ' for (var chunk in this.manifest.chunks) {', ' if (this.manifest.chunks[chunk].includes(key)) {', ' return chunk;', ' }', ' }', ' }', '', ' // Check key movement history', ' if (this.manifest && this.manifest.keyMovements && this.manifest.keyMovements[key]) {', ' return this.manifest.keyMovements[key].newChunk;', ' }', '', ' // Check fallback manifest', ' if (this.fallbackManifest && this.fallbackManifest.chunks) {', ' for (var chunk in this.fallbackManifest.chunks) {', ' if (this.fallbackManifest.chunks[chunk].includes(key)) {', ' return chunk;', ' }', ' }', ' }', '', ' return null;', ' },', '', ' // Get all keys for a chunk including moved keys', ' loadChunkKeys: function(chunkId) {', ' var keys = [];', ' if (this.manifest && this.manifest.chunks[chunkId]) {', ' keys = keys.concat(this.manifest.chunks[chunkId]);', ' }', '', ' // Add keys that were moved to this chunk', ' if (this.manifest && this.manifest.keyMovements) {', ' Object.entries(this.manifest.keyMovements)', ' .forEach(function([key, movement]) {', ' if (movement.newChunk === chunkId) {', ' keys.push(key);', ' }', ' });', ' }', '', ' return keys;', ' },', '', ' // Load a chunk for a specific locale', ' loadLocaleChunk: function(chunkId, locale) {', ' var self = this;', ' var loadedKey = chunkId + "_" + locale;', '', ' if (self.loaded[loadedKey]) {', ' return Promise.resolve();', ' }', '', ' return this.loadManifest().then(function(manifest) {', ' var chunkPath = manifest.locales[locale][chunkId];', ' if (!chunkPath) {', ' console.warn("No i18n chunk found for", {chunkId: chunkId, locale: locale});', ' return Promise.resolve();', ' }', '', ' return new Promise(function(resolve, reject) {', ' var script = document.createElement("script");', ' script.charset = "utf-8";', ' script.timeout = 120;', ' script.src = __webpack_require__.p + chunkPath;', '', ' var timeout = setTimeout(function() {', ' onScriptError({ type: "timeout", target: script });', ' }, 120000);', '', ' function onScriptComplete() {', ' script.onerror = script.onload = null;', ' clearTimeout(timeout);', ' self.loaded[loadedKey] = true;', ' resolve();', ' }', '', ' function onScriptError(event) {', ' script.onerror = script.onload = null;', ' clearTimeout(timeout);', ' var errorType = event && event.type;', ' var realSrc = event && event.target && event.target.src;', ' var error = new Error("Loading i18n chunk " + chunkId + " failed.\\n(" + errorType + ": " + realSrc + ")");', ' error.type = errorType;', ' error.request = realSrc;', ' reject(error);', ' }', '', ' script.onerror = onScriptError;', ' script.onload = onScriptComplete;', '', ' document.head.appendChild(script);', ' });', ' });', ' }', '};']), '}', '', '// Load i18n for the current chunk', 'var locale = ' + this.options.localeVarName + ';', 'if (locale && chunkId) {', _webpack.Template.indent(['promises.push(__webpack_require__.i18n.loadLocaleChunk(chunkId, locale));']), '}']), '})();']);
162
+ });
163
+ });
164
+ }
165
+ }
166
+ exports.default = I18nDownloadLogic;