postcss 8.2.9 → 8.2.10

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/README.md CHANGED
@@ -380,7 +380,7 @@ PostCSS also supports [Deno]:
380
380
 
381
381
  ```js
382
382
  import postcss from 'https://deno.land/x/postcss/mod.js'
383
- import autoprefixer from 'https://dev.jspm.io/autoprefixer'
383
+ import autoprefixer from 'https://jspm.dev/autoprefixer'
384
384
 
385
385
  const result = await postcss([autoprefixer]).process(css)
386
386
  ```
package/lib/input.js CHANGED
@@ -130,7 +130,9 @@ class Input {
130
130
 
131
131
  result.input = { line, column, source: this.css }
132
132
  if (this.file) {
133
- result.input.url = pathToFileURL(this.file).toString()
133
+ if (pathToFileURL) {
134
+ result.input.url = pathToFileURL(this.file).toString()
135
+ }
134
136
  result.input.file = this.file
135
137
  }
136
138
 
@@ -162,7 +164,12 @@ class Input {
162
164
  }
163
165
 
164
166
  if (fromUrl.protocol === 'file:') {
165
- result.file = fileURLToPath(fromUrl)
167
+ if (fileURLToPath) {
168
+ result.file = fileURLToPath(fromUrl)
169
+ } else {
170
+ // istanbul ignore next
171
+ throw new Error(`file: protocol is not available in this PostCSS build`);
172
+ }
166
173
  }
167
174
 
168
175
  let source = consumer.sourceContentFor(from.source)
@@ -4,7 +4,7 @@ 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)
7
+ let pathAvailable = Boolean(dirname && resolve && relative && sep)
8
8
 
9
9
  class MapGenerator {
10
10
  constructor(stringify, root, opts) {
@@ -202,7 +202,12 @@ class MapGenerator {
202
202
  if (this.mapOpts.from) {
203
203
  return this.toUrl(this.mapOpts.from)
204
204
  } else if (this.mapOpts.absolute) {
205
- return pathToFileURL(node.source.input.from).toString()
205
+ if (pathToFileURL) {
206
+ return pathToFileURL(node.source.input.from).toString()
207
+ } else {
208
+ // istanbul ignore next
209
+ throw new Error('`map.absolute` option is not available in this PostCSS build')
210
+ }
206
211
  } else {
207
212
  return this.toUrl(this.path(node.source.input.from))
208
213
  }
@@ -48,13 +48,11 @@ class PreviousMap {
48
48
  }
49
49
 
50
50
  getAnnotationURL(sourceMapString) {
51
- return sourceMapString
52
- .match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//)[1]
53
- .trim()
51
+ return sourceMapString.match(/\/\*\s*# sourceMappingURL=(.*)\*\//)[1].trim()
54
52
  }
55
53
 
56
54
  loadAnnotation(css) {
57
- let annotations = css.match(/\/\*\s*# sourceMappingURL=.*\s*\*\//gm)
55
+ let annotations = css.match(/\/\*\s*# sourceMappingURL=.*\*\//gm)
58
56
 
59
57
  if (annotations && annotations.length > 0) {
60
58
  // Locate the last sourceMappingURL to avoid picking up
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.9'
8
+ this.version = '8.2.10'
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.9",
3
+ "version": "8.2.10",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -43,6 +43,7 @@
43
43
  "./lib/terminal-highlight": false,
44
44
  "colorette": false,
45
45
  "fs": false,
46
- "path": false
46
+ "path": false,
47
+ "url": false
47
48
  }
48
49
  }