diff --git a/Cargo.toml b/Cargo.toml index 4e4cf85c7..7e3e413e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,8 @@ rustdoc-args = ["--cfg", "docsrs"] op-alloy-genesis = { version = "0.5.2", path = "crates/genesis", default-features = false } op-alloy-protocol = { version = "0.5.2", path = "crates/protocol", default-features = false } op-alloy-consensus = { version = "0.5.2", path = "crates/consensus", default-features = false } +op-alloy-network = { version = "0.5.2", path = "crates/network", default-features = false } +op-alloy-provider = { version = "0.5.2", path = "crates/provider", default-features = false } op-alloy-rpc-types = { version = "0.5.2", path = "crates/rpc-types", default-features = false } op-alloy-rpc-jsonrpsee = { version = "0.5.2", path = "crates/rpc-jsonrpsee", default-features = false } op-alloy-rpc-types-engine = { version = "0.5.2", path = "crates/rpc-types-engine", default-features = false } diff --git a/Justfile b/Justfile index d49f50fcd..fbd03036c 100644 --- a/Justfile +++ b/Justfile @@ -33,7 +33,7 @@ fmt-native-check: # Lint the Rust documentation lint-docs: - RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --document-private-items + RUSTDOCFLAGS="-D warnings" cargo doc --all --no-deps --document-private-items # Fixes the formatting of the workspace fmtf: @@ -45,4 +45,4 @@ build *args='': # Runs `cargo hack check` against the workspace hack: - cargo hack check --feature-powerset --no-dev-deps + cargo hack check --feature-powerset --no-dev-deps --exclude op-alloy diff --git a/crates/op-alloy/Cargo.toml b/crates/op-alloy/Cargo.toml new file mode 100644 index 000000000..3d17d7c2f --- /dev/null +++ b/crates/op-alloy/Cargo.toml @@ -0,0 +1,83 @@ +[package] +name = "op-alloy" +description = "Connect applications to the OP Stack" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +exclude.workspace = true + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true + +[dependencies] +# Workspace +op-alloy-consensus = { workspace = true, optional = true } +op-alloy-genesis = { workspace = true, optional = true } +op-alloy-network = { workspace = true, optional = true } +op-alloy-protocol = { workspace = true, optional = true } +op-alloy-provider = { workspace = true, optional = true } +op-alloy-rpc-jsonrpsee = { workspace = true, optional = true } +op-alloy-rpc-types-engine = { workspace = true, optional = true } +op-alloy-rpc-types = { workspace = true, optional = true } + +[features] +default = ["std", "k256", "serde"] + +std = [ + "op-alloy-consensus?/std", + "op-alloy-genesis?/std", + "op-alloy-protocol?/std", + "op-alloy-rpc-types?/std", + "op-alloy-rpc-types-engine?/std", +] + +full = [ + "consensus", + "genesis", + "provider", + "network", + "protocol", + "rpc-types", + "rpc-types-engine", + "rpc-jsonrpsee", +] + +k256 = [ + "op-alloy-consensus?/k256", +] + +arbitrary = [ + "op-alloy-consensus?/arbitrary", + "op-alloy-genesis?/arbitrary", + "op-alloy-protocol?/arbitrary", + "op-alloy-rpc-types?/arbitrary", + "op-alloy-rpc-types-engine?/arbitrary", +] + +serde = [ + "op-alloy-consensus?/serde", + "op-alloy-genesis?/serde", + "op-alloy-protocol?/serde", + "op-alloy-rpc-types-engine?/serde", +] + +# `no_std` support +consensus = ["dep:op-alloy-consensus"] +genesis = ["dep:op-alloy-genesis"] +protocol = ["dep:op-alloy-protocol"] +rpc-types = ["dep:op-alloy-rpc-types"] +rpc-types-engine = ["dep:op-alloy-rpc-types-engine"] + +# std features +provider = ["dep:op-alloy-provider"] +network = ["dep:op-alloy-network"] +rpc-jsonrpsee = ["dep:op-alloy-rpc-jsonrpsee"] + diff --git a/crates/op-alloy/README.md b/crates/op-alloy/README.md new file mode 100644 index 000000000..ae42a26df --- /dev/null +++ b/crates/op-alloy/README.md @@ -0,0 +1 @@ +../../README.md diff --git a/crates/op-alloy/src/lib.rs b/crates/op-alloy/src/lib.rs new file mode 100644 index 000000000..50a2eba5b --- /dev/null +++ b/crates/op-alloy/src/lib.rs @@ -0,0 +1,39 @@ +#![doc = include_str!("../README.md")] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg", + html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico" +)] +#![cfg_attr(not(test), warn(unused_crate_dependencies))] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] + +#[cfg(feature = "consensus")] +#[doc(inline)] +pub use op_alloy_consensus as consensus; + +#[cfg(feature = "genesis")] +#[doc(inline)] +pub use op_alloy_genesis as genesis; + +#[cfg(feature = "network")] +#[doc(inline)] +pub use op_alloy_network as network; + +#[cfg(feature = "protocol")] +#[doc(inline)] +pub use op_alloy_protocol as protocol; + +#[cfg(feature = "provider")] +#[doc(inline)] +pub use op_alloy_provider as provider; + +#[cfg(feature = "rpc-types")] +#[doc(inline)] +pub use op_alloy_rpc_types as rpc_types; + +#[cfg(feature = "rpc-types-engine")] +#[doc(inline)] +pub use op_alloy_rpc_types_engine as rpc_types_engine; + +#[cfg(feature = "rpc-jsonrpsee")] +#[doc(inline)] +pub use op_alloy_rpc_jsonrpsee as rpc_jsonrpsee;