@zohodesk/react-cli 0.0.1-exp.167.1 → 0.0.1-exp.167.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/.eslintrc.js +1 -0
  2. package/.prettierrc +6 -0
  3. package/README.md +112 -4
  4. package/bin/cli.js +10 -20
  5. package/docs/HoverActive.md +12 -0
  6. package/docs/InstallNode.md +28 -0
  7. package/docs/VariableConversion.md +678 -0
  8. package/lib/common/splitChunks.js +133 -7
  9. package/lib/configs/jest.config.js +8 -12
  10. package/lib/configs/libAlias.js +10 -3
  11. package/lib/configs/webpack.dev.config.js +21 -26
  12. package/lib/configs/webpack.docs.config.js +13 -19
  13. package/lib/configs/webpack.impact.config.js +13 -19
  14. package/lib/configs/webpack.prod.config.js +19 -15
  15. package/lib/jest/preProcessors/cssPreprocessor.js +16 -7
  16. package/lib/loaderUtils/configsAssetsLoaders.js +117 -0
  17. package/lib/loaderUtils/getCSSLoaders.js +51 -7
  18. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +63 -54
  19. package/lib/postcss-plugins/{ExcludeRTLPlugin.js → ExcludePlugin.js} +1 -1
  20. package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
  21. package/lib/postcss-plugins/__test__/test1Input.css +39 -0
  22. package/lib/postcss-plugins/__test__/test1Output.css +39 -0
  23. package/lib/postcss-plugins/hoverActivePlugin.js +385 -0
  24. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +37 -0
  25. package/lib/postcss-plugins/variableModificationPlugin/index.js +247 -0
  26. package/lib/postcss-plugins/variableModifier.js +244 -0
  27. package/lib/schemas/index.js +57 -6
  28. package/lib/servers/getCliPath.js +7 -3
  29. package/lib/utils/getOptions.js +29 -1
  30. package/package.json +4 -3
  31. package/cert/cert.pem +0 -37
  32. package/cert/key.pem +0 -27
  33. package/cert/passphrase.pem +0 -1
  34. package/eslint/NOTES.md +0 -3
  35. package/eslint/React_CDN.zip +0 -0
  36. package/eslint/a.sh +0 -14
  37. package/eslint/a23.c +0 -16
  38. package/eslint/a28.c +0 -25
  39. package/eslint/a29.c +0 -25
  40. package/eslint/a30.c +0 -29
  41. package/eslint/a31.c +0 -23
  42. package/eslint/a35.c +0 -23
  43. package/eslint/a36.c +0 -18
  44. package/eslint/a37.c +0 -25
  45. package/eslint/a38.c +0 -28
  46. package/eslint/a39.c +0 -17
  47. package/eslint/a40.c +0 -32
  48. package/eslint/mockapi.html +0 -18
  49. package/eslint/mockapi.md +0 -5
  50. package/eslint/testa/build.sh +0 -7
  51. package/eslint/testa/build1/index.html +0 -12
  52. package/eslint/testa/build1/js/2_.js +0 -15
  53. package/eslint/testa/build1/js/2_.js.map +0 -1
  54. package/eslint/testa/build1/js/main_.js +0 -40
  55. package/eslint/testa/build1/js/main_.js.map +0 -1
  56. package/eslint/testa/build1/js/runtime~main_.js +0 -251
  57. package/eslint/testa/build1/js/runtime~main_.js.map +0 -1
  58. package/eslint/testa/build2/index.html +0 -12
  59. package/eslint/testa/build2/js/2_.js +0 -15
  60. package/eslint/testa/build2/js/2_.js.map +0 -1
  61. package/eslint/testa/build2/js/3_.js +0 -15
  62. package/eslint/testa/build2/js/3_.js.map +0 -1
  63. package/eslint/testa/build2/js/main_.js +0 -46
  64. package/eslint/testa/build2/js/main_.js.map +0 -1
  65. package/eslint/testa/build2/js/runtime~main_.js +0 -251
  66. package/eslint/testa/build2/js/runtime~main_.js.map +0 -1
  67. package/eslint/testa/build3/index.710b00fba04c6c594ad3.html +0 -12
  68. package/eslint/testa/build3/js/2.321b867f0966f9c9cdfd_.js +0 -1
  69. package/eslint/testa/build3/js/main.eb2aec4c9f1c16a385e0_.js +0 -1
  70. package/eslint/testa/build3/js/runtime~main.fafbbe7484e9c126f4f7_.js +0 -1
  71. package/eslint/testa/build3/manifest.json +0 -1
  72. package/eslint/testa/build4/index.9ff03a2ccdc9b904f1fe.html +0 -12
  73. package/eslint/testa/build4/js/2.8b63ce57af6dd2bac274_.js +0 -1
  74. package/eslint/testa/build4/js/3.5208acbe37a44362090e_.js +0 -1
  75. package/eslint/testa/build4/js/main.a934d6c2e2329d97269e_.js +0 -1
  76. package/eslint/testa/build4/js/runtime~main.5b85dd9ab73069c1455a_.js +0 -1
  77. package/eslint/testa/build4/manifest.json +0 -1
  78. package/eslint/testa/package.json +0 -24
  79. package/eslint/testa/scr/chunk1.js +0 -3
  80. package/eslint/testa/scr/chunk2.js +0 -3
  81. package/eslint/testa/scr/index.html +0 -12
  82. package/eslint/testa/scr/index.js +0 -4
  83. package/eslint/testa/scr/utlis.js +0 -12
  84. package/eslint/testa/src/chunk1.js +0 -3
  85. package/eslint/testa/src/index.html +0 -12
  86. package/eslint/testa/src/index.js +0 -3
  87. package/eslint/testa/src/utlis.js +0 -7
