-
Notifications
You must be signed in to change notification settings - Fork 2k
/
compat-data.schema.json
325 lines (314 loc) · 12.1 KB
/
compat-data.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
{
"$schema": "http://json-schema.org/schema",
"definitions": {
"simple_support_statement": {
"type": "object",
"properties": {
"version_added": {
"description": "A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).",
"anyOf": [
{
"type": "string",
"pattern": "^(≤?(\\d+)(\\.\\d+)*|preview)$"
},
{
"type": "boolean",
"nullable": true
}
],
"tsType": "VersionValue"
},
"version_removed": {
"description": "A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.",
"anyOf": [
{
"type": "string",
"pattern": "^(≤?(\\d+)(\\.\\d+)*|preview)$"
},
{
"const": true
}
],
"tsType": "VersionValue"
},
"version_last": {
"description": "A string, indicating the last browser version that supported this feature, or the value true, indicating that the feature was removed in an unknown version. This is automatically generated.",
"anyOf": [
{
"type": "string",
"pattern": "^(≤?(\\d+)(\\.\\d+)*|preview)$"
},
{
"const": true
}
],
"tsType": "VersionValue"
},
"prefix": {
"type": "string",
"description": "A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included."
},
"alternative_name": {
"type": "string",
"description": "An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed."
},
"flags": {
"type": "array",
"description": "An optional array of objects describing flags that must be configured for this browser to support this feature.",
"minItems": 1,
"items": {
"$ref": "#/definitions/flag_statement"
},
"tsType": "FlagStatement[]"
},
"impl_url": {
"anyOf": [
{
"$ref": "#/definitions/impl_url_value"
},
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/impl_url_value"
}
}
],
"description": "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.",
"tsType": "string | string[]",
"errorMessage": {
"pattern": "impl_url must be a link to a browser commit or bug URL. URLs must be in shortened form (ex. bugs.chromium.org -> crbug.com). Note: `npm run fix` may resolve these issues."
}
},
"partial_implementation": {
"const": true,
"description": "A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example)."
},
"notes": {
"description": "A string or array of strings containing additional information.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"minItems": 2,
"items": {
"type": "string"
}
}
],
"tsType": "string | string[]"
}
},
"required": ["version_added"],
"dependencies": {
"partial_implementation": {
"if": {
"properties": { "partial_implementation": { "const": true } }
},
"then": { "required": ["notes"] }
}
},
"additionalProperties": false
},
"flag_statement": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "An enum that indicates the flag type.",
"enum": ["preference", "runtime_flag"]
},
"name": {
"type": "string",
"description": "A string giving the name of the flag or preference that must be configured."
},
"value_to_set": {
"type": "string",
"description": "A string giving the value which the specified flag must be set to for this feature to work."
}
},
"additionalProperties": false,
"required": ["type", "name"]
},
"support_statement": {
"anyOf": [
{ "$ref": "#/definitions/simple_support_statement" },
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/simple_support_statement"
}
},
{ "const": "mirror" }
],
"tsType": "SimpleSupportStatement | SimpleSupportStatement[]"
},
"status_block": {
"type": "object",
"properties": {
"experimental": {
"type": "boolean",
"description": "A boolean value that indicates the general stability of this feature. This value will be true if the feature was implemented in one browser engine recently. This value will be false if the feature was implemented in multiple browser engines, or if the feature had been implemented over two years ago in any one browser engine."
},
"standard_track": {
"type": "boolean",
"description": "A boolean value indicating whether the feature is part of an active specification or specification process."
},
"deprecated": {
"type": "boolean",
"description": "A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality."
}
},
"required": ["experimental", "standard_track", "deprecated"],
"additionalProperties": false
},
"support_block": {
"type": "object",
"propertyNames": {
"enum": [
"chrome",
"chrome_android",
"deno",
"edge",
"firefox",
"firefox_android",
"ie",
"nodejs",
"oculus",
"opera",
"opera_android",
"safari",
"safari_ios",
"samsunginternet_android",
"webview_android",
"webview_ios"
]
},
"additionalProperties": {
"$ref": "#/definitions/support_statement"
},
"tsType": "Partial<Record<BrowserName, SupportStatement>>"
},
"spec_url_value": {
"type": "string",
"format": "uri",
"pattern": "(^https://[^#]+#.+)|(^https://github.com/WebAssembly/.+)|(^https://registry.khronos.org/webgl/extensions/[^/]+/)"
},
"impl_url_value": {
"type": "string",
"format": "uri",
"pattern": "^https://(trac.webkit.org/changeset/|hg.mozilla.org/mozilla-central/rev/|crrev.com/|bugzil.la/|crbug.com/|webkit.org/b/)"
},
"compat_statement": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "A string containing a human-readable description of the feature."
},
"mdn_url": {
"type": "string",
"format": "uri",
"pattern": "^https://developer\\.mozilla\\.org/docs/",
"description": "A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic."
},
"spec_url": {
"anyOf": [
{
"$ref": "#/definitions/spec_url_value"
},
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/spec_url_value"
}
}
],
"description": "An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.",
"tsType": "string | string[]"
},
"tags": {
"description": "An optional array of strings allowing to assign tags to the feature.",
"type": "array",
"minItems": 1,
"tsType": "string[]"
},
"source_file": {
"type": "string",
"description": "The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified."
},
"support": {
"$ref": "#/definitions/support_block",
"description": "The data for the support of each browser, containing a `support_statement` object for each browser identifier with information about versions, prefixes, or alternate names, as well as notes."
},
"status": {
"$ref": "#/definitions/status_block",
"description": "An object containing information about the stability of the feature."
}
},
"required": ["support"],
"additionalProperties": false
},
"identifier": {
"type": "object",
"properties": {
"__compat": {
"type": "object",
"$ref": "#/definitions/compat_statement",
"required": ["status"],
"description": "A feature is described by an identifier containing the `__compat` property.\n\nIn other words, identifiers without `__compat` aren't necessarily features, but help to nest the features properly.\n\nWhen an identifier has a `__compat` block, it represents its basic support, indicating that a minimal implementation of a functionality is included.\n\nWhat it represents exactly depends of the evolution of the feature over time, both in terms of specifications and of browser support.",
"tsType": "CompatStatement"
}
},
"patternProperties": {
"^(?!__compat)[a-zA-Z_0-9-$@]*$": { "$ref": "#/definitions/identifier" }
},
"additionalProperties": false,
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"tsType": "{[key: string]: Identifier} & {__compat?: CompatStatement};"
},
"webextensions_identifier": {
"type": "object",
"properties": {
"__compat": { "$ref": "#/definitions/compat_statement" }
},
"patternProperties": {
"^(?!__compat)[a-zA-Z_0-9-$@]*$": {
"$ref": "#/definitions/webextensions_identifier",
"tsType": "Identifier"
}
},
"additionalProperties": false,
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"tsType": "{[key: string]: Identifier} & {__compat?: CompatStatement}"
}
},
"title": "CompatDataFile",
"type": "object",
"patternProperties": {
"^(?!__compat)(?!webextensions)[a-zA-Z_0-9-$@]*$": {
"$ref": "#/definitions/identifier"
},
"^webextensions*$": {
"$ref": "#/definitions/webextensions_identifier",
"tsType": "Identifier"
},
"^__compat$": {
"$ref": "#/definitions/compat_statement"
}
},
"additionalProperties": false,
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"maxProperties": 1,
"minProperties": 1
}