@zohodesk/react-cli 0.0.1-exp.169.2 → 0.0.1-exp.175.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 (245) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -179
  3. package/.prettierrc +6 -6
  4. package/README.md +1028 -951
  5. package/bin/cli.js +483 -483
  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/TODOS.md +10 -10
  13. package/docs/ValueReplacer.md +60 -60
  14. package/docs/VariableConversion.md +678 -0
  15. package/docs/warnings_while_install.txt +35 -35
  16. package/files/eslintrc.js +62 -62
  17. package/files/prettierrc.js +3 -3
  18. package/lib/babel/cmjs-plugins-presets.js +0 -4
  19. package/lib/babel/es-plugins-presets.js +0 -4
  20. package/lib/common/getEntries.js +0 -10
  21. package/lib/common/getPublicPathConfig.js +0 -6
  22. package/lib/common/index.js +0 -5
  23. package/lib/common/splitChunks.js +2 -13
  24. package/lib/common/sslcertUpdater.js +6 -17
  25. package/lib/common/templateParameters.js +0 -2
  26. package/lib/common/testPattern.js +10 -21
  27. package/lib/common/valueReplacer.js +0 -15
  28. package/lib/configs/jest.config.js +8 -21
  29. package/lib/configs/libAlias.js +11 -2
  30. package/lib/configs/webpack.component.umd.config.js +0 -5
  31. package/lib/configs/webpack.css.umd.config.js +5 -13
  32. package/lib/configs/webpack.dev.config.js +13 -24
  33. package/lib/configs/webpack.docs.config.js +6 -12
  34. package/lib/configs/webpack.impact.config.js +6 -10
  35. package/lib/configs/webpack.prod.config.js +15 -26
  36. package/lib/hooks/docsProptypeHook.js +3 -7
  37. package/lib/jest/commitedFilesResult.js +3 -45
  38. package/lib/jest/coverageCollector.js +0 -11
  39. package/lib/jest/jsonMaker.js +0 -6
  40. package/lib/jest/preProcessors/cssPreprocessor.js +14 -13
  41. package/lib/jest/preProcessors/jsPreprocessor.js +0 -2
  42. package/lib/jest/preProcessors/otherFilesPreprocessor.js +0 -3
  43. package/lib/jest/result.js +0 -22
  44. package/lib/jest/run.js +6 -17
  45. package/lib/jest/setup.js +5 -57
  46. package/lib/loaderUtils/configsAssetsLoaders.js +34 -44
  47. package/lib/loaderUtils/getCSSLoaders.js +41 -28
  48. package/lib/loaderUtils/getDevJsLoaders.js +0 -8
  49. package/lib/loaderUtils/index.js +0 -3
  50. package/lib/loaders/docsLoader.js +0 -7
  51. package/lib/loaders/docsPropsLoader.js +3 -7
  52. package/lib/loaders/fileBountryLoader.js +0 -2
  53. package/lib/loaders/fileLoader.js +11 -22
  54. package/lib/loaders/scriptInstrumentLoader.js +5 -13
  55. package/lib/loaders/selectorMappingLoader.js +7 -25
  56. package/lib/loaders/workerLoader.js +13 -29
  57. package/lib/middlewares/HMRMiddleware.js +13 -26
  58. package/lib/middlewares/SSTMiddleware.js +0 -3
  59. package/lib/pluginUtils/configHtmlWebpackPlugins.js +53 -0
  60. package/lib/pluginUtils/getDevPlugins.js +20 -64
  61. package/lib/pluginUtils/getDocsPlugins.js +1 -10
  62. package/lib/pluginUtils/getLibraryImactPlugins.js +4 -5
  63. package/lib/pluginUtils/getLibraryPlugins.js +0 -5
  64. package/lib/pluginUtils/getProdPlugins.js +32 -78
  65. package/lib/pluginUtils/getServerPlugins.js +0 -5
  66. package/lib/pluginUtils/getUMDCSSPlugins.js +0 -7
  67. package/lib/pluginUtils/getUMDComponentPlugins.js +0 -7
  68. package/lib/pluginUtils/index.js +0 -8
  69. package/lib/plugins/CdnChangePlugin.js +0 -14
  70. package/lib/plugins/CleanupStatsPlugin.js +0 -5
  71. package/lib/plugins/EFCPlugin.js +23 -34
  72. package/lib/plugins/EFCPlugin.md +6 -6
  73. package/lib/plugins/EFCTemplatePlugin.js +23 -32
  74. package/lib/plugins/I18NInjectIntoIndexPlugin.js +12 -38
  75. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +12 -17
  76. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
  77. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +46 -77
  78. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +44 -59
  79. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +21 -30
  80. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  81. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  82. package/lib/plugins/I18nSplitPlugin/index.js +70 -80
  83. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
  84. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
  85. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
  86. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +0 -6
  87. package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
  88. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +2 -20
  89. package/lib/plugins/ManifestPlugin.js +0 -17
  90. package/lib/plugins/ModuleStatsPlugin.js +0 -23
  91. package/lib/plugins/OptimizeJSPlugin.js +0 -7
  92. package/lib/plugins/PublicPathCallbackPlugin.js +0 -10
  93. package/lib/plugins/PublicPathChangePlugin.js +4 -36
  94. package/lib/plugins/ReportGeneratePlugin.js +4 -30
  95. package/lib/plugins/RequireVariablePublicPlugin.js +0 -6
  96. package/lib/plugins/ResourceHintsPlugin.js +20 -27
  97. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
  98. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +23 -38
  99. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  100. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
  101. package/lib/plugins/ScriptInstrumentPlugin.js +0 -7
  102. package/lib/plugins/ServiceWorkerPlugin.js +13 -29
  103. package/lib/plugins/ShadowDOMSupportPlugin.js +3 -40
  104. package/lib/plugins/SourceMapHookPlugin.js +0 -9
  105. package/lib/plugins/TPHashMappingPlugin.js +5 -19
  106. package/lib/plugins/UglifyCSSPlugin.js +0 -9
  107. package/lib/plugins/UnusedFilesFindPlugin.js +2 -35
  108. package/lib/plugins/index.js +0 -19
  109. package/lib/plugins/libraryImpactPlugin.js +0 -32
  110. package/lib/plugins/webpackwatchrunplugin.js +0 -5
  111. package/lib/postcss-plugins/ExcludePlugin.js +0 -4
  112. package/lib/postcss-plugins/RTLSplitPlugin.js +24 -37
  113. package/lib/postcss-plugins/ValueReplacer.js +9 -6
  114. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
  115. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  116. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  117. package/lib/postcss-plugins/hoverActivePlugin.js +80 -92
  118. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +31 -0
  119. package/lib/postcss-plugins/variableModificationPlugin/index.js +232 -0
  120. package/lib/postcss-plugins/variableModifier.js +14 -20
  121. package/lib/schemas/index.js +28 -13
  122. package/lib/servers/clusterHubServer.js +0 -10
  123. package/lib/servers/devBuild.js +13 -24
  124. package/lib/servers/docsServer.js +0 -2
  125. package/lib/servers/docsServerCore.js +0 -21
  126. package/lib/servers/getCliPath.js +1 -10
  127. package/lib/servers/helpServer.js +0 -5
  128. package/lib/servers/httpsOptions.js +0 -4
  129. package/lib/servers/impactServer.js +2 -34
  130. package/lib/servers/mockserver.js +0 -9
  131. package/lib/servers/nowatchserver.js +12 -34
  132. package/lib/servers/scrServer.js +13 -20
  133. package/lib/servers/server.js +7 -35
  134. package/lib/servers/ssServer.js +0 -16
  135. package/lib/sh/pre-commit.sh +34 -34
  136. package/lib/sh/reportPublish.sh +45 -45
  137. package/lib/templates/CoverageScriptTemplate.js +0 -14
  138. package/lib/templates/WMSTemplate.js +6 -12
  139. package/lib/utils/babelPresets.js +0 -2
  140. package/lib/utils/buildstats.html +148 -148
  141. package/lib/utils/clean.js +2 -8
  142. package/lib/utils/copy.js +0 -6
  143. package/lib/utils/copyTimezones.js +0 -8
  144. package/lib/utils/createEventStream.js +0 -4
  145. package/lib/utils/cssClassNameGenerate.js +3 -19
  146. package/lib/utils/cssURLReplacer.js +0 -25
  147. package/lib/utils/dependencyPostPublish.js +0 -9
  148. package/lib/utils/fileUtils.js +0 -26
  149. package/lib/utils/folderIterator.js +0 -10
  150. package/lib/utils/getComponents.js +0 -21
  151. package/lib/utils/getCurrentBranch.js +0 -5
  152. package/lib/utils/getDependenciesImpactList.js +0 -21
  153. package/lib/utils/getHash.js +0 -7
  154. package/lib/utils/getIp.js +0 -2
  155. package/lib/utils/getOptions.js +38 -35
  156. package/lib/utils/getServerURL.js +0 -7
  157. package/lib/utils/index.js +2 -47
  158. package/lib/utils/init.js +0 -1
  159. package/lib/utils/initPreCommitHook.js +6 -29
  160. package/lib/utils/jsonHelper.js +2 -19
  161. package/lib/utils/libraryImpactConfig.js +0 -2
  162. package/lib/utils/lint/addScripts.js +2 -5
  163. package/lib/utils/lint/checkExistingConfig.js +3 -12
  164. package/lib/utils/lint/copyConfigs.js +0 -3
  165. package/lib/utils/lint/index.js +0 -9
  166. package/lib/utils/lint/lintScripts.js +0 -1
  167. package/lib/utils/lint/lintSetup.js +3 -4
  168. package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
  169. package/lib/utils/lint/question.js +0 -7
  170. package/lib/utils/lintReporter.js +0 -20
  171. package/lib/utils/mailSender.js +0 -7
  172. package/lib/utils/pullOrigin.js +0 -4
  173. package/lib/utils/reinstallDependencies.js +0 -28
  174. package/lib/utils/removeAttributes.js +0 -7
  175. package/lib/utils/repoClone.js +2 -27
  176. package/lib/utils/request.js +0 -12
  177. package/lib/utils/resultSchema.json +73 -73
  178. package/lib/utils/rtl.js +4 -16
  179. package/lib/utils/setEnvVariables.js +0 -2
  180. package/lib/utils/ssTestHack.js +0 -10
  181. package/lib/utils/switchBranch.js +0 -4
  182. package/lib/utils/urlConcat.js +0 -4
  183. package/lib/utils/useExitCleanup.js +9 -10
  184. package/npm8.md +9 -9
  185. package/package.json +146 -148
  186. package/postpublish.js +6 -6
  187. package/templates/app/.eslintrc.js +140 -140
  188. package/templates/app/README.md +12 -12
  189. package/templates/app/app/index.html +24 -24
  190. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  191. package/templates/app/app/properties/i18nkeys.json +3 -3
  192. package/templates/app/docs/all.html +69 -69
  193. package/templates/app/mockapi/index.js +18 -18
  194. package/templates/app/package.json +37 -37
  195. package/templates/app/src/actions/SampleActions/index.js +37 -37
  196. package/templates/app/src/actions/index.js +65 -65
  197. package/templates/app/src/appUrls.js +19 -19
  198. package/templates/app/src/components/Alert/Alert.js +134 -134
  199. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  200. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  201. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  202. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  203. package/templates/app/src/components/Sample/SampleList.js +61 -61
  204. package/templates/app/src/components/Slider/Slider.css +41 -41
  205. package/templates/app/src/components/Slider/Slider.js +55 -55
  206. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  207. package/templates/app/src/containers/AppContainer/index.js +96 -96
  208. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  209. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  210. package/templates/app/src/containers/DevTools/index.js +10 -10
  211. package/templates/app/src/containers/Header/index.js +67 -67
  212. package/templates/app/src/containers/Header/index.module.css +43 -43
  213. package/templates/app/src/containers/Redirect/index.js +63 -63
  214. package/templates/app/src/containers/Redirector/index.js +47 -47
  215. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  216. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  217. package/templates/app/src/historyChange.js +5 -5
  218. package/templates/app/src/index.html +10 -10
  219. package/templates/app/src/index.js +24 -24
  220. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  221. package/templates/app/src/reducers/alertData.js +11 -11
  222. package/templates/app/src/reducers/index.js +6 -6
  223. package/templates/app/src/reducers/samples.js +19 -19
  224. package/templates/app/src/store/configureStore.dev.js +51 -51
  225. package/templates/app/src/store/configureStore.js +5 -5
  226. package/templates/app/src/store/configureStore.prod.js +26 -26
  227. package/templates/app/src/util/Common.js +5 -5
  228. package/templates/app/src/util/RequestAPI.js +132 -132
  229. package/templates/docs/all.html +249 -249
  230. package/templates/docs/component.html +178 -178
  231. package/templates/docs/components.html +221 -221
  232. package/templates/docs/css/b.min.css +6 -6
  233. package/templates/docs/css/component.css +42 -42
  234. package/templates/docs/css/componentTest.css +6 -6
  235. package/templates/docs/css/hopscotch.css +585 -585
  236. package/templates/docs/css/style.css +1022 -1022
  237. package/templates/docs/impactReportTemplate.html +154 -154
  238. package/templates/docs/index.html +1501 -1493
  239. package/templates/docs/js/active-line.js +72 -72
  240. package/templates/docs/js/b.min.js +7 -7
  241. package/templates/docs/js/codemirror.js +9680 -9680
  242. package/templates/docs/js/designTokens.js +334 -334
  243. package/templates/docs/js/j.min.js +4 -4
  244. package/templates/docs/js/javascript.js +874 -874
  245. package/templates/docs/js/matchbrackets.js +145 -145
