postcss 8.4.13 → 8.4.16
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/lib/container.js +7 -1
- package/lib/list.js +7 -5
- package/lib/postcss.js +15 -13
- package/lib/processor.js +1 -1
- package/lib/root.js +2 -0
- package/package.json +2 -2
package/lib/container.js
CHANGED
@@ -5,7 +5,7 @@ let Declaration = require('./declaration')
|
|
5
5
|
let Comment = require('./comment')
|
6
6
|
let Node = require('./node')
|
7
7
|
|
8
|
-
let parse, Rule, AtRule
|
8
|
+
let parse, Rule, AtRule, Root
|
9
9
|
|
10
10
|
function cleanSource(nodes) {
|
11
11
|
return nodes.map(i => {
|
@@ -407,6 +407,10 @@ Container.registerAtRule = dependant => {
|
|
407
407
|
AtRule = dependant
|
408
408
|
}
|
409
409
|
|
410
|
+
Container.registerRoot = dependant => {
|
411
|
+
Root = dependant
|
412
|
+
}
|
413
|
+
|
410
414
|
module.exports = Container
|
411
415
|
Container.default = Container
|
412
416
|
|
@@ -420,6 +424,8 @@ Container.rebuild = node => {
|
|
420
424
|
Object.setPrototypeOf(node, Declaration.prototype)
|
421
425
|
} else if (node.type === 'comment') {
|
422
426
|
Object.setPrototypeOf(node, Comment.prototype)
|
427
|
+
} else if (node.type === 'root') {
|
428
|
+
Object.setPrototypeOf(node, Root.prototype)
|
423
429
|
}
|
424
430
|
|
425
431
|
node[my] = true
|
package/lib/list.js
CHANGED
@@ -7,7 +7,8 @@ let list = {
|
|
7
7
|
let split = false
|
8
8
|
|
9
9
|
let func = 0
|
10
|
-
let
|
10
|
+
let inQuote = false
|
11
|
+
let prevQuote = ''
|
11
12
|
let escape = false
|
12
13
|
|
13
14
|
for (let letter of string) {
|
@@ -15,12 +16,13 @@ let list = {
|
|
15
16
|
escape = false
|
16
17
|
} else if (letter === '\\') {
|
17
18
|
escape = true
|
18
|
-
} else if (
|
19
|
-
if (letter ===
|
20
|
-
|
19
|
+
} else if (inQuote) {
|
20
|
+
if (letter === prevQuote) {
|
21
|
+
inQuote = false
|
21
22
|
}
|
22
23
|
} else if (letter === '"' || letter === "'") {
|
23
|
-
|
24
|
+
inQuote = true
|
25
|
+
prevQuote = letter
|
24
26
|
} else if (letter === '(') {
|
25
27
|
func += 1
|
26
28
|
} else if (letter === ')') {
|
package/lib/postcss.js
CHANGED
@@ -27,25 +27,27 @@ function postcss(...plugins) {
|
|
27
27
|
}
|
28
28
|
|
29
29
|
postcss.plugin = function plugin(name, initializer) {
|
30
|
-
|
31
|
-
|
30
|
+
let warningPrinted = false
|
31
|
+
function creator(...args) {
|
32
32
|
// eslint-disable-next-line no-console
|
33
|
-
console.warn
|
34
|
-
|
35
|
-
': postcss.plugin was deprecated. Migration guide:\n' +
|
36
|
-
'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
|
37
|
-
)
|
38
|
-
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
|
39
|
-
/* c8 ignore next 7 */
|
33
|
+
if (console && console.warn && !warningPrinted) {
|
34
|
+
warningPrinted = true
|
40
35
|
// eslint-disable-next-line no-console
|
41
36
|
console.warn(
|
42
37
|
name +
|
43
|
-
':
|
44
|
-
'https://
|
38
|
+
': postcss.plugin was deprecated. Migration guide:\n' +
|
39
|
+
'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
|
45
40
|
)
|
41
|
+
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
|
42
|
+
/* c8 ignore next 7 */
|
43
|
+
// eslint-disable-next-line no-console
|
44
|
+
console.warn(
|
45
|
+
name +
|
46
|
+
': 里面 postcss.plugin 被弃用. 迁移指南:\n' +
|
47
|
+
'https://www.w3ctech.com/topic/2226'
|
48
|
+
)
|
49
|
+
}
|
46
50
|
}
|
47
|
-
}
|
48
|
-
function creator(...args) {
|
49
51
|
let transformer = initializer(...args)
|
50
52
|
transformer.postcssPlugin = name
|
51
53
|
transformer.postcssVersion = new Processor().version
|
package/lib/processor.js
CHANGED
package/lib/root.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.16",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"url": "https://github.com/postcss/postcss/issues"
|
72
72
|
},
|
73
73
|
"dependencies": {
|
74
|
-
"nanoid": "^3.3.
|
74
|
+
"nanoid": "^3.3.4",
|
75
75
|
"picocolors": "^1.0.0",
|
76
76
|
"source-map-js": "^1.0.2"
|
77
77
|
},
|