@zohodesk/react-cli 1.1.9 → 1.1.11-exp.1

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.
@@ -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,68 @@ Now to run app
43
43
  ---
44
44
 
45
45
  # Change Logs
46
+
47
+ # 1.1.11-exp.1 (8-8-2023)
48
+
49
+ **Changes**
50
+
51
+ - Added a new config `stats` to control stats file generation.
52
+
53
+ **Features:-**
54
+
55
+ - 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`.
56
+
57
+ # 1.1.11 (4-8-2023)
58
+
59
+ **Changes**
60
+
61
+ - 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.
62
+
63
+ - Prop-type, Prop description, Default Props support for docs given.
64
+ - Docs and Docs_Code UI updated.
65
+
66
+ **Features:-**
67
+
68
+ - custom classname prefix for separate packages now supported.
69
+ - to use custom classnames for specific patterns, we use the following pattern in `app > customClassNamePrefix` or `docs > customClassNamePrefix` :
70
+
71
+ ```
72
+ "customClassNamePrefix" : [
73
+ {
74
+ "enable": true,
75
+ "prefix": "[required-prefix]",
76
+ "patterns":[
77
+ "**/[path-name]/**/*.css"
78
+ ]
79
+ }
80
+ ]
81
+ ```
82
+
83
+ For example,
84
+
85
+ ```
86
+ "customClassNamePrefix": [
87
+ {
88
+ "enable": true,
89
+ "prefix": "zdSvg",
90
+ "patterns": [
91
+ "**/@zohodesk/svg/**/*.css"
92
+ ]
93
+ },
94
+ ],
95
+ ```
96
+
97
+ **Issue Fix:**
98
+
99
+ - typo fix, (../src/common/runPreProcess.js) to (../lib/common/runPreProcess.js) in cli.js our code.
100
+
101
+ # 1.1.10 (2-8-2023)
102
+
103
+ **Issue Fix:**
104
+
105
+ - undefined plugin postcss issue fixed for docs.
106
+ - unnecessary deprecation warning stopped. (for exclude config)
107
+
46
108
  # 1.1.9 (25-7-2023)
47
109
 
48
110
  **Features:-**
@@ -53,55 +115,65 @@ Now to run app
53
115
  - added support for pattern as function for custom chunks split logic.
54
116
  - added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
55
117
  - added `postCssPluginOrder` feature :
118
+
56
119
  - 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` Object will be considered.
120
+ - If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to "true", order preserved in `plugins` Object will be considered.
58
121
  - If `app > postCssPluginOrder` or `docs > postCssPluginOrder` is set to an array with plugins in a custom order, the custom order will be considered.
59
122
 
60
- - We use the same plugin names as in `patterns` for the plugins to execute successfully.
61
-
123
+ - We use the same plugin names as in `patterns` for the plugins to execute successfully.
62
124
 
63
125
  **Issue Fix**
126
+
64
127
  - 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
128
  - fixed cssUniqueness pattern not working in docs.
66
129
 
67
130
  **Changes**
131
+
68
132
  - previously all custom chunks are enforce true, no we have given support for enforce false for chunks on splitChunks config.
69
133
 
70
134
  # 1.1.8
71
135
 
72
136
  **Issue Fix**
73
- - Docs fix for Selector Replace 'always require arguement' issue.
137
+
138
+ - Docs fix for Selector Replace 'always require argument' issue.
74
139
 
75
140
  # 1.1.7
76
141
 
77
142
  **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
143
 
144
+ - Markdown parser feature added in docs
145
+ For more info please refer to :
146
+ [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/MarkdownParser.md)
82
147
 
83
148
  # 1.1.6-exp.2
149
+
84
150
  - fixed file path separator issue with split chunks config for vendor exclude list.
85
- - added support for not doing enforce true for chunks on splitchunks config.
151
+ - added support for not doing enforce true for chunks on splitChunks config.
86
152
 
87
153
  # 1.1.5-exp.5
154
+
88
155
  - fixed the issues regarding custom chunks base config schema.
89
156
 
90
157
  # 1.1.5-exp.4
158
+
91
159
  - added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
92
160
 
93
161
  # 1.1.5-exp.3
162
+
94
163
  - added options to split chunks base config
