@zohodesk/react-cli 0.0.1-exp.175.1 → 0.0.1-exp.176.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -180
  3. package/.prettierrc +6 -6
  4. package/README.md +1025 -1028
  5. package/bin/cli.js +482 -482
  6. package/cert/Tsicsezwild-22-23.crt +37 -37
  7. package/cert/Tsicsezwild-22-23.key +27 -27
  8. package/docs/CustomChunks.md +26 -26
  9. package/docs/DevStart.md +18 -18
  10. package/docs/HoverActive.md +12 -12
  11. package/docs/InstallNode.md +28 -28
  12. package/docs/SelectorWeight.md +6 -0
  13. package/docs/TODOS.md +10 -10
  14. package/docs/ValueReplacer.md +60 -60
  15. package/docs/VariableConversion.md +719 -678
  16. package/docs/warnings_while_install.txt +35 -35
  17. package/files/eslintrc.js +62 -62
  18. package/files/prettierrc.js +3 -3
  19. package/lib/babel/cmjs-plugins-presets.js +4 -0
  20. package/lib/babel/es-plugins-presets.js +4 -0
  21. package/lib/common/getEntries.js +10 -0
  22. package/lib/common/getPublicPathConfig.js +6 -0
  23. package/lib/common/index.js +5 -0
  24. package/lib/common/splitChunks.js +13 -2
  25. package/lib/common/sslcertUpdater.js +17 -6
  26. package/lib/common/templateParameters.js +2 -0
  27. package/lib/common/testPattern.js +21 -10
  28. package/lib/common/valueReplacer.js +15 -0
  29. package/lib/configs/jest.config.js +9 -0
  30. package/lib/configs/libAlias.js +2 -4
  31. package/lib/configs/webpack.component.umd.config.js +5 -0
  32. package/lib/configs/webpack.css.umd.config.js +13 -5
  33. package/lib/configs/webpack.dev.config.js +36 -2
  34. package/lib/configs/webpack.docs.config.js +21 -1
  35. package/lib/configs/webpack.impact.config.js +19 -1
  36. package/lib/configs/webpack.prod.config.js +37 -3
  37. package/lib/hooks/docsProptypeHook.js +7 -3
  38. package/lib/jest/commitedFilesResult.js +45 -3
  39. package/lib/jest/coverageCollector.js +11 -0
  40. package/lib/jest/jsonMaker.js +6 -0
  41. package/lib/jest/preProcessors/cssPreprocessor.js +8 -0
  42. package/lib/jest/preProcessors/jsPreprocessor.js +2 -0
  43. package/lib/jest/preProcessors/otherFilesPreprocessor.js +3 -0
  44. package/lib/jest/result.js +22 -0
  45. package/lib/jest/run.js +17 -6
  46. package/lib/jest/setup.js +57 -5
  47. package/lib/loaderUtils/configsAssetsLoaders.js +44 -34
  48. package/lib/loaderUtils/getCSSLoaders.js +35 -20
  49. package/lib/loaderUtils/getDevJsLoaders.js +8 -0
  50. package/lib/loaderUtils/index.js +3 -0
  51. package/lib/loaderUtils/windowsModification.js +11 -0
  52. package/lib/loaders/docsLoader.js +7 -0
  53. package/lib/loaders/docsPropsLoader.js +7 -3
  54. package/lib/loaders/fileBountryLoader.js +2 -0
  55. package/lib/loaders/fileLoader.js +22 -11
  56. package/lib/loaders/scriptInstrumentLoader.js +13 -5
  57. package/lib/loaders/selectorMappingLoader.js +25 -7
  58. package/lib/loaders/workerLoader.js +29 -13
  59. package/lib/middlewares/HMRMiddleware.js +26 -13
  60. package/lib/middlewares/SSTMiddleware.js +3 -0
  61. package/lib/pluginUtils/configHtmlWebpackPlugins.js +9 -3
  62. package/lib/pluginUtils/getDevPlugins.js +68 -22
  63. package/lib/pluginUtils/getDocsPlugins.js +10 -1
  64. package/lib/pluginUtils/getLibraryImactPlugins.js +5 -4
  65. package/lib/pluginUtils/getLibraryPlugins.js +5 -0
  66. package/lib/pluginUtils/getProdPlugins.js +77 -28
  67. package/lib/pluginUtils/getServerPlugins.js +5 -0
  68. package/lib/pluginUtils/getUMDCSSPlugins.js +7 -0
  69. package/lib/pluginUtils/getUMDComponentPlugins.js +7 -0
  70. package/lib/pluginUtils/index.js +8 -0
  71. package/lib/plugins/CdnChangePlugin.js +14 -0
  72. package/lib/plugins/CleanupStatsPlugin.js +5 -0
  73. package/lib/plugins/EFCPlugin.js +34 -23
  74. package/lib/plugins/EFCPlugin.md +6 -6
  75. package/lib/plugins/EFCTemplatePlugin.js +32 -23
  76. package/lib/plugins/I18NInjectIntoIndexPlugin.js +38 -12
  77. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +17 -12
  78. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
  79. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +77 -46
  80. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +59 -44
  81. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +30 -21
  82. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  83. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  84. package/lib/plugins/I18nSplitPlugin/index.js +80 -70
  85. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +12 -2
  86. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +1 -0
  87. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +5 -0
  88. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +6 -0
  89. package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
  90. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -2
  91. package/lib/plugins/ManifestPlugin.js +17 -0
  92. package/lib/plugins/ModuleStatsPlugin.js +23 -0
  93. package/lib/plugins/OptimizeJSPlugin.js +7 -0
  94. package/lib/plugins/PublicPathCallbackPlugin.js +10 -0
  95. package/lib/plugins/PublicPathChangePlugin.js +36 -4
  96. package/lib/plugins/ReportGeneratePlugin.js +30 -4
  97. package/lib/plugins/RequireVariablePublicPlugin.js +6 -0
  98. package/lib/plugins/ResourceHintsPlugin.js +27 -20
  99. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
  100. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +22 -15
  101. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  102. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
  103. package/lib/plugins/ScriptInstrumentPlugin.js +7 -0
  104. package/lib/plugins/SelectorPlugin.js +97 -0
  105. package/lib/plugins/ServiceWorkerPlugin.js +29 -13
  106. package/lib/plugins/ShadowDOMSupportPlugin.js +40 -3
  107. package/lib/plugins/SourceMapHookPlugin.js +9 -0
  108. package/lib/plugins/TPHashMappingPlugin.js +19 -5
  109. package/lib/plugins/UglifyCSSPlugin.js +9 -0
  110. package/lib/plugins/UnusedFilesFindPlugin.js +35 -2
  111. package/lib/plugins/VariableConversionCollector.js +322 -0
  112. package/lib/plugins/composeCommonPlugin.js +30 -0
  113. package/lib/plugins/index.js +19 -0
  114. package/lib/plugins/libraryImpactPlugin.js +32 -0
  115. package/lib/plugins/webpackwatchrunplugin.js +5 -0
  116. package/lib/postcss-plugins/ExcludePlugin.js +4 -0
  117. package/lib/postcss-plugins/RTLSplitPlugin.js +37 -24
  118. package/lib/postcss-plugins/ValueReplacer.js +6 -9
  119. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
  120. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  121. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  122. package/lib/postcss-plugins/hoverActivePlugin.js +69 -33
  123. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +42 -13
  124. package/lib/postcss-plugins/variableModificationPlugin/index.js +216 -141
  125. package/lib/postcss-plugins/variableModifier.js +20 -13
  126. package/lib/schemas/index.js +23 -4
  127. package/lib/servers/clusterHubServer.js +10 -0
  128. package/lib/servers/devBuild.js +24 -13
  129. package/lib/servers/docsServer.js +2 -0
  130. package/lib/servers/docsServerCore.js +21 -0
  131. package/lib/servers/getCliPath.js +9 -0
  132. package/lib/servers/helpServer.js +5 -0
  133. package/lib/servers/httpsOptions.js +4 -0
  134. package/lib/servers/impactServer.js +34 -2
  135. package/lib/servers/mockserver.js +9 -0
  136. package/lib/servers/nowatchserver.js +34 -12
  137. package/lib/servers/scrServer.js +20 -13
  138. package/lib/servers/server.js +35 -7
  139. package/lib/servers/ssServer.js +16 -0
  140. package/lib/sh/pre-commit.sh +34 -34
  141. package/lib/sh/reportPublish.sh +45 -45
  142. package/lib/templates/CoverageScriptTemplate.js +14 -0
  143. package/lib/templates/WMSTemplate.js +12 -6
  144. package/lib/utils/babelPresets.js +2 -0
  145. package/lib/utils/buildstats.html +148 -148
  146. package/lib/utils/clean.js +8 -2
  147. package/lib/utils/copy.js +6 -0
  148. package/lib/utils/copyTimezones.js +8 -0
  149. package/lib/utils/createEventStream.js +4 -0
  150. package/lib/utils/cssClassNameGenerate.js +19 -3
  151. package/lib/utils/cssURLReplacer.js +25 -0
  152. package/lib/utils/dependencyPostPublish.js +9 -0
  153. package/lib/utils/fileUtils.js +26 -0
  154. package/lib/utils/folderIterator.js +10 -0
  155. package/lib/utils/getComponents.js +21 -0
  156. package/lib/utils/getCurrentBranch.js +5 -0
  157. package/lib/utils/getDependenciesImpactList.js +21 -0
  158. package/lib/utils/getHash.js +7 -0
  159. package/lib/utils/getIp.js +2 -0
  160. package/lib/utils/getOptions.js +39 -14
  161. package/lib/utils/getServerURL.js +7 -0
  162. package/lib/utils/index.js +47 -2
  163. package/lib/utils/init.js +1 -0
  164. package/lib/utils/initPreCommitHook.js +29 -6
  165. package/lib/utils/jsonHelper.js +19 -2
  166. package/lib/utils/libraryImpactConfig.js +2 -0
  167. package/lib/utils/lint/addScripts.js +5 -2
  168. package/lib/utils/lint/checkExistingConfig.js +12 -3
  169. package/lib/utils/lint/copyConfigs.js +3 -0
  170. package/lib/utils/lint/index.js +9 -0
  171. package/lib/utils/lint/lintScripts.js +1 -0
  172. package/lib/utils/lint/lintSetup.js +4 -3
  173. package/lib/utils/lint/lintStagedPreCommitHook.js +1 -0
  174. package/lib/utils/lint/question.js +7 -0
  175. package/lib/utils/lintReporter.js +20 -0
  176. package/lib/utils/mailSender.js +7 -0
  177. package/lib/utils/pullOrigin.js +4 -0
  178. package/lib/utils/reinstallDependencies.js +28 -0
  179. package/lib/utils/removeAttributes.js +7 -0
  180. package/lib/utils/repoClone.js +27 -2
  181. package/lib/utils/request.js +12 -0
  182. package/lib/utils/resultSchema.json +73 -73
  183. package/lib/utils/rtl.js +16 -4
  184. package/lib/utils/setEnvVariables.js +2 -0
  185. package/lib/utils/ssTestHack.js +10 -0
  186. package/lib/utils/switchBranch.js +4 -0
  187. package/lib/utils/urlConcat.js +4 -0
  188. package/lib/utils/useExitCleanup.js +10 -9
  189. package/npm8.md +9 -9
  190. package/package.json +146 -146
  191. package/postpublish.js +6 -6
  192. package/templates/app/.eslintrc.js +140 -140
  193. package/templates/app/README.md +12 -12
  194. package/templates/app/app/index.html +24 -24
  195. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  196. package/templates/app/app/properties/i18nkeys.json +3 -3
  197. package/templates/app/docs/all.html +69 -69
  198. package/templates/app/mockapi/index.js +18 -18
  199. package/templates/app/package.json +37 -37
  200. package/templates/app/src/actions/SampleActions/index.js +37 -37
  201. package/templates/app/src/actions/index.js +65 -65
  202. package/templates/app/src/appUrls.js +19 -19
  203. package/templates/app/src/components/Alert/Alert.js +134 -134
  204. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  205. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  206. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  207. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  208. package/templates/app/src/components/Sample/SampleList.js +61 -61
  209. package/templates/app/src/components/Slider/Slider.css +41 -41
  210. package/templates/app/src/components/Slider/Slider.js +55 -55
  211. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  212. package/templates/app/src/containers/AppContainer/index.js +96 -96
  213. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  214. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  215. package/templates/app/src/containers/DevTools/index.js +10 -10
  216. package/templates/app/src/containers/Header/index.js +67 -67
  217. package/templates/app/src/containers/Header/index.module.css +43 -43
  218. package/templates/app/src/containers/Redirect/index.js +63 -63
  219. package/templates/app/src/containers/Redirector/index.js +47 -47
  220. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  221. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  222. package/templates/app/src/historyChange.js +5 -5
  223. package/templates/app/src/index.html +10 -10
  224. package/templates/app/src/index.js +24 -24
  225. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  226. package/templates/app/src/reducers/alertData.js +11 -11
  227. package/templates/app/src/reducers/index.js +6 -6
  228. package/templates/app/src/reducers/samples.js +19 -19
  229. package/templates/app/src/store/configureStore.dev.js +51 -51
  230. package/templates/app/src/store/configureStore.js +5 -5
  231. package/templates/app/src/store/configureStore.prod.js +26 -26
  232. package/templates/app/src/util/Common.js +5 -5
  233. package/templates/app/src/util/RequestAPI.js +132 -132
  234. package/templates/docs/all.html +249 -249
  235. package/templates/docs/component.html +178 -178
  236. package/templates/docs/components.html +221 -221
  237. package/templates/docs/css/b.min.css +6 -6
  238. package/templates/docs/css/component.css +42 -42
  239. package/templates/docs/css/componentTest.css +6 -6
  240. package/templates/docs/css/hopscotch.css +585 -585
  241. package/templates/docs/css/style.css +1022 -1022
  242. package/templates/docs/impactReportTemplate.html +154 -154
  243. package/templates/docs/index.html +1501 -1501
  244. package/templates/docs/js/active-line.js +72 -72
  245. package/templates/docs/js/b.min.js +7 -7
  246. package/templates/docs/js/codemirror.js +9680 -9680
  247. package/templates/docs/js/designTokens.js +334 -334
  248. package/templates/docs/js/j.min.js +4 -4
  249. package/templates/docs/js/javascript.js +874 -874
  250. package/templates/docs/js/matchbrackets.js +145 -145
