postcss-discard-comments
Advanced tools
Comparing version 2.0.4 to 4.0.0-rc.0
@@ -0,1 +1,6 @@ | ||
# 4.0.0-rc.0 | ||
* Breaking: Drops support for Node 0.12, we now require at least Node 4. | ||
* Breaking: Update PostCSS to 6.0.0. | ||
# 2.0.4 | ||
@@ -2,0 +7,0 @@ |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _postcss = require('postcss'); | ||
var _commentRemover = require('./lib/commentRemover'); | ||
@@ -13,10 +17,7 @@ | ||
var _postcss = require('postcss'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var space = _postcss.list.space; | ||
exports.default = (0, _postcss.plugin)('postcss-discard-comments', function () { | ||
var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
@@ -32,7 +33,4 @@ var remover = new _commentRemover2.default(opts); | ||
function replaceComments(source) { | ||
var separator = arguments.length <= 1 || arguments[1] === undefined ? ' ' : arguments[1]; | ||
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' '; | ||
if (!source) { | ||
return source; | ||
} | ||
var parsed = (0, _commentParser2.default)(source).reduce(function (value, node) { | ||
@@ -39,0 +37,0 @@ if (node.type !== 'comment') { |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = commentParser; | ||
@@ -9,3 +11,3 @@ function commentParser(input) { | ||
var pos = 0; | ||
var next = undefined; | ||
var next = void 0; | ||
@@ -23,5 +25,2 @@ while (pos < length) { | ||
next = input.indexOf('*/', pos + 2); | ||
if (! ~next) { | ||
throw new Error('postcss-discard-comments: Unclosed */'); | ||
} | ||
tokens.push({ | ||
@@ -28,0 +27,0 @@ type: 'comment', |
'use strict'; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function CommentRemover(options) { | ||
@@ -16,10 +18,10 @@ this.options = options; | ||
return true; | ||
} else if (isImportant) { | ||
if (this.options.removeAll || this._hasFirst) { | ||
return true; | ||
} else if (this.options.removeAllButFirst && !this._hasFirst) { | ||
this._hasFirst = true; | ||
return false; | ||
} | ||
} | ||
if (this.options.removeAll || this._hasFirst) { | ||
return true; | ||
} else if (this.options.removeAllButFirst && !this._hasFirst) { | ||
this._hasFirst = true; | ||
return false; | ||
} | ||
} | ||
@@ -26,0 +28,0 @@ }; |
{ | ||
"name": "postcss-discard-comments", | ||
"version": "2.0.4", | ||
"version": "4.0.0-rc.0", | ||
"description": "Discard comments in your CSS files with PostCSS.", | ||
@@ -11,5 +11,3 @@ "main": "dist/index.js", | ||
"scripts": { | ||
"pretest": "eslint src", | ||
"prepublish": "del-cli dist && BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/", | ||
"test": "ava src/__tests__" | ||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/" | ||
}, | ||
@@ -24,16 +22,8 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "^0.11.0", | ||
"babel-cli": "^6.5.1", | ||
"babel-core": "^6.5.1", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-preset-es2015": "^6.5.0", | ||
"babel-preset-es2015-loose": "^7.0.0", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"del-cli": "^0.2.0", | ||
"eslint": "^1.10.3", | ||
"eslint-config-cssnano": "^1.0.0", | ||
"postcss-scss": "^0.1.3", | ||
"postcss-simple-vars": "^1.2.0" | ||
"babel-cli": "^6.0.0", | ||
"cross-env": "^3.0.0", | ||
"postcss-scss": "^0.3.0", | ||
"postcss-simple-vars": "^3.0.0" | ||
}, | ||
"homepage": "https://github.com/ben-eb/postcss-discard-comments", | ||
"homepage": "https://github.com/ben-eb/cssnano", | ||
"author": { | ||
@@ -44,12 +34,12 @@ "name": "Ben Briggs", | ||
}, | ||
"repository": "ben-eb/postcss-discard-comments", | ||
"repository": "ben-eb/cssnano", | ||
"dependencies": { | ||
"postcss": "^5.0.14" | ||
"postcss": "^6.0.0" | ||
}, | ||
"ava": { | ||
"require": "babel-core/register" | ||
"bugs": { | ||
"url": "https://github.com/ben-eb/cssnano/issues" | ||
}, | ||
"eslintConfig": { | ||
"extends": "cssnano" | ||
"engines": { | ||
"node": ">=4" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# [postcss][postcss]-discard-comments [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-comments.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-comments.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-comments.svg)][deps] | ||
# [postcss][postcss]-discard-comments | ||
@@ -104,6 +104,5 @@ > Discard comments in your CSS files with PostCSS. | ||
## Contributing | ||
## Contributors | ||
Pull requests are welcome. If you add functionality, then please add unit tests | ||
to cover it. | ||
See [CONTRIBUTORS.md](https://github.com/ben-eb/cssnano/blob/master/CONTRIBUTORS.md). | ||
@@ -113,8 +112,5 @@ | ||
MIT © Ben Briggs | ||
MIT © [Ben Briggs](http://beneb.info) | ||
[ci]: https://travis-ci.org/ben-eb/postcss-discard-comments | ||
[deps]: https://gemnasium.com/ben-eb/postcss-discard-comments | ||
[npm]: http://badge.fury.io/js/postcss-discard-comments | ||
[postcss]: https://github.com/postcss/postcss |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the 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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4
0
0
11283
136
115
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedpostcss@6.0.23(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedjs-base64@2.6.4(transitive)
- Removedpostcss@5.2.18(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.03.2.3(transitive)
Updatedpostcss@^6.0.0