web-features 1.1.0 → 1.2.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.
package/data.schema.json CHANGED
@@ -2,6 +2,28 @@
2
2
  "$ref": "#/definitions/WebFeaturesData",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "definitions": {
5
+ "BrowserData": {
6
+ "additionalProperties": false,
7
+ "description": "Browser information",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the browser, as in \"Edge\" or \"Safari on iOS\"",
11
+ "type": "string"
12
+ },
13
+ "releases": {
14
+ "description": "The browser's releases",
15
+ "items": {
16
+ "$ref": "#/definitions/Release"
17
+ },
18
+ "type": "array"
19
+ }
20
+ },
21
+ "required": [
22
+ "name",
23
+ "releases"
24
+ ],
25
+ "type": "object"
26
+ },
5
27
  "FeatureData": {
6
28
  "additionalProperties": false,
7
29
  "properties": {
@@ -236,6 +258,25 @@
236
258
  ],
237
259
  "type": "object"
238
260
  },
261
+ "Release": {
262
+ "additionalProperties": false,
263
+ "description": "Browser release information",
264
+ "properties": {
265
+ "date": {
266
+ "description": "The release date, as in \"2023-12-11\"",
267
+ "type": "string"
268
+ },
269
+ "version": {
270
+ "description": "The version string, as in \"10\" or \"17.1\"",
271
+ "type": "string"
272
+ }
273
+ },
274
+ "required": [
275
+ "version",
276
+ "date"
277
+ ],
278
+ "type": "object"
279
+ },
239
280
  "SnapshotData": {
240
281
  "additionalProperties": false,
241
282
  "properties": {
@@ -258,6 +299,43 @@
258
299
  "WebFeaturesData": {
259
300
  "additionalProperties": false,
260
301
  "properties": {
302
+ "browsers": {
303
+ "additionalProperties": false,
304
+ "description": "Browsers and browser release data",
305
+ "properties": {
306
+ "chrome": {
307
+ "$ref": "#/definitions/BrowserData"
308
+ },
309
+ "chrome_android": {
310
+ "$ref": "#/definitions/BrowserData"
311
+ },
312
+ "edge": {
313
+ "$ref": "#/definitions/BrowserData"
314
+ },
315
+ "firefox": {
316
+ "$ref": "#/definitions/BrowserData"
317
+ },
318
+ "firefox_android": {
319
+ "$ref": "#/definitions/BrowserData"
320
+ },
321
+ "safari": {
322
+ "$ref": "#/definitions/BrowserData"
323
+ },
324
+ "safari_ios": {
325
+ "$ref": "#/definitions/BrowserData"
326
+ }
327
+ },
328
+ "required": [
329
+ "chrome",
330
+ "chrome_android",
331
+ "edge",
332
+ "firefox",
333
+ "firefox_android",
334
+ "safari",
335
+ "safari_ios"
336
+ ],
337
+ "type": "object"
338
+ },
261
339
  "features": {
262
340
  "additionalProperties": {
263
341
  "$ref": "#/definitions/FeatureData"
@@ -281,6 +359,7 @@
281
359
  }
282
360
  },
283
361
  "required": [
362
+ "browsers",
284
363
  "features",
285
364
  "groups",
286
365
  "snapshots"
package/index.d.ts CHANGED
@@ -1,3 +1,17 @@
1
+ /** Browser information */
2
+ interface BrowserData {
3
+ /** The name of the browser, as in "Edge" or "Safari on iOS" */
4
+ name: string;
5
+ /** The browser's releases */
6
+ releases: Release[];
7
+ }
8
+ /** Browser release information */
9
+ interface Release {
10
+ /** The version string, as in "10" or "17.1" */
11
+ version: string;
12
+ /** The release date, as in "2023-12-11" */
13
+ date: string;
14
+ }
1
15
  interface FeatureData {
2
16
  /** Short name */
3
17
  name: string;
@@ -18,7 +32,7 @@ interface FeatureData {
18
32
  /** Sources of support data for this feature */
19
33
  compat_features?: string[];
20
34
  }
21
- type browserIdentifier = "chrome" | "chrome_android" | "edge" | "firefox" | "firefox_android" | "safari" | "safari_ios";
35
+ type BrowserIdentifier = "chrome" | "chrome_android" | "edge" | "firefox" | "firefox_android" | "safari" | "safari_ios";
22
36
  type BaselineHighLow = "high" | "low";
23
37
  interface Status {
24
38
  /** Whether the feature is Baseline (low substatus), Baseline (high substatus), or not (false) */
@@ -29,7 +43,7 @@ interface Status {
29
43
  baseline_high_date?: string;
30
44
  /** Browser versions that most-recently introduced the feature */
31
45
  support: {
32
- [K in browserIdentifier]?: string;
46
+ [K in BrowserIdentifier]?: string;
33
47
  };
34
48
  }
35
49
  interface SupportStatus extends Status {
@@ -53,6 +67,15 @@ interface SnapshotData {
53
67
  spec: specification_url;
54
68
  }
55
69
 
70
+ declare const browsers: {
71
+ chrome: BrowserData;
72
+ chrome_android: BrowserData;
73
+ edge: BrowserData;
74
+ firefox: BrowserData;
75
+ firefox_android: BrowserData;
76
+ safari: BrowserData;
77
+ safari_ios: BrowserData;
78
+ };
56
79
  declare const features: {
57
80
  [key: string]: FeatureData;
58
81
  };
@@ -63,4 +86,4 @@ declare const snapshots: {
63
86
  [key: string]: SnapshotData;
64
87
  };
65
88
 
66
- export { features, groups, snapshots };
89
+ export { browsers, features, groups, snapshots };
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { fileURLToPath } from "node:url";
3
3
  const jsonPath = fileURLToPath(new URL("./data.json", import.meta.url));
4
- const { features, groups, snapshots } = JSON.parse(readFileSync(jsonPath, { encoding: "utf-8" }));
5
- export { features, groups, snapshots };
4
+ const { browsers, features, groups, snapshots } = JSON.parse(readFileSync(jsonPath, { encoding: "utf-8" }));
5
+ export { browsers, features, groups, snapshots };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "web-features",
3
3
  "description": "Curated list of Web platform features",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",