postcss
Advanced tools
Comparing version 4.1.14 to 4.1.15
@@ -0,1 +1,4 @@ | ||
## 4.1.15 | ||
* Allow asynchronous plugins to change processor plugins list (by Ben Briggs). | ||
## 4.1.14 | ||
@@ -2,0 +5,0 @@ * Fix for plugins packs defined by `postcss.plugin`. |
@@ -99,15 +99,19 @@ 'use strict'; | ||
LazyResult.prototype.asyncTick = function asyncTick(plugins, resolve, reject) { | ||
LazyResult.prototype.asyncTick = function asyncTick(resolve, reject) { | ||
var _this = this; | ||
if (plugins.length === 0) return resolve(); | ||
if (this.plugin >= this.processor.plugins.length) { | ||
this.processed = true; | ||
return resolve(); | ||
} | ||
try { | ||
(function () { | ||
var plugin = plugins.shift(); | ||
var plugin = _this.processor.plugins[_this.plugin]; | ||
var promise = _this.run(plugin); | ||
_this.plugin += 1; | ||
if (isPromise(promise)) { | ||
promise.then(function () { | ||
_this.asyncTick(plugins, resolve, reject); | ||
_this.asyncTick(resolve, reject); | ||
})['catch'](function (error) { | ||
@@ -119,3 +123,3 @@ _this.handleError(error, plugin); | ||
} else { | ||
_this.asyncTick(plugins, resolve, reject); | ||
_this.asyncTick(resolve, reject); | ||
} | ||
@@ -145,6 +149,6 @@ })(); | ||
var plugins = this.processor.plugins.slice(0); | ||
this.processing = new Promise(function (resolve, reject) { | ||
if (_this2.error) return reject(_this2.error); | ||
_this2.asyncTick(plugins, resolve, reject); | ||
_this2.plugin = 0; | ||
_this2.asyncTick(resolve, reject); | ||
}).then(function () { | ||
@@ -151,0 +155,0 @@ _this2.processed = true; |
{ | ||
"name": "postcss", | ||
"version": "4.1.14", | ||
"version": "4.1.15", | ||
"description": "Tool for transforming CSS with JS plugins", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"gulp-run": "1.6.8", | ||
"fs-extra": "0.20.1", | ||
"fs-extra": "0.21.0", | ||
"sinon": "1.15.4", | ||
@@ -39,0 +39,0 @@ "mocha": "2.2.5", |
@@ -218,3 +218,3 @@ # PostCSS [![Build Status][ci-img]][ci] [![Gitter][chat-img]][chat] | ||
See also [`cssnext`] plugins pack to add Future CSS syntax by one line of code. | ||
See also [`cssnext`] plugins pack to add future CSS syntax by one line of code. | ||
@@ -303,4 +303,5 @@ ### Fallbacks | ||
* [`postcss-border`] adds shorthand declarations for width | ||
and color of all borders in `border` property. | ||
* [`postcss-alias`] to create shorter aliases for properties. | ||
* [`postcss-border`] adds shorthand for width and color of all borders | ||
in `border` property. | ||
* [`postcss-clearfix`] adds `fix` and `fix-legacy` properties to the `clear` | ||
@@ -338,2 +339,3 @@ declaration. | ||
* [`rtlcss`] mirrors styles for right-to-left locales. | ||
* [`stylehacks`] removes CSS hacks based on browser support. | ||
@@ -445,2 +447,3 @@ ### Analysis | ||
[`postcss-short`]: https://github.com/jonathantneal/postcss-short | ||
[`postcss-alias`]: https://github.com/seaneking/postcss-alias | ||
[`postcss-at2x`]: https://github.com/simonsmith/postcss-at2x | ||
@@ -462,2 +465,3 @@ [`postcss-calc`]: https://github.com/postcss/postcss-calc | ||
[`css-byebye`]: https://github.com/AoDev/css-byebye | ||
[`stylehacks`]: https://github.com/ben-eb/stylehacks | ||
[`cssgrace`]: https://github.com/cssdream/cssgrace | ||
@@ -464,0 +468,0 @@ [`csstyle`]: https://github.com/geddski/csstyle |
137300
2452
559