|
5 | 5 | parseRangedDateString, |
6 | 6 | setLogger, |
7 | 7 | } from "compute-baseline"; |
8 | | -import { Compat, Feature } from "compute-baseline/browser-compat-data"; |
| 8 | +import { Compat, feature, Feature } from "compute-baseline/browser-compat-data"; |
9 | 9 | import { fdir } from "fdir"; |
10 | 10 | import fs from "node:fs"; |
11 | 11 | import path from "node:path"; |
@@ -238,12 +238,12 @@ function toDist(sourcePath: string): YAML.Document { |
238 | 238 |
|
239 | 239 | if (!source.draft_date) { |
240 | 240 | logger.error( |
241 | | - `${id}: contains at least one deprecated compat feature and can never be Baseline. This is forbidden for published features.`, |
| 241 | + `${id}: contains at least one deprecated compat feature. This is forbidden for published features.`, |
242 | 242 | ); |
243 | 243 | exitStatus = 1; |
244 | 244 | } else { |
245 | 245 | logger.warn( |
246 | | - `${id}: draft contains at least one deprecated compat feature and can never be Baseline. Was this intentional?`, |
| 246 | + `${id}: draft contains at least one deprecated compat feature. Was this intentional?`, |
247 | 247 | ); |
248 | 248 | } |
249 | 249 | } |
@@ -282,6 +282,22 @@ function toDist(sourcePath: string): YAML.Document { |
282 | 282 | ); |
283 | 283 | exitStatus = 1; |
284 | 284 | } |
| 285 | + |
| 286 | + for (const key of compatFeatures) { |
| 287 | + const f = feature(key); |
| 288 | + if (f.deprecated) { |
| 289 | + if (!source.draft_date) { |
| 290 | + logger.error( |
| 291 | + `${id}: contains contains deprecated compat feature ${f.id}. This is forbidden for published features.`, |
| 292 | + ); |
| 293 | + exitStatus = 1; |
| 294 | + } else { |
| 295 | + logger.warn( |
| 296 | + `${id}: draft contains deprecated compat feature ${f.id}. Was this intentional?`, |
| 297 | + ); |
| 298 | + } |
| 299 | + } |
| 300 | + } |
285 | 301 | } |
286 | 302 |
|
287 | 303 | const sortedStatus = Array.from(groups.keys()).sort(compareStatus); |
|
0 commit comments