postcss 8.4.31 → 8.4.33

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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ and JetBrains. The [Autoprefixer] and [Stylelint] PostCSS plugins is one of
13
13
 
14
14
  ---
15
15
 
16
- <img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made in <b><a href="https://evilmartians.com/?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
16
+ <img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" />  Made in <b><a href="https://evilmartians.com/devtools?utm_source=postcss&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
17
17
 
18
18
  ---
19
19
 
@@ -16,6 +16,7 @@ class MapGenerator {
16
16
  this.root = root
17
17
  this.opts = opts
18
18
  this.css = cssString
19
+ this.originalCSS = cssString
19
20
  this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute
20
21
 
21
22
  this.memoizedFileURLs = new Map()
@@ -74,7 +75,7 @@ class MapGenerator {
74
75
  }
75
76
  }
76
77
  } else if (this.css) {
77
- this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, '')
78
+ this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, '')
78
79
  }
79
80
  }
80
81
 
@@ -276,7 +277,7 @@ class MapGenerator {
276
277
  }
277
278
  })
278
279
  } else {
279
- let input = new Input(this.css, this.opts)
280
+ let input = new Input(this.originalCSS, this.opts)
280
281
  if (input.map) this.previousMaps.push(input.map)
281
282
  }
282
283
  }
@@ -37,6 +37,9 @@ class NoWorkResult {
37
37
  if (generatedMap) {
38
38
  this.result.map = generatedMap
39
39
  }
40
+ } else {
41
+ map.clearAnnotation();
42
+ this.result.css = map.css;
40
43
  }
41
44
  }
42
45
 
package/lib/postcss.d.ts CHANGED
@@ -309,7 +309,7 @@ declare namespace postcss {
309
309
  * The path of the CSS source file. You should always set `from`,
310
310
  * because it is used in source map generation and syntax error messages.
311
311
  */
312
- from?: string
312
+ from?: string | undefined
313
313
 
314
314
  /**
315
315
  * Source map options
package/lib/processor.js CHANGED
@@ -7,7 +7,7 @@ let Root = require('./root')
7
7
 
8
8
  class Processor {
9
9
  constructor(plugins = []) {
10
- this.version = '8.4.31'
10
+ this.version = '8.4.33'
11
11
  this.plugins = this.normalize(plugins)
12
12
  }
13
13
 
@@ -43,10 +43,10 @@ class Processor {
43
43
 
44
44
  process(css, opts = {}) {
45
45
  if (
46
- this.plugins.length === 0 &&
47
- typeof opts.parser === 'undefined' &&
48
- typeof opts.stringifier === 'undefined' &&
49
- typeof opts.syntax === 'undefined'
46
+ !this.plugins.length &&
47
+ !opts.parser &&
48
+ !opts.stringifier &&
49
+ !opts.syntax
50
50
  ) {
51
51
  return new NoWorkResult(this, css, opts)
52
52
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.4.31",
3
+ "version": "8.4.33",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -74,7 +74,7 @@
74
74
  "url": "https://github.com/postcss/postcss/issues"
75
75
  },
76
76
  "dependencies": {
77
- "nanoid": "^3.3.6",
77
+ "nanoid": "^3.3.7",
78
78
  "picocolors": "^1.0.0",
79
79
  "source-map-js": "^1.0.2"
80
80
  },