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 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="273" height="64">
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
 
@@ -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.
@@ -47,6 +47,8 @@ export default class CssSyntaxError {
47
47
  plugin?: string
48
48
  )
49
49
 
50
+ stack: string
51
+
50
52
  /**
51
53
  * Always equal to `'CssSyntaxError'`. You should always check error type
52
54
  * by `error.name === 'CssSyntaxError'`
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 (/^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) {
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
- let map = new PreviousMap(this.css, opts)
41
- if (map.text) {
42
- this.map = map
43
- let file = map.consumer().file
44
- if (!this.file && file) this.file = this.mapResolve(file)
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 (quote) {
15
- if (escape) {
16
- escape = false
17
- } else if (letter === '\\') {
18
- escape = true
19
- } else if (letter === quote) {
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 === "'") {
@@ -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.map.addMapping({
223
- source: this.sourcePath(node),
224
- generated: { line, column: column - 1 },
225
- original: {
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
- this.map.addMapping({
232
- source: '<no source>',
233
- original: { line: 1, column: 0 },
234
- generated: { line, column: column - 1 }
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.map.addMapping({
253
- source: this.sourcePath(node),
254
- generated: { line, column: column - 2 },
255
- original: {
256
- line: node.source.end.line,
257
- column: node.source.end.column - 1
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
- this.map.addMapping({
262
- source: '<no source>',
263
- original: { line: 1, column: 0 },
264
- generated: { line, column: column - 1 }
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
@@ -177,7 +177,7 @@ class Node {
177
177
  // istanbul ignore next
178
178
  continue
179
179
  }
180
- if (name === 'parent') continue
180
+ if (name === 'parent' || name === 'proxyCache') continue
181
181
  let value = this[name]
182
182
 
183
183
  if (Array.isArray(value)) {
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.4'
8
+ this.version = '8.2.8'
9
9
  this.plugins = this.normalize(plugins)
10
10
  }
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.2.4",
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.1",
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
  }