postcss-unique-selectors 5.0.0-rc.2 → 5.0.3

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/dist/index.js CHANGED
@@ -5,10 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _alphanumSort = _interopRequireDefault(require("alphanum-sort"));
9
-
10
- var _uniqs = _interopRequireDefault(require("uniqs"));
11
-
12
8
  var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
13
9
 
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -18,9 +14,9 @@ function parseSelectors(selectors, callback) {
18
14
  }
19
15
 
20
16
  function unique(rule) {
21
- rule.selector = (0, _alphanumSort.default)((0, _uniqs.default)(rule.selectors), {
22
- insensitive: true
23
- }).join();
17
+ const selector = [...new Set(rule.selectors)];
18
+ selector.sort();
19
+ rule.selector = selector.join();
24
20
  }
25
21
 
26
22
  function pluginCreator() {
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "postcss-unique-selectors",
3
- "version": "5.0.0-rc.2",
3
+ "version": "5.0.3",
4
4
  "description": "Ensure CSS selectors are unique.",
5
5
  "main": "dist/index.js",
6
- "scripts": {
7
- "prebuild": "del-cli dist",
8
- "build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.js --out-dir dist --ignore \"**/__tests__/\"",
9
- "prepublish": "yarn build"
10
- },
11
6
  "files": [
12
7
  "LICENSE-MIT",
13
8
  "dist"
@@ -26,9 +21,7 @@
26
21
  },
27
22
  "repository": "cssnano/cssnano",
28
23
  "dependencies": {
29
- "alphanum-sort": "^1.0.2",
30
- "postcss-selector-parser": "^6.0.2",
31
- "uniqs": "^2.0.0"
24
+ "postcss-selector-parser": "^6.0.5"
32
25
  },
33
26
  "bugs": {
34
27
  "url": "https://github.com/cssnano/cssnano/issues"
@@ -37,10 +30,14 @@
37
30
  "node": "^10 || ^12 || >=14.0"
38
31
  },
39
32
  "devDependencies": {
40
- "postcss": "^8.2.1"
33
+ "postcss": "^8.2.15"
41
34
  },
42
35
  "peerDependencies": {
43
- "postcss": "^8.2.1"
36
+ "postcss": "^8.2.15"
37
+ },
38
+ "scripts": {
39
+ "prebuild": "rimraf dist",
40
+ "build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\""
44
41
  },
45
- "gitHead": "5ba19ca54892f76ba6b2b698b4d88adcabd4451b"
46
- }
42
+ "readme": "# [postcss][postcss]-unique-selectors\n\n> Ensure CSS selectors are unique.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-unique-selectors) do:\n\n```\nnpm install postcss-unique-selectors --save\n```\n\n## Example\n\nSelectors are sorted naturally, and deduplicated:\n\n### Input\n\n```css\nh1,h3,h2,h1 {\n color: red\n}\n```\n\n### Output\n\n```css\nh1,h2,h3 {\n color: red\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
43
+ }
package/CHANGELOG.md DELETED
@@ -1,52 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [5.0.0-rc.2](https://github.com/cssnano/cssnano/compare/postcss-unique-selectors@5.0.0-rc.1...postcss-unique-selectors@5.0.0-rc.2) (2021-03-15)
7
-
8
- **Note:** Version bump only for package postcss-unique-selectors
9
-
10
-
11
-
12
-
13
-
14
- # [5.0.0-rc.1](https://github.com/cssnano/cssnano/compare/postcss-unique-selectors@5.0.0-rc.0...postcss-unique-selectors@5.0.0-rc.1) (2021-03-04)
15
-
16
- **Note:** Version bump only for package postcss-unique-selectors
17
-
18
-
19
-
20
-
21
-
22
- # 5.0.0-rc.0 (2021-02-19)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * **unique-selector:** removed sorting and involving selector comments ([#857](https://github.com/cssnano/cssnano/issues/857)) ([3fa875d](https://github.com/cssnano/cssnano/commit/3fa875dade2138e1a531dce1f8b79814cb39dbc9))
28
-
29
-
30
- ### chore
31
-
32
- * minimum require version of node is 10.13 ([#871](https://github.com/cssnano/cssnano/issues/871)) ([28bda24](https://github.com/cssnano/cssnano/commit/28bda243e32ce3ba89b3c358a5f78727b3732f11))
33
-
34
-
35
- ### Features
36
-
37
- * migarete to PostCSS 8 ([#975](https://github.com/cssnano/cssnano/issues/975)) ([40b82dc](https://github.com/cssnano/cssnano/commit/40b82dca7f53ac02cd4fe62846dec79b898ccb49))
38
-
39
-
40
- ### BREAKING CHANGES
41
-
42
- * minimum supported `postcss` version is `8.2.1`
43
- * minimum require version of node is 10.13
44
-
45
-
46
-
47
- ## 4.1.1 (2018-09-24)
48
-
49
-
50
- ### Bug Fixes
51
-
52
- * **postcss-merge-longhand:** not mangle border output ([#555](https://github.com/cssnano/cssnano/issues/555)) ([9a70605](https://github.com/cssnano/cssnano/commit/9a706050b621e7795a9bf74eb7110b5c81804ffe)), closes [#553](https://github.com/cssnano/cssnano/issues/553) [#554](https://github.com/cssnano/cssnano/issues/554)