@zohodesk/react-cli 0.0.1-exp.175.0 → 0.0.1-exp.176.1
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/.eslintignore +7 -7
- package/.eslintrc.js +180 -180
- package/.prettierrc +6 -6
- package/{CHANGELOG-fz.md → CHANGELOG.md} +0 -0
- package/README.md +1025 -27
- package/bin/cli.js +482 -482
- package/cert/Tsicsezwild-22-23.crt +37 -0
- package/cert/Tsicsezwild-22-23.key +27 -0
- 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/SelectorWeight.md +6 -0
- package/docs/TODOS.md +10 -10
- package/docs/ValueReplacer.md +60 -60
- package/docs/VariableConversion.md +719 -678
- package/docs/warnings_while_install.txt +35 -35
- package/files/eslintrc.js +62 -62
- package/files/prettierrc.js +3 -3
- package/lib/configs/webpack.css.umd.config.js +4 -4
- package/lib/configs/webpack.dev.config.js +34 -6
- package/lib/configs/webpack.docs.config.js +24 -5
- package/lib/configs/webpack.impact.config.js +20 -6
- package/lib/configs/webpack.prod.config.js +35 -10
- package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
- package/lib/loaderUtils/getCSSLoaders.js +27 -19
- package/lib/loaderUtils/windowsModification.js +11 -0
- package/lib/loaders/workerLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +42 -20
- package/lib/pluginUtils/getProdPlugins.js +45 -24
- package/lib/plugins/EFCPlugin.md +6 -6
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
- package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
- package/lib/plugins/I18nSplitPlugin/README.md +25 -25
- package/lib/plugins/I18nSplitPlugin/index.js +57 -57
- package/lib/plugins/ResourceHintsPlugin.js +17 -17
- package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
- package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
- package/lib/plugins/SelectorPlugin.js +97 -0
- package/lib/plugins/ServiceWorkerPlugin.js +9 -9
- package/lib/plugins/TPHashMappingPlugin.js +4 -4
- package/lib/plugins/VariableConversionCollector.js +322 -0
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
- package/lib/postcss-plugins/__test__/test1Input.css +38 -38
- package/lib/postcss-plugins/__test__/test1Output.css +38 -38
- package/lib/postcss-plugins/hoverActivePlugin.js +3 -3
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +37 -14
- package/lib/postcss-plugins/variableModificationPlugin/index.js +203 -144
- package/lib/schemas/index.js +18 -12
- package/lib/servers/docsServerCore.js +12 -13
- package/lib/servers/httpsOptions.js +9 -40
- package/lib/servers/nowatchserver.js +11 -12
- package/lib/servers/server.js +13 -14
- package/lib/sh/pre-commit.sh +34 -34
- package/lib/sh/reportPublish.sh +45 -45
- package/lib/utils/buildstats.html +148 -148
- package/lib/utils/getOptions.js +13 -13
- package/lib/utils/resultSchema.json +73 -73
- package/npm8.md +9 -9
- package/package.json +146 -119
- package/postpublish.js +6 -8
- 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 -1501
- 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
- package/Changelog.md +0 -1019
- package/lib/configs/resolvers.js +0 -38
- package/lib/constants.js +0 -31
|
@@ -3,47 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.httpsOptions =
|
|
7
|
-
exports.httpsOptionsWithUserFriendlyError = httpsOptionsWithUserFriendlyError;
|
|
6
|
+
exports.httpsOptions = void 0;
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
// import path from 'path';
|
|
11
|
-
// export const httpsOptions = {
|
|
12
|
-
// key: fs.readFileSync(path.join(__dirname, './cert/Tsicsezwild-22-23.key')),
|
|
13
|
-
// cert: fs.readFileSync(path.join(__dirname, './cert/Tsicsezwild-22-23.crt'))
|
|
14
|
-
// };
|
|
15
|
-
function httpsOptions(options) {
|
|
16
|
-
const {
|
|
17
|
-
httpsCerts
|
|
18
|
-
} = options.app.server;
|
|
8
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
paths: [process.cwd()]
|
|
22
|
-
})); // TODO: in future we may do some version based check. certificate.version
|
|
10
|
+
var _path = _interopRequireDefault(require("path"));
|
|
23
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
13
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
httpsCerts
|
|
31
|
-
} = options.app.server;
|
|
32
|
-
|
|
33
|
-
if (typeof httpsCerts === 'string') {
|
|
34
|
-
try {
|
|
35
|
-
const certificate = httpsOptions(options);
|
|
36
|
-
return certificate;
|
|
37
|
-
} catch (error) {
|
|
38
|
-
if (error.message.indexOf('Cannot find module') !== -1) {
|
|
39
|
-
console.error(`You have given react-cli.app.server.httpsCerts as "${httpsCerts}". \n But it seems that file path have some problem.\n we are unable to locate "${httpsCerts}" in "${process.cwd()}"`);
|
|
40
|
-
} else {
|
|
41
|
-
console.error(error);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
process.exit(0);
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
14
|
+
const httpsOptions = {
|
|
15
|
+
key: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.key')),
|
|
16
|
+
cert: _fs.default.readFileSync(_path.default.join(__dirname, '../../cert/Tsicsezwild-22-23.crt'))
|
|
17
|
+
};
|
|
18
|
+
exports.httpsOptions = httpsOptions;
|
|
@@ -19,16 +19,15 @@ var _devBuild = require("./devBuild");
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
|
|
21
21
|
// import webpack from 'webpack';
|
|
22
|
-
|
|
22
|
+
let options = (0, _utils.getOptions)(); // let args = process.argv.slice(3);
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
const {
|
|
24
|
+
let {
|
|
26
25
|
app: {
|
|
27
26
|
context,
|
|
28
27
|
server
|
|
29
28
|
}
|
|
30
29
|
} = options;
|
|
31
|
-
|
|
30
|
+
let {
|
|
32
31
|
host,
|
|
33
32
|
port,
|
|
34
33
|
domain,
|
|
@@ -36,9 +35,9 @@ const {
|
|
|
36
35
|
hasMock,
|
|
37
36
|
mockPort
|
|
38
37
|
} = server;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
let isCompatableHttp2 = Number(process.version.slice(1).split('.')[0]) >= 8;
|
|
39
|
+
let contextURL = disableContextURL ? '' : `/${context}`;
|
|
40
|
+
let serverUrl = (0, _utils.getServerURL)(server, 'htt' + 'ps');
|
|
42
41
|
const {
|
|
43
42
|
zipname,
|
|
44
43
|
cssSelectorZipPath,
|
|
@@ -84,7 +83,7 @@ app.use('/wms/*', (req, res) => {
|
|
|
84
83
|
res.sendFile(_path.default.join(__dirname, '..', '..', 'templates', 'wms', 'index.html'));
|
|
85
84
|
});
|
|
86
85
|
|
|
87
|
-
const httpsServer = _https.default.createServer(httpsOptions, app);
|
|
86
|
+
const httpsServer = _https.default.createServer(_httpsOptions.httpsOptions, app);
|
|
88
87
|
|
|
89
88
|
const wss = new _ws.default.Server({
|
|
90
89
|
server: httpsServer
|
|
@@ -102,7 +101,7 @@ wss.on('connection', ws => {
|
|
|
102
101
|
});
|
|
103
102
|
app.post('/wmsmockapi', (req, res) => {
|
|
104
103
|
wsPool.forEach(ws => {
|
|
105
|
-
|
|
104
|
+
let {
|
|
106
105
|
body
|
|
107
106
|
} = req;
|
|
108
107
|
|
|
@@ -162,7 +161,7 @@ httpsServer.listen(port, err => {
|
|
|
162
161
|
if (isCompatableHttp2) {
|
|
163
162
|
const http2 = require('http2');
|
|
164
163
|
|
|
165
|
-
const http2Server = http2.createSecureServer(httpsOptions); // eslint-disable-next-line no-unused-vars
|
|
164
|
+
const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions); // eslint-disable-next-line no-unused-vars
|
|
166
165
|
|
|
167
166
|
http2Server.on('stream', (stream, headers) => {
|
|
168
167
|
stream.respond({
|
|
@@ -171,7 +170,7 @@ if (isCompatableHttp2) {
|
|
|
171
170
|
});
|
|
172
171
|
stream.end('<h1>Hello World! <br>Working with http2</h1>');
|
|
173
172
|
});
|
|
174
|
-
|
|
173
|
+
let http2Port = Number(port) + 1;
|
|
175
174
|
http2Server.listen(http2Port, err => {
|
|
176
175
|
if (err) {
|
|
177
176
|
throw err;
|
|
@@ -187,7 +186,7 @@ if (isCompatableHttp2) {
|
|
|
187
186
|
(0, _utils.log)('Your node version didn\'t adopted http2 support. Kindly update that to 8 LTS or above you can engage the http2');
|
|
188
187
|
}
|
|
189
188
|
|
|
190
|
-
|
|
189
|
+
let httpPort = Number(port) + (isCompatableHttp2 ? 2 : 1);
|
|
191
190
|
app.listen(httpPort, err => {
|
|
192
191
|
if (err) {
|
|
193
192
|
throw err;
|
package/lib/servers/server.js
CHANGED
|
@@ -25,15 +25,14 @@ var _httpsOptions = require("./httpsOptions");
|
|
|
25
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
26
|
|
|
27
27
|
// import fs from 'fs';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const {
|
|
28
|
+
let options = (0, _utils.getOptions)();
|
|
29
|
+
let {
|
|
31
30
|
app: {
|
|
32
31
|
context,
|
|
33
32
|
server
|
|
34
33
|
}
|
|
35
34
|
} = options;
|
|
36
|
-
|
|
35
|
+
let {
|
|
37
36
|
host,
|
|
38
37
|
port,
|
|
39
38
|
domain,
|
|
@@ -42,9 +41,9 @@ const {
|
|
|
42
41
|
hasMock,
|
|
43
42
|
mockPort
|
|
44
43
|
} = server;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let isCompatableHttp2 = Number(process.version.substr(1).split('.')[0]) >= 8;
|
|
45
|
+
let contextURL = disableContextURL ? '' : `/${context}`;
|
|
46
|
+
let serverUrl = (0, _utils.getServerURL)(server, 'htt' + 'ps');
|
|
48
47
|
const {
|
|
49
48
|
writeToDisk
|
|
50
49
|
} = options.impactService;
|
|
@@ -73,8 +72,8 @@ if (mode === 'prod') {
|
|
|
73
72
|
} // console.log({ contextURL });
|
|
74
73
|
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
let compiler = (0, _webpack.default)(config);
|
|
76
|
+
let webpackServerOptions = {
|
|
78
77
|
logLevel: 'error',
|
|
79
78
|
publicPath: mode === 'prod' ? contextURL === '' ? `${serverUrl}/${contextURL}` : serverUrl + contextURL : config.output.publicPath,
|
|
80
79
|
headers: options.app.enableDevCache ? {
|
|
@@ -115,7 +114,7 @@ app.use('/wms/*', (req, res) => {
|
|
|
115
114
|
res.sendFile(_path.default.join(__dirname, '..', '..', 'templates', 'wms', 'index.html'));
|
|
116
115
|
});
|
|
117
116
|
|
|
118
|
-
const httpsServer = _https.default.createServer(httpsOptions, app);
|
|
117
|
+
const httpsServer = _https.default.createServer(_httpsOptions.httpsOptions, app);
|
|
119
118
|
|
|
120
119
|
const wss = new _ws.default.Server({
|
|
121
120
|
server: httpsServer
|
|
@@ -133,7 +132,7 @@ wss.on('connection', ws => {
|
|
|
133
132
|
});
|
|
134
133
|
app.post('/wmsmockapi', (req, res) => {
|
|
135
134
|
wsPool.forEach(ws => {
|
|
136
|
-
|
|
135
|
+
let {
|
|
137
136
|
body
|
|
138
137
|
} = req;
|
|
139
138
|
|
|
@@ -179,7 +178,7 @@ httpsServer.listen(port, err => {
|
|
|
179
178
|
if (isCompatableHttp2) {
|
|
180
179
|
const http2 = require('http2');
|
|
181
180
|
|
|
182
|
-
const http2Server = http2.createSecureServer(httpsOptions); // eslint-disable-next-line no-unused-vars
|
|
181
|
+
const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions); // eslint-disable-next-line no-unused-vars
|
|
183
182
|
|
|
184
183
|
http2Server.on('stream', (stream, headers) => {
|
|
185
184
|
stream.respond({
|
|
@@ -188,7 +187,7 @@ if (isCompatableHttp2) {
|
|
|
188
187
|
});
|
|
189
188
|
stream.end('<h1>Hello World! <br>Working with http2</h1>');
|
|
190
189
|
});
|
|
191
|
-
|
|
190
|
+
let http2Port = Number(port) + 1;
|
|
192
191
|
http2Server.listen(http2Port, err => {
|
|
193
192
|
if (err) {
|
|
194
193
|
throw err;
|
|
@@ -204,7 +203,7 @@ if (isCompatableHttp2) {
|
|
|
204
203
|
(0, _utils.log)('Your node version didn\'t adopted http2 support. Kindly update that to 8 LTS or above you can engage the http2');
|
|
205
204
|
}
|
|
206
205
|
|
|
207
|
-
|
|
206
|
+
let httpPort = Number(port) + (isCompatableHttp2 ? 2 : 1);
|
|
208
207
|
app.listen(httpPort, err => {
|
|
209
208
|
if (err) {
|
|
210
209
|
throw err;
|
package/lib/sh/pre-commit.sh
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
|
|
4
|
-
|
|
5
|
-
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
|
|
6
|
-
|
|
7
|
-
echo "Branch Name - $CURRENT_BRANCH"
|
|
8
|
-
|
|
9
|
-
if [[ "$STAGED_FILES" = "" ]]; then
|
|
10
|
-
exit 0
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
IS_FAILED=false
|
|
14
|
-
FILES=""
|
|
15
|
-
|
|
16
|
-
for FILE in $STAGED_FILES # Add files with space separation
|
|
17
|
-
do
|
|
18
|
-
FILES+="$FILE "
|
|
19
|
-
done
|
|
20
|
-
|
|
21
|
-
npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
|
|
22
|
-
|
|
23
|
-
if [[ "$?" != 0 ]]; then
|
|
24
|
-
IS_FAILED=true
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
if $IS_FAILED; then
|
|
28
|
-
echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
|
|
29
|
-
exit 1
|
|
30
|
-
else
|
|
31
|
-
echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
exit $?
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js)$") # Get staged files
|
|
4
|
+
|
|
5
|
+
CURRENT_BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') # Get branch name
|
|
6
|
+
|
|
7
|
+
echo "Branch Name - $CURRENT_BRANCH"
|
|
8
|
+
|
|
9
|
+
if [[ "$STAGED_FILES" = "" ]]; then
|
|
10
|
+
exit 0
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
IS_FAILED=false
|
|
14
|
+
FILES=""
|
|
15
|
+
|
|
16
|
+
for FILE in $STAGED_FILES # Add files with space separation
|
|
17
|
+
do
|
|
18
|
+
FILES+="$FILE "
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
npm run lint --prefix ${PREFIX_PATH} $FILES # Run ESLint
|
|
22
|
+
|
|
23
|
+
if [[ "$?" != 0 ]]; then
|
|
24
|
+
IS_FAILED=true
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if $IS_FAILED; then
|
|
28
|
+
echo "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors and try again.\n"
|
|
29
|
+
exit 1
|
|
30
|
+
else
|
|
31
|
+
echo "\033[42mCOMMIT SUCCEEDED\033[0m\n"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
exit $?
|
package/lib/sh/reportPublish.sh
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
branchName=$2
|
|
3
|
-
url=$1
|
|
4
|
-
zipUrl=$3
|
|
5
|
-
unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
|
|
6
|
-
publishFolder=$branchName"_"$unique
|
|
7
|
-
|
|
8
|
-
rm -rf ./reports
|
|
9
|
-
rm -rf ./scrTemplate
|
|
10
|
-
rm -rf ./errTemplate
|
|
11
|
-
rm -rf ./css
|
|
12
|
-
rm -rf ./js
|
|
13
|
-
rm -rf ./index.html
|
|
14
|
-
|
|
15
|
-
curl $zipUrl | tar xz
|
|
16
|
-
|
|
17
|
-
cp -rf ./reports/css ./css
|
|
18
|
-
cp -rf ./reports/js ./js
|
|
19
|
-
cp -rf ./reports/index.html ./index.html
|
|
20
|
-
if [ -d "./screenShots" ] ; then
|
|
21
|
-
cp -rf ./scrTemplate/* ./screenShots/
|
|
22
|
-
else
|
|
23
|
-
mkdir ./screenShots
|
|
24
|
-
cp -rf ./scrTemplate/* ./screenShots/
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
[ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
|
|
28
|
-
[ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
|
|
29
|
-
[ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
|
|
30
|
-
[ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
|
|
31
|
-
[ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
|
|
32
|
-
|
|
33
|
-
tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
|
|
34
|
-
|
|
35
|
-
curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
|
|
36
|
-
replace=$publishFolder
|
|
37
|
-
reportUrl=$url"/"$replace
|
|
38
|
-
subject="Client Report - React - $publishFolder"
|
|
39
|
-
msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
|
|
40
|
-
<p><b>Report Branchname - $branchName</b></p>
|
|
41
|
-
<p><b>Report Unique ID - $unique</b></p>
|
|
42
|
-
<p><b>Report Developer - $6</b></p>"
|
|
43
|
-
#node mailSender.js <from> <pass> <to> <subject> <text>
|
|
44
|
-
BASEDIR=$(dirname "$0")
|
|
45
|
-
node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
branchName=$2
|
|
3
|
+
url=$1
|
|
4
|
+
zipUrl=$3
|
|
5
|
+
unique=$(date +"%d_%m_%y_Time_%H_%M_%S")
|
|
6
|
+
publishFolder=$branchName"_"$unique
|
|
7
|
+
|
|
8
|
+
rm -rf ./reports
|
|
9
|
+
rm -rf ./scrTemplate
|
|
10
|
+
rm -rf ./errTemplate
|
|
11
|
+
rm -rf ./css
|
|
12
|
+
rm -rf ./js
|
|
13
|
+
rm -rf ./index.html
|
|
14
|
+
|
|
15
|
+
curl $zipUrl | tar xz
|
|
16
|
+
|
|
17
|
+
cp -rf ./reports/css ./css
|
|
18
|
+
cp -rf ./reports/js ./js
|
|
19
|
+
cp -rf ./reports/index.html ./index.html
|
|
20
|
+
if [ -d "./screenShots" ] ; then
|
|
21
|
+
cp -rf ./scrTemplate/* ./screenShots/
|
|
22
|
+
else
|
|
23
|
+
mkdir ./screenShots
|
|
24
|
+
cp -rf ./scrTemplate/* ./screenShots/
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
[ ! -f "./result.json" ] && touch result.json && cp -rf ./errTemplate/* ./result.json
|
|
28
|
+
[ ! -d "./commitCoverage" ] && mkdir commitCoverage && cp -rf ./errTemplate/* ./commitCoverage/
|
|
29
|
+
[ ! -d "./unittest" ] && mkdir unittest && cp -rf ./errTemplate/* ./unittest/
|
|
30
|
+
[ ! -d "./coverageTest" ] && mkdir coverageTest && cp -rf ./errTemplate/* ./coverageTest/
|
|
31
|
+
[ ! -d "./coverage" ] && mkdir coverage && cp -rf ./errTemplate/* ./coverage/
|
|
32
|
+
|
|
33
|
+
tar -czvf $publishFolder.tar.gz coverage screenShots unittest coverageTest commitCoverage ./css ./js ./index.html ./result.json
|
|
34
|
+
|
|
35
|
+
curl -i -F name=file -F file=@$publishFolder.tar.gz $url"/cgi-bin/upload.py"
|
|
36
|
+
replace=$publishFolder
|
|
37
|
+
reportUrl=$url"/"$replace
|
|
38
|
+
subject="Client Report - React - $publishFolder"
|
|
39
|
+
msg="<p><b>Report URL - <a href='$reportUrl'>Link</a></b></p>
|
|
40
|
+
<p><b>Report Branchname - $branchName</b></p>
|
|
41
|
+
<p><b>Report Unique ID - $unique</b></p>
|
|
42
|
+
<p><b>Report Developer - $6</b></p>"
|
|
43
|
+
#node mailSender.js <from> <pass> <to> <subject> <text>
|
|
44
|
+
BASEDIR=$(dirname "$0")
|
|
45
|
+
node $BASEDIR"/../utils/mailSender" $4 $5 $6 "$subject" "$msg" $7 $8 "$reportUrl"
|