@zohodesk/client_build_tool 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/.babelrc +12 -0
  2. package/.lintstagedrc +3 -0
  3. package/.vscode/settings.json +5 -0
  4. package/CHANGELOG.md +9 -0
  5. package/ConfigurationDocumentation.md +401 -0
  6. package/ContributionGuide.md +2 -0
  7. package/NOTES-Dec12.md +12 -0
  8. package/README.md +91 -0
  9. package/README_backup.md +82 -0
  10. package/TODO.md +35 -0
  11. package/cli.js +31 -0
  12. package/coverage/base.css +224 -0
  13. package/coverage/block-navigation.js +87 -0
  14. package/coverage/coverage-final.json +2 -0
  15. package/coverage/coverage-summary.json +3 -0
  16. package/coverage/favicon.png +0 -0
  17. package/coverage/index.html +116 -0
  18. package/coverage/prettify.css +1 -0
  19. package/coverage/prettify.js +2 -0
  20. package/coverage/sort-arrow-sprite.png +0 -0
  21. package/coverage/sorter.js +196 -0
  22. package/coverage/updateArrayWithDefault.js.html +196 -0
  23. package/docs/CSSCustomPluginsDocumentation.md +71 -0
  24. package/docs/CustomChunksConfiguration.md +0 -0
  25. package/docs/EFCFileTemplate.md +0 -0
  26. package/docs/MockApi.md +61 -0
  27. package/docs/NameTemplateUtility.md +93 -0
  28. package/docs/ServiseWorkerTemplate.md +0 -0
  29. package/docs/SupportedBrowserVersions.md +61 -0
  30. package/helpDocs/check.js +7 -0
  31. package/helpDocs/commmands/build.md +0 -0
  32. package/helpDocs/commmands/start.md +0 -0
  33. package/helpDocs/examples/buildWithContentHash.md +0 -0
  34. package/helpDocs/examples/startDevServer.md +0 -0
  35. package/helpDocs/examples/startWithMockAPI.md +0 -0
  36. package/helpDocs/node18-env.md +30 -0
  37. package/helpDocs/troubleshootings/NewMachineSetup.md +71 -0
  38. package/helpDocs/troubleshootings/README.md +9 -0
  39. package/helpDocs/troubleshootings/hg_install.sh +18 -0
  40. package/helpDocs/troubleshootings/newMachineMac.sh +86 -0
  41. package/helpDocs/troubleshootings/newMachineUbundu.bash +84 -0
  42. package/lib/allCommandsConfigs.js +25 -0
  43. package/lib/commands/build/commandExecutor.js +17 -0
  44. package/lib/commands/build/config.js +12 -0
  45. package/lib/commands/build/errorHander.js +10 -0
  46. package/lib/commands/build/optionsProcessor.js +35 -0
  47. package/lib/commands/buildEs/commandExecutor.js +33 -0
  48. package/lib/commands/buildEs/config.js +12 -0
  49. package/lib/commands/buildLib/commandExecutor.js +33 -0
  50. package/lib/commands/buildLib/config.js +12 -0
  51. package/lib/commands/mockserver/commandExecutor.js +43 -0
  52. package/lib/commands/mockserver/config.js +12 -0
  53. package/lib/commands/start/commandExecutor.js +12 -0
  54. package/lib/commands/start/config.js +12 -0
  55. package/lib/commands/start/deprecationHandler.js +10 -0
  56. package/lib/commands/start/errorHander.js +10 -0
  57. package/lib/commands/start/optionsProcessor.js +30 -0
  58. package/lib/commands/start/postProcessor.js +10 -0
  59. package/lib/commands/start/preProcessor.js +10 -0
  60. package/lib/commands/template/commandExecutor.js +28 -0
  61. package/lib/commands/template/config.js +12 -0
  62. package/lib/commands/version/commandExecutor.js +14 -0
  63. package/lib/commands/version/config.js +12 -0
  64. package/lib/commands/version/errorHander.js +10 -0
  65. package/lib/commandsRouter.js +74 -0
  66. package/lib/index.js +12 -0
  67. package/lib/logger.js +34 -0
  68. package/lib/schemas/applyValuesToSchema/index.js +34 -0
  69. package/lib/schemas/applyValuesToSchema/isObject.js +10 -0
  70. package/lib/schemas/applyValuesToSchema/isValid.js +14 -0
  71. package/lib/schemas/cliArgsToObject.js +39 -0
  72. package/lib/schemas/defaultConfigValues.js +276 -0
  73. package/lib/schemas/defaultConfigValuesOnly.js +161 -0
  74. package/lib/schemas/deprecatedOptionsHandler.js +67 -0
  75. package/lib/schemas/getNpmVersion.js +22 -0
  76. package/lib/schemas/giveDefaultValue.js +18 -0
  77. package/lib/schemas/npmConfigToObject.js +35 -0
  78. package/lib/schemas/readOptions.js +54 -0
  79. package/lib/schemas/readOptionsForConfigFile.js +42 -0
  80. package/lib/shared/babel/babelWebConfig.js +51 -0
  81. package/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +23 -0
  82. package/lib/shared/babel/defaultBabelPlugins.js +26 -0
  83. package/lib/shared/babel/runBabelForJSFile.js +24 -0
  84. package/lib/shared/bundler/webpack/common/decidePublicPath.js +52 -0
  85. package/lib/shared/bundler/webpack/common/libAlias.js +31 -0
  86. package/lib/shared/bundler/webpack/common/modeUtils.js +31 -0
  87. package/lib/shared/bundler/webpack/common/nameTemplates.js +78 -0
  88. package/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +21 -0
  89. package/lib/shared/bundler/webpack/configCustomLoaders.js +10 -0
  90. package/lib/shared/bundler/webpack/cssLoaders.js +16 -0
  91. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +95 -0
  92. package/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +112 -0
  93. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +11 -0
  94. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +172 -0
  95. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +76 -0
  96. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +203 -0
  97. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +95 -0
  98. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +73 -0
  99. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +88 -0
  100. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +25 -0
  101. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +29 -0
  102. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +24 -0
  103. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +76 -0
  104. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +39 -0
  105. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +50 -0
  106. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +68 -0
  107. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +23 -0
  108. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +29 -0
  109. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +43 -0
  110. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +77 -0
  111. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +66 -0
  112. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +13 -0
  113. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +19 -0
  114. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +31 -0
  115. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +129 -0
  116. package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +54 -0
  117. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +24 -0
  118. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +17 -0
  119. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +35 -0
  120. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +18 -0
  121. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +44 -0
  122. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +18 -0
  123. package/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +1 -0
  124. package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +191 -0
  125. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +62 -0
  126. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +84 -0
  127. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +34 -0
  128. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +27 -0
  129. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +20 -0
  130. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +78 -0
  131. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +51 -0
  132. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +16 -0
  133. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +110 -0
  134. package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +38 -0
  135. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +22 -0
  136. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +55 -0
  137. package/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +49 -0
  138. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +62 -0
  139. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +362 -0
  140. package/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +14 -0
  141. package/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +57 -0
  142. package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +87 -0
  143. package/lib/shared/bundler/webpack/defaultVendorPatternList.js +13 -0
  144. package/lib/shared/bundler/webpack/entryConfig.js +28 -0
  145. package/lib/shared/bundler/webpack/externals.js +13 -0
  146. package/lib/shared/bundler/webpack/getCSSLoaders.js +27 -0
  147. package/lib/shared/bundler/webpack/getFilenameFromModule.js +24 -0
  148. package/lib/shared/bundler/webpack/getSourceMapType.js +10 -0
  149. package/lib/shared/bundler/webpack/jsLoaders.js +17 -0
  150. package/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +12 -0
  151. package/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +18 -0
  152. package/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +56 -0
  153. package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +18 -0
  154. package/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +37 -0
  155. package/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +21 -0
  156. package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +138 -0
  157. package/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +60 -0
  158. package/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +21 -0
  159. package/lib/shared/bundler/webpack/loaders/workerLoader.js +133 -0
  160. package/lib/shared/bundler/webpack/optimizationConfig.js +43 -0
  161. package/lib/shared/bundler/webpack/outputConfig.js +28 -0
  162. package/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +40 -0
  163. package/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +24 -0
  164. package/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +27 -0
  165. package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +63 -0
  166. package/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +46 -0
  167. package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +36 -0
  168. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +56 -0
  169. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +41 -0
  170. package/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +16 -0
  171. package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +32 -0
  172. package/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +23 -0
  173. package/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +24 -0
  174. package/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +21 -0
  175. package/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +27 -0
  176. package/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +28 -0
  177. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +40 -0
  178. package/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +20 -0
  179. package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +32 -0
  180. package/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +25 -0
  181. package/lib/shared/bundler/webpack/plugins.js +50 -0
  182. package/lib/shared/bundler/webpack/resolvers.js +81 -0
  183. package/lib/shared/bundler/webpack/splitChunksConfig.js +113 -0
  184. package/lib/shared/bundler/webpack/statsConfig.js +21 -0
  185. package/lib/shared/bundler/webpack/utils/index.js +26 -0
  186. package/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +34 -0
  187. package/lib/shared/bundler/webpack/webpackBuild.js +27 -0
  188. package/lib/shared/bundler/webpack/webpackConfig.js +56 -0
  189. package/lib/shared/commands-utils/doBasicRequirementCheck.js +17 -0
  190. package/lib/shared/commands-utils/getCliPath.js +39 -0
  191. package/lib/shared/commands-utils/index.js +29 -0
  192. package/lib/shared/commands-utils/log.js +13 -0
  193. package/lib/shared/commands-utils/readArgsFormCommandLine.js +11 -0
  194. package/lib/shared/commands-utils/readOptionFormCommandLine.js +11 -0
  195. package/lib/shared/commands-utils/spawnSyncIO.js +38 -0
  196. package/lib/shared/constants.js +45 -0
  197. package/lib/shared/fileUtils/copyFile.js +38 -0
  198. package/lib/shared/fileUtils/directoryIterator.js +21 -0
  199. package/lib/shared/fileUtils/watchRun.js +100 -0
  200. package/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +21 -0
  201. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +10 -0
  202. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +66 -0
  203. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +136 -0
  204. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +32 -0
  205. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +20 -0
  206. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +20 -0
  207. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +24 -0
  208. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +43 -0
  209. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +52 -0
  210. package/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +139 -0
  211. package/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +90 -0
  212. package/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +57 -0
  213. package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +343 -0
  214. package/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +55 -0
  215. package/lib/shared/postcss/getAllowedPostCssPlugins.js +30 -0
  216. package/lib/shared/postcss/getSpecificPostCssPlugin.js +58 -0
  217. package/lib/shared/postcss/runPostCssForCssFile.js +37 -0
  218. package/lib/shared/server/configWebpackDevMiddleware.js +41 -0
  219. package/lib/shared/server/corsHandling.js +21 -0
  220. package/lib/shared/server/getIp.js +30 -0
  221. package/lib/shared/server/getServerURL.js +29 -0
  222. package/lib/shared/server/httpsOptions.js +46 -0
  223. package/lib/shared/server/initExpressApp.js +19 -0
  224. package/lib/shared/server/initialHTMLHandling.js +99 -0
  225. package/lib/shared/server/mockApiHandler.js +60 -0
  226. package/lib/shared/server/mockServer.js +41 -0
  227. package/lib/shared/server/serveContextFiles.js +27 -0
  228. package/lib/shared/server/serverBywebpackDevMiddleware.js +35 -0
  229. package/lib/shared/server/startHttpServer.js +26 -0
  230. package/lib/shared/server/startHttpsServer.js +38 -0
  231. package/lib/shared/server/unwanted/addHttp2Server.js +41 -0
  232. package/lib/shared/server/unwanted/configWebpackDevMiddleware.js +44 -0
  233. package/lib/shared/server/unwanted/mockApiSupport.js +19 -0
  234. package/lib/shared/server/unwanted/websocketMockSetup.js +48 -0
  235. package/lib/shared/server/urlConcat.js +32 -0
  236. package/lib/shared/utils/requireLocalOrGlobal.js +81 -0
  237. package/lib/shared/utils/utils.js +1 -0
  238. package/lib/shared/utils/versionPrint.js +20 -0
  239. package/npm-shrinkwrap.json +14102 -0
  240. package/package.json +54 -0
  241. package/polyfillForOldNodeVersion.js +10 -0
  242. package/result.json +1 -0
  243. package/templates/app/README.MD +30 -0
  244. package/templates/app/package.json +12 -0
  245. package/templates/library/README.MD +28 -0
  246. package/templates/library/package.json +11 -0
  247. package/templates/wms/index.html +43 -0
  248. package/unittest/index.html +37 -0
