@zohodesk/react-cli 0.0.1-beta.17 → 0.0.1-beta.171

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 (292) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +49 -10
  3. package/.prettierrc +6 -0
  4. package/CHANGELOG.md +5 -0
  5. package/README.md +859 -0
  6. package/bin/cli.js +215 -46
  7. package/cert/Tsicsezwild-22-23.crt +37 -0
  8. package/cert/Tsicsezwild-22-23.key +27 -0
  9. package/docs/CustomChunks.md +26 -0
  10. package/docs/DevStart.md +18 -0
  11. package/docs/HoverActive.md +12 -0
  12. package/docs/InstallNode.md +28 -0
  13. package/docs/TODOS.md +10 -0
  14. package/docs/ValueReplacer.md +60 -0
  15. package/docs/warnings_while_install.txt +35 -0
  16. package/files/eslintrc.js +62 -0
  17. package/files/prettierrc.js +3 -0
  18. package/lib/babel/cmjs-plugins-presets.js +24 -0
  19. package/lib/babel/es-plugins-presets.js +34 -0
  20. package/lib/common/getEntries.js +33 -46
  21. package/lib/common/getPublicPathConfig.js +40 -0
  22. package/lib/common/index.js +24 -19
  23. package/lib/common/splitChunks.js +110 -25
  24. package/lib/common/sslcertUpdater.js +59 -0
  25. package/lib/common/templateParameters.js +25 -0
  26. package/lib/common/testPattern.js +69 -0
  27. package/lib/common/valueReplacer.js +55 -0
  28. package/lib/configs/jest.config.js +31 -27
  29. package/lib/configs/libAlias.js +31 -0
  30. package/lib/configs/webpack.component.umd.config.js +46 -53
  31. package/lib/configs/webpack.css.umd.config.js +47 -46
  32. package/lib/configs/webpack.dev.config.js +99 -84
  33. package/lib/configs/webpack.docs.config.js +65 -57
  34. package/lib/configs/webpack.impact.config.js +109 -0
  35. package/lib/configs/webpack.prod.config.js +147 -104
  36. package/lib/hooks/docsProptypeHook.js +32 -38
  37. package/lib/jest/commitedFilesResult.js +144 -71
  38. package/lib/jest/coverageCollector.js +68 -35
  39. package/lib/jest/jsonMaker.js +54 -0
  40. package/lib/jest/preProcessors/cssPreprocessor.js +16 -18
  41. package/lib/jest/preProcessors/jsPreprocessor.js +5 -6
  42. package/lib/jest/preProcessors/otherFilesPreprocessor.js +5 -6
  43. package/lib/jest/result.js +92 -42
  44. package/lib/jest/run.js +75 -28
  45. package/lib/jest/setup.js +103 -102
  46. package/lib/loaderUtils/configsAssetsLoaders.js +117 -0
  47. package/lib/loaderUtils/getCSSLoaders.js +113 -0
  48. package/lib/loaderUtils/getDevJsLoaders.js +35 -23
  49. package/lib/loaderUtils/index.js +14 -7
  50. package/lib/loaders/docsLoader.js +15 -15
  51. package/lib/loaders/docsPropsLoader.js +14 -17
  52. package/lib/loaders/fileBountryLoader.js +17 -0
  53. package/lib/loaders/fileLoader.js +47 -38
  54. package/lib/loaders/scriptInstrumentLoader.js +23 -20
  55. package/lib/loaders/selectorMappingLoader.js +75 -0
  56. package/lib/loaders/workerLoader.js +136 -0
  57. package/lib/middlewares/HMRMiddleware.js +90 -72
  58. package/lib/middlewares/SSTMiddleware.js +21 -0
  59. package/lib/pluginUtils/getDevPlugins.js +177 -30
  60. package/lib/pluginUtils/getDocsPlugins.js +36 -15
  61. package/lib/pluginUtils/getLibraryImactPlugins.js +23 -0
  62. package/lib/pluginUtils/getLibraryPlugins.js +8 -10
  63. package/lib/pluginUtils/getProdPlugins.js +244 -37
  64. package/lib/pluginUtils/getServerPlugins.js +8 -11
  65. package/lib/pluginUtils/getUMDCSSPlugins.js +14 -18
  66. package/lib/pluginUtils/getUMDComponentPlugins.js +14 -9
  67. package/lib/pluginUtils/index.js +36 -43
  68. package/lib/plugins/CdnChangePlugin.js +77 -0
  69. package/lib/plugins/CleanupStatsPlugin.js +28 -0
  70. package/lib/plugins/EFCPlugin.js +241 -0
  71. package/lib/plugins/EFCPlugin.md +6 -0
  72. package/lib/plugins/EFCTemplatePlugin.js +151 -0
  73. package/lib/plugins/I18NInjectIntoIndexPlugin.js +141 -0
  74. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +60 -0
  75. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +44 -0
  76. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +266 -0
  77. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +183 -0
  78. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +100 -0
  79. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -0
  80. package/lib/plugins/I18nSplitPlugin/README.md +25 -0
  81. package/lib/plugins/I18nSplitPlugin/index.js +185 -0
  82. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +64 -0
  83. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +13 -0
  84. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +26 -0
  85. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +40 -0
  86. package/lib/plugins/I18nSplitPlugin/utils/index.js +31 -0
  87. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +112 -0
  88. package/lib/plugins/ManifestPlugin.js +86 -0
  89. package/lib/plugins/ModuleStatsPlugin.js +98 -97
  90. package/lib/plugins/OptimizeJSPlugin.js +41 -0
  91. package/lib/plugins/PublicPathCallbackPlugin.js +63 -0
  92. package/lib/plugins/PublicPathChangePlugin.js +226 -0
  93. package/lib/plugins/ReportGeneratePlugin.js +181 -0
  94. package/lib/plugins/RequireVariablePublicPlugin.js +30 -0
  95. package/lib/plugins/ResourceHintsPlugin.js +67 -0
  96. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +80 -0
  97. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +82 -0
  98. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -0
  99. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +26 -0
  100. package/lib/plugins/ScriptInstrumentPlugin.js +22 -37
  101. package/lib/plugins/ServiceWorkerPlugin.js +107 -0
  102. package/lib/plugins/ShadowDOMSupportPlugin.js +270 -0
  103. package/lib/plugins/SourceMapHookPlugin.js +25 -59
  104. package/lib/plugins/TPHashMappingPlugin.js +67 -0
  105. package/lib/plugins/UglifyCSSPlugin.js +39 -0
  106. package/lib/plugins/UnusedFilesFindPlugin.js +150 -97
  107. package/lib/plugins/index.js +127 -37
  108. package/lib/plugins/libraryImpactPlugin.js +190 -0
  109. package/lib/plugins/webpackwatchrunplugin.js +26 -0
  110. package/lib/postcss-plugins/ExcludePlugin.js +23 -0
  111. package/lib/postcss-plugins/RTLSplitPlugin.js +138 -0
  112. package/lib/postcss-plugins/ValueReplacer.js +46 -0
  113. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
  114. package/lib/postcss-plugins/__test__/test1Input.css +39 -0
  115. package/lib/postcss-plugins/__test__/test1Output.css +39 -0
  116. package/lib/postcss-plugins/hoverActivePlugin.js +368 -0
  117. package/lib/postcss-plugins/variableModifier.js +243 -0
  118. package/lib/schemas/index.js +541 -65
  119. package/lib/servers/clusterHubServer.js +22 -26
  120. package/lib/servers/devBuild.js +102 -0
  121. package/lib/servers/docsServer.js +3 -5
  122. package/lib/servers/docsServerCore.js +94 -79
  123. package/lib/servers/getCliPath.js +28 -0
  124. package/lib/servers/helpServer.js +19 -21
  125. package/lib/servers/httpsOptions.js +18 -0
  126. package/lib/servers/impactServer.js +123 -115
  127. package/lib/servers/mockserver.js +44 -0
  128. package/lib/servers/nowatchserver.js +200 -0
  129. package/lib/servers/scrServer.js +147 -0
  130. package/lib/servers/server.js +134 -132
  131. package/lib/servers/ssServer.js +106 -70
  132. package/lib/sh/reportPublish.sh +16 -10
  133. package/lib/templates/CoverageScriptTemplate.js +45 -18
  134. package/lib/templates/WMSTemplate.js +17 -18
  135. package/lib/templates/linterConstant.js +10 -0
  136. package/lib/utils/babelPresets.js +12 -4
  137. package/lib/utils/buildstats.html +148 -0
  138. package/lib/utils/clean.js +12 -11
  139. package/lib/utils/copy.js +16 -109
  140. package/lib/utils/copyTimezones.js +21 -0
  141. package/lib/utils/createEventStream.js +24 -19
  142. package/lib/utils/cssClassNameGenerate.js +77 -0
  143. package/lib/utils/cssURLReplacer.js +136 -0
  144. package/lib/utils/dependencyPostPublish.js +42 -0
  145. package/lib/utils/fileUtils.js +125 -0
  146. package/lib/utils/folderIterator.js +47 -0
  147. package/lib/utils/getComponents.js +126 -0
  148. package/lib/utils/getCurrentBranch.js +11 -17
  149. package/lib/utils/getDependenciesImpactList.js +151 -0
  150. package/lib/utils/getHash.js +26 -0
  151. package/lib/utils/getIp.js +20 -0
  152. package/lib/utils/getOptions.js +113 -28
  153. package/lib/utils/getServerURL.js +25 -8
  154. package/lib/utils/index.js +283 -68
  155. package/lib/utils/init.js +2 -2
  156. package/lib/utils/initPreCommitHook.js +47 -27
  157. package/lib/utils/jsonHelper.js +106 -0
  158. package/lib/utils/libraryImpactConfig.js +63 -0
  159. package/lib/utils/lint/addScripts.js +27 -0
  160. package/lib/utils/lint/checkExistingConfig.js +67 -0
  161. package/lib/utils/lint/copyConfigs.js +24 -0
  162. package/lib/utils/lint/index.js +54 -0
  163. package/lib/utils/lint/lintScripts.js +11 -0
  164. package/lib/utils/lint/lintSetup.js +31 -0
  165. package/lib/utils/lint/lintStagedPreCommitHook.js +7 -0
  166. package/lib/utils/lint/question.js +30 -0
  167. package/lib/utils/lintReporter.js +142 -0
  168. package/lib/utils/mailSender.js +16 -25
  169. package/lib/utils/pullOrigin.js +28 -0
  170. package/lib/utils/reinstallDependencies.js +133 -0
  171. package/lib/utils/removeAttributes.js +25 -23
  172. package/lib/utils/repoClone.js +59 -63
  173. package/lib/utils/request.js +64 -77
  174. package/lib/utils/resultSchema.json +73 -0
  175. package/lib/utils/rtl.js +59 -0
  176. package/lib/utils/setEnvVariables.js +13 -0
  177. package/lib/utils/ssTestHack.js +48 -0
  178. package/lib/utils/switchBranch.js +28 -0
  179. package/lib/utils/urlConcat.js +22 -0
  180. package/lib/utils/useExitCleanup.js +55 -0
  181. package/npm8.md +9 -0
  182. package/package.json +96 -64
  183. package/postpublish.js +6 -0
  184. package/templates/app/.eslintrc.js +140 -0
  185. package/templates/app/README.md +12 -12
  186. package/templates/app/app/index.html +24 -8
  187. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  188. package/templates/app/app/properties/i18nkeys.json +3 -3
  189. package/templates/app/docs/all.html +69 -69
  190. package/templates/app/mockapi/index.js +18 -13
  191. package/templates/app/package.json +37 -17
  192. package/templates/app/src/actions/SampleActions/index.js +37 -0
  193. package/templates/app/src/actions/index.js +65 -0
  194. package/templates/app/src/appUrls.js +19 -0
  195. package/templates/app/src/components/Alert/Alert.js +134 -0
  196. package/templates/app/src/components/Alert/Alert.module.css +79 -0
  197. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -0
  198. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -0
  199. package/templates/app/src/components/Sample/Sample.module.css +11 -0
  200. package/templates/app/src/components/Sample/SampleList.js +61 -0
  201. package/templates/app/src/components/Slider/Slider.css +41 -0
  202. package/templates/app/src/components/Slider/Slider.js +55 -0
  203. package/templates/app/src/containers/AlertContainer/index.js +15 -0
  204. package/templates/app/src/containers/AppContainer/index.js +96 -0
  205. package/templates/app/src/containers/AppContainer/index.module.css +27 -0
  206. package/templates/app/src/containers/CustomMatch/index.js +65 -0
  207. package/templates/app/src/containers/DevTools/index.js +10 -0
  208. package/templates/app/src/containers/Header/index.js +67 -0
  209. package/templates/app/src/containers/Header/index.module.css +43 -0
  210. package/templates/app/src/containers/Redirect/index.js +63 -0
  211. package/templates/app/src/containers/Redirector/index.js +47 -0
  212. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -0
  213. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -0
  214. package/templates/app/src/historyChange.js +5 -0
  215. package/templates/app/src/index.html +10 -0
  216. package/templates/app/src/index.js +24 -0
  217. package/templates/app/src/middleware/PromiseMiddleware.js +59 -0
  218. package/templates/app/src/reducers/alertData.js +11 -0
  219. package/templates/app/src/reducers/index.js +6 -0
  220. package/templates/app/src/reducers/samples.js +19 -0
  221. package/templates/app/src/store/configureStore.dev.js +51 -0
  222. package/templates/app/src/store/configureStore.js +5 -0
  223. package/templates/app/src/store/configureStore.prod.js +26 -0
  224. package/templates/app/src/util/Common.js +5 -0
  225. package/templates/app/src/util/RequestAPI.js +132 -0
  226. package/templates/appold/README.md +12 -0
  227. package/templates/appold/app/index.html +8 -0
  228. package/templates/appold/app/properties/ApplicationResources_en_US.properties +1 -0
  229. package/templates/appold/app/properties/i18nkeys.json +3 -0
  230. package/templates/appold/docs/all.html +69 -0
  231. package/templates/appold/mockapi/index.js +13 -0
  232. package/templates/{app → appold}/mockapi/tickets.json +0 -0
  233. package/templates/appold/package.json +17 -0
  234. package/templates/appold/src/components/Text/Text.css +0 -0
  235. package/templates/appold/src/components/Text/Text.js +23 -0
  236. package/templates/appold/src/components/Text/__tests__/Text.spec.js +30 -0
  237. package/templates/appold/src/components/Text/docs/Text__default.docs.js +16 -0
  238. package/templates/appold/src/components/docs.js +1 -0
  239. package/templates/appold/src/components/index.js +5 -0
  240. package/templates/appold/src/index.js +13 -0
  241. package/templates/docs/all.html +1 -1
  242. package/templates/docs/component.html +110 -69
  243. package/templates/docs/components.html +221 -0
  244. package/templates/docs/css/component.css +12 -14
  245. package/templates/docs/css/componentTest.css +7 -0
  246. package/templates/docs/css/style.css +150 -206
  247. package/templates/docs/impactReportTemplate.html +154 -0
  248. package/templates/docs/index.html +1482 -1336
  249. package/templates/library/src/index.js +0 -0
  250. package/.npmignore +0 -3
  251. package/cert/cert.pem +0 -129
  252. package/cert/key.pem +0 -27
  253. package/lib/common/getInsertAt.js +0 -36
  254. package/lib/common/getInsertIntoFunction.js +0 -13
  255. package/lib/configs/webpack.server.config.js +0 -93
  256. package/lib/plugins/ChunkManifestReplacePlugin.js +0 -94
  257. package/lib/plugins/RuntimePublicPathPlugin.js +0 -46
  258. package/lib/rmcntrlm.sh +0 -14
  259. package/lib/servers/nodeServer.js +0 -238
  260. package/lib/templates/HMRTemplate.js +0 -256
  261. package/lib/templates/publicPathTemplate.js +0 -16
  262. package/lib/utils/setConfig.js +0 -14
  263. package/node_modules/history/CHANGES.md +0 -395
  264. package/node_modules/history/DOMUtils.js +0 -3
  265. package/node_modules/history/ExecutionEnvironment.js +0 -3
  266. package/node_modules/history/LICENSE +0 -21
  267. package/node_modules/history/LocationUtils.js +0 -3
  268. package/node_modules/history/PathUtils.js +0 -3
  269. package/node_modules/history/README.md +0 -282
  270. package/node_modules/history/cjs/history.js +0 -933
  271. package/node_modules/history/cjs/history.min.js +0 -1
  272. package/node_modules/history/createBrowserHistory.js +0 -3
  273. package/node_modules/history/createHashHistory.js +0 -3
  274. package/node_modules/history/createMemoryHistory.js +0 -3
  275. package/node_modules/history/createTransitionManager.js +0 -3
  276. package/node_modules/history/es/DOMUtils.js +0 -7
  277. package/node_modules/history/es/ExecutionEnvironment.js +0 -7
  278. package/node_modules/history/es/LocationUtils.js +0 -7
  279. package/node_modules/history/es/PathUtils.js +0 -7
  280. package/node_modules/history/es/createBrowserHistory.js +0 -7
  281. package/node_modules/history/es/createHashHistory.js +0 -7
  282. package/node_modules/history/es/createMemoryHistory.js +0 -7
  283. package/node_modules/history/es/createTransitionManager.js +0 -7
  284. package/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
  285. package/node_modules/history/esm/history.js +0 -904
  286. package/node_modules/history/index.js +0 -7
  287. package/node_modules/history/package.json +0 -134
  288. package/node_modules/history/umd/history.js +0 -1059
  289. package/node_modules/history/umd/history.min.js +0 -1
  290. package/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
  291. package/templates/app/.npmignore +0 -9
  292. package/templates/library/.npmignore +0 -9
