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

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 (222) hide show
  1. package/README.md +18 -0
  2. package/lib/babel/babel-option-utils/babel-preset-react-option.js +3 -0
  3. package/lib/babel/cmjs-plugins-presets.js +13 -2
  4. package/lib/babel/es-plugins-presets.js +14 -3
  5. package/lib/common/buildEs.js +0 -1
  6. package/lib/common/getEntries.js +13 -2
  7. package/lib/common/getPublicPathConfig.js +6 -0
  8. package/lib/common/index.js +6 -1
  9. package/lib/common/runPreProcess.js +15 -6
  10. package/lib/common/splitChunks.js +21 -2
  11. package/lib/common/sslcertUpdater.js +18 -7
  12. package/lib/common/templateParameters.js +2 -0
  13. package/lib/common/testPattern.js +21 -10
  14. package/lib/common/valueReplacer.js +16 -1
  15. package/lib/configs/jest.config.js +11 -2
  16. package/lib/configs/libAlias.js +16 -10
  17. package/lib/configs/resolvers.js +16 -6
  18. package/lib/configs/webpack.component.umd.config.js +6 -1
  19. package/lib/configs/webpack.css.umd.config.js +14 -6
  20. package/lib/configs/webpack.dev.config.js +14 -1
  21. package/lib/configs/webpack.docs.config.js +9 -1
  22. package/lib/configs/webpack.impact.config.js +8 -1
  23. package/lib/configs/webpack.prod.config.js +17 -4
  24. package/lib/constants.js +18 -9
  25. package/lib/deprecationLogger.js +7 -0
  26. package/lib/hooks/docsProptypeHook.js +8 -4
  27. package/lib/jest/commitedFilesResult.js +46 -4
  28. package/lib/jest/coverageCollector.js +12 -1
  29. package/lib/jest/jsonMaker.js +6 -0
  30. package/lib/jest/preProcessors/cssPreprocessor.js +9 -1
  31. package/lib/jest/preProcessors/jsPreprocessor.js +11 -2
  32. package/lib/jest/preProcessors/otherFilesPreprocessor.js +4 -1
  33. package/lib/jest/result.js +23 -1
  34. package/lib/jest/run.js +18 -7
  35. package/lib/jest/setup.js +60 -8
  36. package/lib/loaderUtils/configsAssetsLoaders.js +12 -2
  37. package/lib/loaderUtils/getCSSLoaders.js +22 -10
  38. package/lib/loaderUtils/getDevJsLoaders.js +13 -4
  39. package/lib/loaderUtils/index.js +4 -1
  40. package/lib/loaderUtils/tests/windowsModification.test.js +1 -0
  41. package/lib/loaderUtils/windowsModification.js +3 -2
  42. package/lib/loaders/__test__/markdownLoader.spec.js +1 -0
  43. package/lib/loaders/composeLoader.js +37 -13
  44. package/lib/loaders/docsLoader.js +12 -1
  45. package/lib/loaders/docsPropsLoader.js +8 -4
  46. package/lib/loaders/enhancedReactLiveConverter.js +23 -2
  47. package/lib/loaders/fileBountryLoader.js +3 -1
  48. package/lib/loaders/fileLoader.js +23 -12
  49. package/lib/loaders/markdownLoader.js +19 -14
  50. package/lib/loaders/reactLiveConvertor.js +15 -5
  51. package/lib/loaders/scriptInstrumentLoader.js +16 -7
  52. package/lib/loaders/selectorMappingLoader.js +26 -7
  53. package/lib/loaders/workerLoader.js +24 -9
  54. package/lib/logger.js +4 -0
  55. package/lib/middlewares/HMRMiddleware.js +27 -13
  56. package/lib/middlewares/SSTMiddleware.js +5 -1
  57. package/lib/pluginUtils/configHtmlWebpackPlugins.js +24 -1
  58. package/lib/pluginUtils/getDevPlugins.js +42 -9
  59. package/lib/pluginUtils/getDocsPlugins.js +13 -3
  60. package/lib/pluginUtils/getLibraryImactPlugins.js +6 -5
  61. package/lib/pluginUtils/getLibraryPlugins.js +8 -2
  62. package/lib/pluginUtils/getProdPlugins.js +47 -8
  63. package/lib/pluginUtils/getServerPlugins.js +8 -2
  64. package/lib/pluginUtils/getUMDCSSPlugins.js +10 -2
  65. package/lib/pluginUtils/getUMDComponentPlugins.js +10 -2
  66. package/lib/pluginUtils/index.js +9 -1
  67. package/lib/plugins/CdnChangePlugin.js +18 -2
  68. package/lib/plugins/CleanupStatsPlugin.js +5 -0
  69. package/lib/plugins/CssOrderControlPlugin.js +6 -3
  70. package/lib/plugins/CustomAttributePlugin.js +19 -14
  71. package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +23 -3
  72. package/lib/plugins/EFCPlugin.js +34 -20
  73. package/lib/plugins/EFCTemplatePlugin.js +30 -19
  74. package/lib/plugins/EfcResourceCleanupPlugin.js +3 -0
  75. package/lib/plugins/EventsHandlingPlugin.js +4 -2
  76. package/lib/plugins/I18NInjectIntoIndexPlugin.js +37 -14
  77. package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +15 -10
  78. package/lib/plugins/I18nSplitPlugin/I18nDependency.js +10 -4
  79. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +155 -78
  80. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +81 -198
  81. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +23 -12
  82. package/lib/plugins/I18nSplitPlugin/index.js +24 -13
  83. package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +12 -2
  84. package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +1 -0
  85. package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +5 -0
  86. package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +8 -1
  87. package/lib/plugins/I18nSplitPlugin/utils/index.js +4 -0
  88. package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +20 -0
  89. package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +1 -0
  90. package/lib/plugins/ManifestPlugin.js +18 -1
  91. package/lib/plugins/MinifyPlugin.js +10 -1
  92. package/lib/plugins/ModuleStatsPlugin.js +24 -1
  93. package/lib/plugins/OptimizeJSPlugin.js +10 -2
  94. package/lib/plugins/PublicPathCallbackPlugin.js +12 -1
  95. package/lib/plugins/PublicPathChangePlugin.js +39 -6
  96. package/lib/plugins/ReportGeneratePlugin.js +32 -5
  97. package/lib/plugins/RequireVariablePublicPlugin.js +8 -1
  98. package/lib/plugins/ResourceHintsPlugin.js +13 -4
  99. package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +17 -12
  100. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +17 -10
  101. package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +5 -2
  102. package/lib/plugins/ScriptInstrumentPlugin.js +8 -1
  103. package/lib/plugins/SelectorPlugin.js +32 -6
  104. package/lib/plugins/ServiceWorkerPlugin.js +22 -5
  105. package/lib/plugins/ShadowDOMSupportPlugin.js +41 -4
  106. package/lib/plugins/SourceMapHookPlugin.js +12 -2
  107. package/lib/plugins/StatsPlugin.js +14 -0
  108. package/lib/plugins/TPHashMappingPlugin.js +18 -3
  109. package/lib/plugins/UnusedFilesFindPlugin.js +39 -4
  110. package/lib/plugins/VariableConversionCollector.js +42 -15
  111. package/lib/plugins/index.js +20 -1
  112. package/lib/plugins/libraryImpactPlugin.js +33 -1
  113. package/lib/plugins/utils/classHandling.js +6 -0
  114. package/lib/plugins/utils/fileHandling.js +15 -6
  115. package/lib/plugins/utils/tests/fileHandling.test.js +4 -0
  116. package/lib/plugins/variableConvertorUtils.js +29 -14
  117. package/lib/plugins/webpackwatchrunplugin.js +5 -0
  118. package/lib/postcss-plugins/EmptyPlugin.js +4 -3
  119. package/lib/postcss-plugins/ExcludePlugin.js +5 -1
  120. package/lib/postcss-plugins/IncludePlugin.js +5 -1
  121. package/lib/postcss-plugins/RTLSplitPlugin.js +27 -14
  122. package/lib/postcss-plugins/SelectorReplace.js +16 -1
  123. package/lib/postcss-plugins/ValueReplacer.js +6 -7
  124. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +3 -0
  125. package/lib/postcss-plugins/__test__/selectorReplace.test.js +3 -6
  126. package/lib/postcss-plugins/__test__/valueReplacer.spec.js +5 -2
  127. package/lib/postcss-plugins/hoverActivePlugin.js +67 -31
  128. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +7 -0
  129. package/lib/postcss-plugins/variableModificationPlugin/index.js +49 -28
  130. package/lib/schemas/index.js +10 -3
  131. package/lib/servers/clusterHubServer.js +11 -1
  132. package/lib/servers/devBuild.js +26 -14
  133. package/lib/servers/docsServer.js +3 -1
  134. package/lib/servers/docsServerCore.js +22 -1
  135. package/lib/servers/getCliPath.js +9 -0
  136. package/lib/servers/helpServer.js +6 -1
  137. package/lib/servers/httpsOptions.js +8 -2
  138. package/lib/servers/impactServer.js +35 -3
  139. package/lib/servers/mockserver.js +10 -1
  140. package/lib/servers/nowatchserver.js +37 -12
  141. package/lib/servers/requireLocalOrGlobal.js +17 -6
  142. package/lib/servers/scrServer.js +21 -14
  143. package/lib/servers/server.js +36 -6
  144. package/lib/servers/ssServer.js +17 -1
  145. package/lib/templates/CoverageScriptTemplate.js +14 -0
  146. package/lib/templates/WMSTemplate.js +13 -7
  147. package/lib/templates/linterConstant.js +4 -2
  148. package/lib/utils/babelPresets.js +7 -3
  149. package/lib/utils/clean.js +9 -3
  150. package/lib/utils/copy.js +7 -1
  151. package/lib/utils/copyTimezones.js +9 -1
  152. package/lib/utils/createEventStream.js +6 -1
  153. package/lib/utils/cssClassNameGenerate.js +30 -10
  154. package/lib/utils/cssURLReplacer.js +22 -1
  155. package/lib/utils/dependencyPostPublish.js +10 -1
  156. package/lib/utils/deprecationSupport.js +32 -7
  157. package/lib/utils/fileUtils.js +28 -1
  158. package/lib/utils/folderIterator.js +13 -2
  159. package/lib/utils/getComponents.js +21 -0
  160. package/lib/utils/getCurrentBranch.js +5 -0
  161. package/lib/utils/getDependenciesImpactList.js +22 -1
  162. package/lib/utils/getFileType.js +10 -2
  163. package/lib/utils/getHash.js +8 -1
  164. package/lib/utils/getIp.js +2 -0
  165. package/lib/utils/getOptions.js +53 -16
  166. package/lib/utils/getServerURL.js +10 -1
  167. package/lib/utils/index.js +51 -4
  168. package/lib/utils/init.js +1 -0
  169. package/lib/utils/initPreCommitHook.js +30 -7
  170. package/lib/utils/jsonHelper.js +22 -3
  171. package/lib/utils/libraryImpactConfig.js +5 -2
  172. package/lib/utils/lint/addScripts.js +5 -2
  173. package/lib/utils/lint/checkExistingConfig.js +12 -3
  174. package/lib/utils/lint/copyConfigs.js +3 -0
  175. package/lib/utils/lint/index.js +9 -0
  176. package/lib/utils/lint/lintScripts.js +1 -0
  177. package/lib/utils/lint/lintSetup.js +4 -3
  178. package/lib/utils/lint/lintStagedPreCommitHook.js +1 -0
  179. package/lib/utils/lint/question.js +7 -0
  180. package/lib/utils/lintReporter.js +20 -0
  181. package/lib/utils/log.js +1 -0
  182. package/lib/utils/mailSender.js +8 -1
  183. package/lib/utils/object-manipulation.js +17 -1
  184. package/lib/utils/pullOrigin.js +4 -0
  185. package/lib/utils/reinstallDependencies.js +29 -1
  186. package/lib/utils/removeAttributes.js +8 -1
  187. package/lib/utils/repoClone.js +28 -3
  188. package/lib/utils/request.js +12 -0
  189. package/lib/utils/rtl.js +17 -5
  190. package/lib/utils/selectorReplacer.js +16 -10
  191. package/lib/utils/setEnvVariables.js +2 -0
  192. package/lib/utils/ssTestHack.js +11 -1
  193. package/lib/utils/switchBranch.js +5 -0
  194. package/lib/utils/typeCheck.js +1 -0
  195. package/lib/utils/urlConcat.js +4 -0
  196. package/lib/utils/useExitCleanup.js +10 -9
  197. package/lib/utils/variableConverter.js +31 -22
  198. package/{package-lock.json → npm-shrinkwrap.json} +2333 -2101
  199. package/package.json +3 -2
  200. package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +0 -279
  201. package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +0 -51
  202. package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +0 -48
  203. package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +0 -306
  204. package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +0 -363
  205. package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +0 -694
  206. package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +0 -1258
  207. package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +0 -542
  208. package/lib/plugins/newi18nsplitplugin/18nplugin.js +0 -974
  209. package/lib/plugins/newi18nsplitplugin/ChunkManager.js +0 -131
  210. package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +0 -59
  211. package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +0 -262
  212. package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +0 -166
  213. package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +0 -111
  214. package/lib/plugins/newi18nsplitplugin/KeyCollector.js +0 -163
  215. package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +0 -88
  216. package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +0 -101
  217. package/lib/plugins/newi18nsplitplugin/constants.js +0 -162
  218. package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +0 -78
  219. package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +0 -22
  220. package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +0 -18
  221. package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +0 -580
  222. package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +0 -54
