postcss 8.2.4 → 8.2.8
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 +13 -0
- package/README.md +4 -1
- package/lib/container.d.ts +1 -1
- package/lib/css-syntax-error.d.ts +2 -0
- package/lib/input.js +14 -6
- package/lib/list.js +6 -6
- package/lib/map-generator.js +32 -27
- package/lib/node.js +1 -1
- package/lib/processor.js +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
3
3
|
|
4
|
+
## 8.2.8
|
5
|
+
* Fixed browser builds in webpack 4 (by Matt Jones).
|
6
|
+
|
7
|
+
## 8.2.7
|
8
|
+
* Fixed browser builds in webpack 5 (by Matt Jones).
|
9
|
+
|
10
|
+
## 8.2.6
|
11
|
+
* Fixed `Maximum call stack size exceeded` in `Node#toJSON`.
|
12
|
+
* Fixed docs (by inokawa).
|
13
|
+
|
14
|
+
## 8.2.5
|
15
|
+
* Fixed escaped characters handling in `list.split` (by Natalie Weizenbaum).
|
16
|
+
|
4
17
|
## 8.2.4
|
5
18
|
* Added plugin name to `postcss.plugin()` warning (by Tom Williams).
|
6
19
|
* Fixed docs (by Bill Columbia).
|
package/README.md
CHANGED
@@ -47,7 +47,10 @@ PostCSS needs your support. We are accepting donations
|
|
47
47
|
|
48
48
|
<a href="https://tailwindcss.com/">
|
49
49
|
<img src="https://refactoringui.nyc3.cdn.digitaloceanspaces.com/tailwind-logo.svg"
|
50
|
-
alt="Sponsored by Tailwind CSS" width="
|
50
|
+
alt="Sponsored by Tailwind CSS" width="213" height="50">
|
51
|
+
</a> <a href="https://themeisle.com/">
|
52
|
+
<img src="https://mllj2j8xvfl0.i.optimole.com/d0cOXWA.3970~373ad/w:auto/h:auto/q:90/https://s30246.pcdn.co/wp-content/uploads/2019/03/logo.png"
|
53
|
+
alt="Sponsored by ThemeIsle" width="171" height="56">
|
51
54
|
</a>
|
52
55
|
|
53
56
|
|
package/lib/container.d.ts
CHANGED
@@ -298,7 +298,7 @@ export default abstract class Container extends Node {
|
|
298
298
|
* Add child to the end of the node.
|
299
299
|
*
|
300
300
|
* ```js
|
301
|
-
* rule.push(new Declaration({ prop: 'color', value: 'black' }
|
301
|
+
* rule.push(new Declaration({ prop: 'color', value: 'black' }))
|
302
302
|
* ```
|
303
303
|
*
|
304
304
|
* @param child New node.
|
package/lib/input.js
CHANGED
@@ -10,6 +10,8 @@ let PreviousMap = require('./previous-map')
|
|
10
10
|
|
11
11
|
let fromOffsetCache = Symbol('fromOffset cache')
|
12
12
|
|
13
|
+
let pathAvailable = Boolean(resolve && isAbsolute)
|
14
|
+
|
13
15
|
class Input {
|
14
16
|
constructor (css, opts = {}) {
|
15
17
|
if (
|
@@ -30,18 +32,24 @@ class Input {
|
|
30
32
|
}
|
31
33
|
|
32
34
|
if (opts.from) {
|
33
|
-
if (
|
35
|
+
if (
|
36
|
+
!pathAvailable ||
|
37
|
+
/^\w+:\/\//.test(opts.from) ||
|
38
|
+
isAbsolute(opts.from)
|
39
|
+
) {
|
34
40
|
this.file = opts.from
|
35
41
|
} else {
|
36
42
|
this.file = resolve(opts.from)
|
37
43
|
}
|
38
44
|
}
|
39
45
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
46
|
+
if (pathAvailable) {
|
47
|
+
let map = new PreviousMap(this.css, opts)
|
48
|
+
if (map.text) {
|
49
|
+
this.map = map
|
50
|
+
let file = map.consumer().file
|
51
|
+
if (!this.file && file) this.file = this.mapResolve(file)
|
52
|
+
}
|
45
53
|
}
|
46
54
|
|
47
55
|
if (!this.file) {
|
package/lib/list.js
CHANGED
@@ -11,12 +11,12 @@ let list = {
|
|
11
11
|
let escape = false
|
12
12
|
|
13
13
|
for (let letter of string) {
|
14
|
-
if (
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
if (escape) {
|
15
|
+
escape = false
|
16
|
+
} else if (letter === '\\') {
|
17
|
+
escape = true
|
18
|
+
} else if (quote) {
|
19
|
+
if (letter === quote) {
|
20
20
|
quote = false
|
21
21
|
}
|
22
22
|
} else if (letter === '"' || letter === "'") {
|
package/lib/map-generator.js
CHANGED
@@ -4,6 +4,8 @@ let { dirname, resolve, relative, sep } = require('path')
|
|
4
4
|
let { pathToFileURL } = require('url')
|
5
5
|
let mozilla = require('source-map')
|
6
6
|
|
7
|
+
let pathAvailable = Boolean(dirname, resolve, relative, sep)
|
8
|
+
|
7
9
|
class MapGenerator {
|
8
10
|
constructor (stringify, root, opts) {
|
9
11
|
this.stringify = stringify
|
@@ -213,26 +215,30 @@ class MapGenerator {
|
|
213
215
|
let line = 1
|
214
216
|
let column = 1
|
215
217
|
|
218
|
+
let noSource = '<no source>'
|
219
|
+
let mapping = {
|
220
|
+
source: '',
|
221
|
+
generated: { line: 0, column: 0 },
|
222
|
+
original: { line: 0, column: 0 }
|
223
|
+
}
|
224
|
+
|
216
225
|
let lines, last
|
217
226
|
this.stringify(this.root, (str, node, type) => {
|
218
227
|
this.css += str
|
219
228
|
|
220
229
|
if (node && type !== 'end') {
|
230
|
+
mapping.generated.line = line
|
231
|
+
mapping.generated.column = column - 1
|
221
232
|
if (node.source && node.source.start) {
|
222
|
-
this.
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
line: node.source.start.line,
|
227
|
-
column: node.source.start.column - 1
|
228
|
-
}
|
229
|
-
})
|
233
|
+
mapping.source = this.sourcePath(node)
|
234
|
+
mapping.original.line = node.source.start.line
|
235
|
+
mapping.original.column = node.source.start.column - 1
|
236
|
+
this.map.addMapping(mapping)
|
230
237
|
} else {
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
})
|
238
|
+
mapping.source = noSource
|
239
|
+
mapping.original.line = 1
|
240
|
+
mapping.original.column = 0
|
241
|
+
this.map.addMapping(mapping)
|
236
242
|
}
|
237
243
|
}
|
238
244
|
|
@@ -249,20 +255,19 @@ class MapGenerator {
|
|
249
255
|
let p = node.parent || { raws: {} }
|
250
256
|
if (node.type !== 'decl' || node !== p.last || p.raws.semicolon) {
|
251
257
|
if (node.source && node.source.end) {
|
252
|
-
this.
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
}
|
259
|
-
})
|
258
|
+
mapping.source = this.sourcePath(node)
|
259
|
+
mapping.original.line = node.source.end.line
|
260
|
+
mapping.original.column = node.source.end.column - 1
|
261
|
+
mapping.generated.line = line
|
262
|
+
mapping.generated.column = column - 2
|
263
|
+
this.map.addMapping(mapping)
|
260
264
|
} else {
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
265
|
+
mapping.source = noSource
|
266
|
+
mapping.original.line = 1
|
267
|
+
mapping.original.column = 0
|
268
|
+
mapping.generated.line = line
|
269
|
+
mapping.generated.column = column - 1
|
270
|
+
this.map.addMapping(mapping)
|
266
271
|
}
|
267
272
|
}
|
268
273
|
}
|
@@ -272,7 +277,7 @@ class MapGenerator {
|
|
272
277
|
generate () {
|
273
278
|
this.clearAnnotation()
|
274
279
|
|
275
|
-
if (this.isMap()) {
|
280
|
+
if (pathAvailable && this.isMap()) {
|
276
281
|
return this.generateMap()
|
277
282
|
}
|
278
283
|
|
package/lib/node.js
CHANGED
package/lib/processor.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.2.
|
3
|
+
"version": "8.2.8",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -35,13 +35,14 @@
|
|
35
35
|
"homepage": "https://postcss.org/",
|
36
36
|
"repository": "postcss/postcss",
|
37
37
|
"dependencies": {
|
38
|
-
"colorette": "^1.2.
|
38
|
+
"colorette": "^1.2.2",
|
39
39
|
"nanoid": "^3.1.20",
|
40
40
|
"source-map": "^0.6.1"
|
41
41
|
},
|
42
42
|
"browser": {
|
43
43
|
"./lib/terminal-highlight": false,
|
44
44
|
"colorette": false,
|
45
|
-
"fs": false
|
45
|
+
"fs": false,
|
46
|
+
"path": false
|
46
47
|
}
|
47
48
|
}
|