@zohodesk/client_build_tool 0.0.1 → 0.0.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 (75) hide show
  1. package/CHANGELOG.md +25 -4
  2. package/ConfigurationDocumentation.md +239 -73
  3. package/README.md +27 -4
  4. package/README_backup.md +2 -0
  5. package/TODO.md +1 -1
  6. package/coverage/addFilesNamesToManifestJson.js.html +148 -0
  7. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/addFilesNamesToManifestJson.js.html +148 -0
  8. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createInitialEntries.js.html +136 -0
  9. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createManifestJson.js.html +181 -0
  10. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/findInitialFileNames.js.html +133 -0
  11. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.html +146 -0
  12. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.js.html +199 -0
  13. package/coverage/bundler/webpack/custom_plugins/AddManifestJson/removeHashFromFileName.js.html +127 -0
  14. package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js.html +346 -0
  15. package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/index.html +116 -0
  16. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/constants.js.html +94 -0
  17. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js.html +259 -0
  18. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.html +236 -0
  19. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.js.html +442 -0
  20. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/insertBefore.js.html +154 -0
  21. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js.html +142 -0
  22. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js.html +127 -0
  23. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js.html +139 -0
  24. package/coverage/{updateArrayWithDefault.js.html → bundler/webpack/custom_postcss_plugins/HoverActivePlugin/specialCases.js.html} +55 -67
  25. package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js.html +193 -0
  26. package/coverage/bundler/webpack/custom_postcss_plugins/SelectorReplace.js.html +292 -0
  27. package/coverage/bundler/webpack/custom_postcss_plugins/ValueReplacer.js.html +223 -0
  28. package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.html +116 -0
  29. package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.js.html +1126 -0
  30. package/coverage/bundler/webpack/custom_postcss_plugins/index.html +131 -0
  31. package/coverage/bundler/webpack/loaderConfigs/getSpecificPostCssPlugin.js.html +247 -0
  32. package/coverage/bundler/webpack/loaderConfigs/index.html +116 -0
  33. package/coverage/coverage-final.json +3 -1
  34. package/coverage/coverage-summary.json +4 -2
  35. package/coverage/createInitialEntries.js.html +136 -0
  36. package/coverage/dummy.js.html +238 -0
  37. package/coverage/index.html +51 -21
  38. package/coverage/index.js.html +169 -0
  39. package/coverage/isObject.js.html +94 -0
  40. package/coverage/isValid.js.html +106 -0
  41. package/coverage/removeHashFromFileName.js.html +127 -0
  42. package/docs/BabelCustomizations.md +55 -0
  43. package/lib/commands/build/preProcessor.js +12 -0
  44. package/lib/commands/buildEs/preProcessor.js +17 -0
  45. package/lib/commands/buildLib/preProcessor.js +17 -0
  46. package/lib/commands/pre_process/commandExecutor.js +18 -0
  47. package/lib/commands/pre_process/config.js +12 -0
  48. package/lib/commands/start/preProcessor.js +3 -1
  49. package/lib/schemas/defaultConfigValues.js +65 -29
  50. package/lib/schemas/defaultConfigValuesOnly.js +20 -1
  51. package/lib/shared/babel/addDefaultPlugins.js +15 -0
  52. package/lib/shared/babel/babelWebConfig.js +2 -2
  53. package/lib/shared/babel/getBabelPlugin.js +37 -0
  54. package/lib/shared/bundler/webpack/common/nameTemplates.js +31 -8
  55. package/lib/shared/bundler/webpack/configCustomLoaders.js +1 -1
  56. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -1
  57. package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +80 -0
  58. package/lib/shared/bundler/webpack/getCSSLoaders.js +2 -0
  59. package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +1 -53
  60. package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +7 -0
  61. package/lib/shared/bundler/webpack/outputConfig.js +9 -2
  62. package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +20 -0
  63. package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +25 -10
  64. package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +2 -2
  65. package/lib/shared/bundler/webpack/pluginConfigs/dummy.js +23 -0
  66. package/lib/shared/bundler/webpack/plugins.js +3 -1
  67. package/lib/shared/bundler/webpack/statsConfig.js +11 -2
  68. package/lib/shared/commands-utils/spawnSyncIO.js +5 -5
  69. package/lib/shared/pre_process/runPreProcess.js +58 -0
  70. package/lib/shared/server/mockApiHandler.js +1 -1
  71. package/npm-shrinkwrap.json +552 -2209
  72. package/package.json +8 -3
  73. package/result.json +1 -1
  74. package/unittest/index.html +33 -35
  75. package/lib/shared/babel/defaultBabelPlugins.js +0 -26