package/README.md CHANGED
@@ -44,6 +44,24 @@ Now to run app
44
44
 
45
45
  # Change Logs
46
46
 
47
+ # 1.1.28 (29-01-2025)
48
+
49
+ **Fixes**
50
+
51
+ - We've changed the i18n Unicode conversion process. Instead of converting the Unicode at runtime, we now convert it to the corresponding language during the build process and emit the final build
52
+ - Added @zohodesk-private in transformIgnorePatterns in jest.config.js file , fix in jest
53
+
54
+ **changes**
55
+
56
+ - separate the disableES5Transpile flag as two flags disableES5Transpile and disableES5Import
57
+ - disableES5Import flag handles the alias part
58
+ - disableES5Transpile flag handles the esmodules or common modules conversion part
59
+
60
+
61
+ # 1.1.27 (16-12-2024)
62
+
63
+ - While rendering i18n keys at runtime, we convert any keys containing Unicode to their corresponding language characters before rendering. This enhances performance and reduces file size.
64
+
47
65
  # 1.1.26 (06-09-2024)
48
66
 
49
67
  **Features**
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getReactPreset;
7
+
7
8
  function getReactPresetOptions() {
8
9
  return {
9
10
  runtime: 'classic',
@@ -11,9 +12,11 @@ function getReactPresetOptions() {
11
12
  useSpread: true
12
13
  };
13
14
  }
15
+
14
16
  function getReactPreset({
15
17
  disableES5Transpile
16
18
  }) {
17
19
  const reactPreset = require.resolve('@babel/preset-react');
20
+
18
21
  return disableES5Transpile ? [reactPreset, getReactPresetOptions()] : reactPreset;
19
22
  }
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _utils = require("../utils");
9
+
8
10
  var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  const {
11
15
  module: {
12
16
  mode
@@ -26,17 +30,24 @@ const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isPro
26
30
  }]];
