Commit dca296e
committed
Migrate SDK type generation from ts-rs to but-ts (schemars)
Rust side:
- Register all frontend-facing types with schemars JsonSchema +
register_sdk_type!() across gitbutler-branch-actions, but-api,
but-workspace, but-settings, but-core, but-github, but-gitlab,
gitbutler-edit-mode, and gitbutler-operating-modes
- Add export-schema Cargo feature to gitbutler-branch-actions and
gitbutler-edit-mode with conditional schemars guards
- Add rename_all = "camelCase" to but_core::ui::WorktreeChanges
(fixes ignored_changes field being snake_case in JSON)
- Remove skip_serializing_if from SDK-registered types so nullable
fields are always serialized (as null), matching the but-ts assumption
- Remove ts-rs derives and Cargo feature flags from all crates
- Delete generate-ts-definitions-from-rust.sh script
- Enhance but-ts: --source-crates filter, nullable-but-required field
handling, append-to-existing output mode
TypeScript side:
- Delete all ts-rs generated files from @gitbutler/core
- Remove hand-written type duplicates from the desktop app (~40 files)
and replace with direct imports from @gitbutler/but-sdk
- Add browser export condition to @gitbutler/but-sdk package.json
with empty stub so Vite serves it instead of the napi index.js
- Add @gitbutler/but-sdk to Vite optimizeDeps.exclude1 parent d307086 commit dca296e
228 files changed
Lines changed: 1533 additions & 2673 deletions
File tree
- .github/workflows
- apps/desktop
- src
- components
- branchesPage
- branch
- codegen
- commit
- diff
- files
- forge
- irc
- projectSettings
- settings
- stack
- upstream
- views
- workspace
- lib
- actions
- ai
- analytics
- baseBranch
- bootstrap
- branches
- codegen
- commits
- config
- dependencies
- dragging
- files
- forge
- github
- gitlab
- interface
- git
- history
- hunks
- irc
- mode
- project
- rules
- selection
- settings
- stacks
- state
- support
- testing
- upstream
- worktree
- routes/[projectId]/edit
- crates
- but-action
- src
- but-api
- src/legacy
- but-core
- src
- tests/core/diff
- but-forge
- src
- but-github
- src
- but-gitlab
- src
- but-hunk-assignment
- src
- but-settings
- src
- but-ts/src
- but-workspace
- src
- legacy
- ui
- but/src/command/legacy
- pull
- status
- gitbutler-branch-actions
- src
- tests/branch-actions/virtual_branches
- gitbutler-edit-mode
- src
- gitbutler-operating-modes/src
- packages
- but-sdk
- src/generated
- core
- src/generated
- action
- core
- refMetadata
- forge
- github
- gitlab
- hunkAssignment
- settings
- workspace
- legacy
- refInfo
- ui/src/lib
- components
- file
- select
- focus
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 95 | | |
117 | 96 | | |
118 | 97 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
| |||
27 | 21 | | |
28 | 22 | | |
29 | 23 | | |
| 24 | + | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
| |||
0 commit comments