@zohodesk/react-cli 1.1.9 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- package/.vscode/settings.json +25 -0
- package/README.md +121 -43
- package/bin/cli.js +5 -48
- package/lib/common/runPreProcess.js +71 -0
- package/lib/configs/webpack.css.umd.config.js +3 -2
- package/lib/configs/webpack.dev.config.js +3 -0
- package/lib/configs/webpack.docs.config.js +2 -0
- package/lib/configs/webpack.impact.config.js +2 -0
- package/lib/configs/webpack.prod.config.js +3 -0
- package/lib/deprecationLogger.js +0 -1
- package/lib/loaderUtils/getCSSLoaders.js +4 -3
- package/lib/logger.js +7 -0
- package/lib/plugins/utils/fileHandling.js +13 -13
- package/lib/schemas/index.js +2 -1
- package/lib/utils/cssClassNameGenerate.js +38 -5
- package/lib/utils/deprecationSupport.js +7 -1
- package/lib/utils/getOptions.js +16 -1
- package/npm-shrinkwrap.json +94 -2
- package/package.json +2 -2
- package/templates/docs/css/style.css +136 -169
- package/templates/docs/index.html +795 -632
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"cSpell.words": [
|
3
|
+
"classname",
|
4
|
+
"cmjs",
|
5
|
+
"devbuild",
|
6
|
+
"escodegen",
|
7
|
+
"expublish",
|
8
|
+
"gitclone",
|
9
|
+
"hgclone",
|
10
|
+
"mockapi",
|
11
|
+
"mockserver",
|
12
|
+
"nowatchserver",
|
13
|
+
"nowatchstart",
|
14
|
+
"postpublish",
|
15
|
+
"propertytojson",
|
16
|
+
"sslcert",
|
17
|
+
"sslcertupdate",
|
18
|
+
"sstest",
|
19
|
+
"uglifycss",
|
20
|
+
"valuereplacer",
|
21
|
+
"xmlhttprequest",
|
22
|
+
"zohodesk",
|
23
|
+
"zsecurity"
|
24
|
+
]
|
25
|
+
}
|
package/README.md
CHANGED
@@ -43,6 +43,58 @@ Now to run app
|
|
43
43
|
---
|
44
44
|
|
45
45
|
# Change Logs
|
46
|
+
|
47
|
+
# 1.1.11 (4-8-2023)
|
48
|
+
|
49
|
+
**Changes**
|
50
|
+
|
51
|
+
- 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.
|
52
|
+
|
53
|
+
- Prop-type, Prop description, Default Props support for docs given.
|
54
|
+
- Docs and Docs_Code UI updated.
|
55
|
+
|
56
|
+
**Features:-**
|
57
|
+
|
58
|
+
- custom classname prefix for separate packages now supported.
|
59
|
+
- to use custom classnames for specific patterns, we use the following pattern in `app > customClassNamePrefix` or `docs > customClassNamePrefix` :
|
60
|
+
|
61
|
+
```
|
62
|
+
"customClassNamePrefix" : [
|
63
|
+
{
|
64
|
+
"enable": true,
|
65
|
+
"prefix": "[required-prefix]",
|
66
|
+
"patterns":[
|
67
|
+
"**/[path-name]/**/*.css"
|
68
|
+
]
|
69
|
+
}
|
70
|
+
]
|
71
|
+
```
|
72
|
+
|
73
|
+
For example,
|
74
|
+
|
75
|
+
```
|
76
|
+
"customClassNamePrefix": [
|
77
|
+
{
|
78
|
+
"enable": true,
|
79
|
+
"prefix": "zdSvg",
|
80
|
+
"patterns": [
|
81
|
+
"**/@zohodesk/svg/**/*.css"
|
82
|
+
]
|
83
|
+
},
|
84
|
+
],
|
85
|
+
```
|
86
|
+
|
87
|
+
**Issue Fix:**
|
88
|
+
|
89
|
+
- typo fix, (../src/common/runPreProcess.js) to (../lib/common/runPreProcess.js) in cli.js our code.
|
90
|
+
|
91
|
+
# 1.1.10 (2-8-2023)
|
92
|
+
|
93
|
+
**Issue Fix:**
|
94
|
+
|
95
|
+
- undefined plugin postcss issue fixed for docs.
|
96
|
+
- unnecessary deprecation warning stopped. (for exclude config)
|
97
|
+
|
46
98
|
# 1.1.9 (25-7-2023)
|
47
99
|
|
48
100
|
**Features:-**
|
@@ -53,55 +105,65 @@ Now to run app
|
|
53
105
|
- added support for pattern as function for custom chunks split logic.
|
54
106
|
- added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
|
55
107
|
- added `postCssPluginOrder` feature :
|
108
|
+
|
56
109
|
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "false", default plugin order will be followed.
|
57
|
-
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "true", order preserved in `plugins`
|
110
|
+
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "true", order preserved in `plugins` Object will be considered.
|
58
111
|
- If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to an array with plugins in a custom order, the custom order will be considered.
|
59
112
|
|
60
|
-
- We use the same plugin names as in `patterns` for the plugins to execute successfully.
|
61
|
-
|
113
|
+
- We use the same plugin names as in `patterns` for the plugins to execute successfully.
|
62
114
|
|
63
115
|
**Issue Fix**
|
116
|
+
|
64
117
|
- 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).
|
65
118
|
- fixed cssUniqueness pattern not working in docs.
|
66
119
|
|
67
120
|
**Changes**
|
121
|
+
|
68
122
|
- previously all custom chunks are enforce true, no we have given support for enforce false for chunks on splitChunks config.
|
69
123
|
|
70
124
|
# 1.1.8
|
71
125
|
|
72
126
|
**Issue Fix**
|
73
|
-
|
127
|
+
|
128
|
+
- Docs fix for Selector Replace 'always require argument' issue.
|
74
129
|
|
75
130
|
# 1.1.7
|
76
131
|
|
77
132
|
**Feature**
|
78
|
-
- Markdown parser feature added in docs
|
79
|
-
For more info please refer to :
|
80
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/MarkdownParser.md)
|
81
133
|
|
134
|
+
- Markdown parser feature added in docs
|
135
|
+
For more info please refer to :
|
136
|
+
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/MarkdownParser.md)
|
82
137
|
|
83
138
|
# 1.1.6-exp.2
|
139
|
+
|
84
140
|
- fixed file path separator issue with split chunks config for vendor exclude list.
|
85
|
-
- added support for not doing enforce true for chunks on
|
141
|
+
- added support for not doing enforce true for chunks on splitChunks config.
|
86
142
|
|
87
143
|
# 1.1.5-exp.5
|
144
|
+
|
88
145
|
- fixed the issues regarding custom chunks base config schema.
|
89
146
|
|
90
147
|
# 1.1.5-exp.4
|
148
|
+
|
91
149
|
- added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
|
92
150
|
|
93
151
|
# 1.1.5-exp.3
|
152
|
+
|
94
153
|
- added options to split chunks base config
|
95
154
|
- added support for passing custom chunks split logic as function.
|
155
|
+
|
96
156
|
# 1.1.6
|
97
157
|
|
98
158
|
**Issue Fix**
|
159
|
+
|
99
160
|
- local install react-cli spawnSync Error fix in npm 8
|
100
161
|
- babel version update issue fix (Cannot read properties of undefined (reading 'file')) and (BABEL_TRANSFORM_ERROR)
|
101
162
|
|
102
163
|
# 1.1.5-exp.2
|
103
164
|
|
104
165
|
**Issue Fix**
|
166
|
+
|
105
167
|
- local install react-cli spawnSync Error fix in npm 8
|
106
168
|
|
107
169
|
# 1.1.5
|
@@ -113,6 +175,7 @@ For more info please refer to :
|
|
113
175
|
# 1.1.4
|
114
176
|
|
115
177
|
**Issue Fix**
|
178
|
+
|
116
179
|
- global install react-cli spawnSync Error fix
|
117
180
|
- `0px` variable value conversion issue fixed
|
118
181
|
- pattern exclude for postcss plugins case fixed
|
@@ -120,6 +183,7 @@ For more info please refer to :
|
|
120
183
|
# 1.1.3
|
121
184
|
|
122
185
|
**Issue Fix**
|
186
|
+
|
123
187
|
- local install react-cli spawnSync Error fix
|
124
188
|
|
125
189
|
# 1.1.2
|
@@ -131,67 +195,75 @@ For more info please refer to :
|
|
131
195
|
# 1.1.1
|
132
196
|
|
133
197
|
**Issue Fix**
|
198
|
+
|
134
199
|
- docs component name incorrect in windows, when using --enableReactLive issue fixed.
|
135
200
|
|
136
|
-
**Feature Update**
|
201
|
+
**Feature Update**
|
202
|
+
|
137
203
|
- Support for desk-library to use Selector Replace plugin using individual script. To use `react-cli selectorReplacer [source] [target]`
|
138
204
|
|
139
205
|
# 1.1.0
|
140
206
|
|
141
207
|
**Feature Update**
|
142
|
-
|
208
|
+
|
209
|
+
- Support for desk-library to use variable conversion plugin using individual script. To use `react-cli variableConverter [source] [target]`
|
143
210
|
- pattern filter changes, new filter system instead of exclude to include or exclude files for plugins.
|
144
|
-
For more info please refer to :
|
145
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/patternFiltering.md)
|
211
|
+
For more info please refer to :
|
212
|
+
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/patternFiltering.md)
|
146
213
|
- React Live feature implemented for Docs.
|
147
|
-
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ReactLive.md)
|
214
|
+
[details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ReactLive.md)
|
148
215
|
|
149
216
|
# 1.0.3-beta.1
|
150
217
|
|
151
218
|
**Issue Fix**
|
152
|
-
- 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 )
|
153
219
|
|
220
|
+
- 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 )
|
154
221
|
|
155
222
|
# 1.0.3
|
156
223
|
|
157
224
|
**Feature Update**
|
225
|
+
|
158
226
|
- Support for global httpsCerts usage
|
159
227
|
- Support for global client_packages_group usage
|
160
|
-
- 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).
|
161
|
-
**Package Update**
|
162
|
-
- @zohodesk/client_packages_group@**1.0.1** ==>
|
163
|
-
|
164
|
-
|
228
|
+
- 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).
|
229
|
+
**Package Update**
|
230
|
+
- @zohodesk/client_packages_group@**1.0.1** ==> @zohodesk/client_packages_group@**1.0.2**
|
165
231
|
|
166
232
|
# 1.0.2
|
167
233
|
|
168
234
|
**Feature Update**
|
235
|
+
|
169
236
|
- Selector replace plugin made as a custom postcss-plugin with update to code that was unpublished in package.
|
170
237
|
|
171
238
|
# 1.0.1
|
172
239
|
|
173
240
|
**Issue Fix**
|
241
|
+
|
174
242
|
- variable conversion for px and var(--) values in same declaration was not supported, now it is supported.
|
175
243
|
- package-lock.json removed from `.npmignore`
|
176
244
|
|
177
245
|
**Feature Update**
|
246
|
+
|
178
247
|
- exclude added to Selector Plugin
|
248
|
+
|
179
249
|
# 1.0.0
|
250
|
+
|
180
251
|
## Major Release
|
252
|
+
|
181
253
|
**Changes:**
|
254
|
+
|
182
255
|
- File support added for `.webp` for `docs`, `dev` and `prod` mode
|
183
256
|
- File support added for `.webm` for `docs`, `dev` and `prod` mode
|
184
257
|
|
185
258
|
**Breaking Changes:**
|
186
259
|
|
187
|
-
- We have remove ssl certificate for security reasons.
|
188
|
-
So default https server won't run.
|
189
|
-
In order to make it work as before you
|
260
|
+
- We have remove ssl certificate for security reasons.
|
261
|
+
So default https server won't run.
|
262
|
+
In order to make it work as before you need to specify two things
|
190
263
|
1. install `@zohodesk-private/client_dev_cert`
|
191
|
-
2.
|
192
|
-
|
193
|
-
|
194
|
-
|
264
|
+
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
265
|
+
unless configaration are proper this may break `start` , `docs` , `nowatchstart`. and mock wms `/wmsmockapi` won't work.
|
266
|
+
So Please be carefull when you update this version or above without proper configaration.
|
195
267
|
|
196
268
|
# 0.0.1-beta.178
|
197
269
|
|
@@ -202,13 +274,13 @@ For more info please refer to :
|
|
202
274
|
|
203
275
|
**Breaking Changes:**
|
204
276
|
|
205
|
-
- We have remove ssl certificate for security reasons.
|
206
|
-
So default https server won't run.
|
207
|
-
In order to make it work as before you
|
277
|
+
- We have remove ssl certificate for security reasons.
|
278
|
+
So default https server won't run.
|
279
|
+
In order to make it work as before you need to specify two things
|
208
280
|
1. install `@zohodesk-private/client_dev_cert`
|
209
|
-
2.
|
210
|
-
|
211
|
-
|
281
|
+
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
282
|
+
unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
|
283
|
+
So Please be carefull when you update this version or above without proper configaration.
|
212
284
|
|
213
285
|
# 0.0.1-exp.178.2
|
214
286
|
|
@@ -220,13 +292,13 @@ For more info please refer to :
|
|
220
292
|
|
221
293
|
**Breaking Changes:**
|
222
294
|
|
223
|
-
- We have remove ssl certificate for security reasons.
|
224
|
-
So default https server won't run.
|
225
|
-
In order to make it work as before you
|
295
|
+
- We have remove ssl certificate for security reasons.
|
296
|
+
So default https server won't run.
|
297
|
+
In order to make it work as before you need to specify two things
|
226
298
|
1. install `@zohodesk-private/client_dev_cert`
|
227
|
-
2.
|
228
|
-
|
229
|
-
|
299
|
+
2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
|
300
|
+
unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
|
301
|
+
So Please be carefull when you update this version or above without proper configaration.
|
230
302
|
|
231
303
|
# 0.0.1-beta.177
|
232
304
|
|
@@ -287,8 +359,8 @@ cli has been updated to fix compose issue faced when classname:hover exists and
|
|
287
359
|
|
288
360
|
**Feature:-**
|
289
361
|
|
290
|
-
- `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
291
|
-
|
362
|
+
- `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
|
363
|
+
`classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
|
292
364
|
|
293
365
|
**Changes:-**
|
294
366
|
|
@@ -307,7 +379,7 @@ For an more information and reference, refer to `[details](https://zgit.csez.zoh
|
|
307
379
|
|
308
380
|
# 0.0.1-beta.172
|
309
381
|
|
310
|
-
We have renamed some options, For Our future features convenience.
|
382
|
+
We have renamed some options, For Our future features convenience.
|
311
383
|
We have given fallback support.
|
312
384
|
Deprecation Warnings:-
|
313
385
|
|
@@ -384,8 +456,9 @@ Features:-
|
|
384
456
|
- In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
|
385
457
|
|
386
458
|
# 0.0.1-beta.167.1
|
387
|
-
|
388
|
-
|
459
|
+
|
460
|
+
In this version we merged changes from [0.0.1-betaa.138.1](#0.0.1-betaa.138.1).
|
461
|
+
and with [0.0.1-beta.167](#0.0.1-beta.167) version changes.
|
389
462
|
|
390
463
|
# 0.0.1-beta.167
|
391
464
|
|
@@ -649,6 +722,7 @@ impact servise related changes:-
|
|
649
722
|
- few enhancements
|
650
723
|
|
651
724
|
# 0.0.1-betaa.138.1
|
725
|
+
|
652
726
|
- new feature added for custom extra attribute for dynamically added tags by webpack.
|
653
727
|
- To enable this feature you need to enable "react-cli" => "app" => "customAttributes" => "enable"
|
654
728
|
- For more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/9eea8df14e55584b2114b5e484ca8b751a4ba191/src/plugins/CustomAttributePlugin.md)
|
@@ -1291,3 +1365,7 @@ impact servise related changes:-
|
|
1291
1365
|
- prod string error fix
|
1292
1366
|
- efc build support
|
1293
1367
|
- single style tag support
|
1368
|
+
|
1369
|
+
```
|
1370
|
+
|
1371
|
+
```
|
package/bin/cli.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
|
3
3
|
const path = require('path');
|
4
|
-
const {
|
5
|
-
const { spawnSync: _spawnSync, spawn } = require('child_process');
|
4
|
+
const { spawnSync: _spawnSync, execSync } = require('child_process');
|
6
5
|
const getOptions = require('../lib/utils/getOptions.js').default;
|
7
6
|
|
8
7
|
const { log } = require('../lib/utils/log.js');
|
9
8
|
const { getCliPath } = require('../lib/servers/getCliPath.js');
|
9
|
+
const { runPreProcess } = require('../lib/common/runPreProcess.js');
|
10
10
|
//initPreCommitHook();
|
11
11
|
|
12
12
|
const [, , option] = process.argv;
|
@@ -24,7 +24,6 @@ function spawnSync(...args) {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
const { esLint: esLintOptions } = options || {};
|
27
|
-
const { preprocess } = options;
|
28
27
|
const {
|
29
28
|
ignoreFilePaths: esLintIgnorePaths,
|
30
29
|
fix: esLintFix,
|
@@ -39,53 +38,10 @@ const babel = getCliPath('babel');
|
|
39
38
|
const propertyToJson = getCliPath('propertyToJson');
|
40
39
|
const esLint = getCliPath('eslint');
|
41
40
|
|
42
|
-
|
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(
|
52
|
-
preprocessCli,
|
53
|
-
[preprocesserPath, '--watch', path.parse(preprocesserPath).dir],
|
54
|
-
{
|
55
|
-
stdio: 'inherit',
|
56
|
-
cwd: path.parse(preprocesserPath).dir
|
57
|
-
}
|
58
|
-
);
|
59
|
-
// NOTE: it's ok if we not close this here
|
60
|
-
// Because when node server stops this program willbe closed So this nodemon will be killed as well
|
61
|
-
break;
|
62
|
-
case 'nowatchstart':
|
63
|
-
case 'devbuild':
|
64
|
-
case 'build:library:es':
|
65
|
-
case 'build:component:es':
|
66
|
-
case 'build:library:cmjs':
|
67
|
-
case 'build:component:cmjs':
|
68
|
-
spawnSync('node', [preprocesserPath], {
|
69
|
-
stdio: 'inherit',
|
70
|
-
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
71
|
-
});
|
72
|
-
break;
|
73
|
-
}
|
74
|
-
}
|
41
|
+
runPreProcess({ options, option, nodemon, spawnSync });
|
75
42
|
|
76
43
|
let result;
|
77
44
|
switch (option) {
|
78
|
-
case 'preprocessor':
|
79
|
-
if (preprocesserPath && existsSync(preprocesserPath)) {
|
80
|
-
result = spawnSync(preprocessCli, [preprocesserPath], {
|
81
|
-
stdio: 'inherit',
|
82
|
-
cwd: preprocesserPath.slice(0, preprocesserPath.lastIndexOf('/') + 1)
|
83
|
-
});
|
84
|
-
process.exit(result.status);
|
85
|
-
} else {
|
86
|
-
console.error(`preProcessor not exists ${preprocesserPath}`);
|
87
|
-
}
|
88
|
-
break;
|
89
45
|
case 'lint-setup': {
|
90
46
|
result = spawnSync(
|
91
47
|
'node',
|
@@ -481,8 +437,9 @@ switch (option) {
|
|
481
437
|
case '--v':
|
482
438
|
case '-v':
|
483
439
|
log(`@zohodesk/react-cli v${require('../package.json').version}`);
|
440
|
+
log(`Node Js Version : ${process.version}`);
|
441
|
+
log(`Npm Version : ${execSync('npm --version')}`);
|
484
442
|
break;
|
485
|
-
|
486
443
|
default:
|
487
444
|
log(`react-cli > Unknown option "${option}"`);
|
488
445
|
log('react-cli app <appName>');
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.runPreProcess = runPreProcess;
|
7
|
+
|
8
|
+
var _path = _interopRequireWildcard(require("path"));
|
9
|
+
|
10
|
+
var _fs = require("fs");
|
11
|
+
|
12
|
+
var _child_process = require("child_process");
|
13
|
+
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
|
+
|
16
|
+
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; }
|
17
|
+
|
18
|
+
function runPreProcess({
|
19
|
+
options,
|
20
|
+
option,
|
21
|
+
nodemon,
|
22
|
+
spawnSync
|
23
|
+
}) {
|
24
|
+
const {
|
25
|
+
preprocess
|
26
|
+
} = options;
|
27
|
+
const preprocessorPath = preprocess.runner ? _path.default.join(process.cwd(), preprocess.runner) : '';
|
28
|
+
const preprocessCli = preprocess.stopNodemon ? 'node' : nodemon;
|
29
|
+
|
30
|
+
if (preprocessorPath && (0, _fs.existsSync)(preprocessorPath)) {
|
31
|
+
const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
|
32
|
+
const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : []; // eslint-disable-next-line default-case
|
33
|
+
|
34
|
+
switch (option) {
|
35
|
+
case 'start':
|
36
|
+
case 'docs':
|
37
|
+
(0, _child_process.spawn)(preprocessCli, [preprocessorPath, ...watchOptions], {
|
38
|
+
stdio: 'inherit',
|
39
|
+
cwd: preprocessorDirPath
|
40
|
+
}); // NOTE: it's ok if we not close this here
|
41
|
+
// Because when node server stops this program will be closed So this nodemon will be killed as well
|
42
|
+
|
43
|
+
break;
|
44
|
+
|
45
|
+
case 'nowatchstart':
|
46
|
+
case 'devbuild':
|
47
|
+
case 'build:library:es':
|
48
|
+
case 'build:component:es':
|
49
|
+
case 'build:library:cmjs':
|
50
|
+
case 'build:component:cmjs':
|
51
|
+
spawnSync('node', [preprocessorPath], {
|
52
|
+
stdio: 'inherit',
|
53
|
+
cwd: preprocessorPath.slice(0, preprocessorPath.lastIndexOf('/') + 1)
|
54
|
+
});
|
55
|
+
break;
|
56
|
+
|
57
|
+
case 'preprocessor':
|
58
|
+
{
|
59
|
+
const result = spawnSync(preprocessCli, [preprocessorPath, ...watchOptions], {
|
60
|
+
stdio: 'inherit',
|
61
|
+
cwd: preprocessorDirPath
|
62
|
+
});
|
63
|
+
process.exit(result.status);
|
64
|
+
break;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
} else if (option === 'preprocess') {
|
68
|
+
console.error(`preProcessor not exists ${preprocessorPath}`);
|
69
|
+
process.exit(0);
|
70
|
+
}
|
71
|
+
}
|
@@ -23,7 +23,8 @@ let {
|
|
23
23
|
folder,
|
24
24
|
publicPath,
|
25
25
|
cssHashSelectors,
|
26
|
-
classNamePrefix
|
26
|
+
classNamePrefix,
|
27
|
+
customClassNamePrefix
|
27
28
|
}
|
28
29
|
},
|
29
30
|
packageVersion
|
@@ -83,7 +84,7 @@ module.exports = {
|
|
83
84
|
loader: 'css-loader',
|
84
85
|
options: {
|
85
86
|
modules: {
|
86
|
-
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix)
|
87
|
+
getLocalIdent: (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix, customClassNamePrefix)
|
87
88
|
}
|
88
89
|
}
|
89
90
|
}]
|
@@ -30,6 +30,7 @@ const {
|
|
30
30
|
cssVariableReplacementConfig,
|
31
31
|
selectorWeightConfig,
|
32
32
|
cssUniqueness,
|
33
|
+
customClassNamePrefix,
|
33
34
|
seperateCssModules,
|
34
35
|
changeRuntimeChunkChar,
|
35
36
|
// we are going to use this for fonts file name collide in issue in devmode
|
@@ -108,6 +109,7 @@ module.exports = {
|
|
108
109
|
mediaQueryHoverActiveString,
|
109
110
|
cssVariableReplacementConfig,
|
110
111
|
selectorWeightConfig,
|
112
|
+
customClassNamePrefix,
|
111
113
|
classNameBlob: '[local]',
|
112
114
|
cssUniqueness: false,
|
113
115
|
selectorReplace: null,
|
@@ -124,6 +126,7 @@ module.exports = {
|
|
124
126
|
selectorWeightConfig,
|
125
127
|
classNameBlob: null,
|
126
128
|
cssUniqueness,
|
129
|
+
customClassNamePrefix,
|
127
130
|
selectorReplace,
|
128
131
|
cssHashSelectors,
|
129
132
|
classNamePrefix,
|
@@ -20,6 +20,7 @@ const {
|
|
20
20
|
componentFolder,
|
21
21
|
enableChunkHash,
|
22
22
|
cssUniqueness,
|
23
|
+
customClassNamePrefix,
|
23
24
|
plugins,
|
24
25
|
exclude,
|
25
26
|
patterns,
|
@@ -86,6 +87,7 @@ module.exports = isSSTest => ({
|
|
86
87
|
selectorWeightConfig,
|
87
88
|
classNameBlob: false,
|
88
89
|
cssUniqueness,
|
90
|
+
customClassNamePrefix,
|
89
91
|
selectorReplace,
|
90
92
|
cssHashSelectors,
|
91
93
|
classNamePrefix,
|
@@ -19,6 +19,7 @@ const {
|
|
19
19
|
docs: {
|
20
20
|
componentFolder,
|
21
21
|
cssUniqueness,
|
22
|
+
customClassNamePrefix,
|
22
23
|
plugins,
|
23
24
|
exclude,
|
24
25
|
patterns,
|
@@ -85,6 +86,7 @@ module.exports = {
|
|
85
86
|
selectorWeightConfig,
|
86
87
|
classNameBlob: false,
|
87
88
|
cssUniqueness,
|
89
|
+
customClassNamePrefix,
|
88
90
|
selectorReplace: null,
|
89
91
|
cssHashSelectors,
|
90
92
|
classNamePrefix,
|
@@ -34,6 +34,7 @@ const {
|
|
34
34
|
cssVariableReplacementConfig,
|
35
35
|
selectorWeightConfig,
|
36
36
|
cssUniqueness,
|
37
|
+
customClassNamePrefix,
|
37
38
|
server: {
|
38
39
|
mode
|
39
40
|
},
|
@@ -161,6 +162,7 @@ module.exports = {
|
|
161
162
|
mediaQueryHoverActiveString,
|
162
163
|
classNameBlob: '[local]',
|
163
164
|
cssUniqueness: false,
|
165
|
+
customClassNamePrefix,
|
164
166
|
selectorReplace: null,
|
165
167
|
postCssPluginOrder
|
166
168
|
})
|
@@ -175,6 +177,7 @@ module.exports = {
|
|
175
177
|
selectorWeightConfig,
|
176
178
|
classNameBlob: false,
|
177
179
|
cssUniqueness,
|
180
|
+
customClassNamePrefix,
|
178
181
|
selectorReplace,
|
179
182
|
cssHashSelectors,
|
180
183
|
classNamePrefix,
|
package/lib/deprecationLogger.js
CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.deprecateMessage = deprecateMessage;
|
7
7
|
exports.deprecateOption = deprecateOption;
|
8
8
|
exports.deprecationLoggerEnd = deprecationLoggerEnd;
|
9
|
-
exports.deprecationLoggerStart = deprecationLoggerStart;
|
10
9
|
|
11
10
|
var _logger = require("./logger");
|
12
11
|
|
@@ -44,7 +44,8 @@ const getCSSLoaders = optionsObj => {
|
|
44
44
|
selectorReplace,
|
45
45
|
cssHashSelectors,
|
46
46
|
classNamePrefix,
|
47
|
-
postCssPluginOrder
|
47
|
+
postCssPluginOrder,
|
48
|
+
customClassNamePrefix
|
48
49
|
} = optionsObj;
|
49
50
|
const {
|
50
51
|
devCssFileBountry
|
@@ -65,10 +66,10 @@ const getCSSLoaders = optionsObj => {
|
|
65
66
|
if (classNameBlob) {
|
66
67
|
cssLoaderOptions.modules.localIdentName = classNameBlob;
|
67
68
|
} else {
|
68
|
-
cssLoaderOptions.modules.getLocalIdent = (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix, patterns);
|
69
|
+
cssLoaderOptions.modules.getLocalIdent = (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix, customClassNamePrefix, patterns);
|
69
70
|
}
|
70
71
|
|
71
|
-
const pluginOrder = calculatePostCssPluginOrder(postCssPluginOrder, Object.keys(plugins).filter(x => plugins[x]
|
72
|
+
const pluginOrder = calculatePostCssPluginOrder(postCssPluginOrder, Object.keys(plugins).filter(x => plugins[x] === true)); // console.log('selector weight config : ', selectorWeightConfig);
|
72
73
|
|
73
74
|
const postcssPlugins = [plugins.valueReplacer && require('../postcss-plugins/ValueReplacer')(valueReplacer), plugins.hasRTL && require('@zohodesk/postcss-rtl')({
|
74
75
|
addPrefixToSelector: function addPrefixToSelector(selector, prefix) {
|
package/lib/logger.js
CHANGED
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.errorLogger = errorLogger;
|
7
7
|
exports.messageLogger = messageLogger;
|
8
|
+
exports.verboseLogger = verboseLogger;
|
8
9
|
exports.warnLogger = warnLogger;
|
9
10
|
|
11
|
+
/* eslint-disable no-console */
|
10
12
|
function messageLogger(...args) {
|
11
13
|
console.log(...args);
|
12
14
|
}
|
@@ -17,4 +19,9 @@ function errorLogger(...args) {
|
|
17
19
|
|
18
20
|
function warnLogger(...args) {
|
19
21
|
console.warn(...args);
|
22
|
+
}
|
23
|
+
|
24
|
+
function verboseLogger(...args) {
|
25
|
+
// TODO: need to be remove when publish happens
|
26
|
+
process.env.VERBOSE === 'true' && console.log('\x1b[33m [verbose] \x1b[0m', ...args);
|
20
27
|
}
|