27
31
  const resolvedPlugins = [];
28
32
  babelPlugins.forEach(plugin => {
29
- resolvedPlugins.push(require.resolve(plugin));
33
+ if (Array.isArray(plugin)) {
34
+ resolvedPlugins.push([require.resolve(plugin[0]), plugin[1]]);
35
+ } else {
36
+ resolvedPlugins.push(require.resolve(plugin));
37
+ }
30
38
  });
31
39
  const plugins = [...defaultPlugins, ...resolvedPlugins];
32
40
  const presets = [require.resolve('@babel/preset-env'), (0, _babelPresetReactOption.default)({
33
41
  disableES5Transpile: false
34
42
  })];
43
+
35
44
  if (enableTypeScript) {
36
45
  presets.push(require.resolve('@babel/preset-typescript'));
37
46
  }
47
+
38
48
  var _default = () => ({
39
49
  presets: presets,
40
50
  plugins: plugins
41
51
  });
52
+
42
53
  exports.default = _default;
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _utils = require("../utils");
9
+
8
10
  var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-utils/babel-preset-react-option"));
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  const {
11
15
  module: {
12
16
  mode,
@@ -22,12 +26,16 @@ const isProd = mode.toLowerCase() === 'prod';
22
26
  const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
23
27
  __DOCS__: false
24
28
  } : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), [require.resolve('babel-plugin-module-resolver'), {
25
- "root": ["./"],
29
+ 'root': ['./'],
26
30
  alias
27
31
  }]];
