diff --git a/features/error-cause.yml b/features/error-cause.yml index 69e25634134..685de80784c 100644 --- a/features/error-cause.yml +++ b/features/error-cause.yml @@ -1,7 +1,6 @@ name: Error cause description: The `cause` property of errors records the specific original cause of the error, particularly for errors that have been re-thrown. -spec: - - https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-installerrorcause +spec: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-installerrorcause compat_features: - javascript.builtins.Error.Error.options_cause_parameter - javascript.builtins.Error.cause diff --git a/features/focus-events.yml b/features/focus-events.yml index 7108fd9f1d0..cf9b9e17399 100644 --- a/features/focus-events.yml +++ b/features/focus-events.yml @@ -1,9 +1,10 @@ name: Focus events description: Focus events, such as `focus` and `blur`, fire when an element gets or loses focus. spec: https://w3c.github.io/uievents/#events-focusevent -compute_from: - - api.Element.blur_event - - api.Element.focus_event +status: + compute_from: + - api.Element.blur_event + - api.Element.focus_event # It's possible that caniuse's `focusin-focusout-events` could be linked here # or broken out into a separate feature. But caniuse and BCD conflict, # making this difficult. See this issue to help resolve this: diff --git a/features/focus-events.yml.dist b/features/focus-events.yml.dist index 465ed030f69..602353b94aa 100644 --- a/features/focus-events.yml.dist +++ b/features/focus-events.yml.dist @@ -2,10 +2,17 @@ # Do not edit this file by hand. Edit the source file instead! status: - baseline: false + baseline: high + baseline_low_date: 2015-07-29 + baseline_high_date: 2018-01-29 support: - safari: "7" - safari_ios: "7" + chrome: "1" + chrome_android: "18" + edge: "12" + firefox: "24" + firefox_android: "24" + safari: "3.1" + safari_ios: "2" compat_features: # baseline: high # baseline_low_date: 2015-07-29 @@ -20,6 +27,7 @@ compat_features: # safari_ios: "2" - api.Element.blur_event + # ⬇️ Same status as overall feature ⬇️ # baseline: high # baseline_low_date: 2015-07-29 # baseline_high_date: 2018-01-29 diff --git a/features/uint8array-base64-hex.yml b/features/uint8array-base64-hex.yml index 293fe95d212..b96e45d8aaf 100644 --- a/features/uint8array-base64-hex.yml +++ b/features/uint8array-base64-hex.yml @@ -1,8 +1,7 @@ name: Uint8Array base64 and hex conversion description: The `Uint8Array` object methods `fromBase64()`, `toBase64()`, and `setFromBase64()` convert to and from base64 strings. The `fromHex()`, `toHex()`, and `setFromHex()` methods convert to and from hex strings. spec: https://tc39.es/proposal-arraybuffer-base64/spec/ -group: - - typed-arrays +group: typed-arrays compat_features: - javascript.builtins.Uint8Array.fromBase64 - javascript.builtins.Uint8Array.fromHex diff --git a/features/weak-references.yml b/features/weak-references.yml index dba1193752e..55060f0e20a 100644 --- a/features/weak-references.yml +++ b/features/weak-references.yml @@ -1,7 +1,6 @@ name: Weak references description: The `WeakRef` and `FinalizationRegistry` objects hold references to garbage-collectable objects without creating strong references that prevent their garbage collection. -spec: - - https://tc39.es/ecma262/multipage/managing-memory.html#sec-managing-memory +spec: https://tc39.es/ecma262/multipage/managing-memory.html#sec-managing-memory snapshot: ecmascript-2021 group: javascript status: diff --git a/package-lock.json b/package-lock.json index ec65ab4e42d..bfa5d62e399 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "@types/diff": "^5.2.3", "@types/node": "^18.19.68", "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", "caniuse-lite": "^1.0.30001689", "diff": "^7.0.0", "eslint-plugin-new-with-error": "^5.0.0", @@ -1158,22 +1157,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ajv-formats": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", diff --git a/package.json b/package.json index c609b0df5c9..0acd39aa5a1 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "@types/diff": "^5.2.3", "@types/node": "^18.19.68", "ajv": "^8.17.1", - "ajv-formats": "^3.0.1", "caniuse-lite": "^1.0.30001689", "diff": "^7.0.0", "eslint-plugin-new-with-error": "^5.0.0", diff --git a/schemas/data.schema.json b/schemas/data.schema.json index 99363c4d78a..8e81681c9b9 100644 --- a/schemas/data.schema.json +++ b/schemas/data.schema.json @@ -40,7 +40,7 @@ "type": "array" } ], - "description": "caniuse.com identifier" + "description": "caniuse.com identifier(s)" }, "compat_features": { "description": "Sources of support data for this feature", @@ -70,7 +70,7 @@ "type": "array" } ], - "description": "Group identifier" + "description": "Group identifier(s)" }, "name": { "description": "Short name", @@ -89,26 +89,22 @@ "type": "array" } ], - "description": "Snapshot identifier" + "description": "Snapshot identifier(s)" }, "spec": { "anyOf": [ { - "description": "Specification URL", - "format": "uri", "type": "string" }, { "items": { - "description": "Specification URL", - "format": "uri", "type": "string" }, "minItems": 2, "type": "array" } ], - "description": "Specification" + "description": "Specification URL(s)" }, "status": { "additionalProperties": false, @@ -286,7 +282,6 @@ }, "spec": { "description": "Specification", - "format": "uri", "type": "string" } }, diff --git a/scripts/build.ts b/scripts/build.ts index af131761952..35f346481ce 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -88,7 +88,7 @@ function valid(data: any): boolean { if (!valid) { // TODO: turn on strictNullChecks, fix all the errors, and replace this with: // const errors = validate.errors; - const errors = (valid as any).errors as DefinedError[]; + const errors = validate.errors as DefinedError[]; for (const error of errors) { logger.error(`${error.instancePath}: ${error.message}`); } diff --git a/scripts/validate.ts b/scripts/validate.ts index 9a21ca7fdf3..8c88eecfef1 100644 --- a/scripts/validate.ts +++ b/scripts/validate.ts @@ -1,21 +1,17 @@ import Ajv from "ajv"; -import addFormats from "ajv-formats"; import assert from "node:assert/strict"; import * as schema from "../schemas/data.schema.json" with { type: "json" }; -export function validate(data: any) { - const ajv = new Ajv({ allErrors: true, allowUnionTypes: true }); - addFormats(ajv); - // TODO: turn on strictNullChecks, fix all the errors, and replace this with: - // const validator = ajv.compile(schema); - const validator = ajv.compile(schema); +const ajv = new Ajv({ allErrors: true, allowUnionTypes: true }); +// TODO: turn on strictNullChecks, fix all the errors, and replace this with: +// const validator = ajv.compile(schema); +const validator = ajv.compile(schema); - assert.equal( - validator({}), - false, - "Failed confidence check: schema validates empty object", - ); +assert.equal( + validator({}), + false, + "Failed confidence check: schema validates empty object", +); - return validator; -} +export { validator as validate }; diff --git a/types.ts b/types.ts index 6d51e26b912..b99adb54beb 100644 --- a/types.ts +++ b/types.ts @@ -33,13 +33,13 @@ export interface FeatureData { description: string; /** Short description of the feature, as an HTML string */ description_html: string; - /** Specification */ - spec: specification_url | [specification_url, specification_url, ...specification_url[]]; - /** Group identifier */ + /** Specification URL(s) */ + spec: string | [string, string, ...string[]]; + /** Group identifier(s) */ group?: string | [string, string, ...string[]]; - /** Snapshot identifier */ + /** Snapshot identifier(s) */ snapshot?: string | [string, string, ...string[]]; - /** caniuse.com identifier */ + /** caniuse.com identifier(s) */ caniuse?: string | [string, string, ...string[]]; /** Whether a feature is considered a "baseline" web platform feature and when it achieved that status */ status: SupportStatus; @@ -69,11 +69,6 @@ interface SupportStatus extends Status { by_compat_key?: Record } -/** Specification URL - * @format uri -*/ -type specification_url = string; - export interface GroupData { /** Short name */ name: string; @@ -85,5 +80,5 @@ export interface SnapshotData { /** Short name */ name: string; /** Specification */ - spec: specification_url; + spec: string; }