Skip to content

Commit 52cd0f6

Browse files
branchseerclaude
andauthored
Consolidate workspace dependencies and add cargo-autoinherit (#333)
## Summary This PR consolidates dependency management by moving dev-dependencies to the workspace root and ensuring all crates reference them consistently. It also introduces `cargo-autoinherit` to the development toolchain for automated workspace dependency inheritance. ## Key Changes - **Workspace dependency consolidation**: Moved `ntest` and `terminal_size` from individual crate `Cargo.toml` files to the workspace root, allowing all crates to reference them via `{ workspace = true }` - **Updated crate dependencies**: - `crates/pty_terminal/Cargo.toml`: Changed `ntest` and `terminal_size` to use workspace inheritance - `crates/pty_terminal_test/Cargo.toml`: Changed `ntest` to use workspace inheritance - `crates/vite_select/Cargo.toml`: Changed `vite_str` to use workspace inheritance - **Added cargo-autoinherit tooling**: - Integrated `cargo-autoinherit@0.1.6` into CI pipeline - Added to development initialization script (`justfile`) - Added automated check in CI to ensure workspace dependencies are properly inherited - Integrated into the `fmt` recipe for automatic dependency inheritance during formatting ## Notable Details The `cargo-autoinherit` tool is now part of the development workflow and CI checks, ensuring that workspace dependencies are consistently applied across all crates and preventing manual inconsistencies in dependency declarations. https://claude.ai/code/session_01PCwRbvAEXdAD7ieDyKe7pb --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 65504c9 commit 52cd0f6

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,12 @@ jobs:
210210
with:
211211
save-cache: ${{ github.ref_name == 'main' }}
212212
cache-key: fmt
213-
tools: cargo-shear@1.11.1
213+
tools: cargo-shear@1.11.1,cargo-autoinherit@0.1.6
214214
components: clippy rust-docs rustfmt
215215

216216
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
217217
- run: pnpm oxfmt --check
218+
- run: cargo autoinherit && git diff --exit-code
218219
- run: cargo shear --deny-warnings
219220
- run: cargo fmt --check
220221
- run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ widestring = "1.2.0"
154154
winapi = "0.3.9"
155155
winsafe = { version = "0.0.24", features = ["kernel"] }
156156
xxhash-rust = { version = "0.8.15", features = ["const_xxh3"] }
157+
ntest = "0.9.5"
158+
terminal_size = "0.4"
157159

158160
[workspace.metadata.cargo-shear]
159161
ignored = [

crates/pty_terminal/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ vt100 = { workspace = true }
1515
[dev-dependencies]
1616
ctor = { workspace = true }
1717
ctrlc = { workspace = true }
18-
ntest = "0.9.5"
18+
ntest = { workspace = true }
1919
subprocess_test = { workspace = true, features = ["portable-pty"] }
20-
terminal_size = "0.4"
20+
terminal_size = { workspace = true }
2121

2222
[target.'cfg(unix)'.dev-dependencies]
2323
nix = { workspace = true }

crates/pty_terminal_test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pty_terminal_test_client = { workspace = true }
1616
[dev-dependencies]
1717
crossterm = { workspace = true }
1818
ctor = { workspace = true }
19-
ntest = "0.9.5"
19+
ntest = { workspace = true }
2020
pty_terminal_test_client = { workspace = true, features = ["testing"] }
2121
subprocess_test = { workspace = true, features = ["portable-pty"] }
2222

crates/vite_select/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ workspace = true
1414
anyhow = { workspace = true }
1515
crossterm = { workspace = true }
1616
nucleo-matcher = { workspace = true }
17-
vite_str = { path = "../vite_str" }
17+
vite_str = { workspace = true }
1818

1919
[dev-dependencies]
2020
assert2 = { workspace = true }

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _default:
99
alias r := ready
1010

1111
init:
12-
cargo binstall watchexec-cli cargo-insta typos-cli cargo-shear@1.11.1 taplo-cli -y
12+
cargo binstall watchexec-cli cargo-insta typos-cli cargo-shear@1.11.1 cargo-autoinherit taplo-cli -y
1313

1414
ready:
1515
git diff --exit-code --quiet
@@ -24,6 +24,7 @@ watch *args='':
2424
watchexec --no-vcs-ignore {{args}}
2525

2626
fmt:
27+
cargo autoinherit
2728
cargo shear --fix
2829
cargo fmt --all
2930
pnpm oxfmt

0 commit comments

Comments
 (0)