postcss 8.1.6 → 8.1.10
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 +15 -1
- package/README.md +5 -5
- package/lib/at-rule.js +1 -0
- package/lib/comment.js +1 -0
- package/lib/container.js +1 -0
- package/lib/css-syntax-error.js +1 -0
- package/lib/declaration.js +1 -0
- package/lib/input.js +10 -3
- package/lib/lazy-result.d.ts +7 -1
- package/lib/lazy-result.js +5 -0
- package/lib/list.js +1 -0
- package/lib/node.js +1 -0
- package/lib/parse.js +1 -0
- package/lib/postcss.d.ts +2 -0
- package/lib/postcss.js +1 -0
- package/lib/previous-map.js +1 -0
- package/lib/processor.js +2 -1
- package/lib/result.js +1 -0
- package/lib/root.js +1 -0
- package/lib/rule.js +1 -0
- package/lib/stringify.js +4 -1
- package/lib/warning.js +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Change Log
|
2
|
-
This project adheres to [Semantic Versioning](
|
2
|
+
This project adheres to [Semantic Versioning](https://semver.org/).
|
3
|
+
|
4
|
+
## 8.1.10
|
5
|
+
* Fixed `LazyResult` type export (by Evan You).
|
6
|
+
* Fixed `LazyResult` type compatibility with `Promise` (by Anton Kastritskiy).
|
7
|
+
|
8
|
+
## 8.1.9
|
9
|
+
* Reduced dependencies number (by Bogdan Chadkin).
|
10
|
+
|
11
|
+
## 8.1.8
|
12
|
+
* Fixed `LazyResult` type compatibility with `Promise` (by Ludovico Fischer).
|
13
|
+
* Fixed HTTPS links in documentation.
|
14
|
+
|
15
|
+
## 8.1.7
|
16
|
+
* Fixed `import` support in TypeScript (by Remco Haszing).
|
3
17
|
|
4
18
|
## 8.1.6
|
5
19
|
* Reverted `package.exports` Node.js 15 fix.
|
package/README.md
CHANGED
@@ -60,7 +60,7 @@ on top of PostCSS.
|
|
60
60
|
|
61
61
|
If you have any new ideas, [PostCSS plugin development] is really easy.
|
62
62
|
|
63
|
-
[searchable catalog]:
|
63
|
+
[searchable catalog]: https://www.postcss.parts/
|
64
64
|
[plugins list]: https://github.com/postcss/postcss/blob/master/docs/plugins.md
|
65
65
|
|
66
66
|
|
@@ -139,7 +139,7 @@ If you have any new ideas, [PostCSS plugin development] is really easy.
|
|
139
139
|
[`colorguard`]: https://github.com/SlexAxton/css-colorguard
|
140
140
|
[`stylelint`]: https://github.com/stylelint/stylelint
|
141
141
|
[`stylefmt`]: https://github.com/morishitter/stylefmt
|
142
|
-
[`cssnano`]:
|
142
|
+
[`cssnano`]: https://cssnano.co/
|
143
143
|
[`precss`]: https://github.com/jonathantneal/precss
|
144
144
|
[`doiuse`]: https://github.com/anandthakker/doiuse
|
145
145
|
[`rtlcss`]: https://github.com/MohammadYounes/rtlcss
|
@@ -190,8 +190,8 @@ you can write a parser and/or stringifier to extend PostCSS.
|
|
190
190
|
## Articles
|
191
191
|
|
192
192
|
* [Some things you may think about PostCSS… and you might be wrong](http://julian.io/some-things-you-may-think-about-postcss-and-you-might-be-wrong)
|
193
|
-
* [What PostCSS Really Is; What It Really Does](
|
194
|
-
* [PostCSS Guides](
|
193
|
+
* [What PostCSS Really Is; What It Really Does](https://davidtheclark.com/its-time-for-everyone-to-learn-about-postcss/)
|
194
|
+
* [PostCSS Guides](https://webdesign.tutsplus.com/series/postcss-deep-dive--cms-889)
|
195
195
|
|
196
196
|
More articles and videos you can find on [awesome-postcss](https://github.com/jjaderg/awesome-postcss) list.
|
197
197
|
|
@@ -208,7 +208,7 @@ You can start using PostCSS in just two steps:
|
|
208
208
|
1. Find and add PostCSS extensions for your build tool.
|
209
209
|
2. [Select plugins] and add them to your PostCSS process.
|
210
210
|
|
211
|
-
[Select plugins]:
|
211
|
+
[Select plugins]: https://www.postcss.parts/
|
212
212
|
|
213
213
|
|
214
214
|
### CSS-in-JS
|
package/lib/at-rule.js
CHANGED
package/lib/comment.js
CHANGED
package/lib/container.js
CHANGED
package/lib/css-syntax-error.js
CHANGED
package/lib/declaration.js
CHANGED
package/lib/input.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
let { fileURLToPath, pathToFileURL } = require('url')
|
4
4
|
let { resolve, isAbsolute } = require('path')
|
5
5
|
let { nanoid } = require('nanoid/non-secure')
|
6
|
-
let
|
6
|
+
let vfileLocation = require('vfile-location')
|
7
7
|
|
8
8
|
let terminalHighlight = require('./terminal-highlight')
|
9
9
|
let CssSyntaxError = require('./css-syntax-error')
|
@@ -50,8 +50,14 @@ class Input {
|
|
50
50
|
}
|
51
51
|
|
52
52
|
fromOffset (offset) {
|
53
|
-
let finder =
|
54
|
-
this.fromOffset = i =>
|
53
|
+
let finder = vfileLocation(this.css)
|
54
|
+
this.fromOffset = i => {
|
55
|
+
let position = finder.toPoint(i)
|
56
|
+
return {
|
57
|
+
line: position.line,
|
58
|
+
col: position.column
|
59
|
+
}
|
60
|
+
}
|
55
61
|
return this.fromOffset(offset)
|
56
62
|
}
|
57
63
|
|
@@ -139,6 +145,7 @@ class Input {
|
|
139
145
|
}
|
140
146
|
|
141
147
|
module.exports = Input
|
148
|
+
Input.default = Input
|
142
149
|
|
143
150
|
if (terminalHighlight && terminalHighlight.registerInput) {
|
144
151
|
terminalHighlight.registerInput(Input)
|
package/lib/lazy-result.d.ts
CHANGED
@@ -13,7 +13,7 @@ import Root from './root.js'
|
|
13
13
|
* const lazy = postcss([autoprefixer]).process(css)
|
14
14
|
* ```
|
15
15
|
*/
|
16
|
-
export default class LazyResult {
|
16
|
+
export default class LazyResult implements PromiseLike<Result> {
|
17
17
|
/**
|
18
18
|
* Processes input CSS through synchronous and asynchronous plugins
|
19
19
|
* and calls `onFulfilled` with a Result instance. If a plugin throws
|
@@ -66,6 +66,12 @@ export default class LazyResult {
|
|
66
66
|
*/
|
67
67
|
constructor (processor: Processor, css: string, opts: ResultOptions)
|
68
68
|
|
69
|
+
/**
|
70
|
+
* Returns the default string description of an object.
|
71
|
+
* Required to implement the Promise interface.
|
72
|
+
*/
|
73
|
+
get [Symbol.toStringTag] (): string
|
74
|
+
|
69
75
|
/**
|
70
76
|
* Returns a `Processor` instance, which will be used
|
71
77
|
* for CSS transformations.
|
package/lib/lazy-result.js
CHANGED
@@ -114,6 +114,10 @@ class LazyResult {
|
|
114
114
|
})
|
115
115
|
}
|
116
116
|
|
117
|
+
get [Symbol.toStringTag] () {
|
118
|
+
return 'LazyResult'
|
119
|
+
}
|
120
|
+
|
117
121
|
get processor () {
|
118
122
|
return this.result.processor
|
119
123
|
}
|
@@ -475,5 +479,6 @@ LazyResult.registerPostcss = dependant => {
|
|
475
479
|
}
|
476
480
|
|
477
481
|
module.exports = LazyResult
|
482
|
+
LazyResult.default = LazyResult
|
478
483
|
|
479
484
|
Root.registerLazyResult(LazyResult)
|
package/lib/list.js
CHANGED
package/lib/node.js
CHANGED
package/lib/parse.js
CHANGED
package/lib/postcss.d.ts
CHANGED
@@ -13,6 +13,7 @@ import Root, { RootProps } from './root.js'
|
|
13
13
|
import Comment, { CommentProps } from './comment.js'
|
14
14
|
import AtRule, { AtRuleProps } from './at-rule.js'
|
15
15
|
import Result, { Message } from './result.js'
|
16
|
+
import LazyResult from './lazy-result.js'
|
16
17
|
import Rule, { RuleProps } from './rule.js'
|
17
18
|
import Container, { ContainerProps } from './container.js'
|
18
19
|
import Warning, { WarningOptions } from './warning.js'
|
@@ -48,6 +49,7 @@ export {
|
|
48
49
|
Rule,
|
49
50
|
Root,
|
50
51
|
Result,
|
52
|
+
LazyResult,
|
51
53
|
Input
|
52
54
|
}
|
53
55
|
|
package/lib/postcss.js
CHANGED
package/lib/previous-map.js
CHANGED
package/lib/processor.js
CHANGED
@@ -5,7 +5,7 @@ let Root = require('./root')
|
|
5
5
|
|
6
6
|
class Processor {
|
7
7
|
constructor (plugins = []) {
|
8
|
-
this.version = '8.1.
|
8
|
+
this.version = '8.1.10'
|
9
9
|
this.plugins = this.normalize(plugins)
|
10
10
|
}
|
11
11
|
|
@@ -65,5 +65,6 @@ class Processor {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
module.exports = Processor
|
68
|
+
Processor.default = Processor
|
68
69
|
|
69
70
|
Root.registerProcessor(Processor)
|
package/lib/result.js
CHANGED
package/lib/root.js
CHANGED
package/lib/rule.js
CHANGED
package/lib/stringify.js
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
|
3
3
|
let Stringifier = require('./stringifier')
|
4
4
|
|
5
|
-
|
5
|
+
function stringify (node, builder) {
|
6
6
|
let str = new Stringifier(builder)
|
7
7
|
str.stringify(node)
|
8
8
|
}
|
9
|
+
|
10
|
+
module.exports = stringify
|
11
|
+
stringify.default = stringify
|
package/lib/warning.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.1.
|
3
|
+
"version": "8.1.10",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -36,9 +36,9 @@
|
|
36
36
|
"repository": "postcss/postcss",
|
37
37
|
"dependencies": {
|
38
38
|
"colorette": "^1.2.1",
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
39
|
+
"nanoid": "^3.1.18",
|
40
|
+
"source-map": "^0.6.1",
|
41
|
+
"vfile-location": "^3.2.0"
|
42
42
|
},
|
43
43
|
"browser": {
|
44
44
|
"./lib/terminal-highlight": false,
|