mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-28 21:32:39 +00:00
Delete generating-theme-types.md
This commit is contained in:
parent
c106d3ea6b
commit
5da057288d
1 changed files with 0 additions and 29 deletions
|
@ -1,29 +0,0 @@
|
||||||
[⬅ Back to Index](../index.md)
|
|
||||||
|
|
||||||
# Generating Theme Types
|
|
||||||
|
|
||||||
|
|
||||||
## How to generate theme types:
|
|
||||||
|
|
||||||
Run a script
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./script/build-theme-types
|
|
||||||
```
|
|
||||||
|
|
||||||
Types are generated in `styles/src/types/zed.ts`
|
|
||||||
|
|
||||||
|
|
||||||
## How it works:
|
|
||||||
|
|
||||||
1. Rust types
|
|
||||||
|
|
||||||
The `crates/theme` contains theme types.
|
|
||||||
Crate `schemars` 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.
|
|
||||||
|
|
||||||
2. TypeScript types
|
|
||||||
|
|
||||||
Script `npm run build-types` from `styles` package generates TypeScript types from the JSON schema and saves them to `styles/src/types/zed.ts`.
|
|
Loading…
Reference in a new issue