@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.
- package/README.md +0 -18
- package/lib/babel/babel-option-utils/babel-preset-react-option.js +0 -3
- package/lib/babel/cmjs-plugins-presets.js +1 -8
- package/lib/babel/es-plugins-presets.js +1 -8
- package/lib/common/buildEs.js +1 -0
- package/lib/common/getEntries.js +2 -13
- package/lib/common/getPublicPathConfig.js +0 -6
- package/lib/common/index.js +1 -6
- package/lib/common/runPreProcess.js +6 -15
- package/lib/common/splitChunks.js +2 -21
- package/lib/common/sslcertUpdater.js +7 -18
- package/lib/common/templateParameters.js +0 -2
- package/lib/common/testPattern.js +10 -21
- package/lib/common/valueReplacer.js +1 -16
- package/lib/configs/jest.config.js +2 -11
- package/lib/configs/libAlias.js +10 -16
- package/lib/configs/resolvers.js +6 -16
- package/lib/configs/webpack.component.umd.config.js +1 -6
- package/lib/configs/webpack.css.umd.config.js +6 -14
- package/lib/configs/webpack.dev.config.js +1 -14
- package/lib/configs/webpack.docs.config.js +1 -9
- package/lib/configs/webpack.impact.config.js +1 -8
- package/lib/configs/webpack.prod.config.js +4 -17
- package/lib/constants.js +9 -18
- package/lib/deprecationLogger.js +0 -7
- package/lib/hooks/docsProptypeHook.js +4 -8
- package/lib/jest/commitedFilesResult.js +4 -46
- package/lib/jest/coverageCollector.js +1 -12
- package/lib/jest/jsonMaker.js +0 -6
- package/lib/jest/preProcessors/cssPreprocessor.js +1 -9
- package/lib/jest/preProcessors/jsPreprocessor.js +1 -6
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +1 -4
- package/lib/jest/result.js +1 -23
- package/lib/jest/run.js +7 -18
- package/lib/jest/setup.js +8 -60
- package/lib/loaderUtils/configsAssetsLoaders.js +2 -12
- package/lib/loaderUtils/getCSSLoaders.js +10 -22
- package/lib/loaderUtils/getDevJsLoaders.js +4 -13
- package/lib/loaderUtils/index.js +1 -4
- package/lib/loaderUtils/tests/windowsModification.test.js +0 -1
- package/lib/loaderUtils/windowsModification.js +2 -3
- package/lib/loaders/__test__/markdownLoader.spec.js +0 -1
- package/lib/loaders/composeLoader.js +13 -37
- package/lib/loaders/docsLoader.js +1 -12
- package/lib/loaders/docsPropsLoader.js +4 -8
- package/lib/loaders/enhancedReactLiveConverter.js +2 -23
- package/lib/loaders/fileBountryLoader.js +1 -3
- package/lib/loaders/fileLoader.js +12 -23
- package/lib/loaders/markdownLoader.js +14 -19
- package/lib/loaders/reactLiveConvertor.js +5 -15
- package/lib/loaders/scriptInstrumentLoader.js +7 -16
- package/lib/loaders/selectorMappingLoader.js +7 -26
- package/lib/loaders/workerLoader.js +9 -24
- package/lib/logger.js +0 -4
- package/lib/middlewares/HMRMiddleware.js +13 -27
- package/lib/middlewares/SSTMiddleware.js +1 -5
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +1 -24
- package/lib/pluginUtils/getDevPlugins.js +9 -42
- package/lib/pluginUtils/getDocsPlugins.js +3 -13
- package/lib/pluginUtils/getLibraryImactPlugins.js +5 -6
- package/lib/pluginUtils/getLibraryPlugins.js +2 -8
- package/lib/pluginUtils/getProdPlugins.js +8 -47
- package/lib/pluginUtils/getServerPlugins.js +2 -8
- package/lib/pluginUtils/getUMDCSSPlugins.js +2 -10
- package/lib/pluginUtils/getUMDComponentPlugins.js +2 -10
- package/lib/pluginUtils/index.js +1 -9
- package/lib/plugins/CdnChangePlugin.js +2 -18
- package/lib/plugins/CleanupStatsPlugin.js +0 -5
- package/lib/plugins/CssOrderControlPlugin.js +3 -6
- package/lib/plugins/CustomAttributePlugin.js +14 -19
- package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +3 -23
- package/lib/plugins/EFCPlugin.js +20 -34
- package/lib/plugins/EFCTemplatePlugin.js +19 -30
- package/lib/plugins/EfcResourceCleanupPlugin.js +0 -3
- package/lib/plugins/EventsHandlingPlugin.js +2 -4
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +14 -37
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +10 -15
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +78 -155
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +198 -81
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +12 -23
- package/lib/plugins/I18nSplitPlugin/index.js +13 -24
- package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +279 -0
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
- package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +51 -0
- package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +48 -0
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +1 -8
- package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -20
- package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +0 -1
- package/lib/plugins/ManifestPlugin.js +1 -18
- package/lib/plugins/MinifyPlugin.js +1 -10
- package/lib/plugins/ModuleStatsPlugin.js +1 -24
- package/lib/plugins/OptimizeJSPlugin.js +2 -10
- package/lib/plugins/PublicPathCallbackPlugin.js +1 -12
- package/lib/plugins/PublicPathChangePlugin.js +6 -39
- package/lib/plugins/ReportGeneratePlugin.js +5 -32
- package/lib/plugins/RequireVariablePublicPlugin.js +1 -8
- package/lib/plugins/ResourceHintsPlugin.js +4 -13
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +10 -17
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
- package/lib/plugins/ScriptInstrumentPlugin.js +1 -8
- package/lib/plugins/SelectorPlugin.js +6 -32
- package/lib/plugins/ServiceWorkerPlugin.js +5 -22
- package/lib/plugins/ShadowDOMSupportPlugin.js +4 -41
- package/lib/plugins/SourceMapHookPlugin.js +2 -12
- package/lib/plugins/StatsPlugin.js +0 -14
- package/lib/plugins/TPHashMappingPlugin.js +3 -18
- package/lib/plugins/UnusedFilesFindPlugin.js +4 -39
- package/lib/plugins/VariableConversionCollector.js +15 -42
- package/lib/plugins/index.js +1 -20
- package/lib/plugins/libraryImpactPlugin.js +1 -33
- package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +306 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +363 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +694 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +1258 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +542 -0
- package/lib/plugins/newi18nsplitplugin/18nplugin.js +974 -0
- package/lib/plugins/newi18nsplitplugin/ChunkManager.js +131 -0
- package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +59 -0
- package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +262 -0
- package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +166 -0
- package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +111 -0
- package/lib/plugins/newi18nsplitplugin/KeyCollector.js +163 -0
- package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +88 -0
- package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +101 -0
- package/lib/plugins/newi18nsplitplugin/constants.js +162 -0
- package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +78 -0
- package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +22 -0
- package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +18 -0
- package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +580 -0
- package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +54 -0
- package/lib/plugins/utils/classHandling.js +0 -6
- package/lib/plugins/utils/fileHandling.js +6 -15
- package/lib/plugins/utils/tests/fileHandling.test.js +0 -4
- package/lib/plugins/variableConvertorUtils.js +14 -29
- package/lib/plugins/webpackwatchrunplugin.js +0 -5
- package/lib/postcss-plugins/EmptyPlugin.js +3 -4
- package/lib/postcss-plugins/ExcludePlugin.js +1 -5
- package/lib/postcss-plugins/IncludePlugin.js +1 -5
- package/lib/postcss-plugins/RTLSplitPlugin.js +14 -27
- package/lib/postcss-plugins/SelectorReplace.js +1 -16
- package/lib/postcss-plugins/ValueReplacer.js +7 -6
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +6 -3
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +2 -5
- package/lib/postcss-plugins/hoverActivePlugin.js +31 -67
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +0 -7
- package/lib/postcss-plugins/variableModificationPlugin/index.js +28 -49
- package/lib/schemas/index.js +3 -10
- package/lib/servers/clusterHubServer.js +1 -11
- package/lib/servers/devBuild.js +14 -26
- package/lib/servers/docsServer.js +1 -3
- package/lib/servers/docsServerCore.js +1 -22
- package/lib/servers/getCliPath.js +0 -9
- package/lib/servers/helpServer.js +1 -6
- package/lib/servers/httpsOptions.js +2 -8
- package/lib/servers/impactServer.js +3 -35
- package/lib/servers/mockserver.js +1 -10
- package/lib/servers/nowatchserver.js +12 -37
- package/lib/servers/requireLocalOrGlobal.js +6 -17
- package/lib/servers/scrServer.js +14 -21
- package/lib/servers/server.js +6 -36
- package/lib/servers/ssServer.js +1 -17
- package/lib/templates/CoverageScriptTemplate.js +0 -14
- package/lib/templates/WMSTemplate.js +7 -13
- package/lib/templates/linterConstant.js +2 -4
- package/lib/utils/babelPresets.js +3 -7
- package/lib/utils/clean.js +3 -9
- package/lib/utils/copy.js +1 -7
- package/lib/utils/copyTimezones.js +1 -9
- package/lib/utils/createEventStream.js +1 -6
- package/lib/utils/cssClassNameGenerate.js +10 -30
- package/lib/utils/cssURLReplacer.js +1 -22
- package/lib/utils/dependencyPostPublish.js +1 -10
- package/lib/utils/deprecationSupport.js +7 -32
- package/lib/utils/fileUtils.js +1 -28
- package/lib/utils/folderIterator.js +2 -13
- package/lib/utils/getComponents.js +0 -21
- package/lib/utils/getCurrentBranch.js +0 -5
- package/lib/utils/getDependenciesImpactList.js +1 -22
- package/lib/utils/getFileType.js +2 -10
- package/lib/utils/getHash.js +1 -8
- package/lib/utils/getIp.js +0 -2
- package/lib/utils/getOptions.js +16 -53
- package/lib/utils/getServerURL.js +1 -10
- package/lib/utils/index.js +4 -51
- package/lib/utils/init.js +0 -1
- package/lib/utils/initPreCommitHook.js +7 -30
- package/lib/utils/jsonHelper.js +3 -22
- package/lib/utils/libraryImpactConfig.js +2 -5
- package/lib/utils/lint/addScripts.js +2 -5
- package/lib/utils/lint/checkExistingConfig.js +3 -12
- package/lib/utils/lint/copyConfigs.js +0 -3
- package/lib/utils/lint/index.js +0 -9
- package/lib/utils/lint/lintScripts.js +0 -1
- package/lib/utils/lint/lintSetup.js +3 -4
- package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
- package/lib/utils/lint/question.js +0 -7
- package/lib/utils/lintReporter.js +0 -20
- package/lib/utils/log.js +0 -1
- package/lib/utils/mailSender.js +1 -8
- package/lib/utils/object-manipulation.js +1 -17
- package/lib/utils/pullOrigin.js +0 -4
- package/lib/utils/reinstallDependencies.js +1 -29
- package/lib/utils/removeAttributes.js +1 -8
- package/lib/utils/repoClone.js +3 -28
- package/lib/utils/request.js +0 -12
- package/lib/utils/rtl.js +5 -17
- package/lib/utils/selectorReplacer.js +10 -16
- package/lib/utils/setEnvVariables.js +0 -2
- package/lib/utils/ssTestHack.js +1 -11
- package/lib/utils/switchBranch.js +0 -5
- package/lib/utils/typeCheck.js +0 -1
- package/lib/utils/urlConcat.js +0 -4
- package/lib/utils/useExitCleanup.js +9 -10
- package/lib/utils/variableConverter.js +22 -31
- package/{npm-shrinkwrap.json → package-lock.json} +2098 -1999
- package/package.json +1 -1
- package/packages/client_build_tool/lib/allCommandsConfigs.js +0 -25
- package/packages/client_build_tool/lib/commands/build/commandExecutor.js +0 -17
- package/packages/client_build_tool/lib/commands/build/config.js +0 -12
- package/packages/client_build_tool/lib/commands/build/optionsProcessor.js +0 -35
- package/packages/client_build_tool/lib/commands/build/preProcessor.js +0 -12
- package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +0 -33
- package/packages/client_build_tool/lib/commands/buildEs/config.js +0 -12
- package/packages/client_build_tool/lib/commands/buildEs/preProcessor.js +0 -17
- package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +0 -33
- package/packages/client_build_tool/lib/commands/buildLib/config.js +0 -12
- package/packages/client_build_tool/lib/commands/buildLib/preProcessor.js +0 -17
- package/packages/client_build_tool/lib/commands/mockserver/commandExecutor.js +0 -43
- package/packages/client_build_tool/lib/commands/mockserver/config.js +0 -12
- package/packages/client_build_tool/lib/commands/pre_process/commandExecutor.js +0 -18
- package/packages/client_build_tool/lib/commands/pre_process/config.js +0 -12
- package/packages/client_build_tool/lib/commands/start/commandExecutor.js +0 -12
- package/packages/client_build_tool/lib/commands/start/config.js +0 -12
- package/packages/client_build_tool/lib/commands/start/optionsProcessor.js +0 -30
- package/packages/client_build_tool/lib/commands/start/preProcessor.js +0 -12
- package/packages/client_build_tool/lib/commands/template/commandExecutor.js +0 -28
- package/packages/client_build_tool/lib/commands/template/config.js +0 -12
- package/packages/client_build_tool/lib/commands/version/commandExecutor.js +0 -14
- package/packages/client_build_tool/lib/commands/version/config.js +0 -12
- package/packages/client_build_tool/lib/commandsRouter.js +0 -74
- package/packages/client_build_tool/lib/index.js +0 -12
- package/packages/client_build_tool/lib/logger.js +0 -34
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/otherTestCases.test.js +0 -234
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingDifferentDataTypesToSchema.test.js +0 -103
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/passingEmptyObjects.test.js +0 -41
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertArray.test.js +0 -68
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertNumber.test.js +0 -68
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertObject.test.js +0 -141
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertString.test.js +0 -68
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByCustomOptions/convertUndefinedAndNull.test.js +0 -132
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertArray.test.js +0 -71
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertNumber.test.js +0 -71
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertObject.test.js +0 -73
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertString.test.js +0 -71
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/__test__/replacingSchemaValueByProcessEnv/convertUndefinedAndNull.test.js +0 -138
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/index.js +0 -34
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isObject.js +0 -10
- package/packages/client_build_tool/lib/schemas/applyValuesToSchema/isValid.js +0 -14
- package/packages/client_build_tool/lib/schemas/cliArgsToObject.js +0 -39
- package/packages/client_build_tool/lib/schemas/defaultConfigValues.js +0 -349
- package/packages/client_build_tool/lib/schemas/defaultConfigValuesOnly.js +0 -187
- package/packages/client_build_tool/lib/schemas/deprecatedOptionsHandler.js +0 -67
- package/packages/client_build_tool/lib/schemas/getNpmVersion.js +0 -22
- package/packages/client_build_tool/lib/schemas/giveDefaultValue.js +0 -18
- package/packages/client_build_tool/lib/schemas/npmConfigToObject.js +0 -35
- package/packages/client_build_tool/lib/schemas/readOptions.js +0 -54
- package/packages/client_build_tool/lib/schemas/readOptionsForConfigFile.js +0 -42
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Map.test.js +0 -15
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/MathAndNumberMethod.test.js +0 -30
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/ObjectAndModules.test.js +0 -47
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Sets.test.js +0 -18
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/Symbol.test.js +0 -25
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/arrowFunction.test.js +0 -34
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/block-scoping.test.js +0 -18
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/classes.test.js +0 -55
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/defaultParameterValues.test.js +0 -18
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/extraFeatures.test.js +0 -82
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/forOf.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/promise.test.js +0 -22
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadOperator.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/spreadParams.test.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/stringAndArrayMethods.test.js +0 -67
- package/packages/client_build_tool/lib/shared/babel/__test__/es2015/variables.test.js +0 -21
- package/packages/client_build_tool/lib/shared/babel/__test__/es2016/array-includes.test.js +0 -13
- package/packages/client_build_tool/lib/shared/babel/__test__/es2016/exponentationOperator.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/asyncAndawait.test.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-entries.test.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-getOwnproperties.test.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/object-values.test.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/__test__/es2017/stringMethods.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/asynchronous-iterator.test.js +0 -19
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/object-rest-spread.test.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/promise-finally.test.js +0 -26
- package/packages/client_build_tool/lib/shared/babel/__test__/es2018/regularExpressions.test.js +0 -35
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/Json.stringify.test.js +0 -21
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/arrayMethods.test.js +0 -31
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/object-fromEntriesMethod.test.js +0 -13
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/optionalCatchBinding.test.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/revisedFunctionToString.test.js +0 -17
- package/packages/client_build_tool/lib/shared/babel/__test__/es2019/trim-startAndend-method.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/AssignmentOperator.test.js +0 -27
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/Dynamic-Import.test.js +0 -19
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/NullishOperator.test.js +0 -15
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/bigInt.test.js +0 -13
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/chainOperator.test.js +0 -17
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/export-namespace-from.test.js +0 -12
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/promiseAllSettledMathod.test.js +0 -17
- package/packages/client_build_tool/lib/shared/babel/__test__/es2020/stringMatchMethod.test.js +0 -13
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/NumericSeparator.test.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/logicalOperatorAssignments.test.js +0 -25
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/promiseAny.test.js +0 -16
- package/packages/client_build_tool/lib/shared/babel/__test__/es2021/stringReplaceMethod.test.js +0 -16
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/Array-atMethod.test.js +0 -13
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjectKeyCheck.test.js +0 -27
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/ObjecthasOwnMethod.test.js +0 -19
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/RegexMatchIndices.test.js +0 -20
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/String-atMethod.test.js +0 -15
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/error.Cause.test.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/keysCheckinPrivateFields.test.js +0 -27
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/privateMethodsAndFields.test.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/staticFieldsAndMethod.test.js +0 -54
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/topLevelAwait.test.js +0 -11
- package/packages/client_build_tool/lib/shared/babel/__test__/es2022/weakRef.test.js +0 -17
- package/packages/client_build_tool/lib/shared/babel/__test__/utilities.js +0 -28
- package/packages/client_build_tool/lib/shared/babel/addDefaultPlugins.js +0 -15
- package/packages/client_build_tool/lib/shared/babel/babelWebConfig.js +0 -54
- package/packages/client_build_tool/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -23
- package/packages/client_build_tool/lib/shared/babel/getBabelPlugin.js +0 -37
- package/packages/client_build_tool/lib/shared/babel/runBabelForJSFile.js +0 -24
- package/packages/client_build_tool/lib/shared/babel/runBabelForTsFile.js +0 -30
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -57
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +0 -31
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/modeUtils.js +0 -39
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +0 -105
- package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -21
- package/packages/client_build_tool/lib/shared/bundler/webpack/configCustomLoaders.js +0 -10
- package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +0 -16
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +0 -83
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +0 -119
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +0 -46
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +0 -109
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +0 -112
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +0 -174
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -76
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +0 -223
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +0 -73
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -88
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -29
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -24
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -76
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -39
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +0 -50
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -68
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -23
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -29
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -43
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -77
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/classesAndObject.test.js +0 -56
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/conditionalOperation.test.js +0 -154
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function.test.js +0 -89
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/function2.test.js +0 -71
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/loop.test.js +0 -112
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minifyBooleanValues.test.js +0 -43
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/minimizeVariableNames.test.js +0 -45
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/promise.test.js +0 -53
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeCommentsAndEmptySpace.test.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/removeUnusedStrings.test.js +0 -14
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/terser/__test__/variableDeclaration.test.js +0 -30
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -66
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -19
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -31
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -129
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +0 -60
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/addFilesNamesToManifestJson.test.js +0 -51
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/createInitialEntries.test.js +0 -95
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/__test__/removeHashFromFileName.test.js +0 -91
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +0 -30
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +0 -23
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -35
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -18
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -46
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -18
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -1
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +0 -193
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -62
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -84
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -27
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -73
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -20
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +0 -78
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +0 -51
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +0 -16
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -114
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +0 -68
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +0 -22
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +0 -55
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifyCss1.test.js +0 -74
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/uglifycss.test.js +0 -64
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/__test__/utilities.js +0 -28
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +0 -49
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +0 -62
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +0 -362
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +0 -80
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -14
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +0 -57
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +0 -87
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/classesAndObject.test.js +0 -56
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/conditionalOperation.test.js +0 -154
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function.test.js +0 -89
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/function2.test.js +0 -71
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/loop.test.js +0 -112
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minifyBooleanValues.test.js +0 -43
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/minimizeVariableNames.test.js +0 -45
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/promise.test.js +0 -53
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeCommentsAndEmptySpace.test.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/removeUnusedStrings.test.js +0 -14
- package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/terser/__test__/variableDeclaration.test.js +0 -30
- package/packages/client_build_tool/lib/shared/bundler/webpack/defaultVendorPatternList.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/devtoolConfig.js +0 -13
- package/packages/client_build_tool/lib/shared/bundler/webpack/entryConfig.js +0 -28
- package/packages/client_build_tool/lib/shared/bundler/webpack/externals.js +0 -17
- package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +0 -29
- package/packages/client_build_tool/lib/shared/bundler/webpack/getFilenameFromModule.js +0 -24
- package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +0 -17
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -12
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -18
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +0 -56
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -18
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +0 -37
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -21
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -86
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -65
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -21
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +0 -7
- package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +0 -133
- package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +0 -56
- package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +0 -38
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +0 -40
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -36
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +0 -28
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -27
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +0 -63
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -20
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -76
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -46
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -51
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -56
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -41
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -16
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -44
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -24
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -24
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +0 -21
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -27
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +0 -31
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +0 -28
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -40
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -20
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +0 -32
- package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +0 -25
- package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +0 -58
- package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +0 -82
- package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +0 -116
- package/packages/client_build_tool/lib/shared/bundler/webpack/statsConfig.js +0 -30
- package/packages/client_build_tool/lib/shared/bundler/webpack/tsLoaders.js +0 -17
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js +0 -54
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/__test__/updateArrayWithDefault.test.js +0 -47
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/index.js +0 -31
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/object-manipulation.js +0 -87
- package/packages/client_build_tool/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -34
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +0 -27
- package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +0 -58
- package/packages/client_build_tool/lib/shared/commands-utils/doBasicRequirementCheck.js +0 -17
- package/packages/client_build_tool/lib/shared/commands-utils/getCliPath.js +0 -39
- package/packages/client_build_tool/lib/shared/commands-utils/index.js +0 -29
- package/packages/client_build_tool/lib/shared/commands-utils/log.js +0 -13
- package/packages/client_build_tool/lib/shared/commands-utils/readArgsFormCommandLine.js +0 -11
- package/packages/client_build_tool/lib/shared/commands-utils/readOptionFormCommandLine.js +0 -11
- package/packages/client_build_tool/lib/shared/commands-utils/spawnSyncIO.js +0 -38
- package/packages/client_build_tool/lib/shared/constants.js +0 -48
- package/packages/client_build_tool/lib/shared/fileUtils/copyFile.js +0 -38
- package/packages/client_build_tool/lib/shared/fileUtils/directoryIterator.js +0 -21
- package/packages/client_build_tool/lib/shared/fileUtils/watchRun.js +0 -112
- package/packages/client_build_tool/lib/shared/postcss/__test__/ignoreTestCases.test.js +0 -80
- package/packages/client_build_tool/lib/shared/postcss/__test__/postcss-rtl-all-cases.test.js +0 -119
- package/packages/client_build_tool/lib/shared/postcss/__test__/postcssRtl.spec.js +0 -34
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +0 -21
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +0 -10
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +0 -66
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +0 -136
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +0 -32
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -20
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +0 -20
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -24
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +0 -43
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -52
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +0 -139
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -90
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +0 -57
- package/packages/client_build_tool/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +0 -347
- package/packages/client_build_tool/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +0 -55
- package/packages/client_build_tool/lib/shared/postcss/getAllowedPostCssPlugins.js +0 -30
- package/packages/client_build_tool/lib/shared/postcss/getSpecificPostCssPlugin.js +0 -58
- package/packages/client_build_tool/lib/shared/postcss/runPostCssForCssFile.js +0 -37
- package/packages/client_build_tool/lib/shared/pre_process/runPreProcess.js +0 -58
- package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +0 -41
- package/packages/client_build_tool/lib/shared/server/corsHandling.js +0 -30
- package/packages/client_build_tool/lib/shared/server/getIp.js +0 -30
- package/packages/client_build_tool/lib/shared/server/getServerURL.js +0 -36
- package/packages/client_build_tool/lib/shared/server/httpsOptions.js +0 -46
- package/packages/client_build_tool/lib/shared/server/initExpressApp.js +0 -19
- package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +0 -99
- package/packages/client_build_tool/lib/shared/server/mockApiHandler.js +0 -60
- package/packages/client_build_tool/lib/shared/server/mockServer.js +0 -41
- package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +0 -27
- package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +0 -35
- package/packages/client_build_tool/lib/shared/server/startHttpServer.js +0 -26
- package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +0 -38
- package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +0 -41
- package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +0 -44
- package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +0 -19
- package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +0 -48
- package/packages/client_build_tool/lib/shared/server/urlConcat.js +0 -32
- package/packages/client_build_tool/lib/shared/utils/requireLocalOrGlobal.js +0 -81
- package/packages/client_build_tool/lib/shared/utils/utils.js +0 -1
- package/packages/client_build_tool/lib/shared/utils/versionPrint.js +0 -20
- package/packages/client_build_tool/node_modules/history/CHANGES.md +0 -395
- package/packages/client_build_tool/node_modules/history/DOMUtils.js +0 -3
- package/packages/client_build_tool/node_modules/history/ExecutionEnvironment.js +0 -3
- package/packages/client_build_tool/node_modules/history/LICENSE +0 -21
- package/packages/client_build_tool/node_modules/history/LocationUtils.js +0 -3
- package/packages/client_build_tool/node_modules/history/PathUtils.js +0 -3
- package/packages/client_build_tool/node_modules/history/README.md +0 -282
- package/packages/client_build_tool/node_modules/history/cjs/history.js +0 -933
- package/packages/client_build_tool/node_modules/history/cjs/history.min.js +0 -1
- package/packages/client_build_tool/node_modules/history/createBrowserHistory.js +0 -3
- package/packages/client_build_tool/node_modules/history/createHashHistory.js +0 -3
- package/packages/client_build_tool/node_modules/history/createMemoryHistory.js +0 -3
- package/packages/client_build_tool/node_modules/history/createTransitionManager.js +0 -3
- package/packages/client_build_tool/node_modules/history/es/DOMUtils.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/ExecutionEnvironment.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/LocationUtils.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/PathUtils.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/createBrowserHistory.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/createHashHistory.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/createMemoryHistory.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/createTransitionManager.js +0 -7
- package/packages/client_build_tool/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
- package/packages/client_build_tool/node_modules/history/esm/history.js +0 -904
- package/packages/client_build_tool/node_modules/history/index.js +0 -7
- package/packages/client_build_tool/node_modules/history/package.json +0 -120
- package/packages/client_build_tool/node_modules/history/umd/history.js +0 -1059
- package/packages/client_build_tool/node_modules/history/umd/history.min.js +0 -1
- package/packages/client_build_tool/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
@@ -0,0 +1,542 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
//working size based approch
|
4
|
+
const path = require('path');
|
5
|
+
const fs = require('fs');
|
6
|
+
const {
|
7
|
+
getAllI18nGroupedBySection,
|
8
|
+
getPropertiesAsJSON
|
9
|
+
} = require('../I18nSplitPlugin/utils/propertiesUtils');
|
10
|
+
const {
|
11
|
+
collectI18nKeysfromAST,
|
12
|
+
collectI18nKeysfromComments
|
13
|
+
} = require('../I18nSplitPlugin/utils/collectI18nKeys');
|
14
|
+
const NullFactory = require('webpack/lib/NullFactory');
|
15
|
+
const {
|
16
|
+
I18nDependency,
|
17
|
+
I18nDependencyTemplate
|
18
|
+
} = require('../I18nSplitPlugin/I18nDependency');
|
19
|
+
const {
|
20
|
+
RawSource
|
21
|
+
} = require('webpack-sources');
|
22
|
+
const pluginName = 'I18nPlugin';
|
23
|
+
class I18nPlugin {
|
24
|
+
constructor(options = {}) {
|
25
|
+
const {
|
26
|
+
jsResourcePath,
|
27
|
+
mainChunkName,
|
28
|
+
propertiesFolder,
|
29
|
+
disableDefault,
|
30
|
+
jsResource
|
31
|
+
} = options;
|
32
|
+
if (!jsResourcePath) {
|
33
|
+
throw new Error('I18nPlugin: "jsResourcePath" option is required.');
|
34
|
+
}
|
35
|
+
if (!mainChunkName) {
|
36
|
+
throw new Error('I18nPlugin: "mainChunkName" option is required.');
|
37
|
+
}
|
38
|
+
this.jsResourcePath = jsResourcePath;
|
39
|
+
this.entryPointName = mainChunkName;
|
40
|
+
this.jsResourceI18nKeys = jsResource ? getPropertiesAsJSON(jsResource) : {}; // Use getAllI18nGroupedBySection to group keys by sections
|
41
|
+
|
42
|
+
this.allI18nKeys = getAllI18nGroupedBySection({
|
43
|
+
folderPath: propertiesFolder,
|
44
|
+
disableDefault,
|
45
|
+
jsResourceI18nKeys: this.jsResourceI18nKeys
|
46
|
+
});
|
47
|
+
console.log('Locales found:', Object.keys(this.allI18nKeys)); // Build keyToSectionMap
|
48
|
+
|
49
|
+
this.keyToSectionMap = {};
|
50
|
+
const locales = Object.keys(this.allI18nKeys);
|
51
|
+
if (locales.length > 0) {
|
52
|
+
// Use the first locale to build keyToSectionMap
|
53
|
+
const firstLocale = locales[0];
|
54
|
+
const sections = this.allI18nKeys[firstLocale];
|
55
|
+
console.log(`Sections found in properties files: ${Object.keys(sections).join(', ')}`);
|
56
|
+
for (const sectionName of Object.keys(sections)) {
|
57
|
+
const keysInSection = sections[sectionName];
|
58
|
+
for (const key of Object.keys(keysInSection)) {
|
59
|
+
this.keyToSectionMap[key] = sectionName;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
this.moduleToKeysMap = new Map();
|
64
|
+
this.keyToModulesMap = new Map();
|
65
|
+
this.keyToI18nChunkIdMap = {};
|
66
|
+
}
|
67
|
+
defineI18nDependency(compilation) {
|
68
|
+
compilation.dependencyFactories.set(I18nDependency, new NullFactory());
|
69
|
+
compilation.dependencyTemplates.set(I18nDependency, new I18nDependencyTemplate());
|
70
|
+
}
|
71
|
+
apply(compiler) {
|
72
|
+
compiler.hooks.thisCompilation.tap(pluginName, (compilation, params) => {
|
73
|
+
this.defineI18nDependency(compilation); // Handler for parser
|
74
|
+
|
75
|
+
const handler = parser => {
|
76
|
+
parser.hooks.program.tap(pluginName, (ast, comments) => {
|
77
|
+
const {
|
78
|
+
module
|
79
|
+
} = parser.state;
|
80
|
+
if (!(module && /\.jsx?$/.test(module.resource))) {
|
81
|
+
return;
|
82
|
+
} // Collect i18n keys
|
83
|
+
|
84
|
+
let i18nKeys = collectI18nKeysfromAST(ast, this.jsResourceI18nKeys);
|
85
|
+
let commentKeys = collectI18nKeysfromComments(comments, this.jsResourceI18nKeys);
|
86
|
+
i18nKeys = i18nKeys.concat(commentKeys);
|
87
|
+
if (i18nKeys.length) {
|
88
|
+
// Store the keys for this module
|
89
|
+
this.moduleToKeysMap.set(module.resource, i18nKeys); // Map keys to modules
|
90
|
+
|
91
|
+
for (const key of i18nKeys) {
|
92
|
+
if (!this.keyToModulesMap.has(key)) {
|
93
|
+
this.keyToModulesMap.set(key, new Set());
|
94
|
+
}
|
95
|
+
this.keyToModulesMap.get(key).add(module.resource);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
});
|
99
|
+
};
|
100
|
+
const factory = params.normalModuleFactory;
|
101
|
+
factory.hooks.parser.for('javascript/auto').tap(pluginName, handler);
|
102
|
+
factory.hooks.parser.for('javascript/dynamic').tap(pluginName, handler);
|
103
|
+
compilation.hooks.afterOptimizeChunks.tap(pluginName, () => {
|
104
|
+
this.processCollectedKeys(compilation);
|
105
|
+
});
|
106
|
+
});
|
107
|
+
}
|
108
|
+
processCollectedKeys(compilation) {
|
109
|
+
// Map to store chunkId to required sections
|
110
|
+
this.chunkIdToSectionsMap = {};
|
111
|
+
this.moduleChunkIdToModulesMap = {}; // Map module resource to chunk IDs
|
112
|
+
|
113
|
+
this.moduleResourceToChunkIds = new Map(); // Collect modules for the entry point
|
114
|
+
|
115
|
+
const entryPointChunk = compilation.namedChunks.get(this.entryPointName);
|
116
|
+
const entryPointModules = new Set();
|
117
|
+
if (entryPointChunk) {
|
118
|
+
for (const module of entryPointChunk.getModules()) {
|
119
|
+
if (module.resource) {
|
120
|
+
entryPointModules.add(module.resource);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
} // Iterate over all chunks in the compilation
|
124
|
+
|
125
|
+
for (const chunk of compilation.chunks) {
|
126
|
+
const chunkId = chunk.name || chunk.id;
|
127
|
+
const chunkIdString = String(chunkId); // Collect all modules in the chunk
|
128
|
+
|
129
|
+
const modules = chunk.getModules();
|
130
|
+
let requiredSections = new Set();
|
131
|
+
let moduleResources = [];
|
132
|
+
for (const module of modules) {
|
133
|
+
const moduleResource = module.resource;
|
134
|
+
if (moduleResource) {
|
135
|
+
moduleResources.push(moduleResource);
|
136
|
+
const keys = this.moduleToKeysMap.get(moduleResource);
|
137
|
+
if (keys) {
|
138
|
+
for (const key of keys) {
|
139
|
+
const section = this.keyToSectionMap[key];
|
140
|
+
if (section) {
|
141
|
+
requiredSections.add(section);
|
142
|
+
}
|
143
|
+
}
|
144
|
+
} // Map module resource to chunk IDs
|
145
|
+
|
146
|
+
if (!this.moduleResourceToChunkIds.has(moduleResource)) {
|
147
|
+
this.moduleResourceToChunkIds.set(moduleResource, new Set());
|
148
|
+
}
|
149
|
+
this.moduleResourceToChunkIds.get(moduleResource).add(chunkIdString);
|
150
|
+
}
|
151
|
+
} // Store in the map if there are required sections
|
152
|
+
|
153
|
+
if (requiredSections.size > 0) {
|
154
|
+
this.chunkIdToSectionsMap[chunkIdString] = Array.from(requiredSections);
|
155
|
+
} // Map chunkId to module resources
|
156
|
+
|
157
|
+
if (moduleResources.length > 0) {
|
158
|
+
this.moduleChunkIdToModulesMap[chunkIdString] = moduleResources;
|
159
|
+
}
|
160
|
+
} // Collect all used keys
|
161
|
+
|
162
|
+
this.allUsedKeys = new Set();
|
163
|
+
for (const keys of this.moduleToKeysMap.values()) {
|
164
|
+
for (const key of keys) {
|
165
|
+
this.allUsedKeys.add(key);
|
166
|
+
}
|
167
|
+
} // Collect entry point keys
|
168
|
+
|
169
|
+
this.entryPointKeys = new Set();
|
170
|
+
for (const moduleResource of entryPointModules) {
|
171
|
+
const keys = this.moduleToKeysMap.get(moduleResource);
|
172
|
+
if (keys) {
|
173
|
+
for (const key of keys) {
|
174
|
+
this.entryPointKeys.add(key);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
} // Collect unused keys
|
178
|
+
|
179
|
+
this.allKeysInProperties = new Set();
|
180
|
+
const firstLocale = Object.keys(this.allI18nKeys)[0];
|
181
|
+
const sections = this.allI18nKeys[firstLocale];
|
182
|
+
for (const section of Object.values(sections)) {
|
183
|
+
for (const key of Object.keys(section)) {
|
184
|
+
this.allKeysInProperties.add(key);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
this.unusedKeys = new Set([...this.allKeysInProperties].filter(key => !this.allUsedKeys.has(key))); // Remove entry point keys from allUsedKeys
|
188
|
+
|
189
|
+
this.remainingKeys = new Set([...this.allUsedKeys].filter(key => !this.entryPointKeys.has(key))); // Emit the i18n chunks
|
190
|
+
|
191
|
+
this.emitI18nChunks(compilation);
|
192
|
+
}
|
193
|
+
getValueForKeyInLocale(key, locale) {
|
194
|
+
const sections = this.allI18nKeys[locale];
|
195
|
+
for (const sectionName in sections) {
|
196
|
+
const section = sections[sectionName];
|
197
|
+
if (key in section) {
|
198
|
+
return section[key];
|
199
|
+
}
|
200
|
+
}
|
201
|
+
return undefined;
|
202
|
+
}
|
203
|
+
emitI18nChunks(compilation) {
|
204
|
+
const manifest = {
|
205
|
+
moduleToI18nChunkMap: {},
|
206
|
+
locales: {}
|
207
|
+
}; // Get the list of locales
|
208
|
+
|
209
|
+
const locales = Object.keys(this.allI18nKeys);
|
210
|
+
const firstLocale = locales[0]; // Map from i18nChunkId to keys
|
211
|
+
|
212
|
+
const i18nChunkIdToKeysMap = {};
|
213
|
+
let i18nChunkIdCounter = 0; // **Chunk 0**: Entry Point Keys
|
214
|
+
|
215
|
+
const entryPointChunkId = i18nChunkIdCounter++;
|
216
|
+
i18nChunkIdToKeysMap[entryPointChunkId] = Array.from(this.entryPointKeys);
|
217
|
+
for (const key of this.entryPointKeys) {
|
218
|
+
this.keyToI18nChunkIdMap[key] = entryPointChunkId;
|
219
|
+
} // **Last Chunk**: Unused Keys
|
220
|
+
|
221
|
+
const unusedKeysChunkId = 'unused'; // Using a string to make it distinct
|
222
|
+
|
223
|
+
i18nChunkIdToKeysMap[unusedKeysChunkId] = Array.from(this.unusedKeys); // Remaining Keys: Group into chunks of ~30KB
|
224
|
+
|
225
|
+
let currentChunkKeys = [];
|
226
|
+
let currentChunkSize = 0;
|
227
|
+
const desiredChunkSize = 1 * 1024; // 30KB
|
228
|
+
|
229
|
+
for (const key of this.remainingKeys) {
|
230
|
+
const value = this.getValueForKeyInLocale(key, firstLocale);
|
231
|
+
const keySize = Buffer.byteLength(key, 'utf8') + Buffer.byteLength(value || '', 'utf8');
|
232
|
+
if (currentChunkSize + keySize > desiredChunkSize) {
|
233
|
+
// Assign current chunk
|
234
|
+
const i18nChunkId = i18nChunkIdCounter++;
|
235
|
+
i18nChunkIdToKeysMap[i18nChunkId] = currentChunkKeys; // Map keys to i18nChunkId
|
236
|
+
|
237
|
+
for (const chunkKey of currentChunkKeys) {
|
238
|
+
this.keyToI18nChunkIdMap[chunkKey] = i18nChunkId;
|
239
|
+
} // Start a new chunk
|
240
|
+
|
241
|
+
currentChunkKeys = [];
|
242
|
+
currentChunkSize = 0;
|
243
|
+
}
|
244
|
+
currentChunkKeys.push(key);
|
245
|
+
currentChunkSize += keySize;
|
246
|
+
} // Assign the remaining keys
|
247
|
+
|
248
|
+
if (currentChunkKeys.length > 0) {
|
249
|
+
const i18nChunkId = i18nChunkIdCounter++;
|
250
|
+
i18nChunkIdToKeysMap[i18nChunkId] = currentChunkKeys; // Map keys to i18nChunkId
|
251
|
+
|
252
|
+
for (const chunkKey of currentChunkKeys) {
|
253
|
+
this.keyToI18nChunkIdMap[chunkKey] = i18nChunkId;
|
254
|
+
}
|
255
|
+
} // Now, generate the i18n chunks for each locale
|
256
|
+
|
257
|
+
for (const locale of locales) {
|
258
|
+
manifest.locales[locale] = manifest.locales[locale] || {};
|
259
|
+
for (const [i18nChunkId, keys] of Object.entries(i18nChunkIdToKeysMap)) {
|
260
|
+
const i18nData = {};
|
261
|
+
for (const key of keys) {
|
262
|
+
const value = this.getValueForKeyInLocale(key, locale);
|
263
|
+
if (value !== undefined) {
|
264
|
+
i18nData[key] = value;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
if (Object.keys(i18nData).length > 0) {
|
268
|
+
const moduleSource = `window.loadI18nChunk(${JSON.stringify(i18nData, null, 2)});`;
|
269
|
+
const filename = `i18n-chunks/${locale}/chunk-${i18nChunkId}.js`;
|
270
|
+
compilation.emitAsset(filename, new RawSource(moduleSource));
|
271
|
+
manifest.locales[locale][i18nChunkId] = filename;
|
272
|
+
console.log(`Emitted i18n chunk: ${filename}`);
|
273
|
+
}
|
274
|
+
}
|
275
|
+
} // Now, create moduleToI18nChunkMap
|
276
|
+
|
277
|
+
for (const [moduleChunkId, moduleResources] of Object.entries(this.moduleChunkIdToModulesMap)) {
|
278
|
+
const requiredI18nChunkIds = new Set();
|
279
|
+
for (const moduleResource of moduleResources) {
|
280
|
+
const keys = this.moduleToKeysMap.get(moduleResource);
|
281
|
+
if (keys) {
|
282
|
+
for (const key of keys) {
|
283
|
+
const i18nChunkId = this.keyToI18nChunkIdMap[key];
|
284
|
+
if (i18nChunkId !== undefined) {
|
285
|
+
requiredI18nChunkIds.add(i18nChunkId);
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
}
|
290
|
+
if (requiredI18nChunkIds.size > 0) {
|
291
|
+
manifest.moduleToI18nChunkMap[moduleChunkId] = Array.from(requiredI18nChunkIds);
|
292
|
+
} else {
|
293
|
+
console.log(`No required i18n chunks for module chunk ID ${moduleChunkId}`);
|
294
|
+
}
|
295
|
+
} // Ensure that the main chunk always requires chunk zero
|
296
|
+
|
297
|
+
manifest.moduleToI18nChunkMap[this.entryPointName] = manifest.moduleToI18nChunkMap[this.entryPointName] || [];
|
298
|
+
if (!manifest.moduleToI18nChunkMap[this.entryPointName].includes(entryPointChunkId)) {
|
299
|
+
manifest.moduleToI18nChunkMap[this.entryPointName].unshift(entryPointChunkId);
|
300
|
+
} // Emit the manifest file
|
301
|
+
|
302
|
+
const manifestSource = new RawSource(`window.i18n = window.i18n || {}; window.i18n.manifest = ${JSON.stringify(manifest, null, 2)};`);
|
303
|
+
const manifestFilename = 'i18n-chunks/manifest.js';
|
304
|
+
compilation.emitAsset(manifestFilename, manifestSource);
|
305
|
+
console.log(`Emitted i18n manifest: ${manifestFilename}`);
|
306
|
+
}
|
307
|
+
}
|
308
|
+
module.exports = I18nPlugin; //section based approch
|
309
|
+
// const path = require('path');
|
310
|
+
// const fs = require('fs');
|
311
|
+
// const {
|
312
|
+
// getAllI18nGroupedBySection,
|
313
|
+
// getPropertiesAsJSON,
|
314
|
+
// } = require('../I18nSplitPlugin/utils/propertiesUtils');
|
315
|
+
// const {
|
316
|
+
// collectI18nKeysfromAST,
|
317
|
+
// collectI18nKeysfromComments,
|
318
|
+
// } = require('../I18nSplitPlugin/utils/collectI18nKeys');
|
319
|
+
// const NullFactory = require('webpack/lib/NullFactory');
|
320
|
+
// const {
|
321
|
+
// I18nDependency,
|
322
|
+
// I18nDependencyTemplate,
|
323
|
+
// } = require('../I18nSplitPlugin/I18nDependency');
|
324
|
+
// const webpack = require('webpack');
|
325
|
+
// const { RawSource } = require('webpack-sources'); // Import RawSource from webpack-sources
|
326
|
+
// const pluginName = 'I18nPlugin';
|
327
|
+
// class I18nPlugin {
|
328
|
+
// constructor(options = {}) {
|
329
|
+
// const {
|
330
|
+
// jsResourcePath,
|
331
|
+
// mainChunkName,
|
332
|
+
// propertiesFolder,
|
333
|
+
// disableDefault,
|
334
|
+
// jsResource,
|
335
|
+
// } = options;
|
336
|
+
// if (!jsResourcePath) {
|
337
|
+
// throw new Error('I18nPlugin: "jsResourcePath" option is required.');
|
338
|
+
// }
|
339
|
+
// if (!mainChunkName) {
|
340
|
+
// throw new Error('I18nPlugin: "mainChunkName" option is required.');
|
341
|
+
// }
|
342
|
+
// this.jsResourcePath = jsResourcePath;
|
343
|
+
// this.entryPointName = mainChunkName;
|
344
|
+
// this.jsResourceI18nKeys = jsResource
|
345
|
+
// ? getPropertiesAsJSON(jsResource)
|
346
|
+
// : {};
|
347
|
+
// // Get all i18n keys grouped by sections
|
348
|
+
// this.allI18nKeys = getAllI18nGroupedBySection({
|
349
|
+
// folderPath: propertiesFolder,
|
350
|
+
// disableDefault,
|
351
|
+
// jsResourceI18nKeys: this.jsResourceI18nKeys,
|
352
|
+
// });
|
353
|
+
// console.log('All locales:', Object.keys(this.allI18nKeys));
|
354
|
+
// this.moduleToKeysMap = new Map();
|
355
|
+
// this.keyToModulesMap = new Map();
|
356
|
+
// this.keyToI18nChunkIdMap = {};
|
357
|
+
// }
|
358
|
+
// defineI18nDependency(compilation) {
|
359
|
+
// compilation.dependencyFactories.set(I18nDependency, new NullFactory());
|
360
|
+
// compilation.dependencyTemplates.set(
|
361
|
+
// I18nDependency,
|
362
|
+
// new I18nDependencyTemplate()
|
363
|
+
// );
|
364
|
+
// }
|
365
|
+
// addI18nDependency(module, i18nKeys) {
|
366
|
+
// const identifier = `i18n ${module.resource}`;
|
367
|
+
// const dep = new I18nDependency({ identifier, i18nKeys }, module.context, 0);
|
368
|
+
// module.addDependency(dep);
|
369
|
+
// }
|
370
|
+
// apply(compiler) {
|
371
|
+
// compiler.hooks.thisCompilation.tap(pluginName, (compilation, params) => {
|
372
|
+
// this.defineI18nDependency(compilation);
|
373
|
+
// // Handler for parser
|
374
|
+
// const handler = (parser) => {
|
375
|
+
// parser.hooks.program.tap(pluginName, (ast, comments) => {
|
376
|
+
// const { module } = parser.state;
|
377
|
+
// if (!(module && /\.jsx?$/.test(module.resource))) {
|
378
|
+
// return;
|
379
|
+
// }
|
380
|
+
// // Collect i18n keys
|
381
|
+
// let i18nKeys = collectI18nKeysfromAST(ast, this.jsResourceI18nKeys);
|
382
|
+
// let commentKeys = collectI18nKeysfromComments(
|
383
|
+
// comments,
|
384
|
+
// this.jsResourceI18nKeys
|
385
|
+
// );
|
386
|
+
// i18nKeys = i18nKeys.concat(commentKeys);
|
387
|
+
// if (i18nKeys.length) {
|
388
|
+
// // Store the keys for this module
|
389
|
+
// this.moduleToKeysMap.set(module.resource, i18nKeys);
|
390
|
+
// // Map keys to modules
|
391
|
+
// for (const key of i18nKeys) {
|
392
|
+
// if (!this.keyToModulesMap.has(key)) {
|
393
|
+
// this.keyToModulesMap.set(key, new Set());
|
394
|
+
// }
|
395
|
+
// this.keyToModulesMap.get(key).add(module.resource);
|
396
|
+
// }
|
397
|
+
// // Add I18nDependency to the module (optional, if needed)
|
398
|
+
// // this.addI18nDependency(module, i18nKeys);
|
399
|
+
// }
|
400
|
+
// });
|
401
|
+
// };
|
402
|
+
// // Tap into parser hooks
|
403
|
+
// const factory = params.normalModuleFactory;
|
404
|
+
// factory.hooks.parser.for('javascript/auto').tap(pluginName, handler);
|
405
|
+
// factory.hooks.parser.for('javascript/dynamic').tap(pluginName, handler);
|
406
|
+
// // After optimizing chunks, process collected keys
|
407
|
+
// compilation.hooks.afterOptimizeChunks.tap(pluginName, () => {
|
408
|
+
// this.processCollectedKeys(compilation);
|
409
|
+
// });
|
410
|
+
// });
|
411
|
+
// }
|
412
|
+
// processCollectedKeys(compilation) {
|
413
|
+
// console.log('Starting processCollectedKeys...');
|
414
|
+
// // Initialize mappings
|
415
|
+
// this.chunkIdToKeysMap = {};
|
416
|
+
// this.moduleChunkIdToModulesMap = {};
|
417
|
+
// // Iterate over all chunks in the compilation
|
418
|
+
// for (const chunk of compilation.chunks) {
|
419
|
+
// const chunkId = chunk.name || chunk.id;
|
420
|
+
// const chunkIdString = String(chunkId);
|
421
|
+
// console.log(`Processing chunk with ID: ${chunkIdString}`);
|
422
|
+
// // Collect all modules in the chunk
|
423
|
+
// const modules = chunk.getModules();
|
424
|
+
// let chunkKeys = new Set();
|
425
|
+
// let moduleResources = [];
|
426
|
+
// for (const module of modules) {
|
427
|
+
// const moduleResource = module.resource;
|
428
|
+
// if (moduleResource) {
|
429
|
+
// moduleResources.push(moduleResource);
|
430
|
+
// const keys = this.moduleToKeysMap.get(moduleResource);
|
431
|
+
// if (keys) {
|
432
|
+
// for (const key of keys) {
|
433
|
+
// chunkKeys.add(key);
|
434
|
+
// }
|
435
|
+
// }
|
436
|
+
// }
|
437
|
+
// }
|
438
|
+
// // Store in the map if there are keys
|
439
|
+
// chunkKeys = Array.from(chunkKeys);
|
440
|
+
// if (chunkKeys.length > 0) {
|
441
|
+
// this.chunkIdToKeysMap[chunkIdString] = chunkKeys;
|
442
|
+
// }
|
443
|
+
// // Map chunkId to module resources
|
444
|
+
// if (moduleResources.length > 0) {
|
445
|
+
// this.moduleChunkIdToModulesMap[chunkIdString] = moduleResources;
|
446
|
+
// }
|
447
|
+
// }
|
448
|
+
// // Emit the i18n chunks
|
449
|
+
// this.emitI18nChunks(compilation);
|
450
|
+
// }
|
451
|
+
// emitI18nChunks(compilation) {
|
452
|
+
// const manifest = {
|
453
|
+
// moduleToI18nChunkMap: {},
|
454
|
+
// locales: {},
|
455
|
+
// };
|
456
|
+
// // Get the list of locales
|
457
|
+
// const locales = Object.keys(this.allI18nKeys);
|
458
|
+
// // Initialize i18nChunkId counter
|
459
|
+
// let i18nChunkIdCounter = 0;
|
460
|
+
// const sectionToI18nChunkIdMap = {};
|
461
|
+
// // Assign each section to an i18n chunk
|
462
|
+
// // Assuming all locales have the same sections as the first locale
|
463
|
+
// const firstLocale = locales[0];
|
464
|
+
// const sections = Object.keys(this.allI18nKeys[firstLocale]);
|
465
|
+
// for (const sectionName of sections) {
|
466
|
+
// const i18nChunkId = i18nChunkIdCounter++;
|
467
|
+
// sectionToI18nChunkIdMap[sectionName] = i18nChunkId;
|
468
|
+
// // Collect keys for this section from the first locale
|
469
|
+
// const keys = Object.keys(this.allI18nKeys[firstLocale][sectionName] || {});
|
470
|
+
// // Map keys to i18nChunkId
|
471
|
+
// for (const key of keys) {
|
472
|
+
// this.keyToI18nChunkIdMap[key] = i18nChunkId;
|
473
|
+
// }
|
474
|
+
// // Generate the i18n chunk for each locale
|
475
|
+
// for (const locale of locales) {
|
476
|
+
// manifest.locales[locale] = manifest.locales[locale] || {};
|
477
|
+
// const i18nData = {};
|
478
|
+
// const localeSectionKeys = this.allI18nKeys[locale][sectionName] || {};
|
479
|
+
// for (const key of keys) {
|
480
|
+
// const value = localeSectionKeys[key];
|
481
|
+
// if (value !== undefined) {
|
482
|
+
// i18nData[key] = value;
|
483
|
+
// }
|
484
|
+
// }
|
485
|
+
// if (Object.keys(i18nData).length > 0) {
|
486
|
+
// const moduleSource = `window.loadI18nChunk(${JSON.stringify(i18nData, null, 2)});`;
|
487
|
+
// const filename = `i18n-chunks${locale}/${sectionName}chunk-${i18nChunkId}.js`;
|
488
|
+
// compilation.emitAsset(filename, new RawSource(moduleSource));
|
489
|
+
// manifest.locales[locale][i18nChunkId] = filename;
|
490
|
+
// }
|
491
|
+
// }
|
492
|
+
// }
|
493
|
+
// // Now, create moduleToI18nChunkMap
|
494
|
+
// for (const [moduleChunkId, moduleResources] of Object.entries(
|
495
|
+
// this.moduleChunkIdToModulesMap
|
496
|
+
// )) {
|
497
|
+
// const requiredI18nChunkIds = new Set();
|
498
|
+
// for (const moduleResource of moduleResources) {
|
499
|
+
// const keys = this.moduleToKeysMap.get(moduleResource);
|
500
|
+
// if (keys) {
|
501
|
+
// for (const key of keys) {
|
502
|
+
// const i18nChunkId = this.keyToI18nChunkIdMap[key];
|
503
|
+
// if (i18nChunkId !== undefined) {
|
504
|
+
// requiredI18nChunkIds.add(i18nChunkId);
|
505
|
+
// }
|
506
|
+
// }
|
507
|
+
// }
|
508
|
+
// }
|
509
|
+
// if (requiredI18nChunkIds.size > 0) {
|
510
|
+
// manifest.moduleToI18nChunkMap[moduleChunkId] = Array.from(
|
511
|
+
// requiredI18nChunkIds
|
512
|
+
// );
|
513
|
+
// } else {
|
514
|
+
// console.log(
|
515
|
+
// `No required i18n chunks for module chunk ID ${moduleChunkId}`
|
516
|
+
// );
|
517
|
+
// }
|
518
|
+
// }
|
519
|
+
// // Emit the manifest file
|
520
|
+
// const manifestSource = new RawSource(
|
521
|
+
// `window.i18n = window.i18n || {}; window.i18n.manifest = ${JSON.stringify(
|
522
|
+
// manifest,
|
523
|
+
// null,
|
524
|
+
// 2
|
525
|
+
// )};`
|
526
|
+
// );
|
527
|
+
// const manifestFilename = 'i18n-chunks/manifest.js';
|
528
|
+
// compilation.emitAsset(manifestFilename, manifestSource);
|
529
|
+
// console.log(`Emitted i18n manifest: ${manifestFilename}`);
|
530
|
+
// }
|
531
|
+
// }
|
532
|
+
// I18nPlugin.isChunkHasI18n = function (chunk) {
|
533
|
+
// for (const module of chunk.modulesIterable) {
|
534
|
+
// for (const dep of module.dependencies) {
|
535
|
+
// if (dep instanceof I18nDependency) {
|
536
|
+
// return true;
|
537
|
+
// }
|
538
|
+
// }
|
539
|
+
// }
|
540
|
+
// return false;
|
541
|
+
// };
|
542
|
+
// module.exports = I18nPlugin;
|