@@ -24,15 +24,15 @@ function spawnSyncIO(commandName, args, spawnSyncOptions = defaultSpawnSyncOptio
24
24
 
25
25
  if (result.error || result.stderr) {
26
26
  (0, _logger.errorLogger)(result.error || result.stderr);
27
- } // console.log(result.output);
27
+ }
28
28
 
29
-
30
- process.exit(result.status);
29
+ return result;
31
30
  }
32
31
 
33
32
  function spawnIO(commandName, args, cb) {
34
- // const result =
35
- (0, _child_process.spawn)(commandName, args, {
33
+ const command = (0, _getCliPath.getCliPath)(commandName); // const result =
34
+
35
+ return (0, _child_process.spawn)(command, args, {
36
36
  stdio: 'inherit'
37
37
  }, cb); // process.exit(result.status);
38
38
  }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runPreProcess = runPreProcess;
7
+
8
+ var _path = require("path");
9
+
10
+ var _fs = require("fs");
11
+
12
+ var _spawnSyncIO = require("../commands-utils/spawnSyncIO");
13
+
14
+ var _logger = require("../../logger");
15
+
16
+ var _constants = require("../constants");
17
+
18
+ function runPreProcess(options, runnerCli = 'node') {
19
+ const {
20
+ preProcess
21
+ } = options;
22
+ const {
23
+ enable,
24
+ runner,
25
+ stopNodemon
26
+ } = preProcess;
27
+
28
+ if (!enable || !runner) {
29
+ return null;
30
+ }
31
+
32
+ const preprocessorPath = (0, _constants.joinWithAppPath)(runner);
33
+ let result = null;
34
+
35
+ if ((0, _fs.existsSync)(preprocessorPath)) {
36
+ const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
37
+ const watchOptions = ['--watch', preprocessorDirPath];
38
+ const preprocessCli = stopNodemon ? 'node' : runnerCli;
39
+
40
+ if (preprocessCli === 'node') {
41
+ result = (0, _spawnSyncIO.spawnSyncIO)(preprocessCli, [preprocessorPath], {
42
+ stdio: 'inherit',
43
+ cwd: preprocessorDirPath
44
+ });
45
+ (0, _logger.messageLogger)('pre_processor ran successfully');
46
+ } else {
47
+ result = (0, _spawnSyncIO.spawnIO)(preprocessCli, [preprocessorPath, ...watchOptions], {
48
+ stdio: 'inherit',
49
+ cwd: preprocessorDirPath
50
+ });
51
+ }
52
+ } else {
53
+ (0, _logger.errorLogger)(`preProcessor not exists ${preprocessorPath}`);
54
+ process.exit(0);
55
+ }
56
+
57
+ return result;
58
+ }
@@ -44,7 +44,6 @@ function handleMockApi(mockEntryFile, app) {
44
44
  const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile); // eslint-disable-next-line no-use-before-define
45
45
 
46
46
  const mockFunc = safeRequire(entryFilePath);
47
- console.log(mockFunc);
48
47
  mockFunc?.mockApi?.(app);
49
48
  } // function handleMockApi(params) {
50
49
  // }
@@ -52,6 +51,7 @@ function handleMockApi(mockEntryFile, app) {
52
51
 
53
52
  function safeRequire(entryFilePath) {
54
53
  if (!(0, _fs.existsSync)(entryFilePath)) {
54
+ (0, _logger.errorLogger)(`${entryFilePath} file not exists for mockapi, Please check the file presence`);
55
55
  return null;
56
56
  } // eslint-disable-next-line import/no-dynamic-require, global-require
57
57