@zohodesk/react-cli 1.1.28-exp.2 → 1.1.29-exp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -18
- package/lib/configs/jest.config.js +1 -1
- package/lib/configs/libAlias.js +2 -2
- package/lib/configs/resolvers.js +2 -2
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +6 -3
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +77 -141
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +255 -60
- package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +273 -0
- package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +70 -0
- package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +59 -0
- package/lib/schemas/index.js +0 -1
- package/lib/utils/copyTimezones.js +0 -1
- package/npm-shrinkwrap.json +24 -330
- package/package.json +2 -2
- 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
package/README.md
CHANGED
@@ -44,24 +44,6 @@ Now to run app
|
|
44
44
|
|
45
45
|
# Change Logs
|
46
46
|
|
47
|
-
# 1.1.28 (29-01-2025)
|
48
|
-
|
49
|
-
**Fixes**
|
50
|
-
|
51
|
-
- We've changed the i18n Unicode conversion process. Instead of converting the Unicode at runtime, we now convert it to the corresponding language during the build process and emit the final build
|
52
|
-
- Added @zohodesk-private in transformIgnorePatterns in jest.config.js file , fix in jest
|
53
|
-
|
54
|
-
**changes**
|
55
|
-
|
56
|
-
- separate the disableES5Transpile flag as two flags disableES5Transpile and disableES5Import
|
57
|
-
- disableES5Import flag handles the alias part
|
58
|
-
- disableES5Transpile flag handles the esmodules or common modules conversion part
|
59
|
-
|
60
|
-
|
61
|
-
# 1.1.27 (16-12-2024)
|
62
|
-
|
63
|
-
- While rendering i18n keys at runtime, we convert any keys containing Unicode to their corresponding language characters before rendering. This enhances performance and reduces file size.
|
64
|
-
|
65
47
|
# 1.1.26 (06-09-2024)
|
66
48
|
|
67
49
|
**Features**
|
@@ -26,7 +26,7 @@ const commonConfig = {
|
|
26
26
|
// ...moduleNameMapper,
|
27
27
|
// '\\.(css|less)$': 'identity-obj-proxy'
|
28
28
|
// },
|
29
|
-
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk
|
29
|
+
transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
|
30
30
|
// transformIgnorePatterns: ['/node_modules.*?.js$'],
|
31
31
|
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
32
32
|
setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
|
package/lib/configs/libAlias.js
CHANGED
@@ -23,7 +23,7 @@ const {
|
|
23
23
|
app
|
24
24
|
} = (0, _utils.getOptions)();
|
25
25
|
const {
|
26
|
-
|
26
|
+
disableES5Transpile
|
27
27
|
} = app;
|
28
28
|
|
29
29
|
function aliasPathCreation(customAlias) {
|
@@ -64,7 +64,7 @@ const libAlias = {
|
|
64
64
|
// '^@components(.*)$': '<rootDir>/src/components$1',
|
65
65
|
|
66
66
|
exports.libAlias = libAlias;
|
67
|
-
const totalAlias =
|
67
|
+
const totalAlias = disableES5Transpile ? Object.assign({}, libAlias, aliasPathCreation(alias)) : aliasPathCreation(alias);
|
68
68
|
const jestModuleNameMapper = Object.keys(totalAlias).reduce((previousValue, key) => {
|
69
69
|
previousValue[`^${key}(.*)$`] = `${totalAlias[key]}$1`;
|
70
70
|
return previousValue;
|
package/lib/configs/resolvers.js
CHANGED
@@ -19,7 +19,7 @@ var _client_packages_group = require("@zohodesk/client_packages_group");
|
|
19
19
|
function moduleResolver(options) {
|
20
20
|
const {
|
21
21
|
moduleResolvePath,
|
22
|
-
|
22
|
+
disableES5Transpile
|
23
23
|
} = options.app;
|
24
24
|
const customAlias = options.alias;
|
25
25
|
let required = moduleResolvePath && (0, _requireLocalOrGlobal.requireLocal)(moduleResolvePath);
|
@@ -33,7 +33,7 @@ function moduleResolver(options) {
|
|
33
33
|
}
|
34
34
|
|
35
35
|
const nodeModulesPath = required ? required.nodeModulesPath : _client_packages_group.nodeModulesPath;
|
36
|
-
const totalAlias =
|
36
|
+
const totalAlias = disableES5Transpile ? Object.assign({}, _libAlias.libAlias, (0, _libAlias.aliasPathCreation)(customAlias)) : (0, _libAlias.aliasPathCreation)(customAlias);
|
37
37
|
return {
|
38
38
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
39
39
|
modules: [nodeModulesPath, _constants.cliNodeModulesPath, 'node_modules'].filter(Boolean),
|
@@ -63,10 +63,13 @@ class I18NInjectIntoIndexPlugin {
|
|
63
63
|
const {
|
64
64
|
assets
|
65
65
|
} = data; // Manipulate the content
|
66
|
+
// const i18nManifest = this.getI18nManifest(compilation);
|
67
|
+
// const entryPoint = compilation.entrypoints.get(this.entryPointName);
|
66
68
|
|
67
|
-
const
|
68
|
-
|
69
|
-
|
69
|
+
const i18nScriptURLs = [];
|
70
|
+
i18nScriptURLs.push("desk-i18n-manifest.js");
|
71
|
+
i18nScriptURLs.push("master.i18n.js");
|
72
|
+
i18nScriptURLs.push("masterchunk.i18n.js"); // .map(url => getI18nScriptTagObj(url));
|
70
73
|
// .join('');
|
71
74
|
// Tell webpack to move on
|
72
75
|
|
@@ -9,8 +9,6 @@ var _webpack = require("webpack");
|
|
9
9
|
|
10
10
|
var _I18nKeysIdentifer = _interopRequireDefault(require("./I18nKeysIdentifer"));
|
11
11
|
|
12
|
-
var _hashUtils = require("./utils/hashUtils");
|
13
|
-
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
13
|
|
16
14
|
/**
|
@@ -31,43 +29,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
31
29
|
* some thing missing in this definetion
|
32
30
|
*
|
33
31
|
*/
|
34
|
-
|
35
|
-
const pluginName = 'DownloadLogicOfI18n'; // const pluginName = 'i18n-plugin';
|
36
|
-
|
32
|
+
const pluginName = 'DownloadLogicOfI18n';
|
37
33
|
const MODULE_TYPE = 'json/i18n';
|
38
34
|
|
39
|
-
const ltype = locale => `${MODULE_TYPE}/${locale}`;
|
40
|
-
|
41
|
-
function hashesWithLength(hashes, length) {
|
42
|
-
const shortChunkHashMap = {};
|
43
|
-
|
44
|
-
for (let key of Object.keys(hashes)) {
|
45
|
-
if (typeof hashes[key] === 'string') {
|
46
|
-
shortChunkHashMap[key] = hashes.slice(0, length);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
return shortChunkHashMap;
|
51
|
-
}
|
52
|
-
|
53
|
-
function getContentHashMaxLength(filenameTemplate) {
|
54
|
-
let length = 0;
|
55
|
-
let matches = filenameTemplate.match(_hashUtils.REGEXP_CONTENTHASH);
|
56
|
-
|
57
|
-
for (let match of matches) {
|
58
|
-
let tem = match.match(/\d+/);
|
59
|
-
|
60
|
-
if (tem) {
|
61
|
-
length = Math.max(parseInt(tem[0]), length);
|
62
|
-
} else {
|
63
|
-
length = 0;
|
64
|
-
break;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
return length;
|
69
|
-
}
|
70
|
-
|
71
35
|
class I18nDownlodLogic {
|
72
36
|
constructor({
|
73
37
|
filenameTemplate,
|
@@ -81,34 +45,33 @@ class I18nDownlodLogic {
|
|
81
45
|
filenameTemplate,
|
82
46
|
localeVarName
|
83
47
|
};
|
48
|
+
this.finalChunkIds = new Map();
|
84
49
|
}
|
85
50
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
51
|
+
captureChunkIds(compilation) {
|
52
|
+
this.finalChunkIds.clear();
|
53
|
+
compilation.chunks.forEach(chunk => {
|
54
|
+
this.finalChunkIds.set(chunk.id, {
|
55
|
+
original: chunk.id,
|
56
|
+
name: chunk.name || null
|
57
|
+
});
|
91
58
|
});
|
92
|
-
|
93
|
-
if (!length) {
|
94
|
-
return allContenHashes;
|
95
|
-
}
|
96
|
-
|
97
|
-
let shortContentHashMap = {};
|
98
|
-
|
99
|
-
for (const locale of this.locales) {
|
100
|
-
shortContentHashMap[locale] = hashesWithLength(allContenHashes[locale], hashLength);
|
101
|
-
}
|
102
|
-
|
103
|
-
return shortContentHashMap;
|
104
59
|
}
|
105
60
|
|
106
61
|
getI18nChunkObject(mainChunk) {
|
107
62
|
const obj = {};
|
108
63
|
|
109
64
|
for (const chunk of mainChunk.getAllAsyncChunks()) {
|
65
|
+
const finalChunkId = chunk.id;
|
66
|
+
|
110
67
|
if (_I18nKeysIdentifer.default.isChunkHasI18n(chunk)) {
|
111
|
-
|
68
|
+
// Store using the final chunk ID
|
69
|
+
obj[finalChunkId] = 1; // Also keep track of which chunks have i18n content
|
70
|
+
|
71
|
+
this.finalChunkIds.set(finalChunkId, {
|
72
|
+
original: chunk.id,
|
73
|
+
name: chunk.name || null
|
74
|
+
});
|
112
75
|
}
|
113
76
|
}
|
114
77
|
|
@@ -116,6 +79,7 @@ class I18nDownlodLogic {
|
|
116
79
|
}
|
117
80
|
|
118
81
|
addDownloadLogicOfI18nInMainTemplate(mainTemplate) {
|
82
|
+
// Extend localVars to create a container for tracking loaded i18n chunks.
|
119
83
|
mainTemplate.hooks.localVars.tap(pluginName, (source, mainChunk) => {
|
120
84
|
const chunkMap = this.getI18nChunkObject(mainChunk);
|
121
85
|
|
@@ -123,141 +87,113 @@ class I18nDownlodLogic {
|
|
123
87
|
return source;
|
124
88
|
}
|
125
89
|
|
126
|
-
return _webpack.Template.asString([source, '', '//
|
127
|
-
});
|
90
|
+
return _webpack.Template.asString([source, '', '// Object to store loaded I18N chunks', '// Using final chunk IDs from webpack', 'var installedI18nChunks = {', _webpack.Template.indent(mainChunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(',\n')), '};']);
|
91
|
+
}); // Extend requireEnsure so that whenever a JS chunk is requested,
|
92
|
+
// we also download its associated i18n file (if available).
|
93
|
+
|
128
94
|
mainTemplate.hooks.requireEnsure.tap(pluginName, (source, mainChunk, hash) => {
|
129
|
-
/**
|
130
|
-
* for Information this is tapped in mainTemplate ,
|
131
|
-
* So this hooks argument chunk is main chunk means entry chunk mostly.
|
132
|
-
* if any chunk has i18n then we must write our download i18n logic,
|
133
|
-
*/
|
134
95
|
const chunkMap = this.getI18nChunkObject(mainChunk);
|
135
96
|
|
136
97
|
if (!Object.keys(chunkMap).length) {
|
137
98
|
return source;
|
138
99
|
}
|
139
|
-
/**
|
140
|
-
* chunkMaps has
|
141
|
-
* @property {Object} hash [it has key as chunk id and value as chunkHash ]
|
142
|
-
* @property {Object} name [it has key as chunk id and value as chunk name ]
|
143
|
-
*/
|
144
|
-
|
145
100
|
|
146
|
-
const chunkMaps = mainChunk.getChunkMaps();
|
147
101
|
const {
|
148
102
|
crossOriginLoading
|
149
103
|
} = mainTemplate.outputOptions;
|
150
104
|
const {
|
151
|
-
filenameTemplate,
|
152
105
|
localeVarName = 'document.documentElement.lang'
|
153
|
-
} = this.options;
|
154
|
-
const i18nSrcPath = mainTemplate.getAssetPath(JSON.stringify(filenameTemplate).replace(/\[locale\]/gi, '"+ locale +"'), // "i18n-chunk/[locale]/[name].[chunkhash].js"
|
155
|
-
{
|
156
|
-
hash: `" + ${mainTemplate.renderCurrentHashCode(hash)} + "`,
|
157
|
-
hashWithLength: length => `" + ${mainTemplate.renderCurrentHashCode(hash, length)} + "`,
|
158
|
-
chunk: {
|
159
|
-
id: '" + chunkId + "',
|
160
|
-
hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`,
|
161
|
-
|
162
|
-
hashWithLength(length) {
|
163
|
-
const shortChunkHashMap = hashesWithLength(chunkMaps.hash, length);
|
164
|
-
return `" + ${JSON.stringify(shortChunkHashMap)}[chunkId] + "`;
|
165
|
-
},
|
166
|
-
|
167
|
-
// contentHash: contentHashMap,
|
168
|
-
// contentHashWithLength: contentHashLengthMap,
|
169
|
-
contentHash: {
|
170
|
-
[MODULE_TYPE]: '" + contentHash + "'
|
171
|
-
},
|
172
|
-
contentHashWithLength: {
|
173
|
-
[MODULE_TYPE]: length => `" + contentHash.slice(0,${length}) + "`
|
174
|
-
},
|
175
|
-
name: `" + (${JSON.stringify(chunkMaps.name)}[chunkId]||chunkId) + "`
|
176
|
-
},
|
177
|
-
contentHashType: MODULE_TYPE
|
178
|
-
});
|
179
|
-
/** IDEA:
|
180
|
-
* as my suggestion ignore this `jsop` approch,
|
181
|
-
* Because json parse is faster then js parse.
|
182
|
-
* my suggestion is make ajax or fetch request
|
183
|
-
*/
|
184
|
-
|
185
|
-
const buf = [];
|
186
|
-
/*
|
187
|
-
if (REGEXP_HASH.test(filenameTemplate)) {
|
188
|
-
buf.push(
|
189
|
-
`var hash = ${mainTemplate.renderCurrentHashCode(hash)};`
|
190
|
-
);
|
191
|
-
}
|
192
|
-
if (REGEXP_CHUNKHASH.test(filenameTemplate)) {
|
193
|
-
buf.push(`var chunkHashes = ${JSON.stringify(chunkMaps.hash)};`);
|
194
|
-
}
|
195
|
-
*/
|
196
|
-
|
197
|
-
if ((0, _hashUtils.hasContentHash)(filenameTemplate)) {
|
198
|
-
const hashLength = getContentHashMaxLength(filenameTemplate);
|
199
|
-
const contentHashes = this.getShortContentHashes(mainChunk, hashLength);
|
200
|
-
buf.push(_webpack.Template.asString(['// all i18n files contentHash ', `var i18nContentHashes = ${JSON.stringify(contentHashes)};`, '', 'if (!i18nContentHashes[locale]) {', ' console.warn("this locale is "+locale + " not has support")', ' return;', '}', 'if (!i18nContentHashes[locale][chunkId]) {', ' console.warn("this chunkId is " + chunkId + " does not have \'"+locale+"\' locale chunk")', ' return;', '}']));
|
201
|
-
buf.push('var contentHash = i18nContentHashes[locale][chunkId]');
|
202
|
-
}
|
203
|
-
|
204
|
-
const hashUtils = _webpack.Template.asString(buf);
|
106
|
+
} = this.options; // Use the provided publicPath or fallback to the one provided by Webpack.
|
205
107
|
|
206
108
|
const publicPath = this.publicPath ? JSON.stringify(this.publicPath) : `${mainTemplate.requireFn}.p`;
|
207
109
|
return _webpack.Template.asString([source, `
|
208
110
|
(function() {
|
209
|
-
// ${pluginName} I18N loading
|
111
|
+
// ${pluginName} I18N loading with final chunk IDs
|
210
112
|
var i18nChunks = ${JSON.stringify(chunkMap)};
|
211
113
|
var locale = ${localeVarName};
|
212
|
-
|
213
|
-
|
214
|
-
if(installedI18nChunks[chunkId]) {
|
114
|
+
|
115
|
+
// Check if the current chunkId has an associated i18n resource
|
116
|
+
if (installedI18nChunks[chunkId]) {
|
215
117
|
promises.push(installedI18nChunks[chunkId]);
|
216
|
-
} else if(installedI18nChunks[chunkId] !== 0 && i18nChunks[chunkId]) {
|
118
|
+
} else if (installedI18nChunks[chunkId] !== 0 && i18nChunks[chunkId]) {
|
217
119
|
promises.push(installedI18nChunks[chunkId] = new Promise(function(resolve, reject) {
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
120
|
+
// Retrieve the i18n manifest from the global window.desk_i18n_manifest
|
121
|
+
var deskManifest = window.desk_i18n_manifest;
|
122
|
+
|
123
|
+
if (!deskManifest || !deskManifest.chunks || !deskManifest.chunks[chunkId]) {
|
124
|
+
console.warn("No i18n file available for chunk " + chunkId);
|
125
|
+
return resolve();
|
222
126
|
}
|
127
|
+
|
128
|
+
// Replace [locale] in the basePath with the actual locale
|
129
|
+
var basePath = deskManifest.basePath.replace("[locale]", locale);
|
130
|
+
|
131
|
+
// Construct the final URL for the i18n file
|
132
|
+
var srcPath = basePath + deskManifest.chunks[chunkId];
|
223
133
|
var fullsrcPath = ${publicPath} + srcPath;
|
224
|
-
|
225
|
-
|
226
|
-
|
134
|
+
|
135
|
+
// Avoid duplicate loading by checking existing script tags
|
136
|
+
var existingScriptTags = document.getElementsByTagName("script");
|
137
|
+
for (var i = 0; i < existingScriptTags.length; i++) {
|
138
|
+
var tag = existingScriptTags[i];
|
227
139
|
var dataSrc = tag.getAttribute("data-src") || tag.getAttribute("src");
|
228
|
-
if(dataSrc === srcPath || dataSrc === fullsrcPath){
|
140
|
+
if (dataSrc === srcPath || dataSrc === fullsrcPath) {
|
141
|
+
return resolve();
|
142
|
+
}
|
229
143
|
}
|
144
|
+
|
145
|
+
// Create a script tag to load the i18n file
|
230
146
|
var scriptTag = document.createElement("script");
|
231
|
-
scriptTag.onload = ()
|
147
|
+
scriptTag.onload = function() {
|
232
148
|
scriptTag.onerror = scriptTag.onload = null;
|
233
149
|
resolve();
|
234
150
|
};
|
151
|
+
|
235
152
|
scriptTag.onerror = function(event) {
|
236
153
|
scriptTag.onerror = scriptTag.onload = null;
|
237
|
-
var request = event && event.target && event.target.src || fullsrcPath;
|
154
|
+
var request = (event && event.target && event.target.src) || fullsrcPath;
|
238
155
|
var err = new Error("Loading I18N chunk " + chunkId + " failed.\\n(" + request + ")");
|
239
156
|
err.code = "I18N_CHUNK_LOAD_FAILED";
|
240
157
|
err.request = request;
|
241
158
|
delete installedI18nChunks[chunkId];
|
242
|
-
scriptTag.parentNode
|
159
|
+
if (scriptTag.parentNode) {
|
160
|
+
scriptTag.parentNode.removeChild(scriptTag);
|
161
|
+
}
|
243
162
|
reject(err);
|
244
163
|
};
|
164
|
+
|
245
165
|
${mainTemplate.requireFn}.nc && scriptTag.setAttribute("nonce", ${mainTemplate.requireFn}.nc);
|
246
166
|
scriptTag.src = fullsrcPath;
|
167
|
+
|
247
168
|
${crossOriginLoading ? `if (scriptTag.src.indexOf(window.location.origin + '/') !== 0) {
|
248
|
-
|
249
|
-
|
169
|
+
scriptTag.crossOrigin = ${JSON.stringify(crossOriginLoading)};
|
170
|
+
}` : ''}
|
171
|
+
|
250
172
|
document.body.appendChild(scriptTag);
|
251
173
|
}).then(function() {
|
252
174
|
installedI18nChunks[chunkId] = 0;
|
253
175
|
}));
|
254
176
|
}
|
255
|
-
})()
|
177
|
+
})()
|
178
|
+
`]);
|
256
179
|
});
|
257
180
|
}
|
181
|
+
/**
|
182
|
+
* Applies the plugin by tapping into the appropriate Webpack hooks.
|
183
|
+
* Now captures final chunk IDs after compilation is complete.
|
184
|
+
*
|
185
|
+
* @param {Compiler} compiler - The Webpack compiler instance.
|
186
|
+
*/
|
187
|
+
|
258
188
|
|
259
189
|
apply(compiler) {
|
190
|
+
// First capture final chunk IDs after compilation
|
191
|
+
compiler.hooks.afterCompile.tap(pluginName, compilation => {
|
192
|
+
this.captureChunkIds(compilation);
|
193
|
+
}); // Then inject download logic in thisCompilation
|
194
|
+
|
260
195
|
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
196
|
+
// console.log(`${pluginName}: Adding download logic with final chunk IDs`);
|
261
197
|
const {
|
262
198
|
mainTemplate
|
263
199
|
} = compilation;
|