@zohodesk/react-cli 1.1.8-exp.2 → 1.1.9

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.
Files changed (134) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -180
  3. package/.prettierrc +6 -6
  4. package/Changelog.md +1019 -1019
  5. package/README.md +1293 -1293
  6. package/bin/cli.js +501 -497
  7. package/docs/ComposeMinification.md +13 -13
  8. package/docs/CustomChunks.md +29 -29
  9. package/docs/DevServerPort.md +39 -39
  10. package/docs/DevStart.md +18 -18
  11. package/docs/HoverActive.md +12 -12
  12. package/docs/InstallNode.md +28 -28
  13. package/docs/MarkdownParser.md +17 -17
  14. package/docs/ReactLive.md +13 -13
  15. package/docs/SelectorWeight.md +8 -8
  16. package/docs/TODOS.md +10 -10
  17. package/docs/ValueReplacer.md +60 -60
  18. package/docs/VariableConversion.md +729 -729
  19. package/docs/patternFiltering.md +56 -56
  20. package/docs/warnings_while_install.txt +35 -35
  21. package/files/eslintrc.js +62 -62
  22. package/files/prettierrc.js +3 -3
  23. package/lib/configs/webpack.css.umd.config.js +4 -4
  24. package/lib/configs/webpack.dev.config.js +0 -18
  25. package/lib/configs/webpack.docs.config.js +0 -17
  26. package/lib/deprecationLogger.js +3 -3
  27. package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
  28. package/lib/loaderUtils/getCSSLoaders.js +58 -62
  29. package/lib/loaders/workerLoader.js +9 -9
  30. package/lib/pluginUtils/getDevPlugins.js +5 -5
  31. package/lib/pluginUtils/getProdPlugins.js +5 -5
  32. package/lib/plugins/CustomAttributePlugin.md +35 -35
  33. package/lib/plugins/EFCPlugin.md +6 -6
  34. package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
  35. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
  36. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
  37. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
  38. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  39. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  40. package/lib/plugins/I18nSplitPlugin/index.js +57 -57
  41. package/lib/plugins/ReportGeneratePlugin.js +8 -6
  42. package/lib/plugins/ResourceHintsPlugin.js +17 -17
  43. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
  44. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  45. package/lib/plugins/SelectorPlugin.js +29 -29
  46. package/lib/plugins/ServiceWorkerPlugin.js +9 -9
  47. package/lib/plugins/TPHashMappingPlugin.js +4 -4
  48. package/lib/plugins/UnusedFilesFindPlugin.js +7 -5
  49. package/lib/plugins/VariableConversionCollector.js +59 -59
  50. package/lib/plugins/utils/fileHandling.js +8 -4
  51. package/lib/plugins/variableConvertorUtils.js +9 -9
  52. package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
  53. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  54. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  55. package/lib/postcss-plugins/hoverActivePlugin.js +3 -3
  56. package/lib/sh/pre-commit.sh +34 -34
  57. package/lib/sh/reportPublish.sh +45 -45
  58. package/lib/utils/buildstats.html +148 -148
  59. package/lib/utils/cssClassNameGenerate.js +13 -13
  60. package/lib/utils/deprecationSupport.js +83 -78
  61. package/lib/utils/getOptions.js +2 -2
  62. package/lib/utils/index.js +14 -12
  63. package/lib/utils/initPreCommitHook.js +5 -5
  64. package/lib/utils/log.js +11 -0
  65. package/lib/utils/pullOrigin.js +3 -3
  66. package/lib/utils/reinstallDependencies.js +3 -3
  67. package/lib/utils/resultSchema.json +73 -73
  68. package/lib/utils/switchBranch.js +4 -2
  69. package/npm-shrinkwrap.json +33393 -14454
  70. package/npm8.md +9 -9
  71. package/package.json +123 -123
  72. package/postpublish.js +8 -8
  73. package/templates/app/.eslintrc.js +140 -140
  74. package/templates/app/README.md +12 -12
  75. package/templates/app/app/index.html +24 -24
  76. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  77. package/templates/app/app/properties/i18nkeys.json +3 -3
  78. package/templates/app/docs/all.html +69 -69
  79. package/templates/app/mockapi/index.js +18 -18
  80. package/templates/app/package.json +37 -37
  81. package/templates/app/src/actions/SampleActions/index.js +37 -37
  82. package/templates/app/src/actions/index.js +65 -65
  83. package/templates/app/src/appUrls.js +19 -19
  84. package/templates/app/src/components/Alert/Alert.js +134 -134
  85. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  86. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  87. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  88. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  89. package/templates/app/src/components/Sample/SampleList.js +61 -61
  90. package/templates/app/src/components/Slider/Slider.css +41 -41
  91. package/templates/app/src/components/Slider/Slider.js +55 -55
  92. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  93. package/templates/app/src/containers/AppContainer/index.js +96 -96
  94. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  95. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  96. package/templates/app/src/containers/DevTools/index.js +10 -10
  97. package/templates/app/src/containers/Header/index.js +67 -67
  98. package/templates/app/src/containers/Header/index.module.css +43 -43
  99. package/templates/app/src/containers/Redirect/index.js +63 -63
  100. package/templates/app/src/containers/Redirector/index.js +47 -47
  101. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  102. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  103. package/templates/app/src/historyChange.js +5 -5
  104. package/templates/app/src/index.html +10 -10
  105. package/templates/app/src/index.js +24 -24
  106. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  107. package/templates/app/src/reducers/alertData.js +11 -11
  108. package/templates/app/src/reducers/index.js +6 -6
  109. package/templates/app/src/reducers/samples.js +19 -19
  110. package/templates/app/src/store/configureStore.dev.js +51 -51
  111. package/templates/app/src/store/configureStore.js +5 -5
  112. package/templates/app/src/store/configureStore.prod.js +26 -26
  113. package/templates/app/src/util/Common.js +5 -5
  114. package/templates/app/src/util/RequestAPI.js +132 -132
  115. package/templates/docs/all.html +250 -250
  116. package/templates/docs/component.html +179 -179
  117. package/templates/docs/components.html +222 -222
  118. package/templates/docs/css/b.min.css +6 -6
  119. package/templates/docs/css/component.css +42 -42
  120. package/templates/docs/css/componentTest.css +6 -6
  121. package/templates/docs/css/hopscotch.css +585 -585
  122. package/templates/docs/css/markdown.css +202 -202
  123. package/templates/docs/css/style.css +1022 -1022
  124. package/templates/docs/impactReportTemplate.html +154 -154
  125. package/templates/docs/index.html +1502 -1502
  126. package/templates/docs/js/active-line.js +72 -72
  127. package/templates/docs/js/b.min.js +7 -7
  128. package/templates/docs/js/codemirror.js +9680 -9680
  129. package/templates/docs/js/designTokens.js +334 -334
  130. package/templates/docs/js/j.min.js +4 -4
  131. package/templates/docs/js/javascript.js +874 -874
  132. package/templates/docs/js/matchbrackets.js +145 -145
  133. package/result.json +0 -1
  134. package/unittest/index.html +0 -37
