Skip to content

Commit b9b5ccd

Browse files
committed
update web-features
1 parent 0039c1d commit b9b5ccd

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
},
55
"dependencies": {
66
"@types/node": "^22.7.5",
7-
"compute-baseline": "^0.2.0-dev",
7+
"compute-baseline": "^0.4.0",
88
"node-fetch": "^3.3.2",
99
"tsx": "^4.19.1",
10-
"web-features": "^2.0.0"
10+
"web-features": "^3.6.0"
1111
}
1212
}

tools/baseline.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { features } from "web-features";
44
import { readFileSync } from 'fs';
55
import fetch from 'node-fetch';
66
import { stdout } from "process";
7+
import { FeatureData } from "web-features/types.quicktype";
78

89
const bcdVersion = readFileSync("bcd_version").toString();
910

@@ -28,7 +29,18 @@ fetch(`http://unpkg.com/@mdn/browser-compat-data@${bcdVersion}/data.json`)
2829
const failed = [];
2930

3031
for (const key in features) {
31-
const feature = features[key];
32+
let feature: FeatureData = features[key];
33+
34+
if (feature.kind === 'moved') {
35+
//console.info('[Baseline] Feature has moved to following redirect.', key, feature.redirect_target);
36+
feature = features[feature.redirect_target];
37+
}
38+
39+
if (feature.kind == 'split') {
40+
// Skip split features for now
41+
continue
42+
}
43+
3244
let webviewBaseline: WebViewStatus = "unknown";
3345
// Default to today if unknown because that's when we "worked it out"
3446
let last_test_date = new Date().toISOString().split('T')[0];
@@ -96,6 +108,7 @@ fetch(`http://unpkg.com/@mdn/browser-compat-data@${bcdVersion}/data.json`)
96108
// fall back to "unknown".
97109
// We should hunt down these cases and bring the
98110
// list of impacted features down.
111+
console.warn("[Baseline] Failed to compute baseline for", key, e);
99112
failed.push(key);
100113
}
101114

0 commit comments

Comments
 (0)