@zohodesk/client_build_tool 0.0.22-exp.4 → 0.0.22-exp.5

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 (240) hide show
  1. package/README.md +0 -723
  2. package/README_backup.md +0 -723
  3. package/app/README.MD +30 -0
  4. package/app/es/test.js +47 -0
  5. package/app/package.json +12 -0
  6. package/lib/schemas/defaultConfigValues.js +3 -6
  7. package/lib/shared/babel/babelWebConfig.js +2 -1
  8. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/utils.js +15 -0
  9. package/lib/shared/bundler/webpack/entryConfig.js +2 -3
  10. package/lib/shared/bundler/webpack/moduleConcatenationConfig.js +18 -0
  11. package/lib/shared/bundler/webpack/optimizationConfig.js +8 -10
  12. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +1 -1
  13. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +1 -1
  14. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +1 -1
  15. package/package.json +1 -1
  16. package/es/allCommandsConfigs.js +0 -15
  17. package/es/commands/build/commandExecutor.js +0 -6
  18. package/es/commands/build/config.js +0 -5
  19. package/es/commands/build/optionsProcessor.js +0 -25
  20. package/es/commands/build/preProcessor.js +0 -4
  21. package/es/commands/buildEs/commandExecutor.js +0 -29
  22. package/es/commands/buildEs/config.js +0 -5
  23. package/es/commands/buildEs/preProcessor.js +0 -9
  24. package/es/commands/buildLib/commandExecutor.js +0 -24
  25. package/es/commands/buildLib/config.js +0 -5
  26. package/es/commands/buildLib/preProcessor.js +0 -9
  27. package/es/commands/mockserver/commandExecutor.js +0 -32
  28. package/es/commands/mockserver/config.js +0 -5
  29. package/es/commands/pre_process/commandExecutor.js +0 -10
  30. package/es/commands/pre_process/config.js +0 -5
  31. package/es/commands/start/commandExecutor.js +0 -4
  32. package/es/commands/start/config.js +0 -5
  33. package/es/commands/start/optionsProcessor.js +0 -21
  34. package/es/commands/start/preProcessor.js +0 -4
  35. package/es/commands/template/commandExecutor.js +0 -17
  36. package/es/commands/template/config.js +0 -5
  37. package/es/commands/version/commandExecutor.js +0 -5
  38. package/es/commands/version/config.js +0 -5
  39. package/es/commandsRouter.js +0 -58
  40. package/es/index.js +0 -4
  41. package/es/logger.js +0 -23
  42. package/es/schemas/applyValuesToSchema/index.js +0 -25
  43. package/es/schemas/applyValuesToSchema/isObject.js +0 -3
  44. package/es/schemas/applyValuesToSchema/isValid.js +0 -7
  45. package/es/schemas/cliArgsToObject.js +0 -32
  46. package/es/schemas/defaultConfigValues.js +0 -394
  47. package/es/schemas/defaultConfigValuesOnly.js +0 -196
  48. package/es/schemas/deprecatedOptionsHandler.js +0 -60
  49. package/es/schemas/getNpmVersion.js +0 -13
  50. package/es/schemas/giveDefaultValue.js +0 -11
  51. package/es/schemas/npmConfigToObject.js +0 -27
  52. package/es/schemas/readOptions.js +0 -67
  53. package/es/schemas/readOptionsForConfigFile.js +0 -28
  54. package/es/shared/babel/addDefaultPlugins.js +0 -8
  55. package/es/shared/babel/babelWebConfig.js +0 -43
  56. package/es/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -21
  57. package/es/shared/babel/getBabelPlugin.js +0 -36
  58. package/es/shared/babel/runBabelForJSFile.js +0 -15
  59. package/es/shared/babel/runBabelForTsFile.js +0 -34
  60. package/es/shared/bundler/webpack/common/decidePublicPath.js +0 -45
  61. package/es/shared/bundler/webpack/common/libAlias.js +0 -24
  62. package/es/shared/bundler/webpack/common/modeUtils.js +0 -24
  63. package/es/shared/bundler/webpack/common/nameTemplates.js +0 -95
  64. package/es/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -12
  65. package/es/shared/bundler/webpack/configCustomLoaders.js +0 -3
  66. package/es/shared/bundler/webpack/cssLoaders.js +0 -8
  67. package/es/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +0 -76
  68. package/es/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +0 -102
  69. package/es/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +0 -36
  70. package/es/shared/bundler/webpack/custom_plugins/ChunkHierarchyPlugin.js +0 -65
  71. package/es/shared/bundler/webpack/custom_plugins/CssCustomOrderPlugin.js +0 -37
  72. package/es/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +0 -97
  73. package/es/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +0 -98
  74. package/es/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +0 -211
  75. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  76. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +0 -160
  77. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -66
  78. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +0 -201
  79. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  80. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +0 -59
  81. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -82
  82. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  83. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -13
  84. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -15
  85. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -72
  86. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -23
  87. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +0 -40
  88. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -59
  89. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -15
  90. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -22
  91. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -35
  92. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -70
  93. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -56
  94. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -6
  95. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -10
  96. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -2
  97. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -121
  98. package/es/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +0 -85
  99. package/es/shared/bundler/webpack/custom_plugins/InjectChunkGraphPlugin.js +0 -47
  100. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +0 -20
  101. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +0 -11
  102. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -26
  103. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -11
  104. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -34
  105. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -11
  106. package/es/shared/bundler/webpack/custom_plugins/MurphyInjectorPlugin/index.js +0 -79
  107. package/es/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -0
  108. package/es/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +0 -185
  109. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -47
  110. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -70
  111. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  112. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -14
  113. package/es/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -63
  114. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -9
  115. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +0 -63
  116. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +0 -43
  117. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +0 -7
  118. package/es/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -104
  119. package/es/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -6
  120. package/es/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +0 -74
  121. package/es/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +0 -10
  122. package/es/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +0 -36
  123. package/es/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +0 -35
  124. package/es/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +0 -52
  125. package/es/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +0 -341
  126. package/es/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +0 -67
  127. package/es/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -7
  128. package/es/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +0 -43
  129. package/es/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +0 -79
  130. package/es/shared/bundler/webpack/defaultVendorPatternList.js +0 -3
  131. package/es/shared/bundler/webpack/devtoolConfig.js +0 -6
  132. package/es/shared/bundler/webpack/entryConfig.js +0 -25
  133. package/es/shared/bundler/webpack/externals.js +0 -10
  134. package/es/shared/bundler/webpack/getCSSLoaders.js +0 -17
  135. package/es/shared/bundler/webpack/getFilenameFromModule.js +0 -15
  136. package/es/shared/bundler/webpack/jsLoaders.js +0 -16
  137. package/es/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -4
  138. package/es/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -10
  139. package/es/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +0 -45
  140. package/es/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -11
  141. package/es/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +0 -23
  142. package/es/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -13
  143. package/es/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -71
  144. package/es/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -56
  145. package/es/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -11
  146. package/es/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +0 -40
  147. package/es/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +0 -116
  148. package/es/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +0 -5
  149. package/es/shared/bundler/webpack/loaders/workerLoader.js +0 -121
  150. package/es/shared/bundler/webpack/optimizationConfig.js +0 -42
  151. package/es/shared/bundler/webpack/outputConfig.js +0 -35
  152. package/es/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +0 -30
  153. package/es/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -27
  154. package/es/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +0 -17
  155. package/es/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -16
  156. package/es/shared/bundler/webpack/pluginConfigs/configChunkHierarchyPlugin.js +0 -10
  157. package/es/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +0 -50
  158. package/es/shared/bundler/webpack/pluginConfigs/configCssCustomOrderPlugin.js +0 -8
  159. package/es/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -12
  160. package/es/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -67
  161. package/es/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -37
  162. package/es/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -43
  163. package/es/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -52
  164. package/es/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +0 -17
  165. package/es/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -29
  166. package/es/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -8
  167. package/es/shared/bundler/webpack/pluginConfigs/configInjectChunkGraphPlugin.js +0 -12
  168. package/es/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -36
  169. package/es/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -13
  170. package/es/shared/bundler/webpack/pluginConfigs/configMurphyInjectorPlugin.js +0 -19
  171. package/es/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -18
  172. package/es/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +0 -11
  173. package/es/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -19
  174. package/es/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +0 -20
  175. package/es/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +0 -18
  176. package/es/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -29
  177. package/es/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -12
  178. package/es/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +0 -20
  179. package/es/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +0 -15
  180. package/es/shared/bundler/webpack/plugins.js +0 -33
  181. package/es/shared/bundler/webpack/resolvers.js +0 -70
  182. package/es/shared/bundler/webpack/splitChunksConfig.js +0 -106
  183. package/es/shared/bundler/webpack/statsConfig.js +0 -23
  184. package/es/shared/bundler/webpack/tsLoaders.js +0 -16
  185. package/es/shared/bundler/webpack/utils/index.js +0 -8
  186. package/es/shared/bundler/webpack/utils/object-manipulation.js +0 -82
  187. package/es/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -29
  188. package/es/shared/bundler/webpack/webpackBuild.js +0 -14
  189. package/es/shared/bundler/webpack/webpackConfig.js +0 -35
  190. package/es/shared/commands-utils/doBasicRequirementCheck.js +0 -10
  191. package/es/shared/commands-utils/getCliPath.js +0 -28
  192. package/es/shared/commands-utils/index.js +0 -3
  193. package/es/shared/commands-utils/log.js +0 -4
  194. package/es/shared/commands-utils/readArgsFormCommandLine.js +0 -4
  195. package/es/shared/commands-utils/readOptionFormCommandLine.js +0 -4
  196. package/es/shared/commands-utils/spawnSyncIO.js +0 -24
  197. package/es/shared/constants.js +0 -22
  198. package/es/shared/fileUtils/copyFile.js +0 -23
  199. package/es/shared/fileUtils/directoryIterator.js +0 -12
  200. package/es/shared/fileUtils/watchRun.js +0 -96
  201. package/es/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +0 -18
  202. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +0 -2
  203. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +0 -58
  204. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +0 -122
  205. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +0 -22
  206. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -11
  207. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +0 -13
  208. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -17
  209. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +0 -32
  210. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -28
  211. package/es/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +0 -125
  212. package/es/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -82
  213. package/es/shared/postcss/custom_postcss_plugins/ValueReplacer.js +0 -50
  214. package/es/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +0 -318
  215. package/es/shared/postcss/filterPluginsAllowedForSpecficFile.js +0 -41
  216. package/es/shared/postcss/getAllowedPostCssPlugins.js +0 -20
  217. package/es/shared/postcss/getSpecificPostCssPlugin.js +0 -38
  218. package/es/shared/postcss/runPostCssForCssFile.js +0 -25
  219. package/es/shared/pre_process/runPreProcess.js +0 -47
  220. package/es/shared/server/configWebpackDevMiddleware.js +0 -26
  221. package/es/shared/server/corsHandling.js +0 -23
  222. package/es/shared/server/getIp.js +0 -18
  223. package/es/shared/server/getServerURL.js +0 -28
  224. package/es/shared/server/httpsOptions.js +0 -36
  225. package/es/shared/server/initExpressApp.js +0 -9
  226. package/es/shared/server/initialHTMLHandling.js +0 -92
  227. package/es/shared/server/mockApiHandler.js +0 -53
  228. package/es/shared/server/mockServer.js +0 -34
  229. package/es/shared/server/serveContextFiles.js +0 -17
  230. package/es/shared/server/serverBywebpackDevMiddleware.js +0 -21
  231. package/es/shared/server/startHttpServer.js +0 -18
  232. package/es/shared/server/startHttpsServer.js +0 -26
  233. package/es/shared/server/unwanted/addHttp2Server.js +0 -32
  234. package/es/shared/server/unwanted/configWebpackDevMiddleware.js +0 -35
  235. package/es/shared/server/unwanted/mockApiSupport.js +0 -11
  236. package/es/shared/server/unwanted/websocketMockSetup.js +0 -36
  237. package/es/shared/server/urlConcat.js +0 -35
  238. package/es/shared/utils/requireLocalOrGlobal.js +0 -57
  239. package/es/shared/utils/utils.js +0 -0
  240. package/es/shared/utils/versionPrint.js +0 -9