package/.eslintrc.js CHANGED
@@ -125,6 +125,7 @@ let commonConfigs = {
125
125
  'semi-spacing': [logLevel],
126
126
  'arrow-spacing': [logLevel],
127
127
  'arrow-body-style': [logLevel],
128
+ 'prefer-const': [logLevel],
128
129
  'arrow-parens': [logLevel, 'as-needed'],
129
130
  'no-const-assign': [logLevel],
130
131
  'no-dupe-class-members': [logLevel],
package/.prettierrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "trailingComma": "none",
3
+ "singleQuote": true,
4
+ "arrowParens": "avoid",
5
+ "jsxSingleQuote": true
6
+ }
package/README.md CHANGED
@@ -2,10 +2,118 @@
2
2
 
3
3
  A CLI tool for build modern web application and libraries
4
4
 
5
+ # 0.0.1-exp.167.3
6
+
7
+ Splitchunks config test
8
+
9
+ # 0.0.1-beta.174
10
+
11
+ cli has been updated to fix compose issue faced when classname:hover exists and classname does not before compose
12
+
13
+ **Issue Fix:-**
14
+
15
+ - In react-cli version `0.0.1-beta.173`, when we use `start` command throws error issue fixed
16
+ - while using `cssVariableReplacementOptions`, compose issue faced in css files, when classname:hover exists and classname does not exist issue fixed
17
+
18
+ **Feature:-**
19
+
20
+ - `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
21
+ `classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
22
+
23
+ **Changes:-**
24
+
25
+ - `jsonFile_test_*.json` files deleted after they used.
26
+
27
+ # 0.0.1-beta.173
28
+
29
+ Conversion for Variables from Variables to px in Supportapp completed (`variableIgnore.js` && `pxParserPostcss.js` to be referred to), and px to custom variables through the new `variableModificationPlugin`. Error Log generation can also be converted on enabling
30
+
31
+ **Features:**
32
+
33
+ 1. variables are converted from px to custom variables ( options are consumed from `cssVariableReplacementOptions.json` present in source folder )
34
+ 2. To enable the error log generation `errorLog` is to be made `true` in `cssVariableReplacementOptions.json` ( it will take a little longer than usual build time )
35
+ 3. To enable the console display of errors that are generated, `errorInConsole` is to be made `true` in `cssVariableReplacementOptions.json`
36
+ 4. To enable specific errors in the error log generation / error display on console, `DECLARATION_IGNORED`(for ignoring that particular line / declaration),`UNIT_ERROR` (when the Unit doesnt match the available units for the property),`RANGE_ERROR` (when the value does not fall within the range that is given for the property), `VARIABLE_PRESENT`(whether the value supposed to be in px for conversion sake is not converted from var() to px or if it's properly converted to px for conversion from px to var through our plugin) are to be individually made `true` in `cssVariableReplacementOptions.json`
37
+
38
+ For an more information and reference, refer to : `docs/VariableConversion.md `
39
+
40
+ # 0.0.1-beta.172
41
+
42
+ We have renamed some options, For Our future features convenience.
43
+ We have given fallback support.
44
+ Deprecation Warnings:-
45
+
46
+ - `react-cli.app.hasRTL` ==> `react-cli.app.plugins.hasRTL`
47
+ - `react-cli.app.rtlExclude` ==> `react-cli.app.exclude.rtl`
48
+
49
+ - `react-cli.docs.hasRTL` ==> `react-cli.docs.plugins.hasRTL`
50
+ - `react-cli.docs.rtlExclude` ==> `react-cli.docs.exclude.rtl`
51
+ these options have fallback support.
52
+
53
+ # 0.0.1-beta.171
54
+
55
+ Features added :
56
+
57
+ 1. `react-cli.app.mediaQueryHoverActiveString` and `react-cli.docs.mediaQueryHoverActiveString` templates support added for @media(hover: hover) and @media(hover: none) queries. We can modify these to modify respective queries.
58
+
59
+ # 0.0.1-beta.170
60
+
61
+ this version has same as `0.0.1-exp.169.1`, `0.0.1-exp.169.2`
62
+
63
+ # 0.0.1-exp.169.2
64
+
65
+ 1. flags are converted to one variable 'plugin' and used in getCssLoaders.js.
66
+ 2. files for exclusion can be put in seperate arrays in 'exclude' present in package.json.
67
+ 3. `combinerMq` has been converted to `combinerMediaQuery` for clarity.
68
+
69
+ # 0.0.1-exp.169.1
70
+
71
+ File support added for mp4 for docs dev and prod mode
72
+
73
+ # 0.0.1-beta.169
74
+
75
+ this version has same as `0.0.1-exp.168.1`, `0.0.1-exp.168.2`, `0.0.1-exp.168.3` and below and some minor changes
76
+
77
+ 1. `--efc_version=v3` flag added for change efc version via commmand line option
78
+ 2. `hoverActive` flag added for conversion from usual hover to @media(hover:hover) and @media(hover:none) queries for hover support in mobile.
79
+ 3. `combinerMq` flag added for combination of the media queries that might be appended or existing media queries that are duplicates to create one media query with all rules put together.
80
+
81
+ # 0.0.1-exp.168.3
82
+
83
+ Changes :
84
+
85
+ 1. code optimization ( made functions for the hoverActive cases making it more easier to access)
86
+ 2. handled `hover:ignore`, `active:ignore`, `hoverActive:ignore` cases for usual queries and media queries
87
+
88
+ # 0.0.1-exp.168.2
89
+
90
+ Changes :
91
+
92
+ 1. hoverActive case handled with postcss `hover:hover` media query and `hover:none` media query is added
93
+ 2. flag for hoverActive used to add/remove postcss changes
94
+
95
+ # 0.0.1-exp.168.1
96
+
97
+ Changes:-
98
+
99
+ 1. `cliRootPath` option removed `react-cli.app.cliRootPath` in `package.json`
100
+ Due to the reason we updated our logic to find package's executable path.
101
+ 2. `--efc_output_file=efc-sdk-[version].js` option added to modify efc output file by terminal
102
+ 3. added logic to print error message during command run, Previously when executable not found error messages not printed
103
+
104
+ # 0.0.1-beta.168
105
+
106
+ Changes:-
107
+
108
+ 1. `enableChunkHash` option enabled for dev mode, use it as `react-cli.app.enableChunkHash` in `package.json`
109
+ 2. `--enable_efc=true` option added to enable efc by terminal
110
+ 3. unwanted pem files removed
111
+
5
112
  # 0.0.1-exp.167.1
113
+
6
114
  Features:-
7
- * In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
8
115
 
116
+ - In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
9
117
 
10
118
  # 0.0.1-beta.167
11
119
 
@@ -56,7 +164,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
56
164
 
57
165
  # 0.0.1-beta.165
58
166
 
59
- - `valueReplacer` option added in shemas for font name replace related issue handling, for more [details](./docs/ValueReplacer.md)
167
+ - `valueReplacer` option added in shemas for font name replace related issue handling, for more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ValueReplacer.md)
60
168
  - `valuereplacer` option added in react-cli it takes three
