@zohodesk/client_build_tool 0.0.22-exp.3 → 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 (242) 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 +2 -2
  7. package/lib/schemas/defaultConfigValuesOnly.js +0 -5
  8. package/lib/shared/babel/babelWebConfig.js +2 -1
  9. package/lib/shared/bundler/webpack/configCustomLoaders.js +1 -4
  10. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/utils.js +15 -0
  11. package/lib/shared/bundler/webpack/entryConfig.js +2 -3
  12. package/lib/shared/bundler/webpack/moduleConcatenationConfig.js +18 -0
  13. package/lib/shared/bundler/webpack/optimizationConfig.js +4 -9
  14. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +1 -1
  15. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +1 -1
  16. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +1 -1
  17. package/package.json +1 -1
  18. package/es/allCommandsConfigs.js +0 -15
  19. package/es/commands/build/commandExecutor.js +0 -6
  20. package/es/commands/build/config.js +0 -5
  21. package/es/commands/build/optionsProcessor.js +0 -25
  22. package/es/commands/build/preProcessor.js +0 -4
  23. package/es/commands/buildEs/commandExecutor.js +0 -29
  24. package/es/commands/buildEs/config.js +0 -5
  25. package/es/commands/buildEs/preProcessor.js +0 -9
  26. package/es/commands/buildLib/commandExecutor.js +0 -24
  27. package/es/commands/buildLib/config.js +0 -5
  28. package/es/commands/buildLib/preProcessor.js +0 -9
  29. package/es/commands/mockserver/commandExecutor.js +0 -32
  30. package/es/commands/mockserver/config.js +0 -5
  31. package/es/commands/pre_process/commandExecutor.js +0 -10
  32. package/es/commands/pre_process/config.js +0 -5
  33. package/es/commands/start/commandExecutor.js +0 -4
  34. package/es/commands/start/config.js +0 -5
  35. package/es/commands/start/optionsProcessor.js +0 -21
  36. package/es/commands/start/preProcessor.js +0 -4
  37. package/es/commands/template/commandExecutor.js +0 -17
  38. package/es/commands/template/config.js +0 -5
  39. package/es/commands/version/commandExecutor.js +0 -5
  40. package/es/commands/version/config.js +0 -5
  41. package/es/commandsRouter.js +0 -58
  42. package/es/index.js +0 -4
  43. package/es/logger.js +0 -23
  44. package/es/schemas/applyValuesToSchema/index.js +0 -25
  45. package/es/schemas/applyValuesToSchema/isObject.js +0 -3
  46. package/es/schemas/applyValuesToSchema/isValid.js +0 -7
  47. package/es/schemas/cliArgsToObject.js +0 -32
  48. package/es/schemas/defaultConfigValues.js +0 -394
  49. package/es/schemas/defaultConfigValuesOnly.js +0 -196
  50. package/es/schemas/deprecatedOptionsHandler.js +0 -60
  51. package/es/schemas/getNpmVersion.js +0 -13
  52. package/es/schemas/giveDefaultValue.js +0 -11
  53. package/es/schemas/npmConfigToObject.js +0 -27
  54. package/es/schemas/readOptions.js +0 -67
  55. package/es/schemas/readOptionsForConfigFile.js +0 -28
  56. package/es/shared/babel/addDefaultPlugins.js +0 -8
  57. package/es/shared/babel/babelWebConfig.js +0 -43
  58. package/es/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -21
  59. package/es/shared/babel/getBabelPlugin.js +0 -36
  60. package/es/shared/babel/runBabelForJSFile.js +0 -15
  61. package/es/shared/babel/runBabelForTsFile.js +0 -34
  62. package/es/shared/bundler/webpack/common/decidePublicPath.js +0 -45
  63. package/es/shared/bundler/webpack/common/libAlias.js +0 -24
  64. package/es/shared/bundler/webpack/common/modeUtils.js +0 -24
  65. package/es/shared/bundler/webpack/common/nameTemplates.js +0 -95
  66. package/es/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -12
  67. package/es/shared/bundler/webpack/configCustomLoaders.js +0 -3
  68. package/es/shared/bundler/webpack/cssLoaders.js +0 -8
  69. package/es/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +0 -76
  70. package/es/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +0 -102
  71. package/es/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +0 -36
  72. package/es/shared/bundler/webpack/custom_plugins/ChunkHierarchyPlugin.js +0 -65
  73. package/es/shared/bundler/webpack/custom_plugins/CssCustomOrderPlugin.js +0 -37
  74. package/es/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +0 -97
  75. package/es/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +0 -98
  76. package/es/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +0 -211
  77. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  78. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +0 -160
  79. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -66
  80. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +0 -201
  81. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  82. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +0 -59
  83. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -82
  84. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  85. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -13
  86. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -15
  87. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -72
  88. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -23
  89. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +0 -40
  90. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -59
  91. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -15
  92. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -22
  93. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -35
  94. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -70
  95. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -56
  96. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -6
  97. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -10
  98. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -2
  99. package/es/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -121
  100. package/es/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +0 -85
  101. package/es/shared/bundler/webpack/custom_plugins/InjectChunkGraphPlugin.js +0 -47
  102. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +0 -20
  103. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +0 -11
  104. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -26
  105. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -11
  106. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -34
  107. package/es/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -11
  108. package/es/shared/bundler/webpack/custom_plugins/MurphyInjectorPlugin/index.js +0 -79
  109. package/es/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -0
  110. package/es/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +0 -185
  111. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -47
  112. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -70
  113. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  114. package/es/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -14
  115. package/es/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -63
  116. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -9
  117. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +0 -63
  118. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +0 -43
  119. package/es/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +0 -7
  120. package/es/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -104
  121. package/es/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -6
  122. package/es/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +0 -74
  123. package/es/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +0 -10
  124. package/es/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +0 -36
  125. package/es/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +0 -35
  126. package/es/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +0 -52
  127. package/es/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +0 -341
  128. package/es/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +0 -67
  129. package/es/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -7
  130. package/es/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +0 -43
  131. package/es/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +0 -79
  132. package/es/shared/bundler/webpack/defaultVendorPatternList.js +0 -3
  133. package/es/shared/bundler/webpack/devtoolConfig.js +0 -6
  134. package/es/shared/bundler/webpack/entryConfig.js +0 -25
  135. package/es/shared/bundler/webpack/externals.js +0 -10
  136. package/es/shared/bundler/webpack/getCSSLoaders.js +0 -17
  137. package/es/shared/bundler/webpack/getFilenameFromModule.js +0 -15
  138. package/es/shared/bundler/webpack/jsLoaders.js +0 -16
  139. package/es/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -4
  140. package/es/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -10
  141. package/es/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +0 -45
  142. package/es/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -11
  143. package/es/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +0 -23
  144. package/es/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -13
  145. package/es/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -71
  146. package/es/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -56
  147. package/es/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -11
  148. package/es/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +0 -40
  149. package/es/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +0 -116
  150. package/es/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +0 -5
  151. package/es/shared/bundler/webpack/loaders/workerLoader.js +0 -121
  152. package/es/shared/bundler/webpack/optimizationConfig.js +0 -42
  153. package/es/shared/bundler/webpack/outputConfig.js +0 -35
  154. package/es/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +0 -30
  155. package/es/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -27
  156. package/es/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +0 -17
  157. package/es/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -16
  158. package/es/shared/bundler/webpack/pluginConfigs/configChunkHierarchyPlugin.js +0 -10
  159. package/es/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +0 -50
  160. package/es/shared/bundler/webpack/pluginConfigs/configCssCustomOrderPlugin.js +0 -8
  161. package/es/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -12
  162. package/es/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -67
  163. package/es/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -37
  164. package/es/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -43
  165. package/es/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -52
  166. package/es/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +0 -17
  167. package/es/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -29
  168. package/es/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -8
  169. package/es/shared/bundler/webpack/pluginConfigs/configInjectChunkGraphPlugin.js +0 -12
  170. package/es/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -36
  171. package/es/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -13
  172. package/es/shared/bundler/webpack/pluginConfigs/configMurphyInjectorPlugin.js +0 -19
  173. package/es/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -18
  174. package/es/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +0 -11
  175. package/es/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -19
  176. package/es/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +0 -20
  177. package/es/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +0 -18
  178. package/es/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -29
  179. package/es/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -12
  180. package/es/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +0 -20
  181. package/es/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +0 -15
  182. package/es/shared/bundler/webpack/plugins.js +0 -33
  183. package/es/shared/bundler/webpack/resolvers.js +0 -70
  184. package/es/shared/bundler/webpack/splitChunksConfig.js +0 -106
  185. package/es/shared/bundler/webpack/statsConfig.js +0 -23
  186. package/es/shared/bundler/webpack/tsLoaders.js +0 -16
  187. package/es/shared/bundler/webpack/utils/index.js +0 -8
  188. package/es/shared/bundler/webpack/utils/object-manipulation.js +0 -82
  189. package/es/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -29
  190. package/es/shared/bundler/webpack/webpackBuild.js +0 -14
  191. package/es/shared/bundler/webpack/webpackConfig.js +0 -35
  192. package/es/shared/commands-utils/doBasicRequirementCheck.js +0 -10
  193. package/es/shared/commands-utils/getCliPath.js +0 -28
  194. package/es/shared/commands-utils/index.js +0 -3
  195. package/es/shared/commands-utils/log.js +0 -4
  196. package/es/shared/commands-utils/readArgsFormCommandLine.js +0 -4
  197. package/es/shared/commands-utils/readOptionFormCommandLine.js +0 -4
  198. package/es/shared/commands-utils/spawnSyncIO.js +0 -24
  199. package/es/shared/constants.js +0 -22
  200. package/es/shared/fileUtils/copyFile.js +0 -23
  201. package/es/shared/fileUtils/directoryIterator.js +0 -12
  202. package/es/shared/fileUtils/watchRun.js +0 -96
  203. package/es/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +0 -18
  204. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +0 -2
  205. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +0 -58
  206. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +0 -122
  207. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +0 -22
  208. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -11
  209. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +0 -13
  210. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -17
  211. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +0 -32
  212. package/es/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -28
  213. package/es/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +0 -125
  214. package/es/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -82
  215. package/es/shared/postcss/custom_postcss_plugins/ValueReplacer.js +0 -50
  216. package/es/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +0 -318
  217. package/es/shared/postcss/filterPluginsAllowedForSpecficFile.js +0 -41
  218. package/es/shared/postcss/getAllowedPostCssPlugins.js +0 -20
  219. package/es/shared/postcss/getSpecificPostCssPlugin.js +0 -38
  220. package/es/shared/postcss/runPostCssForCssFile.js +0 -25
  221. package/es/shared/pre_process/runPreProcess.js +0 -47
  222. package/es/shared/server/configWebpackDevMiddleware.js +0 -26
  223. package/es/shared/server/corsHandling.js +0 -23
  224. package/es/shared/server/getIp.js +0 -18
  225. package/es/shared/server/getServerURL.js +0 -28
  226. package/es/shared/server/httpsOptions.js +0 -36
  227. package/es/shared/server/initExpressApp.js +0 -9
  228. package/es/shared/server/initialHTMLHandling.js +0 -92
  229. package/es/shared/server/mockApiHandler.js +0 -53
  230. package/es/shared/server/mockServer.js +0 -34
  231. package/es/shared/server/serveContextFiles.js +0 -17
  232. package/es/shared/server/serverBywebpackDevMiddleware.js +0 -21
  233. package/es/shared/server/startHttpServer.js +0 -18
  234. package/es/shared/server/startHttpsServer.js +0 -26
  235. package/es/shared/server/unwanted/addHttp2Server.js +0 -32
  236. package/es/shared/server/unwanted/configWebpackDevMiddleware.js +0 -35
  237. package/es/shared/server/unwanted/mockApiSupport.js +0 -11
  238. package/es/shared/server/unwanted/websocketMockSetup.js +0 -36
  239. package/es/shared/server/urlConcat.js +0 -35
  240. package/es/shared/utils/requireLocalOrGlobal.js +0 -57
  241. package/es/shared/utils/utils.js +0 -0
  242. 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,