@@ -1,51 +1,45 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _propTypes = require('prop-types');
4
-
5
- var _propTypes2 = _interopRequireDefault(_propTypes);
3
+ var _propTypes = _interopRequireDefault(require("prop-types"));
6
4
 
7
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
6
 
9
- _propTypes2.default.array.hookType = 'array';
10
- _propTypes2.default.bool.hookType = 'bool';
11
- _propTypes2.default.func.hookType = 'func';
12
- _propTypes2.default.number.hookType = 'number';
13
- _propTypes2.default.object.hookType = 'object';
14
- _propTypes2.default.string.hookType = 'string';
15
- _propTypes2.default.symbol.hookType = 'symbol';
16
- _propTypes2.default.element.hookType = 'element';
17
- _propTypes2.default.node.hookType = 'element';
18
- _propTypes2.default.array.isRequired.hookType = 'array';
19
- _propTypes2.default.bool.isRequired.hookType = 'bool';
20
- _propTypes2.default.func.isRequired.hookType = 'func';
21
- _propTypes2.default.number.isRequired.hookType = 'number';
22
- _propTypes2.default.object.isRequired.hookType = 'object';
23
- _propTypes2.default.string.isRequired.hookType = 'string';
24
- _propTypes2.default.symbol.isRequired.hookType = 'symbol';
25
- _propTypes2.default.element.isRequired.hookType = 'element';
26
- _propTypes2.default.node.isRequired.hookType = 'element';
27
- function proxy(fn, type) {
28
- var oneOf = fn;
29
- return function () {
30
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
32
- }
7
+ _propTypes.default.array.hookType = 'array';
8
+ _propTypes.default.bool.hookType = 'bool';
9
+ _propTypes.default.func.hookType = 'func';
10
+ _propTypes.default.number.hookType = 'number';
11
+ _propTypes.default.object.hookType = 'object';
12
+ _propTypes.default.string.hookType = 'string';
13
+ _propTypes.default.symbol.hookType = 'symbol';
14
+ _propTypes.default.element.hookType = 'element';
15
+ _propTypes.default.node.hookType = 'element';
16
+ _propTypes.default.array.isRequired.hookType = 'array';
17
+ _propTypes.default.bool.isRequired.hookType = 'bool';
18
+ _propTypes.default.func.isRequired.hookType = 'func';
19
+ _propTypes.default.number.isRequired.hookType = 'number';
20
+ _propTypes.default.object.isRequired.hookType = 'object';
21
+ _propTypes.default.string.isRequired.hookType = 'string';
22
+ _propTypes.default.symbol.isRequired.hookType = 'symbol';
23
+ _propTypes.default.element.isRequired.hookType = 'element';
24
+ _propTypes.default.node.isRequired.hookType = 'element';
33
25
 
34
- var a = oneOf.apply(undefined, args);
35
- var type1 = Array.isArray(args) && Array.isArray(args[0]) ? type + '[' + args[0].map(function (data) {
36
- return typeof data === 'function' ? data.hookType //arrayOf shape complex type not mention
37
- : JSON.stringify(data);
38
- }) + ']' : type;
26
+ function proxy(fn, type) {
27
+ let oneOf = fn;
28
+ return (...args) => {
29
+ let a = oneOf(...args);
30
+ let type1 = Array.isArray(args) && Array.isArray(args[0]) ? `${type}[${args[0].map(data => typeof data === 'function' ? data.hookType //arrayOf shape complex type not mention
31
+ : JSON.stringify(data))}]` : type;
39
32
  a.hookType = type1;
33
+
40
34
  if (a.isRequired) {
41
35
  a.isRequired.hookType = type1;
42
36
  }
37
+
43
38
  return a;
44
39
  };
45
40
  }
46
- _propTypes2.default.oneOf = proxy(_propTypes2.default.oneOf, 'enum');
47
- _propTypes2.default.oneOfType = proxy(_propTypes2.default.oneOfType, 'union');
48
- _propTypes2.default.arrayOf = proxy(_propTypes2.default.arrayOf, 'arrayOf');
49
- _propTypes2.default.shape = proxy(_propTypes2.default.shape, 'shape');
50
41
 
51
- // export default PropTypes;
42
+ _propTypes.default.oneOf = proxy(_propTypes.default.oneOf, 'enum');
43
+ _propTypes.default.oneOfType = proxy(_propTypes.default.oneOfType, 'union');
44
+ _propTypes.default.arrayOf = proxy(_propTypes.default.arrayOf, 'arrayOf');
45
+ _propTypes.default.shape = proxy(_propTypes.default.shape, 'shape'); // export default PropTypes;
@@ -1,127 +1,200 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _fs = require('fs');
3
+ var _fs = _interopRequireDefault(require("fs"));
4
4
 
5
- var _fs2 = _interopRequireDefault(_fs);
5
+ var _utils = require("../utils");
6
6
 
7
- var _utils = require('../utils');
7
+ var _jsonMaker = _interopRequireDefault(require("./jsonMaker"));
8
+
9
+ var _jsonHelper = require("../utils/jsonHelper");
8
10
 
9
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
12
 
11
- var unitTestReport = [];
12
- var result = function result(inp) {
13
- var testPathPattern = process.argv[process.argv.length - 1];
13
+ let result = inp => {
14
+ inp.endTime = Date.now();
15
+ let testPathPattern = process.argv[process.argv.length - 1];
14
16
 
15
17
  if (testPathPattern.indexOf('--') !== -1) {
16
18
  testPathPattern = '';
17
19
  } else {
18
- testPathPattern = _fs2.default.realpathSync(process.cwd());
20
+ testPathPattern = _fs.default.realpathSync(process.cwd());
19
21
  }
20
- var testPathRegex = new RegExp(testPathPattern);
21
- var testResults = inp.testResults;
22
22
 
23
- var testFilesArr = [];
24
- var testCaseFiles = [];
25
- var jsonData = void 0;
23
+ let testPathRegex = new RegExp(testPathPattern);
24
+ let {
25
+ testResults
26
+ } = inp;
27
+ let testFilesArr = [];
28
+ let testCaseFiles = [];
29
+ let jsonData;
26
30
 
27
- if (_fs2.default.existsSync('./coverageTest/result.json')) {
28
- jsonData = JSON.parse(_fs2.default.readFileSync('./coverageTest/result.json', 'utf8'));
31
+ if (_fs.default.existsSync('./coverageTest/result.json')) {
32
+ jsonData = JSON.parse(_fs.default.readFileSync('./coverageTest/result.json', 'utf8'));
29
33
  }
30
- testResults.forEach(function (testResult) {
31
- var filePath = testResult.testFilePath;
34
+
35
+ testResults.forEach(testResult => {
36
+ let filePath = testResult.testFilePath;
32
37
 
33
38
  if (!testPathRegex.test(filePath)) {
34
39
  return;
35
40
  }
41
+
36
42
  filePath = filePath.replace('.spec', '');
37
43
  filePath = filePath.replace('/__tests__', '');
38
44
  filePath = filePath.replace('/__test__', '');
39
- var relatPath = filePath.replace(process.cwd(), '').substring(1);
45
+ let relatPath = filePath.replace(process.cwd(), '').substring(1);
46
+ let fileJson = {};
47
+ fileJson.testPath = testResult.testFilePath;
48
+ fileJson.sourcePath = filePath;
49
+ fileJson.data = testResult;
50
+ testFilesArr.push(fileJson);
40
51
 
41
52
  if (jsonData.FILES.includes(relatPath) || jsonData.FILES.includes(testResult.testFilePath.replace(process.cwd(), ''))) {
42
- var fileJson = {};
43
- fileJson.testPath = testResult.testFilePath;
44
- fileJson.sourcePath = filePath;
45
- fileJson.data = testResult;
46
- testFilesArr.push(fileJson);
47
- jsonData.FILES.includes(relatPath) ? testCaseFiles.push(jsonData.FILES[relatPath]) : jsonData.FILES.includes(testResult.testFilePath.replace(process.cwd(), '')) ? testCaseFiles.push(testResult.testFilePath.replace(process.cwd(), '')) : '';
53
+ jsonData.FILES.includes(relatPath) ? testCaseFiles.push(relatPath) : jsonData.FILES.includes(testResult.testFilePath.replace(process.cwd(), '')) ? testCaseFiles.push(testResult.testFilePath.replace(process.cwd(), '')) : '';
48
54
  }
49
- testResult.testResults && testResult.testResults.filter(function (t) {
50
- return t.status === 'failed';
51
- }).forEach(function (t) {
52
- unitTestReport.push({
53
- title: t.title,
54
- fullName: t.fullName,
55
- filePath: testResult.testFilePath
56
- });
57
- });
58
55
  });
59
- var coverageSummary = {};
60
- if (_fs2.default.existsSync('./commitCoverage/coverage-summary.json')) {
61
- coverageSummary = _fs2.default.readFileSync('./commitCoverage/coverage-summary.json').toString();
56
+ let coverageSummary = {};
57
+
58
+ if (_fs.default.existsSync('./commitCoverage/coverage-summary.json')) {
59
+ coverageSummary = _fs.default.readFileSync('./commitCoverage/coverage-summary.json').toString();
60
+
62
61
  if (coverageSummary.indexOf('\\') !== -1) {
63
62
  coverageSummary = coverageSummary.replace(/\\/g, '\\\\');
64
63
  }
65
64
  }
66
65
 
67
- var coverageJson = JSON.parse(coverageSummary);
68
- var linesPercent = 0;
69
- var functionPercent = 0;
70
- var statementPerment = 0;
71
- var branchesPercent = 0;
66
+ let excludeTestArray = '{}';
67
+
68
+ if (_fs.default.existsSync('./__testUtils__/conf/excludeTest.json')) {
69
+ excludeTestArray = _fs.default.readFileSync('./__testUtils__/conf/excludeTest.json').toString();
70
+
71
+ if (excludeTestArray.indexOf('\\') !== -1) {
72
+ excludeTestArray = excludeTestArray.replace(/\\/g, '\\\\');
73
+ }
74
+ }
75
+
76
+ let coverageJson = JSON.parse(coverageSummary);
77
+ let linesPercent = 0;
78
+ let functionPercent = 0;
79
+ let statementPerment = 0;
80
+ let branchesPercent = 0;
81
+ let fileList = '<h4>Changed files in last code check-in</h4><ul>';
82
+ let i = 0;
83
+ let excludeTestJSON = JSON.parse(excludeTestArray);
84
+
85
+ if (Object.keys(excludeTestArray).length > 0) {
86
+ jsonData.FILES = jsonData.FILES.filter(function (value) {
87
+ if (!excludeTestJSON.test.exclude.includes(value)) {
88
+ let excludeDir = excludeTestJSON.test.exclude.filter(function (excludeFile) {
89
+ if (value.indexOf(excludeFile) > -1) {
90
+ return value;
91
+ }
92
+ });
93
+
94
+ if (excludeDir.length > 0) {
95
+ return null;
96
+ }
97
+
98
+ return value;
99
+ }
100
+
101
+ return null;
102
+ });
103
+ }
72
104
 
73
- var fileList = '<h4>Changed files in last code check-in</h4><ul>';
74
- var i = 0;
75
- for (i; i < testFilesArr.length; i++) {
76
- var curSourceFile = testFilesArr[i].sourcePath;
105
+ for (i; i < jsonData.FILES.length; i++) {
106
+ let coverageData;
107
+ let curSourceFile = jsonData.FILES[i];
77
108
  curSourceFile.replace(process.cwd(), '').substring(1);
78
- fileList = fileList + '<li>' + curSourceFile + '</li>';
79
- var coverageData = coverageJson[curSourceFile];
109
+ fileList = `${fileList}<li>${curSourceFile}</li>`;
110
+ Object.keys(coverageJson).forEach(coverageFile => {
111
+ if (coverageFile.includes(curSourceFile) || coverageFile === 'total') {
112
+ coverageData = coverageJson[coverageFile];
113
+ }
114
+ });
115
+
80
116
  if (!coverageData) {
81
- (0, _utils.log)('Can\'t able to find source for ' + testFilesArr[i].testPath + '\n Please check the file name and the path is correct for test file');
117
+ (0, _utils.log)(`Can't able to find source for ${testFilesArr[i].testPath}\n Please check the file name and the path is correct for test file`);
82
118
  continue;
83
119
  }
120
+
84
121
  linesPercent += coverageData.lines.pct;
85
122
  functionPercent += coverageData.functions.pct;
86
123
  statementPerment += coverageData.statements.pct;
87
124
  branchesPercent += coverageData.branches.pct;
88
125
  }
89
- fileList = fileList + '</ul>';
90
- if (!testFilesArr.length) {
126
+
127
+ fileList = `${fileList}</ul>`;
128
+
129
+ if (!jsonData.FILES.length) {
91
130
  fileList = '<div></div>';
92
131
  }
93
132
 
94
- var uncoveredList = '<h4>Uncovered files :- </h4><ul>';
95
- jsonData.FILES.forEach(function (fileName) {
96
- if (!testCaseFiles.includes(fileName)) {
97
- uncoveredList = uncoveredList + '<li>' + fileName + '</li>';
98
- }
99
- });
100
- uncoveredList = uncoveredList + '</ul>';
101
-
102
- var totalLinesPercent = linesPercent / (i * 100) * 100;
103
- var totalFunctionPercent = functionPercent / (i * 100) * 100;
104
- var totalStatementPercent = statementPerment / (i * 100) * 100;
105
- var totalBranchesPercent = branchesPercent / (i * 100) * 100;
106
- var totalPercentage = totalLinesPercent + totalFunctionPercent + totalStatementPercent + totalBranchesPercent;
107
- var coverage = (totalPercentage / 4).toFixed(2);
133
+ let uncoveredList = '<h4>Uncovered files :- </h4><ul>';
134
+ let fileCoverage = 0;
135
+
136
+ if (jsonData.FILES.length > 0) {
137
+ fileCoverage = testCaseFiles.length / jsonData.FILES.length * 100;
138
+ }
139
+
140
+ fileCoverage = fileCoverage.toFixed(2);
141
+ fileCoverage = Number(fileCoverage);
142
+
143
+ if (Number.isNaN(fileCoverage)) {
144
+ (0, _utils.log)('This build does\'t have any JS changes!');
145
+ fileCoverage = 0;
146
+ } else {
147
+ (0, _utils.log)(`FileCoverage ${fileCoverage}%`);
148
+ }
149
+
150
+ let totalLinesPercent = linesPercent / (i * 100) * 100;
151
+ let totalFunctionPercent = functionPercent / (i * 100) * 100;
152
+ let totalStatementPercent = statementPerment / (i * 100) * 100;
153
+ let totalBranchesPercent = branchesPercent / (i * 100) * 100;
154
+ let totalPercentage = totalLinesPercent + totalFunctionPercent + totalStatementPercent + totalBranchesPercent;
155
+ let coverage = (totalPercentage / 4).toFixed(2);
108
156
  coverage = Number(coverage);
109
157
 
110
158
  if (Number.isNaN(coverage)) {
111
- (0, _utils.log)("This build does't have any JS changes!");
159
+ (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.modifiedFileUnitCase.testInfo', 'can\'t get coverage for this test');
112
160
  coverage = 0;
161
+ uncoveredList = uncoveredList + 'No Component changes with this build, You can proceed this build </ul>';
113
162
  } else {
114
- (0, _utils.log)('COVERAGE ' + coverage + '%');
163
+ (0, _jsonMaker.default)(inp, coverage, true, 'modifiedFileUnitCase', fileCoverage);
164
+ (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.modifiedFileUnitCase.isBuildVerified', coverage > 60);
165
+ (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'tests.modifiedFileUnitCase.testInfo', 'Test coverage value generated'); // jsonHelper(
166
+ // `${process.cwd()}/result.json`,
167
+ // 'testInfo.isBuildVerified',
168
+ // coverage > 60
169
+ // );
170
+
171
+ (0, _jsonHelper.setTestInfoStatus)(`${process.cwd()}/result.json`, true
172
+ /*coverage > 60*/
173
+ );
174
+
175
+ if (coverage < 60) {
176
+ (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'testInfo.failures', [{
177
+ type: 'modifiedUnitcases',
178
+ message: 'Need to cover 60% above for changed files'
179
+ }]);
180
+ uncoveredList = uncoveredList + 'Ask developer to cover 60% above for changed files </ul>';
181
+ } else {
182
+ uncoveredList = uncoveredList + 'You can proceed this build </ul>';
183
+ }
184
+
185
+ (0, _utils.log)(`COVERAGE ${coverage}%`);
115
186
  }
116
187
 
117
- var html = '<html><head><style>.red{font-weight:bold;color:red;}.green{font-weight:bold;color:green;}</style></head><body><br/>COVERAGE <span class="' + (coverage < 60 ? 'red' : 'green') + '">' + coverage + '%</span> <br/> less than 60% consider failure' + fileList + uncoveredList + '</body></html>';
188
+ let html = `<html><head><style>.red{font-weight:bold;color:red;}.green{font-weight:bold;color:green;}</style></head><body><br/>CODE COVERAGE <span class="${coverage < 60 ? 'red' : 'green'}">${coverage}%</span> <br/> less than 60% consider failure<br/><br/> FILE COVERAGE:<span class="${fileCoverage < 60 ? 'red' : 'green'}">${fileCoverage}%</span> <br/> less than 60% consider failure${fileList}${uncoveredList}</body></html>`;
189
+
190
+ if (!_fs.default.existsSync('./coverageTest')) {
191
+ _fs.default.mkdirSync('./coverageTest');
118
192
 
119
- if (!_fs2.default.existsSync('./coverageTest')) {
120
- _fs2.default.mkdirSync('./coverageTest');
121
- _fs2.default.writeFileSync('./coverageTest/index.html', html, 'utf8');
193
+ _fs.default.writeFileSync('./coverageTest/index.html', html, 'utf8');
122
194
  } else {
123
- _fs2.default.writeFileSync('./coverageTest/index.html', html, 'utf8');
195
+ _fs.default.writeFileSync('./coverageTest/index.html', html, 'utf8');
124
196
  }
197
+
125
198
  return inp;
126
199
  };
127
200
 
@@ -1,73 +1,106 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _path = require('path');
3
+ var _path = _interopRequireDefault(require("path"));
4
4
 
5
- var _path2 = _interopRequireDefault(_path);
6
-
7
- var _utils = require('../utils');
5
+ var _utils = require("../utils");
8
6
 
9
7
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
8
 
9
+ function jsFileFilter(listOfObject) {
10
+ let fileNameList = [];
11
+ let curListName = process.cwd().split(_path.default.sep);
12
+ let currentDirName = curListName[curListName.length - 1];
13
+ listOfObject.forEach(fileObj => {
14
+ let fileName = fileObj.FILEPATH;
15
+
16
+ if (fileName.includes(currentDirName)) {
17
+ fileName = fileName.split(currentDirName + '/')[1]; //eslint-disable-line
18
+
19
+ if (fileName.includes('.js') && !fileName.includes('.json') && !fileName.includes('.docs.js') && !fileName.includes('.spec.js')) {
20
+ fileNameList.push(fileName);
21
+ }
22
+ }
23
+ });
24
+ return fileNameList;
25
+ }
26
+
11
27
  function coverage(devBranch, compareWith, serviceName, domain) {
12
- return new Promise(function (resolve) {
28
+ return new Promise(resolve => {
13
29
  (0, _utils.request)({
14
- url: domain + '/impact/ImpactModuleAction.do?action=getCommitDiffFileDetail&serviceName=' + serviceName + '&masterBranchCommitHash=' + compareWith + '&buildCommitHash=' + devBranch
15
- }).then(function (_ref) {
16
- var body = _ref.body;
30
+ url: `${domain}/impact/ImpactModuleAction.do?action=getCommitDiffFileDetail&serviceName=${serviceName}&masterBranchCommitHash=${compareWith}&buildCommitHash=${devBranch}`
31
+ }).then(({
32
+ body
33
+ }) => {
34
+ let res = JSON.parse(body);
17
35
 
18
- var res = JSON.parse(body);
19
36
  if (Object.keys(res).length > 0) {
20
37
  if (Object.prototype.hasOwnProperty.call(res, 'STATUS')) {
21
38
  if (res.STATUS) {
22
- var listOfFiles = [];
39
+ let listOfFiles = [];
40
+
23
41
  if (Object.keys(res.DIFF_FILES).length > 0) {
24
42
  if (Object.prototype.hasOwnProperty.call(res.DIFF_FILES, 'ADDED')) {
25
43
  if (res.DIFF_FILES.ADDED.length > 0) {
26
- listOfFiles = listOfFiles.concat(listMaker(res.DIFF_FILES.ADDED));
44
+ listOfFiles = listOfFiles.concat(jsFileFilter(res.DIFF_FILES.ADDED));
27
45
  }
28
46
  }
47
+
29
48
  if (Object.prototype.hasOwnProperty.call(res.DIFF_FILES, 'UPDATED')) {
30
49
  if (res.DIFF_FILES.UPDATED.length > 0) {
31
- listOfFiles = listOfFiles.concat(listMaker(res.DIFF_FILES.UPDATED));
50
+ listOfFiles = listOfFiles.concat(jsFileFilter(res.DIFF_FILES.UPDATED));
32
51
  }
33
52
  }
34
- resolve({ STATUS: true, LIST: listOfFiles, REASON: 'success' });
53
+
54
+ if (listOfFiles.length > 0) {
55
+ resolve({
56
+ STATUS: true,
57
+ LIST: listOfFiles,
58
+ REASON: 'success'
59
+ });
60
+ } else {
61
+ resolve({
62
+ STATUS: false,
63
+ LIST: listOfFiles,
64
+ REASON: 'No modified js files'
65
+ });
66
+ }
35
67
  } else {
36
68
  resolve({
37
69
  STATUS: false,
38
70
  LIST: [],
39
- REASON: 'No modified js files'
71
+ REASON: 'No changes with last changeset'
40
72
  });
41
73
  }
42
74
  } else {
43
- resolve({ STATUS: false, LIST: [], REASON: 'Internal Error' });
75
+ resolve({
76
+ STATUS: false,
77
+ LIST: [],
78
+ REASON: 'Internal Error'
79
+ });
44
80
  }
45
81
  } else {
46
- resolve({ STATUS: false, LIST: [], REASON: 'Internal Error' });
82
+ resolve({
83
+ STATUS: false,
84
+ LIST: [],
85
+ REASON: 'Internal Error'
86
+ });
47
87
  }
48
88
  } else {
49
- resolve({ STATUS: false, LIST: [], REASON: 'Internal Error' });
89
+ resolve({
90
+ STATUS: false,
91
+ LIST: [],
92
+ REASON: 'Internal Error'
93
+ });
50
94
  }
51
- }).catch(function (err) {
95
+ }).catch(err => {
52
96
  (0, _utils.log)(err);
53
- resolve({ STATUS: false, LIST: [], REASON: 'Service Down' });
97
+ resolve({
98
+ STATUS: false,
99
+ LIST: [],
100
+ REASON: 'Service Down'
101
+ });
54
102
  });
55
103
  });
56
104
  }
57
105
 
58
- function listMaker(listOfObject) {
59
- var fileNameList = [];
60
- var curListName = process.cwd().split(_path2.default.sep);
61
-
62
- listOfObject.forEach(function (fileObj) {
63
- var fileName = fileObj.FILEPATH;
64
- fileName = fileName.replace(curListName[curListName.length - 2] + _path2.default.sep + curListName[curListName.length - 1] + _path2.default.sep, '');
65
- fileName = fileName.replace('jsapps/components/', '');
66
- if (fileName.includes('.js') && !fileName.includes('.json') && !fileName.includes('.docs.js')) {
67
- fileNameList.push(fileName);
68
- }
69
- });
70
- return fileNameList;
71
- }
72
-
73
106
  module.exports = coverage;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _jsonHelper = require("../utils/jsonHelper");
9
+
10
+ var _default = (resultObj, coverage, status = true, type = 'unitcase', filecoverage = 0) => {
11
+ let pathArray = [];
12
+ let resultJson = {};
13
+ resultJson.isExecuted = status;
14
+ resultJson.numberOfSuccess = resultObj.numPassedTests;
15
+ resultJson.numberOfFails = resultObj.numFailedTests;
16
+ resultJson.numberOfCases = resultObj.numTotalTests;
17
+ resultJson.numberOfSuites = resultObj.numTotalTestSuites;
18
+ resultJson.endTime = resultObj.endTime;
19
+ resultJson.startTime = resultObj.startTime;
20
+ resultJson.coverageDetail = {
21
+ codeCoveragePercentage: coverage,
22
+ fileCoveragePercentage: filecoverage
23
+ };
24
+ let fileDetailList = [];
25
+ resultObj.testResults.map(testFile => {
26
+ let fileObj = {};
27
+ fileObj.fileName = testFile.testFilePath;
28
+ fileObj.CaseList = {};
29
+ fileObj.CaseList.passedCaseList = [];
30
+ fileObj.CaseList.failedCaseList = [];
31
+ testFile.testResults.map(testCase => {
32
+ if (testCase.status === 'failed') {
33
+ fileObj.CaseList.failedCaseList.push(testCase.title);
34
+ } else if (testCase.status === 'passed') {
35
+ fileObj.CaseList.passedCaseList.push(testCase.title);
36
+ }
37
+
38
+ return testCase;
39
+ });
40
+ fileDetailList.push(fileObj);
41
+ return testFile;
42
+ });
43
+
44
+ if (type !== 'unitcase') {
45
+ Array.prototype.push.apply(pathArray, ['tests', 'modifiedFileUnitCase']);
46
+ } else {
47
+ Array.prototype.push.apply(pathArray, ['tests', 'unitCase']);
48
+ }
49
+
50
+ resultJson.fileDetails = fileDetailList;
51
+ (0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, pathArray, resultJson);
52
+ };
53
+
54
+ exports.default = _default;
@@ -1,31 +1,29 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _postcss = require('postcss');
3
+ var _postcss = _interopRequireDefault(require("postcss"));
4
4
 
5
- var _postcss2 = _interopRequireDefault(_postcss);
5
+ var _postcssHashClassname = _interopRequireDefault(require("postcss-hash-classname"));
6
6
 
7
- var _postcssHashClassname = require('postcss-hash-classname');
8
-
9
- var _postcssHashClassname2 = _interopRequireDefault(_postcssHashClassname);
10
-
11
- var _fs = require('fs');
12
-
13
- var _fs2 = _interopRequireDefault(_fs);
7
+ var _fs = _interopRequireDefault(require("fs"));
14
8
 
15
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
10
 
17
- var count = 0;
18
-
11
+ let count = 0;
19
12
  module.exports = {
20
- process: function process(src) {
13
+ process: function (src) {
21
14
  count++;
22
- var opts = { hashType: 'md5', digestType: 'base32' };
15
+ let opts = {
16
+ hashType: 'md5',
17
+ digestType: 'base32'
18
+ };
23
19
  opts.maxLength = 6;
24
20
  opts.type = '.json';
25
- opts.outputName = 'jsonFile_test_' + count;
26
- var processor = (0, _postcss2.default)([(0, _postcssHashClassname2.default)(opts)]);
21
+ opts.outputName = `jsonFile_test_${count}`;
22
+ let processor = (0, _postcss.default)([(0, _postcssHashClassname.default)(opts)]);
27
23
  processor.process(src).css;
28
- var jsonMap = _fs2.default.readFileSync('jsonFile_test_' + count + '.json', 'UTF-8');
29
- return 'module.exports =' + jsonMap;
24
+
25
+ let jsonMap = _fs.default.readFileSync(`jsonFile_test_${count}.json`, 'UTF-8');
26
+
27
+ return `module.exports =${jsonMap}`;
30
28
  }
31
29
  };
@@ -1,11 +1,10 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _babelJest = require('babel-jest');
4
-
5
- var _babelJest2 = _interopRequireDefault(_babelJest);
3
+ var _babelJest = _interopRequireDefault(require("babel-jest"));
6
4
 
7
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
6
 
9
- module.exports = _babelJest2.default.createTransformer({
10
- presets: [require.resolve('babel-preset-env'), require.resolve('babel-preset-react')]
7
+ module.exports = _babelJest.default.createTransformer({
8
+ presets: [require.resolve('@babel/preset-env'), require.resolve('@babel/preset-react')],
9
+ plugins: [require.resolve('babel-plugin-transform-dynamic-import')]
11
10
  });
@@ -1,13 +1,12 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- var _path = require('path');
4
-
5
- var _path2 = _interopRequireDefault(_path);
3
+ var _path = _interopRequireDefault(require("path"));
6
4
 
7
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
6
 
9
7
  module.exports = {
10
- process: function process(src, filename) {
11
- return 'module.exports = ' + JSON.stringify(_path2.default.basename(filename)) + ';';
8
+ process(src, filename) {
9
+ return `module.exports = ${JSON.stringify(_path.default.basename(filename))};`;
12
10
  }
11
+
13
12
  };