@zohodesk/react-cli 0.0.1-exp.169.2 → 0.0.1-exp.175.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintignore +7 -7
- package/.eslintrc.js +180 -179
- package/.prettierrc +6 -6
- package/README.md +1028 -951
- package/bin/cli.js +483 -483
- package/cert/Tsicsezwild-22-23.crt +37 -37
- package/cert/Tsicsezwild-22-23.key +27 -27
- package/docs/CustomChunks.md +26 -26
- package/docs/DevStart.md +18 -18
- package/docs/HoverActive.md +12 -12
- package/docs/InstallNode.md +28 -28
- package/docs/TODOS.md +10 -10
- package/docs/ValueReplacer.md +60 -60
- package/docs/VariableConversion.md +678 -0
- package/docs/warnings_while_install.txt +35 -35
- package/files/eslintrc.js +62 -62
- package/files/prettierrc.js +3 -3
- package/lib/babel/cmjs-plugins-presets.js +0 -4
- package/lib/babel/es-plugins-presets.js +0 -4
- package/lib/common/getEntries.js +0 -10
- package/lib/common/getPublicPathConfig.js +0 -6
- package/lib/common/index.js +0 -5
- package/lib/common/splitChunks.js +2 -13
- package/lib/common/sslcertUpdater.js +6 -17
- package/lib/common/templateParameters.js +0 -2
- package/lib/common/testPattern.js +10 -21
- package/lib/common/valueReplacer.js +0 -15
- package/lib/configs/jest.config.js +8 -21
- package/lib/configs/libAlias.js +11 -2
- package/lib/configs/webpack.component.umd.config.js +0 -5
- package/lib/configs/webpack.css.umd.config.js +5 -13
- package/lib/configs/webpack.dev.config.js +13 -24
- package/lib/configs/webpack.docs.config.js +6 -12
- package/lib/configs/webpack.impact.config.js +6 -10
- package/lib/configs/webpack.prod.config.js +15 -26
- package/lib/hooks/docsProptypeHook.js +3 -7
- package/lib/jest/commitedFilesResult.js +3 -45
- package/lib/jest/coverageCollector.js +0 -11
- package/lib/jest/jsonMaker.js +0 -6
- package/lib/jest/preProcessors/cssPreprocessor.js +14 -13
- package/lib/jest/preProcessors/jsPreprocessor.js +0 -2
- package/lib/jest/preProcessors/otherFilesPreprocessor.js +0 -3
- package/lib/jest/result.js +0 -22
- package/lib/jest/run.js +6 -17
- package/lib/jest/setup.js +5 -57
- package/lib/loaderUtils/configsAssetsLoaders.js +34 -44
- package/lib/loaderUtils/getCSSLoaders.js +41 -28
- package/lib/loaderUtils/getDevJsLoaders.js +0 -8
- package/lib/loaderUtils/index.js +0 -3
- package/lib/loaders/docsLoader.js +0 -7
- package/lib/loaders/docsPropsLoader.js +3 -7
- package/lib/loaders/fileBountryLoader.js +0 -2
- package/lib/loaders/fileLoader.js +11 -22
- package/lib/loaders/scriptInstrumentLoader.js +5 -13
- package/lib/loaders/selectorMappingLoader.js +7 -25
- package/lib/loaders/workerLoader.js +13 -29
- package/lib/middlewares/HMRMiddleware.js +13 -26
- package/lib/middlewares/SSTMiddleware.js +0 -3
- package/lib/pluginUtils/configHtmlWebpackPlugins.js +53 -0
- package/lib/pluginUtils/getDevPlugins.js +20 -64
- package/lib/pluginUtils/getDocsPlugins.js +1 -10
- package/lib/pluginUtils/getLibraryImactPlugins.js +4 -5
- package/lib/pluginUtils/getLibraryPlugins.js +0 -5
- package/lib/pluginUtils/getProdPlugins.js +32 -78
- package/lib/pluginUtils/getServerPlugins.js +0 -5
- package/lib/pluginUtils/getUMDCSSPlugins.js +0 -7
- package/lib/pluginUtils/getUMDComponentPlugins.js +0 -7
- package/lib/pluginUtils/index.js +0 -8
- package/lib/plugins/CdnChangePlugin.js +0 -14
- package/lib/plugins/CleanupStatsPlugin.js +0 -5
- package/lib/plugins/EFCPlugin.js +23 -34
- package/lib/plugins/EFCPlugin.md +6 -6
- package/lib/plugins/EFCTemplatePlugin.js +23 -32
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +12 -38
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +12 -17
- package/lib/plugins/I18nSplitPlugin/I18nDependency.js +4 -10
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +46 -77
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +44 -59
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +21 -30
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
- package/lib/plugins/I18nSplitPlugin/README.md +25 -25
- package/lib/plugins/I18nSplitPlugin/index.js +70 -80
- package/lib/plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -12
- 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 +0 -6
- package/lib/plugins/I18nSplitPlugin/utils/index.js +0 -4
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +2 -20
- package/lib/plugins/ManifestPlugin.js +0 -17
- package/lib/plugins/ModuleStatsPlugin.js +0 -23
- package/lib/plugins/OptimizeJSPlugin.js +0 -7
- package/lib/plugins/PublicPathCallbackPlugin.js +0 -10
- package/lib/plugins/PublicPathChangePlugin.js +4 -36
- package/lib/plugins/ReportGeneratePlugin.js +4 -30
- package/lib/plugins/RequireVariablePublicPlugin.js +0 -6
- package/lib/plugins/ResourceHintsPlugin.js +20 -27
- package/lib/plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +12 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +23 -38
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
- package/lib/plugins/RtlSplitPlugin/replaceCssDirTemplate.js +2 -5
- package/lib/plugins/ScriptInstrumentPlugin.js +0 -7
- package/lib/plugins/ServiceWorkerPlugin.js +13 -29
- package/lib/plugins/ShadowDOMSupportPlugin.js +3 -40
- package/lib/plugins/SourceMapHookPlugin.js +0 -9
- package/lib/plugins/TPHashMappingPlugin.js +5 -19
- package/lib/plugins/UglifyCSSPlugin.js +0 -9
- package/lib/plugins/UnusedFilesFindPlugin.js +2 -35
- package/lib/plugins/index.js +0 -19
- package/lib/plugins/libraryImpactPlugin.js +0 -32
- package/lib/plugins/webpackwatchrunplugin.js +0 -5
- package/lib/postcss-plugins/ExcludePlugin.js +0 -4
- package/lib/postcss-plugins/RTLSplitPlugin.js +24 -37
- package/lib/postcss-plugins/ValueReplacer.js +9 -6
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +0 -3
- package/lib/postcss-plugins/__test__/test1Input.css +38 -38
- package/lib/postcss-plugins/__test__/test1Output.css +38 -38
- package/lib/postcss-plugins/hoverActivePlugin.js +80 -92
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +31 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +232 -0
- package/lib/postcss-plugins/variableModifier.js +14 -20
- package/lib/schemas/index.js +28 -13
- package/lib/servers/clusterHubServer.js +0 -10
- package/lib/servers/devBuild.js +13 -24
- package/lib/servers/docsServer.js +0 -2
- package/lib/servers/docsServerCore.js +0 -21
- package/lib/servers/getCliPath.js +1 -10
- package/lib/servers/helpServer.js +0 -5
- package/lib/servers/httpsOptions.js +0 -4
- package/lib/servers/impactServer.js +2 -34
- package/lib/servers/mockserver.js +0 -9
- package/lib/servers/nowatchserver.js +12 -34
- package/lib/servers/scrServer.js +13 -20
- package/lib/servers/server.js +7 -35
- package/lib/servers/ssServer.js +0 -16
- package/lib/sh/pre-commit.sh +34 -34
- package/lib/sh/reportPublish.sh +45 -45
- package/lib/templates/CoverageScriptTemplate.js +0 -14
- package/lib/templates/WMSTemplate.js +6 -12
- package/lib/utils/babelPresets.js +0 -2
- package/lib/utils/buildstats.html +148 -148
- package/lib/utils/clean.js +2 -8
- package/lib/utils/copy.js +0 -6
- package/lib/utils/copyTimezones.js +0 -8
- package/lib/utils/createEventStream.js +0 -4
- package/lib/utils/cssClassNameGenerate.js +3 -19
- package/lib/utils/cssURLReplacer.js +0 -25
- package/lib/utils/dependencyPostPublish.js +0 -9
- package/lib/utils/fileUtils.js +0 -26
- package/lib/utils/folderIterator.js +0 -10
- package/lib/utils/getComponents.js +0 -21
- package/lib/utils/getCurrentBranch.js +0 -5
- package/lib/utils/getDependenciesImpactList.js +0 -21
- package/lib/utils/getHash.js +0 -7
- package/lib/utils/getIp.js +0 -2
- package/lib/utils/getOptions.js +38 -35
- package/lib/utils/getServerURL.js +0 -7
- package/lib/utils/index.js +2 -47
- package/lib/utils/init.js +0 -1
- package/lib/utils/initPreCommitHook.js +6 -29
- package/lib/utils/jsonHelper.js +2 -19
- package/lib/utils/libraryImpactConfig.js +0 -2
- 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/mailSender.js +0 -7
- package/lib/utils/pullOrigin.js +0 -4
- package/lib/utils/reinstallDependencies.js +0 -28
- package/lib/utils/removeAttributes.js +0 -7
- package/lib/utils/repoClone.js +2 -27
- package/lib/utils/request.js +0 -12
- package/lib/utils/resultSchema.json +73 -73
- package/lib/utils/rtl.js +4 -16
- package/lib/utils/setEnvVariables.js +0 -2
- package/lib/utils/ssTestHack.js +0 -10
- package/lib/utils/switchBranch.js +0 -4
- package/lib/utils/urlConcat.js +0 -4
- package/lib/utils/useExitCleanup.js +9 -10
- package/npm8.md +9 -9
- package/package.json +146 -148
- package/postpublish.js +6 -6
- package/templates/app/.eslintrc.js +140 -140
- package/templates/app/README.md +12 -12
- package/templates/app/app/index.html +24 -24
- package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
- package/templates/app/app/properties/i18nkeys.json +3 -3
- package/templates/app/docs/all.html +69 -69
- package/templates/app/mockapi/index.js +18 -18
- package/templates/app/package.json +37 -37
- package/templates/app/src/actions/SampleActions/index.js +37 -37
- package/templates/app/src/actions/index.js +65 -65
- package/templates/app/src/appUrls.js +19 -19
- package/templates/app/src/components/Alert/Alert.js +134 -134
- package/templates/app/src/components/Alert/Alert.module.css +79 -79
- package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
- package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
- package/templates/app/src/components/Sample/Sample.module.css +11 -11
- package/templates/app/src/components/Sample/SampleList.js +61 -61
- package/templates/app/src/components/Slider/Slider.css +41 -41
- package/templates/app/src/components/Slider/Slider.js +55 -55
- package/templates/app/src/containers/AlertContainer/index.js +15 -15
- package/templates/app/src/containers/AppContainer/index.js +96 -96
- package/templates/app/src/containers/AppContainer/index.module.css +27 -27
- package/templates/app/src/containers/CustomMatch/index.js +65 -65
- package/templates/app/src/containers/DevTools/index.js +10 -10
- package/templates/app/src/containers/Header/index.js +67 -67
- package/templates/app/src/containers/Header/index.module.css +43 -43
- package/templates/app/src/containers/Redirect/index.js +63 -63
- package/templates/app/src/containers/Redirector/index.js +47 -47
- package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
- package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
- package/templates/app/src/historyChange.js +5 -5
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +24 -24
- package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
- package/templates/app/src/reducers/alertData.js +11 -11
- package/templates/app/src/reducers/index.js +6 -6
- package/templates/app/src/reducers/samples.js +19 -19
- package/templates/app/src/store/configureStore.dev.js +51 -51
- package/templates/app/src/store/configureStore.js +5 -5
- package/templates/app/src/store/configureStore.prod.js +26 -26
- package/templates/app/src/util/Common.js +5 -5
- package/templates/app/src/util/RequestAPI.js +132 -132
- package/templates/docs/all.html +249 -249
- package/templates/docs/component.html +178 -178
- package/templates/docs/components.html +221 -221
- package/templates/docs/css/b.min.css +6 -6
- package/templates/docs/css/component.css +42 -42
- package/templates/docs/css/componentTest.css +6 -6
- package/templates/docs/css/hopscotch.css +585 -585
- package/templates/docs/css/style.css +1022 -1022
- package/templates/docs/impactReportTemplate.html +154 -154
- package/templates/docs/index.html +1501 -1493
- package/templates/docs/js/active-line.js +72 -72
- package/templates/docs/js/b.min.js +7 -7
- package/templates/docs/js/codemirror.js +9680 -9680
- package/templates/docs/js/designTokens.js +334 -334
- package/templates/docs/js/j.min.js +4 -4
- package/templates/docs/js/javascript.js +874 -874
- package/templates/docs/js/matchbrackets.js +145 -145
@@ -1,18 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
let getOptions = require('./getOptions').default;
|
4
|
-
|
5
4
|
let fs = require('fs');
|
6
|
-
|
7
5
|
let coverageCollector = require('../jest/coverageCollector');
|
8
|
-
|
9
6
|
let path = require('path');
|
10
|
-
|
11
7
|
let {
|
12
8
|
htmlTemplate,
|
13
9
|
endTag
|
14
10
|
} = require('../templates/linterConstant');
|
15
|
-
|
16
11
|
let {
|
17
12
|
esLint: {
|
18
13
|
srcBranch,
|
@@ -24,12 +19,9 @@ let {
|
|
24
19
|
reportPath
|
25
20
|
}
|
26
21
|
} = getOptions();
|
27
|
-
|
28
22
|
function writeFile(filePath, data) {
|
29
23
|
filePath = path.join(process.cwd(), filePath); //eslint-disable-line
|
30
|
-
|
31
24
|
let dirName = path.dirname(filePath);
|
32
|
-
|
33
25
|
if (!fs.existsSync(dirName)) {
|
34
26
|
fs.mkdirSync(dirName);
|
35
27
|
fs.writeFileSync(filePath, data);
|
@@ -37,7 +29,6 @@ function writeFile(filePath, data) {
|
|
37
29
|
fs.writeFileSync(filePath, data);
|
38
30
|
}
|
39
31
|
}
|
40
|
-
|
41
32
|
let formatter = {
|
42
33
|
jsonFormatter: data => {
|
43
34
|
let finalList = [];
|
@@ -48,7 +39,6 @@ let formatter = {
|
|
48
39
|
tempMessageList.push(messageObj);
|
49
40
|
}
|
50
41
|
});
|
51
|
-
|
52
42
|
if (tempMessageList.length > 0) {
|
53
43
|
finalList.push(errorFileObj);
|
54
44
|
}
|
@@ -57,7 +47,6 @@ let formatter = {
|
|
57
47
|
},
|
58
48
|
htmlFormatter: data => {
|
59
49
|
data = formatter.jsonFormatter(data); //eslint-disable-line
|
60
|
-
|
61
50
|
if (data.length > 0) {
|
62
51
|
let liTag = '';
|
63
52
|
data.forEach(errorFileObj => {
|
@@ -65,19 +54,16 @@ let formatter = {
|
|
65
54
|
let messageTag = '';
|
66
55
|
errorFileObj.messages.forEach(messageObj => {
|
67
56
|
let errorType = messageObj.severity == 2 ? 'Error' : 'Warning'; //eslint-disable-line
|
68
|
-
|
69
57
|
messageTag = `${messageTag}<div class="pkDetailsRow"><div class="pkDetailsCol">${messageObj.line}</div><div class="pkDetailsCol pkError">${errorType}</div><div class="pkDetailsCol">${messageObj.message}</div><div class="pkDetailsCol">${messageObj.ruleId}</div></div>`;
|
70
58
|
});
|
71
59
|
liTag = `${liTag + messageTag}</div></div></li>`;
|
72
60
|
});
|
73
61
|
return `${htmlTemplate}<ul class="pkUl">${liTag}</ul>${endTag}`;
|
74
62
|
}
|
75
|
-
|
76
63
|
return `${htmlTemplate}<div class="pkEmpty"><div>No test results with found</div></div>${endTag}`;
|
77
64
|
},
|
78
65
|
xmlFormatter: data => {
|
79
66
|
data = formatter.jsonFormatter(data); //eslint-disable-line
|
80
|
-
|
81
67
|
let startTag = '<jscheck>';
|
82
68
|
let engTag = '</jscheck>';
|
83
69
|
let bodyContent = '';
|
@@ -93,10 +79,8 @@ let formatter = {
|
|
93
79
|
return startTag + bodyContent + engTag;
|
94
80
|
}
|
95
81
|
};
|
96
|
-
|
97
82
|
function formatSplitter(inputJson) {
|
98
83
|
let outputData;
|
99
|
-
|
100
84
|
if (reportType === 'json') {
|
101
85
|
outputData = JSON.stringify(formatter.jsonFormatter(inputJson));
|
102
86
|
} else if (reportType === 'html') {
|
@@ -104,10 +88,8 @@ function formatSplitter(inputJson) {
|
|
104
88
|
} else if (reportType === 'xml') {
|
105
89
|
outputData = formatter.xmlFormatter(inputJson);
|
106
90
|
}
|
107
|
-
|
108
91
|
writeFile(reportPath, outputData);
|
109
92
|
}
|
110
|
-
|
111
93
|
module.exports = function (results) {
|
112
94
|
let erroredFileObjectList = [];
|
113
95
|
results.forEach(fileObject => {
|
@@ -120,11 +102,9 @@ module.exports = function (results) {
|
|
120
102
|
});
|
121
103
|
}
|
122
104
|
});
|
123
|
-
|
124
105
|
if (impactRun) {
|
125
106
|
coverageCollector(srcBranch, targetBranch, serviceName, impactServerDomain).then((res = {}) => {
|
126
107
|
let impactList = [];
|
127
|
-
|
128
108
|
if (res.STATUS) {
|
129
109
|
if (res.LIST.length > 0) {
|
130
110
|
erroredFileObjectList.forEach(errFileObj => {
|
package/lib/utils/mailSender.js
CHANGED
@@ -1,21 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _nodemailer = _interopRequireDefault(require("nodemailer"));
|
4
|
-
|
5
4
|
var _index = require("./index");
|
6
|
-
|
7
5
|
var _jsonHelper = require("./jsonHelper");
|
8
|
-
|
9
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
-
|
11
7
|
if (process.argv.length <= 6) {
|
12
8
|
(0, _index.log)('Usage: node mailSender <from> <pass> <to> <subject> <html>');
|
13
9
|
process.exit(-1);
|
14
10
|
}
|
15
|
-
|
16
11
|
let [from, pass, to, subject, html, cc, user, reportURL] = process.argv.slice(2);
|
17
12
|
(0, _jsonHelper.jsonHelper)(`${process.cwd()}/result.json`, 'Report_URL', reportURL);
|
18
|
-
|
19
13
|
let transporter = _nodemailer.default.createTransport({
|
20
14
|
host: 'smtp.tsi.zohocorpin.com',
|
21
15
|
port: 25,
|
@@ -25,7 +19,6 @@ let transporter = _nodemailer.default.createTransport({
|
|
25
19
|
pass
|
26
20
|
}
|
27
21
|
});
|
28
|
-
|
29
22
|
let mailOptions = {
|
30
23
|
from: from,
|
31
24
|
to: to,
|
package/lib/utils/pullOrigin.js
CHANGED
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
|
8
7
|
var _child_process = require("child_process");
|
9
|
-
|
10
8
|
var _utils = require("../utils");
|
11
|
-
|
12
9
|
var _default = (type = 'git', branchName) => new Promise(resolve => {
|
13
10
|
if (type === 'git') {
|
14
11
|
(0, _child_process.spawnSync)('git', ['pull', 'origin', branchName], {
|
@@ -24,5 +21,4 @@ var _default = (type = 'git', branchName) => new Promise(resolve => {
|
|
24
21
|
resolve();
|
25
22
|
}
|
26
23
|
});
|
27
|
-
|
28
24
|
exports.default = _default;
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.reinstallDependencies1 = exports.reinstallDependencies = exports.collectPackageDiff = void 0;
|
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 _gitRootDir = _interopRequireDefault(require("git-root-dir"));
|
15
|
-
|
16
11
|
var _index = require("./index");
|
17
|
-
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
-
|
20
13
|
let packageJsons = {};
|
21
|
-
|
22
14
|
let packageDiffChecker = (pre, current) => {
|
23
15
|
let {
|
24
16
|
dependencies = {},
|
@@ -27,28 +19,23 @@ let packageDiffChecker = (pre, current) => {
|
|
27
19
|
let diffs = {};
|
28
20
|
Object.keys(dependencies).forEach(pack => {
|
29
21
|
let version = dependencies[pack];
|
30
|
-
|
31
22
|
if (version !== pre.dependencies && pre.dependencies[pack]) {
|
32
23
|
diffs[pack] = version;
|
33
24
|
}
|
34
25
|
});
|
35
26
|
Object.keys(devDependencies).forEach(pack => {
|
36
27
|
let version = devDependencies[pack];
|
37
|
-
|
38
28
|
if (version !== pre.devDependencies && pre.devDependencies[pack]) {
|
39
29
|
diffs[pack] = version;
|
40
30
|
}
|
41
31
|
});
|
42
32
|
return diffs;
|
43
33
|
};
|
44
|
-
|
45
34
|
let collectPackageDiff = pathToSubProjects => new Promise(resolve => {
|
46
35
|
(0, _gitRootDir.default)(process.cwd()).then(rootDir => {
|
47
36
|
let projects = _fs.default.readdirSync(_path.default.join(rootDir, pathToSubProjects));
|
48
|
-
|
49
37
|
projects.forEach(project => {
|
50
38
|
let packageJson = _path.default.join(_path.default.join(rootDir, pathToSubProjects), project, 'package.json');
|
51
|
-
|
52
39
|
if (_fs.default.existsSync(packageJson)) {
|
53
40
|
packageJsons[project] = require(packageJson);
|
54
41
|
}
|
@@ -56,29 +43,21 @@ let collectPackageDiff = pathToSubProjects => new Promise(resolve => {
|
|
56
43
|
resolve();
|
57
44
|
});
|
58
45
|
});
|
59
|
-
|
60
46
|
exports.collectPackageDiff = collectPackageDiff;
|
61
|
-
|
62
47
|
let reinstallDependencies1 = pathToSubProjects => {
|
63
48
|
(0, _gitRootDir.default)(process.cwd()).then(rootDir => {
|
64
49
|
let projects = _fs.default.readdirSync(_path.default.join(rootDir, pathToSubProjects));
|
65
|
-
|
66
50
|
projects.forEach(project => {
|
67
51
|
let prePackageJson = packageJsons[project];
|
68
52
|
let currentPackageJson;
|
69
|
-
|
70
53
|
if (prePackageJson) {
|
71
54
|
currentPackageJson = _path.default.join(_path.default.join(rootDir, pathToSubProjects), project, 'package.json');
|
72
|
-
|
73
55
|
if (_fs.default.existsSync(currentPackageJson)) {
|
74
56
|
currentPackageJson = require(currentPackageJson);
|
75
57
|
}
|
76
58
|
}
|
77
|
-
|
78
59
|
let projPath = _path.default.join(_path.default.join(rootDir, pathToSubProjects), project);
|
79
|
-
|
80
60
|
let diffs = packageDiffChecker(prePackageJson, currentPackageJson);
|
81
|
-
|
82
61
|
if (Object.keys(diffs).length) {
|
83
62
|
(0, _index.log)(diffs, `package diffs between branches for ${project} project`);
|
84
63
|
(0, _child_process.spawnSync)('rm', ['-rf', 'package-lock.json'], {
|
@@ -87,12 +66,10 @@ let reinstallDependencies1 = pathToSubProjects => {
|
|
87
66
|
});
|
88
67
|
let packages = Object.keys(diffs);
|
89
68
|
let dummy = [];
|
90
|
-
|
91
69
|
for (let name of packages) {
|
92
70
|
let version = diffs[name];
|
93
71
|
dummy.push(`${name}@${version}`);
|
94
72
|
}
|
95
|
-
|
96
73
|
(0, _index.log)(`npm ${['install'].concat(dummy).join(' ')}`);
|
97
74
|
(0, _child_process.spawnSync)('npm', ['install'].concat(dummy), {
|
98
75
|
cwd: projPath,
|
@@ -111,16 +88,12 @@ let reinstallDependencies1 = pathToSubProjects => {
|
|
111
88
|
});
|
112
89
|
});
|
113
90
|
};
|
114
|
-
|
115
91
|
exports.reinstallDependencies1 = reinstallDependencies1;
|
116
|
-
|
117
92
|
let reinstallDependencies = pathToSubProjects => new Promise(resolve => {
|
118
93
|
(0, _gitRootDir.default)(process.cwd()).then(rootDir => {
|
119
94
|
let projects = _fs.default.readdirSync(_path.default.join(rootDir, pathToSubProjects));
|
120
|
-
|
121
95
|
projects.forEach(project => {
|
122
96
|
let projPath = _path.default.join(_path.default.join(rootDir, pathToSubProjects), project);
|
123
|
-
|
124
97
|
(0, _child_process.spawnSync)('npm', ['install'], {
|
125
98
|
cwd: projPath,
|
126
99
|
stdio: 'inherit'
|
@@ -129,5 +102,4 @@ let reinstallDependencies = pathToSubProjects => new Promise(resolve => {
|
|
129
102
|
});
|
130
103
|
});
|
131
104
|
});
|
132
|
-
|
133
105
|
exports.reinstallDependencies = reinstallDependencies;
|
@@ -1,34 +1,27 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _getOptions = _interopRequireDefault(require("./getOptions"));
|
4
|
-
|
5
4
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6
|
-
|
7
5
|
let options = (0, _getOptions.default)();
|
8
6
|
let {
|
9
7
|
app: {
|
10
8
|
attrbuteNames
|
11
9
|
}
|
12
10
|
} = options;
|
13
|
-
|
14
11
|
module.exports = () => ({
|
15
12
|
visitor: {
|
16
13
|
Program(path, state) {
|
17
14
|
let properties = state.opts.properties || [];
|
18
|
-
|
19
15
|
if (properties.length === 0) {
|
20
16
|
properties = properties.concat(attrbuteNames);
|
21
17
|
}
|
22
|
-
|
23
18
|
path.traverse({
|
24
19
|
JSXIdentifier(path2) {
|
25
20
|
if (properties.indexOf(path2.node.name.toLowerCase()) > -1) {
|
26
21
|
path2.parentPath.remove();
|
27
22
|
}
|
28
23
|
}
|
29
|
-
|
30
24
|
});
|
31
25
|
}
|
32
|
-
|
33
26
|
}
|
34
27
|
});
|
package/lib/utils/repoClone.js
CHANGED
@@ -1,25 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _os = require("os");
|
4
|
-
|
5
4
|
var _path = _interopRequireDefault(require("path"));
|
6
|
-
|
7
5
|
var _fs = _interopRequireDefault(require("fs"));
|
8
|
-
|
9
6
|
var _child_process = require("child_process");
|
10
|
-
|
11
7
|
var _index = require("./index");
|
12
|
-
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
-
|
15
9
|
function spawnSyncWithErrorLog(...args) {
|
16
10
|
let result = (0, _child_process.spawnSync)(...args);
|
17
|
-
|
18
11
|
if (result.stderr) {
|
19
12
|
console.error(result.stderr);
|
20
13
|
}
|
21
14
|
}
|
22
|
-
|
23
15
|
let options = (0, _index.getOptions)();
|
24
16
|
let {
|
25
17
|
clone: {
|
@@ -34,36 +26,28 @@ let {
|
|
34
26
|
shouldDelete
|
35
27
|
}
|
36
28
|
} = options;
|
37
|
-
|
38
29
|
if (type && (type === 'git' || type === 'hg')) {
|
39
30
|
(0, _index.log)(`Going to clone ${type} repository`);
|
40
31
|
} else {
|
41
32
|
throw new Error('You must give valid type to clone a repository');
|
42
33
|
}
|
43
|
-
|
44
34
|
if (!cacheDir) {
|
45
35
|
cacheDir = _path.default.join((0, _os.homedir)(), '.react-cli');
|
46
36
|
} else {
|
47
37
|
cacheDir = _path.default.join(process.cwd(), cacheDir);
|
48
38
|
}
|
49
|
-
|
50
39
|
if (!projectName) {
|
51
40
|
let {
|
52
41
|
name
|
53
42
|
} = _path.default.parse(url);
|
54
|
-
|
55
43
|
projectName = name;
|
56
44
|
}
|
57
|
-
|
58
45
|
let projectPath = _path.default.join(cacheDir, projectName);
|
59
|
-
|
60
46
|
let cloneRepo = () => {
|
61
47
|
if (!_fs.default.existsSync(cacheDir)) {
|
62
48
|
_fs.default.mkdirSync(cacheDir);
|
63
49
|
}
|
64
|
-
|
65
50
|
let revisionOrBranch;
|
66
|
-
|
67
51
|
if (type === 'git') {
|
68
52
|
revisionOrBranch = `-b${branch}`;
|
69
53
|
} else {
|
@@ -73,30 +57,23 @@ let cloneRepo = () => {
|
|
73
57
|
revisionOrBranch = `-b${branch}`;
|
74
58
|
}
|
75
59
|
}
|
76
|
-
|
77
|
-
|
78
|
-
|
60
|
+
(0, _index.log)(`Going to clone ${url} repo to ${cacheDir} path`);
|
61
|
+
// this is for some time error will because of hg or git so we addid error log for this
|
79
62
|
let oargs = ['clone', url, revisionOrBranch, projectName];
|
80
63
|
type === 'git' && shallowClone && oargs.push('--depth=1');
|
81
64
|
spawnSyncWithErrorLog(type, oargs, {
|
82
65
|
cwd: cacheDir,
|
83
66
|
stdio: 'inherit'
|
84
67
|
});
|
85
|
-
|
86
68
|
_fs.default.writeFileSync(_path.default.join(projectPath, type === 'hg' ? '.hg' : '.git', 'remoteUrl'), url);
|
87
|
-
|
88
69
|
(0, _index.log)('Repository cloned!');
|
89
70
|
};
|
90
|
-
|
91
71
|
let getRemoteURL = () => {
|
92
72
|
let remoteUrl = _fs.default.readFileSync(_path.default.join(projectPath, type === 'hg' ? '.hg' : '.git', 'remoteUrl')).toString();
|
93
|
-
|
94
73
|
return remoteUrl.trim();
|
95
74
|
};
|
96
|
-
|
97
75
|
if (_fs.default.existsSync(projectPath)) {
|
98
76
|
let remoteUrl = getRemoteURL();
|
99
|
-
|
100
77
|
if (remoteUrl === url) {
|
101
78
|
if (type === 'git') {
|
102
79
|
spawnSyncWithErrorLog(type, ['pull', remoteName, branch], {
|
@@ -105,13 +82,11 @@ if (_fs.default.existsSync(projectPath)) {
|
|
105
82
|
});
|
106
83
|
} else {
|
107
84
|
let revisionOrBranch;
|
108
|
-
|
109
85
|
if (revision) {
|
110
86
|
revisionOrBranch = `-r${revision}`;
|
111
87
|
} else {
|
112
88
|
revisionOrBranch = `-b${branch}`;
|
113
89
|
}
|
114
|
-
|
115
90
|
spawnSyncWithErrorLog(type, ['pull', revisionOrBranch, '-u', url], {
|
116
91
|
cwd: projectPath,
|
117
92
|
stdio: 'inherit'
|
package/lib/utils/request.js
CHANGED
@@ -1,19 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
const https = require('https');
|
4
|
-
|
5
4
|
const http = require('http');
|
6
|
-
|
7
5
|
const url = require('url');
|
8
|
-
|
9
6
|
const querystring = require('querystring');
|
10
|
-
|
11
7
|
let isObject = data => data && data.toString && data.toString() === '[object Object]';
|
12
|
-
|
13
8
|
let isArray = data => data && Array.isArray(data);
|
14
|
-
|
15
9
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
16
|
-
|
17
10
|
let callback = resolve => res => {
|
18
11
|
res.setEncoding('utf8');
|
19
12
|
let str = '';
|
@@ -30,7 +23,6 @@ let callback = resolve => res => {
|
|
30
23
|
process.stdout.write(err);
|
31
24
|
});
|
32
25
|
};
|
33
|
-
|
34
26
|
let request = options => new Promise((resolve, reject) => {
|
35
27
|
let {
|
36
28
|
protocol,
|
@@ -52,13 +44,11 @@ let request = options => new Promise((resolve, reject) => {
|
|
52
44
|
headers: headers
|
53
45
|
};
|
54
46
|
let req;
|
55
|
-
|
56
47
|
if (protocol === 'https:') {
|
57
48
|
req = https.request(newOptions, callback(resolve));
|
58
49
|
} else if (protocol === 'http:') {
|
59
50
|
req = http.request(newOptions, callback(resolve));
|
60
51
|
}
|
61
|
-
|
62
52
|
if (method.toUpperCase() === 'POST') {
|
63
53
|
if (isObject(payload) || isArray(payload)) {
|
64
54
|
payload = JSON.stringify(payload);
|
@@ -68,7 +58,6 @@ let request = options => new Promise((resolve, reject) => {
|
|
68
58
|
req.write(formdata);
|
69
59
|
}
|
70
60
|
}
|
71
|
-
|
72
61
|
req.on('error', err => {
|
73
62
|
//eslint-disable-next-line
|
74
63
|
console.log(err);
|
@@ -76,5 +65,4 @@ let request = options => new Promise((resolve, reject) => {
|
|
76
65
|
});
|
77
66
|
req.end();
|
78
67
|
});
|
79
|
-
|
80
68
|
module.exports = request;
|
@@ -1,73 +1,73 @@
|
|
1
|
-
{
|
2
|
-
"jobDetails": {
|
3
|
-
"isTriggeredFromGit": true,
|
4
|
-
"isCIPassed": true,
|
5
|
-
"developerName": "GITLAB_USER_NAME",
|
6
|
-
"jobID": "CI_PIPELINE_ID",
|
7
|
-
"branchName": "CI_COMMIT_REF_NAME",
|
8
|
-
"commitMessage": "CI_COMMIT_MESSAGE",
|
9
|
-
"jobURL": "CI_JOB_URL",
|
10
|
-
"isByManual": "CI_JOB_MANUAL",
|
11
|
-
"commitID": "CI_COMMIT_SHA",
|
12
|
-
"executionTime": "Date.now()-Date.now()",
|
13
|
-
"hostName": "kathir-zt252"
|
14
|
-
},
|
15
|
-
"tests": {
|
16
|
-
"unitCase": {
|
17
|
-
"startTime": "123455",
|
18
|
-
"endTime": "123446",
|
19
|
-
"isExecuted": true,
|
20
|
-
"numberOfSuccess": "",
|
21
|
-
"numberOfFails": "",
|
22
|
-
"numberOfCases": "",
|
23
|
-
"numberOfSuites": "",
|
24
|
-
"fileDetail": {
|
25
|
-
"fileName": "sample.spec.js",
|
26
|
-
"caseDetail": {
|
27
|
-
"failedCaseLists": [],
|
28
|
-
"passedCaseList": []
|
29
|
-
}
|
30
|
-
},
|
31
|
-
"coverageDetail": {
|
32
|
-
"codeCoveragePercentage": "",
|
33
|
-
"fileCoveragePercentage": ""
|
34
|
-
}
|
35
|
-
},
|
36
|
-
"modifiedFileUnitCase": {
|
37
|
-
"hasChanges": "true",
|
38
|
-
"startTime": "123455",
|
39
|
-
"endTime": "123446",
|
40
|
-
"isExecuted": true,
|
41
|
-
"isPassed": true,
|
42
|
-
"numberOfSuccess": "",
|
43
|
-
"numberOfFails": "",
|
44
|
-
"numberOfCases": "",
|
45
|
-
"numberOfSuites": "",
|
46
|
-
"fileDetail": {
|
47
|
-
"fileName": "sample.spec.js",
|
48
|
-
"caseDetail": {
|
49
|
-
"failedCaseLists": [],
|
50
|
-
"passedCaseList": []
|
51
|
-
}
|
52
|
-
},
|
53
|
-
"coverageDetail": {
|
54
|
-
"codeCoveragePercentage": "",
|
55
|
-
"fileCoveragePercentage": ""
|
56
|
-
}
|
57
|
-
},
|
58
|
-
"screenshotTest": {
|
59
|
-
"message": "some",
|
60
|
-
"startTime": "123455",
|
61
|
-
"endTime": "123446",
|
62
|
-
"isThisExecuted": true,
|
63
|
-
"compareBranch": "master",
|
64
|
-
"isPassed": true,
|
65
|
-
"result": {
|
66
|
-
"numberOfComponents": 200,
|
67
|
-
"numberOfDiffFiles": 20,
|
68
|
-
"improperDocsList": [],
|
69
|
-
"erroredComponents": []
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
1
|
+
{
|
2
|
+
"jobDetails": {
|
3
|
+
"isTriggeredFromGit": true,
|
4
|
+
"isCIPassed": true,
|
5
|
+
"developerName": "GITLAB_USER_NAME",
|
6
|
+
"jobID": "CI_PIPELINE_ID",
|
7
|
+
"branchName": "CI_COMMIT_REF_NAME",
|
8
|
+
"commitMessage": "CI_COMMIT_MESSAGE",
|
9
|
+
"jobURL": "CI_JOB_URL",
|
10
|
+
"isByManual": "CI_JOB_MANUAL",
|
11
|
+
"commitID": "CI_COMMIT_SHA",
|
12
|
+
"executionTime": "Date.now()-Date.now()",
|
13
|
+
"hostName": "kathir-zt252"
|
14
|
+
},
|
15
|
+
"tests": {
|
16
|
+
"unitCase": {
|
17
|
+
"startTime": "123455",
|
18
|
+
"endTime": "123446",
|
19
|
+
"isExecuted": true,
|
20
|
+
"numberOfSuccess": "",
|
21
|
+
"numberOfFails": "",
|
22
|
+
"numberOfCases": "",
|
23
|
+
"numberOfSuites": "",
|
24
|
+
"fileDetail": {
|
25
|
+
"fileName": "sample.spec.js",
|
26
|
+
"caseDetail": {
|
27
|
+
"failedCaseLists": [],
|
28
|
+
"passedCaseList": []
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"coverageDetail": {
|
32
|
+
"codeCoveragePercentage": "",
|
33
|
+
"fileCoveragePercentage": ""
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"modifiedFileUnitCase": {
|
37
|
+
"hasChanges": "true",
|
38
|
+
"startTime": "123455",
|
39
|
+
"endTime": "123446",
|
40
|
+
"isExecuted": true,
|
41
|
+
"isPassed": true,
|
42
|
+
"numberOfSuccess": "",
|
43
|
+
"numberOfFails": "",
|
44
|
+
"numberOfCases": "",
|
45
|
+
"numberOfSuites": "",
|
46
|
+
"fileDetail": {
|
47
|
+
"fileName": "sample.spec.js",
|
48
|
+
"caseDetail": {
|
49
|
+
"failedCaseLists": [],
|
50
|
+
"passedCaseList": []
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"coverageDetail": {
|
54
|
+
"codeCoveragePercentage": "",
|
55
|
+
"fileCoveragePercentage": ""
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"screenshotTest": {
|
59
|
+
"message": "some",
|
60
|
+
"startTime": "123455",
|
61
|
+
"endTime": "123446",
|
62
|
+
"isThisExecuted": true,
|
63
|
+
"compareBranch": "master",
|
64
|
+
"isPassed": true,
|
65
|
+
"result": {
|
66
|
+
"numberOfComponents": 200,
|
67
|
+
"numberOfDiffFiles": 20,
|
68
|
+
"improperDocsList": [],
|
69
|
+
"erroredComponents": []
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
package/lib/utils/rtl.js
CHANGED
@@ -1,35 +1,24 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
-
|
5
4
|
var _path = _interopRequireDefault(require("path"));
|
6
|
-
|
7
5
|
var _fs = _interopRequireDefault(require("fs"));
|
8
|
-
|
9
6
|
var _folderIterator = _interopRequireDefault(require("./folderIterator"));
|
10
|
-
|
11
7
|
var _postcssRtl = _interopRequireDefault(require("@zohodesk/postcss-rtl"));
|
12
|
-
|
13
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
-
|
15
9
|
let cwd = process.cwd();
|
16
|
-
|
17
10
|
let src = _path.default.join(cwd, process.argv[2]);
|
18
|
-
|
19
11
|
let dist = _path.default.join(cwd, process.argv[3]);
|
20
|
-
|
21
12
|
let canWacth = '-w' === process.argv[4];
|
22
|
-
|
23
13
|
// import { useExitCleanup } from './useExitCleanup';
|
14
|
+
|
24
15
|
function watchHandler(fromPath, toPath) {
|
25
16
|
let css = _fs.default.readFileSync(fromPath);
|
26
|
-
|
27
17
|
(0, _postcss.default)([(0, _postcssRtl.default)({
|
28
18
|
addPrefixToSelector: function addPrefixToSelector(selector, prefix) {
|
29
19
|
if (prefix === '[dir]') {
|
30
20
|
return selector;
|
31
21
|
}
|
32
|
-
|
33
22
|
return `${prefix} ${selector}`; // Make selectors like [dir=rtl] > .selector
|
34
23
|
}
|
35
24
|
})]).process(css, {
|
@@ -37,22 +26,21 @@ function watchHandler(fromPath, toPath) {
|
|
37
26
|
to: toPath
|
38
27
|
}).then(result => {
|
39
28
|
_fs.default.writeFile(toPath, result.css, () => true);
|
40
|
-
|
41
29
|
if (result.map) {
|
42
30
|
_fs.default.writeFile(`${toPath}.map`, result.map, () => true);
|
43
31
|
}
|
44
32
|
});
|
45
33
|
}
|
46
|
-
|
47
34
|
(0, _folderIterator.default)(src, dist, ['.css'], false, (fromPath, toPath) => {
|
48
35
|
if (canWacth && fromPath) {
|
49
36
|
_fs.default.watchFile(fromPath, () => {
|
50
37
|
watchHandler(fromPath, toPath);
|
51
38
|
});
|
52
39
|
}
|
53
|
-
|
54
40
|
watchHandler(fromPath, toPath);
|
55
|
-
});
|
41
|
+
});
|
42
|
+
|
43
|
+
// if (canWacth) {
|
56
44
|
// useExitCleanup(() => {
|
57
45
|
// fs.unwatchFile(src, watchHandler);
|
58
46
|
// });
|
@@ -1,13 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _child_process = require("child_process");
|
4
|
-
|
5
4
|
let args = process.argv.slice(2);
|
6
5
|
args.forEach(arg => {
|
7
6
|
if (arg.startsWith('-')) {
|
8
7
|
//eslint-disable-next-line
|
9
8
|
arg = arg.substring(2);
|
10
9
|
}
|
11
|
-
|
12
10
|
(0, _child_process.execSync)(`npm config set ${arg}`);
|
13
11
|
});
|