postcss 7.0.2 → 7.0.6
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.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/CHANGELOG.md +14 -1
- package/README.md +35 -0
- package/docs/architecture.md +5 -5
- package/docs/guidelines/plugin.md +10 -10
- package/docs/guidelines/runner.md +2 -2
- package/lib/at-rule.js +21 -23
- package/lib/comment.js +15 -19
- package/lib/container.js +195 -205
- package/lib/css-syntax-error.js +42 -39
- package/lib/declaration.js +15 -19
- package/lib/input.js +56 -50
- package/lib/lazy-result.js +58 -76
- package/lib/list.js +7 -8
- package/lib/map-generator.js +110 -80
- package/lib/node.js +84 -89
- package/lib/parse.js +12 -12
- package/lib/parser.js +162 -104
- package/lib/postcss.d.ts +5 -1
- package/lib/postcss.js +43 -54
- package/lib/previous-map.js +42 -46
- package/lib/processor.js +32 -30
- package/lib/result.js +29 -26
- package/lib/root.js +24 -25
- package/lib/rule.js +20 -25
- package/lib/stringifier.js +72 -53
- package/lib/stringify.js +8 -8
- package/lib/terminal-highlight.js +30 -29
- package/lib/tokenize.js +57 -73
- package/lib/vendor.js +10 -9
- package/lib/warn-once.js +4 -3
- package/lib/warning.js +24 -17
- package/package.json +9 -3
- package/README-cn.md +0 -349
- package/gulpfile.js +0 -101
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
+
## 7.0.6
|
5
|
+
* Fix parsing files with BOM (by Veniamin Krol).
|
6
|
+
|
7
|
+
## 7.0.5
|
8
|
+
* Reduce npm package size (by Gilad Peleg).
|
9
|
+
|
10
|
+
## 7.0.4
|
11
|
+
* Fix safe parser regression.
|
12
|
+
|
13
|
+
## 7.0.3
|
14
|
+
* Fix tokenizer extendability (by Andrew Powell).
|
15
|
+
* Reduce npm package size.
|
16
|
+
|
4
17
|
## 7.0.2
|
5
18
|
* Fix warning text (by Rui Pedro M Lima).
|
6
19
|
|
@@ -9,7 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
9
22
|
|
10
23
|
## 7.0 “President Amy”
|
11
24
|
* Remove Node.js 9 and Node.js 4 support.
|
12
|
-
* Remove IE and “dead” browsers
|
25
|
+
* Remove IE and “dead” browsers support for client-side Babel transpiling.
|
13
26
|
* Add CSS position on error happened inside `walk()` (by Nikhil Gaba).
|
14
27
|
* Add `LazyResult#finally` (by Igor Kamyshev).
|
15
28
|
* Add warning on calling PostCSS without plugins and syntax options.
|
package/README.md
CHANGED
@@ -231,6 +231,41 @@ module.exports = {
|
|
231
231
|
|
232
232
|
[`postcss-loader`]: https://github.com/postcss/postcss-loader
|
233
233
|
|
234
|
+
### CSS-in-JS
|
235
|
+
|
236
|
+
The best way to use PostCSS with CSS-in-JS is [`astroturf`].
|
237
|
+
Add it’s loader to your `webpack.config.js`:
|
238
|
+
|
239
|
+
```js
|
240
|
+
module.exports = {
|
241
|
+
module: {
|
242
|
+
rules: [
|
243
|
+
{
|
244
|
+
test: /\.css$/,
|
245
|
+
use: ['style-loader', 'postcss-loader'],
|
246
|
+
},
|
247
|
+
{
|
248
|
+
test: /\.jsx?$/,
|
249
|
+
use: ['babel-loader', 'astroturf/loader'],
|
250
|
+
}
|
251
|
+
]
|
252
|
+
}
|
253
|
+
}
|
254
|
+
```
|
255
|
+
|
256
|
+
Then create `postcss.config.js`:
|
257
|
+
|
258
|
+
```js
|
259
|
+
module.exports = {
|
260
|
+
plugins: [
|
261
|
+
require('autoprefixer'),
|
262
|
+
require('postcss-nested')
|
263
|
+
]
|
264
|
+
}
|
265
|
+
```
|
266
|
+
|
267
|
+
[`astroturf`]: https://github.com/4Catalyzer/astroturf
|
268
|
+
|
234
269
|
### Gulp
|
235
270
|
|
236
271
|
Use [`gulp-postcss`] and [`gulp-sourcemaps`].
|
package/docs/architecture.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## PostCSS Architecture
|
2
2
|
|
3
|
-
General overview of PostCSS architecture.
|
3
|
+
General overview of the PostCSS architecture.
|
4
4
|
It can be useful for everyone who wish to contribute to core or develop better understanding of the tool.
|
5
5
|
|
6
6
|
**Table of Contents**
|
@@ -37,7 +37,7 @@ Before diving deeper into development of PostCSS let's briefly describe what is
|
|
37
37
|
|
38
38
|
### Workflow
|
39
39
|
|
40
|
-
This is high
|
40
|
+
This is high-level overview of whole PostCSS workflow
|
41
41
|
|
42
42
|
<img width="300" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/PostCSS_scheme.svg/512px-PostCSS_scheme.svg.png" alt="workflow">
|
43
43
|
|
@@ -54,7 +54,7 @@ That being said, there are few ways to write parser
|
|
54
54
|
- *Split it into lexical analysis/parsing steps (source string → tokens → AST)*
|
55
55
|
|
56
56
|
This is the way of how we do it in PostCSS and also the most popular one.
|
57
|
-
A lot of parsers like [`
|
57
|
+
A lot of parsers like [`@babel/parser` (parser behind Babel)](https://github.com/babel/babel/tree/master/packages/babel-parser), [`CSSTree`](https://github.com/csstree/csstree) were written in such way.
|
58
58
|
The main reasons to separate tokenization from parsing steps are performance and abstracting complexity.
|
59
59
|
|
60
60
|
Let think about why second way is better for our needs.
|
@@ -77,7 +77,7 @@ So now lets look more closely on structures that play main role in PostCSS workf
|
|
77
77
|
|
78
78
|
Token is a simple structure that describes some part of syntax like `at-rule`, `comment` or `word`. It can also contain positional information for more descriptive errors.
|
79
79
|
|
80
|
-
For example if we consider following
|
80
|
+
For example if we consider following CSS
|
81
81
|
|
82
82
|
```css
|
83
83
|
.className { color: #FFF; }
|
@@ -133,7 +133,7 @@ So now lets look more closely on structures that play main role in PostCSS workf
|
|
133
133
|
|
134
134
|
Parser works in common with Tokenizer and operates over tokens not source string, as it would be very inefficient operation.
|
135
135
|
|
136
|
-
It use mostly `nextToken` and `back` methods provided by Tokenizer for obtaining single or multiple tokens and
|
136
|
+
It use mostly `nextToken` and `back` methods provided by Tokenizer for obtaining single or multiple tokens and then construct part of AST called `Node`
|
137
137
|
|
138
138
|
There are multiple Node types that PostCSS could produce but all of them inherit from base Node [class](https://github.com/postcss/postcss/blob/master/lib/node.es6#L34).
|
139
139
|
|
@@ -22,34 +22,34 @@ The prefix `postcss-` shows that the plugin is part of the PostCSS ecosystem.
|
|
22
22
|
|
23
23
|
This rule is not mandatory for plugins that can run as independent tools,
|
24
24
|
without the user necessarily knowing that it is powered by
|
25
|
-
PostCSS — for example, [
|
25
|
+
PostCSS — for example, [RTLCSS] and [Autoprefixer].
|
26
26
|
|
27
27
|
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
28
|
-
[
|
28
|
+
[RTLCSS]: https://rtlcss.com/
|
29
29
|
|
30
30
|
### 1.2. Do one thing, and do it well
|
31
31
|
|
32
32
|
Do not create multitool plugins. Several small, one-purpose plugins bundled into
|
33
33
|
a plugin pack is usually a better solution.
|
34
34
|
|
35
|
-
For example, [
|
36
|
-
one for each W3C specification. And [cssnano] contains a separate plugin
|
35
|
+
For example, [`postcss-preset-env`] contains many small plugins,
|
36
|
+
one for each W3C specification. And [`cssnano`] contains a separate plugin
|
37
37
|
for each of its optimization.
|
38
38
|
|
39
|
-
[
|
40
|
-
[cssnano]:
|
39
|
+
[`postcss-preset-env`]: https://preset-env.cssdb.org/
|
40
|
+
[`cssnano`]: https://github.com/ben-eb/cssnano
|
41
41
|
|
42
42
|
### 1.3. Do not use mixins
|
43
43
|
|
44
44
|
Preprocessors libraries like Compass provide an API with mixins.
|
45
45
|
|
46
46
|
PostCSS plugins are different.
|
47
|
-
A plugin cannot be just a set of mixins for [postcss-mixins].
|
47
|
+
A plugin cannot be just a set of mixins for [`postcss-mixins`].
|
48
48
|
|
49
49
|
To achieve your goal, consider transforming valid CSS
|
50
50
|
or using custom at-rules and custom properties.
|
51
51
|
|
52
|
-
[postcss-mixins]: https://github.com/postcss/postcss-mixins
|
52
|
+
[`postcss-mixins`]: https://github.com/postcss/postcss-mixins
|
53
53
|
|
54
54
|
### 1.4. Create plugin by `postcss.plugin`
|
55
55
|
|
@@ -98,7 +98,7 @@ postcss.plugin('plugin-sprite', opts => {
|
|
98
98
|
Every node must have a relevant `source` so PostCSS can generate
|
99
99
|
an accurate source map.
|
100
100
|
|
101
|
-
So if you add new declaration based on some existing declaration, you should
|
101
|
+
So if you add a new declaration based on some existing declaration, you should
|
102
102
|
clone the existing declaration in order to save that original `source`.
|
103
103
|
|
104
104
|
```js
|
@@ -156,7 +156,7 @@ If CSS input is a source of the warning, the plugin must set the `node` option.
|
|
156
156
|
|
157
157
|
### 4.1. Document your plugin in English
|
158
158
|
|
159
|
-
PostCSS plugins must have their `README.md`
|
159
|
+
PostCSS plugins must have their `README.md` wrote in English. Do not be afraid
|
160
160
|
of your English skills, as the open source community will fix your errors.
|
161
161
|
|
162
162
|
Of course, you are welcome to write documentation in other languages;
|
@@ -115,7 +115,7 @@ if (result.map) {
|
|
115
115
|
|
116
116
|
### 4.1. Document your runner in English
|
117
117
|
|
118
|
-
PostCSS runners must have their `README.md`
|
118
|
+
PostCSS runners must have their `README.md` wrote in English. Do not be afraid
|
119
119
|
of your English skills, as the open source community will fix your errors.
|
120
120
|
|
121
121
|
Of course, you are welcome to write documentation in other languages;
|
@@ -127,7 +127,7 @@ PostCSS runners must describe changes of all releases in a separate file,
|
|
127
127
|
such as `ChangeLog.md`, `History.md`, or with [GitHub Releases].
|
128
128
|
Visit [Keep A Changelog] for more information on how to write one of these.
|
129
129
|
|
130
|
-
Of course you should use [SemVer].
|
130
|
+
Of course, you should use [SemVer].
|
131
131
|
|
132
132
|
[Keep A Changelog]: http://keepachangelog.com/
|
133
133
|
[GitHub Releases]: https://help.github.com/articles/creating-releases/
|
package/lib/at-rule.js
CHANGED
@@ -1,18 +1,13 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
exports.default = void 0;
|
4
5
|
|
5
|
-
var _container = require(
|
6
|
-
|
7
|
-
var _container2 = _interopRequireDefault(_container);
|
6
|
+
var _container = _interopRequireDefault(require("./container"));
|
8
7
|
|
9
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
9
|
|
11
|
-
function
|
12
|
-
|
13
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14
|
-
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
10
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
16
11
|
|
17
12
|
/**
|
18
13
|
* Represents an at-rule.
|
@@ -32,42 +27,44 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
32
27
|
* const media = root.last
|
33
28
|
* media.nodes //=> []
|
34
29
|
*/
|
35
|
-
var AtRule =
|
36
|
-
|
30
|
+
var AtRule =
|
31
|
+
/*#__PURE__*/
|
32
|
+
function (_Container) {
|
33
|
+
_inheritsLoose(AtRule, _Container);
|
37
34
|
|
38
35
|
function AtRule(defaults) {
|
39
|
-
|
40
|
-
|
41
|
-
var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
|
36
|
+
var _this;
|
42
37
|
|
38
|
+
_this = _Container.call(this, defaults) || this;
|
43
39
|
_this.type = 'atrule';
|
44
40
|
return _this;
|
45
41
|
}
|
46
42
|
|
47
|
-
AtRule.prototype
|
43
|
+
var _proto = AtRule.prototype;
|
44
|
+
|
45
|
+
_proto.append = function append() {
|
48
46
|
var _Container$prototype$;
|
49
47
|
|
50
48
|
if (!this.nodes) this.nodes = [];
|
51
49
|
|
52
|
-
for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
|
50
|
+
for (var _len = arguments.length, children = new Array(_len), _key = 0; _key < _len; _key++) {
|
53
51
|
children[_key] = arguments[_key];
|
54
52
|
}
|
55
53
|
|
56
54
|
return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
|
57
55
|
};
|
58
56
|
|
59
|
-
|
57
|
+
_proto.prepend = function prepend() {
|
60
58
|
var _Container$prototype$2;
|
61
59
|
|
62
60
|
if (!this.nodes) this.nodes = [];
|
63
61
|
|
64
|
-
for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
62
|
+
for (var _len2 = arguments.length, children = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
65
63
|
children[_key2] = arguments[_key2];
|
66
64
|
}
|
67
65
|
|
68
66
|
return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
|
69
67
|
};
|
70
|
-
|
71
68
|
/**
|
72
69
|
* @memberof AtRule#
|
73
70
|
* @member {string} name The at-rule’s name immediately follows the `@`.
|
@@ -124,8 +121,9 @@ var AtRule = function (_Container) {
|
|
124
121
|
|
125
122
|
|
126
123
|
return AtRule;
|
127
|
-
}(
|
124
|
+
}(_container.default);
|
128
125
|
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
var _default = AtRule;
|
127
|
+
exports.default = _default;
|
128
|
+
module.exports = exports.default;
|
129
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIiwiQ29udGFpbmVyIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBOzs7Ozs7QUFFQT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AgKiAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgIGFmdGVyTmFtZTogJ1xcbicsXG4gICAqICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgYWZ0ZXI6ICdcXG4nIH1cbiAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZVxuIl0sImZpbGUiOiJhdC1ydWxlLmpzIn0=
|
package/lib/comment.js
CHANGED
@@ -1,18 +1,13 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
exports.default = void 0;
|
4
5
|
|
5
|
-
var _node = require(
|
6
|
-
|
7
|
-
var _node2 = _interopRequireDefault(_node);
|
6
|
+
var _node = _interopRequireDefault(require("./node"));
|
8
7
|
|
9
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
9
|
|
11
|
-
function
|
12
|
-
|
13
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
14
|
-
|
15
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
10
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
16
11
|
|
17
12
|
/**
|
18
13
|
* Represents a comment between declarations or statements (rule and at-rules).
|
@@ -22,18 +17,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
22
17
|
*
|
23
18
|
* @extends Node
|
24
19
|
*/
|
25
|
-
var Comment =
|
26
|
-
|
20
|
+
var Comment =
|
21
|
+
/*#__PURE__*/
|
22
|
+
function (_Node) {
|
23
|
+
_inheritsLoose(Comment, _Node);
|
27
24
|
|
28
25
|
function Comment(defaults) {
|
29
|
-
|
30
|
-
|
31
|
-
var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
|
26
|
+
var _this;
|
32
27
|
|
28
|
+
_this = _Node.call(this, defaults) || this;
|
33
29
|
_this.type = 'comment';
|
34
30
|
return _this;
|
35
31
|
}
|
36
|
-
|
37
32
|
/**
|
38
33
|
* @memberof Comment#
|
39
34
|
* @member {string} text The comment’s text.
|
@@ -54,8 +49,9 @@ var Comment = function (_Node) {
|
|
54
49
|
|
55
50
|
|
56
51
|
return Comment;
|
57
|
-
}(
|
52
|
+
}(_node.default);
|
58
53
|
|
59
|
-
|
60
|
-
|
61
|
-
|
54
|
+
var _default = Comment;
|
55
|
+
exports.default = _default;
|
56
|
+
module.exports = exports.default;
|
57
|
+
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiLCJOb2RlIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBOzs7Ozs7QUFFQTs7Ozs7Ozs7SUFRTUEsTzs7Ozs7QUFDSixtQkFBYUMsUUFBYixFQUF1QjtBQUFBOztBQUNyQiw2QkFBTUEsUUFBTjtBQUNBLFVBQUtDLElBQUwsR0FBWSxTQUFaO0FBRnFCO0FBR3RCO0FBRUQ7Ozs7O0FBS0E7Ozs7Ozs7Ozs7Ozs7OztFQVhvQkMsYTs7ZUF5QlBILE8iLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgTm9kZSBmcm9tICcuL25vZGUnXG5cbi8qKlxuICogUmVwcmVzZW50cyBhIGNvbW1lbnQgYmV0d2VlbiBkZWNsYXJhdGlvbnMgb3Igc3RhdGVtZW50cyAocnVsZSBhbmQgYXQtcnVsZXMpLlxuICpcbiAq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