@@ -21,10 +21,10 @@ const aliasNames = {
21
21
  cssVariableReplacement: 'postcss-variable-report',
22
22
  composeMinification: 'postcss-compose-plugin'
23
23
  };
24
- /*
25
-
26
- unique scenario
27
-
24
+ /*
25
+
26
+ unique scenario
27
+
28
28
  */
29
29
  // export function filterFileCssUniqueness(filename, filterObj) {
30
30
  // let rootDir = 'supportapp';
@@ -73,6 +73,10 @@ function isFileNameMatchingPattern({
73
73
  }
74
74
 
75
75
  function isFilePathMatchingPattern(filePath, patterns) {
76
+ if (patterns.length === 0) {
77
+ return true;
78
+ }
79
+
76
80
  const ig = (0, _ignore.default)({
77
81
  allowRelativePaths: true
78
82
  }).add(patterns);
@@ -12,15 +12,15 @@ var _classHandling = require("./utils/classHandling");
12
12
  const ignoreVals = ['--zd_size', '--zd_font_size', '--size', '--size_']; // const avoidProps = [];
13
13
  // -- is issue IO --
14
14
 
15
- /*
16
- issues eg :
17
- issues = ['--zd_size', '--zd_font_size', '--size', '--size_'];
18
- input :
19
- --zd_size
20
- output :
21
- true
22
- comment :
23
- do not execute when --zd_size comes as prop
15
+ /*
16
+ issues eg :
17
+ issues = ['--zd_size', '--zd_font_size', '--size', '--size_'];
18
+ input :
19
+ --zd_size
20
+ output :
21
+ true
22
+ comment :
23
+ do not execute when --zd_size comes as prop
24
24
  */
25
25
 
26
26
  exports.ignoreVals = ignoreVals;
@@ -37,11 +37,11 @@ function selectorMinifySameDir(selector, direction) {
37
37
  const regex = getRegex(direction);
38
38
  return selector.replace(regex, '').trim();
39
39
  }
40
- /**
41
- * this funtion will remove given rule,
42
- * if given selector and it's previous sibiling rule selector are same
43
- * current rule properties will move to previous sibiling rule.
44
- * @param {Rule} rule current rule
40
+ /**
41
+ * this funtion will remove given rule,
42
+ * if given selector and it's previous sibiling rule selector are same
43
+ * current rule properties will move to previous sibiling rule.
44
+ * @param {Rule} rule current rule
45
45
  */
46
46
 
47
47
 
@@ -56,11 +56,11 @@ function mergeIfSameSelector(rule) {
56
56
  rule.remove();
57
57
  }
58
58
  }
59
- /**
60
- * this funtion will remove given rule,
61
- * if given selector and it's previous sibiling rule selector are same
62
- * current rule properties will move to previous sibiling rule.
63
- * @param {Rule} rule current rule
59
+ /**
60
+ * this funtion will remove given rule,
61
+ * if given selector and it's previous sibiling rule selector are same
62
+ * current rule properties will move to previous sibiling rule.
63
+ * @param {Rule} rule current rule
64
64
  */
65
65
 
66
66
 
@@ -1,39 +1,39 @@
1
- /*Hover_active:ignore*/
2
- g,a:hover{
3
- color : red
4
- }
5
- /*Hover:ignore*/
6
- h:hover{
7
- background : yellow
8
- }
9
-
10
- /* Hover_active:ignore */
11
- g,d+e:hover{
12
- color : black
13
- }
14
-
15
- g,d e:hover{
16
- color : black
17
- }
18
-
19
- @media screen and (max-width:61.25em){
20
- /* Hover_active:ignore */
21
- a,b,a:hover, b:hover{
22
- background-color : blue
23
- }
24
- a + b,a:hover + b:hover{
25
- background-color : blue
26
- }
27
- a b:hover{
28
- background-color : blue
29
- }
30
-
31
- .cc:hover {
32
- color: red;
33
- }
34
-
35
- c:hover{
36
- color : red
37
- }
38
-
1
+ /*Hover_active:ignore*/
2
+ g,a:hover{
3
+ color : red
4
+ }
5
+ /*Hover:ignore*/
6
+ h:hover{
7
+ background : yellow
8
+ }
9
+
10
+ /* Hover_active:ignore */
11
+ g,d+e:hover{
12
+ color : black
13
+ }
14
+
15
+ g,d e:hover{
16
+ color : black
17
+ }
18
+
19
+ @media screen and (max-width:61.25em){
20
+ /* Hover_active:ignore */
21
+ a,b,a:hover, b:hover{
22
+ background-color : blue
23
+ }
24
+ a + b,a:hover + b:hover{
25
+ background-color : blue
26
+ }
27
+ a b:hover{
28
+ background-color : blue
29
+ }
30
+
31
+ .cc:hover {
32
+ color: red;
33
+ }
34
+
35
+ c:hover{
36
+ color : red
37
+ }
38
+
39
39
  }
@@ -1,39 +1,39 @@
1
- /*Hover_active:ignore*/
2
- g,a:hover{
3
- color : red
4
- }
5
- /*Hover:ignore*/
6
- h:hover{
7
- background : yellow
8
- }
9
-
10
- /* Hover_active:ignore */
11
- g,d+e:hover{
12
- color : black
13
- }
14
-
15
- g,d e:hover{
16
- color : black
17
- }
18
-
19
- @media screen and (max-width:61.25em){
20
- /* Hover_active:ignore */
21
- a,b,a:hover, b:hover{
22
- background-color : blue
23
- }
24
- a + b,a:hover + b:hover{
25
- background-color : blue
26
- }
27
- a b:hover{
28
- background-color : blue
29
- }
30
-
31
- .cc:hover {
32
- color: red;
33
- }
34
-
35
- c:hover{
36
- color : red
37
- }
38
-
1
+ /*Hover_active:ignore*/
2
+ g,a:hover{
3
+ color : red
4
+ }
5
+ /*Hover:ignore*/
6
+ h:hover{
7
+ background : yellow
8
+ }
9
+
10
+ /* Hover_active:ignore */
11
+ g,d+e:hover{
12
+ color : black
13
+ }
14
+
15
+ g,d e:hover{
16
+ color : black
17
+ }
18
+
19
+ @media screen and (max-width:61.25em){
20
+ /* Hover_active:ignore */
21
+ a,b,a:hover, b:hover{
22
+ background-color : blue
23
+ }
24
+ a + b,a:hover + b:hover{
25
+ background-color : blue
26
+ }
27
+ a b:hover{
28
+ background-color : blue
29
+ }
30
+
31
+ .cc:hover {
32
+ color: red;
33
+ }
34
+
35
+ c:hover{
36
+ color : red
37
+ }
38
+
39
39
  }
@@ -4,9 +4,9 @@ var _postcss = _interopRequireDefault(require("postcss"));
4
4
 
5
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
6
 
7
- /**
8
- * we have give support for ignore(exclude) comments
9
- * These are the comments' keyword
7
+ /**
8
+ * we have give support for ignore(exclude) comments
9
+ * These are the comments' keyword
10
10
  */
11
11
  const hoverIgnoreQuery = 'Hover:ignore',
12
12
  activeIgnoreQuery = 'Active:ignore',
@@ -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"