postcss 8.2.3 → 8.2.7
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 -2
- package/lib/container.d.ts +1 -1
- package/lib/list.js +6 -6
- package/lib/map-generator.js +29 -26
- package/lib/node.js +1 -1
- package/lib/postcss.js +5 -3
- package/lib/processor.js +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
@@ -1,8 +1,22 @@
|
|
1
1
|
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
3
3
|
|
4
|
+
## 8.2.7
|
5
|
+
* Fixed browser builds in webpack 5 (by Matt Jones).
|
6
|
+
|
7
|
+
## 8.2.6
|
8
|
+
* Fixed `Maximum call stack size exceeded` in `Node#toJSON`.
|
9
|
+
* Fixed docs (by inokawa).
|
10
|
+
|
11
|
+
## 8.2.5
|
12
|
+
* Fixed escaped characters handling in `list.split` (by Natalie Weizenbaum).
|
13
|
+
|
14
|
+
## 8.2.4
|
15
|
+
* Added plugin name to `postcss.plugin()` warning (by Tom Williams).
|
16
|
+
* Fixed docs (by Bill Columbia).
|
17
|
+
|
4
18
|
## 8.2.3
|
5
|
-
*
|
19
|
+
* Fixed `JSON.stringify(Node[])` support (by Niklas Mischkulnig).
|
6
20
|
|
7
21
|
## 8.2.2
|
8
22
|
* Fixed CSS-in-JS support (by James Garbutt).
|
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
|
|
@@ -416,7 +419,7 @@ fs.readFile('src/app.css', (err, css) => {
|
|
416
419
|
.then(result => {
|
417
420
|
fs.writeFile('dest/app.css', result.css, () => true)
|
418
421
|
if ( result.map ) {
|
419
|
-
fs.writeFile('dest/app.css.map', result.map, () => true)
|
422
|
+
fs.writeFile('dest/app.css.map', result.map.toString(), () => true)
|
420
423
|
}
|
421
424
|
})
|
422
425
|
})
|
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/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
@@ -213,26 +213,30 @@ class MapGenerator {
|
|
213
213
|
let line = 1
|
214
214
|
let column = 1
|
215
215
|
|
216
|
+
let noSource = '<no source>'
|
217
|
+
let mapping = {
|
218
|
+
source: '',
|
219
|
+
generated: { line: 0, column: 0 },
|
220
|
+
original: { line: 0, column: 0 }
|
221
|
+
}
|
222
|
+
|
216
223
|
let lines, last
|
217
224
|
this.stringify(this.root, (str, node, type) => {
|
218
225
|
this.css += str
|
219
226
|
|
220
227
|
if (node && type !== 'end') {
|
228
|
+
mapping.generated.line = line
|
229
|
+
mapping.generated.column = column - 1
|
221
230
|
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
|
-
})
|
231
|
+
mapping.source = this.sourcePath(node)
|
232
|
+
mapping.original.line = node.source.start.line
|
233
|
+
mapping.original.column = node.source.start.column - 1
|
234
|
+
this.map.addMapping(mapping)
|
230
235
|
} else {
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
})
|
236
|
+
mapping.source = noSource
|
237
|
+
mapping.original.line = 1
|
238
|
+
mapping.original.column = 0
|
239
|
+
this.map.addMapping(mapping)
|
236
240
|
}
|
237
241
|
}
|
238
242
|
|
@@ -249,20 +253,19 @@ class MapGenerator {
|
|
249
253
|
let p = node.parent || { raws: {} }
|
250
254
|
if (node.type !== 'decl' || node !== p.last || p.raws.semicolon) {
|
251
255
|
if (node.source && node.source.end) {
|
252
|
-
this.
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
}
|
259
|
-
})
|
256
|
+
mapping.source = this.sourcePath(node)
|
257
|
+
mapping.original.line = node.source.end.line
|
258
|
+
mapping.original.column = node.source.end.column - 1
|
259
|
+
mapping.generated.line = line
|
260
|
+
mapping.generated.column = column - 2
|
261
|
+
this.map.addMapping(mapping)
|
260
262
|
} else {
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
263
|
+
mapping.source = noSource
|
264
|
+
mapping.original.line = 1
|
265
|
+
mapping.original.column = 0
|
266
|
+
mapping.generated.line = line
|
267
|
+
mapping.generated.column = column - 1
|
268
|
+
this.map.addMapping(mapping)
|
266
269
|
}
|
267
270
|
}
|
268
271
|
}
|
package/lib/node.js
CHANGED
package/lib/postcss.js
CHANGED
@@ -22,19 +22,21 @@ function postcss (...plugins) {
|
|
22
22
|
if (plugins.length === 1 && Array.isArray(plugins[0])) {
|
23
23
|
plugins = plugins[0]
|
24
24
|
}
|
25
|
-
return new Processor(plugins
|
25
|
+
return new Processor(plugins)
|
26
26
|
}
|
27
27
|
|
28
28
|
postcss.plugin = function plugin (name, initializer) {
|
29
29
|
if (console && console.warn) {
|
30
30
|
console.warn(
|
31
|
-
|
31
|
+
name +
|
32
|
+
': postcss.plugin was deprecated. Migration guide:\n' +
|
32
33
|
'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
|
33
34
|
)
|
34
35
|
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
|
35
36
|
// istanbul ignore next
|
36
37
|
console.warn(
|
37
|
-
|
38
|
+
name +
|
39
|
+
': 里面 postcss.plugin 被弃用. 迁移指南:\n' +
|
38
40
|
'https://www.w3ctech.com/topic/2226'
|
39
41
|
)
|
40
42
|
}
|
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.7",
|
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
|
}
|