@zohodesk/react-cli 1.1.29-exp.1 → 1.1.29-exp.2

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 (221) hide show
  1. package/lib/babel/babel-option-utils/babel-preset-react-option.js +0 -3
  2. package/lib/babel/cmjs-plugins-presets.js +1 -8
  3. package/lib/babel/es-plugins-presets.js +1 -8
  4. package/lib/common/buildEs.js +1 -0
  5. package/lib/common/getEntries.js +2 -13
  6. package/lib/common/getPublicPathConfig.js +0 -6
  7. package/lib/common/index.js +1 -6
  8. package/lib/common/runPreProcess.js +6 -15
  9. package/lib/common/splitChunks.js +2 -21
  10. package/lib/common/sslcertUpdater.js +7 -18
  11. package/lib/common/templateParameters.js +0 -2
  12. package/lib/common/testPattern.js +10 -21
  13. package/lib/common/valueReplacer.js +1 -16
  14. package/lib/configs/jest.config.js +1 -10
  15. package/lib/configs/libAlias.js +8 -14
  16. package/lib/configs/resolvers.js +4 -14
  17. package/lib/configs/webpack.component.umd.config.js +1 -6
  18. package/lib/configs/webpack.css.umd.config.js +6 -14
  19. package/lib/configs/webpack.dev.config.js +1 -14
  20. package/lib/configs/webpack.docs.config.js +1 -9
  21. package/lib/configs/webpack.impact.config.js +1 -8
  22. package/lib/configs/webpack.prod.config.js +4 -17
  23. package/lib/constants.js +9 -18
  24. package/lib/deprecationLogger.js +0 -7
  25. package/lib/hooks/docsProptypeHook.js +4 -8
  26. package/lib/jest/commitedFilesResult.js +4 -46
  27. package/lib/jest/coverageCollector.js +1 -12
  28. package/lib/jest/jsonMaker.js +0 -6
  29. package/lib/jest/preProcessors/cssPreprocessor.js +1 -9
  30. package/lib/jest/preProcessors/jsPreprocessor.js +1 -6
  31. package/lib/jest/preProcessors/otherFilesPreprocessor.js +1 -4
  32. package/lib/jest/result.js +1 -23
  33. package/lib/jest/run.js +7 -18
  34. package/lib/jest/setup.js +8 -60
  35. package/lib/loaderUtils/configsAssetsLoaders.js +2 -12
  36. package/lib/loaderUtils/getCSSLoaders.js +10 -22
  37. package/lib/loaderUtils/getDevJsLoaders.js +4 -13
  38. package/lib/loaderUtils/index.js +1 -4
  39. package/lib/loaderUtils/tests/windowsModification.test.js +0 -1
  40. package/lib/loaderUtils/windowsModification.js +2 -3
  41. package/lib/loaders/__test__/markdownLoader.spec.js +0 -1
  42. package/lib/loaders/composeLoader.js +13 -37
  43. package/lib/loaders/docsLoader.js +1 -12
  44. package/lib/loaders/docsPropsLoader.js +4 -8
  45. package/lib/loaders/enhancedReactLiveConverter.js +2 -23
  46. package/lib/loaders/fileBountryLoader.js +1 -3
  47. package/lib/loaders/fileLoader.js +12 -23
  48. package/lib/loaders/markdownLoader.js +14 -19
  49. package/lib/loaders/reactLiveConvertor.js +5 -15
  50. package/lib/loaders/scriptInstrumentLoader.js +7 -16
  51. package/lib/loaders/selectorMappingLoader.js +7 -26
  52. package/lib/loaders/workerLoader.js +9 -24
  53. package/lib/logger.js +0 -4
  54. package/lib/middlewares/HMRMiddleware.js +13 -27
  55. package/lib/middlewares/SSTMiddleware.js +1 -5
  56. package/lib/pluginUtils/configHtmlWebpackPlugins.js +1 -24
  57. package/lib/pluginUtils/getDevPlugins.js +9 -42
  58. package/lib/pluginUtils/getDocsPlugins.js +3 -13
  59. package/lib/pluginUtils/getLibraryImactPlugins.js +5 -6
  60. package/lib/pluginUtils/getLibraryPlugins.js +2 -8
  61. package/lib/pluginUtils/getProdPlugins.js +8 -47
  62. package/lib/pluginUtils/getServerPlugins.js +2 -8
  63. package/lib/pluginUtils/getUMDCSSPlugins.js +2 -10
  64. package/lib/pluginUtils/getUMDComponentPlugins.js +2 -10
  65. package/lib/pluginUtils/index.js +1 -9
  66. package/lib/plugins/CdnChangePlugin.js +2 -18
  67. package/lib/plugins/CleanupStatsPlugin.js +0 -5
  68. package/lib/plugins/CssOrderControlPlugin.js +3 -6
  69. package/lib/plugins/CustomAttributePlugin.js +14 -19
  70. package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +3 -23
  71. package/lib/plugins/EFCPlugin.js +20 -34
  72. package/lib/plugins/EFCTemplatePlugin.js +19 -30
  73. package/lib/plugins/EfcResourceCleanupPlugin.js +0 -3
  74. package/lib/plugins/EventsHandlingPlugin.js +2 -4
  75. package/lib/plugins/I18NInjectIntoIndexPlugin.js +11 -37
  76. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +10 -15
  77. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
  78. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +12 -25
  79. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +55 -133
  80. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +12 -23
  81. package/lib/plugins/I18nSplitPlugin/index.js +13 -24
  82. package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +64 -58
  83. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
  84. package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +10 -29
  85. package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +8 -19
  86. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
  87. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
  88. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +1 -8
  89. package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
  90. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -20
  91. package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +0 -1
  92. package/lib/plugins/ManifestPlugin.js +1 -18
  93. package/lib/plugins/MinifyPlugin.js +1 -10
  94. package/lib/plugins/ModuleStatsPlugin.js +1 -24
  95. package/lib/plugins/OptimizeJSPlugin.js +2 -10
  96. package/lib/plugins/PublicPathCallbackPlugin.js +1 -12
  97. package/lib/plugins/PublicPathChangePlugin.js +6 -39
  98. package/lib/plugins/ReportGeneratePlugin.js +5 -32
  99. package/lib/plugins/RequireVariablePublicPlugin.js +1 -8
  100. package/lib/plugins/ResourceHintsPlugin.js +4 -13
  101. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
  102. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +10 -17
  103. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
  104. package/lib/plugins/ScriptInstrumentPlugin.js +1 -8
  105. package/lib/plugins/SelectorPlugin.js +6 -32
  106. package/lib/plugins/ServiceWorkerPlugin.js +5 -22
  107. package/lib/plugins/ShadowDOMSupportPlugin.js +4 -41
  108. package/lib/plugins/SourceMapHookPlugin.js +2 -12
  109. package/lib/plugins/StatsPlugin.js +0 -14
  110. package/lib/plugins/TPHashMappingPlugin.js +3 -18
  111. package/lib/plugins/UnusedFilesFindPlugin.js +4 -39
  112. package/lib/plugins/VariableConversionCollector.js +15 -42
  113. package/lib/plugins/index.js +1 -20
  114. package/lib/plugins/libraryImpactPlugin.js +1 -33
  115. package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +306 -0
  116. package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +363 -0
  117. package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +694 -0
  118. package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +1258 -0
  119. package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +542 -0
  120. package/lib/plugins/newi18nsplitplugin/18nplugin.js +974 -0
  121. package/lib/plugins/newi18nsplitplugin/ChunkManager.js +131 -0
  122. package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +59 -0
  123. package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +262 -0
  124. package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +166 -0
  125. package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +111 -0
  126. package/lib/plugins/newi18nsplitplugin/KeyCollector.js +163 -0
  127. package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +88 -0
  128. package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +101 -0
  129. package/lib/plugins/newi18nsplitplugin/constants.js +162 -0
  130. package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +78 -0
  131. package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +22 -0
  132. package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +18 -0
  133. package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +580 -0
  134. package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +54 -0
  135. package/lib/plugins/utils/classHandling.js +0 -6
  136. package/lib/plugins/utils/fileHandling.js +6 -15
  137. package/lib/plugins/utils/tests/fileHandling.test.js +0 -4
  138. package/lib/plugins/variableConvertorUtils.js +14 -29
  139. package/lib/plugins/webpackwatchrunplugin.js +0 -5
  140. package/lib/postcss-plugins/EmptyPlugin.js +3 -4
  141. package/lib/postcss-plugins/ExcludePlugin.js +1 -5
  142. package/lib/postcss-plugins/IncludePlugin.js +1 -5
  143. package/lib/postcss-plugins/RTLSplitPlugin.js +14 -27
  144. package/lib/postcss-plugins/SelectorReplace.js +1 -16
  145. package/lib/postcss-plugins/ValueReplacer.js +7 -6
  146. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
  147. package/lib/postcss-plugins/__test__/selectorReplace.test.js +6 -3
  148. package/lib/postcss-plugins/__test__/valueReplacer.spec.js +2 -5
  149. package/lib/postcss-plugins/hoverActivePlugin.js +31 -67
  150. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +0 -7
  151. package/lib/postcss-plugins/variableModificationPlugin/index.js +28 -49
  152. package/lib/schemas/index.js +3 -9
  153. package/lib/servers/clusterHubServer.js +1 -11
  154. package/lib/servers/devBuild.js +14 -26
  155. package/lib/servers/docsServer.js +1 -3
  156. package/lib/servers/docsServerCore.js +1 -22
  157. package/lib/servers/getCliPath.js +0 -9
  158. package/lib/servers/helpServer.js +1 -6
  159. package/lib/servers/httpsOptions.js +2 -8
  160. package/lib/servers/impactServer.js +3 -35
  161. package/lib/servers/mockserver.js +1 -10
  162. package/lib/servers/nowatchserver.js +12 -37
  163. package/lib/servers/requireLocalOrGlobal.js +6 -17
  164. package/lib/servers/scrServer.js +14 -21
  165. package/lib/servers/server.js +6 -36
  166. package/lib/servers/ssServer.js +1 -17
  167. package/lib/templates/CoverageScriptTemplate.js +0 -14
  168. package/lib/templates/WMSTemplate.js +7 -13
  169. package/lib/templates/linterConstant.js +2 -4
  170. package/lib/utils/babelPresets.js +3 -7
  171. package/lib/utils/clean.js +3 -9
  172. package/lib/utils/copy.js +1 -7
  173. package/lib/utils/copyTimezones.js +1 -9
  174. package/lib/utils/createEventStream.js +1 -6
  175. package/lib/utils/cssClassNameGenerate.js +10 -30
  176. package/lib/utils/cssURLReplacer.js +1 -22
  177. package/lib/utils/dependencyPostPublish.js +1 -10
  178. package/lib/utils/deprecationSupport.js +7 -32
  179. package/lib/utils/fileUtils.js +1 -28
  180. package/lib/utils/folderIterator.js +2 -13
  181. package/lib/utils/getComponents.js +0 -21
  182. package/lib/utils/getCurrentBranch.js +0 -5
  183. package/lib/utils/getDependenciesImpactList.js +1 -22
  184. package/lib/utils/getFileType.js +2 -10
  185. package/lib/utils/getHash.js +1 -8
  186. package/lib/utils/getIp.js +0 -2
  187. package/lib/utils/getOptions.js +16 -53
  188. package/lib/utils/getServerURL.js +1 -10
  189. package/lib/utils/index.js +4 -51
  190. package/lib/utils/init.js +0 -1
  191. package/lib/utils/initPreCommitHook.js +7 -30
  192. package/lib/utils/jsonHelper.js +3 -22
  193. package/lib/utils/libraryImpactConfig.js +2 -5
  194. package/lib/utils/lint/addScripts.js +2 -5
  195. package/lib/utils/lint/checkExistingConfig.js +3 -12
  196. package/lib/utils/lint/copyConfigs.js +0 -3
  197. package/lib/utils/lint/index.js +0 -9
  198. package/lib/utils/lint/lintScripts.js +0 -1
  199. package/lib/utils/lint/lintSetup.js +3 -4
  200. package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
  201. package/lib/utils/lint/question.js +0 -7
  202. package/lib/utils/lintReporter.js +0 -20
  203. package/lib/utils/log.js +0 -1
  204. package/lib/utils/mailSender.js +1 -8
  205. package/lib/utils/object-manipulation.js +1 -17
  206. package/lib/utils/pullOrigin.js +0 -4
  207. package/lib/utils/reinstallDependencies.js +1 -29
  208. package/lib/utils/removeAttributes.js +1 -8
  209. package/lib/utils/repoClone.js +3 -28
  210. package/lib/utils/request.js +0 -12
  211. package/lib/utils/rtl.js +5 -17
  212. package/lib/utils/selectorReplacer.js +10 -16
  213. package/lib/utils/setEnvVariables.js +0 -2
  214. package/lib/utils/ssTestHack.js +1 -11
  215. package/lib/utils/switchBranch.js +0 -5
  216. package/lib/utils/typeCheck.js +0 -1
  217. package/lib/utils/urlConcat.js +0 -4
  218. package/lib/utils/useExitCleanup.js +9 -10
  219. package/lib/utils/variableConverter.js +22 -31
  220. package/{npm-shrinkwrap.json → package-lock.json} +2098 -1999
  221. package/package.json +1 -1
