Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,29 @@
# 2.1.0
* postcss-discard-empty will now report the rules that were removed
(thanks to @duncanbeevers).
# 2.0.1
* Now compiled with babel 6.
# 2.0.0
* Upgraded to PostCSS 5.
# 1.1.2
* Increased performance by iterating the AST in a single pass
(thanks to @andyjansson).
# 1.1.1
* Tweaks for compatibility with the plugin guidelines.
# 1.1.0
* Now uses the PostCSS `4.1` plugin API.
# 1.0.0
* Initial release.

View File

@@ -0,0 +1,22 @@
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,50 @@
# [postcss][postcss]-discard-empty [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-empty.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-empty.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-empty.svg)][deps]
> Discard empty rules and values with PostCSS.
## Install
With [npm](https://npmjs.org/package/postcss-discard-empty) do:
```
npm install postcss-discard-empty --save
```
## Example
For more examples see the [tests](test.js).
### Input
```css
@font-face;
h1 {}
{color:blue}
h2 {color:}
h3 {color:red}
```
### Output
```css
h3 {color:red}
```
## Usage
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
examples for your environment.
## Contributing
Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.
## License
MIT © [Ben Briggs](http://beneb.info)
[ci]: https://travis-ci.org/ben-eb/postcss-discard-empty
[deps]: https://gemnasium.com/ben-eb/postcss-discard-empty
[npm]: http://badge.fury.io/js/postcss-discard-empty
[postcss]: https://github.com/postcss/postcss

View File

@@ -0,0 +1,36 @@
'use strict';
exports.__esModule = true;
var _postcss = require('postcss');
function discardAndReport(css, result) {
function discardEmpty(node) {
var type = node.type;
var sub = node.nodes;
if (sub) {
node.each(discardEmpty);
}
if (type === 'decl' && !node.value || type === 'rule' && !node.selector || sub && !sub.length || type === 'atrule' && (!sub && !node.params || !node.params && !sub.length)) {
node.remove();
result.messages.push({
type: 'removal',
plugin: 'postcss-discard-empty',
node: node
});
}
}
css.each(discardEmpty);
}
exports.default = (0, _postcss.plugin)('postcss-discard-empty', function () {
return function (css, result) {
return discardAndReport(css, result);
};
});
module.exports = exports['default'];

View File

@@ -0,0 +1,87 @@
{
"_args": [
[
"postcss-discard-empty@2.1.0",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "postcss-discard-empty@2.1.0",
"_id": "postcss-discard-empty@2.1.0",
"_inBundle": false,
"_integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=",
"_location": "/css-loader/postcss-discard-empty",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "postcss-discard-empty@2.1.0",
"name": "postcss-discard-empty",
"escapedName": "postcss-discard-empty",
"rawSpec": "2.1.0",
"saveSpec": null,
"fetchSpec": "2.1.0"
},
"_requiredBy": [
"/css-loader/cssnano"
],
"_resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz",
"_spec": "2.1.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"ava": {
"require": "babel-core/register"
},
"bugs": {
"url": "https://github.com/ben-eb/postcss-discard-empty/issues"
},
"dependencies": {
"postcss": "^5.0.14"
},
"description": "Discard empty rules and values with PostCSS.",
"devDependencies": {
"ava": "^0.14.0",
"babel-cli": "^6.4.5",
"babel-core": "^6.4.5",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.3.13",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.3.13",
"del-cli": "^0.2.0",
"eslint": "^2.0.0",
"eslint-config-cssnano": "^2.0.0"
},
"eslintConfig": {
"extends": "cssnano"
},
"files": [
"dist",
"LICENSE-MIT"
],
"homepage": "https://github.com/ben-eb/postcss-discard-empty",
"keywords": [
"compress",
"css",
"empty",
"minify",
"optimisation",
"postcss",
"postcss-plugin"
],
"license": "MIT",
"main": "dist/index.js",
"name": "postcss-discard-empty",
"repository": {
"type": "git",
"url": "git+https://github.com/ben-eb/postcss-discard-empty.git"
},
"scripts": {
"prepublish": "del-cli dist && babel src --out-dir dist --ignore /__tests__/",
"pretest": "eslint src",
"test": "ava src/__tests__"
},
"version": "2.1.0"
}