@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.
- package/.eslintrc.js +1 -0
- package/.prettierrc +6 -0
- package/README.md +112 -4
- package/bin/cli.js +10 -20
- package/docs/HoverActive.md +12 -0
- package/docs/InstallNode.md +28 -0
- package/docs/VariableConversion.md +678 -0
- package/lib/common/splitChunks.js +133 -7
- package/lib/configs/jest.config.js +8 -12
- package/lib/configs/libAlias.js +10 -3
- package/lib/configs/webpack.dev.config.js +21 -26
- package/lib/configs/webpack.docs.config.js +13 -19
- package/lib/configs/webpack.impact.config.js +13 -19
- package/lib/configs/webpack.prod.config.js +19 -15
- package/lib/jest/preProcessors/cssPreprocessor.js +16 -7
- package/lib/loaderUtils/configsAssetsLoaders.js +117 -0
- package/lib/loaderUtils/getCSSLoaders.js +51 -7
- package/lib/plugins/I18nSplitPlugin/I18nSplit.md +63 -54
- package/lib/postcss-plugins/{ExcludeRTLPlugin.js → ExcludePlugin.js} +1 -1
- package/lib/postcss-plugins/__test__/hoverActivePlugin.spec.js +22 -0
- package/lib/postcss-plugins/__test__/test1Input.css +39 -0
- package/lib/postcss-plugins/__test__/test1Output.css +39 -0
- package/lib/postcss-plugins/hoverActivePlugin.js +385 -0
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +37 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +247 -0
- package/lib/postcss-plugins/variableModifier.js +244 -0
- package/lib/schemas/index.js +57 -6
- package/lib/servers/getCliPath.js +7 -3
- package/lib/utils/getOptions.js +29 -1
- package/package.json +4 -3
- package/cert/cert.pem +0 -37
- package/cert/key.pem +0 -27
- package/cert/passphrase.pem +0 -1
- package/eslint/NOTES.md +0 -3
- package/eslint/React_CDN.zip +0 -0
- package/eslint/a.sh +0 -14
- package/eslint/a23.c +0 -16
- package/eslint/a28.c +0 -25
- package/eslint/a29.c +0 -25
- package/eslint/a30.c +0 -29
- package/eslint/a31.c +0 -23
- package/eslint/a35.c +0 -23
- package/eslint/a36.c +0 -18
- package/eslint/a37.c +0 -25
- package/eslint/a38.c +0 -28
- package/eslint/a39.c +0 -17
- package/eslint/a40.c +0 -32
- package/eslint/mockapi.html +0 -18
- package/eslint/mockapi.md +0 -5
- package/eslint/testa/build.sh +0 -7
- package/eslint/testa/build1/index.html +0 -12
- package/eslint/testa/build1/js/2_.js +0 -15
- package/eslint/testa/build1/js/2_.js.map +0 -1
- package/eslint/testa/build1/js/main_.js +0 -40
- package/eslint/testa/build1/js/main_.js.map +0 -1
- package/eslint/testa/build1/js/runtime~main_.js +0 -251
- package/eslint/testa/build1/js/runtime~main_.js.map +0 -1
- package/eslint/testa/build2/index.html +0 -12
- package/eslint/testa/build2/js/2_.js +0 -15
- package/eslint/testa/build2/js/2_.js.map +0 -1
- package/eslint/testa/build2/js/3_.js +0 -15
- package/eslint/testa/build2/js/3_.js.map +0 -1
- package/eslint/testa/build2/js/main_.js +0 -46
- package/eslint/testa/build2/js/main_.js.map +0 -1
- package/eslint/testa/build2/js/runtime~main_.js +0 -251
- package/eslint/testa/build2/js/runtime~main_.js.map +0 -1
- package/eslint/testa/build3/index.710b00fba04c6c594ad3.html +0 -12
- package/eslint/testa/build3/js/2.321b867f0966f9c9cdfd_.js +0 -1
- package/eslint/testa/build3/js/main.eb2aec4c9f1c16a385e0_.js +0 -1
- package/eslint/testa/build3/js/runtime~main.fafbbe7484e9c126f4f7_.js +0 -1
- package/eslint/testa/build3/manifest.json +0 -1
- package/eslint/testa/build4/index.9ff03a2ccdc9b904f1fe.html +0 -12
- package/eslint/testa/build4/js/2.8b63ce57af6dd2bac274_.js +0 -1
- package/eslint/testa/build4/js/3.5208acbe37a44362090e_.js +0 -1
- package/eslint/testa/build4/js/main.a934d6c2e2329d97269e_.js +0 -1
- package/eslint/testa/build4/js/runtime~main.5b85dd9ab73069c1455a_.js +0 -1
- package/eslint/testa/build4/manifest.json +0 -1
- package/eslint/testa/package.json +0 -24
- package/eslint/testa/scr/chunk1.js +0 -3
- package/eslint/testa/scr/chunk2.js +0 -3
- package/eslint/testa/scr/index.html +0 -12
- package/eslint/testa/scr/index.js +0 -4
- package/eslint/testa/scr/utlis.js +0 -12
- package/eslint/testa/src/chunk1.js +0 -3
- package/eslint/testa/src/index.html +0 -12
- package/eslint/testa/src/index.js +0 -3
- 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
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](
|
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](
|
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
|
-
-
|
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
|