@zohodesk/react-cli 0.0.1-exp.168.2 → 0.0.1-exp.168.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +179 -179
  3. package/README.md +925 -918
  4. package/bin/cli.js +492 -492
  5. package/cert/Tsicsezwild-22-23.crt +37 -37
  6. package/cert/Tsicsezwild-22-23.key +27 -27
  7. package/docs/CustomChunks.md +26 -26
  8. package/docs/DevStart.md +18 -18
  9. package/docs/InstallNode.md +28 -28
  10. package/docs/TODOS.md +10 -10
  11. package/docs/ValueReplacer.md +60 -60
  12. package/docs/warnings_while_install.txt +35 -35
  13. package/files/eslintrc.js +62 -62
  14. package/files/prettierrc.js +3 -3
  15. package/lib/configs/webpack.css.umd.config.js +4 -4
  16. package/lib/configs/webpack.prod.config.js +1 -1
  17. package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
  18. package/lib/loaders/workerLoader.js +9 -9
  19. package/lib/pluginUtils/getDevPlugins.js +5 -5
  20. package/lib/pluginUtils/getProdPlugins.js +5 -5
  21. package/lib/plugins/EFCPlugin.md +6 -6
  22. package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
  23. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
  24. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
  25. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
  26. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +86 -86
  27. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  28. package/lib/plugins/I18nSplitPlugin/index.js +57 -57
  29. package/lib/plugins/ResourceHintsPlugin.js +17 -17
  30. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
  31. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  32. package/lib/plugins/ServiceWorkerPlugin.js +9 -9
  33. package/lib/plugins/TPHashMappingPlugin.js +4 -4
  34. package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
  35. package/lib/postcss-plugins/hoverActivePlugin.js +324 -231
  36. package/lib/postcss-plugins/keyframesPlugin.js +20 -20
  37. package/lib/sh/pre-commit.sh +34 -34
  38. package/lib/sh/reportPublish.sh +45 -45
  39. package/lib/utils/buildstats.html +148 -148
  40. package/lib/utils/resultSchema.json +73 -73
  41. package/npm8.md +9 -9
  42. package/package.json +148 -148
  43. package/postpublish.js +6 -6
  44. package/templates/app/.eslintrc.js +140 -140
  45. package/templates/app/README.md +12 -12
  46. package/templates/app/app/index.html +24 -24
  47. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  48. package/templates/app/app/properties/i18nkeys.json +3 -3
  49. package/templates/app/docs/all.html +69 -69
  50. package/templates/app/mockapi/index.js +18 -18
  51. package/templates/app/package.json +37 -37
  52. package/templates/app/src/actions/SampleActions/index.js +37 -37
  53. package/templates/app/src/actions/index.js +65 -65
  54. package/templates/app/src/appUrls.js +19 -19
  55. package/templates/app/src/components/Alert/Alert.js +134 -134
  56. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  57. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  58. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  59. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  60. package/templates/app/src/components/Sample/SampleList.js +61 -61
  61. package/templates/app/src/components/Slider/Slider.css +41 -41
  62. package/templates/app/src/components/Slider/Slider.js +55 -55
  63. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  64. package/templates/app/src/containers/AppContainer/index.js +96 -96
  65. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  66. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  67. package/templates/app/src/containers/DevTools/index.js +10 -10
  68. package/templates/app/src/containers/Header/index.js +67 -67
  69. package/templates/app/src/containers/Header/index.module.css +43 -43
  70. package/templates/app/src/containers/Redirect/index.js +63 -63
  71. package/templates/app/src/containers/Redirector/index.js +47 -47
  72. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  73. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  74. package/templates/app/src/historyChange.js +5 -5
  75. package/templates/app/src/index.html +10 -10
  76. package/templates/app/src/index.js +24 -24
  77. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  78. package/templates/app/src/reducers/alertData.js +11 -11
  79. package/templates/app/src/reducers/index.js +6 -6
  80. package/templates/app/src/reducers/samples.js +19 -19
  81. package/templates/app/src/store/configureStore.dev.js +51 -51
  82. package/templates/app/src/store/configureStore.js +5 -5
  83. package/templates/app/src/store/configureStore.prod.js +26 -26
  84. package/templates/app/src/util/Common.js +5 -5
  85. package/templates/app/src/util/RequestAPI.js +132 -132
  86. package/templates/docs/all.html +249 -249
  87. package/templates/docs/component.html +178 -178
  88. package/templates/docs/components.html +221 -221
  89. package/templates/docs/css/b.min.css +6 -6
  90. package/templates/docs/css/component.css +42 -42
  91. package/templates/docs/css/componentTest.css +6 -6
  92. package/templates/docs/css/hopscotch.css +585 -585
  93. package/templates/docs/css/style.css +1022 -1022
  94. package/templates/docs/impactReportTemplate.html +154 -154
  95. package/templates/docs/index.html +1493 -1493
  96. package/templates/docs/js/active-line.js +72 -72
  97. package/templates/docs/js/b.min.js +7 -7
  98. package/templates/docs/js/codemirror.js +9680 -9680
  99. package/templates/docs/js/designTokens.js +334 -334
  100. package/templates/docs/js/j.min.js +4 -4
  101. package/templates/docs/js/javascript.js +874 -874
  102. package/templates/docs/js/matchbrackets.js +145 -145
