@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
@@ -11,6 +11,12 @@ var _utils = require("./utils");
|
|
11
11
|
|
12
12
|
var _getI18nKeysFormModules = _interopRequireDefault(require("./utils/getI18nKeysFormModules"));
|
13
13
|
|
14
|
+
var _createRegularManifest = require("./utils/createRegularManifest");
|
15
|
+
|
16
|
+
var _createMetaManifest = require("./utils/createMetaManifest");
|
17
|
+
|
18
|
+
var _applyMetaManifest = require("./utils/applyMetaManifest");
|
19
|
+
|
14
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
21
|
|
16
22
|
/**
|
@@ -28,42 +34,65 @@ class I18nFilesEmitter {
|
|
28
34
|
i18nManifestFileName,
|
29
35
|
filenameTemplate,
|
30
36
|
locales,
|
31
|
-
jsonpFunc
|
37
|
+
jsonpFunc,
|
38
|
+
i18nMetaManifestFileName,
|
39
|
+
entryPointNames = ['main'],
|
40
|
+
masterChunkFileName = 'master.i18n.js',
|
41
|
+
publicPath
|
32
42
|
}) {
|
33
43
|
this.locales = locales;
|
34
44
|
this.allI18nObject = allI18nObject;
|
35
|
-
this.filenameTemplate = filenameTemplate;
|
36
|
-
|
45
|
+
this.filenameTemplate = filenameTemplate;
|
37
46
|
this.jsonpFunc = jsonpFunc;
|
38
47
|
this.prevHashes = {};
|
39
48
|
this.i18nManifestFileName = i18nManifestFileName;
|
49
|
+
this.i18nMetaManifestFileName = i18nMetaManifestFileName || 'metaManifest.json';
|
50
|
+
this.regularManifest = {};
|
51
|
+
this.detailedManifest = {};
|
52
|
+
this.entryPointNames = Array.isArray(entryPointNames) ? entryPointNames : [entryPointNames];
|
53
|
+
this.masterChunkFileName = masterChunkFileName;
|
54
|
+
this.generatedMetaManifest = {
|
55
|
+
modules: {},
|
56
|
+
masterKeys: []
|
57
|
+
};
|
58
|
+
this.extraKeys = new Set();
|
59
|
+
this.movedKeys = new Set();
|
60
|
+
this.entryPointKeys = new Set();
|
61
|
+
this.combinedChunks = {};
|
62
|
+
this.publicPath = publicPath; // Add a map to store module ID mappings
|
63
|
+
|
64
|
+
this.moduleIdMap = new Map(); // Map to track which modules belong to which chunks
|
65
|
+
|
66
|
+
this.moduleToChunks = new Map(); // Store original resource paths for stable identification
|
67
|
+
|
68
|
+
this.resourceToModule = new Map();
|
69
|
+
console.log(`I18nFilesEmitter initialized with publicPath: "${this.publicPath}"`);
|
40
70
|
}
|
41
71
|
|
42
72
|
emitAsset(compilation, filename, source, info) {
|
43
|
-
// NOTE: info support available since webpack v4.40.0 https://webpack.js.org/api/stats/#asset-objects
|
44
73
|
if (!compilation.emitAsset) {
|
45
74
|
compilation.assets[filename] = source;
|
46
75
|
} else {
|
47
76
|
compilation.emitAsset(filename, source, info);
|
48
77
|
}
|
49
|
-
}
|
50
|
-
|
78
|
+
}
|
51
79
|
|
52
80
|
getI18nObjectByLocale(i18nKeys, locale) {
|
53
81
|
const data = {};
|
54
82
|
i18nKeys.forEach(key => {
|
55
|
-
|
83
|
+
if (this.allI18nObject[locale] && this.allI18nObject[locale][key] !== undefined) {
|
84
|
+
data[key] = this.allI18nObject[locale][key];
|
85
|
+
}
|
56
86
|
});
|
57
87
|
return data;
|
58
88
|
}
|
59
89
|
|
60
90
|
getTemplateString(i18nKeys, locale) {
|
61
|
-
|
62
|
-
return `${this.jsonpFunc}(${(0, _utils.jsonToString)(i18nObject)});`;
|
91
|
+
const i18nObject = this.getI18nObjectByLocale(i18nKeys, locale);
|
92
|
+
return `${this.jsonpFunc}(${(0, _utils.jsonToString)(i18nObject)});`;
|
63
93
|
}
|
64
94
|
|
65
95
|
renderI18nLocaleChunk(chunk, locale, i18nKeys) {
|
66
|
-
// renderI18nLocaleChunk(chunk, locale, i18nKeys, compilation) {
|
67
96
|
const filenameTemplate = this.filenameTemplate.replace(/\[locale\]/g, locale);
|
68
97
|
const pathOptions = {
|
69
98
|
chunk,
|
@@ -76,6 +105,53 @@ class I18nFilesEmitter {
|
|
76
105
|
identifier: `${pluginName}.${chunk.id}.${locale}`,
|
77
106
|
hash: chunk.contentHash[i18ntype(locale)]
|
78
107
|
};
|
108
|
+
} // Capture final module IDs from compilation
|
109
|
+
|
110
|
+
|
111
|
+
captureModuleIds(compilation) {
|
112
|
+
console.log('Capturing final module IDs from compilation...');
|
113
|
+
this.moduleIdMap.clear();
|
114
|
+
this.resourceToModule.clear();
|
115
|
+
this.moduleToChunks.clear(); // Process all modules to build our mapping
|
116
|
+
|
117
|
+
compilation.modules.forEach(module => {
|
118
|
+
// Skip modules without resources
|
119
|
+
if (!module.resource) return;
|
120
|
+
const originalId = module.resource;
|
121
|
+
const finalId = module.id; // Map resource path to final module ID
|
122
|
+
|
123
|
+
this.moduleIdMap.set(originalId, finalId); // Map resource path to module object
|
124
|
+
|
125
|
+
this.resourceToModule.set(originalId, module); // Build chunk membership for each module
|
126
|
+
|
127
|
+
const chunkIds = Array.from(module.chunksIterable || []).map(chunk => chunk.id).filter(Boolean);
|
128
|
+
|
129
|
+
if (chunkIds.length > 0) {
|
130
|
+
this.moduleToChunks.set(originalId, chunkIds);
|
131
|
+
}
|
132
|
+
});
|
133
|
+
console.log(`Captured ${this.moduleIdMap.size} module ID mappings`);
|
134
|
+
} // Modified to use stable resource identifiers
|
135
|
+
|
136
|
+
|
137
|
+
gatherModuleDetails(chunk, i18nKeys) {
|
138
|
+
if (!i18nKeys.length) return; // Get stable identifiers for each module in the chunk
|
139
|
+
|
140
|
+
const stableModuleIds = Array.from(chunk.modulesIterable).map(module => module.resource).filter(Boolean); // If no stable IDs found, fallback to chunk ID
|
141
|
+
|
142
|
+
const moduleKey = stableModuleIds.length ? stableModuleIds[0] : `chunk_${chunk.id}`;
|
143
|
+
|
144
|
+
if (!this.detailedManifest[moduleKey]) {
|
145
|
+
this.detailedManifest[moduleKey] = {
|
146
|
+
chunkId: chunk.id,
|
147
|
+
chunkName: chunk.name || `chunk_${chunk.id}`,
|
148
|
+
keysUsed: new Set()
|
149
|
+
};
|
150
|
+
}
|
151
|
+
|
152
|
+
i18nKeys.forEach(key => {
|
153
|
+
this.detailedManifest[moduleKey].keysUsed.add(key);
|
154
|
+
});
|
79
155
|
}
|
80
156
|
|
81
157
|
emitI18nFilesForChunk(chunk, compilation) {
|
@@ -87,14 +163,20 @@ class I18nFilesEmitter {
|
|
87
163
|
};
|
88
164
|
|
89
165
|
if (!i18nKeys.length) {
|
90
|
-
// why it is not checked as 0
|
91
166
|
return manifestForChunk;
|
92
167
|
}
|
93
168
|
|
94
|
-
|
169
|
+
this.gatherModuleDetails(chunk, i18nKeys);
|
170
|
+
manifestForChunk.hasI18n = true; // Check if this is an entry point chunk
|
171
|
+
|
172
|
+
const isEntryPoint = this.isPartOfEntryPoint(chunk, compilation); // If it's an entry point, add its keys to our tracking set
|
173
|
+
|
174
|
+
if (isEntryPoint) {
|
175
|
+
i18nKeys.forEach(key => this.entryPointKeys.add(key));
|
176
|
+
}
|
95
177
|
|
96
178
|
this.locales.forEach(locale => {
|
97
|
-
const result = this.renderI18nLocaleChunk(chunk, locale, i18nKeys
|
179
|
+
const result = this.renderI18nLocaleChunk(chunk, locale, i18nKeys);
|
98
180
|
const {
|
99
181
|
filenameTemplate,
|
100
182
|
pathOptions,
|
@@ -110,73 +192,186 @@ class I18nFilesEmitter {
|
|
110
192
|
}
|
111
193
|
|
112
194
|
manifestForChunk.hasChanges = true;
|
113
|
-
this.prevHashes[identifier] = hash;
|
114
|
-
|
195
|
+
this.prevHashes[identifier] = hash; // Get the rendered content
|
196
|
+
|
197
|
+
const renderedContent = render().source(); // Emit the asset
|
198
|
+
|
199
|
+
this.emitAsset(compilation, filePath, new _webpackSources.RawSource(renderedContent), {
|
115
200
|
locale,
|
116
201
|
chunkId: chunk.id,
|
117
202
|
chunkName: chunk.name
|
118
|
-
}); //
|
203
|
+
}); // Store chunk content for later reference
|
204
|
+
|
205
|
+
if (!this.combinedChunks[locale]) {
|
206
|
+
this.combinedChunks[locale] = [];
|
207
|
+
}
|
208
|
+
|
209
|
+
this.combinedChunks[locale].push({
|
210
|
+
path: filePath,
|
211
|
+
content: renderedContent,
|
212
|
+
data: this.getI18nObjectByLocale(i18nKeys, locale),
|
213
|
+
isEntryPoint: isEntryPoint
|
214
|
+
});
|
119
215
|
});
|
120
216
|
return manifestForChunk;
|
217
|
+
} // Check if a chunk is part of an entry point we're interested in
|
218
|
+
|
219
|
+
|
220
|
+
isPartOfEntryPoint(chunk, compilation) {
|
221
|
+
let isEntryChunk = false;
|
222
|
+
this.entryPointNames.forEach(entryName => {
|
223
|
+
const entryPoint = compilation.entrypoints.get(entryName);
|
224
|
+
|
225
|
+
if (entryPoint && entryPoint.chunks.includes(chunk)) {
|
226
|
+
isEntryChunk = true;
|
227
|
+
}
|
228
|
+
});
|
229
|
+
return isEntryChunk;
|
230
|
+
} // Create meta manifest with final module IDs
|
231
|
+
|
232
|
+
|
233
|
+
createMetaManifestWithFinalIds(compilation) {
|
234
|
+
console.log('Creating meta manifest with final module IDs...'); // Initialize meta manifest structure
|
235
|
+
|
236
|
+
const finalMetaManifest = {
|
237
|
+
modules: {},
|
238
|
+
masterKeys: []
|
239
|
+
}; // Process each module with its final ID
|
240
|
+
|
241
|
+
for (const [resourcePath, moduleData] of Object.entries(this.detailedManifest)) {
|
242
|
+
// Get the final module ID if available
|
243
|
+
const finalId = this.moduleIdMap.get(resourcePath) || resourcePath;
|
244
|
+
const chunkName = moduleData.chunkName || `chunk_${finalId}`;
|
245
|
+
const keysArray = Array.isArray(moduleData.keysUsed) ? moduleData.keysUsed : Array.from(moduleData.keysUsed); // Only add modules that have i18n keys
|
246
|
+
|
247
|
+
if (keysArray.length > 0) {
|
248
|
+
finalMetaManifest.modules[chunkName] = {
|
249
|
+
id: moduleData.chunkId,
|
250
|
+
finalId: finalId,
|
251
|
+
resourcePath: resourcePath,
|
252
|
+
keys: keysArray
|
253
|
+
};
|
254
|
+
}
|
255
|
+
} // Store the generated manifest
|
256
|
+
|
257
|
+
|
258
|
+
this.generatedMetaManifest = finalMetaManifest;
|
259
|
+
console.log(`Created meta manifest with ${Object.keys(finalMetaManifest.modules).length} modules`);
|
260
|
+
} // Compare the remote meta manifest with current build
|
261
|
+
|
262
|
+
|
263
|
+
compareWithRemoteManifest(compilation) {
|
264
|
+
// Use the imported applyMetaManifest function with our updated module ID maps
|
265
|
+
(0, _applyMetaManifest.applyMetaManifest)(compilation, this);
|
266
|
+
} // Create and emit the combined master chunk for each locale
|
267
|
+
|
268
|
+
|
269
|
+
emitMasterChunks(compilation) {
|
270
|
+
// Combine all the keys we need in the master chunk
|
271
|
+
const combinedKeys = new Set([...this.extraKeys, ...this.movedKeys, ...(this.generatedMetaManifest.masterKeys || [])]);
|
272
|
+
console.log(`Extra and moved keys to add to master chunk: ${combinedKeys.size}`);
|
273
|
+
console.log(`Entry point keys: ${this.entryPointKeys.size}`); // Add entry point keys to the master keys in meta manifest
|
274
|
+
|
275
|
+
if (this.generatedMetaManifest) {
|
276
|
+
this.generatedMetaManifest.masterKeys = [...this.generatedMetaManifest.masterKeys, ...Array.from(this.entryPointKeys)];
|
277
|
+
} // Create a master object that contains all needed keys
|
278
|
+
|
279
|
+
|
280
|
+
const allMasterKeys = new Set([...combinedKeys, ...this.entryPointKeys]);
|
281
|
+
console.log(`Creating master chunks with ${allMasterKeys.size} total keys`);
|
282
|
+
|
283
|
+
for (const locale of this.locales) {
|
284
|
+
try {
|
285
|
+
// console.log(`\n========== Processing master chunk for locale: ${locale} ==========`);
|
286
|
+
// Create the master i18n object with all required keys
|
287
|
+
const masterI18nObject = this.getI18nObjectByLocale([...allMasterKeys], locale);
|
288
|
+
console.log(`Master i18n object has ${Object.keys(masterI18nObject).length} keys`); // Create the final JSONP content
|
289
|
+
|
290
|
+
const finalContent = `${this.jsonpFunc}(${(0, _utils.jsonToString)(masterI18nObject)});`;
|
291
|
+
const outputPath = `i18n-chunk/${locale}/${this.masterChunkFileName}`; // Emit the combined master chunk
|
292
|
+
|
293
|
+
this.emitAsset(compilation, outputPath, new _webpackSources.RawSource(finalContent), {
|
294
|
+
locale,
|
295
|
+
chunkName: 'master',
|
296
|
+
desc: 'Combined master i18n chunk'
|
297
|
+
}); // Add to manifest
|
298
|
+
|
299
|
+
if (!this.regularManifest.master) {
|
300
|
+
this.regularManifest.master = {};
|
301
|
+
}
|
302
|
+
|
303
|
+
this.regularManifest.master[locale] = outputPath; // console.log(`Emitted master chunk for locale ${locale}: ${outputPath} (${Object.keys(masterI18nObject).length} total keys)`);
|
304
|
+
} catch (error) {
|
305
|
+
console.error(`ERROR processing master chunk for locale ${locale}:`, error.message); // Emit a simplified version with just the master keys
|
306
|
+
|
307
|
+
try {
|
308
|
+
console.log(`Attempting to emit a fallback master chunk for locale ${locale}`); // Just use the moved and extra keys as fallback
|
309
|
+
|
310
|
+
const fallbackI18nObject = this.getI18nObjectByLocale([...combinedKeys], locale);
|
311
|
+
const fallbackContent = `${this.jsonpFunc}(${(0, _utils.jsonToString)(fallbackI18nObject)});`;
|
312
|
+
const outputPath = `i18n-chunk/${locale}/${this.masterChunkFileName}`;
|
313
|
+
this.emitAsset(compilation, outputPath, new _webpackSources.RawSource(fallbackContent), {
|
314
|
+
locale,
|
315
|
+
chunkName: 'master',
|
316
|
+
desc: 'Fallback master i18n chunk (only moved/extra keys)'
|
317
|
+
});
|
318
|
+
|
319
|
+
if (!this.regularManifest.master) {
|
320
|
+
this.regularManifest.master = {};
|
321
|
+
}
|
322
|
+
|
323
|
+
this.regularManifest.master[locale] = outputPath;
|
324
|
+
console.log(`Emitted fallback master chunk for locale ${locale}: ${outputPath}`);
|
325
|
+
} catch (fallbackError) {
|
326
|
+
console.error(`Failed to emit fallback master chunk for locale ${locale}:`, fallbackError.message);
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
121
330
|
}
|
122
331
|
|
123
332
|
emitI18nAssert(compilation) {
|
124
|
-
|
125
|
-
|
333
|
+
console.log('Starting I18n asset emission process...'); // First, capture all final module IDs
|
334
|
+
|
335
|
+
this.captureModuleIds(compilation); // Reset entry point keys for this build
|
336
|
+
|
337
|
+
this.entryPointKeys = new Set(); // 1. Process chunks and collect keys
|
338
|
+
|
126
339
|
compilation.chunks.forEach(chunk => {
|
127
340
|
const manifestForChunk = this.emitI18nFilesForChunk(chunk, compilation);
|
128
341
|
|
129
342
|
if (manifestForChunk.hasI18n) {
|
130
|
-
|
131
|
-
needEmitManifest = needEmitManifest || manifestForChunk.hasChanges;
|
343
|
+
this.regularManifest[chunk.id] = manifestForChunk.assets;
|
132
344
|
}
|
133
|
-
});
|
345
|
+
}); // 2. Create our meta manifest with final module IDs
|
134
346
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
347
|
+
this.createMetaManifestWithFinalIds(compilation); // 3. Compare with remote manifest to find extra/moved keys
|
348
|
+
|
349
|
+
this.compareWithRemoteManifest(compilation); // 4. Create and emit combined master chunks
|
350
|
+
|
351
|
+
this.emitMasterChunks(compilation); // 5. Create the regular manifest
|
352
|
+
|
353
|
+
(0, _createRegularManifest.createRegularManifest)(compilation, this); // 6. Emit the final meta manifest with updated master keys
|
354
|
+
|
355
|
+
const metaManifestSource = new _webpackSources.RawSource(JSON.stringify(this.generatedMetaManifest, null, 2));
|
356
|
+
this.emitAsset(compilation, this.i18nMetaManifestFileName, metaManifestSource, {
|
357
|
+
desc: 'Updated meta manifest with master keys'
|
358
|
+
});
|
359
|
+
console.log('Completed I18n asset emission process');
|
141
360
|
}
|
142
361
|
|
143
362
|
apply(compiler) {
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
compilation.chunkTemplate.hooks.renderManifest.tap(
|
153
|
-
pluginName,
|
154
|
-
(result, { chunk }) => {
|
155
|
-
this.renderChunk(result, compilation, chunk);
|
156
|
-
}
|
157
|
-
);
|
158
|
-
});
|
159
|
-
*/
|
160
|
-
// this below hook was tapped for create asssets(file) for chunk specific i18nChunk Files
|
161
|
-
compiler.hooks.emit.tap(pluginName, compilation => {
|
363
|
+
// Use the afterCompile hook to capture module info after compilation
|
364
|
+
compiler.hooks.afterCompile.tap(pluginName, compilation => {
|
365
|
+
// console.log(`${pluginName}: Capturing compilation information after compile phase`);
|
366
|
+
this.compilation = compilation;
|
367
|
+
}); // Use the emit hook to generate the I18n assets with final module IDs
|
368
|
+
|
369
|
+
compiler.hooks.emit.tapAsync(pluginName, (compilation, callback) => {
|
370
|
+
// console.log(`${pluginName}: Emitting I18n assets with final module IDs`);
|
162
371
|
this.emitI18nAssert(compilation);
|
372
|
+
callback();
|
163
373
|
});
|
164
374
|
}
|
165
|
-
/*
|
166
|
-
renderChunk(result, compilation, chunk) {
|
167
|
-
const i18nKeys = getI18nKeysFormModules(chunk.modulesIterable);
|
168
|
-
// TODO: need to discuss with vimal ji can we chose this place for add i18n locale files ????
|
169
|
-
// IDEA: we chose this place for add i18n locale files ????
|
170
|
-
if (i18nKeys.length > 0) {
|
171
|
-
Object.keys(this.allI18nObject).forEach(locale => {
|
172
|
-
result.push(
|
173
|
-
this.renderI18nLocaleChunk(chunk, locale, i18nKeys, compilation)
|
174
|
-
);
|
175
|
-
});
|
176
|
-
}
|
177
|
-
}
|
178
|
-
*/
|
179
|
-
|
180
375
|
|
181
376
|
}
|
182
377
|
|
@@ -0,0 +1,273 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.applyMetaManifest = applyMetaManifest;
|
7
|
+
|
8
|
+
var _fs = _interopRequireDefault(require("fs"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
12
|
+
function applyMetaManifest(compilation, plugin) {
|
13
|
+
const {
|
14
|
+
moduleIdMap
|
15
|
+
} = plugin;
|
16
|
+
const manifestPath = './metaManifest.json';
|
17
|
+
|
18
|
+
if (!plugin.detailedManifest || Object.keys(plugin.detailedManifest).length === 0) {
|
19
|
+
console.warn('No detailedManifest available, skipping manifest comparison');
|
20
|
+
return {
|
21
|
+
extraKeys: new Set(),
|
22
|
+
movedKeys: new Set(),
|
23
|
+
error: 'No detailedManifest available'
|
24
|
+
};
|
25
|
+
} // Track keys in current build
|
26
|
+
|
27
|
+
|
28
|
+
const currentBuildKeys = new Set();
|
29
|
+
const currentKeyToModule = new Map();
|
30
|
+
const currentModules = new Map();
|
31
|
+
const currentKeySets = new Map();
|
32
|
+
const moduleIdToName = new Map(); // Process current build modules with final IDs
|
33
|
+
|
34
|
+
for (const [resourcePath, chunkData] of Object.entries(plugin.detailedManifest)) {
|
35
|
+
// Get the final module ID if it exists in our mapping
|
36
|
+
const finalModuleId = moduleIdMap.get(resourcePath) || resourcePath;
|
37
|
+
const chunkName = chunkData.chunkName || `chunk_${chunkData.chunkId || "unknown"}`; // Store module name mapping for better logging
|
38
|
+
|
39
|
+
moduleIdToName.set(finalModuleId, chunkName);
|
40
|
+
const keys = Array.isArray(chunkData.keysUsed) ? chunkData.keysUsed : Array.from(chunkData.keysUsed); // Skip empty modules
|
41
|
+
|
42
|
+
if (keys.length === 0) continue; // Sort keys for consistent comparison
|
43
|
+
|
44
|
+
const sortedKeys = [...keys].sort();
|
45
|
+
const keySetString = sortedKeys.join(','); // Store module data using final IDs
|
46
|
+
|
47
|
+
currentModules.set(finalModuleId, {
|
48
|
+
id: finalModuleId,
|
49
|
+
resourcePath: resourcePath,
|
50
|
+
chunkId: chunkData.chunkId,
|
51
|
+
name: chunkName,
|
52
|
+
keys: sortedKeys
|
53
|
+
}); // Store key set for module fingerprinting
|
54
|
+
|
55
|
+
currentKeySets.set(keySetString, finalModuleId); // Store individual key mappings
|
56
|
+
|
57
|
+
keys.forEach(key => {
|
58
|
+
currentBuildKeys.add(key);
|
59
|
+
currentKeyToModule.set(key, finalModuleId);
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
const currentKeyCount = currentBuildKeys.size;
|
64
|
+
const currentModuleCount = currentModules.size;
|
65
|
+
console.log(`Current build: ${currentKeyCount} keys in ${currentModuleCount} modules`);
|
66
|
+
|
67
|
+
try {
|
68
|
+
// Read from specified manifest path
|
69
|
+
if (!_fs.default.existsSync(manifestPath)) {
|
70
|
+
console.warn(`Meta manifest not found at ${manifestPath}`);
|
71
|
+
return {
|
72
|
+
extraKeys: new Set(),
|
73
|
+
movedKeys: new Set(),
|
74
|
+
error: `Meta manifest not found at ${manifestPath}`
|
75
|
+
};
|
76
|
+
}
|
77
|
+
|
78
|
+
const fileContent = _fs.default.readFileSync(manifestPath, 'utf8');
|
79
|
+
|
80
|
+
const remoteMetaManifest = JSON.parse(fileContent); // Handle non-existent or invalid modules
|
81
|
+
|
82
|
+
if (!remoteMetaManifest.modules) {
|
83
|
+
console.warn('Meta manifest does not contain modules section');
|
84
|
+
return {
|
85
|
+
extraKeys: new Set(),
|
86
|
+
movedKeys: new Set(),
|
87
|
+
error: 'Meta manifest does not contain modules section'
|
88
|
+
};
|
89
|
+
} // Track all keys in remote manifest modules
|
90
|
+
|
91
|
+
|
92
|
+
const remoteModuleKeys = new Set();
|
93
|
+
const remoteKeyToModule = new Map();
|
94
|
+
const remoteModules = new Map();
|
95
|
+
const remoteKeySets = new Map();
|
96
|
+
const remoteModuleIdToName = new Map();
|
97
|
+
const moduleEquivalenceMap = new Map(); // Process remote manifest modules
|
98
|
+
|
99
|
+
for (const [moduleId, moduleData] of Object.entries(remoteMetaManifest.modules)) {
|
100
|
+
if (moduleData.keys && Array.isArray(moduleData.keys)) {
|
101
|
+
// Store module name for better logging
|
102
|
+
const moduleName = moduleId;
|
103
|
+
remoteModuleIdToName.set(moduleId, moduleName); // Skip empty modules
|
104
|
+
|
105
|
+
if (moduleData.keys.length === 0) continue; // Sort keys for consistent comparison
|
106
|
+
|
107
|
+
const sortedKeys = [...moduleData.keys].sort();
|
108
|
+
const keySetString = sortedKeys.join(','); // Store module data
|
109
|
+
|
110
|
+
remoteModules.set(moduleId, {
|
111
|
+
id: moduleData.id || moduleId,
|
112
|
+
name: moduleName,
|
113
|
+
keys: sortedKeys,
|
114
|
+
keyCount: moduleData.keys.length
|
115
|
+
}); // Store key set
|
116
|
+
|
117
|
+
remoteKeySets.set(keySetString, moduleId); // Store individual key mappings
|
118
|
+
|
119
|
+
moduleData.keys.forEach(key => {
|
120
|
+
remoteModuleKeys.add(key);
|
121
|
+
remoteKeyToModule.set(key, moduleId);
|
122
|
+
});
|
123
|
+
}
|
124
|
+
} // Get keys from the master chunk in the remote manifest (if it exists)
|
125
|
+
|
126
|
+
|
127
|
+
const remoteMasterKeys = new Set();
|
128
|
+
|
129
|
+
if (remoteMetaManifest.masterKeys && Array.isArray(remoteMetaManifest.masterKeys)) {
|
130
|
+
remoteMetaManifest.masterKeys.forEach(key => {
|
131
|
+
remoteMasterKeys.add(key);
|
132
|
+
});
|
133
|
+
} // Get all unique keys from the remote manifest (modules + master)
|
134
|
+
|
135
|
+
|
136
|
+
const remoteAllKeys = new Set([...remoteModuleKeys, ...remoteMasterKeys]);
|
137
|
+
const remoteKeyCount = remoteAllKeys.size;
|
138
|
+
const remoteModuleCount = remoteModules.size;
|
139
|
+
const remoteMasterKeyCount = remoteMasterKeys.size;
|
140
|
+
console.log(`Remote manifest: ${remoteKeyCount} keys in ${remoteModuleCount} modules, ${remoteMasterKeyCount} master keys`); // Find intersection and differences for keys
|
141
|
+
|
142
|
+
const inBothSets = new Set([...currentBuildKeys].filter(key => remoteAllKeys.has(key)));
|
143
|
+
const missingKeys = new Set([...remoteAllKeys].filter(key => !currentBuildKeys.has(key)));
|
144
|
+
const extraKeys = new Set([...currentBuildKeys].filter(key => !remoteAllKeys.has(key)));
|
145
|
+
console.log(`Key comparison: ${inBothSets.size} shared keys, ${missingKeys.size} missing, ${extraKeys.size} new`); // Enhanced multi-level module equivalence mapping
|
146
|
+
// 1. First pass: Match by module name
|
147
|
+
|
148
|
+
for (const [remoteId, remoteModule] of remoteModules.entries()) {
|
149
|
+
if (remoteModule.name) {
|
150
|
+
// Find a current module with matching name
|
151
|
+
for (const [currentId, currentModule] of currentModules.entries()) {
|
152
|
+
if (currentModule.name && currentModule.name === remoteModule.name) {
|
153
|
+
moduleEquivalenceMap.set(remoteId, currentId);
|
154
|
+
break;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
} // 2. Second pass: Match by resource path
|
159
|
+
|
160
|
+
|
161
|
+
const unmatchedRemote = [...remoteModules.keys()].filter(id => !moduleEquivalenceMap.has(id));
|
162
|
+
|
163
|
+
for (const remoteId of unmatchedRemote) {
|
164
|
+
for (const [resourcePath, currentModuleId] of moduleIdMap.entries()) {
|
165
|
+
if (resourcePath.includes(remoteId)) {
|
166
|
+
moduleEquivalenceMap.set(remoteId, currentModuleId);
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
} // 3. Third pass: Match by key set fingerprint
|
171
|
+
|
172
|
+
|
173
|
+
const stillUnmatchedRemote = [...remoteModules.keys()].filter(id => !moduleEquivalenceMap.has(id));
|
174
|
+
|
175
|
+
for (const remoteId of stillUnmatchedRemote) {
|
176
|
+
const remoteModule = remoteModules.get(remoteId);
|
177
|
+
const keySetString = remoteModule.keys.join(',');
|
178
|
+
|
179
|
+
if (currentKeySets.has(keySetString)) {
|
180
|
+
moduleEquivalenceMap.set(remoteId, currentKeySets.get(keySetString));
|
181
|
+
}
|
182
|
+
} // Find moved keys based on enhanced module equivalence map
|
183
|
+
|
184
|
+
|
185
|
+
const trulyMovedKeys = new Set();
|
186
|
+
const keyMovementDetails = new Map();
|
187
|
+
|
188
|
+
for (const key of inBothSets) {
|
189
|
+
// Skip keys that are in the master chunk
|
190
|
+
if (remoteMasterKeys.has(key)) {
|
191
|
+
continue;
|
192
|
+
}
|
193
|
+
|
194
|
+
const remoteModuleId = remoteKeyToModule.get(key);
|
195
|
+
const currentModuleId = currentKeyToModule.get(key); // Normalize module names for comparison
|
196
|
+
|
197
|
+
const remoteModuleName = remoteModuleIdToName.get(remoteModuleId) || remoteModuleId;
|
198
|
+
const currentModuleName = moduleIdToName.get(currentModuleId) || currentModuleId; // Only consider a key moved if it's actually in a different module
|
199
|
+
|
200
|
+
const moduleNameComparison = remoteModuleName !== currentModuleName;
|
201
|
+
|
202
|
+
if (moduleNameComparison) {
|
203
|
+
trulyMovedKeys.add(key);
|
204
|
+
keyMovementDetails.set(key, {
|
205
|
+
from: remoteModuleId,
|
206
|
+
fromName: remoteModuleName,
|
207
|
+
to: currentModuleId,
|
208
|
+
toName: currentModuleName,
|
209
|
+
type: 'module_change'
|
210
|
+
});
|
211
|
+
}
|
212
|
+
} // Get keys from unmatched modules that exist in the current build
|
213
|
+
|
214
|
+
|
215
|
+
const unmatchedRemoteModules = [...remoteModules.keys()].filter(id => !moduleEquivalenceMap.has(id));
|
216
|
+
unmatchedRemoteModules.forEach(moduleId => {
|
217
|
+
const module = remoteModules.get(moduleId);
|
218
|
+
const moduleName = remoteModuleIdToName.get(moduleId) || moduleId;
|
219
|
+
module.keys.forEach(key => {
|
220
|
+
// Only add the key if it exists in the current build
|
221
|
+
if (currentBuildKeys.has(key)) {
|
222
|
+
const currentModuleId = currentKeyToModule.get(key);
|
223
|
+
const currentModuleName = moduleIdToName.get(currentModuleId) || currentModuleId; // Only add if actually in a different module
|
224
|
+
|
225
|
+
if (moduleName !== currentModuleName) {
|
226
|
+
trulyMovedKeys.add(key);
|
227
|
+
keyMovementDetails.set(key, {
|
228
|
+
from: moduleId,
|
229
|
+
fromName: moduleName,
|
230
|
+
to: currentModuleId,
|
231
|
+
toName: currentModuleName,
|
232
|
+
type: 'unmatched_module'
|
233
|
+
});
|
234
|
+
}
|
235
|
+
}
|
236
|
+
});
|
237
|
+
});
|
238
|
+
const movedKeyCount = trulyMovedKeys.size;
|
239
|
+
console.log(`Found ${extraKeys.size} new keys and ${movedKeyCount} moved keys`); // Add extra and moved keys to the plugin's tracking for master chunk inclusion
|
240
|
+
|
241
|
+
plugin.extraKeys = extraKeys;
|
242
|
+
plugin.movedKeys = trulyMovedKeys; // Store key counts for reference
|
243
|
+
|
244
|
+
plugin.keyStats = {
|
245
|
+
current: currentKeyCount,
|
246
|
+
remote: remoteKeyCount,
|
247
|
+
extra: extraKeys.size,
|
248
|
+
moved: movedKeyCount
|
249
|
+
}; // Update master keys in the generated meta manifest
|
250
|
+
|
251
|
+
if (plugin.generatedMetaManifest) {
|
252
|
+
// Only include extra (new) and moved keys in the master keys
|
253
|
+
const masterKeys = [...Array.from(extraKeys), ...Array.from(trulyMovedKeys)];
|
254
|
+
plugin.generatedMetaManifest.masterKeys = masterKeys;
|
255
|
+
}
|
256
|
+
|
257
|
+
return {
|
258
|
+
extraKeys,
|
259
|
+
movedKeys: trulyMovedKeys,
|
260
|
+
keyStats: plugin.keyStats
|
261
|
+
};
|
262
|
+
} catch (error) {
|
263
|
+
console.error(`Error during manifest comparison: ${error.message}`); // Return empty sets for keys if there was an error
|
264
|
+
|
265
|
+
plugin.extraKeys = new Set();
|
266
|
+
plugin.movedKeys = new Set();
|
267
|
+
return {
|
268
|
+
extraKeys: new Set(),
|
269
|
+
movedKeys: new Set(),
|
270
|
+
error: error.message
|
271
|
+
};
|
272
|
+
}
|
273
|
+
}
|