61
169
  1. sourceDir
62
170
  2. distDir
@@ -64,7 +172,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
64
172
 
65
173
  # 0.0.1-exp.164.1
66
174
 
67
- - extra features in custom chunks reffer [this](./docs/CustomChunks.md)
175
+ - extra features in custom chunks reffer [this](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/CustomChunks.md)
68
176
 
69
177
  # 0.0.1-exp.164.2
70
178
 
@@ -154,7 +262,7 @@ this version has same as `# 0.0.1-exp.164.1`, `# 0.0.1-exp.164.2` and below and
154
262
 
155
263
  # 0.0.1-exp.159
156
264
 
157
- - isse fix:-
265
+ - issue fix:-
158
266
  - when rtl ltr css split enable manifest json css filename keys comes with hash .
159
267
 
160
268
  # 0.0.1-beta.158
package/bin/cli.js CHANGED
@@ -1,19 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const path = require('path');
4
- const os = require('os');
5
4
  const { existsSync } = require('fs');
6
- const { spawnSync, spawn } = require('child_process');
5
+ const { spawnSync: _spawnSync, spawn } = require('child_process');
7
6
  const { getOptions } = require('../lib/utils/index.js');
8
7
 
9
8
  const { log } = require('../lib/utils');
9
+ const { getCliPath } = require('../lib/servers/getCliPath.js');
10
10
  //initPreCommitHook();