@@ -1,25 +0,0 @@
1
- import { isObject } from "./isObject";
2
- import { isValid } from "./isValid";
3
- export function applyValuesToSchema(schemas, customOptions, processEnv) {
4
- const output = {};
5
-
6
- function decideValue(schema, key, customOptions) {
7
- const specificSchema = schema[key];
8
- const correspondingValue = customOptions && customOptions[key];
9
-
10
- if (isObject(specificSchema)) {
11
- if (typeof specificSchema.cli === 'string') {
12
- return processEnv[specificSchema.cli] ?? isValid(correspondingValue, specificSchema.value);
13
- }
14
-
15
- return applyValuesToSchema(specificSchema, correspondingValue, processEnv);
16
- }
17
-
18
- return isValid(correspondingValue, specificSchema);
19
- }
20
-
21
- Object.keys(schemas).forEach(key => {
22
- output[key] = decideValue(schemas, key, customOptions);
23
- });
24
- return output;
25
- }
@@ -1,3 +0,0 @@
1
- export function isObject(obj) {
2
- return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
3
- }
@@ -1,7 +0,0 @@
1
- export function isValid(correspondingValue, specificSchema) {
2
- if (typeof correspondingValue === 'number' && Number.isNaN(correspondingValue)) {
3
- return specificSchema;
4
- }
5
-
6
- return correspondingValue ?? specificSchema;
7
- }
@@ -1,32 +0,0 @@
1
- import { giveDefaultValue } from "./giveDefaultValue";
2
- /**
3
- * experimental argument parsing logic
4
- * @param {Array} cliArgs is when we use cli the options or args
5
- *
6
- * cliArgs:-
7
- * `cbt start --port=2332 --mode=prod` in this command
8
- * ['--port=2332', '--mode=prod'] these are cliArgs
9
- *
10
- * return {"port": 2332, "mode":"prod"}
11
- */
12
-
13
- export function cliArgsToObject(cliArgs) {
14
- const processEnv = {};
15
- cliArgs.forEach(option => {
16
- if (/^--./.test(option)) {
17
- const equIndex = option.indexOf('='); // equIndex = equIndex === -1 ? option.length : equIndex;
18
-
19
- let key = option.slice(2, equIndex);
20
- let value = giveDefaultValue(option.slice(equIndex + 1));
21
-
22
- if (equIndex === -1) {
23
- key = option.slice(2);
24
- value = true;
25
- }
26
-
27
- key = key.replace(/-|:/g, '_');
28
- processEnv[key] = value;
29
- }
30
- });
31
- return processEnv;
32
- }
@@ -1,394 +0,0 @@
1
- import { hostname } from 'os'; // NOTE: Don't use 'config_file' as cli option it was reserved
2
-
3
- export default {
4
- context: {
5
- value: 'app',
6
- cli: 'context'
7
- },
8
- library: {
9
- ignorePatterns: []
10
- },
11
- devtool: 'source-map',
12
- statsLogConfig: null,
13
- stats: {
14
- enable: {
15
- value: false,
16
- cli: 'enable_stats',
17
- type: 'boolean'
18
- },
19
- fileName: null,
20
- options: null,
21
- excludeKeys: null
22
- },
23
- enableFileNameHashing: {
24
- value: false,
25
- cli: 'enable_hash'
26
- },
27
- bundleAnalyze: {
28
- value: false,
29
- cli: 'bundle_analyze'
30
- },
31
- enableMockReplace: {
32
- value: false,
33
- cli: 'enable_mock_replace'
34
- },
35
- noPublicPath: {
36
- value: false,
37
- cli: 'no_public_path'
38
- },
39
- output: {
40
- value: 'build',
41
- cli: 'output'
42
- },
43
- mode: {
44
- value: null,
45
- cli: 'mode'
46
- },
47
- printProgress: {
48
- value: false,
49
- cli: 'print_progress'
50
- },
51
- server: {
52
- k8s: {
53
- value: false,
54
- cli: 'k8s'
55
- },
56
- httpsCerts: {
57
- value: '',
58
- cli: 'https_certs'
59
- },
60
- host: {
61
- value: hostname(),
62
- cli: 'host'
63
- },
64
- port: {
65
- value: 9090,
66
- cli: 'port'
67
- },
68
- domain: {
69
- value: null,
70
- cli: 'domain'
71
- },
72
- disableContextURL: {
73
- value: false,
74
- cli: 'disable_context'
75
- }
76
- },
77
- mockServer: {
78
- enable: {
79
- value: false,
80
- cli: 'enable_mock'
81
- },
82
- separateSeverPort: {
83
- value: null,
84
- cli: 'mock_port'
85
- },
86
- disableNodemon: {
87
- value: false,
88
- cli: 'disable_nodemon'
89
- },
90
- mockEntryFile: 'mockapi/index.js',
91
- mockPrefix: {
92
- value: '/api',
93
- cli: 'mock_prefix'
94
- }
95
- },
96
- css: {
97
- classNameOptions: {
98
- customizations: [{
99
- enable: true,
100
- blob: '[local]',
101
- patterns: ['*.plain.css']
102
- }, {
103
- enable: true,
104
- blob: '[prefix]-[filename]-[local]',
105
- patterns: []
106
- }],
107
- caseOnlyFilename: false,
108
- classNamePrefix: 'zd'
109
- },
110
- // NOTE: Suggestions
111
- // Name Suggestions `customizations` this will be easier then `plugin` to understand for developers
112
- plugins: {
113
- rtlSplit: {
114
- enableRTLSplit: {
115
- value: false,
116
- cli: 'enable_rtl_split'
117
- },
118
- templateLabel: '{{--dir}}',
119
- disableMinifySelector: false,
120
- dirVarName: 'document.dir'
121
- },
122
- selectorWeight: {
123
- enable: false,
124
- patterns: [],
125
- configFile: null,
126
- defaultSelector: '',
127
- customFileDetails: '',
128
- excludeStrings: []
129
- },
130
- // postcss plugins start
131
- // NOTE: These we have putted names of post-css-plugins in array
132
- // packages/client_build_tool/src/shared/bundler/webpack/custom_postcss_loaders/PostCssOptionConstants.js
133
- valueReplacer: {
134
- enable: false,
135
- patterns: [],
136
- config: []
137
- },
138
- selectorReplace: {
139
- enable: false,
140
- patterns: [],
141
- before: [],
142
- after: []
143
- },
144
- hoverActive: {
145
- enable: false,
146
- patterns: [],
147
- hover: '(hover: hover)',
148
- active: '(hover: none)'
149
- },
150
- cssVariableReplacement: {
151
- enable: false,
152
- patterns: [],
153
- configFile: null
154
- },
155
- rtl: {
156
- enable: false,
157
- patterns: []
158
- } // postcss - plugins end
159
-
160
- },
161
- customPlugins: ['...']
162
- },
163
- i18nChunkSplit: {
164
- chunkSplitEnable: {
165
- value: false,
166
- cli: 'i18n_split'
167
- },
168
- disableDefault: false,
169
- templateLabel: '{{--user-locale}}',
170
- localeVarName: 'document.documentElement.lang',
171
- jsonpFunc: 'console.log',
172
- jsResource: null,
173
- propertiesFolder: null
174
- },
175
- i18nIndexing: {
176
- enable: {
177
- value: false,
178
- cli: 'i18n_indexing'
179
- },
180
- jsResourcePath: null,
181
- propertiesFolderPath: null,
182
- numericMapPath: null,
183
- outputFolder: 'i18n-chunk',
184
- numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
185
- dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
186
- singleFile: false,
187
- singleFileTemplate: '[locale].js',
188
- jsonpFunc: 'window.loadI18nChunk',
189
- htmlTemplateLabel: '{{--user-locale}}',
190
- localeVarName: 'window.userLangCode',
191
- includeContentHash: false,
192
- emitFiles: true,
193
- generateManifest: false,
194
- manifestPath: null
195
- },
196
- publicFolders: {
197
- dev: ['...'],
198
- prod: ['...']
199
- },
200
- app: {
201
- AdditionalEntry: {
202
- enable: false,
203
- entryFile: 'src/widget.js',
204
- entryPointName: 'widget'
205
- },
206
- entryFile: {
207
- value: 'src/index.js',
208
- cli: 'entry'
209
- }
210
- },
211
- resolve: {
212
- preferLocalFirst: false,
213
- defaultAlias: true,
214
- moduleResolvePath: {
215
- value: '',
216
- cli: 'module_resolve_path'
217
- },
218
- alias: null
219
- },
220
- htmlTemplate: {
221
- generateHtml: true,
222
- crossorigin: {
223
- value: false,
224
- cli: 'enable_crossorigin'
225
- },
226
- templateFile: {
227
- value: 'src/index.html',
228
- cli: 'initial_html'
229
- },
230
- minify: null,
231
- inject: true
232
- },
233
- efc: {
234
- hasEFC: {
235
- value: false,
236
- cli: 'enable_efc',
237
- type: 'boolean'
238
- },
239
- entryPointName: 'efc',
240
- entryFile: {
241
- value: 'src/efc.js',
242
- cli: 'efc_entry'
243
- },
244
- version: {
245
- value: 'v1',
246
- cli: 'efc_version'
247
- },
248
- createSDkFile: {
249
- value: false,
250
- cli: 'create_efc_sdk'
251
- },
252
- templateFilePath: 'efcTemplate.js',
253
- outputFile: {
254
- value: 'efc-sdk-[version].js',
255
- cli: 'efc_output'
256
- },
257
- resourceCleanup: {
258
- value: false,
259
- cli: 'enable_efc_resource_cleanup',
260
- type: 'boolean'
261
- }
262
- },
263
- createSeparateSMap: {
264
- value: false,
265
- cli: 'enable_smap'
266
- },
267
- babelCustomizations: {
268
- browserList: null,
269
- // NOTE: need to consider
270
- // presets: [],
271
- plugins: [],
272
- removeAttribute: {
273
- enable: false,
274
- options: {
275
- attributeNames: ['data-testid']
276
- }
277
- },
278
- removePropTypes: {
279
- enable: false,
280
- options: {
281
- mode: 'remove',
282
- removeImport: true
283
- }
284
- },
285
- devConsoleExclude: {
286
- enable: {
287
- value: false,
288
- cli: 'console_exclude'
289
- },
290
- options: {
291
- exclude: ['error']
292
- }
293
- }
294
- },
295
- webpackPlugins: [],
296
- vendorPatterns: [],
297
- customChunksBaseConfig: null,
298
- customChunks: [],
299
- cdnMapping: {
300
- isCdnEnabled: {
301
- value: false,
302
- cli: 'enable_cdn'
303
- },
304
- variableName: '',
305
- cssTemplate: '',
306
- jsTemplate: '',
307
- i18nTemplate: ''
308
- },
309
- manifestJson: {
310
- enable: false,
311
- i18nManifestJson: false,
312
- licenseManifest: false
313
- },
314
- changeRuntimeChunkChar: '~',
315
- serviceWorker: {
316
- enable: false,
317
- templateFilePath: 'sw.js',
318
- outputFilePath: '/v1.js',
319
- replaceText: '//<!--AssetsFromBuild -->'
320
- },
321
- customLoaders: [],
322
- resourceHints: {
323
- allowPrefetchingMultipleChunks: false
324
- },
325
- devModeContentHashAllowedTypes: null,
326
- nameTemplateCustomization: null,
327
- devLikeHash: {
328
- value: false,
329
- cli: 'dev_like_hash'
330
- },
331
- disableReactDevWarning: {
332
- value: false,
333
- cli: 'disable_react_dev_warning'
334
- },
335
- preProcess: {
336
- enable: {
337
- value: false,
338
- cli: 'enable_pre_process'
339
- },
340
- // This option is for tell the CBT to which is preprocessor js file path
341
- runner: {
342
- value: '',
343
- cli: 'preprocessor'
344
- },
345
- // usually preprocessor run in nodemon for, start and docs , preprocessor
346
- stopNodemon: {
347
- value: false,
348
- cli: 'stop_nodemon'
349
- }
350
- },
351
- fileHashMappingToVariable: null,
352
- customAttributes: {
353
- enable: false,
354
- attributes: null,
355
- jsAttributes: null,
356
- cssAttributes: null,
357
- i18nAttributes: null
358
- },
359
- externals: null,
360
- typeScript: {
361
- enable: {
362
- value: false,
363
- cli: 'type_script_enable'
364
- }
365
- },
366
- optimization: {
367
- jsExcludePath: '',
368
- cssExcludePath: ''
369
- },
370
- customScriptLoadingStrategey: {
371
- enable: false,
372
- options: null
373
- },
374
- murphyBootstrapHtml: {
375
- enable: false,
376
- chunkName: '',
377
- filePath: ''
378
- },
379
- enableSubResourceIntegrity: {
380
- value: false,
381
- cli: 'enable_sub_resource_integrity'
382
- },
383
- chunkGraph: {
384
- enable: {
385
- value: false,
386
- cli: 'chunk_graph_enable'
387
- },
388
- fileName: ''
389
- },
390
- cssOrderControler: {
391
- enable: false,
392
- className: 'customCss'
393
- }
394
- };
@@ -1,196 +0,0 @@
1
- import { hostname } from 'os'; // NOTE: Don't use 'config_file' as cli option it was reserved
2
-
3
- export default {
4
- context: 'app',
5
- devtool: 'hidden-cheap-source-map',
6
- enableFileNameHashing: false,
7
- bundleAnalyze: false,
8
- enableMockReplace: false,
9
- noPublicPath: false,
10
- output: 'build',
11
- mode: null,
12
- printProgress: false,
13
- server: {
14
- httpsCerts: '@zohodesk-private/client_dev_cert',
15
- host: hostname(),
16
- port: 9090,
17
- domain: 'tsi',
18
- disableContextURL: false
19
- },
20
- mockServer: {
21
- enable: false,
22
- separateSeverPort: 5000,
23
- disableNodemon: false,
24
- mockEntryFile: 'mockapi/index.js',
25
- mockPrefix: '/api/'
26
- },
27
- css: {
28
- classNameOptions: {
29
- customizations: [{
30
- enable: true,
31
- blob: '[local]',
32
- patterns: ['*.plain.css']
33
- }, {
34
- enable: true,
35
- blob: '[prefix]-[filename]-[local]',
36
- patterns: []
37
- }],
38
- classNamePrefix: 'zd'
39
- },
40
- // NOTE: Suggestions
41
- // Name Suggestions `customizations` this will be easier then `plugin` to understand for developers
42
- plugins: {
43
- rtlSplit: {
44
- enableRTLSplit: false,
45
- templateLabel: '{{--dir}}',
46
- disableMinifySelector: false,
47
- dirVarName: 'document.dir'
48
- },
49
- selectorWeight: {
50
- enable: false,
51
- patterns: [],
52
- configFile: null,
53
- defaultSelector: '',
54
- customFileDetails: '',
55
- excludeStrings: []
56
- },
57
- selectorReplace: {
58
- enable: false,
59
- patterns: [],
60
- before: [],
61
- after: []
62
- },
63
- hoverActive: {
64
- enable: false,
65
- patterns: [],
66
- hover: '(hover: hover)',
67
- active: '(hover: none)'
68
- },
69
- cssVariableReplacement: {
70
- enable: false,
71
- patterns: [],
72
- configFile: null
73
- },
74
- rtl: {
75
- enable: false,
76
- patterns: []
77
- } // postcss - plugins end
78
-
79
- },
80
- customPlugins: []
81
- },
82
- i18nChunkSplit: {
83
- chunkSplitEnable: false,
84
- disableDefault: false,
85
- templateLabel: '{{--user-locale}}',
86
- localeVarName: 'document.documentElement.lang',
87
- jsonpFunc: 'console.log',
88
- jsResource: null,
89
- propertiesFolder: null
90
- },
91
- i18nIndexing: {
92
- enable: false,
93
- jsResourcePath: null,
94
- propertiesFolderPath: null,
95
- numericMapPath: null,
96
- outputFolder: 'i18n-chunk',
97
- numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
98
- dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
99
- singleFile: false,
100
- singleFileTemplate: '[locale].js',
101
- jsonpFunc: 'window.loadI18nChunk',
102
- htmlTemplateLabel: '{{--user-locale}}',
103
- localeVarName: 'window.userLangCode',
104
- includeContentHash: false,
105
- emitFiles: true,
106
- generateManifest: false,
107
- manifestPath: null
108
- },
109
- publicFolders: {
110
- dev: ['...'],
111
- prod: ['...']
112
- },
113
- app: {
114
- entryFile: 'src/index.js',
115
- tpFolder: null,
116
- moduleResolvePath: 'node_modules'
117
- },
118
- resolve: {
119
- preferLocalFirst: false,
120
- defaultAlias: true,
121
- moduleResolvePath: 'node_modules',
122
- alias: null
123
- },
124
- // EFC means Embedded Functional Components
125
- efc: {
126
- hasEFC: false,
127
- entryPointName: 'efc',
128
- entryFile: 'src/efc.js',
129
- version: 'v1',
130
- createSDkFile: false,
131
- templateFilePath: 'efcTemplate.js',
132
- outputFile: 'efc-sdk-[version].js',
133
- resourceCleanup: false
134
- },
135
- createSeparateSMap: false,
136
- babelCustomizations: {
137
- browserList: null,
138
- removeAttribute: {
139
- enable: false,
140
- options: {
141
- attributeNames: ['data-testid']
142
- }
143
- },
144
- removePropTypes: {
145
- enable: false,
146
- options: {
147
- mode: 'remove',
148
- removeImport: true
149
- }
150
- },
151
- devConsoleExclude: {
152
- enable: false,
153
- options: {
154
- exclude: ['error']
155
- }
156
- },
157
- // NOTE: need to consider
158
- // presets: [],
159
- plugins: []
160
- },
161
- webpackPlugins: [],
162
- vendorPatterns: [],
163
- customChunks: [{
164
- name: 'styles',
165
- patterns: ['*.css']
166
- }],
167
- htmlTemplate: {
168
- templateFile: 'src/index.html',
169
- minify: null,
170
- inject: true
171
- },
172
- // CDN means Content Delivery Network
173
- cdnMapping: {
174
- isCdnEnabled: false,
175
- variableName: '',
176
- cssTemplate: '',
177
- jsTemplate: '',
178
- i18nTemplate: ''
179
- },
180
- manifestJson: {
181
- enable: true
182
- },
183
- changeRuntimeChunkChar: '~',
184
- serviceWorker: {
185
- enable: false,
186
- templateFilePath: 'sw.js',
187
- outputFilePath: '/v1.js',
188
- replaceText: '//<!--AssetsFromBuild -->'
189
- },
190
- stats: {
191
- enable: false,
192
- fileName: null,
193
- options: null,
194
- excludeKeys: null
195
- }
196
- };
@@ -1,60 +0,0 @@
1
- import { warnLogger } from "../logger";
2
-
3
- function nestedSelect(obj, key) {
4
- let temp = obj;
5
- const keys = key.split('.');
6
-
7
- for (let i = 0; i < keys.length && temp; i++) {
8
- const element = keys[i];
9
- temp = temp[element];
10
- }
11
-
12
- return temp;
13
- }
14
-
15
- function nestedUpdate(obj, key, value) {
16
- let temp = obj;
17
- const keys = key.split('.');
18
- let i = 0;
19
-
20
- for (; i < keys.length - 1 && temp; i++) {
21
- const element = keys[i];
22
- temp = temp[element];
23
- }
24
-
25
- if (temp) {
26
- temp[keys[i]] = value;
27
- }
28
- }
29
-
30
- export function deprecatedOptionsHandler(options) {
31
- function checkAndUpdateAndPrintWaring(oldKey, newkey) {
32
- const oldVal = nestedSelect(options, oldKey);
33
- const newVal = nestedSelect(options, newkey); // console.log({ oldVal, newVal });
34
-
35
- if (oldVal !== undefined && newVal === undefined) {
36
- nestedUpdate(options, newkey, newVal);
37
- warnLogger(`"${oldKey}" deprecated use "${newkey}" instead`);
38
- }
39
- } // return;
40
-
41
-
42
- checkAndUpdateAndPrintWaring('app.context', 'context'); // TODO handle deprecations here
43
- // we will finish this logic later when options are confirmed
44
-
45
- if (nestedSelect(options, 'app.hasRTL') === true) {
46
- nestedUpdate(options, 'app.plugins.hasRTL', true);
47
- }
48
-
49
- if (nestedSelect(options, 'docs.hasRTL') === true) {
50
- nestedUpdate(options, 'docs.plugins.hasRTL', true);
51
- }
52
-
53
- if (nestedSelect(options, 'app.rtlExclude.length') > 0) {
54
- nestedUpdate(options, 'app.exclude.rtl', nestedSelect(options, 'app.rtlExclude'));
55
- }
56
-
57
- if (nestedSelect(options, 'docs.rtlExclude.length') > 0) {
58
- nestedUpdate(options, 'docs.exclude.rtl', nestedSelect(options, 'docs.rtlExclude'));
59
- }
60
- }