@mdn/browser-compat-data 4.1.20 → 5.0.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/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ /* This file is a part of @mdn/browser-compat-data
2
+ * See LICENSE file for more information. */
3
+
4
+ import "./types";
5
+
6
+ import bcd from "./data.json";
7
+
8
+ export default bcd as CompatData;
9
+ export * from "./types";
package/legacynode.mjs ADDED
@@ -0,0 +1,4 @@
1
+ // A small wrapper to allow ESM imports on older NodeJS versions that don't support import assertions
2
+ import fs from 'node:fs';
3
+ const bcd = JSON.parse(fs.readFileSync(new URL('./data.json', import.meta.url)));
4
+ export default bcd;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"main":"index.js","name":"@mdn/browser-compat-data","version":"4.1.20","description":"Browser compatibility data provided by MDN Web Docs","repository":{"type":"git","url":"git+https://github.com/mdn/browser-compat-data.git"},"keywords":["bcd","browser-compat-data","browser","compatibility","data","mdn","mozilla"],"author":"MDN Web Docs","license":"CC0-1.0","bugs":{"url":"https://github.com/mdn/browser-compat-data/issues"},"homepage":"https://github.com/mdn/browser-compat-data#readme","types":"index.d.ts"}
1
+ {"main":"data.json","exports":{".":"./data.json","./forLegacyNode":"./legacynode.mjs"},"types":"index.ts","name":"@mdn/browser-compat-data","version":"5.0.0","description":"Browser compatibility data provided by MDN Web Docs","repository":{"type":"git","url":"git+https://github.com/mdn/browser-compat-data.git"},"keywords":["bcd","browser-compat-data","browser","compatibility","data","mdn","mozilla"],"author":"MDN Web Docs","license":"CC0-1.0","bugs":{"url":"https://github.com/mdn/browser-compat-data/issues"},"homepage":"https://github.com/mdn/browser-compat-data#readme"}
package/types.d.ts CHANGED
@@ -13,6 +13,7 @@ export type BrowserNames =
13
13
  | 'firefox_android'
14
14
  | 'ie'
15
15
  | 'nodejs'
16
+ | 'oculus'
16
17
  | 'opera'
17
18
  | 'opera_android'
18
19
  | 'safari'
@@ -29,6 +30,8 @@ export type BrowserEngines =
29
30
  | 'WebKit'
30
31
  | 'V8';
31
32
 
33
+ export type BrowserTypes = 'desktop' | 'mobile' | 'xr' | 'server';
34
+
32
35
  /**
33
36
  * The browser namespace.
34
37
  */
@@ -46,6 +49,33 @@ export interface BrowserStatement {
46
49
  */
47
50
  name: string;
48
51
 
52
+ /**
53
+ * The platform the browser runs on, for example:
54
+ * `"desktop"`, `"mobile"`, `"server"`, etc.
55
+ */
56
+ type: BrowserTypes;
57
+
58
+ /**
59
+ * The upstream browser
60
+ */
61
+ upstream?: string;
62
+
63
+ /**
64
+ * Whether the browser supports flags to enable or disable features.
65
+ */
66
+ accepts_flags?: boolean;
67
+
68
+ /**
69
+ * Whether the browser supports extensions.
70
+ */
71
+ accepts_webextensions?: boolean;
72
+
73
+ /**
74
+ * An optional string containing the URL of the page where feature flags can be changed
75
+ * (e.g. `"about:config"` for Firefox or `"chrome://flags"` for Chrome).
76
+ */
77
+ pref_url?: string;
78
+
49
79
  /**
50
80
  * The preview browser's name, for example:
51
81
  * `"Nightly"`, `"Canary"`, `"TP"`, etc.
@@ -58,12 +88,6 @@ export interface BrowserStatement {
58
88
  releases: {
59
89
  [version: string]: ReleaseStatement;
60
90
  };
61
-
62
- /**
63
- * An optional string containing the URL of the page where feature flags can be changed
64
- * (e.g. `"about:config"` for Firefox or `"chrome://flags"` for Chrome).
65
- */
66
- pref_url?: string;
67
91
  }
68
92
 
69
93
  /**
@@ -126,6 +150,7 @@ export interface ReleaseStatement {
126
150
  export type SupportStatement =
127
151
  | SimpleSupportStatement
128
152
  | SimpleSupportStatement[];
153
+
129
154
  export type VersionValue = string | boolean | null;
130
155
 
131
156
  /**
@@ -199,6 +224,13 @@ export interface SimpleSupportStatement {
199
224
  */
200
225
  value_to_set?: string;
201
226
  }[];
227
+
228
+ /**
229
+ * An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser; e.g. a https://trac.webkit.org/changeset/
230
+ * https://hg.mozilla.org/mozilla-central/rev/, or https://crrev.com/ URL.
231
+ */
232
+ impl_url?: string;
233
+
202
234
  /**
203
235
  * A `boolean` value indicating whether or not the implementation of the sub-feature follows
204
236
  * the current specification closely enough to not create major interoperability problems.
@@ -260,8 +292,6 @@ export interface CompatStatement {
260
292
  */
261
293
  mdn_url?: string;
262
294
 
263
- matches?: MatchesBlock;
264
-
265
295
  /**
266
296
  * Each `__compat` object contains support information.
267
297
  *
@@ -283,12 +313,6 @@ export interface SupportBlock
283
313
  extends Partial<Record<BrowserNames, SupportStatement>>,
284
314
  Partial<Record<string, SupportStatement>> {}
285
315
 
286
- export interface MatchesBlock {
287
- keywords?: string[];
288
- regex_token?: string;
289
- regex_value?: string;
290
- }
291
-
292
316
  /**
293
317
  * The status property contains information about stability of the feature.
294
318
  */
package/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /* This file is a part of @mdn/browser-compat-data
2
- * See LICENSE file for more information. */
3
-
4
- /// <reference path="./types.d.ts"/>
5
- import { CompatData } from './types';
6
-
7
- // This is necessary to have intellisense in projects which
8
- // import data from this package.
9
- declare const compatData: CompatData;
10
- export = compatData;
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require("./data.json");