baseline-browser-mapping 2.3.0 → 2.4.0
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.
|
@@ -652,6 +652,24 @@
|
|
|
652
652
|
"engine_version": "130",
|
|
653
653
|
"status": "unknown",
|
|
654
654
|
"release_date": "2024-11-30"
|
|
655
|
+
},
|
|
656
|
+
"25.2": {
|
|
657
|
+
"engine": "Blink",
|
|
658
|
+
"engine_version": "132",
|
|
659
|
+
"status": "unknown",
|
|
660
|
+
"release_date": "2025-04-24"
|
|
661
|
+
},
|
|
662
|
+
"25.3": {
|
|
663
|
+
"engine": "Blink",
|
|
664
|
+
"engine_version": "132",
|
|
665
|
+
"status": "unknown",
|
|
666
|
+
"release_date": "2025-04-23"
|
|
667
|
+
},
|
|
668
|
+
"25.4": {
|
|
669
|
+
"engine": "Blink",
|
|
670
|
+
"engine_version": "134",
|
|
671
|
+
"status": "unknown",
|
|
672
|
+
"release_date": "2025-04-23"
|
|
655
673
|
}
|
|
656
674
|
}
|
|
657
675
|
},
|
|
@@ -1504,5 +1522,5 @@
|
|
|
1504
1522
|
}
|
|
1505
1523
|
}
|
|
1506
1524
|
},
|
|
1507
|
-
"lastUpdated": "2025-04-
|
|
1525
|
+
"lastUpdated": "2025-04-30T13:52:05.731Z"
|
|
1508
1526
|
}
|
|
@@ -6,7 +6,7 @@ type BrowserVersion = {
|
|
|
6
6
|
engine_version?: string;
|
|
7
7
|
};
|
|
8
8
|
interface AllBrowsersBrowserVersion extends BrowserVersion {
|
|
9
|
-
year: number;
|
|
9
|
+
year: number | string;
|
|
10
10
|
supports?: string;
|
|
11
11
|
wa_compatible?: boolean;
|
|
12
12
|
}
|
|
@@ -33,7 +33,7 @@ type Options = {
|
|
|
33
33
|
*/
|
|
34
34
|
widelyAvailableOnDate?: string | number;
|
|
35
35
|
/**
|
|
36
|
-
* Pass a year between
|
|
36
|
+
* Pass a year between 2015 and the current year to get browser versions compatible with all
|
|
37
37
|
* Newly Available features as of the end of the year specified.
|
|
38
38
|
* > NOTE: cannot be used with `widelyAvailableOnDate`.
|
|
39
39
|
*/
|
|
@@ -23,7 +23,15 @@ const downstreamBrowserData = [
|
|
|
23
23
|
...Object.entries(bcdBrowsers.browsers).filter(([browserName]) => bcdDownstreamBrowserNames.includes(browserName)),
|
|
24
24
|
...Object.entries(otherBrowsers.browsers),
|
|
25
25
|
];
|
|
26
|
-
const acceptableStatuses = [
|
|
26
|
+
const acceptableStatuses = [
|
|
27
|
+
"current",
|
|
28
|
+
"esr",
|
|
29
|
+
"retired",
|
|
30
|
+
"unknown",
|
|
31
|
+
"beta",
|
|
32
|
+
"nightly",
|
|
33
|
+
];
|
|
34
|
+
let suppressPre2015Warning = false;
|
|
27
35
|
const stripLTEPrefix = (str) => {
|
|
28
36
|
if (!str) {
|
|
29
37
|
return str;
|
|
@@ -136,8 +144,11 @@ const getSubsequentVersions = (minimumVersions) => {
|
|
|
136
144
|
return subsequentVersions;
|
|
137
145
|
};
|
|
138
146
|
const getCoreVersionsByDate = (date, listAllCompatibleVersions = false) => {
|
|
139
|
-
if (date.getFullYear() <
|
|
140
|
-
|
|
147
|
+
if (date.getFullYear() < 2015 && !suppressPre2015Warning) {
|
|
148
|
+
console.warn(new Error("There are no browser versions compatible with Baseline before 2015. You may receive unexpected results."));
|
|
149
|
+
}
|
|
150
|
+
if (date.getFullYear() < 2002) {
|
|
151
|
+
throw new Error("None of the browsers in the core set were released before 2002. Please use a date after 2002.");
|
|
141
152
|
}
|
|
142
153
|
if (date.getFullYear() > new Date().getFullYear()) {
|
|
143
154
|
throw new Error("There are no browser versions compatible with Baseline in the future");
|
|
@@ -269,6 +280,7 @@ export function getCompatibleVersions(userOptions) {
|
|
|
269
280
|
* - `outputFormat`: `array` (default), `object` or `csv`
|
|
270
281
|
*/
|
|
271
282
|
export function getAllVersions(userOptions) {
|
|
283
|
+
suppressPre2015Warning = true;
|
|
272
284
|
let incomingOptions = userOptions ?? {};
|
|
273
285
|
let options = {
|
|
274
286
|
outputFormat: incomingOptions.outputFormat ?? "array",
|
|
@@ -276,7 +288,7 @@ export function getAllVersions(userOptions) {
|
|
|
276
288
|
useSupports: incomingOptions.useSupports ?? false,
|
|
277
289
|
};
|
|
278
290
|
let nextYear = new Date().getFullYear() + 1;
|
|
279
|
-
const yearArray = [...Array(nextYear).keys()].slice(
|
|
291
|
+
const yearArray = [...Array(nextYear).keys()].slice(2002);
|
|
280
292
|
const yearMinimumVersions = {};
|
|
281
293
|
yearArray.forEach((year) => {
|
|
282
294
|
yearMinimumVersions[year] = {};
|
|
@@ -300,7 +312,7 @@ export function getAllVersions(userOptions) {
|
|
|
300
312
|
naObject[version.browser] = version;
|
|
301
313
|
});
|
|
302
314
|
const allVersions = getCompatibleVersions({
|
|
303
|
-
targetYear:
|
|
315
|
+
targetYear: 2002,
|
|
304
316
|
listAllCompatibleVersions: true,
|
|
305
317
|
});
|
|
306
318
|
const outputArray = new Array();
|
|
@@ -327,18 +339,13 @@ export function getAllVersions(userOptions) {
|
|
|
327
339
|
let isNaCompatible = compareVersions(version.version, naVersion) >= 0 ? true : false;
|
|
328
340
|
let versionToPush = {
|
|
329
341
|
...version,
|
|
330
|
-
year: year - 1,
|
|
342
|
+
year: year <= 2015 ? "pre_baseline" : year - 1,
|
|
331
343
|
};
|
|
332
344
|
if (options.useSupports) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
supports = "widely";
|
|
338
|
-
versionToPush = {
|
|
339
|
-
...versionToPush,
|
|
340
|
-
supports: supports,
|
|
341
|
-
};
|
|
345
|
+
if (isWaCcompatible)
|
|
346
|
+
versionToPush.supports = "widely";
|
|
347
|
+
if (isNaCompatible)
|
|
348
|
+
versionToPush.supports = "newly";
|
|
342
349
|
}
|
|
343
350
|
else {
|
|
344
351
|
versionToPush = {
|
|
@@ -376,15 +383,30 @@ export function getAllVersions(userOptions) {
|
|
|
376
383
|
});
|
|
377
384
|
}
|
|
378
385
|
outputArray.sort((a, b) => {
|
|
379
|
-
|
|
386
|
+
// Sort by year: "pre_baseline" first, then numerical year in ascending order
|
|
387
|
+
if (a.year === "pre_baseline" && b.year !== "pre_baseline") {
|
|
380
388
|
return -1;
|
|
381
389
|
}
|
|
382
|
-
|
|
390
|
+
if (b.year === "pre_baseline" && a.year !== "pre_baseline") {
|
|
383
391
|
return 1;
|
|
384
392
|
}
|
|
385
|
-
|
|
386
|
-
|
|
393
|
+
if (a.year !== "pre_baseline" && b.year !== "pre_baseline") {
|
|
394
|
+
if (a.year < b.year) {
|
|
395
|
+
return -1;
|
|
396
|
+
}
|
|
397
|
+
if (a.year > b.year) {
|
|
398
|
+
return 1;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
// Sort by browser alphabetically
|
|
402
|
+
if (a.browser < b.browser) {
|
|
403
|
+
return -1;
|
|
404
|
+
}
|
|
405
|
+
if (a.browser > b.browser) {
|
|
406
|
+
return 1;
|
|
387
407
|
}
|
|
408
|
+
// Sort by version using compareVersions
|
|
409
|
+
return compareVersions(a.version, b.version);
|
|
388
410
|
});
|
|
389
411
|
if (options.outputFormat === "object") {
|
|
390
412
|
const outputObject = {};
|
|
@@ -398,10 +420,19 @@ export function getAllVersions(userOptions) {
|
|
|
398
420
|
engine: version.engine,
|
|
399
421
|
engine_version: version.engine_version,
|
|
400
422
|
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
423
|
+
if (options.useSupports) {
|
|
424
|
+
//@ts-ignore
|
|
425
|
+
outputObject[version.browser][version.version] = version.supports
|
|
426
|
+
? { ...versionToAdd, supports: version.supports }
|
|
427
|
+
: versionToAdd;
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
//@ts-ignores
|
|
431
|
+
outputObject[version.browser][version.version] = {
|
|
432
|
+
...versionToAdd,
|
|
433
|
+
wa_compatible: version.wa_compatible,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
405
436
|
});
|
|
406
437
|
return outputObject ?? {};
|
|
407
438
|
}
|
|
@@ -419,7 +450,7 @@ export function getAllVersions(userOptions) {
|
|
|
419
450
|
engine_version: version.engine_version ?? "NULL",
|
|
420
451
|
};
|
|
421
452
|
outputs = options.useSupports
|
|
422
|
-
? { ...outputs, supports: version.supports }
|
|
453
|
+
? { ...outputs, supports: version.supports ?? "" }
|
|
423
454
|
: { ...outputs, wa_compatible: version.wa_compatible };
|
|
424
455
|
outputString +=
|
|
425
456
|
`\n"${outputs.browser}","` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baseline-browser-mapping",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "A library for obtaining browser versions with their maximum supported Baseline feature set and Widely Available status.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
@@ -20,14 +20,12 @@
|
|
|
20
20
|
"refresh-static": "npx tsx scripts/refresh-static.ts"
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@mdn/browser-compat-data": "^6.0.9",
|
|
25
|
-
"web-features": "^2.34.1"
|
|
26
|
-
},
|
|
27
23
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^22.15.
|
|
24
|
+
"@types/node": "^22.15.17",
|
|
29
25
|
"prettier": "^3.5.3",
|
|
30
|
-
"typescript": "^5.7.2"
|
|
26
|
+
"typescript": "^5.7.2",
|
|
27
|
+
"@mdn/browser-compat-data": "^6.0.13",
|
|
28
|
+
"web-features": "^2.34.2"
|
|
31
29
|
},
|
|
32
30
|
"repository": "git+https://github.com/web-platform-dx/baseline-browser-mapping.git"
|
|
33
31
|
}
|