@zohodesk/client_build_tool 0.0.11-exp.15.4 → 0.0.11-exp.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +102 -0
  2. package/README_backup.md +100 -0
  3. package/docs/DYNAMIC_TEMPLATE_EXAMPLE.md +129 -0
  4. package/docs/I18N_SINGLE_FILE_MODE.md +126 -0
  5. package/example-single-file-config.js +59 -0
  6. package/lib/allCommandsConfigs.js +2 -7
  7. package/lib/commands/build/commandExecutor.js +1 -5
  8. package/lib/commands/build/config.js +2 -3
  9. package/lib/commands/build/optionsProcessor.js +2 -5
  10. package/lib/commands/build/preProcessor.js +0 -2
  11. package/lib/commands/buildEs/commandExecutor.js +0 -5
  12. package/lib/commands/buildEs/config.js +2 -3
  13. package/lib/commands/buildEs/preProcessor.js +0 -2
  14. package/lib/commands/buildLib/commandExecutor.js +0 -5
  15. package/lib/commands/buildLib/config.js +2 -3
  16. package/lib/commands/buildLib/preProcessor.js +0 -2
  17. package/lib/commands/mockserver/commandExecutor.js +2 -9
  18. package/lib/commands/mockserver/config.js +2 -3
  19. package/lib/commands/pre_process/commandExecutor.js +0 -2
  20. package/lib/commands/pre_process/config.js +2 -3
  21. package/lib/commands/start/commandExecutor.js +0 -2
  22. package/lib/commands/start/config.js +2 -3
  23. package/lib/commands/start/optionsProcessor.js +2 -4
  24. package/lib/commands/start/preProcessor.js +0 -2
  25. package/lib/commands/template/commandExecutor.js +0 -7
  26. package/lib/commands/template/config.js +2 -3
  27. package/lib/commands/version/commandExecutor.js +0 -3
  28. package/lib/commands/version/config.js +2 -3
  29. package/lib/commandsRouter.js +5 -21
  30. package/lib/index.js +0 -2
  31. package/lib/logger.js +0 -5
  32. package/lib/schemas/applyValuesToSchema/index.js +0 -8
  33. package/lib/schemas/applyValuesToSchema/isObject.js +0 -1
  34. package/lib/schemas/applyValuesToSchema/isValid.js +0 -2
  35. package/lib/schemas/cliArgsToObject.js +2 -6
  36. package/lib/schemas/defaultConfigValues.js +21 -12
  37. package/lib/schemas/defaultConfigValuesOnly.js +4 -7
  38. package/lib/schemas/deprecatedOptionsHandler.js +7 -16
  39. package/lib/schemas/getNpmVersion.js +0 -5
  40. package/lib/schemas/giveDefaultValue.js +0 -3
  41. package/lib/schemas/npmConfigToObject.js +2 -5
  42. package/lib/schemas/readOptions.js +10 -30
  43. package/lib/schemas/readOptionsForConfigFile.js +2 -12
  44. package/lib/shared/babel/addDefaultPlugins.js +0 -2
  45. package/lib/shared/babel/babelWebConfig.js +1 -10
  46. package/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -4
  47. package/lib/shared/babel/getBabelPlugin.js +2 -7
  48. package/lib/shared/babel/runBabelForJSFile.js +1 -4
  49. package/lib/shared/babel/runBabelForTsFile.js +1 -5
  50. package/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -5
  51. package/lib/shared/bundler/webpack/common/libAlias.js +3 -3
  52. package/lib/shared/bundler/webpack/common/modeUtils.js +0 -5
  53. package/lib/shared/bundler/webpack/common/nameTemplates.js +11 -18
  54. package/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +2 -3
  55. package/lib/shared/bundler/webpack/configCustomLoaders.js +0 -1
  56. package/lib/shared/bundler/webpack/cssLoaders.js +0 -2
  57. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +1 -20
  58. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +20 -25
  59. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +4 -9
  60. package/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +3 -23
  61. package/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +8 -19
  62. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nGroupRuntimeModule.js +2 -6
  63. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +81 -0
  64. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +135 -60
  65. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +20 -26
  66. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +5 -26
  67. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +13 -16
  68. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +19 -53
  69. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +2 -17
  70. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -13
  71. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +11 -21
  72. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -4
  73. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +4 -14
  74. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +3 -13
  75. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +3 -12
  76. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +2 -7
  77. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -2
  78. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +2 -3
  79. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +2 -4
  80. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +8 -13
  81. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -14
  82. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -1
  83. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +1 -3
  84. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -4
  85. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +5 -25
  86. package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +3 -10
  87. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +1 -6
  88. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +1 -6
  89. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -6
  90. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -1
  91. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -7
  92. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -1
  93. package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +13 -17
  94. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +6 -15
  95. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +4 -13
  96. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +4 -6
  97. package/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -10
  98. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -3
  99. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +4 -20
  100. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +10 -12
  101. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +2 -3
  102. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +7 -20
  103. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -1
  104. package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +7 -10
  105. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +1 -6
  106. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -16
  107. package/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +4 -11
  108. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +3 -10
  109. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +27 -62
  110. package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +3 -15
  111. package/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -1
  112. package/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +2 -12
  113. package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +2 -7
  114. package/lib/shared/bundler/webpack/defaultVendorPatternList.js +2 -6
  115. package/lib/shared/bundler/webpack/devtoolConfig.js +0 -1
  116. package/lib/shared/bundler/webpack/entryConfig.js +0 -4
  117. package/lib/shared/bundler/webpack/externals.js +0 -1
  118. package/lib/shared/bundler/webpack/getCSSLoaders.js +1 -6
  119. package/lib/shared/bundler/webpack/getFilenameFromModule.js +1 -5
  120. package/lib/shared/bundler/webpack/jsLoaders.js +6 -10
  121. package/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -2
  122. package/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +2 -3
  123. package/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +3 -12
  124. package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -1
  125. package/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +2 -10
  126. package/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -2
  127. package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -12
  128. package/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +1 -15
  129. package/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +1 -4
  130. package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +8 -16
  131. package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +22 -29
  132. package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +2 -2
  133. package/lib/shared/bundler/webpack/loaders/workerLoader.js +8 -19
  134. package/lib/shared/bundler/webpack/optimizationConfig.js +5 -13
  135. package/lib/shared/bundler/webpack/outputConfig.js +1 -9
  136. package/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +5 -9
  137. package/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -5
  138. package/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +4 -9
  139. package/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +3 -8
  140. package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +1 -16
  141. package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -4
  142. package/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -16
  143. package/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -5
  144. package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -5
  145. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +2 -8
  146. package/lib/shared/bundler/webpack/pluginConfigs/configI18nIndexingPlugin.js +5 -9
  147. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericHtmlInjector.js +19 -25
  148. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +92 -0
  149. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +3 -9
  150. package/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -2
  151. package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -7
  152. package/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +3 -7
  153. package/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +1 -5
  154. package/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +1 -4
  155. package/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -4
  156. package/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +3 -8
  157. package/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +1 -6
  158. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +3 -8
  159. package/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -4
  160. package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +1 -8
  161. package/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +1 -6
  162. package/lib/shared/bundler/webpack/plugins.js +3 -30
  163. package/lib/shared/bundler/webpack/resolvers.js +3 -17
  164. package/lib/shared/bundler/webpack/splitChunksConfig.js +2 -15
  165. package/lib/shared/bundler/webpack/statsConfig.js +2 -5
  166. package/lib/shared/bundler/webpack/tsLoaders.js +2 -4
  167. package/lib/shared/bundler/webpack/utils/index.js +1 -12
  168. package/lib/shared/bundler/webpack/utils/object-manipulation.js +2 -16
  169. package/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -7
  170. package/lib/shared/bundler/webpack/webpackBuild.js +1 -8
  171. package/lib/shared/bundler/webpack/webpackConfig.js +0 -17
  172. package/lib/shared/commands-utils/doBasicRequirementCheck.js +0 -3
  173. package/lib/shared/commands-utils/getCliPath.js +5 -9
  174. package/lib/shared/commands-utils/index.js +0 -3
  175. package/lib/shared/commands-utils/log.js +0 -2
  176. package/lib/shared/commands-utils/readArgsFormCommandLine.js +0 -1
  177. package/lib/shared/commands-utils/readOptionFormCommandLine.js +0 -1
  178. package/lib/shared/commands-utils/spawnSyncIO.js +5 -13
  179. package/lib/shared/constants.js +9 -29
  180. package/lib/shared/fileUtils/copyFile.js +1 -8
  181. package/lib/shared/fileUtils/directoryIterator.js +0 -4
  182. package/lib/shared/fileUtils/watchRun.js +3 -24
  183. package/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +1 -6
  184. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +2 -3
  185. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +6 -13
  186. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +6 -26
  187. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +6 -9
  188. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -3
  189. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +2 -7
  190. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -2
  191. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +4 -9
  192. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -10
  193. package/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +16 -29
  194. package/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -17
  195. package/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +4 -9
  196. package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +27 -63
  197. package/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +5 -13
  198. package/lib/shared/postcss/getAllowedPostCssPlugins.js +0 -3
  199. package/lib/shared/postcss/getSpecificPostCssPlugin.js +7 -17
  200. package/lib/shared/postcss/runPostCssForCssFile.js +1 -9
  201. package/lib/shared/pre_process/runPreProcess.js +0 -11
  202. package/lib/shared/server/configWebpackDevMiddleware.js +1 -8
  203. package/lib/shared/server/corsHandling.js +2 -6
  204. package/lib/shared/server/getIp.js +1 -7
  205. package/lib/shared/server/getServerURL.js +0 -6
  206. package/lib/shared/server/httpsOptions.js +0 -11
  207. package/lib/shared/server/initExpressApp.js +1 -4
  208. package/lib/shared/server/initialHTMLHandling.js +7 -16
  209. package/lib/shared/server/mockApiHandler.js +8 -16
  210. package/lib/shared/server/mockServer.js +0 -7
  211. package/lib/shared/server/serveContextFiles.js +1 -5
  212. package/lib/shared/server/serverBywebpackDevMiddleware.js +4 -9
  213. package/lib/shared/server/startHttpServer.js +0 -3
  214. package/lib/shared/server/startHttpsServer.js +1 -9
  215. package/lib/shared/server/unwanted/addHttp2Server.js +2 -7
  216. package/lib/shared/server/unwanted/configWebpackDevMiddleware.js +1 -8
  217. package/lib/shared/server/unwanted/mockApiSupport.js +0 -2
  218. package/lib/shared/server/unwanted/websocketMockSetup.js +1 -7
  219. package/lib/shared/server/urlConcat.js +3 -8
  220. package/lib/shared/utils/requireLocalOrGlobal.js +10 -25
  221. package/lib/shared/utils/versionPrint.js +1 -6
  222. package/npm-shrinkwrap.json +2 -2
  223. package/package.json +1 -1
  224. package/packages/client_build_tool/test-i18n-config.js +22 -0
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.websocketMockSetup = websocketMockSetup;
7
-
8
7
  var _ws = _interopRequireDefault(require("ws"));
