postcss 8.3.1 → 8.3.5
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 +23 -21
- package/lib/input.js +1 -1
- package/lib/lazy-result.js +8 -2
- package/lib/node.js +2 -1
- package/lib/postcss.mjs +1 -1
- package/lib/previous-map.js +1 -1
- package/lib/processor.js +2 -2
- package/lib/symbols.js +2 -0
- package/package.json +1 -1
package/lib/container.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
|
+
let { isClean, my } = require('./symbols')
|
3
4
|
let Declaration = require('./declaration')
|
4
|
-
let { isClean } = require('./symbols')
|
5
5
|
let Comment = require('./comment')
|
6
6
|
let Node = require('./node')
|
7
7
|
|
@@ -24,25 +24,6 @@ function markDirtyUp(node) {
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
|
-
// istanbul ignore next
|
28
|
-
function rebuild(node) {
|
29
|
-
if (node.type === 'atrule') {
|
30
|
-
Object.setPrototypeOf(node, AtRule.prototype)
|
31
|
-
} else if (node.type === 'rule') {
|
32
|
-
Object.setPrototypeOf(node, Rule.prototype)
|
33
|
-
} else if (node.type === 'decl') {
|
34
|
-
Object.setPrototypeOf(node, Declaration.prototype)
|
35
|
-
} else if (node.type === 'comment') {
|
36
|
-
Object.setPrototypeOf(node, Comment.prototype)
|
37
|
-
}
|
38
|
-
|
39
|
-
if (node.nodes) {
|
40
|
-
node.nodes.forEach(child => {
|
41
|
-
rebuild(child)
|
42
|
-
})
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
27
|
class Container extends Node {
|
47
28
|
push(child) {
|
48
29
|
child.parent = this
|
@@ -336,7 +317,7 @@ class Container extends Node {
|
|
336
317
|
|
337
318
|
let processed = nodes.map(i => {
|
338
319
|
// istanbul ignore next
|
339
|
-
if (
|
320
|
+
if (!i[my]) Container.rebuild(i)
|
340
321
|
i = i.proxyOf
|
341
322
|
if (i.parent) i.parent.removeChild(i)
|
342
323
|
if (i[isClean]) markDirtyUp(i)
|
@@ -428,3 +409,24 @@ Container.registerAtRule = dependant => {
|
|
428
409
|
|
429
410
|
module.exports = Container
|
430
411
|
Container.default = Container
|
412
|
+
|
413
|
+
// istanbul ignore next
|
414
|
+
Container.rebuild = node => {
|
415
|
+
if (node.type === 'atrule') {
|
416
|
+
Object.setPrototypeOf(node, AtRule.prototype)
|
417
|
+
} else if (node.type === 'rule') {
|
418
|
+
Object.setPrototypeOf(node, Rule.prototype)
|
419
|
+
} else if (node.type === 'decl') {
|
420
|
+
Object.setPrototypeOf(node, Declaration.prototype)
|
421
|
+
} else if (node.type === 'comment') {
|
422
|
+
Object.setPrototypeOf(node, Comment.prototype)
|
423
|
+
}
|
424
|
+
|
425
|
+
node[my] = true
|
426
|
+
|
427
|
+
if (node.nodes) {
|
428
|
+
node.nodes.forEach(child => {
|
429
|
+
Container.rebuild(child)
|
430
|
+
})
|
431
|
+
}
|
432
|
+
}
|
package/lib/input.js
CHANGED
@@ -9,7 +9,7 @@ let terminalHighlight = require('./terminal-highlight')
|
|
9
9
|
let CssSyntaxError = require('./css-syntax-error')
|
10
10
|
let PreviousMap = require('./previous-map')
|
11
11
|
|
12
|
-
let fromOffsetCache = Symbol('
|
12
|
+
let fromOffsetCache = Symbol('fromOffsetCache')
|
13
13
|
|
14
14
|
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
|
15
15
|
let pathAvailable = Boolean(resolve && isAbsolute)
|
package/lib/lazy-result.js
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
|
+
let { isClean, my } = require('./symbols')
|
3
4
|
let MapGenerator = require('./map-generator')
|
4
|
-
let { isClean } = require('./symbols')
|
5
5
|
let stringify = require('./stringify')
|
6
|
+
let Container = require('./container')
|
7
|
+
let Document = require('./document')
|
6
8
|
let warnOnce = require('./warn-once')
|
7
9
|
let Result = require('./result')
|
8
10
|
let parse = require('./parse')
|
9
11
|
let Root = require('./root')
|
10
|
-
let Document = require('./document')
|
11
12
|
|
12
13
|
const TYPE_TO_CLASS_NAME = {
|
13
14
|
document: 'Document',
|
@@ -134,6 +135,11 @@ class LazyResult {
|
|
134
135
|
this.processed = true
|
135
136
|
this.error = error
|
136
137
|
}
|
138
|
+
|
139
|
+
if (root && !root[my]) {
|
140
|
+
// istanbul ignore next
|
141
|
+
Container.rebuild(root)
|
142
|
+
}
|
137
143
|
}
|
138
144
|
|
139
145
|
this.result = new Result(processor, root, opts)
|
package/lib/node.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
|
+
let { isClean, my } = require('./symbols')
|
3
4
|
let CssSyntaxError = require('./css-syntax-error')
|
4
5
|
let Stringifier = require('./stringifier')
|
5
|
-
let { isClean } = require('./symbols')
|
6
6
|
let stringify = require('./stringify')
|
7
7
|
|
8
8
|
function cloneNode(obj, parent) {
|
@@ -36,6 +36,7 @@ class Node {
|
|
36
36
|
constructor(defaults = {}) {
|
37
37
|
this.raws = {}
|
38
38
|
this[isClean] = false
|
39
|
+
this[my] = true
|
39
40
|
|
40
41
|
for (let name in defaults) {
|
41
42
|
if (name === 'nodes') {
|
package/lib/postcss.mjs
CHANGED
@@ -8,12 +8,12 @@ export const plugin = postcss.plugin
|
|
8
8
|
export const parse = postcss.parse
|
9
9
|
export const list = postcss.list
|
10
10
|
|
11
|
+
export const document = postcss.document
|
11
12
|
export const comment = postcss.comment
|
12
13
|
export const atRule = postcss.atRule
|
13
14
|
export const rule = postcss.rule
|
14
15
|
export const decl = postcss.decl
|
15
16
|
export const root = postcss.root
|
16
|
-
export const document = postcss.document
|
17
17
|
|
18
18
|
export const CssSyntaxError = postcss.CssSyntaxError
|
19
19
|
export const Declaration = postcss.Declaration
|
package/lib/previous-map.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
|
+
let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
|
3
4
|
let { existsSync, readFileSync } = require('fs')
|
4
5
|
let { dirname, join } = require('path')
|
5
|
-
let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
|
6
6
|
|
7
7
|
function fromBase64(str) {
|
8
8
|
if (Buffer) {
|
package/lib/processor.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
'use strict'
|
2
2
|
|
3
3
|
let LazyResult = require('./lazy-result')
|
4
|
-
let Root = require('./root')
|
5
4
|
let Document = require('./document')
|
5
|
+
let Root = require('./root')
|
6
6
|
|
7
7
|
class Processor {
|
8
8
|
constructor(plugins = []) {
|
9
|
-
this.version = '8.3.
|
9
|
+
this.version = '8.3.5'
|
10
10
|
this.plugins = this.normalize(plugins)
|
11
11
|
}
|
12
12
|
|
package/lib/symbols.js
CHANGED