Skip to content

Commit

Permalink
Generate TypeScript definitions from schema (#16571)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
queengooborg authored Jun 7, 2022
1 parent 95acc4a commit 2888cf5
Show file tree
Hide file tree
Showing 11 changed files with 890 additions and 533 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ LICENSE
/CODE_OF_CONDUCT.md
build/
coverage/
types.d.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ yarn.lock
.nyc_output/
coverage.lcov
coverage/
types.d.ts
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ LICENSE
/CODE_OF_CONDUCT.md
build/
coverage/
types.d.ts
Loading

0 comments on commit 2888cf5

Please sign in to comment.