95
164
  - added support for passing custom chunks split logic as function.
165
+
96
166
  # 1.1.6
97
167
 
98
168
  **Issue Fix**
169
+
99
170
  - local install react-cli spawnSync Error fix in npm 8
100
171
  - babel version update issue fix (Cannot read properties of undefined (reading 'file')) and (BABEL_TRANSFORM_ERROR)
101
172
 
102
173
  # 1.1.5-exp.2
103
174
 
104
175
  **Issue Fix**
176
+
105
177
  - local install react-cli spawnSync Error fix in npm 8
106
178
 
107
179
  # 1.1.5
@@ -113,6 +185,7 @@ For more info please refer to :
113
185
  # 1.1.4
114
186
 
115
187
  **Issue Fix**
188
+
116
189
  - global install react-cli spawnSync Error fix
117
190
  - `0px` variable value conversion issue fixed
118
191
  - pattern exclude for postcss plugins case fixed
@@ -120,6 +193,7 @@ For more info please refer to :
120
193
  # 1.1.3
121
194
 
122
195
  **Issue Fix**
196
+
123
197
  - local install react-cli spawnSync Error fix
124
198
 
125
199
  # 1.1.2
@@ -131,67 +205,75 @@ For more info please refer to :
131
205
  # 1.1.1
132
206
 
133
207
  **Issue Fix**
208
+
134
209
  - docs component name incorrect in windows, when using --enableReactLive issue fixed.
135
210
 
136
- **Feature Update**
211
+ **Feature Update**
212
+
137
213
  - Support for desk-library to use Selector Replace plugin using individual script. To use `react-cli selectorReplacer [source] [target]`
138
214
 
139
215
  # 1.1.0
140
216
 
141
217
  **Feature Update**
142
- - Support for desk-library to use variable convertion plugin using individual script. To use `react-cli variableConverter [source] [target]`
218
+
219
+ - Support for desk-library to use variable conversion plugin using individual script. To use `react-cli variableConverter [source] [target]`
143
220
  - 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)
221
+ For more info please refer to :
222
+ [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/patternFiltering.md)
146
223
  - React Live feature implemented for Docs.
147
- [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ReactLive.md)
224
+ [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/2.0.0/docs/ReactLive.md)
148
225
 
149
226
  # 1.0.3-beta.1
150
227
 
151
228
  **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
229
 
230
+ - 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
231
 
155
232
  # 1.0.3
156
233
 
157
234
  **Feature Update**
235
+
158
236
  - Support for global httpsCerts usage
159
237
  - 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** ==> @zohodesk/client_packages_group@**1.0.2**
163
-
164
-
238
+ - 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).
239
+ **Package Update**
240
+ - @zohodesk/client_packages_group@**1.0.1** ==> @zohodesk/client_packages_group@**1.0.2**
165
241
 
166
242
  # 1.0.2
167
243
 
168
244
  **Feature Update**
245
+
169
246
  - Selector replace plugin made as a custom postcss-plugin with update to code that was unpublished in package.
170
247
 
171
248
  # 1.0.1
172
249
 
173
250
  **Issue Fix**
251
+
174
252
  - variable conversion for px and var(--) values in same declaration was not supported, now it is supported.
175
253
  - package-lock.json removed from `.npmignore`
176
254
 
177
255
  **Feature Update**
256
+
178
257
  - exclude added to Selector Plugin
258
+
179
259
  # 1.0.0
260
+
180
261
  ## Major Release
262
+
181
263
  **Changes:**
264
+
182
265
  - File support added for `.webp` for `docs`, `dev` and `prod` mode
183
266
  - File support added for `.webm` for `docs`, `dev` and `prod` mode
184
267
 
185
268
  **Breaking Changes:**
186
269
 
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 need to specify two things
270
+ - We have remove ssl certificate for security reasons.
271
+ So default https server won't run.
272
+ In order to make it work as before you need to specify two things
190
273
  1. install `@zohodesk-private/client_dev_cert`
191
- 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
192
- unless configaration are proper this may break `start` , `docs` , `nowatchstart`. and mock wms `/wmsmockapi` won't work.
193
- So Please be carefull when you update this version or above without proper configaration.
194
-
274
+ 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
275
+ unless configaration are proper this may break `start` , `docs` , `nowatchstart`. and mock wms `/wmsmockapi` won't work.
276
+ So Please be carefull when you update this version or above without proper configaration.
195
277
 
