postcss 8.3.11 → 8.4.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/lib/warning.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { RangePosition } from './css-syntax-error.js'
1
2
  import Node from './node.js'
2
3
 
3
4
  export interface WarningOptions {
@@ -12,10 +13,25 @@ export interface WarningOptions {
12
13
  word?: string
13
14
 
14
15
  /**
15
- * Index in CSS node string that caused the warning.
16
+ * Start index, inclusive, in CSS node string that caused the warning.
16
17
  */
17
18
  index?: number
18
19
 
20
+ /**
21
+ * End index, exclusive, in CSS node string that caused the warning.
22
+ */
23
+ endIndex?: number
24
+
25
+ /**
26
+ * Start position, inclusive, in CSS node string that caused the warning.
27
+ */
28
+ start?: RangePosition
29
+
30
+ /**
31
+ * End position, exclusive, in CSS node string that caused the warning.
32
+ */
33
+ end?: RangePosition
34
+
19
35
  /**
20
36
  * Name of the plugin that created this warning. `Result#warn` fills
21
37
  * this property automatically.
@@ -68,7 +84,7 @@ export default class Warning {
68
84
  node: Node
69
85
 
70
86
  /**
71
- * Line in the input file with this warning’s source.
87
+ * Line for inclusive start position in the input file with this warning’s source.
72
88
  *
73
89
  * ```js
74
90
  * warning.line //=> 5
@@ -77,7 +93,7 @@ export default class Warning {
77
93
  line: number
78
94
 
79
95
  /**
80
- * Column in the input file with this warning’s source.
96
+ * Column for inclusive start position in the input file with this warning’s source.
81
97
  *
82
98
  * ```js
83
99
  * warning.column //=> 6
@@ -85,6 +101,24 @@ export default class Warning {
85
101
  */
86
102
  column: number
87
103
 
104
+ /**
105
+ * Line for exclusive end position in the input file with this warning’s source.
106
+ *
107
+ * ```js
108
+ * warning.endLine //=> 6
109
+ * ```
110
+ */
111
+ endLine?: number
112
+
113
+ /**
114
+ * Column for exclusive end position in the input file with this warning’s source.
115
+ *
116
+ * ```js
117
+ * warning.endColumn //=> 4
118
+ * ```
119
+ */
120
+ endColumn?: number
121
+
88
122
  /**
89
123
  * @param text Warning message.
90
124
  * @param opts Warning options.
package/lib/warning.js CHANGED
@@ -6,9 +6,11 @@ class Warning {
6
6
  this.text = text
7
7
 
8
8
  if (opts.node && opts.node.source) {
9
- let pos = opts.node.positionBy(opts)
10
- this.line = pos.line
11
- this.column = pos.column
9
+ let range = opts.node.rangeBy(opts)
10
+ this.line = range.start.line
11
+ this.column = range.start.column
12
+ this.endLine = range.end.line
13
+ this.endColumn = range.end.column
12
14
  }
13
15
 
14
16
  for (let opt in opts) this[opt] = opts[opt]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.3.11",
3
+ "version": "8.4.3",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "engines": {
6
6
  "node": "^10 || ^12 || >=14"
@@ -19,6 +19,7 @@
19
19
  "./lib/fromJSON": "./lib/fromJSON.js",
20
20
  "./lib/input": "./lib/input.js",
21
21
  "./lib/lazy-result": "./lib/lazy-result.js",
22
+ "./lib/no-work-result": "./lib/no-work-result.js",
22
23
  "./lib/list": "./lib/list.js",
23
24
  "./lib/map-generator": "./lib/map-generator.js",
24
25
  "./lib/node": "./lib/node.js",
@@ -66,7 +67,7 @@
66
67
  "dependencies": {
67
68
  "nanoid": "^3.1.30",
68
69
  "picocolors": "^1.0.0",
69
- "source-map-js": "^0.6.2"
70
+ "source-map-js": "^1.0.1"
70
71
  },
71
72
  "browser": {
72
73
  "./lib/terminal-highlight": false,