@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.
- package/lib/babel/babel-option-utils/babel-preset-react-option.js +0 -3
- package/lib/babel/cmjs-plugins-presets.js +1 -8
- package/lib/babel/es-plugins-presets.js +1 -8
- package/lib/common/buildEs.js +1 -0
- package/lib/common/getEntries.js +2 -13
- package/lib/common/getPublicPathConfig.js +0 -6
- package/lib/common/index.js +1 -6
- package/lib/common/runPreProcess.js +6 -15
- package/lib/common/splitChunks.js +2 -21
- package/lib/common/sslcertUpdater.js +7 -18
- package/lib/common/templateParameters.js +0 -2
- package/lib/common/testPattern.js +10 -21
- package/lib/common/valueReplacer.js +1 -16
- package/lib/configs/jest.config.js +1 -10
- package/lib/configs/libAlias.js +8 -14
- package/lib/configs/resolvers.js +4 -14
- package/lib/configs/webpack.component.umd.config.js +1 -6
- package/lib/configs/webpack.css.umd.config.js +6 -14
- package/lib/configs/webpack.dev.config.js +1 -14
- package/lib/configs/webpack.docs.config.js +1 -9
- package/lib/configs/webpack.impact.config.js +1 -8
- package/lib/configs/webpack.prod.config.js +4 -17
- package/lib/constants.js +9 -18
- package/lib/deprecationLogger.js +0 -7
- package/lib/hooks/docsProptypeHook.js +4 -8
- package/lib/jest/commitedFilesResult.js +4 -46
- package/lib/jest/coverageCollector.js +1 -12
- package/lib/jest/jsonMaker.js +0 -6
- package/lib/jest/preProcessors/cssPreprocessor.js +1 -9
- package/lib/jest/preProcessors/jsPreprocessor.js +1 -6
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +1 -4
- package/lib/jest/result.js +1 -23
- package/lib/jest/run.js +7 -18
- package/lib/jest/setup.js +8 -60
- package/lib/loaderUtils/configsAssetsLoaders.js +2 -12
- package/lib/loaderUtils/getCSSLoaders.js +10 -22
- package/lib/loaderUtils/getDevJsLoaders.js +4 -13
- package/lib/loaderUtils/index.js +1 -4
- package/lib/loaderUtils/tests/windowsModification.test.js +0 -1
- package/lib/loaderUtils/windowsModification.js +2 -3
- package/lib/loaders/__test__/markdownLoader.spec.js +0 -1
- package/lib/loaders/composeLoader.js +13 -37
- package/lib/loaders/docsLoader.js +1 -12
- package/lib/loaders/docsPropsLoader.js +4 -8
- package/lib/loaders/enhancedReactLiveConverter.js +2 -23
- package/lib/loaders/fileBountryLoader.js +1 -3
- package/lib/loaders/fileLoader.js +12 -23
- package/lib/loaders/markdownLoader.js +14 -19
- package/lib/loaders/reactLiveConvertor.js +5 -15
- package/lib/loaders/scriptInstrumentLoader.js +7 -16
- package/lib/loaders/selectorMappingLoader.js +7 -26
- package/lib/loaders/workerLoader.js +9 -24
- package/lib/logger.js +0 -4
- package/lib/middlewares/HMRMiddleware.js +13 -27
- package/lib/middlewares/SSTMiddleware.js +1 -5
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +1 -24
- package/lib/pluginUtils/getDevPlugins.js +9 -42
- package/lib/pluginUtils/getDocsPlugins.js +3 -13
- package/lib/pluginUtils/getLibraryImactPlugins.js +5 -6
- package/lib/pluginUtils/getLibraryPlugins.js +2 -8
- package/lib/pluginUtils/getProdPlugins.js +8 -47
- package/lib/pluginUtils/getServerPlugins.js +2 -8
- package/lib/pluginUtils/getUMDCSSPlugins.js +2 -10
- package/lib/pluginUtils/getUMDComponentPlugins.js +2 -10
- package/lib/pluginUtils/index.js +1 -9
- package/lib/plugins/CdnChangePlugin.js +2 -18
- package/lib/plugins/CleanupStatsPlugin.js +0 -5
- package/lib/plugins/CssOrderControlPlugin.js +3 -6
- package/lib/plugins/CustomAttributePlugin.js +14 -19
- package/lib/plugins/CustomScriptLoadingStrategyPlugin.js +3 -23
- package/lib/plugins/EFCPlugin.js +20 -34
- package/lib/plugins/EFCTemplatePlugin.js +19 -30
- package/lib/plugins/EfcResourceCleanupPlugin.js +0 -3
- package/lib/plugins/EventsHandlingPlugin.js +2 -4
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +11 -37
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +10 -15
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +12 -25
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +55 -133
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +12 -23
- package/lib/plugins/I18nSplitPlugin/index.js +13 -24
- package/lib/plugins/I18nSplitPlugin/utils/applyMetaManifest.js +64 -58
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
- package/lib/plugins/I18nSplitPlugin/utils/createMetaManifest.js +10 -29
- package/lib/plugins/I18nSplitPlugin/utils/createRegularManifest.js +8 -19
- package/lib/plugins/I18nSplitPlugin/utils/getI18nFileUrlPathTemplate.js +0 -1
- package/lib/plugins/I18nSplitPlugin/utils/getI18nKeysFormModules.js +0 -5
- package/lib/plugins/I18nSplitPlugin/utils/hashUtils.js +1 -8
- package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -20
- package/lib/plugins/I18nSplitPlugin/utils/unicodeConversion.js +0 -1
- package/lib/plugins/ManifestPlugin.js +1 -18
- package/lib/plugins/MinifyPlugin.js +1 -10
- package/lib/plugins/ModuleStatsPlugin.js +1 -24
- package/lib/plugins/OptimizeJSPlugin.js +2 -10
- package/lib/plugins/PublicPathCallbackPlugin.js +1 -12
- package/lib/plugins/PublicPathChangePlugin.js +6 -39
- package/lib/plugins/ReportGeneratePlugin.js +5 -32
- package/lib/plugins/RequireVariablePublicPlugin.js +1 -8
- package/lib/plugins/ResourceHintsPlugin.js +4 -13
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +10 -17
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
- package/lib/plugins/ScriptInstrumentPlugin.js +1 -8
- package/lib/plugins/SelectorPlugin.js +6 -32
- package/lib/plugins/ServiceWorkerPlugin.js +5 -22
- package/lib/plugins/ShadowDOMSupportPlugin.js +4 -41
- package/lib/plugins/SourceMapHookPlugin.js +2 -12
- package/lib/plugins/StatsPlugin.js +0 -14
- package/lib/plugins/TPHashMappingPlugin.js +3 -18
- package/lib/plugins/UnusedFilesFindPlugin.js +4 -39
- package/lib/plugins/VariableConversionCollector.js +15 -42
- package/lib/plugins/index.js +1 -20
- package/lib/plugins/libraryImpactPlugin.js +1 -33
- package/lib/plugins/newi18nsplitplugin/18nPlugin1.js +306 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin2.js +363 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin3.js +694 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin_hashed.js +1258 -0
- package/lib/plugins/newi18nsplitplugin/18nPlugin_working.js +542 -0
- package/lib/plugins/newi18nsplitplugin/18nplugin.js +974 -0
- package/lib/plugins/newi18nsplitplugin/ChunkManager.js +131 -0
- package/lib/plugins/newi18nsplitplugin/GenerateModuleIdToKeysMapPlugin.js +59 -0
- package/lib/plugins/newi18nsplitplugin/I18nDiffPlugin.js +262 -0
- package/lib/plugins/newi18nsplitplugin/I18nDownloadLogic.js +166 -0
- package/lib/plugins/newi18nsplitplugin/I18nPropertiesPlugin.js +111 -0
- package/lib/plugins/newi18nsplitplugin/KeyCollector.js +163 -0
- package/lib/plugins/newi18nsplitplugin/ManifestGenerator.js +88 -0
- package/lib/plugins/newi18nsplitplugin/UnicodeConversionPlugin.js +101 -0
- package/lib/plugins/newi18nsplitplugin/constants.js +162 -0
- package/lib/plugins/newi18nsplitplugin/utils/I18nKeyHasher.js +78 -0
- package/lib/plugins/newi18nsplitplugin/utils/getJsResourceKeys.js +22 -0
- package/lib/plugins/newi18nsplitplugin/utils/i18nChunkUtils.js +18 -0
- package/lib/plugins/newi18nsplitplugin/utils/manifestGenerator.js +580 -0
- package/lib/plugins/newi18nsplitplugin/utils/propertiesUtils.js +54 -0
- package/lib/plugins/utils/classHandling.js +0 -6
- package/lib/plugins/utils/fileHandling.js +6 -15
- package/lib/plugins/utils/tests/fileHandling.test.js +0 -4
- package/lib/plugins/variableConvertorUtils.js +14 -29
- package/lib/plugins/webpackwatchrunplugin.js +0 -5
- package/lib/postcss-plugins/EmptyPlugin.js +3 -4
- package/lib/postcss-plugins/ExcludePlugin.js +1 -5
- package/lib/postcss-plugins/IncludePlugin.js +1 -5
- package/lib/postcss-plugins/RTLSplitPlugin.js +14 -27
- package/lib/postcss-plugins/SelectorReplace.js +1 -16
- package/lib/postcss-plugins/ValueReplacer.js +7 -6
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +6 -3
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +2 -5
- package/lib/postcss-plugins/hoverActivePlugin.js +31 -67
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +0 -7
- package/lib/postcss-plugins/variableModificationPlugin/index.js +28 -49
- package/lib/schemas/index.js +3 -9
- package/lib/servers/clusterHubServer.js +1 -11
- package/lib/servers/devBuild.js +14 -26
- package/lib/servers/docsServer.js +1 -3
- package/lib/servers/docsServerCore.js +1 -22
- package/lib/servers/getCliPath.js +0 -9
- package/lib/servers/helpServer.js +1 -6
- package/lib/servers/httpsOptions.js +2 -8
- package/lib/servers/impactServer.js +3 -35
- package/lib/servers/mockserver.js +1 -10
- package/lib/servers/nowatchserver.js +12 -37
- package/lib/servers/requireLocalOrGlobal.js +6 -17
- package/lib/servers/scrServer.js +14 -21
- package/lib/servers/server.js +6 -36
- package/lib/servers/ssServer.js +1 -17
- package/lib/templates/CoverageScriptTemplate.js +0 -14
- package/lib/templates/WMSTemplate.js +7 -13
- package/lib/templates/linterConstant.js +2 -4
- package/lib/utils/babelPresets.js +3 -7
- package/lib/utils/clean.js +3 -9
- package/lib/utils/copy.js +1 -7
- package/lib/utils/copyTimezones.js +1 -9
- package/lib/utils/createEventStream.js +1 -6
- package/lib/utils/cssClassNameGenerate.js +10 -30
- package/lib/utils/cssURLReplacer.js +1 -22
- package/lib/utils/dependencyPostPublish.js +1 -10
- package/lib/utils/deprecationSupport.js +7 -32
- package/lib/utils/fileUtils.js +1 -28
- package/lib/utils/folderIterator.js +2 -13
- package/lib/utils/getComponents.js +0 -21
- package/lib/utils/getCurrentBranch.js +0 -5
- package/lib/utils/getDependenciesImpactList.js +1 -22
- package/lib/utils/getFileType.js +2 -10
- package/lib/utils/getHash.js +1 -8
- package/lib/utils/getIp.js +0 -2
- package/lib/utils/getOptions.js +16 -53
- package/lib/utils/getServerURL.js +1 -10
- package/lib/utils/index.js +4 -51
- package/lib/utils/init.js +0 -1
- package/lib/utils/initPreCommitHook.js +7 -30
- package/lib/utils/jsonHelper.js +3 -22
- package/lib/utils/libraryImpactConfig.js +2 -5
- package/lib/utils/lint/addScripts.js +2 -5
- package/lib/utils/lint/checkExistingConfig.js +3 -12
- package/lib/utils/lint/copyConfigs.js +0 -3
- package/lib/utils/lint/index.js +0 -9
- package/lib/utils/lint/lintScripts.js +0 -1
- package/lib/utils/lint/lintSetup.js +3 -4
- package/lib/utils/lint/lintStagedPreCommitHook.js +0 -1
- package/lib/utils/lint/question.js +0 -7
- package/lib/utils/lintReporter.js +0 -20
- package/lib/utils/log.js +0 -1
- package/lib/utils/mailSender.js +1 -8
- package/lib/utils/object-manipulation.js +1 -17
- package/lib/utils/pullOrigin.js +0 -4
- package/lib/utils/reinstallDependencies.js +1 -29
- package/lib/utils/removeAttributes.js +1 -8
- package/lib/utils/repoClone.js +3 -28
- package/lib/utils/request.js +0 -12
- package/lib/utils/rtl.js +5 -17
- package/lib/utils/selectorReplacer.js +10 -16
- package/lib/utils/setEnvVariables.js +0 -2
- package/lib/utils/ssTestHack.js +1 -11
- package/lib/utils/switchBranch.js +0 -5
- package/lib/utils/typeCheck.js +0 -1
- package/lib/utils/urlConcat.js +0 -4
- package/lib/utils/useExitCleanup.js +9 -10
- package/lib/utils/variableConverter.js +22 -31
- package/{npm-shrinkwrap.json → package-lock.json} +2098 -1999
- package/package.json +1 -1
@@ -1,15 +1,10 @@
|
|
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 _express = _interopRequireDefault(require("express"));
|
8
|
-
|
9
6
|
var _utils = require("../utils");
|
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 options = (0, _utils.getOptions)();
|
14
9
|
let {
|
15
10
|
cluster: {
|
@@ -18,17 +13,13 @@ let {
|
|
18
13
|
} = options;
|
19
14
|
let app = (0, _express.default)();
|
20
15
|
let appPath = process.cwd();
|
21
|
-
|
22
16
|
let clusterConfigPath = _path.default.join(appPath, 'clusterConfig.js');
|
23
|
-
|
24
17
|
let config;
|
25
|
-
|
26
18
|
if (_fs.default.existsSync(clusterConfigPath)) {
|
27
19
|
config = require(clusterConfigPath);
|
28
20
|
} else {
|
29
21
|
throw new Error(`clusterConfig.js doen't exist under following path - ${clusterConfigPath}`);
|
30
22
|
}
|
31
|
-
|
32
23
|
app.get('/clusterhub/nodes', (req, res) => {
|
33
24
|
res.send(JSON.stringify(config.cluster));
|
34
25
|
});
|
@@ -37,6 +28,5 @@ app.listen(server.port, err => {
|
|
37
28
|
if (err) {
|
38
29
|
throw err;
|
39
30
|
}
|
40
|
-
|
41
31
|
(0, _utils.log)(`Listening at ${(0, _utils.getServerURL)(server, 'ht' + 'tp')}/clusterhub/`);
|
42
32
|
});
|
package/lib/servers/devBuild.js
CHANGED
@@ -4,22 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getPaths = getPaths;
|
7
|
-
|
8
7
|
var _fs = _interopRequireDefault(require("fs"));
|
9
|
-
|
10
8
|
var _path = _interopRequireDefault(require("path"));
|
11
|
-
|
12
9
|
var _child_process = require("child_process");
|
13
|
-
|
14
10
|
var _utils = require("../utils");
|
15
|
-
|
16
11
|
var _getCliPath = require("./getCliPath");
|
17
|
-
|
18
12
|
var _logger = require("../logger");
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
const options = (0, _utils.getOptions)(); // const args = process.argv.slice(3);
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
const options = (0, _utils.getOptions)();
|
15
|
+
// const args = process.argv.slice(3);
|
23
16
|
// NOTE: need to discuss about in below codes,
|
24
17
|
// when we run webpack the usable options that comes for npm run not working as automatical
|
25
18
|
// we are use this option always --disable_watch=true reason for now no need for
|
@@ -33,68 +26,63 @@ const {
|
|
33
26
|
cssSelectorZipPath
|
34
27
|
} = options.impactService;
|
35
28
|
const zipname = cssSelectorZipPath ? _path.default.parse(cssSelectorZipPath).name : null;
|
36
|
-
|
37
29
|
const outputFolderLocation = _path.default.join(process.cwd(), outputFolder);
|
38
|
-
|
39
30
|
function execSyncDefalut(command) {
|
40
31
|
(0, _logger.messageLogger)(' command running ==>', command);
|
41
32
|
return (0, _child_process.execSync)(command, {
|
42
33
|
stdio: 'inherit'
|
43
34
|
});
|
44
35
|
}
|
45
|
-
|
46
36
|
const isQuiet = 'q';
|
47
|
-
const webpack = (0, _getCliPath.getCliPath)('webpack');
|
37
|
+
const webpack = (0, _getCliPath.getCliPath)('webpack');
|
38
|
+
// messageLogger('webpack === > ', webpack, fs.existsSync(webpack));
|
48
39
|
|
49
40
|
if (_fs.default.existsSync(outputFolderLocation)) {
|
50
41
|
execSyncDefalut(`rm -rf ${outputFolder}`);
|
51
42
|
(0, _logger.messageLogger)(`previous ${outputFolder} removed`);
|
52
43
|
}
|
53
|
-
|
54
44
|
if (_fs.default.existsSync(_path.default.join(process.cwd(), 'build.zip'))) {
|
55
45
|
execSyncDefalut('rm build.zip');
|
56
46
|
(0, _logger.messageLogger)('previous build.zip removed');
|
57
|
-
}
|
47
|
+
}
|
48
|
+
// execSyncDefalut(`${webpack } --version`);
|
58
49
|
// execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')}`);
|
59
50
|
|
60
|
-
|
61
51
|
(0, _logger.messageLogger)('webpack compilation starts...');
|
62
|
-
const startTime = Date.now();
|
52
|
+
const startTime = Date.now();
|
53
|
+
// const result = spawnSync(
|
63
54
|
// webpack,
|
64
55
|
// ['--config', require.resolve('../configs/webpack.dev.config.js')].concat(
|
65
56
|
// args
|
66
57
|
// ),
|
67
58
|
// { stdio: 'inherit' }
|
68
59
|
// );
|
69
|
-
// --disable_watch=true
|
70
60
|
|
61
|
+
// --disable_watch=true
|
71
62
|
const result = execSyncDefalut(`${webpack} --config ${require.resolve('../configs/webpack.dev.config.js')} ${process.argv.slice(2).map(o => o.replace(/(.*?)=(.*)/, '$1="$2"')).join(' ')} `);
|
72
63
|
result && (0, _logger.messageLogger)(result);
|
73
|
-
|
74
64
|
if (result && result.stderr) {
|
75
65
|
throw result.stderr;
|
76
66
|
}
|
77
|
-
|
78
67
|
(0, _logger.messageLogger)(`compailation done in ${Date.now() - startTime}ms`);
|
79
|
-
|
80
68
|
if (zipname) {
|
81
69
|
execSyncDefalut(`zip -r${isQuiet} build.zip ${outputFolder}/*`);
|
82
70
|
(0, _logger.messageLogger)('build.zip file created');
|
83
71
|
const result = execSyncDefalut(`zip -r${isQuiet} ${cssSelectorZipPath} ${zipname}/*`);
|
84
72
|
execSyncDefalut(`rm -rf ${zipname}`);
|
85
|
-
|
86
73
|
if (result && result.stderr) {
|
87
74
|
(0, _logger.messageLogger)('zip file not created', cssSelectorZipPath);
|
88
75
|
console.error(result.stderr);
|
89
76
|
} else {
|
90
77
|
(0, _logger.messageLogger)('zip file created', cssSelectorZipPath);
|
91
78
|
}
|
92
|
-
}
|
93
|
-
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
79
|
+
}
|
94
80
|
|
81
|
+
// npm run start --app:domain=tsi --impact:cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
95
82
|
|
96
|
-
|
83
|
+
// npm run start --app_domain=tsi --impact_cssbountry="{$@&&@$}" --disable-watch --dev-cache --cssselector_zip=css-source-map.zip
|
97
84
|
|
85
|
+
(0, _logger.messageLogger)(`compailation done in ${Date.now() - startTime}ms`);
|
98
86
|
function getPaths() {
|
99
87
|
return {
|
100
88
|
zipname,
|
@@ -1,7 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _docsServerCore = _interopRequireDefault(require("./docsServerCore"));
|
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
|
(0, _docsServerCore.default)();
|
@@ -4,29 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _path = _interopRequireDefault(require("path"));
|
9
|
-
|
10
8
|
var _https = _interopRequireDefault(require("https"));
|
11
|
-
|
12
9
|
var _webpack = _interopRequireDefault(require("webpack"));
|
13
|
-
|
14
10
|
var _express = _interopRequireDefault(require("express"));
|
15
|
-
|
16
11
|
var _child_process = require("child_process");
|
17
|
-
|
18
12
|
var _webpackDevMiddleware = _interopRequireDefault(require("webpack-dev-middleware"));
|
19
|
-
|
20
13
|
var _HMRMiddleware = _interopRequireDefault(require("../middlewares/HMRMiddleware"));
|
21
|
-
|
22
14
|
var _utils = require("../utils");
|
23
|
-
|
24
15
|
var _webpackDocs = _interopRequireDefault(require("../configs/webpack.docs.config"));
|
25
|
-
|
26
16
|
var _httpsOptions = require("./httpsOptions");
|
27
|
-
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
|
-
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
30
18
|
// import fs from 'fs';
|
31
19
|
var _default = isSSTest => {
|
32
20
|
const options = (0, _utils.getOptions)();
|
@@ -82,41 +70,33 @@ var _default = isSSTest => {
|
|
82
70
|
version: require('../../package.json').version
|
83
71
|
});
|
84
72
|
});
|
85
|
-
|
86
73
|
if (branch) {
|
87
74
|
app.post('/repo/merge', (req, res) => {
|
88
75
|
const {
|
89
76
|
ref
|
90
77
|
} = req.body;
|
91
|
-
|
92
78
|
if (ref && ref.endsWith(branch)) {
|
93
79
|
(0, _child_process.spawnSync)('git', ['pull', 'origin', branch], {
|
94
80
|
stdio: 'inherit'
|
95
81
|
});
|
96
82
|
}
|
97
|
-
|
98
83
|
res.send('done');
|
99
84
|
});
|
100
85
|
}
|
101
|
-
|
102
86
|
const httpsServer = _https.default.createServer(httpsOptions, app);
|
103
|
-
|
104
87
|
if (!isSSTest) {
|
105
88
|
httpsServer.listen(port, err => {
|
106
89
|
if (err) {
|
107
90
|
throw err;
|
108
91
|
}
|
109
|
-
|
110
92
|
(0, _utils.log)(`Listening at ${(0, _utils.getServerURL)(server, 'htt' + 'ps')}/docs/`);
|
111
93
|
});
|
112
94
|
}
|
113
|
-
|
114
95
|
const httpPort = Number(port) + 1;
|
115
96
|
const http = app.listen(httpPort, err => {
|
116
97
|
if (err) {
|
117
98
|
throw err;
|
118
99
|
}
|
119
|
-
|
120
100
|
if (isSSTest) {
|
121
101
|
(0, _utils.log)(`Listening at ${(0, _utils.getServerURL)(Object.assign(server, {
|
122
102
|
host: iphost,
|
@@ -138,5 +118,4 @@ var _default = isSSTest => {
|
|
138
118
|
wdm
|
139
119
|
};
|
140
120
|
};
|
141
|
-
|
142
121
|
exports.default = _default;
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.getCliPath = getCliPath;
|
7
|
-
|
8
7
|
var _path = require("path");
|
9
|
-
|
10
8
|
var _os = require("os");
|
11
|
-
|
12
9
|
var _fs = require("fs");
|
13
|
-
|
14
10
|
var _constants = require("../constants");
|
15
|
-
|
16
11
|
const isWindows = (0, _os.platform)().toLowerCase() === 'win32';
|
17
|
-
|
18
12
|
const _getCliPath = libName => (0, _path.join)(_constants.cliNodeModulesPath, '.bin', libName);
|
19
|
-
|
20
13
|
const suffixExt = isWindows ? '.cmd' : '';
|
21
|
-
|
22
14
|
function getCliPath(libName) {
|
23
15
|
const cliPath = _getCliPath(libName + suffixExt);
|
24
|
-
|
25
16
|
return (0, _fs.existsSync)(cliPath) ? cliPath : libName + suffixExt;
|
26
17
|
}
|
@@ -1,13 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _path = _interopRequireDefault(require("path"));
|
4
|
-
|
5
4
|
var _express = _interopRequireDefault(require("express"));
|
6
|
-
|
7
5
|
var _utils = require("../utils");
|
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 options = (0, _utils.getOptions)();
|
12
8
|
let {
|
13
9
|
help: {
|
@@ -24,6 +20,5 @@ app.listen(port, err => {
|
|
24
20
|
if (err) {
|
25
21
|
throw err;
|
26
22
|
}
|
27
|
-
|
28
23
|
(0, _utils.log)(`Listening at ${serverUrl}/help/`);
|
29
24
|
});
|
@@ -5,27 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.httpsOptions = httpsOptions;
|
7
7
|
exports.httpsOptionsWithUserFriendlyError = httpsOptionsWithUserFriendlyError;
|
8
|
-
|
9
8
|
var _logger = require("../logger");
|
10
|
-
|
11
9
|
var _requireLocalOrGlobal = require("./requireLocalOrGlobal");
|
12
|
-
|
13
10
|
const globalCertificate = (0, _requireLocalOrGlobal.requireGlobal)('@zohodesk-private/client_dev_cert');
|
14
|
-
|
15
11
|
function httpsOptions(options) {
|
16
12
|
const {
|
17
13
|
httpsCerts
|
18
14
|
} = options.app.server;
|
19
|
-
const certificate = (0, _requireLocalOrGlobal.requireLocalOrGlobal)(httpsCerts);
|
15
|
+
const certificate = (0, _requireLocalOrGlobal.requireLocalOrGlobal)(httpsCerts);
|
16
|
+
// TODO: in future we may do some version based check. certificate.version
|
20
17
|
|
21
18
|
return certificate.httpsOptions;
|
22
19
|
}
|
23
|
-
|
24
20
|
function httpsOptionsWithUserFriendlyError(options) {
|
25
21
|
const {
|
26
22
|
httpsCerts
|
27
23
|
} = options.app.server;
|
28
|
-
|
29
24
|
if (typeof httpsCerts === 'string' && httpsCerts) {
|
30
25
|
try {
|
31
26
|
const certificate = httpsOptions(options);
|
@@ -36,7 +31,6 @@ function httpsOptionsWithUserFriendlyError(options) {
|
|
36
31
|
} else {
|
37
32
|
(0, _logger.errorLogger)(error);
|
38
33
|
}
|
39
|
-
|
40
34
|
process.exit(0);
|
41
35
|
}
|
42
36
|
} else if (globalCertificate) {
|
@@ -1,15 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _express = _interopRequireDefault(require("express"));
|
4
|
-
|
5
4
|
var _gitlab = require("gitlab");
|
6
|
-
|
7
5
|
var _esprima = _interopRequireDefault(require("esprima"));
|
8
|
-
|
9
6
|
var _utils = require("../utils");
|
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 options = (0, _utils.getOptions)();
|
14
9
|
let {
|
15
10
|
impact: {
|
@@ -29,35 +24,28 @@ app.use(_express.default.json());
|
|
29
24
|
app.use(_express.default.urlencoded({
|
30
25
|
extended: true
|
31
26
|
}));
|
32
|
-
|
33
27
|
function traverseJSON(parsed, file) {
|
34
28
|
let parsedObj = {};
|
35
29
|
parsed.forEach(Block => {
|
36
30
|
if (Block.type === 'FunctionDeclaration' || Block.type === 'ExportDefaultDeclaration' || Block.type === 'ExportNamedDeclaration') {
|
37
31
|
let ParsedTemp;
|
38
|
-
|
39
32
|
if (Block.type === 'FunctionDeclaration') {
|
40
33
|
ParsedTemp = Block;
|
41
34
|
} else {
|
42
35
|
ParsedTemp = Block.declaration;
|
43
36
|
}
|
44
|
-
|
45
37
|
if (ParsedTemp) {
|
46
38
|
if (ParsedTemp.id) {
|
47
39
|
let funcname = ParsedTemp.id.name;
|
48
|
-
|
49
40
|
if (funcname !== 'mapStateToProps') {
|
50
41
|
if (!funcname.includes('_')) {
|
51
42
|
if (!Object.prototype.hasOwnProperty.call(parsedObj, 'file')) {
|
52
43
|
parsedObj[file] = {};
|
53
44
|
}
|
54
|
-
|
55
45
|
let tempArray = [];
|
56
|
-
|
57
46
|
for (let j = ParsedTemp.loc.start.line; j < ParsedTemp.loc.end.line; j++) {
|
58
47
|
tempArray.push(j);
|
59
48
|
}
|
60
|
-
|
61
49
|
parsedObj[file][funcname] = tempArray;
|
62
50
|
}
|
63
51
|
}
|
@@ -67,7 +55,6 @@ function traverseJSON(parsed, file) {
|
|
67
55
|
});
|
68
56
|
return parsedObj;
|
69
57
|
}
|
70
|
-
|
71
58
|
function getDetails(url, callback) {
|
72
59
|
let changeObj = {};
|
73
60
|
let compObj = {};
|
@@ -75,7 +62,6 @@ function getDetails(url, callback) {
|
|
75
62
|
url
|
76
63
|
}).then(res => {
|
77
64
|
let body = JSON.parse(res.body);
|
78
|
-
|
79
65
|
if (body.includes('Source_Changeset')) {
|
80
66
|
let branch, changeSet;
|
81
67
|
body = body.split('\n');
|
@@ -84,16 +70,15 @@ function getDetails(url, callback) {
|
|
84
70
|
let [, __changeSet] = content.split('=');
|
85
71
|
changeSet = __changeSet;
|
86
72
|
}
|
87
|
-
|
88
73
|
if (content.includes('SourceCoLabel')) {
|
89
74
|
let [__branch] = content.split('=');
|
90
75
|
branch = __branch;
|
91
76
|
}
|
92
77
|
});
|
93
|
-
services.Commits.diff(1143, changeSet
|
78
|
+
services.Commits.diff(1143, changeSet
|
79
|
+
//'587efd32ce14620750a38ab74bc744fc52f2943a '
|
94
80
|
).then(result => {
|
95
81
|
let promises = [];
|
96
|
-
|
97
82
|
if (result) {
|
98
83
|
result.forEach(change => {
|
99
84
|
let p = new Promise(resolve => {
|
@@ -111,27 +96,22 @@ function getDetails(url, callback) {
|
|
111
96
|
tempObj.changedId = null;
|
112
97
|
}
|
113
98
|
}
|
114
|
-
|
115
99
|
if (!diff.indexOf('-')) {
|
116
100
|
//eslint-disable-next-line
|
117
101
|
tempObj.defaultId = diff.match(/(data-id=.*)/g)[0].match(/["']([^"']+?)['"]/g)[0];
|
118
102
|
let tempIndex = diffList.indexOf(diff);
|
119
|
-
|
120
103
|
if (diffList[tempIndex + 1].indexOf('data-id') === -1) {
|
121
104
|
tempObj.changedId = null;
|
122
105
|
}
|
123
106
|
}
|
124
|
-
|
125
107
|
if (!diff.indexOf('+')) {
|
126
108
|
//eslint-disable-next-line
|
127
109
|
tempObj.changedId = diff.match(/(data-id=.*)/g)[0].match(/["']([^"']+?)['"]/g)[0];
|
128
110
|
let tempIndex = diffList.indexOf(diff);
|
129
|
-
|
130
111
|
if (diffList[tempIndex - 1].indexOf('data-id') === -1) {
|
131
112
|
tempObj.defaultId = null;
|
132
113
|
}
|
133
114
|
}
|
134
|
-
|
135
115
|
if (Object.prototype.hasOwnProperty.call(tempObj, 'defaultId') && Object.prototype.hasOwnProperty.call(tempObj, 'changedId')) {
|
136
116
|
if (tempObj.defaultId !== tempObj.changedId) {
|
137
117
|
compObj[filename].push(tempObj);
|
@@ -139,39 +119,31 @@ function getDetails(url, callback) {
|
|
139
119
|
}
|
140
120
|
}
|
141
121
|
}
|
142
|
-
|
143
122
|
if (diff.startsWith('@')) {
|
144
123
|
let [, content] = diff.split('@@');
|
145
124
|
let tempList = content.split(' ');
|
146
125
|
let startingLine = parseInt(tempList[1].split(',')[0]) * -1 + 3;
|
147
126
|
let furtherLines = parseInt(tempList[2].split(',')[0]) + 3;
|
148
|
-
|
149
127
|
if (parseInt(tempList[1].split(',')[1]) > 6) {
|
150
128
|
changeObj[filename].push(startingLine);
|
151
129
|
}
|
152
|
-
|
153
130
|
if (parseInt(tempList[2].split(',')[1]) > 6) {
|
154
131
|
let endValue = parseInt(tempList[2].split(',')[1]) - 6;
|
155
|
-
|
156
132
|
for (let i = furtherLines; i < furtherLines + endValue; i++) {
|
157
133
|
changeObj[filename].push(i);
|
158
134
|
}
|
159
135
|
}
|
160
136
|
}
|
161
137
|
});
|
162
|
-
|
163
138
|
if (!filename.includes('.spec.js') && !filename.includes('.docs.js') && !filename.includes('.css') && filename.includes('.js')) {
|
164
139
|
try {
|
165
140
|
services.RepositoryFiles.show(1143, filename, branch).then(res => {
|
166
141
|
let code = Buffer.from(res.content, 'base64').toString('ascii');
|
167
|
-
|
168
142
|
let parsed = _esprima.default.parseModule(code, {
|
169
143
|
jsx: true,
|
170
144
|
loc: true
|
171
145
|
});
|
172
|
-
|
173
146
|
let methodDetail = traverseJSON(parsed.body, filename);
|
174
|
-
|
175
147
|
if (Object.keys(methodDetail).length) {
|
176
148
|
resolve(methodDetail);
|
177
149
|
} else {
|
@@ -195,7 +167,6 @@ function getDetails(url, callback) {
|
|
195
167
|
}
|
196
168
|
}).catch(err => err);
|
197
169
|
}
|
198
|
-
|
199
170
|
app.post('/impact/build', (req, res) => {
|
200
171
|
req.setTimeout(0);
|
201
172
|
let subUrl = '/logs/reactbuildinfo.txt';
|
@@ -208,7 +179,6 @@ app.post('/impact/build', (req, res) => {
|
|
208
179
|
if (err) {
|
209
180
|
return err;
|
210
181
|
}
|
211
|
-
|
212
182
|
let responseObj = {};
|
213
183
|
Object.keys(esprimaObj).forEach(file => {
|
214
184
|
responseObj[file] = [];
|
@@ -221,7 +191,6 @@ app.post('/impact/build', (req, res) => {
|
|
221
191
|
}
|
222
192
|
});
|
223
193
|
});
|
224
|
-
|
225
194
|
if (!responseObj[file].length) {
|
226
195
|
delete responseObj[file];
|
227
196
|
}
|
@@ -238,7 +207,6 @@ app.listen(port, err => {
|
|
238
207
|
if (err) {
|
239
208
|
throw err;
|
240
209
|
}
|
241
|
-
|
242
210
|
(0, _utils.log)(`Listening at ${serverUrl}/impact/build/`);
|
243
211
|
(0, _utils.log)('payload like => {buildUrl:test_build_url}');
|
244
212
|
});
|
@@ -1,15 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _express = _interopRequireDefault(require("express"));
|
4
|
-
|
5
4
|
var _fs = _interopRequireDefault(require("fs"));
|
6
|
-
|
7
5
|
var _path = _interopRequireDefault(require("path"));
|
8
|
-
|
9
6
|
var _utils = require("../utils");
|
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 options = (0, _utils.getOptions)();
|
14
9
|
let {
|
15
10
|
app: {
|
@@ -24,17 +19,13 @@ app.use(_express.default.urlencoded({
|
|
24
19
|
extended: true
|
25
20
|
}));
|
26
21
|
let appPath = process.cwd();
|
27
|
-
|
28
22
|
let mockServerPath = _path.default.join(appPath, 'mockapi', 'index.js');
|
29
|
-
|
30
23
|
if (_fs.default.existsSync(mockServerPath)) {
|
31
24
|
let mockServer = require(mockServerPath);
|
32
|
-
|
33
25
|
mockServer(app);
|
34
26
|
} else {
|
35
27
|
(0, _utils.log)('You must export a function from mockapi folder by only we can provide mock api hook');
|
36
28
|
}
|
37
|
-
|
38
29
|
app.listen(mockPort, err => {
|
39
30
|
if (err) {
|
40
31
|
(0, _utils.log)('error', err);
|