@@ -320,7 +321,6 @@ var _default = {
320
321
  licenseManifest: false
321
322
  },
322
323
  changeRuntimeChunkChar: '~',
323
- splitRuntimeChunk: true,
324
324
  serviceWorker: {
325
325
  enable: false,
326
326
  templateFilePath: 'sw.js',
@@ -120,7 +120,6 @@ var _default = {
120
120
  },
121
121
  app: {
122
122
  entryFile: 'src/index.js',
123
- entryPointName: 'main',
124
123
  tpFolder: null,
125
124
  moduleResolvePath: 'node_modules'
126
125
  },
@@ -190,7 +189,6 @@ var _default = {
190
189
  enable: true
191
190
  },
192
191
  changeRuntimeChunkChar: '~',
193
- splitRuntimeChunk: true,
194
192
  serviceWorker: {
195
193
  enable: false,
196
194
  templateFilePath: 'sw.js',
@@ -202,9 +200,6 @@ var _default = {
202
200
  fileName: null,
203
201
  options: null,
204
202
  excludeKeys: null
205
- },
206
- optimization: {
207
- enable: true
208
203
  }
209
204
  };
210
205
  exports.default = _default;
@@ -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
  }
@@ -6,8 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.configCustomLoaders = configCustomLoaders;
7
7
 
8
8
  function configCustomLoaders(options) {
9
- return {
10
- test: /\.html$/,
11
- type: 'asset/resource'
12
- };
9
+ return options.customLoaders || [];
13
10
  }
@@ -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,17 +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
- if (!options.optimization.enable) {
22
- return {
23
- minimize: false,
24
- splitChunks: false,
25
- runtimeChunk: false
26
- };
27
- }
28
-
29
23
  const {
30
24
  changeRuntimeChunkChar
31
25
  } = options;
@@ -59,6 +53,7 @@ function optimizationConfig(options) {
59
53
  moduleIds: 'named',
60
54
  runtimeChunk: {
61
55
  name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
62
- }
56
+ },
57
+ concatenateModules: (0, _moduleConcatenationConfig.getModuleConcatenation)(options)
63
58
  };
64
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.3",
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
- }