Skip to content

Commit 70819b4

Browse files
committed
feat(forge-cmd): export ProjectPathsAwareArgs, FilterArgs and update manifests
1 parent d431f74 commit 70819b4

File tree

10 files changed

+233
-318
lines changed

10 files changed

+233
-318
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ members = [
2020
"crates/evm/traces/",
2121
"crates/fmt/",
2222
"crates/forge/",
23+
"crates/forge/bin",
2324
"crates/macros/",
2425
"crates/test-utils/",
2526
]

crates/forge/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ license.workspace = true
1010
homepage.workspace = true
1111
repository.workspace = true
1212

13-
[[bin]]
14-
name = "forge"
15-
path = "bin/main.rs"
13+
#[[bin]] converted to a crate in the workspace to expose code
14+
#name = "forge"
15+
#path = "bin/main.rs"
1616

1717
[build-dependencies]
1818
vergen = { workspace = true, default-features = false, features = [

crates/forge/bin/Cargo.toml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
[package]
2+
name = "forge-cmd"
3+
description = "Forge command line interface"
4+
5+
version.workspace = true
6+
edition.workspace = true
7+
rust-version.workspace = true
8+
authors.workspace = true
9+
license.workspace = true
10+
homepage.workspace = true
11+
repository.workspace = true
12+
13+
[lib]
14+
#name = "forge_cmd"
15+
path = "cmd/lib.rs"
16+
#name = "forge"
17+
18+
[build-dependencies]
19+
vergen = { workspace = true, default-features = false, features = [
20+
"build",
21+
"git",
22+
"gitcl",
23+
] }
24+
25+
[dependencies]
26+
# lib
27+
foundry-block-explorers = { workspace = true, features = ["foundry-compilers"] }
28+
foundry-common.workspace = true
29+
foundry-compilers = { workspace = true, features = ["full"] }
30+
foundry-config.workspace = true
31+
foundry-evm.workspace = true
32+
foundry-wallets.workspace = true
33+
#foundry-linking.workspace = true
34+
#
35+
ethers-contract = { workspace = true, features = ["abigen"] }
36+
#
37+
#revm-inspectors.workspace = true
38+
#
39+
comfy-table = "7"
40+
eyre.workspace = true
41+
#proptest = "1"
42+
rayon = "1"
43+
serde.workspace = true
44+
tracing.workspace = true
45+
yansi.workspace = true
46+
#humantime-serde = "1.1.1"
47+
48+
# bin
49+
forge.workspace = true
50+
forge-doc.workspace = true
51+
forge-fmt.workspace = true
52+
forge-verify.workspace = true
53+
forge-script.workspace = true
54+
foundry-cli.workspace = true
55+
foundry-debugger.workspace = true
56+
57+
alloy-dyn-abi.workspace = true
58+
alloy-json-abi.workspace = true
59+
alloy-primitives = { workspace = true, features = ["serde"] }
60+
alloy-rpc-types.workspace = true
61+
alloy-provider = { workspace = true, features = ["reqwest", "ws", "ipc"] }
62+
alloy-network.workspace = true
63+
alloy-transport.workspace = true
64+
alloy-signer.workspace = true
65+
alloy-consensus.workspace = true
66+
alloy-chains.workspace = true
67+
68+
async-trait = "0.1"
69+
clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] }
70+
clap_complete = "4"
71+
clap_complete_fig = "4"
72+
dialoguer = { version = "0.11", default-features = false }
73+
dunce = "1"
74+
futures = "0.3"
75+
hex.workspace = true
76+
indicatif = "0.17"
77+
itertools.workspace = true
78+
once_cell = "1"
79+
parking_lot = "0.12"
80+
regex = { version = "1", default-features = false }
81+
reqwest = { workspace = true, features = ["json"] }
82+
semver = "1"
83+
serde_json.workspace = true
84+
similar = { version = "2", features = ["inline"] }
85+
solang-parser.workspace = true
86+
strum = { workspace = true, features = ["derive"] }
87+
thiserror = "1"
88+
tokio = { version = "1", features = ["time"] }
89+
toml = { version = "0.8", features = ["preserve_order"] }
90+
toml_edit = "0.22.4"
91+
watchexec = "2.3.2"
92+
evm-disassembler.workspace = true
93+
rustc-hash.workspace = true
94+
95+
# doc server
96+
axum = { workspace = true, features = ["ws"] }
97+
hyper.workspace = true
98+
tower-http = { workspace = true, features = ["fs"] }
99+
opener = "0.6"
100+
101+
[target.'cfg(unix)'.dependencies]
102+
tikv-jemallocator = { workspace = true, optional = true }
103+
104+
[dev-dependencies]
105+
anvil.workspace = true
106+
foundry-test-utils.workspace = true
107+
108+
mockall = "0.12"
109+
criterion = "0.5"
110+
globset = "0.4"
111+
paste = "1.0"
112+
path-slash = "0.2"
113+
pretty_assertions.workspace = true
114+
svm = { package = "svm-rs", version = "0.5", default-features = false, features = [
115+
"rustls",
116+
] }
117+
tempfile.workspace = true
118+
tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] }
119+
120+
alloy-signer-wallet.workspace = true
121+
122+
[features]
123+
default = ["rustls"]
124+
rustls = [
125+
"foundry-cli/rustls",
126+
"foundry-wallets/rustls",
127+
"reqwest/rustls-tls",
128+
"reqwest/rustls-tls-native-roots",
129+
]
130+
openssl = ["foundry-cli/openssl", "reqwest/default-tls"]
131+
asm-keccak = ["alloy-primitives/asm-keccak"]
132+
jemalloc = ["dep:tikv-jemallocator"]
133+
134+
#[[bench]]
135+
#name = "test"
136+
#harness = false

crates/forge/bin/cmd/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[path = "mod.rs"]
2+
mod cmd;
3+
use cmd::{install, watch};
4+
5+
mod test;
6+
pub use test::{FilterArgs, ProjectPathsAwareFilter};
7+
8+
#[macro_use]
9+
extern crate tracing;

crates/forge/bin/cmd/test/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{fmt, path::Path};
99
/// The filter to use during testing.
1010
///
1111
/// See also `FileFilter`.
12-
#[derive(Clone, Parser)]
12+
#[derive(Clone, Parser, Default)]
1313
#[command(next_help_heading = "Test filtering")]
1414
pub struct FilterArgs {
1515
/// Only run test functions matching the specified regex pattern.

crates/forge/bin/cmd/test/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{install, test::filter::ProjectPathsAwareFilter, watch::WatchArgs};
1+
use super::{install, watch::WatchArgs};
22
use alloy_primitives::U256;
33
use clap::Parser;
44
use eyre::Result;
@@ -44,7 +44,7 @@ mod filter;
4444
mod summary;
4545
use summary::TestSummaryReporter;
4646

47-
pub use filter::FilterArgs;
47+
pub use filter::{FilterArgs, ProjectPathsAwareFilter};
4848
use forge::traces::render_trace_arena;
4949

5050
// Loads project's figment and merges the build cli arguments into it

crates/forge/bin/cmd/test/summary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::cmd::test::TestOutcome;
1+
use forge::result::TestOutcome;
22
use comfy_table::{
33
modifiers::UTF8_ROUND_CORNERS, Attribute, Cell, CellAlignment, Color, Row, Table,
44
};

0 commit comments

Comments
 (0)