@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
package/app/README.MD ADDED
@@ -0,0 +1,30 @@
1
+ # Welcome
2
+
3
+ This is a web applications template.
4
+
5
+ Supported and Tested Environment
6
+
7
+ | Name | Version |
8
+ | :--: | :------: |
9
+ | node | v18.11.0 |
10
+ | npm | 8.19.2 |
11
+
12
+ OS : Mac , ubuntu
13
+
14
+ So Please make sure you use the right node and npm version
15
+
16
+ ## To install your app
17
+
18
+ > `npm install`
19
+
20
+ ## To run app
21
+
22
+ > `npm run start`
23
+
24
+ ## To create build
25
+
26
+ > `npm run build`
27
+
28
+ ---
29
+
30
+ Happy Code :>) 🤟
package/app/es/test.js ADDED
@@ -0,0 +1,47 @@
1
+ function destructuring_within_body() {
2
+ const {
3
+ jos: joshuva = 'josss'
4
+ } = {
5
+ jos: 'dkdk'
6
+ };
7
+ const object = {
8
+ a: 'Joshuva',
9
+ b: {
10
+ age: 30,
11
+ hobbies: ['chess', 'book_reading']
12
+ },
13
+ c: ['jos']
14
+ };
15
+ const {
16
+ a,
17
+ c: j,
18
+ ...d
19
+ } = object;
20
+ }
21
+
22
+ function destructuring_within_args({
23
+ va: jso
24
+ }) {
25
+ console.log('jso', jso);
26
+ }
27
+
28
+ function destructuring_within_args_arr([jos, joshuv]) {
29
+ console.log('array destructing', jos, joshuv);
30
+ }
31
+
32
+ function destructuring_within_args_with_default_value({
33
+ jos: joss
34
+ } = {}) {
35
+ console.log('josss', joss);
36
+ }
37
+
38
+ function restFromargs(...a) {
39
+ console.log('a', a);
40
+ }
41
+
42
+ function default_assignment(a = 1, b = 2) {
43
+ console.log('a', a);
44
+ console.log('b', b);
45
+ }
46
+
47
+ function default_assignment_with_arr([j, q] = []) {}
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "sample",
3
+ "version": "1.0.0",
4
+ "private": "true",
5
+ "description": "web application",
6
+ "scripts": {
7
+ "start": "cbt start",
8
+ "build": "cbt build"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
12
+ }
@@ -26,7 +26,8 @@ var _default = {
26
26
  },
27
27
  fileName: null,
28
28
  options: null,
29
- excludeKeys: null
29
+ excludeKeys: null,
30
+ moduleConcatenation: true
30
31
  },
31
32
  enableFileNameHashing: {
32
33
  value: false,
@@ -214,8 +215,7 @@ var _default = {
214
215
  entryFile: {
215
216
  value: 'src/index.js',
216
217
  cli: 'entry'
217
- },
218
- entryPointName: 'main'
218
+ }
219
219
  },
220
220
  resolve: {
221
221
  preferLocalFirst: false,
@@ -374,9 +374,6 @@ var _default = {
374
374
  }
375
375
  },
376
376
  optimization: {
377
- minimize: true,
378
- splitChunks: true,
379
- runtimeChunk: true,
380
377
  jsExcludePath: '',
381
378
  cssExcludePath: ''
382
379
  },
@@ -49,6 +49,7 @@ function getBabelPresetEnvConfig(browserList, mode) {
49
49
  corejs: 3,
50
50
  targets: {
51
51
  browsers
52
- }
52
+ },
53
+ bugfixes: true
53
54
  }];
54
55
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getModuleConcatenationFlag = getModuleConcatenationFlag;
7
+ exports.isStatsEnabled = isStatsEnabled;
8
+
9
+ function getModuleConcatenationFlag(options) {
10
+ return options.stats.moduleConcatenation;
11
+ }
12
+
13
+ function isStatsEnabled(options) {
14
+ return options.stats.enable;
15
+ }
@@ -15,11 +15,10 @@ function entryConfig(options) {
15
15
  } = options.efc;
16
16
  const {
17
17
  entryFile: mainEntry,
18
- AdditionalEntry,
19
- entryPointName: mainEntryPointName = 'main'
18
+ AdditionalEntry
20
19
  } = options.app;
