postcss-unique-selectors 4.0.0-nightly.2020.9.3 → 4.0.0
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.
- package/CHANGELOG.md +24 -0
- package/dist/index.js +12 -34
- package/package.json +10 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 4.0.0-rc.0
|
|
2
|
+
|
|
3
|
+
* Breaking: Drops support for Node 0.12, we now require at least Node 4.
|
|
4
|
+
* Breaking: Update PostCSS to 6.0.0.
|
|
5
|
+
|
|
6
|
+
# 2.0.2
|
|
7
|
+
|
|
8
|
+
* Now compiled with babel 6.
|
|
9
|
+
|
|
10
|
+
# 2.0.1
|
|
11
|
+
|
|
12
|
+
* Replaced javascript-natural-sort with alphanum-sort (thanks to @TrySound).
|
|
13
|
+
|
|
14
|
+
# 2.0.0
|
|
15
|
+
|
|
16
|
+
* Upgraded to PostCSS 5.
|
|
17
|
+
|
|
18
|
+
# 1.0.1
|
|
19
|
+
|
|
20
|
+
* Removed an unnecessary dependency on css-list.
|
|
21
|
+
|
|
22
|
+
# 1.0.0
|
|
23
|
+
|
|
24
|
+
* Initial release.
|
package/dist/index.js
CHANGED
|
@@ -1,48 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
7
6
|
|
|
8
|
-
var _postcss = require(
|
|
7
|
+
var _postcss = require('postcss');
|
|
9
8
|
|
|
10
|
-
var _alphanumSort =
|
|
9
|
+
var _alphanumSort = require('alphanum-sort');
|
|
11
10
|
|
|
12
|
-
var
|
|
11
|
+
var _alphanumSort2 = _interopRequireDefault(_alphanumSort);
|
|
13
12
|
|
|
14
|
-
var
|
|
13
|
+
var _uniqs = require('uniqs');
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
var _uniqs2 = _interopRequireDefault(_uniqs);
|
|
17
16
|
|
|
18
|
-
function
|
|
19
|
-
return (0, _postcssSelectorParser.default)(callback).processSync(selectors);
|
|
20
|
-
}
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
18
|
|
|
22
19
|
function unique(rule) {
|
|
23
|
-
|
|
24
|
-
insensitive: true
|
|
25
|
-
}).join();
|
|
20
|
+
rule.selector = (0, _alphanumSort2.default)((0, _uniqs2.default)(rule.selectors), { insensitive: true }).join();
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let comments = [];
|
|
31
|
-
nodes.selector = parseSelectors(nodes.selector, selNode => {
|
|
32
|
-
selNode.walk(sel => {
|
|
33
|
-
if (sel.type === 'comment') {
|
|
34
|
-
comments.push(sel.value);
|
|
35
|
-
sel.remove();
|
|
36
|
-
return;
|
|
37
|
-
} else {
|
|
38
|
-
return sel;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
unique(nodes);
|
|
43
|
-
nodes.selectors = nodes.selectors.concat(comments);
|
|
44
|
-
});
|
|
23
|
+
exports.default = (0, _postcss.plugin)('postcss-unique-selectors', () => {
|
|
24
|
+
return css => css.walkRules(unique);
|
|
45
25
|
});
|
|
46
|
-
|
|
47
|
-
exports.default = _default;
|
|
48
|
-
module.exports = exports.default;
|
|
26
|
+
module.exports = exports['default'];
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-unique-selectors",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Ensure CSS selectors are unique.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.js --out-dir dist --ignore \"**/__tests__/\"",
|
|
9
|
-
"prepublish": ""
|
|
7
|
+
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
|
10
8
|
},
|
|
11
9
|
"files": [
|
|
12
10
|
"LICENSE-MIT",
|
|
@@ -25,16 +23,19 @@
|
|
|
25
23
|
"url": "http://beneb.info"
|
|
26
24
|
},
|
|
27
25
|
"repository": "cssnano/cssnano",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"babel-cli": "^6.0.0",
|
|
28
|
+
"cross-env": "^5.0.0"
|
|
29
|
+
},
|
|
28
30
|
"dependencies": {
|
|
29
|
-
"alphanum-sort": "^1.0.
|
|
30
|
-
"postcss": "^
|
|
31
|
-
"postcss-selector-parser": "^6.0.2",
|
|
31
|
+
"alphanum-sort": "^1.0.0",
|
|
32
|
+
"postcss": "^6.0.0",
|
|
32
33
|
"uniqs": "^2.0.0"
|
|
33
34
|
},
|
|
34
35
|
"bugs": {
|
|
35
36
|
"url": "https://github.com/cssnano/cssnano/issues"
|
|
36
37
|
},
|
|
37
38
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
39
|
+
"node": ">=6.9.0"
|
|
39
40
|
}
|
|
40
|
-
}
|
|
41
|
+
}
|