@zohodesk/react-cli 1.1.16-exp.5 → 1.1.16-exp.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. package/bin/cli.js +0 -4
  2. package/lib/babel/cmjs-plugins-presets.js +1 -1
  3. package/lib/babel/es-plugins-presets.js +1 -1
  4. package/lib/configs/webpack.dev.config.js +0 -4
  5. package/lib/configs/webpack.prod.config.js +2 -6
  6. package/npm-shrinkwrap.json +2 -2
  7. package/package.json +1 -4
  8. package/packages/client_build_tool/lib/allCommandsConfigs.js +23 -0
  9. package/packages/client_build_tool/lib/buildToolLoggers.js +32 -0
  10. package/packages/client_build_tool/lib/commands/build/commandExecutor.js +21 -0
  11. package/packages/client_build_tool/lib/commands/build/config.js +12 -0
  12. package/packages/client_build_tool/lib/commands/build/errorHander.js +10 -0
  13. package/packages/client_build_tool/lib/commands/build/index.js +35 -0
  14. package/packages/client_build_tool/lib/commands/build/optionsProcesser.js +40 -0
  15. package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +17 -0
  16. package/packages/client_build_tool/lib/commands/buildEs/config.js +12 -0
  17. package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +17 -0
  18. package/packages/client_build_tool/lib/commands/buildLib/config.js +12 -0
  19. package/packages/client_build_tool/lib/commands/start/commandExecutor.js +13 -0
  20. package/packages/client_build_tool/lib/commands/start/config.js +12 -0
  21. package/packages/client_build_tool/lib/commands/start/deprecationHandler.js +10 -0
  22. package/packages/client_build_tool/lib/commands/start/errorHander.js +10 -0
  23. package/packages/client_build_tool/lib/commands/start/optionsProcesser.js +36 -0
  24. package/packages/client_build_tool/lib/commands/start/postProcesser.js +10 -0
  25. package/packages/client_build_tool/lib/commands/start/preProcesser.js +10 -0
  26. package/packages/client_build_tool/lib/commandsRouter.js +71 -0
  27. package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +44 -0
  28. package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +31 -0
  29. package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +51 -0
  30. package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +21 -0
  31. package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +16 -0
  32. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +111 -0
  33. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCPlugin.js +1 -0
  34. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +11 -0
  35. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +136 -0
  36. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +95 -0
  37. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +25 -0
  38. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +29 -0
  39. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +24 -0
  40. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nDependency.js +99 -0
  41. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +81 -0
  42. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nModule.js +201 -0
  43. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +401 -0
  44. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +67 -0
  45. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +23 -0
  46. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +29 -0
  47. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +49 -0
  48. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +77 -0
  49. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +63 -0
  50. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +19 -0
  51. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +31 -0
  52. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +127 -0
  53. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +1 -0
  54. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +63 -0
  55. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +89 -0
  56. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +34 -0
  57. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +15 -0
  58. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +155 -0
  59. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin.js +49 -0
  60. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/ExcludePlugin.js +58 -0
  61. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/RTLSplitPlugin.js +139 -0
  62. package/packages/client_build_tool/lib/shared/bundler/webpack/devServerConfig.js +34 -0
  63. package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +30 -0
  64. package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +17 -0
  65. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +14 -0
  66. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +24 -0
  67. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +18 -0
  68. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +21 -0
  69. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +138 -0
  70. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +83 -0
  71. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +23 -0
  72. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +133 -0
  73. package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +39 -0
  74. package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +28 -0
  75. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +18 -0
  76. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyThirdpartyFile.js +38 -0
  77. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +24 -0
  78. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +28 -0
  79. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +35 -0
  80. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +16 -0
  81. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +23 -0
  82. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +19 -0
  83. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +27 -0
  84. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +18 -0
  85. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configUglifyCSSPlugin.js +15 -0
  86. package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +39 -0
  87. package/packages/client_build_tool/lib/shared/bundler/webpack/postcssPlugins.js +36 -0
  88. package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +42 -0
  89. package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +12 -0
  90. package/packages/client_build_tool/lib/shared/bundler/webpack/webpack.dev.config.js +17 -0
  91. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +24 -0
  92. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +50 -0
  93. package/packages/client_build_tool/lib/shared/commands-utlis/doBasicRequiermentCheck.js +16 -0
  94. package/packages/client_build_tool/lib/shared/commands-utlis/getCliPath.js +38 -0
  95. package/packages/client_build_tool/lib/shared/commands-utlis/index.js +29 -0
  96. package/packages/client_build_tool/lib/shared/commands-utlis/log.js +13 -0
  97. package/packages/client_build_tool/lib/shared/commands-utlis/readArgsFormCommandLine.js +11 -0
  98. package/packages/client_build_tool/lib/shared/commands-utlis/readOptionFormCommandLine.js +11 -0
  99. package/packages/client_build_tool/lib/shared/commands-utlis/spanSync.js +35 -0
  100. package/packages/client_build_tool/lib/shared/constants.js +33 -0
  101. package/packages/client_build_tool/lib/shared/schemas/applyValuesToShema.js +37 -0
  102. package/packages/client_build_tool/lib/shared/schemas/cliArgsToObject.js +37 -0
  103. package/packages/client_build_tool/lib/shared/schemas/defaultConfigValues.js +119 -0
  104. package/packages/client_build_tool/lib/shared/schemas/deprecatedOptionsHandler.js +65 -0
  105. package/packages/client_build_tool/lib/shared/schemas/getCWD.js +23 -0
  106. package/packages/client_build_tool/lib/shared/schemas/getNpmVersion.js +21 -0
  107. package/packages/client_build_tool/lib/shared/schemas/npmConfigToObject.js +32 -0
  108. package/packages/client_build_tool/lib/shared/schemas/oldDefaultConfigValues.js +480 -0
  109. package/packages/client_build_tool/lib/shared/schemas/readOptions.js +55 -0
  110. package/packages/client_build_tool/lib/shared/schemas/readOptionsForPackageJson.js +26 -0
  111. package/packages/client_build_tool/lib/shared/schemas/readOptionsOld.js +152 -0
  112. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.crt +37 -0
  113. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.key +27 -0
  114. package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +40 -0
  115. package/packages/client_build_tool/lib/shared/server/corsHandleing.js +28 -0
  116. package/packages/client_build_tool/lib/shared/server/getIp.js +30 -0
  117. package/packages/client_build_tool/lib/shared/server/getServerURL.js +29 -0
  118. package/packages/client_build_tool/lib/shared/server/httpsOptions.js +53 -0
  119. package/packages/client_build_tool/lib/shared/server/initExpressApp.js +19 -0
  120. package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +66 -0
  121. package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +24 -0
  122. package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +40 -0
  123. package/packages/client_build_tool/lib/shared/server/startHttpServer.js +26 -0
  124. package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +34 -0
  125. package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +41 -0
  126. package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +44 -0
  127. package/packages/client_build_tool/lib/shared/server/unwanted/devServerUtlis.js +1 -0
  128. package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +19 -0
  129. package/packages/client_build_tool/lib/shared/server/unwanted/webpackConfig.js +32 -0
  130. package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +48 -0
  131. package/packages/client_build_tool/lib/shared/server/urlConcat.js +25 -0
  132. package/packages/client_build_tool/lib/shared/utils/utils.js +1 -0
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.deprecatedOptionsHandler = deprecatedOptionsHandler;
7
+
8
+ var _buildToolLoggers = require("../../buildToolLoggers");
9
+
10
+ function selectn(obj, key) {
11
+ let temp = obj;
12
+ const keys = key.split('.');
13
+
14
+ for (let i = 0; i < keys.length; i++) {
15
+ const element = keys[i];
16
+ temp = temp && temp[element];
17
+ }
18
+
19
+ return temp;
20
+ }
21
+
22
+ function selectnu(obj, key, value) {
23
+ let temp = obj;
24
+ const keys = key.split('.');
25
+ let i = 0;
26
+
27
+ for (; i < keys.length - 1; i++) {
28
+ const element = keys[i];
29
+ temp = temp && temp[element];
30
+ }
31
+
32
+ temp[keys[i]] = value;
33
+ }
34
+
35
+ function deprecatedOptionsHandler(options) {
36
+ function checkAndupdateAndPrintWaring(oldKey, newkey) {
37
+ const oldVal = selectn(options, oldKey);
38
+ const newVal = selectn(options, newkey); // console.log({ oldVal, newVal });
39
+
40
+ if (oldVal !== undefined && newVal === undefined) {
41
+ selectnu(options, newkey, newVal);
42
+ (0, _buildToolLoggers.warnLogger)(`"${oldKey}" deprecated use "${newkey}" instead`);
43
+ }
44
+ } // return;
45
+
46
+
47
+ checkAndupdateAndPrintWaring('app.context', 'context'); // TODO handle deprecations here
48
+ // we will finish this logic later when options are confirmed
49
+
50
+ if (selectn(options, 'app.hasRTL') === true) {
51
+ options.app.plugins.hasRTL = true;
52
+ }
53
+
54
+ if (selectn(options, 'docs.hasRTL') === true) {
55
+ options.docs.plugins.hasRTL = true;
56
+ }
57
+
58
+ if (selectn(options, 'app.rtlExclude.length') > 0) {
59
+ options.app.exclude.rtl = selectn(options, 'app.rtlExclude');
60
+ }
61
+
62
+ if (selectn(options, 'docs.rtlExclude.length') > 0) {
63
+ options.docs.exclude.rtl = selectn(options, 'docs.rtlExclude');
64
+ }
65
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getCWD = getCWD;
7
+
8
+ var _child_process = require("child_process");
9
+
10
+ function getCWD() {
11
+ // require("child_process").
12
+ let cwd = process.cwd();
13
+
14
+ try {
15
+ let ress = (0, _child_process.execSync)('npm bin').toString();
16
+ let i = ress.lastIndexOf('node_modules');
17
+ cwd = i === -1 ? cwd : ress.slice(0, i);
18
+ } catch (error) {
19
+ console.log(error);
20
+ }
21
+
22
+ return cwd;
23
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getNpmVersion = getNpmVersion;
7
+
8
+ var _child_process = require("child_process");
9
+
10
+ function getNpmVersion() {
11
+ // require("child_process").
12
+ let vers = '6';
13
+
14
+ try {
15
+ [vers] = (0, _child_process.execSync)('npm -v').toString().trim().split('.');
16
+ } catch (error) {
17
+ console.log(error);
18
+ }
19
+
20
+ return vers;
21
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.npmConfigToObject = npmConfigToObject;
7
+ const NPM_CONFIG_PREFIX = 'npm_config_'; // TODO: we have to do option parse logic little better
8
+ // if user use react-cli stritly without using npm scripts options won't work,
9
+ // So we have to write our own option parse logic or some other library
10
+ // console.log('type', process.argv, process.env.npm_config_check, process.env.npm_config_clone_type, process.env.npm_config_clone_url);
11
+ // console.log('Object.keys(process.env).filter(s => s.startsWith(\'npm_config_\') && s.includes(\'clone\')', Object.keys(process.env).filter(s => s.startsWith('npm_config_') && s.includes('clone')));
12
+
13
+ function npmConfigToObject() {
14
+ // // clone:type
15
+ const processEnv = {};
16
+ let keysWithColon = [];
17
+ Object.keys(process.env).filter(key => key.startsWith(NPM_CONFIG_PREFIX)).forEach(key => {
18
+ let nkey = key.slice(NPM_CONFIG_PREFIX.length);
19
+ processEnv[nkey] = process.env[key];
20
+ nkey.includes(':') && keysWithColon.push(nkey);
21
+ });
22
+ keysWithColon.forEach(key => {
23
+ let nkey = key.replace(/:/g, '_');
24
+
25
+ if (processEnv[nkey]) {
26
+ console.warn('there is some options conflict', key, nkey);
27
+ }
28
+
29
+ processEnv[nkey] = processEnv[key];
30
+ });
31
+ return processEnv;
32
+ }
@@ -0,0 +1,480 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _os = require("os");
9
+
10
+ var _getIp = require("../server/getIp");
11
+
12
+ var _default = {
13
+ cliRootPath: null,
14
+ unstableDepsInverse: {
15
+ value: false,
16
+ cli: 'unstable_deps_inverse'
17
+ },
18
+ sslCertURL: {
19
+ value: null,
20
+ cli: 'ssl_cert_url'
21
+ },
22
+ preprocess: {
23
+ // This option is for tell the react-cli which in preprocessor js file path
24
+ runner: {
25
+ value: '',
26
+ cli: 'preprocessor'
27
+ },
28
+ // usally preprocessor run in nodemon for, start and docs , preprocessor
29
+ stopNodemon: {
30
+ value: false,
31
+ cli: 'stop_nodemon'
32
+ }
33
+ },
34
+ i18n: {
35
+ chunkSplitEnable: {
36
+ value: false,
37
+ cli: 'i18n_split'
38
+ },
39
+ disableDefault: false,
40
+ templateLabel: '{{--user-locale}}',
41
+ jsResource: null,
42
+ localeVarName: 'document.documentElement.lang',
43
+ jsonpFunc: 'console.log',
44
+ propertiesFolder: null
45
+ },
46
+ css: {
47
+ enableRTLSplit: false,
48
+ valueReplacer: null,
49
+ //valueReplacer: [
50
+ // {
51
+ // props: ['font', 'font-family'],
52
+ // values: {
53
+ // 'zdfonts-rCallBar': 'zdfonts-rCallBar01',
54
+ // 'zdfonts-rCall': 'zdfonts-rCallBar02'
55
+ // }
56
+ // // ,suffix: '0'
57
+ // }
58
+ // ],
59
+ templateLabel: '{{--dir}}',
60
+ disableMiniFiySelector: false,
61
+ dirVarName: 'document.dir'
62
+ },
63
+ efc: {
64
+ hasEFC: {
65
+ value: false,
66
+ cli: 'enable_efc'
67
+ },
68
+ createSDkFile: false,
69
+ nameScope: 'ZOHODESK',
70
+ version: 'default',
71
+ outputFile: {
72
+ value: 'efc-sdk-[version].js',
73
+ cli: 'efc_output_file'
74
+ },
75
+ templateFilePath: '',
76
+ localeAttr: 'data-efc-locale',
77
+ localeDefaultValue: 'en_US',
78
+ localeStatement: null,
79
+ cssDirAttr: 'data-efc-dir',
80
+ cssDirDefaultValue: 'ltr',
81
+ cdnStatement: '',
82
+ // cdnStatement: "new URL(document.querySelector(\"script[src*='zohodesk-efc-sdk']\").src).origin",
83
+ cssDirStatement: null
84
+ },
85
+ app: {
86
+ // this option only for impact testing
87
+ devCssFileBountry: {
88
+ value: '',
89
+ cli: 'impact_cssbountry'
90
+ },
91
+ disableWatch: {
92
+ value: false,
93
+ cli: 'disable_watch'
94
+ },
95
+ enableDevCache: {
96
+ value: false,
97
+ cli: 'dev_cache'
98
+ },
99
+ crossorigin: {
100
+ value: false,
101
+ cli: 'enable_crossorigin'
102
+ },
103
+ context: {
104
+ value: 'app',
105
+ cli: 'app_context'
106
+ },
107
+ tpFolder: null,
108
+ // folder: 'src',
109
+ folder: {
110
+ cli: 'app_folder',
111
+ value: 'src'
112
+ },
113
+ vendorExclude: [],
114
+ vendorInclude: [],
115
+ cssHashSelectors: {
116
+ filenames: [],
117
+ packages: []
118
+ },
119
+ server: {
120
+ host: {
121
+ value: (0, _os.hostname)(),
122
+ cli: 'app_host'
123
+ },
124
+ port: {
125
+ value: 9090,
126
+ cli: 'app_port'
127
+ },
128
+ domain: {
129
+ value: null,
130
+ cli: 'app_domain'
131
+ },
132
+ mode: {
133
+ value: 'dev',
134
+ cli: 'app_mode'
135
+ },
136
+ branch: {
137
+ value: 'master',
138
+ cli: 'app_branch'
139
+ },
140
+ redisHost: {
141
+ value: '127.0.0.1',
142
+ cli: 'redis:host'
143
+ },
144
+ redisPort: {
145
+ value: '6379',
146
+ cli: 'redis:port'
147
+ },
148
+ disableContextURL: false,
149
+ hasMock: false,
150
+ mockPrefix: {
151
+ value: '/api',
152
+ cli: 'mock_prefix'
153
+ },
154
+ mockPort: {
155
+ value: 5000,
156
+ cli: 'mock_port'
157
+ }
158
+ },
159
+ disableES5Transpile: false,
160
+ isReactMig: false,
161
+ hasWidget: false,
162
+ hasEFC: {
163
+ value: false,
164
+ cli: 'enable_efc'
165
+ },
166
+ enableChunkHash: {
167
+ value: false,
168
+ cli: 'hash_enable'
169
+ },
170
+ cssUniqueness: {
171
+ value: true,
172
+ cli: 'css_unique'
173
+ },
174
+ outputFolder: {
175
+ value: 'build',
176
+ cli: 'output_folder'
177
+ },
178
+ bundleAnalyze: {
179
+ value: false,
180
+ cli: 'bundle_analyze'
181
+ },
182
+ optimize: true,
183
+ manifestFileName: 'manifest.json',
184
+ removeAttribute: {
185
+ value: true,
186
+ cli: 'rm_attr'
187
+ },
188
+ attrbuteNames: {
189
+ value: ['data-testid'],
190
+ cli: 'attr_name'
191
+ },
192
+ publicPaths: false,
193
+ instrumentScript: {
194
+ value: false,
195
+ cli: 'instru_script'
196
+ },
197
+ enableSMap: {
198
+ value: false,
199
+ cli: 'enable_smap'
200
+ },
201
+ enableSMapHook: {
202
+ value: true,
203
+ cli: 'enable_smaphook'
204
+ },
205
+ hasRTL: false,
206
+ rtlExclude: [],
207
+ seperateCssModules: {
208
+ value: false,
209
+ cli: 'sep_cssmodules'
210
+ },
211
+ hasShadowDOM: {
212
+ value: false,
213
+ cli: 'has_shadowdom'
214
+ },
215
+ resourceHints: [],
216
+ changeRuntimeChunkChar: false,
217
+ classNamePrefix: {
218
+ value: 'zd',
219
+ cli: 'class_prefix'
220
+ },
221
+ selectorReplace: null,
222
+ devConsoleExculde: {
223
+ value: false,
224
+ cli: 'console_exculde'
225
+ },
226
+ serviceWorker: {
227
+ enableSw: false,
228
+ filePath: 'sw.js',
229
+ fileName: 'v1.js',
230
+ exitPath: '/',
231
+ replaceText: '//<!--AssetsFromBuild -->'
232
+ },
233
+ htmlTemplate: {
234
+ inject: true
235
+ },
236
+ removePropTypes: false,
237
+ customChunks: [{
238
+ name: 'styles',
239
+ pattern: '\\.css$'
240
+ }],
241
+ tpHashMapping: [],
242
+ cdnMapping: {
243
+ isCdnEnabled: false,
244
+ variableName: '',
245
+ cssTemplate: '',
246
+ jsTemplate: '',
247
+ i18nTemplate: ''
248
+ },
249
+ sourcemap: {
250
+ cli: 'source_map',
251
+ value: 'cheap-eval-source-map'
252
+ }
253
+ },
254
+ docs: {
255
+ server: {
256
+ iphost: (0, _getIp.getIp)(),
257
+ host: (0, _os.hostname)(),
258
+ port: {
259
+ value: 9292,
260
+ cli: 'docs_port'
261
+ },
262
+ domain: {
263
+ value: null,
264
+ cli: 'docs_domain'
265
+ },
266
+ branch: false
267
+ },
268
+ componentFolder: 'src',
269
+ cssUniqueness: {
270
+ value: true,
271
+ cli: 'css_unique'
272
+ },
273
+ enableChunkHash: false,
274
+ folder: 'src',
275
+ disableES5Transpile: false,
276
+ hasRTL: false,
277
+ rtlExclude: [],
278
+ cssHashSelectors: {
279
+ filenames: [],
280
+ packages: []
281
+ },
282
+ classNamePrefix: {
283
+ value: 'zd',
284
+ cli: 'class_prefix'
285
+ }
286
+ },
287
+ ssr: {
288
+ server: {
289
+ host: (0, _os.hostname)(),
290
+ port: {
291
+ value: 4040,
292
+ cli: 'ssr_port'
293
+ },
294
+ domain: {
295
+ value: false,
296
+ cli: 'ssr_domain'
297
+ },
298
+ repoUrl: 'https://vimalesan.a@git.csez.zohocorpin.com/zohodesk/supportportal.git',
299
+ branch: {
300
+ value: 'theme1',
301
+ cli: 'ssr_branch'
302
+ },
303
+ clientAppPath: 'jsapps/portalapp'
304
+ },
305
+ watch: {
306
+ value: false,
307
+ cli: 'ssr_watch'
308
+ }
309
+ },
310
+ cluster: {
311
+ server: {
312
+ host: (0, _os.hostname)(),
313
+ port: 4000,
314
+ domain: {
315
+ value: false,
316
+ cli: 'cluster_domain'
317
+ }
318
+ }
319
+ },
320
+ help: {
321
+ server: {
322
+ host: (0, _os.hostname)(),
323
+ port: 3000,
324
+ domain: {
325
+ value: false,
326
+ cli: 'help_domain'
327
+ }
328
+ }
329
+ },
330
+ umd: {
331
+ component: {
332
+ watch: {
333
+ value: false,
334
+ cli: 'umdComp_watch'
335
+ },
336
+ umdVar: 'Component',
337
+ isDocs: false,
338
+ isHtml: false,
339
+ outputFolder: 'build',
340
+ cssUniqueness: {
341
+ value: true,
342
+ cli: 'umdComp_css_unique'
343
+ },
344
+ folder: 'src'
345
+ },
346
+ css: {
347
+ watch: {
348
+ value: false,
349
+ cli: 'umdCss_watch'
350
+ },
351
+ outputFolder: 'dist',
352
+ umdVar: 'CSS',
353
+ cssUniqueness: {
354
+ value: true,
355
+ cli: 'umdCss_css_unique'
356
+ },
357
+ folder: 'src',
358
+ publicPath: {
359
+ value: false,
360
+ cli: 'umdCss_public_path'
361
+ },
362
+ cssHashSelectors: {
363
+ filenames: [],
364
+ packages: []
365
+ },
366
+ classNamePrefix: {
367
+ value: 'zd',
368
+ cli: 'class_prefix'
369
+ }
370
+ },
371
+ library: {
372
+ umdVar: 'Component',
373
+ outputFolder: 'build',
374
+ watch: {
375
+ value: false,
376
+ cli: 'umdLib_watch'
377
+ }
378
+ }
379
+ },
380
+ unusedFiles: {
381
+ usedFilesExcludes: ['node_modules'],
382
+ appFilesExcludes: ['.docs.js$', '/__tests__/.*(spec|test).js$'],
383
+ delete: false,
384
+ enable: {
385
+ value: false,
386
+ cli: 'enable_unusedfiles'
387
+ },
388
+ outputFileName: 'Unusedfiles.json'
389
+ },
390
+ esLint: {
391
+ enable: {
392
+ value: false,
393
+ cli: 'enable_eslint'
394
+ },
395
+ ignoreFilePaths: false,
396
+ fix: {
397
+ value: false,
398
+ cli: 'eslint_fix'
399
+ },
400
+ isCI: {
401
+ value: false,
402
+ cli: 'eslint_ci'
403
+ },
404
+ reportType: {
405
+ value: 'json',
406
+ cli: 'report_type'
407
+ },
408
+ reportPath: {
409
+ value: './eslint/report.json',
410
+ cli: 'report_path'
411
+ },
412
+ srcBranch: {
413
+ value: 'master',
414
+ cli: 'src_branch'
415
+ },
416
+ targetBranch: {
417
+ value: 'master',
418
+ cli: 'target_branch'
419
+ },
420
+ serviceName: {
421
+ value: 'ZohoDeskReactApp',
422
+ cli: 'service_name'
423
+ },
424
+ impactServerDomain: {
425
+ value: 'ht' + 'tp://desk-automation.csez.zohocorpin.com:8080',
426
+ //value: 'ht' + 'tp://desk-qa-impact.tsi.zohocorpin.com:8080',
427
+ cli: 'impact_server_domain'
428
+ },
429
+ impactRun: {
430
+ value: false,
431
+ cli: 'impact_run'
432
+ }
433
+ },
434
+ clone: {
435
+ type: {
436
+ value: null,
437
+ cli: 'clone_type'
438
+ },
439
+ url: {
440
+ value: null,
441
+ cli: 'clone_url'
442
+ },
443
+ branch: {
444
+ value: null,
445
+ cli: 'clone_branch'
446
+ },
447
+ revision: {
448
+ value: null,
449
+ cli: 'clone_revision'
450
+ },
451
+ shallowClone: {
452
+ value: false,
453
+ cli: 'shallow_clone'
454
+ },
455
+ projectName: {
456
+ value: null,
457
+ cli: 'clone_proj_name'
458
+ },
459
+ remoteName: {
460
+ value: 'origin',
461
+ cli: 'clone_remote_name'
462
+ },
463
+ cacheDir: {
464
+ value: null,
465
+ cli: 'clone_cacheDir'
466
+ },
467
+ shouldDelete: {
468
+ value: true,
469
+ cli: 'clone_delete'
470
+ }
471
+ },
472
+ module: {
473
+ mode: {
474
+ value: 'prod',
475
+ cli: 'module_mode'
476
+ },
477
+ disableES5Transpile: true
478
+ }
479
+ };
480
+ exports.default = _default;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getOptions = exports.args = void 0;
7
+
8
+ var _applyValuesToShema = require("./applyValuesToShema");
9
+
10
+ var _cliArgsToObject = require("./cliArgsToObject");
11
+
12
+ var _defaultConfigValues = _interopRequireDefault(require("./defaultConfigValues"));
13
+
14
+ var _deprecatedOptionsHandler = require("./deprecatedOptionsHandler");
15
+
16
+ var _getCWD = require("./getCWD");
17
+
18
+ var _getNpmVersion = require("./getNpmVersion");
19
+
20
+ var _npmConfigToObject = require("./npmConfigToObject");
21
+
22
+ var _readOptionsForPackageJson = require("./readOptionsForPackageJson");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ // import schemas from './oldDefaultConfigValues';
27
+ const args = process.argv.slice(2);
28
+ exports.args = args;
29
+ const processEnv = (0, _npmConfigToObject.npmConfigToObject)();
30
+ const cliArgsObject = (0, _cliArgsToObject.cliArgsToObject)(args);
31
+ Object.assign(processEnv, cliArgsObject);
32
+ global.reactCLIOptions = null;
33
+
34
+ const getOptions = () => {
35
+ if (global.reactCLIOptions) {
36
+ return global.reactCLIOptions;
37
+ }
38
+
39
+ const appPath = process.cwd();
40
+ const userSchemas = (0, _readOptionsForPackageJson.readOptionsForPackageJson)(appPath);
41
+ const options = (0, _applyValuesToShema.applyValuesToShema)(_defaultConfigValues.default, userSchemas || {}, processEnv);
42
+ (0, _deprecatedOptionsHandler.deprecatedOptionsHandler)(options); // for future may be for npm 8 edge cases
43
+
44
+ options.npmVersion = (0, _getNpmVersion.getNpmVersion)();
45
+ options.cwd = (0, _getCWD.getCWD)();
46
+ options.packageVersion = process.env.npm_package_version;
47
+ options.extraArgs = process.argv.slice(3); // eslint-disable-next-line prefer-destructuring
48
+
49
+ options.commandOption = process.argv[2];
50
+ global.reactCLIOptions = options; // console.log({ options });
51
+
52
+ return options;
53
+ };
54
+
55
+ exports.getOptions = getOptions;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.readOptionsForPackageJson = readOptionsForPackageJson;
7
+
8
+ var _fs = require("fs");
9
+
10
+ var _path = _interopRequireDefault(require("path"));
11
+
12
+ var _constants = require("../constants");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ // import { CONFIG_ROOT } from "../constants";
17
+ function readOptionsForPackageJson(appPath) {
18
+ const packagePath = _path.default.join(appPath, "package.json");
19
+
20
+ if ((0, _fs.existsSync)(packagePath)) {
21
+ // eslint-disable-next-line import/no-dynamic-require, global-require
22
+ return require(packagePath)[_constants.BASE_CONFIG_KEY] || {};
23
+ }
24
+
25
+ return {};
26
+ }