@zohodesk/react-cli 0.0.1-beta.174 → 0.0.1-beta.176

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.
Files changed (119) hide show
  1. package/.eslintignore +7 -7
  2. package/.eslintrc.js +180 -180
  3. package/.prettierrc +6 -6
  4. package/README.md +1018 -1003
  5. package/bin/cli.js +482 -482
  6. package/cert/Tsicsezwild-22-23.crt +37 -37
  7. package/cert/Tsicsezwild-22-23.key +27 -27
  8. package/docs/CustomChunks.md +26 -26
  9. package/docs/DevStart.md +18 -18
  10. package/docs/HoverActive.md +12 -12
  11. package/docs/InstallNode.md +28 -28
  12. package/docs/SelectorWeight.md +6 -0
  13. package/docs/TODOS.md +10 -10
  14. package/docs/ValueReplacer.md +60 -60
  15. package/docs/VariableConversion.md +710 -678
  16. package/docs/warnings_while_install.txt +35 -35
  17. package/files/eslintrc.js +62 -62
  18. package/files/prettierrc.js +3 -3
  19. package/lib/configs/webpack.css.umd.config.js +4 -4
  20. package/lib/configs/webpack.dev.config.js +23 -2
  21. package/lib/configs/webpack.docs.config.js +13 -1
  22. package/lib/configs/webpack.impact.config.js +13 -1
  23. package/lib/configs/webpack.prod.config.js +23 -2
  24. package/lib/loaderUtils/configsAssetsLoaders.js +33 -33
  25. package/lib/loaderUtils/getCSSLoaders.js +24 -21
  26. package/lib/loaderUtils/windowsModification.js +11 -0
  27. package/lib/loaders/workerLoader.js +9 -9
  28. package/lib/pluginUtils/configHtmlWebpackPlugins.js +59 -0
  29. package/lib/pluginUtils/getDevPlugins.js +54 -52
  30. package/lib/pluginUtils/getProdPlugins.js +66 -63
  31. package/lib/plugins/EFCPlugin.md +6 -6
  32. package/lib/plugins/I18NInjectIntoIndexPlugin.js +4 -4
  33. package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +38 -38
  34. package/lib/plugins/I18nSplitPlugin/I18nFilesEmitter.js +30 -30
  35. package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +8 -8
  36. package/lib/plugins/I18nSplitPlugin/I18nSplit.md +95 -95
  37. package/lib/plugins/I18nSplitPlugin/README.md +25 -25
  38. package/lib/plugins/I18nSplitPlugin/index.js +57 -57
  39. package/lib/plugins/ResourceHintsPlugin.js +17 -17
  40. package/lib/plugins/RtlSplitPlugin/RtlCssPlugin.js +6 -6
  41. package/lib/plugins/RtlSplitPlugin/RtrSplit.md +30 -30
  42. package/lib/plugins/SelectorPlugin.js +97 -0
  43. package/lib/plugins/ServiceWorkerPlugin.js +9 -9
  44. package/lib/plugins/TPHashMappingPlugin.js +4 -4
  45. package/lib/plugins/VariableConversionCollector.js +252 -0
  46. package/lib/plugins/composeCommonPlugin.js +30 -0
  47. package/lib/postcss-plugins/RTLSplitPlugin.js +10 -10
  48. package/lib/postcss-plugins/__test__/test1Input.css +38 -38
  49. package/lib/postcss-plugins/__test__/test1Output.css +38 -38
  50. package/lib/postcss-plugins/hoverActivePlugin.js +13 -9
  51. package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +35 -14
  52. package/lib/postcss-plugins/variableModificationPlugin/index.js +202 -143
  53. package/lib/schemas/index.js +20 -8
  54. package/lib/sh/pre-commit.sh +34 -34
  55. package/lib/sh/reportPublish.sh +45 -45
  56. package/lib/utils/buildstats.html +148 -148
  57. package/lib/utils/resultSchema.json +73 -73
  58. package/npm8.md +9 -9
  59. package/package.json +146 -146
  60. package/postpublish.js +6 -6
  61. package/templates/app/.eslintrc.js +140 -140
  62. package/templates/app/README.md +12 -12
  63. package/templates/app/app/index.html +24 -24
  64. package/templates/app/app/properties/ApplicationResources_en_US.properties +1 -1
  65. package/templates/app/app/properties/i18nkeys.json +3 -3
  66. package/templates/app/docs/all.html +69 -69
  67. package/templates/app/mockapi/index.js +18 -18
  68. package/templates/app/package.json +37 -37
  69. package/templates/app/src/actions/SampleActions/index.js +37 -37
  70. package/templates/app/src/actions/index.js +65 -65
  71. package/templates/app/src/appUrls.js +19 -19
  72. package/templates/app/src/components/Alert/Alert.js +134 -134
  73. package/templates/app/src/components/Alert/Alert.module.css +79 -79
  74. package/templates/app/src/components/FreezeLayer/FreezeLayer.css +37 -37
  75. package/templates/app/src/components/FreezeLayer/FreezeLayer.js +84 -84
  76. package/templates/app/src/components/Sample/Sample.module.css +11 -11
  77. package/templates/app/src/components/Sample/SampleList.js +61 -61
  78. package/templates/app/src/components/Slider/Slider.css +41 -41
  79. package/templates/app/src/components/Slider/Slider.js +55 -55
  80. package/templates/app/src/containers/AlertContainer/index.js +15 -15
  81. package/templates/app/src/containers/AppContainer/index.js +96 -96
  82. package/templates/app/src/containers/AppContainer/index.module.css +27 -27
  83. package/templates/app/src/containers/CustomMatch/index.js +65 -65
  84. package/templates/app/src/containers/DevTools/index.js +10 -10
  85. package/templates/app/src/containers/Header/index.js +67 -67
  86. package/templates/app/src/containers/Header/index.module.css +43 -43
  87. package/templates/app/src/containers/Redirect/index.js +63 -63
  88. package/templates/app/src/containers/Redirector/index.js +47 -47
  89. package/templates/app/src/containers/SampleListContainer/ListContainer.js +42 -42
  90. package/templates/app/src/containers/SampleListContainer/ListContainer.module.css +3 -3
  91. package/templates/app/src/historyChange.js +5 -5
  92. package/templates/app/src/index.html +10 -10
  93. package/templates/app/src/index.js +24 -24
  94. package/templates/app/src/middleware/PromiseMiddleware.js +59 -59
  95. package/templates/app/src/reducers/alertData.js +11 -11
  96. package/templates/app/src/reducers/index.js +6 -6
  97. package/templates/app/src/reducers/samples.js +19 -19
  98. package/templates/app/src/store/configureStore.dev.js +51 -51
  99. package/templates/app/src/store/configureStore.js +5 -5
  100. package/templates/app/src/store/configureStore.prod.js +26 -26
  101. package/templates/app/src/util/Common.js +5 -5
  102. package/templates/app/src/util/RequestAPI.js +132 -132
  103. package/templates/docs/all.html +249 -249
  104. package/templates/docs/component.html +178 -178
  105. package/templates/docs/components.html +221 -221
  106. package/templates/docs/css/b.min.css +6 -6
  107. package/templates/docs/css/component.css +42 -42
  108. package/templates/docs/css/componentTest.css +6 -6
  109. package/templates/docs/css/hopscotch.css +585 -585
  110. package/templates/docs/css/style.css +1022 -1022
  111. package/templates/docs/impactReportTemplate.html +154 -154
  112. package/templates/docs/index.html +1501 -1501
  113. package/templates/docs/js/active-line.js +72 -72
  114. package/templates/docs/js/b.min.js +7 -7
  115. package/templates/docs/js/codemirror.js +9680 -9680
  116. package/templates/docs/js/designTokens.js +334 -334
  117. package/templates/docs/js/j.min.js +4 -4
  118. package/templates/docs/js/javascript.js +874 -874
  119. package/templates/docs/js/matchbrackets.js +145 -145
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _postcss = _interopRequireDefault(require("postcss"));
9
+
10
+ var _fs = _interopRequireDefault(require("fs"));
11
+
12
+ var _webpackSources = require("webpack-sources");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ const path = require('path');
17
+
18
+ const isCss = filename => path.extname(filename) === '.css';
19
+
20
+ function rootConvertor(rootOriginal, defaultSelector, data, chunkFilename, excludeStrings) {
21
+ rootOriginal.walkRules((rule, index) => {
22
+ const prevNode = rootOriginal.nodes[index - 1];
23
+
24
+ if (index !== 0 && prevNode.type && prevNode.type === 'comment' && prevNode.text.toLowerCase() === 'updateselector:ignore') {
25
+ return;
26
+ }
27
+
28
+ if (rule.parent && rule.parent.type === 'atrule') {
29
+ if (rule.parent.name !== 'media') {
30
+ return;
31
+ }
32
+ }
33
+
34
+ if (excludeStrings.includes(rule.selector)) {
35
+ return;
36
+ }
37
+
38
+ let ruleArr = rule.selector.split(',');
39
+ ruleArr.forEach((rule, index) => {
40
+ if (rule.includes(']')) {
41
+ if (rule.slice(rule.lastIndexOf(']') + 2).trim() === '') {
42
+ return;
43
+ } // console.log(
44
+ // rule.slice(rule.lastIndexOf(']') + 2).trim(),
45
+ // rule.slice(rule.lastIndexOf(']') + 2).trim() !== ''
46
+ // );
47
+
48
+
49
+ ruleArr[index] = `${rule.slice(0, rule.lastIndexOf(']') + 1).trim()} ${defaultSelector}${rule.slice(rule.lastIndexOf(']') + 2).trim()}`; // console.log(ruleArr[index]);
50
+
51
+ return;
52
+ }
53
+
54
+ ruleArr[index] = data[chunkFilename] ? `${data[chunkFilename].defaultSelector}${rule}` : `${defaultSelector}${rule}`;
55
+ });
56
+ rule.selector = ruleArr.join(',\n'); // console.log(`${rule.selector} converted`);
57
+ });
58
+ return rootOriginal;
59
+ }
60
+
61
+ class SelectorPlugin {
62
+ constructor(options = {}) {
63
+ this.optimize = options.optimize;
64
+ this.selectorWeightConfig = options.selectorWeightConfig;
65
+ }
66
+
67
+ apply(compiler) {
68
+ const {
69
+ defaultSelector,
70
+ customFileDetails,
71
+ excludeStrings
72
+ } = this.selectorWeightConfig;
73
+
74
+ const rawdata = _fs.default.readFileSync(customFileDetails);
75
+
76
+ const data = JSON.parse(rawdata);
77
+ compiler.hooks.compilation.tap('selector-weight-rewrite', compilation => {
78
+ compilation.hooks.optimizeChunkAssets.tapAsync('selector-weight-rewrite', (chunks, callback) => {
79
+ chunks.forEach(chunk => {
80
+ chunk.files.filter(isCss).forEach(chunkFilename => {
81
+ const asset = compilation.assets[chunkFilename];
82
+ const sourceStr = asset.source();
83
+
84
+ const rootOriginal = _postcss.default.parse(sourceStr);
85
+
86
+ compilation.assets[chunkFilename] = new _webpackSources.RawSource(rootConvertor(rootOriginal, defaultSelector, data, chunkFilename, excludeStrings).toString());
87
+ });
88
+ });
89
+ callback();
90
+ });
91
+ });
92
+ }
93
+
94
+ }
95
+
96
+ var _default = SelectorPlugin;
97
+ exports.default = _default;
@@ -51,11 +51,11 @@ class ServiceWorkerPlugin {
51
51
  if (err) {
52
52
  throw new Error(err);
53
53
  } else {
54
- /* const extractedChunks = compilation.chunks.filter(chunk => {
55
- if ('canBeInitial' in chunk) {
56
- return chunk.canBeInitial();
57
- }
58
- return chunk.isInitial();
54
+ /* const extractedChunks = compilation.chunks.filter(chunk => {
55
+ if ('canBeInitial' in chunk) {
56
+ return chunk.canBeInitial();
57
+ }
58
+ return chunk.isInitial();
59
59
  }); */
60
60
  // let [js, css, , , i18nPublicPath] = this.publicPaths;
61
61
  // let initialChunkUrls = [];
@@ -64,10 +64,10 @@ class ServiceWorkerPlugin {
64
64
  let entrypoint = compilation.entrypoints.get('main');
65
65
  let initialChunkUrls = entrypoint.getFiles();
66
66
  const cssDirTemplate = '@dir@';
67
- /**
68
- * NOTE:
69
- * if chunkSplitEnable is false means,
70
- * serviceWorker will get i18n files path for html
67
+ /**
68
+ * NOTE:
69
+ * if chunkSplitEnable is false means,
70
+ * serviceWorker will get i18n files path for html
71
71
  */
72
72
 
73
73
  let initalI18nAssets = chunkSplitEnable ? entrypoint.chunks.filter(chunk => _I18nKeysIdentifer.default.isChunkHasI18n(chunk)).map(chunk => (0, _getI18nFileUrlPathTemplate.getI18nFileUrlPathTemplate)(compilation, chunk, this.i18nFileNameTemplate, '@locale@')) : [];
@@ -15,10 +15,10 @@ var _crypto = _interopRequireDefault(require("crypto"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- /**
19
- * Plugin that generates hash for the provided list of third party files
20
- * Map the provided key with the file hash and add it to the list of exisiting global constants.
21
- * Plugin in turn uses the defineplugin to generate global constants.
18
+ /**
19
+ * Plugin that generates hash for the provided list of third party files
20
+ * Map the provided key with the file hash and add it to the list of exisiting global constants.
21
+ * Plugin in turn uses the defineplugin to generate global constants.
22
22
  */
23
23
  class TPHashMappingPlugin {
24
24
  constructor(options) {
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _postcss = _interopRequireDefault(require("postcss"));
9
+
10
+ var _fs = _interopRequireDefault(require("fs"));
11
+
12
+ var _ErrorHandler = require("../postcss-plugins/variableModificationPlugin/ErrorHandler");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ // import { RawSource } from 'webpack-sources';
17
+ const ignoreVals = ['--zd_size', '--zd_font_size', '--size', '--size_']; // -- is issue IO --
18
+
19
+ /*
20
+ issues eg :
21
+ issues = ['--zd_size', '--zd_font_size', '--size', '--size_'];
22
+ input :
23
+ --zd_size
24
+ output :
25
+ true
26
+ comment :
27
+ do not execute when --zd_size comes as prop
28
+ */
29
+
30
+ function isIgnoreValuePresent(ignoreVals, prop) {
31
+ let present = false;
32
+ ignoreVals.forEach(issue => {
33
+ if (prop && prop.includes(issue)) {
34
+ present = true;
35
+ }
36
+ });
37
+ return present;
38
+ } // -- to convert the hyphen values to values --
39
+
40
+ /*
41
+ input :
42
+ var(--zdt_uploadlist_default_width)
43
+ output :
44
+ --zdt_uploadlist_default_width
45
+
46
+ comment :
47
+ to make the variable object using the output as key and decl.prop such as font-size as value
48
+ */
49
+
50
+
51
+ function extractVariableName(val) {
52
+ return val.replace(/calc\((.+)\)/gi, '$1').replace(/var\((.+)\)/gi, '$1').replace('-1', '').replace('*', '').replace('\n', '').trim();
53
+ }
54
+
55
+ function rootConvertor(rootOriginal, variables, settingsObject) {
56
+ rootOriginal.walkRules(rule => {
57
+ rule.nodes.forEach((decl, index) => {
58
+ let prevNode = rule.nodes[index - 1];
59
+ let currentNode = rule.nodes[index];
60
+
61
+ if (decl.prop && decl.prop.includes('--')) {
62
+ if (prevNode && prevNode.type === 'comment' && prevNode.text.toLowerCase() === 'variable:ignore') {
63
+ return;
64
+ }
65
+
66
+ if (isIgnoreValuePresent(ignoreVals, decl.prop)) {
67
+ return;
68
+ }
69
+
70
+ if (settingsObject[variables[decl.prop]]) {
71
+ /* if there is no value for property, set it to default so that undefined doesn't get called as key */
72
+ if (!variables[decl.prop] || !settingsObject[variables[decl.prop]]) {
73
+ variables[decl.prop] = 'default';
74
+ }
75
+
76
+ const pxReplacement = settingsObject[variables[decl.prop]].replacements.px;
77
+ let valArr = decl.value.split(' '); // single values are considered in the above array and converted below
78
+
79
+ valArr.forEach((value, index) => {
80
+ if (value.includes('px')) {
81
+ let num = value.replace('px', '');
82
+ valArr[index] = pxReplacement.replace('$$', num);
83
+ }
84
+ });
85
+ currentNode.value = valArr.join(' ');
86
+ }
87
+ }
88
+ });
89
+ });
90
+ return rootOriginal;
91
+ }
92
+
93
+ class VariableConversionCollector {
94
+ constructor(options = {}) {
95
+ this.optimize = options.optimize;
96
+ this.filename = options.cssVariableReplacementConfig;
97
+ }
98
+
99
+ apply(compiler) {
100
+ let variables = {};
101
+
102
+ const rawdata = _fs.default.readFileSync(this.filename);
103
+
104
+ const data = JSON.parse(rawdata);
105
+ const {
106
+ settings: settingsObject,
107
+ errorLog: errorLogStatus,
108
+ errorInConsole: errorConsoleStatus
109
+ } = data; // If theres is no setting for default prop in settingsObject, set one.
110
+
111
+ if (!settingsObject.default) {
112
+ settingsObject.default = {
113
+ allowed: ['px', 'em', 'fit-content', 'auto', '%', 'inherit', '-moz-fit-content', 'vh', '0', 'initial', 'vw'],
114
+ replacements: {
115
+ px: 'var(--zd_size$$)'
116
+ },
117
+ range: {
118
+ start: -99999,
119
+ end: 99999
120
+ }
121
+ };
122
+ }
123
+ /*
124
+ purpose of tap : to create a variable object such as:
125
+ {
126
+ --zdt_uploadlist_default_width : width,
127
+ --zdt_uploadlist_default_height : height,
128
+ }
129
+ which will help in the conversion further
130
+ */
131
+
132
+
133
+ compiler.hooks.compilation.tap('VariableConversionCollector', compilation => {
134
+ compilation.hooks.optimizeModules.tap('VariableConversionCollector', modules => {
135
+ const mods = modules.filter(x => x.type.includes('css'));
136
+ mods.forEach(module => {
137
+ const rootOriginal = _postcss.default.parse(module.content);
138
+
139
+ const filename = module.issuer.resource;
140
+ rootOriginal.walkRules(rule => {
141
+ rule.walkDecls(decl => {
142
+ decl.value.split(' ').forEach(val => {
143
+ if (val && val.includes('--') && !new RegExp(ignoreVals.join('|'), 'gi').test(val)) {
144
+ variables[extractVariableName(val)] = decl.prop;
145
+ }
146
+ });
147
+ });
148
+ });
149
+ /*
150
+ current value example:
151
+ {
152
+ --zdt_uploadlist_default_width : --zd_upload_width,
153
+ --zd_upload_width : width
154
+ }
155
+ expected value :
156
+ {
157
+ --zdt_uploadlist_default_width : width,
158
+ --zd_upload_width : width
159
+ }
160
+
161
+ conversion is done in the while loop below
162
+ */
163
+
164
+ Object.keys(variables).forEach(key => {
165
+ while (variables[variables[key]]) {
166
+ variables[key] = variables[variables[key]];
167
+ }
168
+ });
169
+ });
170
+ }); // -- conversion for the root using rootConvertor --
171
+
172
+ /*
173
+ input :
174
+ .a{
175
+ padding : 20px
176
+ }
177
+ output :
178
+ // on settingObject file :
179
+ { padding : { replacements : { px : 'zd_size$$' }}}
180
+ .a{
181
+ padding : zd_size20;
182
+ }
183
+ */
184
+
185
+ compilation.hooks.optimizeModules.tap('VariableConversionCollector', modules => {
186
+ const mods = modules.filter(x => x.type.includes('css'));
187
+ mods.forEach(module => {
188
+ const rootOriginal = _postcss.default.parse(module.content);
189
+
190
+ module.content = rootConvertor(rootOriginal, variables, settingsObject).toString();
191
+ });
192
+ });
193
+ });
194
+ /*
195
+ purpose of tap : to display the errors encountered so far
196
+ input :
197
+ all css files
198
+ output :
199
+ all errors that are present in the errTable arr
200
+ */
201
+
202
+ compiler.hooks.afterEmit.tap('error-display', () => {
203
+ const {
204
+ errors,
205
+ errTable
206
+ } = require('../postcss-plugins/variableModificationPlugin/index');
207
+
208
+ let avlTypes = new Set([]);
209
+ let srtArr = errTable.sort((a, b) => {
210
+ avlTypes.add(a.type);
211
+ avlTypes.add(b.type);
212
+
213
+ if (a.type < b.type) {
214
+ return -1;
215
+ }
216
+ });
217
+
218
+ if (errorConsoleStatus) {
219
+ const errHandler = new _ErrorHandler.ErrorHandler();
220
+ avlTypes.forEach(type => {
221
+ console.log('---------------------------------------------------------------------------------------------------------------------------');
222
+ console.log(`Error Type : ${type}`);
223
+ console.log('---------------------------------------------------------------------------------------------------------------------------');
224
+ srtArr.forEach(err => {
225
+ if (err.decl.prop && err.decl.value && err.type === type) {
226
+ errHandler.printError(err);
227
+ }
228
+ });
229
+ console.log('---------------------------------------------------------------------------------------------------------------------------');
230
+ });
231
+ }
232
+
233
+ if (errorLogStatus) {
234
+ _fs.default.writeFileSync('./css_error.log', '');
235
+
236
+ console.log('writing to logFile...');
237
+
238
+ if (errors.length > 0) {
239
+ errors.forEach((err, index) => {
240
+ if (errTable[index].decl.prop && errTable[index].decl.value) {
241
+ _fs.default.appendFileSync('./css_error.log', err);
242
+ }
243
+ });
244
+ }
245
+ }
246
+ });
247
+ }
248
+
249
+ }
250
+
251
+ var _default = VariableConversionCollector;
252
+ exports.default = _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _postcss = _interopRequireDefault(require("postcss"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ class ComposeCommonPlugin {
13
+ constructor(options = {}) {
14
+ this.optimize = options.optimize;
15
+ }
16
+
17
+ apply(compiler) {
18
+ compiler.hooks.compilation.tap('OptimizeJSPlugin', compilation => {
19
+ compilation.hooks.optimizeModules.tap('OptimizeMods', modules => {
20
+ modules.forEach(module => {
21
+ console.log(module);
22
+ });
23
+ });
24
+ });
25
+ }
26
+
27
+ }
28
+
29
+ var _default = ComposeCommonPlugin;
30
+ exports.default = _default;
@@ -38,11 +38,11 @@ function selectorMinifySameDir(selector, direction) {
38
38
  const regex = getRegex(direction);
39
39
  return selector.replace(regex, '').trim();
40
40
  }
41
- /**
42
- * this funtion will remove given rule,
43
- * if given selector and it's previous sibiling rule selector are same
44
- * current rule properties will move to previous sibiling rule.
45
- * @param {Rule} rule current rule
41
+ /**
42
+ * this funtion will remove given rule,
43
+ * if given selector and it's previous sibiling rule selector are same
44
+ * current rule properties will move to previous sibiling rule.
45
+ * @param {Rule} rule current rule
46
46
  */
47
47
 
48
48
 
@@ -57,11 +57,11 @@ function mergeIfSameSelector(rule) {
57
57
  rule.remove();
58
58
  }
59
59
  }
60
- /**
61
- * this funtion will remove given rule,
62
- * if given selector and it's previous sibiling rule selector are same
63
- * current rule properties will move to previous sibiling rule.
64
- * @param {Rule} rule current rule
60
+ /**
61
+ * this funtion will remove given rule,
62
+ * if given selector and it's previous sibiling rule selector are same
63
+ * current rule properties will move to previous sibiling rule.
64
+ * @param {Rule} rule current rule
65
65
  */
66
66
 
67
67
 
@@ -1,39 +1,39 @@
1
- /*Hover_active:ignore*/
2
- g,a:hover{
3
- color : red
4
- }
5
- /*Hover:ignore*/
6
- h:hover{
7
- background : yellow
8
- }
9
-
10
- /* Hover_active:ignore */
11
- g,d+e:hover{
12
- color : black
13
- }
14
-
15
- g,d e:hover{
16
- color : black
17
- }
18
-
19
- @media screen and (max-width:61.25em){
20
- /* Hover_active:ignore */
21
- a,b,a:hover, b:hover{
22
- background-color : blue
23
- }
24
- a + b,a:hover + b:hover{
25
- background-color : blue
26
- }
27
- a b:hover{
28
- background-color : blue
29
- }
30
-
31
- .cc:hover {
32
- color: red;
33
- }
34
-
35
- c:hover{
36
- color : red
37
- }
38
-
1
+ /*Hover_active:ignore*/
2
+ g,a:hover{
3
+ color : red
4
+ }
5
+ /*Hover:ignore*/
6
+ h:hover{
7
+ background : yellow
8
+ }
9
+
10
+ /* Hover_active:ignore */
11
+ g,d+e:hover{
12
+ color : black
13
+ }
14
+
15
+ g,d e:hover{
16
+ color : black
17
+ }
18
+
19
+ @media screen and (max-width:61.25em){
20
+ /* Hover_active:ignore */
21
+ a,b,a:hover, b:hover{
22
+ background-color : blue
23
+ }
24
+ a + b,a:hover + b:hover{
25
+ background-color : blue
26
+ }
27
+ a b:hover{
28
+ background-color : blue
29
+ }
30
+
31
+ .cc:hover {
32
+ color: red;
33
+ }
34
+
35
+ c:hover{
36
+ color : red
37
+ }
38
+
39
39
  }
@@ -1,39 +1,39 @@
1
- /*Hover_active:ignore*/
2
- g,a:hover{
3
- color : red
4
- }
5
- /*Hover:ignore*/
6
- h:hover{
7
- background : yellow
8
- }
9
-
10
- /* Hover_active:ignore */
11
- g,d+e:hover{
12
- color : black
13
- }
14
-
15
- g,d e:hover{
16
- color : black
17
- }
18
-
19
- @media screen and (max-width:61.25em){
20
- /* Hover_active:ignore */
21
- a,b,a:hover, b:hover{
22
- background-color : blue
23
- }
24
- a + b,a:hover + b:hover{
25
- background-color : blue
26
- }
27
- a b:hover{
28
- background-color : blue
29
- }
30
-
31
- .cc:hover {
32
- color: red;
33
- }
34
-
35
- c:hover{
36
- color : red
37
- }
38
-
1
+ /*Hover_active:ignore*/
2
+ g,a:hover{
3
+ color : red
4
+ }
5
+ /*Hover:ignore*/
6
+ h:hover{
7
+ background : yellow
8
+ }
9
+
10
+ /* Hover_active:ignore */
11
+ g,d+e:hover{
12
+ color : black
13
+ }
14
+
15
+ g,d e:hover{
16
+ color : black
17
+ }
18
+
19
+ @media screen and (max-width:61.25em){
20
+ /* Hover_active:ignore */
21
+ a,b,a:hover, b:hover{
22
+ background-color : blue
23
+ }
24
+ a + b,a:hover + b:hover{
25
+ background-color : blue
26
+ }
27
+ a b:hover{
28
+ background-color : blue
29
+ }
30
+
31
+ .cc:hover {
32
+ color: red;
33
+ }
34
+
35
+ c:hover{
36
+ color : red
37
+ }
38
+
39
39
  }
@@ -4,9 +4,9 @@ var _postcss = _interopRequireDefault(require("postcss"));
4
4
 
5
5
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
6
 
7
- /**
8
- * we have give support for ignore(exclude) comments
9
- * These are the comments' keyword
7
+ /**
8
+ * we have give support for ignore(exclude) comments
9
+ * These are the comments' keyword
10
10
  */
11
11
  const hoverIgnoreQuery = 'Hover:ignore',
12
12
  activeIgnoreQuery = 'Active:ignore',
@@ -375,11 +375,15 @@ module.exports = _postcss.default.plugin('postcss-mobile-hover', mediaQueryHover
375
375
  hoverRule.rule.remove();
376
376
  }
377
377
  }
378
- }
378
+ } // rootOriginal.walkAtRules(atrule => {
379
+ // if (
380
+ // (atrule !== undefined &&
381
+ // atrule.nodes !== undefined &&
382
+ // atrule.nodes.length === 0) ||
383
+ // atrule.nodes === undefined
384
+ // ) {
385
+ // atrule.remove();
386
+ // }
387
+ // });
379
388
 
380
- rootOriginal.walkAtRules(atrule => {
381
- if (atrule !== undefined && atrule.nodes !== undefined && atrule.nodes.length === 0 || atrule.nodes === undefined) {
382
- atrule.remove();
383
- }
384
- });
385
389
  });