@zohodesk/react-cli 1.1.14-exp.2 → 1.1.14-kubernetes
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -281
- package/bin/cli.js +55 -30
- package/docs/CustomChunks.md +9 -12
- package/docs/SelectorWeight.md +0 -3
- package/docs/ValueReplacer.md +0 -27
- package/docs/VariableConversion.md +1 -6
- package/lib/common/splitChunks.js +45 -65
- package/lib/common/testPattern.js +11 -9
- package/lib/common/valueReplacer.js +3 -1
- package/lib/configs/resolvers.js +5 -16
- package/lib/configs/webpack.css.umd.config.js +2 -3
- package/lib/configs/webpack.dev.config.js +5 -15
- package/lib/configs/webpack.docs.config.js +3 -14
- package/lib/configs/webpack.impact.config.js +2 -8
- package/lib/configs/webpack.prod.config.js +5 -15
- package/lib/constants.js +3 -3
- package/lib/loaderUtils/getCSSLoaders.js +49 -98
- package/lib/loaderUtils/windowsModification.js +1 -6
- package/lib/loaders/docsLoader.js +7 -18
- package/lib/loaders/selectorMappingLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +6 -25
- package/lib/pluginUtils/getProdPlugins.js +5 -32
- package/lib/pluginUtils/getUMDCSSPlugins.js +1 -1
- package/lib/pluginUtils/getUMDComponentPlugins.js +1 -1
- package/lib/plugins/EFCPlugin.js +9 -9
- package/lib/plugins/EFCTemplatePlugin.js +12 -10
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +9 -8
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +3 -2
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +13 -29
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +7 -2
- package/lib/plugins/I18nSplitPlugin/index.js +1 -1
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
- package/lib/plugins/ReportGeneratePlugin.js +6 -8
- package/lib/plugins/ResourceHintsPlugin.js +3 -13
- package/lib/plugins/SelectorPlugin.js +37 -77
- package/lib/plugins/{MinifyPlugin.js → UglifyCSSPlugin.js} +3 -3
- package/lib/plugins/UnusedFilesFindPlugin.js +5 -7
- package/lib/plugins/VariableConversionCollector.js +101 -40
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/plugins/index.js +7 -7
- package/lib/postcss-plugins/ExcludePlugin.js +1 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -4
- package/lib/postcss-plugins/ValueReplacer.js +29 -8
- package/lib/postcss-plugins/hoverActivePlugin.js +6 -0
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +1 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +38 -94
- package/lib/postcss-plugins/variableModifier.js +244 -0
- package/lib/schemas/index.js +18 -94
- package/lib/servers/devBuild.js +11 -13
- package/lib/servers/getCliPath.js +5 -3
- package/lib/servers/httpsOptions.js +13 -12
- package/lib/servers/nowatchserver.js +55 -62
- package/lib/servers/server.js +52 -53
- package/lib/utils/cssClassNameGenerate.js +13 -70
- package/lib/utils/getOptions.js +28 -35
- package/lib/utils/getServerURL.js +9 -1
- package/lib/utils/index.js +12 -14
- package/lib/utils/initPreCommitHook.js +5 -5
- package/lib/utils/pullOrigin.js +3 -3
- package/lib/utils/reinstallDependencies.js +3 -3
- package/lib/utils/switchBranch.js +2 -4
- package/package.json +3 -5
- package/templates/docs/all.html +0 -1
- package/templates/docs/component.html +0 -1
- package/templates/docs/components.html +0 -1
- package/templates/docs/css/style.css +169 -136
- package/templates/docs/index.html +632 -796
- package/.vscode/settings.json +0 -25
- package/docs/ComposeMinification.md +0 -13
- package/docs/MarkdownParser.md +0 -18
- package/docs/ReactLive.md +0 -14
- package/docs/patternFiltering.md +0 -57
- package/lib/common/buildEs.js +0 -12
- package/lib/common/runPreProcess.js +0 -71
- package/lib/deprecationLogger.js +0 -40
- package/lib/loaderUtils/tests/windowsModification.test.js +0 -10
- package/lib/loaders/__test__/markdownLoader.spec.js +0 -145
- package/lib/loaders/composeLoader.js +0 -298
- package/lib/loaders/markdownLoader.js +0 -71
- package/lib/loaders/reactLiveConvertor.js +0 -105
- package/lib/logger.js +0 -27
- package/lib/plugins/CustomAttributePlugin.js +0 -82
- package/lib/plugins/CustomAttributePlugin.md +0 -35
- package/lib/plugins/EfcResourceCleanupPlugin.js +0 -43
- package/lib/plugins/StatsPlugin.js +0 -82
- package/lib/plugins/utils/classHandling.js +0 -35
- package/lib/plugins/utils/fileHandling.js +0 -92
- package/lib/plugins/utils/tests/fileHandling.test.js +0 -30
- package/lib/plugins/variableConvertorUtils.js +0 -133
- package/lib/postcss-plugins/EmptyPlugin.js +0 -8
- package/lib/postcss-plugins/IncludePlugin.js +0 -23
- package/lib/postcss-plugins/SelectorReplace.js +0 -80
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +0 -28
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +0 -43
- package/lib/servers/requireLocalOrGlobal.js +0 -61
- package/lib/utils/deprecationSupport.js +0 -134
- package/lib/utils/log.js +0 -11
- package/lib/utils/object-manipulation.js +0 -88
- package/lib/utils/selectorReplacer.js +0 -47
- package/lib/utils/variableConverter.js +0 -104
- package/npm-shrinkwrap.json +0 -33485
- package/templates/docs/css/markdown.css +0 -202
package/README.md
CHANGED
@@ -44,274 +44,24 @@ Now to run app
|
|
44
44
|
|
45
45
|
# Change Logs
|
46
46
|
|
47
|
-
# 1.1.14 (11-9-2023)
|
48
|
-
|
49
|
-
**Feature:-**
|
50
|
-
|
51
|
-
- Value Replacer supports `^` before and `$` after the word to consider the whole word for replacement. Only if the exact word comes as value, there will be a replacement made.
|
52
|
-
|
53
|
-
**Issue Fix**
|
54
|
-
|
55
|
-
- 'space' character on variable conversion changes to undefined fixed.
|
56
|
-
- calc(100%) variable conversion to undefined fixed.
|
57
|
-
- height value if text converts to undefined, issue fixed.
|
58
|
-
|
59
|
-
# 1.1.13 (4-9-2023)
|
60
|
-
|
61
|
-
**Changes**
|
62
|
-
|
63
|
-
- Fixed the issue related to the resource cleanup plugin. (EfcResouceCleanupPlugin)
|
64
|
-
|
65
|
-
|
66
|
-
# 1.1.12 (1-9-2023)
|
67
|
-
|
68
|
-
**Features**
|
69
|
-
|
70
|
-
- Generating stats.json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
|
71
|
-
- Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by custom attributes enable flag.
|
72
|
-
|
73
|
-
**Changes**
|
74
|
-
|
75
|
-
- Added a new config `stats` to control stats file generation.
|
76
|
-
- Using Existing custom attributes flag, we can control resource cleanup plugin.
|
77
|
-
|
78
|
-
# 1.1.11 (4-8-2023)
|
79
|
-
|
80
|
-
**Changes**
|
81
|
-
|
82
|
-
- we have renamed our default config file as `react-cli.config.js` instead of `build.config.js`. But we still support `build.config.js` we will remove it in later major version.
|
83
|
-
|
84
|
-
- Prop-type, Prop description, Default Props support for docs given.
|
85
|
-
- Docs and Docs_Code UI updated.
|
86
|
-
|
87
|
-
**Features:-**
|
88
|
-
|
89
|
-
- custom classname prefix for separate packages now supported.
|
90
|
-
- to use custom classnames for specific patterns, we use the following pattern in `app > customClassNamePrefix` or `docs > customClassNamePrefix` :
|
91
|
-
|
92
|
-
```
|
93
|
-
"customClassNamePrefix" : [
|
94
|
-
{
|
95
|
-
"enable": true,
|
96
|
-
"prefix": "[required-prefix]",
|
97
|
-
"patterns":[
|
98
|
-
"**/[path-name]/**/*.css"
|
99
|
-
]
|
100
|
-
}
|
101
|
-
]
|
102
|
-
```
|
103
|
-
|
104
|
-
For example,
|
105
|
-
|
106
|
-
```
|
107
|
-
"customClassNamePrefix": [
|
108
|
-
{
|
109
|
-
"enable": true,
|
110
|
-
"prefix": "zdSvg",
|
111
|
-
"patterns": [
|
112
|
-
"**/@zohodesk/svg/**/*.css"
|
113
|
-
]
|
114
|
-
},
|
115
|
-
],
|
116
|
-
```
|
117
|
-
|
118
|
-
**Issue Fix:**
|
119
|
-
|
120
|
-
- typo fix, (../src/common/runPreProcess.js) to (../lib/common/runPreProcess.js) in cli.js our code.
|
121
|
-
|
122
|
-
# 1.1.10 (2-8-2023)
|
123
|
-
|
124
|
-
**Issue Fix:**
|
125
|
-
|
126
|
-
- undefined plugin postcss issue fixed for docs.
|
127
|
-
- unnecessary deprecation warning stopped. (for exclude config)
|
128
|
-
|
129
|
-
# 1.1.9 (25-7-2023)
|
130
|
-
|
131
|
-
**Features:-**
|
132
|
-
|
133
|
-
- we have added config file support for react-cli schema. the default config file name `build.config.js` support added. In `build.config.js` you must export configuration object under `config` key. And Note: `build.config.js` is high priority then `package.json` `react-cli` config.
|
134
|
-
- added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
|
135
|
-
only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
|
136
|
-
- added support for pattern as function for custom chunks split logic.
|
137
|
-
- added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
|
138
|
-
- added `postCssPluginOrder` feature :
|
139
|
-
|
140
|
-
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "false", default plugin order will be followed.
|
141
|
-
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "true", order preserved in `plugins` Object will be considered.
|
142
|
-
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to an array with plugins in a custom order, the custom order will be considered.
|
143
|
-
|
144
|
-
- We use the same plugin names as in `patterns` for the plugins to execute successfully.
|
145
|
-
|
146
|
-
**Issue Fix**
|
147
|
-
|
148
|
-
- fixed file path separator issue with split chunks config for vendor exclude list for windows (that was work well for mac and ubuntu only issue in windows).
|
149
|
-
- fixed cssUniqueness pattern not working in docs.
|
150
|
-
|
151
|
-
**Changes**
|
152
|
-
|
153
|
-
- previously all custom chunks are enforce true, no we have given support for enforce false for chunks on splitChunks config.
|
154
|
-
|
155
|
-
# 1.1.8
|
156
|
-
|
157
|
-
**Issue Fix**
|
158
|
-
|
159
|
-
- Docs fix for Selector Replace 'always require argument' issue.
|
160
|
-
|
161
|
-
# 1.1.7
|
162
|
-
|
163
|
-
**Feature**
|
164
|
-
|
165
|
-
- Markdown parser feature added in docs
|
166
|
-
For more info please refer to :
|
167
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/MarkdownParser.md)
|
168
|
-
|
169
|
-
# 1.1.6-exp.2
|
170
|
-
|
171
|
-
- fixed file path separator issue with split chunks config for vendor exclude list.
|
172
|
-
- added support for not doing enforce true for chunks on splitChunks config.
|
173
|
-
|
174
|
-
# 1.1.5-exp.5
|
175
|
-
|
176
|
-
- fixed the issues regarding custom chunks base config schema.
|
177
|
-
|
178
|
-
# 1.1.5-exp.4
|
179
|
-
|
180
|
-
- added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
|
181
|
-
|
182
|
-
# 1.1.5-exp.3
|
183
|
-
|
184
|
-
- added options to split chunks base config
|
185
|
-
- added support for passing custom chunks split logic as function.
|
186
|
-
|
187
|
-
# 1.1.6
|
188
|
-
|
189
|
-
**Issue Fix**
|
190
|
-
|
191
|
-
- local install react-cli spawnSync Error fix in npm 8
|
192
|
-
- babel version update issue fix (Cannot read properties of undefined (reading 'file')) and (BABEL_TRANSFORM_ERROR)
|
193
|
-
|
194
|
-
# 1.1.5-exp.2
|
195
|
-
|
196
|
-
**Issue Fix**
|
197
|
-
|
198
|
-
- local install react-cli spawnSync Error fix in npm 8
|
199
|
-
|
200
|
-
# 1.1.5
|
201
|
-
|
202
|
-
**Issue Fix**
|
203
|
-
|
204
|
-
- include pattern fix for variable converter plugin fixed
|
205
|
-
|
206
|
-
# 1.1.4
|
207
|
-
|
208
|
-
**Issue Fix**
|
209
|
-
|
210
|
-
- global install react-cli spawnSync Error fix
|
211
|
-
- `0px` variable value conversion issue fixed
|
212
|
-
- pattern exclude for postcss plugins case fixed
|
213
|
-
|
214
|
-
# 1.1.3
|
215
|
-
|
216
|
-
**Issue Fix**
|
217
|
-
|
218
|
-
- local install react-cli spawnSync Error fix
|
219
|
-
|
220
|
-
# 1.1.2
|
221
|
-
|
222
|
-
**Issue Fix**
|
223
|
-
|
224
|
-
- ReactLiveConverter filepath changed to 'reactLiveConverter.js' in docLoader file
|
225
|
-
|
226
|
-
# 1.1.1
|
227
|
-
|
228
|
-
**Issue Fix**
|
229
|
-
|
230
|
-
- docs component name incorrect in windows, when using --enableReactLive issue fixed.
|
231
|
-
|
232
|
-
**Feature Update**
|
233
|
-
|
234
|
-
- Support for desk-library to use Selector Replace plugin using individual script. To use `react-cli selectorReplacer [source] [target]`
|
235
|
-
|
236
|
-
# 1.1.0
|
237
|
-
|
238
|
-
**Feature Update**
|
239
|
-
|
240
|
-
- Support for desk-library to use variable conversion plugin using individual script. To use `react-cli variableConverter [source] [target]`
|
241
|
-
- pattern filter changes, new filter system instead of exclude to include or exclude files for plugins.
|
242
|
-
For more info please refer to :
|
243
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/patternFiltering.md)
|
244
|
-
- React Live feature implemented for Docs.
|
245
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ReactLive.md)
|
246
|
-
|
247
|
-
# 1.0.3-beta.1
|
248
|
-
|
249
|
-
**Issue Fix**
|
250
|
-
|
251
|
-
- nock api not working issue fixed. This error throwing in @zohodesk/react-cli@1.0.2 version. but working in older versions ( 0.0.1-beta.178 )
|
252
|
-
|
253
|
-
# 1.0.3
|
254
|
-
|
255
|
-
**Feature Update**
|
256
|
-
|
257
|
-
- Support for global httpsCerts usage
|
258
|
-
- Support for global client_packages_group usage
|
259
|
-
- custom attribute for dynamically loading chunks, In this version we merged changes from [0.0.1-beta.167.1](#0.0.1-beta.167.1).
|
260
|
-
**Package Update**
|
261
|
-
- @zohodesk/client_packages_group@**1.0.1** ==> @zohodesk/client_packages_group@**1.0.2**
|
262
|
-
|
263
|
-
# 1.0.2
|
264
|
-
|
265
|
-
**Feature Update**
|
266
|
-
|
267
|
-
- Selector replace plugin made as a custom postcss-plugin with update to code that was unpublished in package.
|
268
|
-
|
269
|
-
# 1.0.1
|
270
|
-
|
271
|
-
**Issue Fix**
|
272
|
-
|
273
|
-
- variable conversion for px and var(--) values in same declaration was not supported, now it is supported.
|
274
|
-
- package-lock.json removed from `.npmignore`
|
275
|
-
|
276
|
-
**Feature Update**
|
277
|
-
|
278
|
-
- exclude added to Selector Plugin
|
279
|
-
|
280
|
-
# 1.0.0
|
281
|
-
|
282
|
-
## Major Release
|
283
|
-
|
284
|
-
**Changes:**
|
285
|
-
|
286
|
-
- File support added for `.webp` for `docs`, `dev` and `prod` mode
|
287
|
-
- File support added for `.webm` for `docs`, `dev` and `prod` mode
|
288
|
-
|
289
|
-
**Breaking Changes:**
|
290
|
-
|
291
|
-
- We have remove ssl certificate for security reasons.
|
292
|
-
So default https server won't run.
|
293
|
-
In order to make it work as before you need to specify two things
|
294
|
-
1. install `@zohodesk-private/client_dev_cert`
|
295
|
-
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
296
|
-
unless configaration are proper this may break `start` , `docs` , `nowatchstart`. and mock wms `/wmsmockapi` won't work.
|
297
|
-
So Please be carefull when you update this version or above without proper configaration.
|
298
47
|
|
299
48
|
# 0.0.1-beta.178
|
300
49
|
|
301
50
|
**Changes:**
|
302
51
|
|
303
52
|
- File support added for `.webp` for `docs`, `dev` and `prod` mode
|
53
|
+
- and this version has same as `0.0.1-exp.178.1`, `0.0.1-exp.178.2`
|
304
54
|
- File support added for `.webm` for `docs`, `dev` and `prod` mode
|
305
55
|
|
306
56
|
**Breaking Changes:**
|
307
57
|
|
308
|
-
- We have remove ssl certificate for security reasons.
|
309
|
-
So default https server won't run.
|
310
|
-
In order to make it work as before you
|
58
|
+
- We have remove ssl certificate for security reasons.
|
59
|
+
So default https server won't run.
|
60
|
+
In order to make it work as before you need to specify two things
|
311
61
|
1. install `@zohodesk-private/client_dev_cert`
|
312
|
-
2.
|
313
|
-
|
314
|
-
|
62
|
+
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
63
|
+
unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
|
64
|
+
So Please be carefull when you update this version or above without proper configaration.
|
315
65
|
|
316
66
|
# 0.0.1-exp.178.2
|
317
67
|
|
@@ -323,13 +73,13 @@ For example,
|
|
323
73
|
|
324
74
|
**Breaking Changes:**
|
325
75
|
|
326
|
-
- We have remove ssl certificate for security reasons.
|
327
|
-
So default https server won't run.
|
328
|
-
In order to make it work as before you
|
76
|
+
- We have remove ssl certificate for security reasons.
|
77
|
+
So default https server won't run.
|
78
|
+
In order to make it work as before you need to specify two things
|
329
79
|
1. install `@zohodesk-private/client_dev_cert`
|
330
|
-
2.
|
331
|
-
|
332
|
-
|
80
|
+
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
81
|
+
unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
|
82
|
+
So Please be carefull when you update this version or above without proper configaration.
|
333
83
|
|
334
84
|
# 0.0.1-beta.177
|
335
85
|
|
@@ -390,8 +140,8 @@ cli has been updated to fix compose issue faced when classname:hover exists and
|
|
390
140
|
|
391
141
|
**Feature:-**
|
392
142
|
|
393
|
-
- `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
394
|
-
|
143
|
+
- `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
144
|
+
`classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
|
395
145
|
|
396
146
|
**Changes:-**
|
397
147
|
|
@@ -410,7 +160,7 @@ For an more information and reference, refer to `[details](https://zgit.csez.zoh
|
|
410
160
|
|
411
161
|
# 0.0.1-beta.172
|
412
162
|
|
413
|
-
We have renamed some options, For Our future features convenience.
|
163
|
+
We have renamed some options, For Our future features convenience.
|
414
164
|
We have given fallback support.
|
415
165
|
Deprecation Warnings:-
|
416
166
|
|
@@ -486,11 +236,6 @@ Features:-
|
|
486
236
|
|
487
237
|
- In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
|
488
238
|
|
489
|
-
# 0.0.1-beta.167.1
|
490
|
-
|
491
|
-
In this version we merged changes from [0.0.1-betaa.138.1](#0.0.1-betaa.138.1).
|
492
|
-
and with [0.0.1-beta.167](#0.0.1-beta.167) version changes.
|
493
|
-
|
494
239
|
# 0.0.1-beta.167
|
495
240
|
|
496
241
|
SSL certificate update
|
@@ -752,12 +497,6 @@ impact servise related changes:-
|
|
752
497
|
- babel runtime plugin issue fix in prod config
|
753
498
|
- few enhancements
|
754
499
|
|
755
|
-
# 0.0.1-betaa.138.1
|
756
|
-
|
757
|
-
- new feature added for custom extra attribute for dynamically added tags by webpack.
|
758
|
-
- To enable this feature you need to enable "react-cli" => "app" => "customAttributes" => "enable"
|
759
|
-
- For more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/9eea8df14e55584b2114b5e484ca8b751a4ba191/src/plugins/CustomAttributePlugin.md)
|
760
|
-
|
761
500
|
# 0.0.1-beta.138
|
762
501
|
|
763
502
|
- sstest library version updated
|
@@ -1396,7 +1135,3 @@ impact servise related changes:-
|
|
1396
1135
|
- prod string error fix
|
1397
1136
|
- efc build support
|
1398
1137
|
- single style tag support
|
1399
|
-
|
1400
|
-
```
|
1401
|
-
|
1402
|
-
```
|
package/bin/cli.js
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
|
3
3
|
const path = require('path');
|
4
|
-
const {
|
5
|
-
const
|
4
|
+
const { existsSync } = require('fs');
|
5
|
+
const { spawnSync: _spawnSync, spawn } = require('child_process');
|
6
|
+
const { getOptions } = require('../lib/utils/index.js');
|
6
7
|
|
7
|
-
const { log } = require('../lib/utils
|
8
|
+
const { log } = require('../lib/utils');
|
8
9
|
const { getCliPath } = require('../lib/servers/getCliPath.js');
|
9
|
-
const { runPreProcess } = require('../lib/common/runPreProcess.js');
|
10
10
|
//initPreCommitHook();
|
11
11
|
|
12
|
-
const
|
13
|
-
const args = process.argv.slice(3);
|
14
|
-
const appPath = process.cwd();
|
15
|
-
|
16
|
-
const options = getOptions({ start: true, build: true, docs: true }[option]);
|
12
|
+
const options = getOptions();
|
17
13
|
|
18
14
|
function spawnSync(...args) {
|
19
15
|
const result = _spawnSync(...args);
|
@@ -24,6 +20,7 @@ function spawnSync(...args) {
|
|
24
20
|
}
|
25
21
|
|
26
22
|
const { esLint: esLintOptions } = options || {};
|
23
|
+
const { preprocess } = options;
|
27
24
|
const {
|
28
25
|
ignoreFilePaths: esLintIgnorePaths,
|
29
26
|
fix: esLintFix,
|
@@ -31,6 +28,10 @@ const {
|
|
31
28
|
reportPath: reportPath
|
32
29
|
} = esLintOptions || {};
|
33
30
|
|
31
|
+
const [, , option] = process.argv;
|
32
|
+
const args = process.argv.slice(3);
|
33
|
+
const appPath = process.cwd();
|
34
|
+
|
34
35
|
const webpack = getCliPath('webpack');
|
35
36
|
|
36
37
|
const nodemon = getCliPath('nodemon');
|
@@ -38,10 +39,49 @@ const babel = getCliPath('babel');
|
|
38
39
|
const propertyToJson = getCliPath('propertyToJson');
|
39
40
|
const esLint = getCliPath('eslint');
|
40
41
|
|
41
|
-
|
42
|
+
const preprocesserPath = preprocess.runner
|
43
|
+
? path.join(process.cwd(), preprocess.runner)
|
44
|
+
: '';
|
45
|
+
const preprocessCli = preprocess.stopNodemon ? 'node' : nodemon;
|
46
|
+
if (preprocesserPath && existsSync(preprocesserPath)) {
|
47
|
+
// eslint-disable-next-line default-case
|
48
|
+
switch (option) {
|
49
|
+
case 'start':
|
50
|
+
case 'docs':
|
51
|
+
spawn(preprocessCli, [preprocesserPath], {
|
52
|
+
stdio: 'inherit',
|
53
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
54
|
+
});
|
55
|
+
// NOTE: it's ok if we not close this here
|
56
|
+
// Because when node server stops this program willbe closed So this nodemon will be killed as well
|
57
|
+
break;
|
58
|
+
case 'nowatchstart':
|
59
|
+
case 'devbuild':
|
60
|
+
case 'build:library:es':
|
61
|
+
case 'build:component:es':
|
62
|
+
case 'build:library:cmjs':
|
63
|
+
case 'build:component:cmjs':
|
64
|
+
spawnSync('node', [preprocesserPath], {
|
65
|
+
stdio: 'inherit',
|
66
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
67
|
+
});
|
68
|
+
break;
|
69
|
+
}
|
70
|
+
}
|
42
71
|
|
43
72
|
let result;
|
44
73
|
switch (option) {
|
74
|
+
case 'preprocessor':
|
75
|
+
if (preprocesserPath && existsSync(preprocesserPath)) {
|
76
|
+
result = spawnSync(preprocessCli, [preprocesserPath], {
|
77
|
+
stdio: 'inherit',
|
78
|
+
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
79
|
+
});
|
80
|
+
process.exit(result.status);
|
81
|
+
} else {
|
82
|
+
console.error(`preProcessor not exists ${preprocesserPath}`);
|
83
|
+
}
|
84
|
+
break;
|
45
85
|
case 'lint-setup': {
|
46
86
|
result = spawnSync(
|
47
87
|
'node',
|
@@ -76,22 +116,6 @@ switch (option) {
|
|
76
116
|
{ stdio: 'inherit' }
|
77
117
|
);
|
78
118
|
|
79
|
-
process.exit(result.status);
|
80
|
-
break;
|
81
|
-
case 'variableConverter':
|
82
|
-
result = spawnSync(
|
83
|
-
'node',
|
84
|
-
[require.resolve('../lib/utils/variableConverter')].concat(args),
|
85
|
-
{ stdio: 'inherit' }
|
86
|
-
);
|
87
|
-
process.exit(result.status);
|
88
|
-
break;
|
89
|
-
case 'selectorReplacer':
|
90
|
-
result = spawnSync(
|
91
|
-
'node',
|
92
|
-
[require.resolve('../lib/utils/selectorReplacer.js')].concat(args),
|
93
|
-
{ stdio: 'inherit' }
|
94
|
-
);
|
95
119
|
process.exit(result.status);
|
96
120
|
break;
|
97
121
|
case 'valuereplacer':
|
@@ -191,7 +215,9 @@ switch (option) {
|
|
191
215
|
case 'devbuild':
|
192
216
|
result = spawnSync(
|
193
217
|
'node',
|
194
|
-
[
|
218
|
+
[
|
219
|
+
require.resolve('../lib/servers/devBuild')
|
220
|
+
].concat(args),
|
195
221
|
// [require.resolve('../lib/servers/staticServer'), '--expose-http2'].concat(args),
|
196
222
|
{ stdio: 'inherit' }
|
197
223
|
);
|
@@ -230,7 +256,7 @@ switch (option) {
|
|
230
256
|
require.resolve('../lib/servers/mockserver.js'),
|
231
257
|
'--delay',
|
232
258
|
'2500ms',
|
233
|
-
'
|
259
|
+
'watch',
|
234
260
|
`${appPath + path.sep}mockapi`
|
235
261
|
].concat(args),
|
236
262
|
{ stdio: 'inherit' }
|
@@ -437,9 +463,8 @@ switch (option) {
|
|
437
463
|
case '--v':
|
438
464
|
case '-v':
|
439
465
|
log(`@zohodesk/react-cli v${require('../package.json').version}`);
|
440
|
-
log(`Node Js Version : ${process.version}`);
|
441
|
-
log(`Npm Version : ${execSync('npm --version')}`);
|
442
466
|
break;
|
467
|
+
|
443
468
|
default:
|
444
469
|
log(`react-cli > Unknown option "${option}"`);
|
445
470
|
log('react-cli app <appName>');
|
package/docs/CustomChunks.md
CHANGED
@@ -4,26 +4,23 @@ In react-cli we provide options to create custom chunks.
|
|
4
4
|
This Custom Chunk Option is array of Object
|
5
5
|
that Object keys are
|
6
6
|
|
7
|
-
- `pattern`
|
8
|
-
- `name`
|
9
|
-
- `size`
|
7
|
+
- `pattern` regex pattern as string
|
8
|
+
- `name` chunk name
|
9
|
+
- `size` is count which is minmum chunk dublicated or need in chunks
|
10
10
|
|
11
11
|
> Since 0.0.1-exp.164.1
|
12
12
|
|
13
13
|
extra features in custom chunks :-
|
14
14
|
for more details [SplitChunkPlugin](https://webpack.js.org/plugins/split-chunks-plugin/) webpack
|
15
15
|
|
16
|
-
- `minChunks`: `minChunks` is
|
17
|
-
- `rules`: `rules` is same as `pattern` with some easy hooks
|
16
|
+
- `minChunks`: `minChunks` is alies of `size` default value is `2`,
|
17
|
+
- `rules`: `rules` is same as `pattern` with some easy hooks
|
18
18
|
- use `/` for both windows and linux we will replace internally
|
19
19
|
- for `.*` we need to use `*`
|
20
20
|
- we can consider rules as regex when the `rules-string` has any of these `*`, `^`, `$`. So if you want regex then kindly use `*` in your `rules-string` for force regex
|
21
21
|
- `chunks`: by this option we can specify , default value is `all`,
|
22
22
|
- `priority`: priority default value is `-10 * (index + 2)`,
|
23
|
-
- `enforce`: enforce default value is
|
24
|
-
- `maxSize`: maxSize, default value is
|
25
|
-
- `minSize`: minSize, default value is
|
26
|
-
|
27
|
-
- `automaticNamePrefix` with this you can specify for chunks created through that specified config. default value `''`.
|
28
|
-
- `cacheGroupName`: `cacheGroupName` is alias of `name`, But it won't work as chunk name, instead it will just work as key in cacheGroup.
|
29
|
-
<!-- includeDependency: includeDependency default value is `false` -->
|
23
|
+
- `enforce`: enforce default value is true,
|
24
|
+
- `maxSize`: maxSize, default value is 0,
|
25
|
+
- `minSize`: minSize, default value is 20000,
|
26
|
+
includeDepenency: includeDepenency default value is false
|
package/docs/SelectorWeight.md
CHANGED
@@ -4,6 +4,3 @@
|
|
4
4
|
* all classes in all files will be added with the `defaultSelector` provided in package.json to increase selector weight
|
5
5
|
* in case a specific chunk file is supposed to have a different selector, it can be mentioned in the `customFileSelectorWeight.json`. This will add the new selector to that particular chunk file.
|
6
6
|
* `excludeStrings` is an array used to exclude selectors that should not be converted. Default selectors such as body, html are excluded through this way.
|
7
|
-
|
8
|
-
# v1.0.1 update:
|
9
|
-
* exclude support added, file paths to be added in `react-cli > app > exclude > selectorWeight` to be excluded from conversion.
|
package/docs/ValueReplacer.md
CHANGED
@@ -58,30 +58,3 @@ new option `valueReplacer` added for replace css property value while build runn
|
|
58
58
|
font: zdf-rCallBar_1 !important;
|
59
59
|
}
|
60
60
|
```
|
61
|
-
|
62
|
-
|
63
|
-
If we need the exact word to be considered for replacement ( that is, if value is `text` and only if the value is `text` and not `text_cursor` or `cursortext` for example, the conversion happens ) we have to use `^` before the word and `$` after the word in the key.
|
64
|
-
|
65
|
-
# For Example :
|
66
|
-
{
|
67
|
-
valueReplacer: [
|
68
|
-
{
|
69
|
-
"props": [
|
70
|
-
"cursor",
|
71
|
-
"--label_cursor",
|
72
|
-
"--checkbox_cursor",
|
73
|
-
"--tag_cursor",
|
74
|
-
"--button_cursor",
|
75
|
-
"--textboxicon_icon_cursor",
|
76
|
-
],
|
77
|
-
"values": {
|
78
|
-
"^default$": "var(--zdr-cursor-default)",
|
79
|
-
"^pointer$": "var(--zdr-cursor-pointer)",
|
80
|
-
"^text$": "var(--zdr-cursor-text)",
|
81
|
-
"^move$": "var(--zdr-cursor-move)",
|
82
|
-
}
|
83
|
-
}
|
84
|
-
]
|
85
|
-
}
|
86
|
-
|
87
|
-
- Here we have added `^` before and `$` after default, pointer, text and move. Only if the exact words default, pointer, text and move are used, the values will be converted.
|
@@ -4,13 +4,8 @@
|
|
4
4
|
|
5
5
|
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
|
6
6
|
|
7
|
-
|
8
|
-
**Issue Fix**
|
9
|
-
# Issue fix done in `1.0.1`
|
10
|
-
- variable conversion for px and var(--) values in same declaration was not supported, now it is supported.
|
11
|
-
|
12
7
|
**Features:**
|
13
|
-
# Features below are added
|
8
|
+
# Features below are added form `0.0.1-beta.173`
|
14
9
|
1. variables are converted from px to custom variables ( options are consumed from `cssVariableReplacementOptions.json` present in source folder )
|
15
10
|
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 )
|
16
11
|
3. To enable the console display of errors that are generated, `errorInConsole` is to be made `true` in `cssVariableReplacementOptions.json`
|