9
-
10
8
  var _logger = require("../../../logger");
11
-
12
9
  var _constants = require("../../constants");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
11
  function websocketMockSetup(app, httpsServer) {
17
12
  app.use('/wms/*', (req, res) => {
18
13
  res.sendFile((0, _constants.getTemplatePath)('wms', 'index.html'));
@@ -36,7 +31,6 @@ function websocketMockSetup(app, httpsServer) {
36
31
  const {
37
32
  body
38
33
  } = req;
39
-
40
34
  try {
41
35
  ws.send(JSON.stringify(body));
42
36
  } catch (e) {
@@ -4,30 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.urlConcat = urlConcat;
7
-
8
7
  /* eslint-disable no-use-before-define */
9
-
10
8
  /**
11
9
  *
12
10
  * @param {String} url
13
11
  * @param {String} path
14
12
  */
13
+
15
14
  function urlConcat(url, path) {
16
15
  const slashRemovedUrl = removeLastSlash(url);
17
16
  const slashRemovedPath = removeFrontSlash(path);
18
-
19
17
  if (slashRemovedUrl === '') {
20
18
  return `${path}/`;
21
- } //return `${slashRemovedUrl}/${slashRemovedPath}`;
22
-
23
-
19
+ }
20
+ //return `${slashRemovedUrl}/${slashRemovedPath}`;
24
21
  return `${[slashRemovedUrl, slashRemovedPath].filter(a => a).join('/')}/`;
25
22
  }
26
-
27
23
  function removeLastSlash(url) {
28
24
  return url.replace(/\/+$/, '');
29
25
  }
30
-
31
26
  function removeFrontSlash(url) {
32
27
  return url.replace(/^\/+/, '');
33
28
  }
@@ -9,21 +9,12 @@ exports.requireGlobal = requireGlobal;
9
9
  exports.requireInFolder = requireInFolder;
10
10
  exports.requireLocal = requireLocal;
11
11
  exports.requireLocalOrGlobal = requireLocalOrGlobal;
12
-
13
12
  var _child_process = require("child_process");
14
-
15
13
  var _path = _interopRequireDefault(require("path"));
16
-
17
14
  var _constants = require("../constants");
18
-
19
15
  var _logger = require("../../logger");
20
-
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
-
23
- const globalNodeModules = _path.default.join(`${(0, _child_process.execSync)('npm config get prefix')}`.trim(), 'lib');
24
-
25
- exports.globalNodeModules = globalNodeModules;
26
-
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ const globalNodeModules = exports.globalNodeModules = _path.default.join(`${(0, _child_process.execSync)('npm config get prefix')}`.trim(), 'lib');
27
18
  function requireLocalOrGlobal(moduleName, opts = {}) {
28
19
  let {
29
20
  global = true
@@ -31,24 +22,22 @@ function requireLocalOrGlobal(moduleName, opts = {}) {
31
22
  const {
32
23
  local = true
33
24
  } = opts;
34
- const isRelativePath = moduleName[0] === '.'; // NOTE: if starts with . then it only mean local
35
-
25
+ const isRelativePath = moduleName[0] === '.';
26
+ // NOTE: if starts with . then it only mean local
36
27
  if (isRelativePath) {
37
28
  global = false;
38
29
  }
30
+ const paths = [local && _constants.appPath, global && globalNodeModules].filter(Boolean);
39
31
 
40
- const paths = [local && _constants.appPath, global && globalNodeModules].filter(Boolean); // eslint-disable-next-line no-use-before-define
41
-
32
+ // eslint-disable-next-line no-use-before-define
42
33
  return requireInFolder(moduleName, paths);
43
34
  }
44
-
45
35
  function requireInFolder(moduleName, paths) {
46
36
  try {
47
37
  const moduleResolvePath = require.resolve(moduleName, {
48
38
  paths
49
- }); // eslint-disable-next-line import/no-dynamic-require, global-require
50
-
51
-
39
+ });
40
+ // eslint-disable-next-line import/no-dynamic-require, global-require
52
41
  return require(moduleResolvePath);
53
42
  } catch (error) {
54
43
  // NOTE: since we return null we can check out side
@@ -56,21 +45,17 @@ function requireInFolder(moduleName, paths) {
56
45
  return null;
57
46
  }
58
47
  }
59
-
60
48
  function requireLocal(moduleName) {
61
49
  return requireInFolder(moduleName, [_constants.appPath]);
62
50
  }
63
-
64
51
  function requireGlobal(moduleName) {
65
- const isRelativePath = moduleName[0] === '.'; // NOTE: if starts with . then it only mean local
66
-
52
+ const isRelativePath = moduleName[0] === '.';
53
+ // NOTE: if starts with . then it only mean local
67
54
  if (isRelativePath) {
68
55
  return null;
69
56
  }
70
-
71
57
  return requireInFolder(moduleName, [globalNodeModules]);
72
58
  }
73
-
74
59
  function requireAllPossible(moduleName) {
75
60
  const localP = requireLocal(moduleName);
76
61
  const globalP = localP ? null : requireGlobal(moduleName);
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.versionPrint = versionPrint;
7
-
8
7
  var _child_process = require("child_process");
9
-
10
8
  var _logger = require("../../logger");
11
-
12
9
  var _package = _interopRequireDefault(require("../../../package.json"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
11
  function versionPrint(logger = _logger.messageLogger) {
17
12
  logger(`Client Build Tool Version : ${_package.default.version}`);
18
13
  logger(`Node Js Version : ${process.version}`);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.11",
3
+ "version": "0.0.11-exp.15.4",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zohodesk/client_build_tool",
9
- "version": "0.0.11",
9
+ "version": "0.0.11-exp.15.4",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "@babel/cli": "7.17.10",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.11-exp.15.4",
3
+ "version": "0.0.11-exp.16.0",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -0,0 +1,22 @@
1
+ // Test configuration for i18n indexing features
2
+ module.exports = {
3
+ i18nIndexing: {
4
+ enable: true,
5
+ outputFolder: 'i18n', // Changed from default 'i18n-chunk'
6
+ jsResourcePath: './test-data/JSResources.properties',
7
+ propertiesFolderPath: './test-data/properties',
8
+ numericMapPath: './test-data/i18n-numeric-map.json',
9
+ numericFilenameTemplate: '[locale]/numeric.js',
10
+ dynamicFilenameTemplate: '[locale]/dynamic.js',
11
+ jsonpFunc: 'window.loadI18n',
12
+ htmlTemplateLabel: '{{locale}}',
13
+ localeVarName: 'window.userLocale',
14
+ singleFile: false,
15
+ includeContentHash: true, // Enable content hashing
16
+ generateManifest: true, // Enable manifest generation
17
+ loaderOptions: {
18
+ includePaths: ['src'],
19
+ excludePaths: ['node_modules', 'tests', 'lib']
20
+ }
21
+ }
22
+ };