28
32
  const resolvedPlugins = [];
29
33
  babelPlugins.forEach(plugin => {
30
- resolvedPlugins.push(require.resolve(plugin));
34
+ if (Array.isArray(plugin)) {
35
+ resolvedPlugins.push([require.resolve(plugin[0]), plugin[1]]);
36
+ } else {
37
+ resolvedPlugins.push(require.resolve(plugin));
38
+ }
31
39
  });
32
40
  const plugins = [...defaultPlugins, ...resolvedPlugins];
33
41
  const presets = [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
@@ -42,11 +50,14 @@ const presets = [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
42
50
  }], (0, _babelPresetReactOption.default)({
43
51
  disableES5Transpile
44
52
  })];
53
+
45
54
  if (enableTypeScript) {
46
55
  presets.push(require.resolve('@babel/preset-typescript'));
47
56
  }
57
+
48
58
  var _default = () => ({
49
59
  presets: presets,
50
60
  plugins: plugins
51
61
  });
62
+
52
63
  exports.default = _default;
@@ -1,4 +1,3 @@
1
-
2
1
  // result = spawnSync(
3
2
  // babel,
4
3
  // [
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _path = _interopRequireDefault(require("path"));
9
+
8
10
  var _utils = require("../utils");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  let getEntries = (appSchemas, mode) => {
11
15
  let appPath = process.cwd();
12
16
  let {
@@ -26,16 +30,23 @@ let getEntries = (appSchemas, mode) => {
26
30
  let entry = {
27
31
  main: mainJs
28
32
  };
33
+
29
34
  if (mode === 'dev' || mode === 'dev-no-warn') {
30
35
  mainJs.push(`${_path.default.join(__dirname, '..', 'templates', 'WMSTemplate')}?wmsPath=wss:${(0, _utils.getServerURL)(server)}`);
31
36
  }
37
+
32
38
  mainJs.push(_path.default.join(appPath, folder, isReactMig ? 'migration.js' : 'index.js'));
39
+
33
40
  if (hasWidget) {
34
41
  entry.widget = [_path.default.join(appPath, folder, 'widget.js')];
35
42
  }
43
+
36
44
  if (hasEFC) {
37
45
  entry.efc = [_path.default.join(appPath, folder, 'efc.js')];
38
46
  }
47
+
39
48
  return entry;
40
49
  };
41
- var _default = exports.default = getEntries;
50
+
51
+ var _default = getEntries;
52
+ exports.default = _default;
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _utils = require("../utils");
9
+
8
10
  let {
9
11
  app: {
10
12
  publicPaths,
@@ -18,8 +20,10 @@ let {
18
20
  }
19
21
  } = (0, _utils.getOptions)();
20
22
  let isDevelopment = mode === 'dev' || mode === 'prod' || mode === 'dev-no-warn';
23
+
21
24
  var _default = url => {
22
25
  let type = (0, _utils.getFileType)(url);
26
+
23
27
  if (!isDevelopment) {
24
28
  if (publicPaths && publicPaths.callback) {
25
29
  return `${publicPaths.callback}(${JSON.stringify(type)}) + ${JSON.stringify(url)}`;
@@ -29,6 +33,8 @@ var _default = url => {
29
33
  return `__REACT_CLI_${type.toUpperCase()}_PUBLIC_PATH__ + ${JSON.stringify(url)}`;
30
34
  }
31
35
  }
36
+
32
37
  return `__webpack_public_path__ + ${JSON.stringify(url)}`;
33
38
  };
39
+
34
40
  exports.default = _default;
@@ -27,8 +27,13 @@ Object.defineProperty(exports, "templateParameters", {
27
27
  return _templateParameters.default;
28
28
  }
29
29
  });
30
+
30
31
  var _splitChunks = _interopRequireDefault(require("./splitChunks"));
32
+
31
33
  var _getEntries = _interopRequireDefault(require("./getEntries"));
34
+
32
35
  var _getPublicPathConfig = _interopRequireDefault(require("./getPublicPathConfig"));
36
+
33
37
  var _templateParameters = _interopRequireDefault(require("./templateParameters"));
34
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
38
+
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.runPreProcess = runPreProcess;
7
+
7
8
  var _path = _interopRequireWildcard(require("path"));
9
+
8
10
  var _fs = require("fs");
11
+
9
12
  var _child_process = require("child_process");
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; }
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
+
12
18
  function runPreProcess({
13
19
  options,
14
20
  option,
@@ -20,20 +26,22 @@ function runPreProcess({
20
26
  } = options;
21
27
  const preprocessorPath = preprocess.runner ? _path.default.join(process.cwd(), preprocess.runner) : '';
22
28
  const preprocessCli = preprocess.stopNodemon ? 'node' : nodemon;
29
+
23
30
  if (preprocessorPath && (0, _fs.existsSync)(preprocessorPath)) {
24
31
  const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
25
- const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : [];
26
- // eslint-disable-next-line default-case
32
+ const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : []; // eslint-disable-next-line default-case
33
+
27
34
  switch (option) {
28
35
  case 'start':
29
36
  case 'docs':
30
37
  (0, _child_process.spawn)(preprocessCli, [preprocessorPath, ...watchOptions], {
31
38
  stdio: 'inherit',
32
39
  cwd: preprocessorDirPath
33
- });
34
- // NOTE: it's ok if we not close this here
40
+ }); // NOTE: it's ok if we not close this here
35
41
  // Because when node server stops this program will be closed So this nodemon will be killed as well
42
+
36
43
  break;
44
+
37
45
  case 'nowatchstart':
38
46
  case 'devbuild':
39
47
  case 'build:library:es':
@@ -45,6 +53,7 @@ function runPreProcess({
45
53
  cwd: preprocessorPath.slice(0, preprocessorPath.lastIndexOf('/') + 1)
46
54
  });
47
55
  break;
56
+
48
57
  case 'preprocessor':
49
58
  {
50
59
  const result = spawnSync(preprocessCli, [preprocessorPath, ...watchOptions], {
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _path = _interopRequireDefault(require("path"));
9
+
8
10
  var _os = _interopRequireDefault(require("os"));
11
+
9
12
  var _utils = require("../utils");
13
+
10
14
  var _testPattern = require("./testPattern");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
12
18
  const isWindows = _os.default.platform().toLowerCase() === 'win32';
13
19
  const ps = _path.default.sep;
14
20
  const options = (0, _utils.getOptions)();
@@ -23,29 +29,35 @@ const {
23
29
  const reactBundleIncludeList = ['react', 'react-dom', 'react-redux', 'react-transition-group', 'scheduler', 'prop-types'];
24
30
  const vendorExcludeList = ['script-loader', 'raw-loader', ...reactBundleIncludeList, ...vendorExclude.map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep))];
25
31
  const vendorIncludeList = [...vendorInclude].map(vendorPath => vendorPath.replace(/[/\\]/g, _path.default.sep));
32
+
26
33
  const isVendor = function isVendor(module) {
27
34
  const {
28
35
  userRequest
29
36
  } = module;
30
37
  return userRequest && (vendorIncludeList.some(item => userRequest.indexOf(item) !== -1) || userRequest.indexOf('node_modules') >= 0 && userRequest.endsWith('.css') === false && userRequest.endsWith('publicPathConfig.js') === false && vendorExcludeList.every(item => userRequest.indexOf(`node_modules${ps}${item}${ps}`) === -1));
31
38
  };
39
+
32
40
  const isReact = module => {
33
41
  const {
34
42
  userRequest
35
43
  } = module;
36
44
  return userRequest && reactBundleIncludeList.some(pkg => userRequest.indexOf(`node_modules${ps}${pkg}${ps}`) >= 0);
37
45
  };
46
+
38
47
  function rulesMatcher(pattern) {
39
48
  if (typeof pattern === 'function') {
40
49
  return pattern;
41
50
  }
51
+
42
52
  if (Array.isArray(pattern)) {
43
53
  return ({
44
54
  userRequest
45
55
  }) => (0, _testPattern.testPattern)(userRequest, pattern);
46
56
  }
57
+
47
58
  return new RegExp(isWindows ? pattern.replace(/\//g, '\\') : pattern);
48
59
  }
60
+
49
61
  const baseSplitChunkConfig = Object.assign({
50
62
  minSize: 15000
51
63
  }, customChunksBaseConfig);
@@ -101,21 +113,27 @@ customChunks.map((obj, index) => ({
101
113
  minChunks,
102
114
  priority
103
115
  };
116
+
104
117
  if (minSize !== undefined) {
105
118
  obj.minSize = minSize;
106
119
  }
120
+
107
121
  if (maxSize !== undefined) {
108
122
  obj.maxSize = maxSize;
109
123
  }
124
+
110
125
  if (enforce !== false) {
111
126
  obj.enforce = true;
112
127
  }
128
+
113
129
  if (name !== undefined) {
114
130
  obj.name = name;
115
131
  }
132
+
116
133
  if (reuseExistingChunk !== undefined) {
117
134
  obj.reuseExistingChunk = reuseExistingChunk;
118
135
  }
136
+
119
137
  customChunksConfig[cacheGroupName] = obj;
120
138
  });
121
139
  const splitChunkConfig = Object.assign({}, baseSplitChunkConfig, {
@@ -124,4 +142,5 @@ const splitChunkConfig = Object.assign({}, baseSplitChunkConfig, {
124
142
  vendors: false
125
143
  }, specificCacheGroupConfig, customChunksConfig)
126
144
  });
127
- var _default = exports.default = splitChunkConfig;
145
+ var _default = splitChunkConfig;
146
+ exports.default = _default;
@@ -1,16 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _https = _interopRequireDefault(require("https"));
4
+
4
5
  var _http = _interopRequireDefault(require("http"));
6
+
5
7
  var _path = _interopRequireDefault(require("path"));
8
+
6
9
  var _fs = _interopRequireDefault(require("fs"));
10
+
7
11
  var _getOptions = _interopRequireDefault(require("../utils/getOptions"));
12
+
8
13
  var _urlConcat = require("../utils/urlConcat");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+
10
17
  const {
11
18
  sslCertURL
12
19
  } = (0, _getOptions.default)();
20
+
13
21
  const CRET_FOLDER_PATH = _path.default.join(__dirname, '..', '..', 'cert');
22
+
14
23
  console.log({
15
24
  CRET_FOLDER_PATH,
16
25
  sslCertURL
@@ -18,6 +27,7 @@ console.log({
18
27
  const CERT_PATH = 'cert.pem';
19
28
  const KEY_PATH = 'key.pem';
20
29
  const PASSPHRASE_PATH = 'passphrase.pem';
30
+
21
31
  function updateSSlFile(sslCertURL, filename) {
22
32
  let url = (0, _urlConcat.urlConcat)(sslCertURL, filename);
23
33
  console.log({
@@ -25,24 +35,25 @@ function updateSSlFile(sslCertURL, filename) {
25
35
  });
26
36
  (url.startsWith('https://') ? _https.default : _http.default).get(url, resp => {
27
37
  let fpath = _path.default.join(CRET_FOLDER_PATH, filename);
28
- let data = '';
29
- // A chunk of data has been received.
38
+
39
+ let data = ''; // A chunk of data has been received.
40
+
30
41
  resp.on('data', chunk => {
31
42
  data += chunk;
32
- });
43
+ }); // The whole response has been received. Print out the result.
33
44
 
34
- // The whole response has been received. Print out the result.
35
45
  resp.on('end', () => {
36
46
  _fs.default.writeFileSync(fpath, data);
37
- });
38
- // return;
47
+ }); // return;
39
48
  }).on('error', err => {
40
49
  console.log(`Error: ${err.message}`);
41
50
  });
42
51
  }
52
+
43
53
  if (!sslCertURL) {
44
54
  throw 'sslCertURL not given';
45
55
  }
56
+
46
57
  updateSSlFile(sslCertURL, PASSPHRASE_PATH);
47
58
  updateSSlFile(sslCertURL, CERT_PATH);
48
59
  updateSSlFile(sslCertURL, KEY_PATH);
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+
7
8
  var _default = (compilation, assets, assetTags, options) => {
8
9
  Object.keys(assetTags).forEach(rootTag => {
9
10
  assetTags[rootTag].forEach(tag => {
@@ -20,4 +21,5 @@ var _default = (compilation, assets, assetTags, options) => {
20
21
  }
21
22
  };
22
23
  };
24
+
23
25
  exports.default = _default;
@@ -6,51 +6,62 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.isDependency = isDependency;
7
7
  exports.isRelatedPackage = exports.isRelated = void 0;
8
8
  exports.testPattern = testPattern;
9
+
9
10
  var _path = require("path");
11
+
10
12
  // in our development we only use windows, mac and linux
11
- const isWindows = _path.sep !== '/';
13
+ const isWindows = _path.sep !== '/'; // this function will return true if pattern matched
12
14
 
13
- // this function will return true if pattern matched
14
15
  function _testPattern(req, pattern) {
15
16
  let modifiedPattern = pattern;
17
+
16
18
  if (/[*.$^]/.test(modifiedPattern)) {
17
19
  if (isWindows) {
18
20
  // modifiedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
19
21
  modifiedPattern = modifiedPattern.replace(/\//g, '\\\\');
20
22
  }
23
+
21
24
  modifiedPattern = modifiedPattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
22
25
  const re = new RegExp(modifiedPattern);
23
26
  return re.test(req);
24
27
  }
28
+
25
29
  if (isWindows) {
26
30
  // modifiedPattern = pattern.replace(/\//g, ps.replace(/\\/g, '\\\\'));
27
31
  modifiedPattern = modifiedPattern.replace(/\//g, '\\');
28
32
  }
33
+
29
34
  return req.indexOf(modifiedPattern) !== -1;
30
35
  }
36
+
31
37
  function testPattern(req, pattern) {
32
38
  if (!req || !pattern) {
33
39
  return false;
34
40
  }
41
+
35
42
  if (Array.isArray(pattern)) {
36
43
  // eslint-disable-next-line no-unused-vars
37
44
  return pattern.every(p => testPattern(req, p));
38
45
  }
46
+
39
47
  if (pattern[0] === '!') {
40
48
  return !_testPattern(req, pattern.slice(1));
41
49
  }
50
+
42
51
  return _testPattern(req, pattern);
43
52
  }
44
- const isRelated = (req, item) => req && req.indexOf(item) !== -1;
45
- // export const isRelated = (req, item) => testPattern(req, item);
53
+
54
+ const isRelated = (req, item) => req && req.indexOf(item) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
55
+
56
+
46
57
  exports.isRelated = isRelated;
47
- const isRelatedPackage = (req, item) => isRelated(req, `node_modules${_path.sep}${item}${_path.sep}`) !== -1;
48
- // export const isRelated = (req, item) => testPattern(req, item);
58
+
59
+ const isRelatedPackage = (req, item) => isRelated(req, `node_modules${_path.sep}${item}${_path.sep}`) !== -1; // export const isRelated = (req, item) => testPattern(req, item);
60
+
61
+
49
62
  exports.isRelatedPackage = isRelatedPackage;
63
+
50
64
  function isDependency(m, excludeList) {
51
65
  return m.reasons.some(r => excludeList.some(item => r.module && isRelated(r.module.userRequest, item)));
52
- }
53
-
54
- // export function queryHandler(conditions, pattern) {
55
-
66
+ } // export function queryHandler(conditions, pattern) {
56
67
  // }
@@ -1,36 +1,51 @@
1
1
  "use strict";
2
2
 
3
3
  var _postcss = _interopRequireDefault(require("postcss"));
4
+
4
5
  var _path = _interopRequireDefault(require("path"));
6
+
5
7
  var _fs = _interopRequireDefault(require("fs"));
8
+
6
9
  var _folderIterator = _interopRequireDefault(require("../utils/folderIterator"));
10
+
7
11
  var _utils = require("../utils");
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
9
15
  const cwd = process.cwd();
16
+
10
17
  const src = _path.default.join(cwd, process.argv[2]);
18
+
11
19
  const dist = _path.default.join(cwd, process.argv[3]);
20
+
12
21
  const docopy = process.argv[4] === 'true';
13
22
  const {
14
23
  css: {
15
24
  valueReplacer
16
25
  }
17
26
  } = (0, _utils.getOptions)();
27
+
18
28
  if (!_fs.default.existsSync(dist)) {
19
29
  _fs.default.mkdirSync(dist, {
20
30
  recursive: true
21
31
  });
22
32
  }
33
+
23
34
  (0, _folderIterator.default)(src, dist, docopy ? false : ['.css'], false, (fromPath, toPath) => {
24
35
  const css = _fs.default.readFileSync(fromPath);
36
+
25
37
  if (docopy && !fromPath.endsWith('.css')) {
26
38
  _fs.default.writeFileSync(toPath, css);
39
+
27
40
  return;
28
41
  }
42
+
29
43
  (0, _postcss.default)([valueReplacer && require('../postcss-plugins/ValueReplacer')(valueReplacer)]).process(css, {
30
44
  from: fromPath,
31
45
  to: toPath
32
46
  }).then(result => {
33
47
  _fs.default.writeFile(toPath, result.css, () => true);
48
+
34
49
  if (result.map) {
35
50
  _fs.default.writeFile(`${toPath}.map`, result.map, () => true);
36
51
  }
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _fs = require("fs");
4
+
4
5
  var _path = _interopRequireDefault(require("path"));
6
+
5
7
  var _libAlias = require("./libAlias");
6
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
7
11
  const appPath = process.cwd();
12
+
8
13
  const appGlobals = _path.default.resolve(appPath, '__testUtils__', 'globals.js');
14
+
9
15
  const commonConfig = {
10
16
  coverageReporters: ['json', 'html', 'json-summary', 'text'],
11
17
  collectCoverage: true,
@@ -20,7 +26,7 @@ const commonConfig = {
20
26
  // ...moduleNameMapper,
21
27
  // '\\.(css|less)$': 'identity-obj-proxy'
22
28
  // },
23
- transformIgnorePatterns: ['/node_modules/(?!(@zohodesk)/)'],
29
+ transformIgnorePatterns: ['/node_modules/(?!(@zohodesk|@zohodesk-private)/)'],
24
30
  // transformIgnorePatterns: ['/node_modules.*?.js$'],
25
31
  moduleFileExtensions: ['js', 'ts', 'tsx'],
26
32
  setupFiles: [(0, _fs.existsSync)(appGlobals) && appGlobals, _path.default.resolve(__dirname, '..', 'jest', 'setup.js')].filter(Boolean),
@@ -30,14 +36,17 @@ const commonConfig = {
30
36
  __TEST__: true
31
37
  }
32
38
  };
39
+
33
40
  module.exports = (...args) => {
34
41
  const [appFolder, forCommittedFiles = false] = args;
42
+
35
43
  if (forCommittedFiles) {
36
44
  return Object.assign({}, commonConfig, {
37
45
  coverageDirectory: _path.default.resolve(appPath, 'commitCoverage'),
38
46
  testResultsProcessor: _path.default.resolve(__dirname, '..', 'jest', 'commitedFilesResult.js')
39
47
  });
40
48
  }
49
+
41
50
  return Object.assign({}, commonConfig, {
42
51
  rootDir: appPath,
43
52
  testPathIgnorePatterns: ['/node_modules/', 'docs'],