@@ -1,148 +1,148 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5
- <style>
6
- #file {
7
- font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
8
- border-collapse: collapse;
9
- width: 100%;
10
- }
11
- #redTd {
12
- color: red;
13
- }
14
- #greenTD {
15
- color: green;
16
- }
17
- #file td,
18
- #file th {
19
- border: 1px solid #ddd;
20
- padding: 8px;
21
- text-align: center;
22
- }
23
-
24
- #file tr:nth-child(even) {
25
- background-color: #f2f2f2;
26
- }
27
-
28
- #file tr:hover {
29
- background-color: #ddd;
30
- }
31
-
32
- #file th {
33
- padding-top: 12px;
34
- padding-bottom: 12px;
35
- background-color: #2a2d36;
36
- color: white;
37
- }
38
- #sizeTable {
39
- float: left;
40
- width: 50%;
41
- }
42
- #hashTable {
43
- display: inline-block;
44
- width: 50%;
45
- }
46
- </style>
47
- <script type="text/javascript" src="./buildtrack.js"></script>
48
- </head>
49
- <body>
50
- <div>
51
- <div style="float: left;margin-right: 10px;">Branch Name:</div>
52
- <h4 id="h4" style="margin: 0px;"></h4>
53
- </div>
54
- <div id="sizeTable">
55
- <div>
56
- <h3>Size changes</h3>
57
- <h3></h3>
58
- </div>
59
- <table id="file" class="table table-bordered table-hover table-condensed">
60
- <thead>
61
- <tr>
62
- <th title="Field #1">Name</th>
63
- <th title="Field #2">Size / Diff</th>
64
- <th title="Field #3">Size / Old</th>
65
- <th title="Field #4">Size / New</th>
66
- </tr>
67
- </thead>
68
- <tbody id="sizeTbody"></tbody>
69
- </table>
70
- </div>
71
- <div id="hashTable">
72
- <div>
73
- <h3>Hash changes</h3>
74
- <h3></h3>
75
- </div>
76
- <table id="file" class="table table-bordered table-hover table-condensed">
77
- <thead>
78
- <tr>
79
- <th style="background-color: #4CAF50;" title="Field #1">Name</th>
80
- <th style="background-color: #4CAF50;" title="Field #2">
81
- Hash / Old
82
- </th>
83
- <th style="background-color: #4CAF50;" title="Field #3">
84
- Hash / New
85
- </th>
86
- </tr>
87
- </thead>
88
- <tbody id="hashTbody"></tbody>
89
- </table>
90
- </div>
91
-
92
- <script type="text/javascript">
93
- function load() {
94
- if (statsJson) {
95
- var tdStringSize = '';
96
- var tdStringHash = '';
97
- if (statsJson.increased.length > 0) {
98
- statsJson.increased.forEach(fileObj => {
99
- let colorTD = '</td><td>';
100
- if (fileObj.size.diff.split(' ').length > 2) {
101
- colorTD = '</td><td id="greenTd">';
102
- } else {
103
- colorTD = '</td><td id="redTd">';
104
- }
105
-
106
- tdStringSize =
107
- tdStringSize +
108
- '<tr><td>' +
109
- fileObj.name +
110
- colorTD +
111
- fileObj.size.diff +
112
- '</td><td>' +
113
- fileObj.size.old +
114
- '</td><td>' +
115
- fileObj.size.new +
116
- '</td><tr>';
117
- });
118
- } else {
119
- tdStringSize = '<tr><td></td><td></td><td></td></tr>';
120
- }
121
- document.getElementById('sizeTbody').innerHTML = tdStringSize;
122
- if (statsJson.hashChanged.length > 0) {
123
- statsJson.hashChanged.forEach(fileObj => {
124
- tdStringHash =
125
- tdStringHash +
126
- '<tr><td>' +
127
- fileObj.name +
128
- '</td><td>' +
129
- fileObj.hash.old +
130
- '</td><td>' +
131
- fileObj.hash.new +
132
- '</td><tr>';
133
- });
134
- } else {
135
- tdStringHash = '<tr><td></td><td></td><td></td></tr>';
136
- }
137
- document.getElementById('hashTbody').innerHTML = tdStringHash;
138
- if (statsJson.branchName) {
139
- document.getElementById('h4').innerHTML = statsJson.branchName;
140
- } else {
141
- document.getElementById('h4').innerHTML = 'Not specified';
142
- }
143
- }
144
- }
145
- load();
146
- </script>
147
- </body>
148
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5
+ <style>
6
+ #file {
7
+ font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
8
+ border-collapse: collapse;
9
+ width: 100%;
10
+ }
11
+ #redTd {
12
+ color: red;
13
+ }
14
+ #greenTD {
15
+ color: green;
16
+ }
17
+ #file td,
18
+ #file th {
19
+ border: 1px solid #ddd;
20
+ padding: 8px;
21
+ text-align: center;
22
+ }
23
+
24
+ #file tr:nth-child(even) {
25
+ background-color: #f2f2f2;
26
+ }
27
+
28
+ #file tr:hover {
29
+ background-color: #ddd;
30
+ }
31
+
32
+ #file th {
33
+ padding-top: 12px;
34
+ padding-bottom: 12px;
35
+ background-color: #2a2d36;
36
+ color: white;
37
+ }
38
+ #sizeTable {
39
+ float: left;
40
+ width: 50%;
41
+ }
42
+ #hashTable {
43
+ display: inline-block;
44
+ width: 50%;
45
+ }
46
+ </style>
47
+ <script type="text/javascript" src="./buildtrack.js"></script>
48
+ </head>
49
+ <body>
50
+ <div>
51
+ <div style="float: left;margin-right: 10px;">Branch Name:</div>
52
+ <h4 id="h4" style="margin: 0px;"></h4>
53
+ </div>
54
+ <div id="sizeTable">
55
+ <div>
56
+ <h3>Size changes</h3>
57
+ <h3></h3>
58
+ </div>
59
+ <table id="file" class="table table-bordered table-hover table-condensed">
60
+ <thead>
61
+ <tr>
62
+ <th title="Field #1">Name</th>
63
+ <th title="Field #2">Size / Diff</th>
64
+ <th title="Field #3">Size / Old</th>
65
+ <th title="Field #4">Size / New</th>
66
+ </tr>
67
+ </thead>
68
+ <tbody id="sizeTbody"></tbody>
69
+ </table>
70
+ </div>
71
+ <div id="hashTable">
72
+ <div>
73
+ <h3>Hash changes</h3>
74
+ <h3></h3>
75
+ </div>
76
+ <table id="file" class="table table-bordered table-hover table-condensed">
77
+ <thead>
78
+ <tr>
79
+ <th style="background-color: #4CAF50;" title="Field #1">Name</th>
80
+ <th style="background-color: #4CAF50;" title="Field #2">
81
+ Hash / Old
82
+ </th>
83
+ <th style="background-color: #4CAF50;" title="Field #3">
84
+ Hash / New
85
+ </th>
86
+ </tr>
87
+ </thead>
88
+ <tbody id="hashTbody"></tbody>
89
+ </table>
90
+ </div>
91
+
92
+ <script type="text/javascript">
93
+ function load() {
94
+ if (statsJson) {
95
+ var tdStringSize = '';
96
+ var tdStringHash = '';
97
+ if (statsJson.increased.length > 0) {
98
+ statsJson.increased.forEach(fileObj => {
99
+ let colorTD = '</td><td>';
100
+ if (fileObj.size.diff.split(' ').length > 2) {
101
+ colorTD = '</td><td id="greenTd">';
102
+ } else {
103
+ colorTD = '</td><td id="redTd">';
104
+ }
105
+
106
+ tdStringSize =
107
+ tdStringSize +
108
+ '<tr><td>' +
109
+ fileObj.name +
110
+ colorTD +
111
+ fileObj.size.diff +
112
+ '</td><td>' +
113
+ fileObj.size.old +
114
+ '</td><td>' +
115
+ fileObj.size.new +
116
+ '</td><tr>';
117
+ });
118
+ } else {
119
+ tdStringSize = '<tr><td></td><td></td><td></td></tr>';
120
+ }
121
+ document.getElementById('sizeTbody').innerHTML = tdStringSize;
122
+ if (statsJson.hashChanged.length > 0) {
123
+ statsJson.hashChanged.forEach(fileObj => {
124
+ tdStringHash =
125
+ tdStringHash +
126
+ '<tr><td>' +
127
+ fileObj.name +
128
+ '</td><td>' +
129
+ fileObj.hash.old +
130
+ '</td><td>' +
131
+ fileObj.hash.new +
132
+ '</td><tr>';
133
+ });
134
+ } else {
135
+ tdStringHash = '<tr><td></td><td></td><td></td></tr>';
136
+ }
137
+ document.getElementById('hashTbody').innerHTML = tdStringHash;
138
+ if (statsJson.branchName) {
139
+ document.getElementById('h4').innerHTML = statsJson.branchName;
140
+ } else {
141
+ document.getElementById('h4').innerHTML = 'Not specified';
142
+ }
143
+ }
144
+ }
145
+ load();
146
+ </script>
147
+ </body>
148
+ </html>
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _rimraf = _interopRequireDefault(require("rimraf"));
4
+
4
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
+
5
7
  let help = false;
