mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-13 06:39:31 +03:00
703 B
703 B
Generating Theme Types
How to generate theme types:
Run a script
./script/build-theme-types
Types are generated in styles/src/types/zed.ts
How it works:
-
Rust types
The
crates/theme
contains theme types. Crateschemars
used to generate a JSON schema from the theme structs. Every struct that represent theme type has a#[derive(JsonSchema)]
attribute.Task lotaked at
crates/xtask/src/main.rs
generates a JSON schema from the theme structs. -
TypeScript types
Script
npm run build-types
fromstyles
package generates TypeScript types from the JSON schema and saves them tostyles/src/types/zed.ts
.