postcss-unique-selectors
Advanced tools
Comparing version 4.0.1 to 5.0.0-rc.0
@@ -1,24 +0,36 @@ | ||
# 4.0.0-rc.0 | ||
# Change Log | ||
* Breaking: Drops support for Node 0.12, we now require at least Node 4. | ||
* Breaking: Update PostCSS to 6.0.0. | ||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
# 2.0.2 | ||
# 5.0.0-rc.0 (2021-02-19) | ||
* Now compiled with babel 6. | ||
# 2.0.1 | ||
### Bug Fixes | ||
* Replaced javascript-natural-sort with alphanum-sort (thanks to @TrySound). | ||
* **unique-selector:** removed sorting and involving selector comments ([#857](https://github.com/cssnano/cssnano/issues/857)) ([3fa875d](https://github.com/cssnano/cssnano/commit/3fa875dade2138e1a531dce1f8b79814cb39dbc9)) | ||
# 2.0.0 | ||
* Upgraded to PostCSS 5. | ||
### chore | ||
# 1.0.1 | ||
* minimum require version of node is 10.13 ([#871](https://github.com/cssnano/cssnano/issues/871)) ([28bda24](https://github.com/cssnano/cssnano/commit/28bda243e32ce3ba89b3c358a5f78727b3732f11)) | ||
* Removed an unnecessary dependency on css-list. | ||
# 1.0.0 | ||
### Features | ||
* Initial release. | ||
* migarete to PostCSS 8 ([#975](https://github.com/cssnano/cssnano/issues/975)) ([40b82dc](https://github.com/cssnano/cssnano/commit/40b82dca7f53ac02cd4fe62846dec79b898ccb49)) | ||
### BREAKING CHANGES | ||
* minimum supported `postcss` version is `8.2.1` | ||
* minimum require version of node is 10.13 | ||
## 4.1.1 (2018-09-24) | ||
### Bug Fixes | ||
* **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) |
@@ -1,26 +0,55 @@ | ||
'use strict'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _postcss = require('postcss'); | ||
var _alphanumSort = _interopRequireDefault(require("alphanum-sort")); | ||
var _alphanumSort = require('alphanum-sort'); | ||
var _uniqs = _interopRequireDefault(require("uniqs")); | ||
var _alphanumSort2 = _interopRequireDefault(_alphanumSort); | ||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser")); | ||
var _uniqs = require('uniqs'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _uniqs2 = _interopRequireDefault(_uniqs); | ||
function parseSelectors(selectors, callback) { | ||
return (0, _postcssSelectorParser.default)(callback).processSync(selectors); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function unique(rule) { | ||
rule.selector = (0, _alphanumSort2.default)((0, _uniqs2.default)(rule.selectors), { insensitive: true }).join(); | ||
rule.selector = (0, _alphanumSort.default)((0, _uniqs.default)(rule.selectors), { | ||
insensitive: true | ||
}).join(); | ||
} | ||
exports.default = (0, _postcss.plugin)('postcss-unique-selectors', () => { | ||
return css => css.walkRules(unique); | ||
}); | ||
module.exports = exports['default']; | ||
function pluginCreator() { | ||
return { | ||
postcssPlugin: 'postcss-unique-selectors', | ||
OnceExit(css) { | ||
css.walkRules(nodes => { | ||
let comments = []; | ||
nodes.selector = parseSelectors(nodes.selector, selNode => { | ||
selNode.walk(sel => { | ||
if (sel.type === 'comment') { | ||
comments.push(sel.value); | ||
sel.remove(); | ||
return; | ||
} else { | ||
return sel; | ||
} | ||
}); | ||
}); | ||
unique(nodes); | ||
nodes.selectors = nodes.selectors.concat(comments); | ||
}); | ||
} | ||
}; | ||
} | ||
pluginCreator.postcss = true; | ||
var _default = pluginCreator; | ||
exports.default = _default; | ||
module.exports = exports.default; |
{ | ||
"name": "postcss-unique-selectors", | ||
"version": "4.0.1", | ||
"version": "5.0.0-rc.0", | ||
"description": "Ensure CSS selectors are unique.", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/" | ||
"prebuild": "del-cli dist", | ||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.js --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepublish": "yarn build" | ||
}, | ||
@@ -26,9 +28,5 @@ "files": [ | ||
"repository": "cssnano/cssnano", | ||
"devDependencies": { | ||
"babel-cli": "^6.0.0", | ||
"cross-env": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"alphanum-sort": "^1.0.0", | ||
"postcss": "^7.0.0", | ||
"alphanum-sort": "^1.0.2", | ||
"postcss-selector-parser": "^6.0.2", | ||
"uniqs": "^2.0.0" | ||
@@ -40,4 +38,11 @@ }, | ||
"engines": { | ||
"node": ">=6.9.0" | ||
} | ||
"node": "^10 || ^12 || >=14.0" | ||
}, | ||
"devDependencies": { | ||
"postcss": "^8.2.1" | ||
}, | ||
"peerDependencies": { | ||
"postcss": "^8.2.1" | ||
}, | ||
"gitHead": "8c16e67a4d24a13ac7e09a36d4faf504196efd0f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5622
1
43
4
1
+ Addedcssesc@3.0.0(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedpostcss-selector-parser@6.1.2(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedpostcss@^7.0.0
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedsource-map@0.6.1(transitive)
Updatedalphanum-sort@^1.0.2