6
- let dashdash = false;
7
- //eslint-disable-next-line array-callback-return
8
+ let dashdash = false; //eslint-disable-next-line array-callback-return
9
+
8
10
  let args = process.argv.slice(2).filter(arg => {
9
11
  if (dashdash) {
10
12
  return !!arg;
@@ -16,17 +18,21 @@ let args = process.argv.slice(2).filter(arg => {
16
18
  return !!arg;
17
19
  }
18
20
  });
21
+
19
22
  let go = n => {
20
23
  if (n >= args.length) {
21
24
  return;
22
25
  }
26
+
23
27
  (0, _rimraf.default)(args[n], er => {
24
28
  if (er) {
25
29
  throw er;
26
30
  }
31
+
27
32
  go(n + 1);
28
33
  });
29
34
  };
35
+
30
36
  if (help || args.length === 0) {
31
37
  // If they didn't ask for help, then this is not a "success"
32
38
  // eslint-disable-next-line no-console
package/lib/utils/copy.js CHANGED
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _path = _interopRequireDefault(require("path"));
4
+
4
5
  var _fs = _interopRequireDefault(require("fs"));
6
+
5
7
  var _fileUtils = require("./fileUtils");
8
+
6
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
7
11
  let args = process.argv.slice(2);
12
+
8
13
  let appPath = _fs.default.realpathSync(process.cwd());
14
+
9
15
  let [srcPath, targetPath, exts, isCopy = true, flatten = '', changeExt = ''] = args;
10
16
  exts = exts ? exts.split(',').map(ext => `.${ext.trim()}`) : false;
11
17
  srcPath = _path.default.join(appPath, srcPath);
@@ -1,13 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  var _path = _interopRequireDefault(require("path"));
4
+
4
5
  var _fs = _interopRequireDefault(require("fs"));
6
+
5
7
  var _fileUtils = require("./fileUtils");
8
+
6
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
7
11
  let args = process.argv.slice(2);
12
+
8
13
  let appPath = _fs.default.realpathSync(process.cwd());
14
+
9
15
  let [targetPath] = args;
10
16
  targetPath = targetPath === '."' || !targetPath ? '' : targetPath;
11
17
  targetPath = _path.default.join(appPath, targetPath);
18
+
12
19
  let srcPath = _path.default.resolve(_path.default.dirname(require.resolve('@zohodesk/datetimejs')), '../data/timezones/');
20
+
13
21
  (0, _fileUtils.copy)(srcPath, targetPath, true, null, 'flatten');
@@ -4,14 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  let createEventStream = (heartbeat, heartbeatInfo = null) => {
8
9
  let clientId = 0;
9
10
  let clients = {};
11
+
10
12
  let everyClient = fn => {
11
13
  Object.keys(clients).forEach(id => {
12
14
  fn(clients[id]);
13
15
  });
14
16
  };
17
+
15
18
  setInterval(() => {
16
19
  everyClient(client => {
17
20
  if (heartbeatInfo) {
@@ -49,5 +52,6 @@ let createEventStream = (heartbeat, heartbeatInfo = null) => {
49
52
  }
50
53
  };
51
54
  };
55
+
52
56
  var _default = createEventStream;
53
57
  exports.default = _default;
@@ -4,27 +4,38 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _os = _interopRequireDefault(require("os"));
9
+
8
10
  var _path = _interopRequireDefault(require("path"));
11
+
9
12
  var _getHash = _interopRequireDefault(require("./getHash"));
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
11
16
  let isWindows = _os.default.platform().toLowerCase() === 'win32';
17
+
12
18
  let isSelectorPackage = (resourcePath, packages) => {
13
19
  if (!resourcePath.includes('node_modules')) {
14
20
  return false;
15
21
  }
22
+
16
23
  let isValid = false;
24
+
17
25
  for (let pack of packages) {
18
26
  if (isWindows) {
19
27
  pack = pack.replace(/\//g, '\\');
20
28
  }
29
+
21
30
  if (resourcePath.includes(pack)) {
22
31
  isValid = true;
23
32
  break;
24
33
  }
25
34
  }
35
+
26
36
  return isValid;
27
37
  };
38
+
28
39
  var _default = (unique = true, {
29
40
  filenames,
30
41
  packages
@@ -35,27 +46,32 @@ var _default = (unique = true, {
35
46
  // console.log('context.resourcePath', context.resourcePath, context);
36
47
  // let contextResourcePath = context.resourcePath;
37
48
  let relativePath = _path.default.relative(context.rootContext, context.resourcePath);
49
+
38
50
  if (context.resourcePath.endsWith('.plain.css')) {
39
51
  return localName;
40
52
  }
41
-
42
53
  /* old production mode start without breaking so added. may be removed in future*/
54
+
55
+
43
56
  if (unique) {
44
57
  let h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
45
58
  return `${classNamePrefix}${h}`;
46
59
  }
47
60
  /* old production mode end*/
48
61
 
62
+
49
63
  let filePaths = context.resourcePath.split(_path.default.sep);
50
64
  let fileName = filePaths[filePaths.length - 1];
51
65
  let [fileNameWithoutExt] = fileName.split('.');
52
- let cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase();
53
- //css file has casesensitive selector issue so can't toLowerCase
66
+ let cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase(); //css file has casesensitive selector issue so can't toLowerCase
54
67
  //let local = localName.toLowerCase()
68
+
55
69
  if (isSelectorPackage(context.resourcePath, packages) || filenames.indexOf(cleanFileName) !== -1) {
56
70
  let h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
57
71
  return `${classNamePrefix}${h}`;
58
72
  }
73
+
59
74
  return `${classNamePrefix}-${cleanFileName}-${localName}`;
60
75
  };
76
+
61
77
  exports.default = _default;
@@ -4,25 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getUrls = exports.getFileType = exports.cssUrlReplacer = void 0;
7
+
7
8
  var _fs = _interopRequireDefault(require("fs"));
9
+
8
10
  var _path = _interopRequireDefault(require("path"));
11
+
9
12
  var _crypto = _interopRequireDefault(require("crypto"));
13
+
10
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
11
16
  let urlRegex = /url\(.*?\)/g;
17
+
12
18
  let getHash = (file, isPath = false, needSubStr = true) => {
13
19
  let hash = _crypto.default.createHash('md5');
20
+
14
21
  if (isPath) {
15
22
  hash.update(_fs.default.readFileSync(file));
16
23
  } else {
17
24
  hash.update(file);
18
25
  }
26
+
19
27
  hash = hash.digest('hex');
20
28
  return hash ? needSubStr ? hash.substring(0, 20) : hash : null;
21
29
  };
30
+
22
31
  let getFileType = file => {
23
32
  let {
24
33
  ext
25
34
  } = _path.default.parse(file);
35
+
26
36
  if (ext === '.gif' || ext === '.png' || ext === '.jpg' || ext === '.jpeg' || ext === '.ico') {
27
37
  return 'image';
28
38
  } else if (ext === '.svg' || ext === '.woff' || ext === '.eot' || ext === '.ttf' || ext === '.woff2') {
@@ -32,9 +42,12 @@ let getFileType = file => {
32
42
  } else if (ext === '.css') {
33
43
  return 'css';
34
44
  }
45
+
35
46
  return null;
36
47
  };
48
+
37
49
  exports.getFileType = getFileType;
50
+
38
51
  let formatUrl = str => {
39
52
  let char = str.includes('"') ? '"' : str.includes('\'') ? '\'' : '(';
40
53
  let statingIdx = str.indexOf(char) + 1;
@@ -42,9 +55,11 @@ let formatUrl = str => {
42
55
  char = char === '(' ? ')' : char;
43
56
  return substr.substring(0, substr.indexOf(char));
44
57
  };
58
+
45
59
  let getUrls = css => {
46
60
  let urlMatches = css.match(urlRegex);
47
61
  let src = css;
62
+
48
63
  if (urlMatches) {
49
64
  let patterns = {};
50
65
  urlMatches.forEach(pattern => {
@@ -60,16 +75,20 @@ let getUrls = css => {
60
75
  };
61
76
  }
62
77
  };
78
+
63
79
  exports.getUrls = getUrls;
80
+
64
81
  let cssUrlReplacer = (css, domains, chunkHash = {}) => {
65
82
  let obj = getUrls(css);
66
83
  let src = css;
84
+
67
85
  if (obj) {
68
86
  let patterns = obj.urls;
69
87
  src = obj.css;
70
88
  Object.keys(patterns).forEach(pattern => {
71
89
  let urlParts = pattern.split('/');
72
90
  let fileName = urlParts.pop();
91
+
73
92
  if (fileName.includes('#')) {
74
93
  if (fileName.includes('?')) {
75
94
  fileName = fileName.replace(/\?.*#/g, '#');
@@ -77,12 +96,14 @@ let cssUrlReplacer = (css, domains, chunkHash = {}) => {
77
96
  } else {
78
97
  fileName = fileName.replace(/\?.*$/g, '');
79
98
  }
99
+
80
100
  let hash = patterns[pattern];
81
101
  let filename = fileName.replace(/(\?|#).*?$/g, '');
82
102
  let regex = new RegExp(hash, 'g');
83
103
  let {
84
104
  hashedName
85
105
  } = chunkHash[filename] || fileName;
106
+
86
107
  if (domains && typeof urlParts[0] === 'string' && !urlParts[0].includes('http')) {
87
108
  let {
88
109
  font,
@@ -92,6 +113,7 @@ let cssUrlReplacer = (css, domains, chunkHash = {}) => {
92
113
  let customPath = type === 'image' ? `${image}/images` : type === 'font' ? `${font}/fonts` : urlParts.join('/');
93
114
  urlParts = customPath.split('/');
94
115
  }
116
+
95
117
  if (hashedName) {
96
118
  if (fileName.includes('#')) {
97
119
  if (fileName.includes('?')) {
@@ -101,11 +123,14 @@ let cssUrlReplacer = (css, domains, chunkHash = {}) => {
101
123
  }
102
124
  }
103
125
  }
126
+
104
127
  urlParts.push(hashedName || fileName);
105
128
  urlParts = urlParts.join('/');
106
129
  src = src.replace(regex, `url('${urlParts}')`);
107
130
  });
108
131
  }
132
+
109
133
  return src;
110
134
  };
135
+
111
136
  exports.cssUrlReplacer = cssUrlReplacer;
@@ -1,22 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _child_process = require("child_process");
4
+
4
5
  var _path = _interopRequireDefault(require("path"));
6
+
5
7
  var _request = _interopRequireDefault(require("./request"));
8
+
6
9
  var _index = require("./index");
10
+
7
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
8
13
  let changeset = (0, _child_process.execSync)('git rev-parse HEAD', {
9
14
  cwd: process.cwd()
10
15
  }).toString() || '';
11
16
  changeset = changeset.trim();
17
+
12
18
  if (!changeset) {
13
19
  throw new Error('Changeset doesn\'t exists');
14
20
  }
21
+
15
22
  (0, _index.log)(changeset, 'changeset');
23
+
16
24
  let {
17
25
  version,
18
26
  name
19
27
  } = require(_path.default.join(process.cwd(), './package.json'));
28
+
20
29
  (0, _request.default)({
21
30
  url: `${'ht'}${'tp'}://tsi-desk-mock.tsi.zohocorpin.com:8080/Hbase/addKey?method=addkey`,
22
31
  method: 'POST',