@@ -6,12 +6,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
6
6
 
7
7
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8
8
 
9
- module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
9
+ module.exports = _postcss.default.plugin('postcss-reduced-motion', () => {
10
10
  function animDeclPosn(rule) {
11
11
  let posn = -1;
12
12
  rule.walkDecls((decl, index) => {
13
13
  //console.log(decl.prop, " " , decl.value);
14
- if (decl.prop.includes("animation")) {
14
+ if (decl.prop.includes('animation')) {
15
15
  //console.log(decl.prop," selected")
16
16
  posn = index;
17
17
  }
@@ -22,12 +22,12 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
22
22
  return root => {
23
23
  let redRules = [];
24
24
  root.walkAtRules((atrule, index) => {
25
- if (index != 0) {
25
+ if (index !== 0) {
26
26
  //ignore case
27
27
  let ignore = false;
28
28
 
29
- if (root.nodes[index - 1].type == "comment") {
30
- ignore = root.nodes[index - 1].text.includes("reduced-motion:ignore");
29
+ if (root.nodes[index - 1].type === 'comment') {
30
+ ignore = root.nodes[index - 1].text.includes('reduced-motion:ignore');
31
31
  } //animation none push to reduced motion
32
32
 
33
33
 
@@ -36,11 +36,11 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
36
36
  atrule.walkRules(rule => {
37
37
  let pos = animDeclPosn(rule);
38
38
 
39
- if (pos != -1) {
39
+ if (pos !== -1) {
40
40
  let ruleNew = rule.clone();
41
41
  let decl = ruleNew.nodes[pos];
42
42
  let declClone = decl.clone();
43
- declClone.value = "none";
43
+ declClone.value = 'none';
44
44
  ruleNew.walkDecls(declVal => declVal.remove());
45
45
  ruleNew.append(declClone);
46
46
  let atRuleNew = atrule.clone();
@@ -56,11 +56,11 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
56
56
  atrule.walkRules(rule => {
57
57
  let pos = animDeclPosn(rule);
58
58
 
59
- if (pos != -1) {
59
+ if (pos !== -1) {
60
60
  let ruleNew = rule.clone();
61
61
  let decl = ruleNew.nodes[pos];
62
62
  let declClone = decl.clone();
63
- declClone.value = "none";
63
+ declClone.value = 'none';
64
64
  ruleNew.walkDecls(declVal => declVal.remove());
65
65
  ruleNew.append(declClone);
66
66
  let atRuleNew = atrule.clone();
@@ -72,23 +72,23 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
72
72
  }
73
73
  });
74
74
  root.walkRules((rule, index) => {
75
- if (rule.type === "rule" && rule.parent.name == undefined) {
76
- if (index != 0) {
75
+ if (rule.type === 'rule' && rule.parent.name === undefined) {
76
+ if (index !== 0) {
77
77
  //ignore case
78
78
  let ignore = false;
79
79
 
80
- if (root.nodes[index - 1].type == "comment") {
81
- ignore = root.nodes[index - 1].text.includes("reduced-motion:ignore");
80
+ if (root.nodes[index - 1].type === 'comment') {
81
+ ignore = root.nodes[index - 1].text.includes('reduced-motion:ignore');
82
82
  } //animation none push to reduced motion
83
83
 
84
84
 
85
85
  if (!ignore) {
86
86
  //console.log(atrule)
87
87
  rule.walkDecls(decl => {
88
- if (decl != undefined && decl.prop.includes("animation")) {
88
+ if (decl !== undefined && decl.prop.includes('animation')) {
89
89
  let declClone = decl.clone();
90
90
  let newRule = rule.clone();
91
- declClone.value = "none";
91
+ declClone.value = 'none';
92
92
  newRule.walkDecls(declVal => declVal.remove());
93
93
  newRule.append(declClone);
94
94
  redRules.push(newRule);
@@ -99,10 +99,10 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
99
99
  //animation none push to reduced motion
100
100
  //console.log(atrule)
101
101
  rule.walkDecls(decl => {
102
- if (decl != undefined && decl.prop.includes("animation")) {
102
+ if (decl !== undefined && decl.prop.includes('animation')) {
103
103
  let declClone = decl.clone();
104
104
  let newRule = rule.clone();
105
- declClone.value = "none";
105
+ declClone.value = 'none';
106
106
  newRule.walkDecls(declVal => declVal.remove());
107
107
  newRule.append(declClone);
108
108
  redRules.push(newRule);
@@ -114,11 +114,11 @@ module.exports = _postcss.default.plugin("postcss-reduced-motion", () => {
114
114
 
115
115
  if (redRules.length > 0) {
116
116
  let redMtnQuery = (0, _postcss.atRule)({
117
- name: "media",
118
- params: "(prefers-reduced-motion)"
117
+ name: 'media',
118
+ params: '(prefers-reduced-motion)'
119
119
  });
120
120
  root.append(redMtnQuery).last;
121
- redRules.map(rule => {
121
+ redRules.forEach(rule => {
122
122
  redMtnQuery.append(rule);
123
123
  });
124
124
  }
@@ -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 $?
@@ -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"
@@ -1,148 +1,148 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5
- <style>
6
- #file {
7
- font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
8
- border-collapse: collapse;
9
- width: 100%;
10
- }
11
- #redTd {
12
- color: red;
13
- }
14
- #greenTD {
15
- color: green;
16
- }
17
- #file td,
18
- #file th {
19
- border: 1px solid #ddd;
20
- padding: 8px;
21
- text-align: center;
22
- }
23
-
24
- #file tr:nth-child(even) {
25
- background-color: #f2f2f2;
26
- }
27
-
28
- #file tr:hover {
29
- background-color: #ddd;
30
- }
31
-
32
- #file th {
33
- padding-top: 12px;
34
- padding-bottom: 12px;
35
- background-color: #2a2d36;
36
- color: white;
37
- }
38
- #sizeTable {
39
- float: left;
40
- width: 50%;
41
- }
42
- #hashTable {
43
- display: inline-block;
44
- width: 50%;
45
- }
46
- </style>
47
- <script type="text/javascript" src="./buildtrack.js"></script>
48
- </head>
49
- <body>
50
- <div>
51
- <div style="float: left;margin-right: 10px;">Branch Name:</div>
52
- <h4 id="h4" style="margin: 0px;"></h4>
53
- </div>
54
- <div id="sizeTable">
55
- <div>
56
- <h3>Size changes</h3>
57
- <h3></h3>
58
- </div>
59
- <table id="file" class="table table-bordered table-hover table-condensed">
60
- <thead>
61
- <tr>
62
- <th title="Field #1">Name</th>
63
- <th title="Field #2">Size / Diff</th>
64
- <th title="Field #3">Size / Old</th>
65
- <th title="Field #4">Size / New</th>
66
- </tr>
67
- </thead>
68
- <tbody id="sizeTbody"></tbody>
69
- </table>
70
- </div>
71
- <div id="hashTable">
72
- <div>
73
- <h3>Hash changes</h3>
74
- <h3></h3>
75
- </div>
76
- <table id="file" class="table table-bordered table-hover table-condensed">
77
- <thead>
78
- <tr>
79
- <th style="background-color: #4CAF50;" title="Field #1">Name</th>
80
- <th style="background-color: #4CAF50;" title="Field #2">
81
- Hash / Old
82
- </th>
83
- <th style="background-color: #4CAF50;" title="Field #3">
84
- Hash / New
85
- </th>
86
- </tr>
87
- </thead>
88
- <tbody id="hashTbody"></tbody>
89
- </table>
90
- </div>
91
-
92
- <script type="text/javascript">
93
- function load() {
94
- if (statsJson) {
95
- var tdStringSize = '';
96
- var tdStringHash = '';
97
- if (statsJson.increased.length > 0) {
98
- statsJson.increased.forEach(fileObj => {
99
- let colorTD = '</td><td>';
100
- if (fileObj.size.diff.split(' ').length > 2) {
101
- colorTD = '</td><td id="greenTd">';
102
- } else {
103
- colorTD = '</td><td id="redTd">';
104
- }
105
-
106
- tdStringSize =
107
- tdStringSize +
108
- '<tr><td>' +
109
- fileObj.name +
110
- colorTD +
111
- fileObj.size.diff +
112
- '</td><td>' +
113
- fileObj.size.old +
114
- '</td><td>' +
115
- fileObj.size.new +
116
- '</td><tr>';
117
- });
118
- } else {
119
- tdStringSize = '<tr><td></td><td></td><td></td></tr>';
120
- }
121
- document.getElementById('sizeTbody').innerHTML = tdStringSize;
122
- if (statsJson.hashChanged.length > 0) {
123
- statsJson.hashChanged.forEach(fileObj => {
124
- tdStringHash =
125
- tdStringHash +
126
- '<tr><td>' +
127
- fileObj.name +
128
- '</td><td>' +
129
- fileObj.hash.old +
130
- '</td><td>' +
131
- fileObj.hash.new +
132
- '</td><tr>';
133
- });
134
- } else {
135
- tdStringHash = '<tr><td></td><td></td><td></td></tr>';
136
- }
137
- document.getElementById('hashTbody').innerHTML = tdStringHash;
138
- if (statsJson.branchName) {
139
- document.getElementById('h4').innerHTML = statsJson.branchName;
140
- } else {
141
- document.getElementById('h4').innerHTML = 'Not specified';
142
- }
143
- }
144
- }
145
- load();
146
- </script>
147
- </body>
148
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5
+ <style>
6
+ #file {
7
+ font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
8
+ border-collapse: collapse;
9
+ width: 100%;
10
+ }
11
+ #redTd {
12
+ color: red;
13
+ }
14
+ #greenTD {
15
+ color: green;
16
+ }
17
+ #file td,
18
+ #file th {
19
+ border: 1px solid #ddd;
20
+ padding: 8px;
21
+ text-align: center;
22
+ }
23
+
24
+ #file tr:nth-child(even) {
25
+ background-color: #f2f2f2;
26
+ }
27
+
28
+ #file tr:hover {
29
+ background-color: #ddd;
30
+ }
31
+
32
+ #file th {
33
+ padding-top: 12px;
34
+ padding-bottom: 12px;
35
+ background-color: #2a2d36;
36
+ color: white;
37
+ }
38
+ #sizeTable {
39
+ float: left;
40
+ width: 50%;
41
+ }
42
+ #hashTable {
43
+ display: inline-block;
44
+ width: 50%;
45
+ }
46
+ </style>
47
+ <script type="text/javascript" src="./buildtrack.js"></script>
48
+ </head>
49
+ <body>
50
+ <div>
51
+ <div style="float: left;margin-right: 10px;">Branch Name:</div>
52
+ <h4 id="h4" style="margin: 0px;"></h4>
53
+ </div>
54
+ <div id="sizeTable">
55
+ <div>
56
+ <h3>Size changes</h3>
57
+ <h3></h3>
58
+ </div>
59
+ <table id="file" class="table table-bordered table-hover table-condensed">
60
+ <thead>
61
+ <tr>
62
+ <th title="Field #1">Name</th>
63
+ <th title="Field #2">Size / Diff</th>
64
+ <th title="Field #3">Size / Old</th>
65
+ <th title="Field #4">Size / New</th>
66
+ </tr>
67
+ </thead>
68
+ <tbody id="sizeTbody"></tbody>
69
+ </table>
70
+ </div>
71
+ <div id="hashTable">
72
+ <div>
73
+ <h3>Hash changes</h3>
74
+ <h3></h3>
75
+ </div>
76
+ <table id="file" class="table table-bordered table-hover table-condensed">
77
+ <thead>
78
+ <tr>
79
+ <th style="background-color: #4CAF50;" title="Field #1">Name</th>
80
+ <th style="background-color: #4CAF50;" title="Field #2">
81
+ Hash / Old
82
+ </th>
83
+ <th style="background-color: #4CAF50;" title="Field #3">
84
+ Hash / New
85
+ </th>
86
+ </tr>
87
+ </thead>
88
+ <tbody id="hashTbody"></tbody>
89
+ </table>
90
+ </div>
91
+
92
+ <script type="text/javascript">
93
+ function load() {
94
+ if (statsJson) {
95
+ var tdStringSize = '';
96
+ var tdStringHash = '';
97
+ if (statsJson.increased.length > 0) {
98
+ statsJson.increased.forEach(fileObj => {
99
+ let colorTD = '</td><td>';
100
+ if (fileObj.size.diff.split(' ').length > 2) {
101
+ colorTD = '</td><td id="greenTd">';
102
+ } else {
103
+ colorTD = '</td><td id="redTd">';
104
+ }
105
+
106
+ tdStringSize =
107
+ tdStringSize +
108
+ '<tr><td>' +
109
+ fileObj.name +
110
+ colorTD +
111
+ fileObj.size.diff +
112
+ '</td><td>' +
113
+ fileObj.size.old +
114
+ '</td><td>' +
115
+ fileObj.size.new +
116
+ '</td><tr>';
117
+ });
118
+ } else {
119
+ tdStringSize = '<tr><td></td><td></td><td></td></tr>';
120
+ }
121
+ document.getElementById('sizeTbody').innerHTML = tdStringSize;
122
+ if (statsJson.hashChanged.length > 0) {
123
+ statsJson.hashChanged.forEach(fileObj => {
124
+ tdStringHash =
125
+ tdStringHash +
126
+ '<tr><td>' +
127
+ fileObj.name +
128
+ '</td><td>' +
129
+ fileObj.hash.old +
130
+ '</td><td>' +
131
+ fileObj.hash.new +
132
+ '</td><tr>';
133
+ });
134
+ } else {
135
+ tdStringHash = '<tr><td></td><td></td><td></td></tr>';
136
+ }
137
+ document.getElementById('hashTbody').innerHTML = tdStringHash;
138
+ if (statsJson.branchName) {
139
+ document.getElementById('h4').innerHTML = statsJson.branchName;
140
+ } else {
141
+ document.getElementById('h4').innerHTML = 'Not specified';
142
+ }
143
+ }
144
+ }
145
+ load();
146
+ </script>
147
+ </body>
148
+ </html>