Skip to content

Commit 4a20bed

Browse files
authored
Merge pull request #11253 from Byron/next2
intermezzo: finish but-api cleanup
2 parents 8eb12e2 + f436900 commit 4a20bed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+978
-948
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ The `crates/` directory contains ~65 Rust crates organized by functionality:
225225
**Note**: Some crates are marked for refactoring (see DEVELOPMENT.md). Be cautious when modifying:
226226

227227
- gitbutler-reference
228-
- gitbutler-storage
229228
- gitbutler-branch-actions
230229
- gitbutler-repository
231230
- gitbutler-url

.github/workflows/push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ jobs:
119119
cargo check -p but-meta
120120
cargo check -p but-graph
121121
cargo check -p but-workspace
122+
cargo check -p but-github
123+
cargo check -p but-api
122124
name: Special `cargo check` runs
123125
env:
124126
RUSTFLAGS: '--deny warnings'

Cargo.lock

Lines changed: 36 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ but-feedback = { path = "crates/but-feedback" }
3636
but-forge-storage = { path = "crates/but-forge-storage" }
3737
but-settings = { path = "crates/but-settings" }
3838
but-oxidize = { path = "crates/but-oxidize" }
39+
but-fs = { path = "crates/but-fs" }
40+
but-forge = { path = "crates/but-forge" }
3941

4042
gitbutler-git = { path = "crates/gitbutler-git" }
4143
gitbutler-watcher = { path = "crates/gitbutler-watcher" }
@@ -51,8 +53,6 @@ gitbutler-project = { path = "crates/gitbutler-project" }
5153
gitbutler-user = { path = "crates/gitbutler-user" }
5254
gitbutler-branch = { path = "crates/gitbutler-branch" }
5355
gitbutler-reference = { path = "crates/gitbutler-reference" }
54-
gitbutler-storage = { path = "crates/gitbutler-storage" }
55-
gitbutler-fs = { path = "crates/gitbutler-fs" }
5656
gitbutler-time = { path = "crates/gitbutler-time" }
5757
gitbutler-commit = { path = "crates/gitbutler-commit" }
5858
gitbutler-url = { path = "crates/gitbutler-url" }
@@ -61,7 +61,6 @@ gitbutler-operating-modes = { path = "crates/gitbutler-operating-modes" }
6161
gitbutler-edit-mode = { path = "crates/gitbutler-edit-mode" }
6262
gitbutler-cherry-pick = { path = "crates/gitbutler-cherry-pick" }
6363
gitbutler-stack = { path = "crates/gitbutler-stack" }
64-
gitbutler-forge = { path = "crates/gitbutler-forge" }
6564
gitbutler-hunk-dependency = { path = "crates/gitbutler-hunk-dependency" }
6665
gitbutler-workspace = { path = "crates/gitbutler-workspace" }
6766

DEVELOPMENT.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ If you are interested in joining our small but tightly knit engineering team, we
499499
This is a list of crates/modules that we want to eliminate or split into smaller crates:
500500

501501
- [gitbutler-reference](crates/gitbutler-reference/) (just bad)
502-
- [gitbutler-storage](crates/gitbutler-storage/) (legacy way of dealing with files)
503502
- [gitbutler-branch-actions](crates/gitbutler-branch-actions/) (contains functionality outside of the virtual branch domain (e.g. commit actions etc.))
504503
- [gitbutler-repository](crates/gitbutler-repository/)
505504
- [gitbutler-branch](crates/gitbutler-branch/) (contains `diff` and `branch` contexts due to a cyclic dependency)

crates/but-api/Cargo.toml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,28 @@ tauri = ["dep:tauri"]
2020
## When paths are turned into strings they are lossy. Also provide a `_bytes` variant of such fields with the original value
2121
## for lossless use.
2222
path-bytes = ["dep:bstr"]
23+
## Make legacy functionality available.
24+
legacy = [
25+
"dep:gitbutler-user",
26+
"dep:gitbutler-project",
27+
"dep:gitbutler-branch",
28+
"dep:gitbutler-branch-actions",
29+
"dep:gitbutler-commit",
30+
"dep:gitbutler-command-context",
31+
"dep:gitbutler-reference",
32+
"dep:gitbutler-stack",
33+
"dep:gitbutler-repo",
34+
"dep:gitbutler-repo-actions",
35+
"dep:gitbutler-edit-mode",
36+
"dep:gitbutler-operating-modes",
37+
"dep:gitbutler-sync",
38+
"dep:gitbutler-oplog",
39+
]
40+
2341

2442
[dependencies]
2543
but-settings.workspace = true
26-
but-github.workspace = true
44+
but-github = { workspace = true, features = ["legacy"] }
2745
but-secret.workspace = true
2846
but-workspace = { workspace = true, features = ["legacy"] }
2947
but-worktrees.workspace = true
@@ -46,22 +64,22 @@ but-feedback.workspace = true
4664
but-error.workspace = true
4765
but-rules.workspace = true
4866
but-oxidize.workspace = true
67+
but-forge.workspace = true
4968

50-
gitbutler-user.workspace = true
51-
gitbutler-project.workspace = true
52-
gitbutler-branch.workspace = true
53-
gitbutler-branch-actions.workspace = true
54-
gitbutler-commit.workspace = true
55-
gitbutler-command-context.workspace = true
56-
gitbutler-reference.workspace = true
57-
gitbutler-stack.workspace = true
58-
gitbutler-repo.workspace = true
59-
gitbutler-repo-actions.workspace = true
60-
gitbutler-edit-mode.workspace = true
61-
gitbutler-operating-modes.workspace = true
62-
gitbutler-sync.workspace = true
63-
gitbutler-oplog.workspace = true
64-
gitbutler-forge.workspace = true
69+
gitbutler-user = {workspace = true, optional = true}
70+
gitbutler-project = {workspace = true, optional = true}
71+
gitbutler-branch = {workspace = true, optional = true}
72+
gitbutler-branch-actions = {workspace = true, optional = true}
73+
gitbutler-commit = {workspace = true, optional = true}
74+
gitbutler-command-context = {workspace = true, optional = true}
75+
gitbutler-reference = {workspace = true, optional = true}
76+
gitbutler-stack = {workspace = true, optional = true}
77+
gitbutler-repo = {workspace = true, optional = true}
78+
gitbutler-repo-actions = {workspace = true, optional = true}
79+
gitbutler-edit-mode = {workspace = true, optional = true}
80+
gitbutler-operating-modes = {workspace = true, optional = true}
81+
gitbutler-sync = {workspace = true, optional = true}
82+
gitbutler-oplog = {workspace = true, optional = true}
6583

6684
tauri = { version = "^2.9.2", features = ["unstable"], optional = true } # For the #[tauri::command(async)] macro only
6785

crates/but-api/src/commands/mod.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)