196
278
  # 0.0.1-beta.178
197
279
 
@@ -202,13 +284,13 @@ For more info please refer to :
202
284
 
203
285
  **Breaking Changes:**
204
286
 
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 need to specify two things
287
+ - We have remove ssl certificate for security reasons.
288
+ So default https server won't run.
289
+ In order to make it work as before you need to specify two things
208
290
  1. install `@zohodesk-private/client_dev_cert`
209
- 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
210
- unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
211
- So Please be carefull when you update this version or above without proper configaration.
291
+ 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
292
+ unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
293
+ So Please be carefull when you update this version or above without proper configaration.
212
294
 
213
295
  # 0.0.1-exp.178.2
214
296
 
@@ -220,13 +302,13 @@ For more info please refer to :
220
302
 
221
303
  **Breaking Changes:**
222
304
 
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 need to specify two things
305
+ - We have remove ssl certificate for security reasons.
306
+ So default https server won't run.
307
+ In order to make it work as before you need to specify two things
226
308
  1. install `@zohodesk-private/client_dev_cert`
227
- 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
228
- unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
229
- So Please be carefull when you update this version or above without proper configaration.
309
+ 2. `react-cli.app.server.httpsCerts` option example `"httpsCerts": "@zohodesk-private/client_dev_cert"`
310
+ unless configaration are proper this may break `start` , `docs` , `nowatchstart`.
311
+ So Please be carefull when you update this version or above without proper configaration.
230
312
 
231
313
  # 0.0.1-beta.177
232
314
 
@@ -287,8 +369,8 @@ cli has been updated to fix compose issue faced when classname:hover exists and
287
369
 
288
370
  **Feature:-**
289
371
 
290
- - `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
291
- `classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
372
+ - `react-cli.test.classnameFormat` option added to change CssModules (Ex: import style from "./a.module.css" ) className transform template unittest case.
373
+ `classnameFormat` default value `[classname]` you can customize it. Example: `[classname]-[hash]`
292
374
 
293
375
  **Changes:-**
294
376
 
@@ -307,7 +389,7 @@ For an more information and reference, refer to `[details](https://zgit.csez.zoh
307
389
 
308
390
  # 0.0.1-beta.172
309
391
 
310
- We have renamed some options, For Our future features convenience.
392
+ We have renamed some options, For Our future features convenience.
311
393
  We have given fallback support.
312
394
  Deprecation Warnings:-
313
395
 
@@ -384,8 +466,9 @@ Features:-
384
466
  - In docs we have added `Description` for Component Props- check out it in `PropTypes` tab
385
467
 
386
468
  # 0.0.1-beta.167.1
387
- In this version we merged changes from [0.0.1-betaa.138.1](#0.0.1-betaa.138.1).
388
- and with [0.0.1-beta.167](#0.0.1-beta.167) version changes.
469
+
470
+ In this version we merged changes from [0.0.1-betaa.138.1](#0.0.1-betaa.138.1).
471
+ and with [0.0.1-beta.167](#0.0.1-beta.167) version changes.
389
472
 
390
473
  # 0.0.1-beta.167
391
474
 
@@ -649,6 +732,7 @@ impact servise related changes:-
649
732
  - few enhancements
650
733
 
651
734
  # 0.0.1-betaa.138.1
735
+
652
736
  - new feature added for custom extra attribute for dynamically added tags by webpack.
653
737
  - To enable this feature you need to enable "react-cli" => "app" => "customAttributes" => "enable"
654
738
  - For more [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/9eea8df14e55584b2114b5e484ca8b751a4ba191/src/plugins/CustomAttributePlugin.md)
@@ -1291,3 +1375,7 @@ impact servise related changes:-
1291
1375
  - prod string error fix
1292
1376
  - efc build support
1293
1377
  - single style tag support
1378
+
1379
+ ```
1380
+
1381
+ ```
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 { existsSync } = require('fs');
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
- 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(
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,
@@ -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] !== false)); // console.log('selector weight config : ', selectorWeightConfig);
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
  }