11
11
 
12
12
  const options = getOptions();
13
13
 
14
+ function spawnSync(...args) {
15
+ const result = _spawnSync(...args);
16
+ if (result.error) {
17
+ console.error(result.error);
18
+ }
19
+ return result;
20
+ }
21
+
14
22
  const { esLint: esLintOptions } = options || {};
15
23
  const { preprocess } = options;
16
- let { cliRootPath } = options;
17
24
  const {
18
25
  ignoreFilePaths: esLintIgnorePaths,
19
26
  fix: esLintFix,
@@ -21,27 +28,10 @@ const {
21
28
  reportPath: reportPath
22
29
  } = esLintOptions || {};
23
30
 
24
- const isWindows = os.platform().toLowerCase() === 'win32';
25
-
26
31
  const [, , option] = process.argv;
27
32
  const args = process.argv.slice(3);
28
33
  const appPath = process.cwd();
29
34
 
30
- const isNodeModuleUnderAppFolder = __dirname.indexOf(appPath) !== -1;
31
-
32
- if (!cliRootPath) {
33
- cliRootPath = path.join(__dirname, '..');
34
- }
35
-
36
- const _getCliPath = !isNodeModuleUnderAppFolder
37
- ? libName => path.join(cliRootPath, 'node_modules', '.bin', libName)
38
- : libName => libName;
39
- const suffixExt = isWindows ? '.cmd' : '';
40
-
41
- function getCliPath(libName) {
42
- return _getCliPath(libName) + suffixExt;
43
- }
44
-
45
35
  const webpack = getCliPath('webpack');
46
36
 
47
37
  const nodemon = getCliPath('nodemon');
@@ -0,0 +1,12 @@
1
+ # hover active css handling
2
+
3
+ In general we write css with some hover in it.
4
+ But In mobile there is no hover and some times this hover css may do something messy some thing like we may need to click a button we need to click it double time.
5
+
6
+ To handle this behaviour we write a postcss plugin
7
+
8
+ PostCSS plugin that transforms :hover selectors to :active on devices where a mouse isn't the primary input mechanism.
9
+
10
+ when we write hover css it will have some problem in mobile devices the reason was in mobile device ther is no mouse
11
+
12
+ for this we have to handle that as
@@ -0,0 +1,28 @@
1
+ ### Step 1: Update APT index
2
+
3
+ Run the apt update command on your Ubuntu Linux to update package repository contents database.
4
+
5
+ > sudo apt update
6
+
7
+ ### Step 2: Install Node.js 14 on Ubuntu 22.04|20.04|18.04
8
+
9
+ After system update, install Node.js 14 on Ubuntu 22.04|20.04|18.04 by first installing the required repository.
10
+
11
+ > curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
12
+
13
+ The script above will create apt sources list file for the NodeSource Node.js 14.x repo:
14
+
15
+ > \# Ubuntu 20.04 example
16
+ >
17
+ > $ cat /etc/apt/sources.list.d/nodesource.list
18
+ > deb https://deb.nodesource.com/node_14.x focal main
19
+ > deb-src https://deb.nodesource.com/node_14.x focal main
20
+
21
+ Once the repository is added, you can begin the installation of Node.js 14 on Ubuntu Linux:
22
+
23
+ > sudo apt -y install nodejs
24
+
25
+ Verify the version of Node.js installed.
26
+
27
+ > $ node -v
28
+ > v14.17.5