postcss 8.2.2 → 8.2.3

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 CHANGED
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](https://semver.org/).
3
3
 
4
+ ## 8.2.3
5
+ * FIx `JSON.stringify(Node[])` support (by Niklas Mischkulnig).
6
+
4
7
  ## 8.2.2
5
8
  * Fixed CSS-in-JS support (by James Garbutt).
6
9
  * Fixed plugin types (by Ludovico Fischer).
@@ -1,4 +1,4 @@
1
- import Input, { FilePosition } from './input.js'
1
+ import { FilePosition } from './input.js'
2
2
 
3
3
  /**
4
4
  * The CSS parser throws this error for broken CSS.
package/lib/fromJSON.js CHANGED
@@ -9,6 +9,8 @@ let Root = require('./root')
9
9
  let Rule = require('./rule')
10
10
 
11
11
  function fromJSON (json, inputs) {
12
+ if (Array.isArray(json)) return json.map(n => fromJSON(n))
13
+
12
14
  let { inputs: ownInputs, ...defaults } = json
13
15
  if (ownInputs) {
14
16
  inputs = []
package/lib/node.js CHANGED
@@ -166,7 +166,7 @@ class Node {
166
166
  if (!keepBetween) delete this.raws.between
167
167
  }
168
168
 
169
- toJSON (inputs) {
169
+ toJSON (_, inputs) {
170
170
  let fixed = {}
171
171
  let emitInputs = inputs == null
172
172
  inputs = inputs || new Map()
@@ -183,13 +183,13 @@ class Node {
183
183
  if (Array.isArray(value)) {
184
184
  fixed[name] = value.map(i => {
185
185
  if (typeof i === 'object' && i.toJSON) {
186
- return i.toJSON(inputs)
186
+ return i.toJSON(null, inputs)
187
187
  } else {
188
188
  return i
189
189
  }
190
190
  })
191
191
  } else if (typeof value === 'object' && value.toJSON) {
192
- fixed[name] = value.toJSON(inputs)
192
+ fixed[name] = value.toJSON(null, inputs)
193
193
  } else if (name === 'source') {
194
194
  let inputId = inputs.get(value.input)
195
195
  if (inputId == null) {
package/lib/postcss.d.ts CHANGED
@@ -214,6 +214,7 @@ export interface Stringifier {
214
214
  }
215
215
 
216
216
  export interface JSONHydrator {
217
+ (data: object[]): Node[]
217
218
  (data: object): Node
218
219
  }
219
220
 
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.2.2'
8
+ this.version = '8.2.3'
9
9
  this.plugins = this.normalize(plugins)
10
10
  }
11
11
 
package/lib/root.d.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  import Container, { ContainerProps } from './container.js'
2
2
  import { ProcessOptions } from './postcss.js'
3
- import { ChildNode } from './node.js'
4
- import Declaration from './declaration.js'
5
- import Comment from './comment.js'
6
- import AtRule from './at-rule.js'
7
3
  import Result from './result.js'
8
- import Rule from './rule.js'
9
4
 
10
5
  interface RootRaws {
11
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.2.2",
3
+ "version": "8.2.3",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"