Skip to content

Commit 2888cf5

Browse files
authored
Generate TypeScript definitions from schema (#16571)
* Install json-schema-to-typescript * Auto-generate typedefs from JSON schema * Remove primary_identifier from schema * Remove webextensions_compat_statement * Reverse order of typedefs output * Add TS type overrides * Allow for top-level __compat should we ever want it * Ensure potentially-unreachable definitions are generated as well * Generate BrowserName type from BCD * Generate enum types for browser data * Add/update descriptions * Simplify schema for support statements * Don't mark "mirror" as potential option for support statement * Generate CompatData type * Enforce type on compat data file * Add custom names to file types in schema * Rename script * Fix types output * Apply transformations to TypeScript manually (until PR is merged) * Move test to ensure alt. name + prefix aren't both defined into linter * Add descriptions * Update types * Make browser type property required * Add keywords to AJV * Finish preparing auto-generated types * Replace types.d.ts with auto-generated file * Ignore types.d.ts in Prettier/ESLint
1 parent 95acc4a commit 2888cf5

File tree

11 files changed

+890
-533
lines changed

11 files changed

+890
-533
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ LICENSE
1010
/CODE_OF_CONDUCT.md
1111
build/
1212
coverage/
13+
types.d.ts

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ yarn.lock
88
.nyc_output/
99
coverage.lcov
1010
coverage/
11+
types.d.ts

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ LICENSE
1010
/CODE_OF_CONDUCT.md
1111
build/
1212
coverage/
13+
types.d.ts

0 commit comments

Comments
 (0)