@zohodesk/react-cli 1.1.16-exp.1 → 1.1.16-exp.2
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.
@@ -8,12 +8,38 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
8
8
|
|
9
9
|
module.exports = _postcss.default.plugin('autoprefixer', prefixConfig => {
|
10
10
|
const filePath = prefixConfig && prefixConfig.defaultPrefixesPath ? prefixConfig.defaultPrefixesPath : './defaultPrefixes.json';
|
11
|
+
|
12
|
+
if (!_fs.default.existsSync(filePath)) {
|
13
|
+
console.error('default prefixes file not found! AutoPrefixer will not work, kindly check!');
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
11
17
|
const prefixes = JSON.parse(_fs.default.readFileSync(filePath, 'utf-8'));
|
12
18
|
const prefixVals = Object.keys(prefixes).filter(key => prefixes[key].key);
|
13
19
|
const prefixValObj = {};
|
14
20
|
prefixVals.forEach(val => {
|
15
21
|
prefixValObj[prefixes[val].value] = prefixes[val];
|
16
22
|
});
|
23
|
+
const removedPropertiesPath = prefixConfig && prefixConfig.removedPropertyPath ? prefixConfig.removedPropertyPath : './removedProperties.json';
|
24
|
+
|
25
|
+
if (_fs.default.existsSync(removedPropertiesPath)) {
|
26
|
+
const removedProperties = JSON.parse(_fs.default.readFileSync(removedPropertiesPath, 'utf-8'));
|
27
|
+
const valuesNotFound = [];
|
28
|
+
removedProperties.forEach(property => {
|
29
|
+
if (!Object.keys(prefixes).includes(property) && !Object.keys(prefixConfig.include).includes(property) && !Object.keys(prefixConfig.exclude).includes(property)) {
|
30
|
+
valuesNotFound.push(property);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
if (valuesNotFound.length > 0) {
|
35
|
+
console.error('Autoprefixer Properties not Handled : ');
|
36
|
+
valuesNotFound.forEach(value => {
|
37
|
+
console.error(value);
|
38
|
+
});
|
39
|
+
throw new Error('Kindly ensure these properties are handled through defaultPrefixes.json or prefixConfig.include or prefixConfig.exclude ');
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
17
43
|
return root => {
|
18
44
|
root.walkAtRules(rule => {
|
19
45
|
const previous = rule.parent.nodes[rule.parent.nodes.indexOf(rule) - 1];
|
package/lib/schemas/index.js
CHANGED
@@ -296,7 +296,9 @@ var _default = {
|
|
296
296
|
exclude: [],
|
297
297
|
replacements: null,
|
298
298
|
browsers: null,
|
299
|
-
defaultPrefixesPath: ''
|
299
|
+
defaultPrefixesPath: '',
|
300
|
+
removedPropertyPath: '',
|
301
|
+
prefixesPresentPath: ''
|
300
302
|
},
|
301
303
|
seperateCssModules: {
|
302
304
|
value: false,
|
@@ -420,7 +422,9 @@ var _default = {
|
|
420
422
|
exclude: [],
|
421
423
|
replacements: null,
|
422
424
|
browsers: null,
|
423
|
-
defaultPrefixesPath: ''
|
425
|
+
defaultPrefixesPath: '',
|
426
|
+
removedPropertyPath: '',
|
427
|
+
prefixesPresentPath: ''
|
424
428
|
},
|
425
429
|
cssHashSelectors: {
|
426
430
|
filenames: [],
|