@@ -1,40 +1,34 @@
1
1
  "use strict";
2
2
 
3
3
  var _querystring = _interopRequireDefault(require("querystring"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.htmlTemplate = exports.endTag = void 0;
7
- const htmlTemplate = '<!DOCTYPE html><html> <head> <title>Eslint Security Rule</title> <style type="text/css"> body{margin: 0; font: 93.75%/1.6 -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;}body, html{width: 100%; height: 100%;}.pkCont{}.pkEmpty{height: 300px;display: flex;align-items: center;justify-content: center;font-size: 20px;}.pkUl{margin: 0; padding: 0; list-style-type: none;}.pkLi{}.pkRow{display: flex; padding: 12px 16px;}.pkArrowCont{cursor: pointer; width: 50px; display: flex; align-items: center; justify-content: center; background-color: #f4f5f5; border-radius: 4px;}.pkArrow{width: 1px; height: 1px; border: 5px solid; border-color: #000 transparent transparent; margin-top: 7px;}.pkDetailsOpen .pkArrow{margin: 0 0 7px; border-color: transparent transparent #000;}.pkFileName{font-weight: 600; margin: 0 8px;}.pkUrl{flex: 1; min-width: 0; min-height: 0; word-break: break-word; word-wrap: break-word; color: blue;}.pkDetails{margin-left: 66px; display: none;}.pkDetailsOpen .pkDetails{display: block;}.pkDetailsHead{font-weight: 600; display: flex; border: 1px solid #e5e5e5; padding: 3px 8px;}.pkDetailsBody{max-height: 400px; overflow: auto;}.pkDetailsRow{display: flex; padding: 10px 8px;}.pkDetailsRow:nth-child(even){background-color: #f4f5f5;}.pkDetailsCol{word-break: break-word; word-wrap: break-word;}.pkError{color: red;}.pkDetailsCol:nth-child(1){width: 10%;}.pkDetailsCol:nth-child(2){width: 10%;}.pkDetailsCol:nth-child(3){width: 40%;}.pkDetailsCol:nth-child(4){width: 40%;}</style> <script>function toggleWrapper(element){var classArray=element.parentElement.parentElement.className; if (classArray.includes("pkDetailsOpen")){element.parentElement.parentElement.className="pkLi";}else{element.parentElement.parentElement.className="pkLi pkDetailsOpen";}}</script> </head> <body> <div class="pkCont">';
8
- exports.htmlTemplate = htmlTemplate;
9
- const endTag = '</div></body></html>';
10
- exports.endTag = endTag;
7
+ const htmlTemplate = exports.htmlTemplate = '<!DOCTYPE html><html> <head> <title>Eslint Security Rule</title> <style type="text/css"> body{margin: 0; font: 93.75%/1.6 -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;}body, html{width: 100%; height: 100%;}.pkCont{}.pkEmpty{height: 300px;display: flex;align-items: center;justify-content: center;font-size: 20px;}.pkUl{margin: 0; padding: 0; list-style-type: none;}.pkLi{}.pkRow{display: flex; padding: 12px 16px;}.pkArrowCont{cursor: pointer; width: 50px; display: flex; align-items: center; justify-content: center; background-color: #f4f5f5; border-radius: 4px;}.pkArrow{width: 1px; height: 1px; border: 5px solid; border-color: #000 transparent transparent; margin-top: 7px;}.pkDetailsOpen .pkArrow{margin: 0 0 7px; border-color: transparent transparent #000;}.pkFileName{font-weight: 600; margin: 0 8px;}.pkUrl{flex: 1; min-width: 0; min-height: 0; word-break: break-word; word-wrap: break-word; color: blue;}.pkDetails{margin-left: 66px; display: none;}.pkDetailsOpen .pkDetails{display: block;}.pkDetailsHead{font-weight: 600; display: flex; border: 1px solid #e5e5e5; padding: 3px 8px;}.pkDetailsBody{max-height: 400px; overflow: auto;}.pkDetailsRow{display: flex; padding: 10px 8px;}.pkDetailsRow:nth-child(even){background-color: #f4f5f5;}.pkDetailsCol{word-break: break-word; word-wrap: break-word;}.pkError{color: red;}.pkDetailsCol:nth-child(1){width: 10%;}.pkDetailsCol:nth-child(2){width: 10%;}.pkDetailsCol:nth-child(3){width: 40%;}.pkDetailsCol:nth-child(4){width: 40%;}</style> <script>function toggleWrapper(element){var classArray=element.parentElement.parentElement.className; if (classArray.includes("pkDetailsOpen")){element.parentElement.parentElement.className="pkLi";}else{element.parentElement.parentElement.className="pkLi pkDetailsOpen";}}</script> </head> <body> <div class="pkCont">';
8
+ const endTag = exports.endTag = '</div></body></html>';
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.a = void 0;
7
-
8
- let a = require.resolve('babel-plugin-transform-define');
9
-
10
- exports.a = a;
11
- var _default = {
7
+ let a = exports.a = require.resolve('babel-plugin-transform-define');
8
+ var _default = exports.default = {
12
9
  presets: [['env', {
13
10
  modules: false
14
11
  }], 'react'],
@@ -18,5 +15,4 @@ var _default = {
18
15
  regenerator: false,
19
16
  moduleName: 'babel-runtime'
20
17
  }]]
21
- };
22
- exports.default = _default;
18
+ };
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  var _rimraf = _interopRequireDefault(require("rimraf"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
4
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
5
  let help = false;
8
- let dashdash = false; //eslint-disable-next-line array-callback-return
9
-
6
+ let dashdash = false;
7
+ //eslint-disable-next-line array-callback-return
10
8
  let args = process.argv.slice(2).filter(arg => {
11
9
  if (dashdash) {
12
10
  return !!arg;
@@ -18,21 +16,17 @@ let args = process.argv.slice(2).filter(arg => {
18
16
  return !!arg;
19
17
  }
20
18
  });
21
-
22
19
  let go = n => {
23
20
  if (n >= args.length) {
24
21
  return;
25
22
  }
26
-
27
23
  (0, _rimraf.default)(args[n], er => {
28
24
  if (er) {
29
25
  throw er;
30
26
  }
31
-
32
27
  go(n + 1);
33
28
  });
34
29
  };
35
-
36
30
  if (help || args.length === 0) {
37
31
  // If they didn't ask for help, then this is not a "success"
38
32
  // eslint-disable-next-line no-console
package/lib/utils/copy.js CHANGED
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _path = _interopRequireDefault(require("path"));
4
-
5
4
  var _fs = _interopRequireDefault(require("fs"));
6
-
7
5
  var _fileUtils = require("./fileUtils");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
6
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
7
  let args = process.argv.slice(2);
12
-
13
8
  let appPath = _fs.default.realpathSync(process.cwd());
14
-
15
9
  let [srcPath, targetPath, exts, isCopy = true, flatten = '', changeExt = ''] = args;
16
10
  exts = exts ? exts.split(',').map(ext => `.${ext.trim()}`) : false;
17
11
  srcPath = _path.default.join(appPath, srcPath);
@@ -1,21 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  var _path = _interopRequireDefault(require("path"));
4
-
5
4
  var _fs = _interopRequireDefault(require("fs"));
6
-
7
5
  var _fileUtils = require("./fileUtils");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
6
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
7
  let args = process.argv.slice(2);
12
-
13
8
  let appPath = _fs.default.realpathSync(process.cwd());
14
-
15
9
  let [targetPath] = args;
16
10
  targetPath = targetPath === '."' || !targetPath ? '' : targetPath;
17
11
  targetPath = _path.default.join(appPath, targetPath);
18
-
19
12
  let srcPath = _path.default.resolve(_path.default.dirname(require.resolve('@zohodesk/datetimejs')), '../data/timezones/');
20
-
21
13
  (0, _fileUtils.copy)(srcPath, targetPath, true, null, 'flatten');
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  let createEventStream = (heartbeat, heartbeatInfo = null) => {
9
8
  let clientId = 0;
10
9
  let clients = {};
11
-
12
10
  let everyClient = fn => {
13
11
  Object.keys(clients).forEach(id => {
14
12
  fn(clients[id]);
15
13
  });
16
14
  };
17
-
18
15
  setInterval(() => {
19
16
  everyClient(client => {
20
17
  if (heartbeatInfo) {
@@ -52,6 +49,4 @@ let createEventStream = (heartbeat, heartbeatInfo = null) => {
52
49
  }
53
50
  };
54
51
  };
55
-
56
- var _default = createEventStream;
57
- exports.default = _default;
52
+ var _default = exports.default = createEventStream;
@@ -4,40 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _os = _interopRequireDefault(require("os"));
9
-
10
8
  var _path = _interopRequireDefault(require("path"));
11
-
12
9
  var _fileHandling = require("../plugins/utils/fileHandling");
13
-
14
10
  var _getHash = _interopRequireDefault(require("./getHash"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
12
  const isWindows = _os.default.platform().toLowerCase() === 'win32';
19
-
20
13
  const isSelectorPackage = (resourcePath, packages) => {
21
14
  if (!resourcePath.includes('node_modules')) {
22
15
  return false;
23
16
  }
24
-
25
17
  let isValid = false;
26
-
27
18
  for (let pack of packages) {
28
19
  if (isWindows) {
29
20
  pack = pack.replace(/\//g, '\\');
30
21
  }
31
-
32
22
  if (resourcePath.includes(pack)) {
33
23
  isValid = true;
34
24
  break;
35
25
  }
36
26
  }
37
-
38
27
  return isValid;
39
28
  };
40
-
41
29
  function patternBasedClass({
42
30
  customClassNamePrefix,
43
31
  context,
@@ -58,24 +46,24 @@ function patternBasedClass({
58
46
  });
59
47
  return newName;
60
48
  }
61
-
62
49
  var _default = (unique = true, {
63
50
  filenames,
64
51
  packages
65
52
  }, classNamePrefix, customClassNamePrefix, patterns, displayClassName) => (context, localIdentName, localName) => {
66
53
  // console.log(patterns, context.resourcePath);
54
+
67
55
  // NOTE: in build machine we use date as folder path.
68
56
  // So every time we create new build there is path will alway different
69
57
  // in order to minimize that problem we try in relative path;
70
58
  // console.log('context.resourcePath', context.resourcePath, context);
71
59
  // let contextResourcePath = context.resourcePath;
60
+
72
61
  const filePaths = context.resourcePath.split(_path.default.sep);
73
62
  const fileName = filePaths[filePaths.length - 1];
74
63
  const [fileNameWithoutExt] = fileName.split('.');
75
64
  const cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase();
76
-
77
- const relativePath = _path.default.relative(context.rootContext, context.resourcePath); // console.log('customClassNamePrefix', customClassNamePrefix);
78
-
65
+ const relativePath = _path.default.relative(context.rootContext, context.resourcePath);
66
+ // console.log('customClassNamePrefix', customClassNamePrefix);
79
67
  /*
80
68
  input :
81
69
  context.resourcePath : 'D:/MyWork/..../desk_client_app/supportapp/src/components/Avatar/Avatar.module.css,
@@ -90,17 +78,15 @@ var _default = (unique = true, {
90
78
  output :
91
79
  true or false
92
80
  */
93
-
94
-
95
81
  if (displayClassName) {
96
82
  return `${fileNameWithoutExt}__${localName}`;
97
- } // return cleanFileName
83
+ }
98
84
 
85
+ // return cleanFileName
99
86
 
100
87
  if (context.resourcePath.endsWith('.plain.css')) {
101
88
  return localName;
102
89
  }
103
-
104
90
  if (!(0, _fileHandling.isFileNameMatchingPluginPattern)({
105
91
  filename: context.resourcePath,
106
92
  filterArr: patterns.cssUniqueness
@@ -108,32 +94,26 @@ var _default = (unique = true, {
108
94
  return `${classNamePrefix}-${cleanFileName}-${localName}`;
109
95
  }
110
96
  /* old production mode start without breaking so added. may be removed in future*/
111
-
112
-
113
97
  if (unique) {
114
98
  const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
115
99
  return `${classNamePrefix}${h}`;
116
100
  }
117
-
118
101
  const patternClass = patternBasedClass({
119
102
  customClassNamePrefix,
120
103
  context,
121
104
  relativePath,
122
105
  localName
123
106
  });
124
-
125
107
  if (patternClass) {
126
108
  return patternClass;
127
- } //css file has case sensitive selector issue so can't toLowerCase
128
- //let local = localName.toLowerCase()
129
-
109
+ }
130
110
 
111
+ //css file has case sensitive selector issue so can't toLowerCase
112
+ //let local = localName.toLowerCase()
131
113
  if (isSelectorPackage(context.resourcePath, packages) || filenames.indexOf(cleanFileName) !== -1) {
132
114
  const h = (0, _getHash.default)(`${relativePath}-${localName}`, 10);
133
115
  return `${classNamePrefix}${h}`;
134
116
  }
135
-
136
117
  return `${classNamePrefix}-${cleanFileName}-${localName}`;
137
118
  };
138
-
139
119
  exports.default = _default;
@@ -11,30 +11,21 @@ Object.defineProperty(exports, "getFileType", {
11
11
  }
12
12
  });
13
13
  exports.getUrls = void 0;
14
-
15
14
  var _fs = _interopRequireDefault(require("fs"));
16
-
17
15
  var _crypto = _interopRequireDefault(require("crypto"));
18
-
19
16
  var _getFileType = require("./getFileType");
20
-
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
-
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
18
  const urlRegex = /url\(.*?\)/g;
24
-
25
19
  const getHash = (file, isPath = false, needSubStr = true) => {
26
20
  let hash = _crypto.default.createHash('md5');
27
-
28
21
  if (isPath) {
29
22
  hash.update(_fs.default.readFileSync(file));
30
23
  } else {
31
24
  hash.update(file);
32
25
  }
33
-
34
26
  hash = hash.digest('hex');
35
27
  return hash ? needSubStr ? hash.substring(0, 20) : hash : null;
36
28
  };
37
-
38
29
  const formatUrl = str => {
39
30
  let char = str.includes('"') ? '"' : str.includes('\'') ? '\'' : '(';
40
31
  const statingIdx = str.indexOf(char) + 1;
@@ -42,11 +33,9 @@ const formatUrl = str => {
42
33
  char = char === '(' ? ')' : char;
43
34
  return substr.substring(0, substr.indexOf(char));
44
35
  };
45
-
46
36
  const getUrls = css => {
47
37
  const urlMatches = css.match(urlRegex);
48
38
  let src = css;
49
-
50
39
  if (urlMatches) {
51
40
  const patterns = {};
52
41
  urlMatches.forEach(pattern => {
@@ -62,20 +51,16 @@ const getUrls = css => {
62
51
  };
63
52
  }
64
53
  };
65
-
66
54
  exports.getUrls = getUrls;
67
-
68
55
  const cssUrlReplacer = (css, domains, chunkHash = {}) => {
69
56
  const obj = getUrls(css);
70
57
  let src = css;
71
-
72
58
  if (obj) {
73
59
  const patterns = obj.urls;
74
60
  src = obj.css;
75
61
  Object.keys(patterns).forEach(pattern => {
76
62
  let urlParts = pattern.split('/');
77
63
  let fileName = urlParts.pop();
78
-
79
64
  if (fileName.includes('#')) {
80
65
  if (fileName.includes('?')) {
81
66
  fileName = fileName.replace(/\?.*#/g, '#');
@@ -83,14 +68,12 @@ const cssUrlReplacer = (css, domains, chunkHash = {}) => {
83
68
  } else {
84
69
  fileName = fileName.replace(/\?.*$/g, '');
85
70
  }
86
-
87
71
  const hash = patterns[pattern];
88
72
  const filename = fileName.replace(/(\?|#).*?$/g, '');
89
73
  const regex = new RegExp(hash, 'g');
90
74
  let {
91
75
  hashedName
92
76
  } = chunkHash[filename] || fileName;
93
-
94
77
  if (domains && typeof urlParts[0] === 'string' && !urlParts[0].includes('http')) {
95
78
  const {
96
79
  font,
@@ -100,7 +83,6 @@ const cssUrlReplacer = (css, domains, chunkHash = {}) => {
100
83
  const customPath = type === 'image' ? `${image}/images` : type === 'font' ? `${font}/fonts` : urlParts.join('/');
101
84
  urlParts = customPath.split('/');
102
85
  }
103
-
104
86
  if (hashedName) {
105
87
  if (fileName.includes('#')) {
106
88
  if (fileName.includes('?')) {
@@ -110,14 +92,11 @@ const cssUrlReplacer = (css, domains, chunkHash = {}) => {
110
92
  }
111
93
  }
112
94
  }
113
-
114
95
  urlParts.push(hashedName || fileName);
115
96
  urlParts = urlParts.join('/');
116
97
  src = src.replace(regex, `url('${urlParts}')`);
117
98
  });
118
99
  }
119
-
120
100
  return src;
121
101
  };
122
-
123
102
  exports.cssUrlReplacer = cssUrlReplacer;
@@ -1,31 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _child_process = require("child_process");
4
-
5
4
  var _path = _interopRequireDefault(require("path"));
6
-
7
5
  var _request = _interopRequireDefault(require("./request"));
8
-
9
6
  var _index = require("./index");
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
7
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
8
  let changeset = (0, _child_process.execSync)('git rev-parse HEAD', {
14
9
  cwd: process.cwd()
15
10
  }).toString() || '';
16
11
  changeset = changeset.trim();
17
-
18
12
  if (!changeset) {
19
13
  throw new Error('Changeset doesn\'t exists');
20
14
  }
21
-
22
15
  (0, _index.log)(changeset, 'changeset');
23
-
24
16
  let {
25
17
  version,
26
18
  name
27
19
  } = require(_path.default.join(process.cwd(), './package.json'));
28
-
29
20
  (0, _request.default)({
30
21
  url: `${'ht'}${'tp'}://tsi-desk-mock.tsi.zohocorpin.com:8080/Hbase/addKey?method=addkey`,
31
22
  method: 'POST',
@@ -4,35 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.deprecationSupport = deprecationSupport;
7
-
8
7
  var _path = _interopRequireDefault(require("path"));
9
-
10
8
  var deprecationHandlers = _interopRequireWildcard(require("../deprecationLogger"));
11
-
12
9
  var _windowsModification = require("../loaderUtils/windowsModification");
13
-
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
13
  let {
21
14
  deprecateMessage,
22
15
  deprecateOption,
23
16
  deprecationLoggerEnd
24
17
  } = deprecationHandlers;
25
-
26
18
  function modifyCssArr(arr) {
27
19
  return arr.map(x => {
28
20
  const includeCss = !x.startsWith('!');
29
21
  const modifier = includeCss ? '/*.css' : '';
30
22
  const filePath = x.replace(/^!/, ''); // Remove the "!" symbol if present
31
-
32
23
  return (0, _windowsModification.windowsModificationFile)(_path.default.join(includeCss ? '**' : '!**', filePath, '**', modifier));
33
24
  });
34
25
  }
35
-
36
26
  const defaultPostCssPluginOptions = {
37
27
  valueReplacer: null,
38
28
  hasRTL: false,
@@ -44,80 +34,66 @@ const defaultPostCssPluginOptions = {
44
34
  minifier: false,
45
35
  composeMinification: false
46
36
  };
47
-
48
37
  function deprecationSupport(options, disableDeprecationWarning) {
49
38
  if (disableDeprecationWarning) {
50
39
  /* eslint-disable no-empty-function */
51
40
  deprecateMessage = () => {};
52
-
53
41
  deprecateOption = () => {};
54
-
55
42
  deprecationLoggerEnd = () => {};
56
43
  /* eslint-enable no-empty-function */
57
-
58
44
  }
59
-
60
45
  options.app.plugins = options.app.plugins || defaultPostCssPluginOptions;
61
46
  options.docs.plugins = options.docs.plugins || defaultPostCssPluginOptions;
62
- options.css.plugins = options.css.plugins || defaultPostCssPluginOptions; // if (selectn(options, ".app.hasRTL") === true) {
47
+ options.css.plugins = options.css.plugins || defaultPostCssPluginOptions;
63
48
 
49
+ // if (selectn(options, ".app.hasRTL") === true) {
64
50
  if (options.app.hasRTL === true) {
65
51
  deprecateOption('app.hasRTL', 'app.plugins.hasRTL');
66
52
  options.app.plugins.hasRTL = true;
67
53
  }
68
-
69
54
  if (options.docs.hasRTL === true) {
70
55
  deprecateOption('docs.hasRTL', 'docs.plugins.hasRTL');
71
56
  options.docs.plugins.hasRTL = true;
72
57
  }
73
-
74
58
  if (options.app.selectorReplace !== null && options.app.plugins && (options.app.plugins.selectorReplace === null || options.app.plugins.selectorReplace === undefined)) {
75
59
  deprecateMessage('when you use app.selectorReplace mention enable or disable app.plugins.selectorReplace by setting value to true or false');
76
60
  options.app.plugins.selectorReplace = true;
77
61
  }
78
-
79
62
  if (options.docs.selectorReplace !== null && options.docs.plugins && (options.docs.plugins.selectorReplace === null || options.docs.plugins.selectorReplace === undefined)) {
80
63
  deprecateMessage('when you use docs.selectorReplace mention enable or disable docs.plugins.selectorReplace by setting value to true or false');
81
64
  options.docs.plugins.selectorReplace = true;
82
65
  }
83
-
84
66
  if (options.css.valueReplacer !== null && options.css.plugins && (options.app.plugins.valueReplacer === null || options.app.plugins.valueReplacer === undefined)) {
85
67
  deprecateMessage('when you use app.valueReplacer mention enable or disable app.plugins.valueReplacer by setting value to true or false');
86
68
  options.app.plugins.valueReplacer = true;
87
69
  }
88
-
89
70
  if (!options.app.patterns) {
90
71
  options.app.patterns = {};
91
72
  }
92
-
93
73
  function handleRTL(rtlExclude, rtl, hasRTL, type) {
94
74
  if (rtlExclude && rtlExclude.length > 0) {
95
75
  options[type].patterns.hasRTL = modifyCssArr(rtlExclude);
96
76
  deprecateOption(`${type}.rtlExclude`, `${type}.patterns.hasRTL`);
97
77
  }
98
-
99
78
  if (rtl && rtl.length > 0) {
100
79
  options[type].patterns.hasRTL = modifyCssArr(rtl);
101
80
  deprecateOption(`${type}.exclude.rtl`, `${type}.patterns.hasRTL`);
102
81
  }
103
-
104
82
  if (hasRTL && hasRTL.length > 0) {
105
83
  options[type].patterns.hasRTL = modifyCssArr(hasRTL);
106
84
  deprecateOption(`${type}.exclude.hasRTL`, `${type}.patterns.hasRTL`);
107
85
  }
108
86
  }
109
-
110
87
  function addExcludesToPattern(patterns, exclude, type) {
111
88
  Object.keys(defaultPostCssPluginOptions).forEach(key => {
112
89
  if (!exclude[key] || exclude[key].length === 0) {
113
90
  return;
114
91
  }
115
-
116
92
  if (patterns[key].length === 0) {
117
93
  deprecateOption(`${type}.exclude.${key}`, `${type}.patterns.${key}`);
118
94
  let tempArr = exclude[key];
119
- tempArr = tempArr.map(x => _path.default.join('!**', x, '**')); // Since patterns[key] is empty we need to wildcard for allow all others.
120
-
95
+ tempArr = tempArr.map(x => _path.default.join('!**', x, '**'));
96
+ // Since patterns[key] is empty we need to wildcard for allow all others.
121
97
  tempArr.unshift('*');
122
98
  patterns[key] = tempArr;
123
99
  } else if (exclude[key].length > 0 && patterns[key].length > 0) {
@@ -125,7 +101,6 @@ function deprecationSupport(options, disableDeprecationWarning) {
125
101
  }
126
102
  });
127
103
  }
128
-
129
104
  handleRTL(options.app.rtlExclude, options.app.exclude.rtl, options.app.exclude.hasRTL, 'app');
130
105
  handleRTL(options.docs.rtlExclude, options.docs.exclude.rtl, options.docs.exclude.hasRTL, 'docs');
131
106
  addExcludesToPattern(options.app.patterns, options.app.exclude, 'app');