Skip to content

Commit

Permalink
fix: docsrs builds final (#2235)
Browse files Browse the repository at this point in the history
* fix

* fix: middleware

* fix: update rustc flags

* docs: add comment
  • Loading branch information
DaniPopes committed Mar 8, 2023
1 parent 7242850 commit f9086e7
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 18 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -38,6 +38,7 @@ default-members = [

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
Expand Down
1 change: 1 addition & 0 deletions ethers-contract/Cargo.toml
Expand Up @@ -57,4 +57,5 @@ openssl = ["ethers-contract-abigen/openssl"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
1 change: 1 addition & 0 deletions ethers-contract/ethers-contract-abigen/Cargo.toml
Expand Up @@ -43,6 +43,7 @@ getrandom = { version = "0.2", features = ["js"] }

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
Expand Down
1 change: 1 addition & 0 deletions ethers-contract/ethers-contract-derive/Cargo.toml
Expand Up @@ -30,4 +30,5 @@ eyre = "0.6"

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
19 changes: 6 additions & 13 deletions ethers-contract/src/lib.rs
Expand Up @@ -69,31 +69,24 @@ pub use once_cell::sync::Lazy;
#[cfg(feature = "eip712")]
pub use ethers_derive_eip712::*;

// For Abigen expansions in docs.rs builds.
// For macro expansions only, not public API.
// See: [#2235](https://github.com/gakonst/ethers-rs/pull/2235)

#[doc(hidden)]
#[allow(unused_extern_crates)]
extern crate self as ethers_contract;

#[doc(hidden)]
#[allow(unused_extern_crates)]
#[cfg(docsrs)]
extern crate self as ethers;

#[doc(hidden)]
#[cfg(docsrs)]
pub mod core {
pub use ethers_core::*;
}

#[doc(hidden)]
#[cfg(docsrs)]
pub mod contract {
pub use crate::*;
}

#[doc(hidden)]
#[cfg(docsrs)]
pub mod providers {
pub use ethers_providers::*;
}
pub use ethers_core as core;

#[doc(hidden)]
pub use ethers_providers as providers;
1 change: 1 addition & 0 deletions ethers-core/Cargo.toml
Expand Up @@ -66,4 +66,5 @@ macros = ["syn", "cargo_metadata", "once_cell"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
1 change: 1 addition & 0 deletions ethers-etherscan/Cargo.toml
Expand Up @@ -42,6 +42,7 @@ tracing-subscriber = { version = "0.3", default-features = false, features = ["e

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
Expand Down
1 change: 1 addition & 0 deletions ethers-middleware/Cargo.toml
Expand Up @@ -12,6 +12,7 @@ keywords = ["ethereum", "web3", "celo", "ethers"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
Expand Down
16 changes: 16 additions & 0 deletions ethers-middleware/src/lib.rs
Expand Up @@ -40,3 +40,19 @@ pub use timelag::TimeLag;
/// [`Middleware`](ethers_providers::Middleware) in a concise way
pub mod builder;
pub use builder::MiddlewareBuilder;

// For macro expansions only, not public API.
// See: [#2235](https://github.com/gakonst/ethers-rs/pull/2235)

#[doc(hidden)]
#[allow(unused_extern_crates)]
extern crate self as ethers;

#[doc(hidden)]
pub use ethers_contract as contract;

#[doc(hidden)]
pub use ethers_core as core;

#[doc(hidden)]
pub use ethers_providers as providers;
1 change: 1 addition & 0 deletions ethers-providers/Cargo.toml
Expand Up @@ -12,6 +12,7 @@ keywords = ["ethereum", "web3", "celo", "ethers"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions ethers-signers/Cargo.toml
Expand Up @@ -12,6 +12,7 @@ keywords = ["ethereum", "web3", "celo", "ethers"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Expand Up @@ -83,11 +83,6 @@
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms), allow(dead_code, unused_variables))))]

// For macro expansion
#[doc(hidden)]
#[allow(unused_extern_crates)]
extern crate self as ethers;

#[doc(inline)]
pub use ethers_addressbook as addressbook;
#[doc(inline)]
Expand Down Expand Up @@ -129,3 +124,8 @@ pub mod prelude {
#[cfg(feature = "ethers-solc")]
pub use super::solc::*;
}

// For macro expansions only, not public API.
#[doc(hidden)]
#[allow(unused_extern_crates)]
extern crate self as ethers;

0 comments on commit f9086e7

Please sign in to comment.