21
20
  const entry = {
22
- [mainEntryPointName]: (0, _constants.joinWithAppPath)(mainEntry)
21
+ main: (0, _constants.joinWithAppPath)(mainEntry)
23
22
  };
24
23
 
25
24
  if (hasEFC && entryFile) {
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getModuleConcatenation = getModuleConcatenation;
7
+
8
+ var _modeUtils = require("./common/modeUtils");
9
+
10
+ var _utils = require("./custom_plugins/BundleIntegrityReport/utils");
11
+
12
+ function getModuleConcatenation(options) {
13
+ const mode = (0, _modeUtils.getWebpackMode)(options);
14
+
15
+ if ((0, _modeUtils.isProductionMode)(mode) && (0, _utils.isStatsEnabled)(options)) {
16
+ return (0, _utils.getModuleConcatenationFlag)(options);
17
+ }
18
+ }
@@ -15,14 +15,11 @@ var _configCSSMinifierPlugin = require("./pluginConfigs/configCSSMinifierPlugin"
15
15
 
16
16
  var _splitChunksConfig = require("./splitChunksConfig");
17
17
 
18
+ var _moduleConcatenationConfig = require("./moduleConcatenationConfig");
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
20
22
  function optimizationConfig(options) {
21
- const {
22
- minimize,
23
- splitChunks,
24
- runtimeChunk
25
- } = options.optimization;
26
23
  const {
27
24
  changeRuntimeChunkChar
28
25
  } = options;
@@ -42,8 +39,8 @@ function optimizationConfig(options) {
42
39
  const char = changeRuntimeChunkChar;
43
40
  const excludeList = options.optimization.jsExcludePath;
44
41
  return {
45
- splitChunks: splitChunks ? (0, _splitChunksConfig.splitChunksConfig)(options) : false,
46
- minimizer: minimize ? [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
42
+ splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
43
+ minimizer: [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
47
44
  // '...',
48
45
  excludeList !== '' ? new _terserWebpackPlugin.default({
49
46
  exclude: excludeList,
@@ -52,10 +49,11 @@ function optimizationConfig(options) {
52
49
  }) : new _terserWebpackPlugin.default({
53
50
  extractComments: false // Do not extract comments to .LICENSE.txt files
54
51
 
55
- }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean) : false,
52
+ }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
56
53
  moduleIds: 'named',
57
- runtimeChunk: runtimeChunk ? {
54
+ runtimeChunk: {
58
55
  name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
59
- } : false
56
+ },
57
+ concatenateModules: (0, _moduleConcatenationConfig.getModuleConcatenation)(options)
60
58
  };
61
59
  }
@@ -33,7 +33,7 @@ function configHtmlWebpackPlugin(options) {
33
33
  const minifyHtmlOptions = (0, _modeUtils.isProductionMode)(mode) ? // eslint-disable-next-line no-use-before-define
34
34
  getHTMLMinifyOptions(htmlTemplate) : false;
35
35
  return new _InitialHtmlPlugin.InitialHtmlPlugin({
36
- mainChunkName: options.app.entryPointName || 'main',
36
+ mainChunkName: 'main',
37
37
  filename: (0, _nameTemplates.nameTemplates)('html', options),
38
38
  template: appInitialHTMLTemplatePath,
39
39
  minify: minifyHtmlOptions,
@@ -25,7 +25,7 @@ function configI18nSplitPlugin(options) {
25
25
  const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options); // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
26
26
 
27
27
  return new _I18nSplitPlugin.default({
28
- mainChunkName: options.app.entryPointName || 'main',
28
+ mainChunkName: 'main',
29
29
  jsResource: i18nChunkSplit.jsResource,
30
30
  localeVarName: i18nChunkSplit.localeVarName,
31
31
  jsonpFunc: i18nChunkSplit.jsonpFunc,
@@ -35,6 +35,6 @@ function configServiceWorkerPlugin(options) {
35
35
  i18nFileNameTemplate,
36
36
  chunkSplitEnable,
37
37
  enableRTLSplit,
38
- entryPointName: options.app.entryPointName || 'main'
38
+ entryPointName: 'main'
39
39
  });
40
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.22-exp.4",
3
+ "version": "0.0.22-exp.5",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -1,15 +0,0 @@
1
- /* eslint-disable global-require */
2
- import { existsSync, readdirSync } from 'fs';
3
- import { join } from 'path';
4
- const allConfigs = [];
5
- readdirSync(join(__dirname, 'commands')).forEach(folderName => {
6
- const modulePath = join(__dirname, `./commands/${folderName}/config.js`);
7
-
8
- if (existsSync(modulePath)) {
9
- // eslint-disable-next-line import/no-dynamic-require
10
- const config = require(modulePath).default;
11
-
12
- allConfigs.push(config);
13
- }
14
- });
15
- export default allConfigs;
@@ -1,6 +0,0 @@
1
- import { messageLogger } from "../../logger";
2
- import webpackBuild from "../../shared/bundler/webpack/webpackBuild";
3
- export function commandExecutor(options) {
4
- messageLogger('Build is running.....');
5
- webpackBuild(options);
6
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'build',
3
- alias: ['devbuild'],
4
- dirname: __dirname
5
- };
@@ -1,25 +0,0 @@
1
- import { decidePublicPath, modifiedServerOptions } from "../../shared/bundler/webpack/common/decidePublicPath";
2
- import { isDevelopmentMode } from "../../shared/bundler/webpack/common/modeUtils";
3
- import { joinWithAppPath } from "../../shared/constants";
4
- export function optionsProcessor(options) {
5
- const {
6
- context,
7
- mode,
8
- noPublicPath
9
- } = options;
10
- const {
11
- isCdnEnabled
12
- } = options.cdnMapping;
13
- const serverExtras = modifiedServerOptions(options);
14
- const publicPath = noPublicPath ? undefined : decidePublicPath(serverExtras);
15
- const contextFolderPath = joinWithAppPath(context);
16
- const defaultAppliedOptions = { ...options,
17
- serverExtras,
18
- // eslint-disable-next-line no-nested-ternary
19
- mode: mode === null ? 'prod' : mode === 'dev' ? 'dev' : 'prod',
20
- publicPath: isDevelopmentMode(mode) || isCdnEnabled ? undefined : publicPath,
21
- contextFolderPath,
22
- httpsOptions: serverExtras.httpsOptions
23
- };
24
- return defaultAppliedOptions;
25
- }
@@ -1,4 +0,0 @@
1
- import { runPreProcess } from "../../shared/pre_process/runPreProcess";
2
- export function preProcessor(options) {
3
- runPreProcess(options, 'node');
4
- }
@@ -1,29 +0,0 @@
1
- import { joinWithAppPath } from "../../shared/constants";
2
- import { watchRun } from "../../shared/fileUtils/watchRun";
3
- export function commandExecutor(options) {
4
- const {
5
- extraArgs = []
6
- } = options;
7
- const index = extraArgs.indexOf('-w');
8
- const canWatch = index !== -1;
9
-
10
- if (canWatch) {
11
- extraArgs.splice(index, 1);
12
- }
13
-
14
- let [srcArg, targetArg] = extraArgs;
15
- srcArg = srcArg || 'src';
16
- targetArg = targetArg || 'es';
17
- const srcList = srcArg.split(',').map(s => joinWithAppPath(s));
18
- const targetList = targetArg.split(',').map(t => joinWithAppPath(t));
19
- const runs = Math.min(srcList.length, targetList.length);
20
- srcList.slice(0, runs).forEach((src, index) => {
21
- watchRun({
22
- options,
23
- src,
24
- target: targetList[index],
25
- canWatch,
26
- mode: 'es'
27
- });
28
- });
29
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'buildEs',
3
- alias: ['build_es', 'build:es'],
4
- dirname: __dirname
5
- };
@@ -1,9 +0,0 @@
1
- import { runPreProcess } from "../../shared/pre_process/runPreProcess";
2
- export function preProcessor(options) {
3
- const {
4
- extraArgs = []
5
- } = options;
6
- const index = extraArgs.indexOf('-w');
7
- const canWatch = index !== -1;
8
- runPreProcess(options, canWatch ? 'nodemon' : 'node');
9
- }
@@ -1,24 +0,0 @@
1
- import { joinWithAppPath } from "../../shared/constants";
2
- import { watchRun } from "../../shared/fileUtils/watchRun";
3
- export function commandExecutor(options) {
4
- const {
5
- extraArgs = []
6
- } = options;
7
- const index = extraArgs.indexOf('-w');
8
- const canWatch = index !== -1;
9
-
10
- if (canWatch) {
11
- extraArgs.splice(index, 1);
12
- }
13
-
14
- let [src, target] = extraArgs;
15
- src = joinWithAppPath(src || 'src');
16
- target = joinWithAppPath(target || 'lib');
17
- watchRun({
18
- options,
19
- src,
20
- target,
21
- canWatch,
22
- mode: 'lib'
23
- });
24
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'buildLib',
3
- alias: ['build:lib', 'build_lib'],
4
- dirname: __dirname
5
- };
@@ -1,9 +0,0 @@
1
- import { runPreProcess } from "../../shared/pre_process/runPreProcess";
2
- export function preProcessor(options) {
3
- const {
4
- extraArgs = []
5
- } = options;
6
- const index = extraArgs.indexOf('-w');
7
- const canWatch = index !== -1;
8
- runPreProcess(options, canWatch ? 'nodemon' : 'node');
9
- }
@@ -1,32 +0,0 @@
1
- import { dirname, join } from 'path';
2
- import { messageLogger, verboseLogger } from "../../logger";
3
- import { spawnSyncIO } from "../../shared/commands-utils/spawnSyncIO";
4
- import { joinWithAppPath } from "../../shared/constants";
5
- export function commandExecutor(options) {
6
- const {
7
- extraArgs
8
- } = options;
9
- const {
10
- enable,
11
- separateSeverPort,
12
- mockEntryFile,
13
- disableNodemon
14
- } = options.mockServer;
15
-
16
- if (!enable) {
17
- messageLogger('mock server not enabled');
18
- return;
19
- }
20
-
21
- if (!separateSeverPort) {
22
- messageLogger('mock server not port enabled');
23
- return;
24
- }
25
-
26
- const absolutePath = join(__dirname, '..', '..', 'shared', 'server', 'mockServer.js');
27
- const mockFile = joinWithAppPath(mockEntryFile);
28
- verboseLogger('Mock server is running path', absolutePath);
29
- verboseLogger('App mock server is path', mockFile);
30
- messageLogger('mock server is running.....');
31
- spawnSyncIO(disableNodemon ? 'node' : 'nodemon', [absolutePath, '--watch', dirname(mockFile), ...extraArgs]); // webpackBuild(options);
32
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'mockServer',
3
- alias: ['mockserver', 'mock_server', 'mock-server', 'mock:server'],
4
- dirname: __dirname
5
- };
@@ -1,10 +0,0 @@
1
- import { runPreProcess } from "../../shared/pre_process/runPreProcess";
2
- export function commandExecutor(options) {
3
- const {
4
- extraArgs = []
5
- } = options;
6
- const index = extraArgs.indexOf('-w');
7
- const canWatch = index !== -1;
8
- const result = runPreProcess(options, canWatch ? 'nodemon' : 'node');
9
- !canWatch && process.exit(result ? result.status : 0);
10
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'pre_process',
3
- alias: ['preprocess', 'pre:process', 'preProcess'],
4
- dirname: __dirname
5
- };
@@ -1,4 +0,0 @@
1
- import { run as serverRunner } from "../../shared/server/serverBywebpackDevMiddleware";
2
- export function commandExecutor(options) {
3
- serverRunner(options);
4
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'start',
3
- alias: ['dstart', 'devSeverStart'],
4
- dirname: __dirname
5
- };
@@ -1,21 +0,0 @@
1
- import { decidePublicPath, modifiedServerOptions } from "../../shared/bundler/webpack/common/decidePublicPath";
2
- import { joinWithAppPath } from "../../shared/constants";
3
- export function optionsProcessor(options) {
4
- const {
5
- context,
6
- mode,
7
- noPublicPath
8
- } = options;
9
- const serverExtras = modifiedServerOptions(options);
10
- const publicPath = noPublicPath ? undefined : decidePublicPath(serverExtras);
11
- const contextFolderPath = joinWithAppPath(context);
12
- const defaultAppliedOptions = { ...options,
13
- // eslint-disable-next-line no-nested-ternary
14
- mode: options.mode === null ? 'dev' : mode === 'prod' ? 'prod' : 'dev',
15
- serverExtras,
16
- publicPath,
17
- contextFolderPath,
18
- httpsOptions: serverExtras.httpsOptions
19
- };
20
- return defaultAppliedOptions;
21
- }
@@ -1,4 +0,0 @@
1
- import { runPreProcess } from "../../shared/pre_process/runPreProcess";
2
- export function preProcessor(options) {
3
- runPreProcess(options, 'nodemon');
4
- }
@@ -1,17 +0,0 @@
1
- import { getTemplatePath } from "../../shared/constants";
2
- import { messageLogger } from "../../logger";
3
- import { spawnSyncIO } from "../../shared/commands-utils/spawnSyncIO";
4
- const supportedTemplates = ['app', 'library'];
5
- export function commandExecutor(options) {
6
- const {
7
- extraArgs = []
8
- } = options;
9
- const [templateName, ...args] = extraArgs;
10
-
11
- if (!supportedTemplates.includes(templateName)) {
12
- messageLogger(`template not supported "${templateName}" only these \n${supportedTemplates.join('\n ')} are supported`);
13
- return;
14
- }
15
-
16
- spawnSyncIO('cp', ['-r', getTemplatePath(templateName)].concat(args));
17
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'template',
3
- alias: ['template', 'templates'],
4
- dirname: __dirname
5
- };
@@ -1,5 +0,0 @@
1
- import { messageLogger } from "../../logger";
2
- import { versionPrint } from "../../shared/utils/versionPrint";
3
- export function commandExecutor() {
4
- versionPrint(messageLogger);
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- name: 'version',
3
- alias: ['v', '-v', '--v', '-version', '--version'],
4
- dirname: __dirname
5
- };
@@ -1,58 +0,0 @@
1
- import { existsSync } from 'fs';
2
- import { join } from 'path';
3
- import allCommandsConfigs from "./allCommandsConfigs";
4
- import { errorLogger, verboseLogger, warnLogger } from "./logger";
5
- import { getOptions } from "./schemas/readOptions";
6
- export function runCommand(commandName, options) {
7
- // eslint-disable-next-line no-use-before-define
8
- const commandConfig = findCommandConfig(commandName);
9
-
10
- if (!commandConfig) {
11
- return;
12
- }
13
-
14
- const {
15
- dirname
16
- } = commandConfig;
17
-
18
- function runRespectiveFile(name, data) {
19
- const commandExecutorPath = join(dirname, `${name}.js`);
20
-
21
- if (existsSync(commandExecutorPath)) {
22
- // eslint-disable-next-line import/no-dynamic-require, global-require
23
- const commandExecutor = require(commandExecutorPath);
24
-
25
- return (commandExecutor[name] || commandExecutor.default)(data);
26
- }
27
-
28
- verboseLogger('file not found', commandExecutorPath);
29
- return null;
30
- }
31
-
32
- const processedOption = runRespectiveFile('optionsProcessor', options) || options;
33
- runRespectiveFile('deprecationHandler', processedOption); // runRespectiveFile("errorHandler", () => {
34
-
35
- runRespectiveFile('preProcessor', processedOption);
36
- runRespectiveFile('commandExecutor', processedOption);
37
- runRespectiveFile('postProcessor', processedOption); // });
38
- }
39
- export function route(commandName) {
40
- try {
41
- const options = getOptions();
42
- runCommand(commandName, options);
43
- } catch (error) {
44
- errorLogger(error);
45
- }
46
- }
47
-
48
- function findCommandConfig(option) {
49
- // eslint-disable-next-line no-restricted-syntax
50
- for (const commandConfig of allCommandsConfigs) {
51
- if (commandConfig.name === option || commandConfig.alias.includes(option)) {
52
- return commandConfig;
53
- }
54
- }
55
-
56
- warnLogger('Un known command', option, 'please check the document');
57
- return null;
58
- }
package/es/index.js DELETED
@@ -1,4 +0,0 @@
1
- import { runCommand } from "./commandsRouter";
2
- export function run(commandName, options) {
3
- return runCommand(commandName, options);
4
- }
package/es/logger.js DELETED
@@ -1,23 +0,0 @@
1
- /* eslint-disable no-console */
2
- export function verboseLogger() {
3
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4
- args[_key] = arguments[_key];
5
- }
6
-
7
- // TODO: need to be remove when publish happens
8
- process.env.VERBOSE === 'true' && console.log('\x1b[33m [verbose] \x1b[0m', ...args);
9
- }
10
- export function warnLogger() {
11
- console.warn(...arguments);
12
- }
13
- export function messageLogger() {
14
- console.log(...arguments);
15
- }
16
- export function debugLogger() {
17
- // TODO: need to be remove when publish happens
18
- console.trace();
19
- console.log(...arguments);
20
- }
21
- export function errorLogger() {
22
- console.error(...arguments);
23
- }