@@ -0,0 +1,196 @@
1
+ /* eslint-disable */
2
+ var addSorting = (function() {
3
+ 'use strict';
4
+ var cols,
5
+ currentSort = {
6
+ index: 0,
7
+ desc: false
8
+ };
9
+
10
+ // returns the summary table element
11
+ function getTable() {
12
+ return document.querySelector('.coverage-summary');
13
+ }
14
+ // returns the thead element of the summary table
15
+ function getTableHeader() {
16
+ return getTable().querySelector('thead tr');
17
+ }
18
+ // returns the tbody element of the summary table
19
+ function getTableBody() {
20
+ return getTable().querySelector('tbody');
21
+ }
22
+ // returns the th element for nth column
23
+ function getNthColumn(n) {
24
+ return getTableHeader().querySelectorAll('th')[n];
25
+ }
26
+
27
+ function onFilterInput() {
28
+ const searchValue = document.getElementById('fileSearch').value;
29
+ const rows = document.getElementsByTagName('tbody')[0].children;
30
+ for (let i = 0; i < rows.length; i++) {
31
+ const row = rows[i];
32
+ if (
33
+ row.textContent
34
+ .toLowerCase()
35
+ .includes(searchValue.toLowerCase())
36
+ ) {
37
+ row.style.display = '';
38
+ } else {
39
+ row.style.display = 'none';
40
+ }
41
+ }
42
+ }
43
+
44
+ // loads the search box
45
+ function addSearchBox() {
46
+ var template = document.getElementById('filterTemplate');
47
+ var templateClone = template.content.cloneNode(true);
48
+ templateClone.getElementById('fileSearch').oninput = onFilterInput;
49
+ template.parentElement.appendChild(templateClone);
50
+ }
51
+
52
+ // loads all columns
53
+ function loadColumns() {
54
+ var colNodes = getTableHeader().querySelectorAll('th'),
55
+ colNode,
56
+ cols = [],
57
+ col,
58
+ i;
59
+
60
+ for (i = 0; i < colNodes.length; i += 1) {
61
+ colNode = colNodes[i];
62
+ col = {
63
+ key: colNode.getAttribute('data-col'),
64
+ sortable: !colNode.getAttribute('data-nosort'),
65
+ type: colNode.getAttribute('data-type') || 'string'
66
+ };
67
+ cols.push(col);
68
+ if (col.sortable) {
69
+ col.defaultDescSort = col.type === 'number';
70
+ colNode.innerHTML =
71
+ colNode.innerHTML + '<span class="sorter"></span>';
72
+ }
73
+ }
74
+ return cols;
75
+ }
76
+ // attaches a data attribute to every tr element with an object
77
+ // of data values keyed by column name
78
+ function loadRowData(tableRow) {
79
+ var tableCols = tableRow.querySelectorAll('td'),
80
+ colNode,
81
+ col,
82
+ data = {},
83
+ i,
84
+ val;
85
+ for (i = 0; i < tableCols.length; i += 1) {
86
+ colNode = tableCols[i];
87
+ col = cols[i];
88
+ val = colNode.getAttribute('data-value');
89
+ if (col.type === 'number') {
90
+ val = Number(val);
91
+ }
92
+ data[col.key] = val;
93
+ }
94
+ return data;
95
+ }
96
+ // loads all row data
97
+ function loadData() {
98
+ var rows = getTableBody().querySelectorAll('tr'),
99
+ i;
100
+
101
+ for (i = 0; i < rows.length; i += 1) {
102
+ rows[i].data = loadRowData(rows[i]);
103
+ }
104
+ }
105
+ // sorts the table using the data for the ith column
106
+ function sortByIndex(index, desc) {
107
+ var key = cols[index].key,
108
+ sorter = function(a, b) {
109
+ a = a.data[key];
110
+ b = b.data[key];
111
+ return a < b ? -1 : a > b ? 1 : 0;
112
+ },
113
+ finalSorter = sorter,
114
+ tableBody = document.querySelector('.coverage-summary tbody'),
115
+ rowNodes = tableBody.querySelectorAll('tr'),
116
+ rows = [],
117
+ i;
118
+
119
+ if (desc) {
120
+ finalSorter = function(a, b) {
121
+ return -1 * sorter(a, b);
122
+ };
123
+ }
124
+
125
+ for (i = 0; i < rowNodes.length; i += 1) {
126
+ rows.push(rowNodes[i]);
127
+ tableBody.removeChild(rowNodes[i]);
128
+ }
129
+
130
+ rows.sort(finalSorter);
131
+
132
+ for (i = 0; i < rows.length; i += 1) {
133
+ tableBody.appendChild(rows[i]);
134
+ }
135
+ }
136
+ // removes sort indicators for current column being sorted
137
+ function removeSortIndicators() {
138
+ var col = getNthColumn(currentSort.index),
139
+ cls = col.className;
140
+
141
+ cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
142
+ col.className = cls;
143
+ }
144
+ // adds sort indicators for current column being sorted
145
+ function addSortIndicators() {
146
+ getNthColumn(currentSort.index).className += currentSort.desc
147
+ ? ' sorted-desc'
148
+ : ' sorted';
149
+ }
150
+ // adds event listeners for all sorter widgets
151
+ function enableUI() {
152
+ var i,
153
+ el,
154
+ ithSorter = function ithSorter(i) {
155
+ var col = cols[i];
156
+
157
+ return function() {
158
+ var desc = col.defaultDescSort;
159
+
160
+ if (currentSort.index === i) {
161
+ desc = !currentSort.desc;
162
+ }
163
+ sortByIndex(i, desc);
164
+ removeSortIndicators();
165
+ currentSort.index = i;
166
+ currentSort.desc = desc;
167
+ addSortIndicators();
168
+ };
169
+ };
170
+ for (i = 0; i < cols.length; i += 1) {
171
+ if (cols[i].sortable) {
172
+ // add the click event handler on the th so users
173
+ // dont have to click on those tiny arrows
174
+ el = getNthColumn(i).querySelector('.sorter').parentElement;
175
+ if (el.addEventListener) {
176
+ el.addEventListener('click', ithSorter(i));
177
+ } else {
178
+ el.attachEvent('onclick', ithSorter(i));
179
+ }
180
+ }
181
+ }
182
+ }
183
+ // adds sorting functionality to the UI
184
+ return function() {
185
+ if (!getTable()) {
186
+ return;
187
+ }
188
+ cols = loadColumns();
189
+ loadData();
190
+ addSearchBox();
191
+ addSortIndicators();
192
+ enableUI();
193
+ };
194
+ })();
195
+
196
+ window.addEventListener('load', addSorting);
@@ -0,0 +1,196 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for updateArrayWithDefault.js</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="prettify.css" />
9
+ <link rel="stylesheet" href="base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="index.html">All files</a> updateArrayWithDefault.js</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">52.94% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>9/17</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">14.28% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>1/7</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">60% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>3/5</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">53.33% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>8/15</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line medium'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a>
78
+ <a name='L13'></a><a href='#L13'>13</a>
79
+ <a name='L14'></a><a href='#L14'>14</a>
80
+ <a name='L15'></a><a href='#L15'>15</a>
81
+ <a name='L16'></a><a href='#L16'>16</a>
82
+ <a name='L17'></a><a href='#L17'>17</a>
83
+ <a name='L18'></a><a href='#L18'>18</a>
84
+ <a name='L19'></a><a href='#L19'>19</a>
85
+ <a name='L20'></a><a href='#L20'>20</a>
86
+ <a name='L21'></a><a href='#L21'>21</a>
87
+ <a name='L22'></a><a href='#L22'>22</a>
88
+ <a name='L23'></a><a href='#L23'>23</a>
89
+ <a name='L24'></a><a href='#L24'>24</a>
90
+ <a name='L25'></a><a href='#L25'>25</a>
91
+ <a name='L26'></a><a href='#L26'>26</a>
92
+ <a name='L27'></a><a href='#L27'>27</a>
93
+ <a name='L28'></a><a href='#L28'>28</a>
94
+ <a name='L29'></a><a href='#L29'>29</a>
95
+ <a name='L30'></a><a href='#L30'>30</a>
96
+ <a name='L31'></a><a href='#L31'>31</a>
97
+ <a name='L32'></a><a href='#L32'>32</a>
98
+ <a name='L33'></a><a href='#L33'>33</a>
99
+ <a name='L34'></a><a href='#L34'>34</a>
100
+ <a name='L35'></a><a href='#L35'>35</a>
101
+ <a name='L36'></a><a href='#L36'>36</a>
102
+ <a name='L37'></a><a href='#L37'>37</a>
103
+ <a name='L38'></a><a href='#L38'>38</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
104
+ <span class="cline-any cline-no">&nbsp;</span>
105
+ <span class="cline-any cline-neutral">&nbsp;</span>
106
+ <span class="cline-any cline-no">&nbsp;</span>
107
+ <span class="cline-any cline-no">&nbsp;</span>
108
+ <span class="cline-any cline-neutral">&nbsp;</span>
109
+ <span class="cline-any cline-no">&nbsp;</span>
110
+ <span class="cline-any cline-no">&nbsp;</span>
111
+ <span class="cline-any cline-no">&nbsp;</span>
112
+ <span class="cline-any cline-neutral">&nbsp;</span>
113
+ <span class="cline-any cline-neutral">&nbsp;</span>
114
+ <span class="cline-any cline-yes">1x</span>
115
+ <span class="cline-any cline-neutral">&nbsp;</span>
116
+ <span class="cline-any cline-neutral">&nbsp;</span>
117
+ <span class="cline-any cline-neutral">&nbsp;</span>
118
+ <span class="cline-any cline-neutral">&nbsp;</span>
119
+ <span class="cline-any cline-neutral">&nbsp;</span>
120
+ <span class="cline-any cline-neutral">&nbsp;</span>
121
+ <span class="cline-any cline-yes">8x</span>
122
+ <span class="cline-any cline-neutral">&nbsp;</span>
123
+ <span class="cline-any cline-yes">8x</span>
124
+ <span class="cline-any cline-no">&nbsp;</span>
125
+ <span class="cline-any cline-neutral">&nbsp;</span>
126
+ <span class="cline-any cline-neutral">&nbsp;</span>
127
+ <span class="cline-any cline-yes">8x</span>
128
+ <span class="cline-any cline-yes">95x</span>
129
+ <span class="cline-any cline-neutral">&nbsp;</span>
130
+ <span class="cline-any cline-neutral">&nbsp;</span>
131
+ <span class="cline-any cline-neutral">&nbsp;</span>
132
+ <span class="cline-any cline-neutral">&nbsp;</span>
133
+ <span class="cline-any cline-neutral">&nbsp;</span>
134
+ <span class="cline-any cline-neutral">&nbsp;</span>
135
+ <span class="cline-any cline-neutral">&nbsp;</span>
136
+ <span class="cline-any cline-yes">8x</span>
137
+ <span class="cline-any cline-yes">8x</span>
138
+ <span class="cline-any cline-yes">8x</span>
139
+ <span class="cline-any cline-neutral">&nbsp;</span>
140
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export function <span class="fstat-no" title="function not covered" >updateArrayWithDefault(</span>array, defaultoptions = <span class="branch-0 cbranch-no" title="branch not covered" >[])</span> {
141
+ const index = <span class="cstat-no" title="statement not covered" >array.indexOf('...');</span>
142
+ &nbsp;
143
+ <span class="cstat-no" title="statement not covered" > if (index === -1) {</span>
144
+ <span class="cstat-no" title="statement not covered" > return array;</span>
145
+ }
146
+ const newArray = <span class="cstat-no" title="statement not covered" >[...array];</span>
147
+ <span class="cstat-no" title="statement not covered" > newArray.splice(index, 1, ...defaultoptions);</span>
148
+ <span class="cstat-no" title="statement not covered" > return newArray;</span>
149
+ }
150
+ &nbsp;
151
+ const isEqualVal = <span class="fstat-no" title="function not covered" >(a</span>, b) =&gt; <span class="cstat-no" title="statement not covered" >a === b;</span>
152
+ &nbsp;
153
+ export function getArrayWithDefault(
154
+ array,
155
+ defaultoptions = <span class="branch-0 cbranch-no" title="branch not covered" >[],</span>
156
+ isEqual = <span class="branch-0 cbranch-no" title="branch not covered" >isEqualVal</span>
157
+ ) {
158
+ const index = array.indexOf('...');
159
+ &nbsp;
160
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (index === -1) {
161
+ <span class="cstat-no" title="statement not covered" > return array;</span>
162
+ }
163
+ // console.log(isEqual, array, defaultoptions);
164
+ const filteredDefaultOptions = defaultoptions.filter(
165
+ v =&gt; !array.some(v1 =&gt; isEqual(v, v1))
166
+ // v =&gt; !array.some(v1 =&gt; {
167
+ // let c = isEqual(v, v1)
168
+ // console.log(` v=${v} v1=${v1} ==${c}`);
169
+ // return c
170
+ // })
171
+ );
172
+ &nbsp;
173
+ const newArray = [...array];
174
+ newArray.splice(index, 1, ...filteredDefaultOptions);
175
+ return newArray;
176
+ }
177
+ &nbsp;</pre></td></tr></table></pre>
178
+
179
+ <div class='push'></div><!-- for sticky footer -->
180
+ </div><!-- /wrapper -->
181
+ <div class='footer quiet pad2 space-top1 center small'>
182
+ Code coverage generated by
183
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
184
+ at 2023-08-08T10:31:57.089Z
185
+ </div>
186
+ <script src="prettify.js"></script>
187
+ <script>
188
+ window.onload = function () {
189
+ prettyPrint();
190
+ };
191
+ </script>
192
+ <script src="sorter.js"></script>
193
+ <script src="block-navigation.js"></script>
194
+ </body>
195
+ </html>
196
+
@@ -0,0 +1,71 @@
1
+ ## CSS Custom Plugins Documentation
2
+
3
+ The following documentation provides an overview of the CSS custom plugins available in the Client Build Tool (CBT) configuration. These plugins allow you to extend the functionality of PostCSS, a powerful tool for transforming CSS using JavaScript plugins. Each plugin can be customized based on your specific requirements. Here are the available CSS custom plugins:
4
+
5
+ ### rtlSplit
6
+
7
+ - **enableRTLSplit** (boolean): Specifies whether to enable Right-to-Left (RTL) splitting. When enabled, this plugin generates separate CSS files for RTL layouts. The default value is `false`.
8
+
9
+ - **templateLabel** (string): Specifies the template label used for RTL splitting. The default value is `'{{--dir}}'`.
10
+
11
+ - **disableMinifySelector** (boolean): Specifies whether to disable minification of CSS selectors during RTL splitting. The default value is `false`.
12
+
13
+ - **dirVarName** (string): Specifies the variable name used to store the direction (LTR or RTL). The default value is `'document.dir'`.
14
+
15
+ ### selectorWeight
16
+
17
+ - **enable** (boolean): Specifies whether to enable the selector weight plugin. When enabled, this plugin calculates the weight of CSS selectors based on specificity. The default value is `false`.
18
+
19
+ - **patterns** (array): Specifies an array of file patterns to apply the selector weight plugin. The default value is an empty array.
20
+
21
+ - **configFile** (null): Specifies the configuration file for the selector weight plugin. The default value is `null`.
22
+
23
+ - **defaultSelector** (string): Specifies the default selector used by the selector weight plugin. The default value is an empty string.
24
+
25
+ - **customFileDetails** (string): Specifies custom file details for the selector weight plugin. The default value is an empty string.
26
+
27
+ - **excludeStrings** (array): Specifies an array of strings to exclude from the selector weight calculations. The default value is an empty array.
28
+
29
+ ### valueReplacer
30
+
31
+ - **enable** (boolean): Specifies whether to enable the value replacer plugin. When enabled, this plugin replaces values in CSS properties based on specified patterns. The default value is `false`.
32
+
33
+ - **patterns** (array): Specifies an array of patterns to match CSS property values for replacement. The default value is an empty array.
34
+
35
+ - **config** (array): Specifies an array of configuration options for the value replacer plugin. The default value is an empty array.
36
+
37
+ ### selectorReplace
38
+
39
+ - **enable** (boolean): Specifies whether to enable the selector replace plugin. When enabled, this plugin replaces CSS selectors based on specified patterns. The default value is `false`.
40
+
41
+ - **patterns** (array): Specifies an array of patterns to match CSS selectors for replacement. The default value is an empty array.
42
+
43
+ - **before** (array): Specifies an array of strings or regular expressions to match selector patterns that should be replaced before the main replacement. The default value is an empty array.
44
+
45
+ - **after** (array): Specifies an array of strings or regular expressions to match selector patterns that should be replaced after the main replacement. The default value is an empty array.
46
+
47
+ ### hoverActive
48
+
49
+ - **enable** (boolean): Specifies whether to enable the hover and active plugin. When enabled, this plugin generates CSS for hover and active states based on specified patterns. The default value is `false`.
50
+
51
+ - **patterns** (array): Specifies an array of patterns to match CSS selectors for generating hover and active states. The default value is an empty array.
52
+
53
+ - **hover** (string): Specifies the CSS pseudo-class for the hover state. The default value is `'(hover: hover)'`.
54
+
55
+ - **active** (string): Specifies the CSS pseudo-class for the active state. The default value is `'(hover: none)'`.
56
+
57
+ ### cssVariableReplacement
58
+
59
+ - **enable** (boolean): Specifies whether to enable the CSS variable replacement plugin. When enabled, this plugin replaces CSS variables based on specified patterns. The default value is `false`.
60
+
61
+ - **patterns** (array): Specifies an array of patterns to match CSS variable names for replacement. The default value is an empty array.
62
+
63
+ - **configFile** (null): Specifies the configuration file for the CSS variable replacement plugin. The default value is `null`.
64
+
65
+ ### rtl
66
+
67
+ - **enable** (boolean): Specifies whether to enable the RTL plugin. When enabled, this plugin generates RTL-specific CSS based on specified patterns. The default value is `false`.
68
+
69
+ - **patterns** (array): Specifies an array of patterns to match CSS selectors for RTL transformation. The default value is an empty array.
70
+
71
+ These custom plugins provide additional functionality and customization options for transforming CSS during the build process. You can enable or disable each plugin as needed and configure them according to your project's requirements.
File without changes
File without changes
@@ -0,0 +1,61 @@
1
+ # Mock Api
2
+
3
+ ## Explanation:-
4
+
5
+ This api is for run mock api.
6
+ The reason for this feature is we usually run dev server as just to server react page not for api request.
7
+ So when we need Mock Api or api request related this not on server (some java server).
8
+ But do it in node js, this api.
9
+
10
+ ## Ways to use Mock api
11
+
12
+ There is two ways to run mock api.
13
+
14
+ 1. Run mock api with dev server
15
+ 2. Run mock api separate from dev server but api can be called through dev server.
16
+
17
+ ### Run mock api with dev server
18
+
19
+ In this way of running you do not need to run extra you do not have to run separate command.
20
+ But every change you do in mock api you need to stop and restart.
21
+
22
+ To run this you have to enable mock server and just un dev server as usual `cbt start`
23
+
24
+ ### Run mock api separate from dev server
25
+
26
+ This api is for run mock api in separate nodemon.
27
+
28
+ So to run this you have to enable mock api and run `cbt mock:server`.
29
+
30
+ ## Configuration
31
+
32
+ To config this mock api
33
+ you can need to add `mockServer` key in **cbt.config.js** or **package.json** file (`client-build-config` or `react-cli`) ==> `mockServer`
34
+
35
+ | option | type | default |
36
+ | :---------------: | :-----: | :--------------: |
37
+ | enable | Boolean | false |
38
+ | separateSeverPort | Number | null |
39
+ | disableNodemon | Boolean | false |
40
+ | mockEntryFile | String | mockapi/index.js |
41
+ | mockPrefix | String | /api/ |
42
+
43
+ ### **enable**:
44
+
45
+ Specifies whether the application's mocking functionality is enabled or disabled. When set to `true`, the application will use the mock server. When set to `false`, the mock server will be disabled. By default, the value is set to `false`.
46
+
47
+ ### **separateSeverPort**:
48
+
49
+ Specifies the port to be used by the mock server. If the `enable` option is set to `true`, the application will use this port to run the mock server. This configuration parameter should be set to a valid port number. In this case, the port number is set to `8080`.
50
+
51
+ ### **disableNodemon**:
52
+
53
+ Specifies whether nodemon, a utility that automatically restarts the application upon file changes, should be disabled. When set to `true`, nodemon will be disabled. When set to `false`, nodemon will remain enabled. By default, the value is set to `false`.
54
+
55
+ ### **mockEntryFile**:
56
+
57
+ Specifies the entry file for the mock server. This file is the starting point for the mock server's execution. The value should be a string representing the file path. In this case, the entry file is set to `mockapi/index.js`.
58
+
59
+ ### **mockPrefix**:
60
+
61
+ Specifies the URL prefix for the mock server's API endpoints. The value should be a string representing the desired prefix. In this case, the prefix is set to `/api/`.
@@ -0,0 +1,93 @@
1
+ ## Name Template Utility Documentation
2
+
3
+ The provided code snippet represents a utility module for generating name templates used in the build process of the Client Build Tool (CBT). The module contains functions for creating name templates and determining whether a file is an internationalization file. Let's document the different parts of the code:
4
+
5
+ ### Import Statements
6
+
7
+ ```javascript
8
+ import { isDevelopmentMode, isProductionMode } from './modeUtils';
9
+ ```
10
+
11
+ This import statement brings in the `isDevelopmentMode` and `isProductionMode` functions from the `modeUtils` module.
12
+
13
+ ### Templates Object
14
+
15
+ The `templates` object represents a collection of different name templates used for various types of files during the build process. Each key-value pair in the object represents a file type and its corresponding name templates.
16
+
17
+ ### createNameTemplate Function
18
+
19
+ The `createNameTemplate` function is used to generate a name template for a specific file type based on whether a hash should be included in the file name. It takes in the `name` and `useHash` parameters and returns the appropriate name template based on the `useHash` value.
20
+
21
+ ### nameTemplates Function
22
+
23
+ The `nameTemplates` function is a utility function that determines the name template for a specified file type based on the provided options. It takes in the `type` and `options` parameters and returns the corresponding name template.
24
+
25
+ ### isI18nFile Function
26
+
27
+ The `isI18nFile` function is a utility function that checks whether a given URL represents an internationalization file. It takes in the `url` parameter and returns `true` if the URL ends with `.i18n.js`, indicating it is an internationalization file.
28
+
29
+ ### Export Statements
30
+
31
+ The module exports the `nameTemplates` function, allowing it to be used in other parts of the build process. The `isI18nFile` function is not exported and is intended for internal use within the module.
32
+
33
+ By using these utility functions, you can generate name templates for different types of files during the build process. These name templates play a crucial role in determining the output file names and paths, enabling effective asset management and caching strategies.
34
+
35
+ Please note that the provided code snippet represents a partial implementation, and there may be additional code or dependencies required for the utility module to function correctly within the overall CBT system.
36
+
37
+ ## File Templates Configuration Documentation
38
+
39
+ The `templates` object in the provided code represents a collection of file templates used in the build process of the Client Build Tool (CBT). The object contains various file types as keys, and each key holds an array of file templates for development and production modes. Here is the documentation for the file templates:
40
+
41
+ ```javascript
42
+ const templates = {
43
+ html: ['index.html', 'index.[contenthash].html'],
44
+ js: ['js/[name].js', 'js/[name].[contenthash].js'],
45
+ chunkjs: ['js-chunks/[name].js', 'js-chunks/[name].[contenthash].js'],
46
+ i18njs: [
47
+ 'i18n-chunks/[locale]/[name].i18n.js',
48
+ 'i18n-chunks/[locale]/[name].[chunkhash].i18n.js'
49
+ ],
50
+ i18nchunkjs: [
51
+ 'i18n-chunks/[locale]/[name].i18n.js',
52
+ // 'i18n-chunks/[locale]/[name].[chunkhash].i18n.js'
53
+ 'i18n-chunks/[locale]/[name].[contenthash].i18n.js'
54
+ ],
55
+ i18nmanifest: ['i18n-manifest.json', 'i18n-manifest.json'],
56
+ workerjs: ['js/[name].js', 'js/[name].[contenthash].js'],
57
+ css: ['css/[name].css', 'css/[name].[contenthash].css'],
58
+ cssdir: ['css/[name].[dir].css', 'css/[name].[contenthash].[dir].css'],
59
+ image: ['images/[name][ext]', 'images/[name].[contenthash][ext]'],
60
+ font: ['fonts/[name][ext]', 'fonts/[name].[contenthash][ext]'],
61
+ svg: ['fonts/[name][ext]', 'fonts/[name].[contenthash][ext]'],
62
+ audio: ['fonts/[name][ext]', 'fonts/[name].[contenthash][ext]'],
63
+ video: ['videos/[name][ext]', 'videos/[name].[contenthash][ext]']
64
+ };
65
+ ```
66
+
67
+ The `templates` object contains file templates for various types of assets used in the build process. Each key-value pair represents a file type and its corresponding file templates.
68
+
69
+ Here are some key points regarding the file templates:
70
+
71
+ - **html**: Contains file templates for HTML files. The development mode template is `'index.html'`, and the production mode template includes a `[contenthash]` placeholder, resulting in `'index.[contenthash].html'`.
72
+
73
+ - **js**: Contains file templates for JavaScript files. The development mode template is `'js/[name].js'`, where `[name]` is replaced by the actual name of the JavaScript file. The production mode template includes a `[contenthash]` placeholder, resulting in `'js/[name].[contenthash].js'`.
74
+
75
+ - **chunkjs**: Contains file templates for chunk JavaScript files. The templates follow a similar pattern to the `js` templates.
76
+
77
+ - **i18njs**: Contains file templates for internationalization JavaScript files. The templates include a `[locale]` placeholder, representing the locale, and a `[chunkhash]` placeholder in the production mode template.
78
+
79
+ - **i18nchunkjs**: Contains alternative file templates for internationalization JavaScript files. The production mode template uses a `[contenthash]` placeholder instead of `[chunkhash]`.
80
+
81
+ - **i18nmanifest**: Contains file templates for the internationalization manifest file. The same template is used for both development and production modes.
82
+
83
+ - **workerjs**: Contains file templates for worker JavaScript files. The templates follow a similar pattern to the `js` templates.
84
+
85
+ - **css**: Contains file templates for CSS files. The templates follow a similar pattern to the `js` templates.
86
+
87
+ - **cssdir**: Contains file templates for CSS files with directory placeholders. The templates include a `[dir]` placeholder in the file name. Changing this line may affect other files and plugins in the build process.
88
+
89
+ - **image**, **font**, **svg**, **audio**, **video**: Contains file templates for different types of static assets. The templates follow specific patterns based on the file extensions and include placeholders like `[name]`, `[contenthash]`, and `[ext]` to generate dynamic file names.
90
+
91
+ These file templates are used by the build process to determine the output file names and paths for different assets. They allow for effective asset management and caching strategies during development and production modes.
92
+
93
+ Please note that the provided code snippet represents a partial implementation, and there may be additional code or dependencies required to fully utilize the file templates within the overall CBT system.
File without changes