@@ -1,30 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _path = _interopRequireDefault(require("path"));
4
-
5
4
  var _https = _interopRequireDefault(require("https"));
6
-
7
5
  var _webpack = _interopRequireDefault(require("webpack"));
8
-
9
6
  var _express = _interopRequireDefault(require("express"));
10
-
11
7
  var _ws = _interopRequireDefault(require("ws"));
12
-
13
8
  var _compression = _interopRequireDefault(require("compression"));
14
-
15
9
  var _webpackDevMiddleware = _interopRequireDefault(require("webpack-dev-middleware"));
16
-
17
10
  var _httpProxyMiddleware = require("http-proxy-middleware");
18
-
19
11
  var _HMRMiddleware = _interopRequireDefault(require("../middlewares/HMRMiddleware"));
20
-
21
12
  var _utils = require("../utils");
22
-
23
13
  var _httpsOptions = require("./httpsOptions");
24
-
25
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
-
27
15
  // import fs from 'fs';
16
+
28
17
  let options = (0, _utils.getOptions)();
29
18
  let {
30
19
  app: {
@@ -48,20 +37,17 @@ const {
48
37
  writeToDisk
49
38
  } = options.impactService;
50
39
  const app = (0, _express.default)();
51
-
52
40
  if (hasMock) {
53
41
  app.use(server.mockPrefix, (0, _httpProxyMiddleware.createProxyMiddleware)({
54
42
  target: 'ht' + `tp://localhost:${mockPort}`,
55
43
  changeOrigin: true
56
44
  }));
57
45
  }
58
-
59
46
  app.use(_express.default.json());
60
47
  app.use(_express.default.urlencoded({
61
48
  extended: true
62
49
  }));
63
50
  let config;
64
-
65
51
  if (mode === 'prod') {
66
52
  config = require('../configs/webpack.prod.config');
67
53
  app.use((0, _compression.default)());
@@ -69,8 +55,8 @@ if (mode === 'prod') {
69
55
  config = require('../configs/webpack.dev.config');
70
56
  } else {
71
57
  throw new Error('You must configure valid option in mode');
72
- } // console.log({ contextURL });
73
-
58
+ }
59
+ // console.log({ contextURL });
74
60
 
75
61
  let compiler = (0, _webpack.default)(config);
76
62
  let webpackServerOptions = {
@@ -84,25 +70,22 @@ let webpackServerOptions = {
84
70
  },
85
71
  compress: mode === 'prod'
86
72
  };
87
-
88
73
  if (options.app.disableWatch) {
89
74
  webpackServerOptions.watchOptions = {
90
75
  ignored: /./
91
76
  };
92
77
  }
93
-
94
78
  if (writeToDisk) {
95
79
  webpackServerOptions.writeToDisk = true;
96
80
  }
97
-
98
81
  app.use((0, _webpackDevMiddleware.default)(compiler, webpackServerOptions));
99
82
  app.use((0, _HMRMiddleware.default)(compiler, {
100
83
  path: '/sockjs-node/info'
101
84
  }));
102
85
  app.use((req, res, next) => {
103
86
  //console.log('origin', req.get('origin'));
104
- res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*'); // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));
105
-
87
+ res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*');
88
+ // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));
106
89
  res.setHeader('Access-Control-Allow-Private-Network', true);
107
90
  res.setHeader('Access-Control-Allow-Credentials', true);
108
91
  next();
@@ -113,9 +96,7 @@ app.options('/*', (req, res) => {
113
96
  app.use('/wms/*', (req, res) => {
114
97
  res.sendFile(_path.default.join(__dirname, '..', '..', 'templates', 'wms', 'index.html'));
115
98
  });
116
-
117
99
  const httpsServer = _https.default.createServer(_httpsOptions.httpsOptions, app);
118
-
119
100
  const wss = new _ws.default.Server({
120
101
  server: httpsServer
121
102
  });
@@ -135,7 +116,6 @@ app.post('/wmsmockapi', (req, res) => {
135
116
  let {
136
117
  body
137
118
  } = req;
138
-
139
119
  try {
140
120
  ws.send(JSON.stringify(body));
141
121
  } catch (e) {
@@ -151,12 +131,10 @@ compiler.hooks.afterCompile.tap('ReactCLI', compilation => {
151
131
  });
152
132
  compiler.hooks.done.tap('ReactCLI', () => {
153
133
  const indexHtml = webpackCompilation.assets['index.html'];
154
-
155
134
  if (indexHtml) {
156
135
  initalHTML = indexHtml.source();
157
136
  }
158
137
  });
159
-
160
138
  if (contextURL) {
161
139
  app.use(contextURL, _express.default.static(context));
162
140
  app.use(`${contextURL}/*`, (req, res) => {
@@ -166,20 +144,17 @@ if (contextURL) {
166
144
  app.use(_express.default.static(context));
167
145
  app.use('/*', _express.default.static(context));
168
146
  }
169
-
170
147
  httpsServer.listen(port, err => {
171
148
  if (err) {
172
149
  throw err;
173
150
  }
174
-
175
151
  (0, _utils.log)(`Listening at ${serverUrl}${contextURL}/`);
176
152
  });
177
-
178
153
  if (isCompatableHttp2) {
179
154
  const http2 = require('http2');
155
+ const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions);
180
156
 
181
- const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions); // eslint-disable-next-line no-unused-vars
182
-
157
+ // eslint-disable-next-line no-unused-vars
183
158
  http2Server.on('stream', (stream, headers) => {
184
159
  stream.respond({
185
160
  'content-type': 'text/html',
@@ -192,7 +167,6 @@ if (isCompatableHttp2) {
192
167
  if (err) {
193
168
  throw err;
194
169
  }
195
-
196
170
  (0, _utils.log)(`Listening at ${(0, _utils.getServerURL)({
197
171
  host,
198
172
  domain,
@@ -202,13 +176,11 @@ if (isCompatableHttp2) {
202
176
  } else {
203
177
  (0, _utils.log)('Your node version didn\'t adopted http2 support. Kindly update that to 8 LTS or above you can engage the http2');
204
178
  }
205
-
206
179
  let httpPort = Number(port) + (isCompatableHttp2 ? 2 : 1);
207
180
  app.listen(httpPort, err => {
208
181
  if (err) {
209
182
  throw err;
210
183
  }
211
-
212
184
  (0, _utils.log)(`Listening at ${(0, _utils.getServerURL)({
213
185
  host,
214
186
  domain,
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _screenshotTest = _interopRequireDefault(require("@zohodesk/screenshot-test"));
4
-
5
4
  var _jsonHelper = require("../utils/jsonHelper");
6
-
7
5
  var _utils = require("../utils");
8
-
9
6
  var _docsServerCore = _interopRequireDefault(require("./docsServerCore"));
10
-
11
7
  var _SSTMiddleware = _interopRequireDefault(require("../middlewares/SSTMiddleware"));
12
-
13
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
9
  let options = (0, _utils.getOptions)();
16
10
  let impactedComponentObject = null;
17
11
  let docsServerInstance;
@@ -27,7 +21,6 @@ let {
27
21
  server
28
22
  }
29
23
  } = options;
30
-
31
24
  function closeServer(serverInstance) {
32
25
  (0, _utils.log)('Docs service stopped!');
33
26
  let {
@@ -39,12 +32,10 @@ function closeServer(serverInstance) {
39
32
  https.close();
40
33
  wdm.close();
41
34
  }
42
-
43
35
  (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.screenshotTest.compareBranch', referBranch);
44
36
  (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.screenshotTest.TestBranch', currentBranch);
45
37
  (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.screenshotTest.isExecuted', true);
46
38
  (0, _utils.log)('Test Branch Name :- ', currentBranch);
47
-
48
39
  let afterFirstScreenShotCollected = () => {
49
40
  closeServer(docsServerInstance);
50
41
  (0, _utils.switchBranch)('git', referBranch).then(() => {
@@ -54,7 +45,6 @@ let afterFirstScreenShotCollected = () => {
54
45
  });
55
46
  });
56
47
  };
57
-
58
48
  let onSStestEnd = (status, resultObject, isLastRun, runSSTest) => {
59
49
  if (status) {
60
50
  if (!isLastRun) {
@@ -82,17 +72,13 @@ let onSStestEnd = (status, resultObject, isLastRun, runSSTest) => {
82
72
  throw new Error('Component list undefined! Please check component Docs');
83
73
  }
84
74
  };
85
-
86
75
  (0, _utils.ssTestHack)();
87
-
88
76
  let getDocsServerInstance = beforeJobs => {
89
77
  if (typeof beforeJobs === 'function') {
90
78
  beforeJobs();
91
79
  }
92
-
93
80
  return (0, _docsServerCore.default)(true);
94
81
  };
95
-
96
82
  let runSSTest = (onBefore, isLastRun, mode, branch, listOfComponents) => {
97
83
  let url = (0, _utils.getServerURL)(Object.assign(server, {
98
84
  host: server.iphost
@@ -100,7 +86,6 @@ let runSSTest = (onBefore, isLastRun, mode, branch, listOfComponents) => {
100
86
  docsServerInstance = getDocsServerInstance(onBefore);
101
87
  docsServerInstance.app.use((0, _SSTMiddleware.default)(docsServerInstance.compiler, mData => {
102
88
  impactedComponentObject = (0, _utils.getComponents)(mData, listOfComponents);
103
-
104
89
  _screenshotTest.default.run({
105
90
  branch,
106
91
  seleniumHub: seleniumHub,
@@ -115,7 +100,6 @@ let runSSTest = (onBefore, isLastRun, mode, branch, listOfComponents) => {
115
100
  });
116
101
  }));
117
102
  };
118
-
119
103
  (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.screenshotTest.startTime', Date.now());
120
104
  (0, _utils.getDependenciesImpactList)(currentBranch, referBranch).then(impactedList => {
121
105
  (0, _utils.log)('from here ');
@@ -1,34 +1,34 @@
1
- #!/bin/sh
2
-
3
- STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
4
-
5
- CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
6
-
7
- echo "Branch Name - $CURRENT_BRANCH"
8
-
9
- if [[ "$STAGED_FILES" = "" ]]; then
10
- exit 0
11
- fi
12
-
13
- IS_FAILED=false
14
- FILES=""
15
-
16
- for FILE in $STAGED_FILES # Add files with space separation
17
- do
18
- FILES+="$FILE "
19
- done
20
-
21
- npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
22
-
23
- if [[ "$?" != 0 ]]; then
24
- IS_FAILED=true
25
- fi
26
-
27
- if $IS_FAILED; then
28
- echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
29
- exit 1
30
- else
31
- echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
32
- fi
33
-
34
- exit $?
1
+ #!/bin/sh
2
+
3
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
4
+
5
+ CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
6
+
7
+ echo "Branch Name - $CURRENT_BRANCH"
8
+
9
+ if [[ "$STAGED_FILES" = "" ]]; then
10
+ exit 0
11
+ fi
12
+
13
+ IS_FAILED=false
14
+ FILES=""
15
+
16
+ for FILE in $STAGED_FILES # Add files with space separation
17
+ do
18
+ FILES+="$FILE "
19
+ done
20
+
21
+ npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
22
+
23
+ if [[ "$?" != 0 ]]; then
24
+ IS_FAILED=true
25
+ fi
26
+
27
+ if $IS_FAILED; then
28
+ echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
29
+ exit 1
30
+ else
31
+ echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
32
+ fi
33
+
34
+ exit $?
@@ -1,45 +1,45 @@
1
- #!/bin/bash
2
- branchName=$2
3
- url=$1
4
- zipUrl=$3
5
- unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
6
- publishFolder=$branchName"_"$unique
7
-
8
- rm -rf ./reports
9
- rm -rf ./scrTemplate
10
- rm -rf ./errTemplate
11
- rm -rf ./css
12
- rm -rf ./js
13
- rm -rf ./index.html
14
-
15
- curl $zipUrl | tar xz
16
-
17
- cp -rf ./reports/css ./css
18
- cp -rf ./reports/js ./js
19
- cp -rf ./reports/index.html ./index.html
20
- if [ -d "./screenShots" ] ; then
21
- cp -rf ./scrTemplate/* ./screenShots/
22
- else
23
- mkdir ./screenShots
24
- cp -rf ./scrTemplate/* ./screenShots/
25
- fi
26
-
27
- [ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
28
- [ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
29
- [ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
30
- [ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
31
- [ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
32
-
33
- tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
34
-
35
- curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
36
- replace=$publishFolder
37
- reportUrl=$url"/"$replace
38
- subject="Client Report - React - $publishFolder"
39
- msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
40
- <p><b>Report Branchname - $branchName</b></p>
41
- <p><b>Report Unique ID - $unique</b></p>
42
- <p><b>Report Developer - $6</b></p>"
43
- #node mailSender.js <from> <pass> <to> <subject> <text>
44
- BASEDIR=$(dirname "$0")
45
- node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
1
+ #!/bin/bash
2
+ branchName=$2
3
+ url=$1
4
+ zipUrl=$3
5
+ unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
6
+ publishFolder=$branchName"_"$unique
7
+
8
+ rm -rf ./reports
9
+ rm -rf ./scrTemplate
10
+ rm -rf ./errTemplate
11
+ rm -rf ./css
12
+ rm -rf ./js
13
+ rm -rf ./index.html
14
+
15
+ curl $zipUrl | tar xz
16
+
17
+ cp -rf ./reports/css ./css
18
+ cp -rf ./reports/js ./js
19
+ cp -rf ./reports/index.html ./index.html
20
+ if [ -d "./screenShots" ] ; then
21
+ cp -rf ./scrTemplate/* ./screenShots/
22
+ else
23
+ mkdir ./screenShots
24
+ cp -rf ./scrTemplate/* ./screenShots/
25
+ fi
26
+
27
+ [ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
28
+ [ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
29
+ [ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
30
+ [ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
31
+ [ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
32
+
33
+ tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
34
+
35
+ curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
36
+ replace=$publishFolder
37
+ reportUrl=$url"/"$replace
38
+ subject="Client Report - React - $publishFolder"
39
+ msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
40
+ <p><b>Report Branchname - $branchName</b></p>
41
+ <p><b>Report Unique ID - $unique</b></p>
42
+ <p><b>Report Developer - $6</b></p>"
43
+ #node mailSender.js <from> <pass> <to> <subject> <text>
44
+ BASEDIR=$(dirname "$0")
45
+ node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
@@ -8,27 +8,21 @@ window.ClientCoverage = {
8
8
  localStorage.setItem(property, JSON.stringify(defaultVal));
9
9
  return defaultVal;
10
10
  }
11
-
12
11
  localStorage.setItem(property, JSON.stringify(defaultVal));
13
12
  return defaultVal || {};
14
13
  },
15
-
16
14
  clearLocalStorage(property) {
17
15
  localStorage.removeItem(property);
18
16
  }
19
-
20
17
  },
21
18
  JS: {
22
19
  jsMethodInstrumentObject: {},
23
20
  jsStorageKey: 'jsClientCoverageObject',
24
-
25
21
  init() {
26
22
  this.jsMethodInstrumentObject = ClientCoverage.LocalStorageWrapper.getLocalStorage(this.jsStorageKey, this.jsMethodInstrumentObject);
27
23
  },
28
-
29
24
  visitMethod(jsFileName, jsMethodName) {
30
25
  this.init();
31
-
32
26
  if (this.jsMethodInstrumentObject.hasOwnProperty(jsFileName)) {
33
27
  if (!this.jsMethodInstrumentObject[jsFileName].includes(jsMethodName)) {
34
28
  this.jsMethodInstrumentObject[jsFileName].push(jsMethodName);
@@ -37,35 +31,27 @@ window.ClientCoverage = {
37
31
  this.jsMethodInstrumentObject[jsFileName] = [];
38
32
  this.jsMethodInstrumentObject[jsFileName].push(jsMethodName);
39
33
  }
40
-
41
34
  localStorage.setItem(this.jsStorageKey, JSON.stringify(this.jsMethodInstrumentObject));
42
35
  },
43
-
44
36
  clear() {
45
37
  this.jsMethodInstrumentObject = {};
46
38
  ClientCoverage.LocalStorageWrapper.clearLocalStorage(this.jsStorageKey);
47
39
  },
48
-
49
40
  getData() {
50
41
  return {
51
42
  methods: this.jsMethodInstrumentObject
52
43
  };
53
44
  }
54
-
55
45
  },
56
-
57
46
  getCoverageData() {
58
47
  return {
59
48
  JS: this.JS.getData()
60
49
  };
61
50
  },
62
-
63
51
  clear() {
64
52
  this.JS.clear();
65
53
  },
66
-
67
54
  init() {
68
55
  this.JS.init();
69
56
  }
70
-
71
57
  };
@@ -1,40 +1,34 @@
1
1
  "use strict";
2
2
 
3
3
  var _querystring = _interopRequireDefault(require("querystring"));
4
-
5
4
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
5
  let log = (...args) => {
8
6
  let print = console;
9
7
  print.log(...args);
10
- }; // eslint-disable-next-line no-undef
11
-
8
+ };
12
9
 
10
+ // eslint-disable-next-line no-undef
13
11
  let options = _querystring.default.parse(__resourceQuery.slice(1));
14
-
15
12
  window.WebSocket = window.WebSocket || window.MozWebSocket;
16
13
  let connection = new WebSocket(options.wmsPath);
17
-
18
14
  connection.onopen = () => {
19
15
  // connection is opened and ready to use
20
16
  log('open');
21
17
  };
22
-
23
18
  connection.onerror = error => {
24
19
  // an error occurred when sending/receiving data
25
20
  throw error;
26
21
  };
27
-
28
22
  connection.onmessage = message => {
29
23
  // try to decode json (I assume that each message
30
24
  // from server is json)
31
25
  try {
32
- let json = JSON.parse(message.data); // eslint-disable-next-line no-undef
33
-
26
+ let json = JSON.parse(message.data);
27
+ // eslint-disable-next-line no-undef
34
28
  Collaboration.handleCustomMessage(json);
35
29
  } catch (e) {
36
30
  log('This doesn\'t look like a valid JSON: ', message.data);
37
31
  return;
38
- } // handle incoming message
39
-
32
+ }
33
+ // handle incoming message
40
34
  };
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.a = void 0;
7
-
8
7
  let a = require.resolve('babel-plugin-transform-define');
9
-
10
8
  exports.a = a;
11
9
  var _default = {
12
10
  presets: [['env', {