Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move cli args to separate crates #2681

Merged
merged 10 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ members = [
"crates/katana/storage/provider",
"crates/katana/tasks",
"crates/katana/trie",
"crates/katana/cli",
"crates/metrics",
"crates/saya/core",
"crates/saya/provider",
Expand All @@ -45,6 +46,7 @@ members = [
"crates/torii/client",
"crates/torii/server",
"crates/torii/types-test",
"crates/torii/cli",
"examples/spawn-and-move",
"scripts/verify_db_balances",
"xtask/generate-test-db",
Expand Down Expand Up @@ -103,6 +105,7 @@ katana-runner = { path = "crates/katana/runner" }
katana-slot-controller = { path = "crates/katana/controller" }
katana-tasks = { path = "crates/katana/tasks" }
katana-trie = { path = "crates/katana/trie" }
katana-cli = { path = "crates/katana/cli" }

# torii
torii-client = { path = "crates/torii/client" }
Expand All @@ -111,6 +114,7 @@ torii-graphql = { path = "crates/torii/graphql" }
torii-grpc = { path = "crates/torii/grpc" }
torii-relay = { path = "crates/torii/libp2p" }
torii-server = { path = "crates/torii/server" }
torii-cli = { path = "crates/torii/cli" }

# saya
saya-core = { path = "crates/saya/core" }
Expand Down
21 changes: 3 additions & 18 deletions bin/katana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,23 @@ repository.workspace = true
version.workspace = true

[dependencies]
katana-core.workspace = true
katana-cli.workspace = true
katana-db.workspace = true
katana-node.workspace = true
katana-primitives.workspace = true
katana-slot-controller = { workspace = true, optional = true }

alloy-primitives.workspace = true
anyhow.workspace = true
byte-unit = "5.1.4"
cainome-cairo-serde.workspace = true
clap.workspace = true
clap_complete.workspace = true
comfy-table = "7.1.1"
console.workspace = true
dojo-utils.workspace = true
serde.workspace = true
serde_json.workspace = true
shellexpand = "3.1.0"
tokio.workspace = true
toml.workspace = true
tracing.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
url.workspace = true

[dev-dependencies]
assert_matches.workspace = true
starknet.workspace = true

[features]
default = [ "jemalloc", "slot" ]
default = [ "jemalloc", "katana-cli/slot" ]

jemalloc = [ ]
slot = [ "dep:katana-slot-controller", "katana-primitives/slot" ]
starknet-messaging = [ "katana-node/starknet-messaging" ]
starknet-messaging = [ "katana-cli/starknet-messaging" ]
5 changes: 2 additions & 3 deletions bin/katana/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
mod db;
mod node;
mod options;

use anyhow::Result;
use clap::{Args, CommandFactory, Parser, Subcommand};
use clap_complete::Shell;
use katana_cli::NodeArgs;
use katana_node::version::VERSION;

#[derive(Parser)]
Expand All @@ -14,7 +13,7 @@ pub struct Cli {
commands: Option<Commands>,

#[command(flatten)]
node: node::NodeArgs,
node: NodeArgs,
}

impl Cli {
Expand Down
1 change: 0 additions & 1 deletion bin/katana/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

mod cli;
mod utils;

use anyhow::Result;
use clap::Parser;
Expand Down
79 changes: 0 additions & 79 deletions bin/katana/src/utils.rs

This file was deleted.

1 change: 1 addition & 0 deletions bin/torii/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ starknet.workspace = true
tokio-stream = "0.1.11"
tokio-util = "0.7.7"
tokio.workspace = true
torii-cli.workspace = true
torii-core.workspace = true
torii-graphql.workspace = true
torii-grpc = { workspace = true, features = [ "server" ] }
Expand Down
Loading
Loading