Export codegen from main juniper crate
Use a trick for re-exporting proc-macros to supply juniper_derive as a dependency of juniper. Users will now just have to depend on juniper directly.
This commit is contained in:
parent
c4ded5781d
commit
141292ad91
5 changed files with 25 additions and 8 deletions
|
@ -20,16 +20,25 @@ harness = false
|
||||||
path = "benches/bench.rs"
|
path = "benches/bench.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
codegen = ["juniper_codegen"]
|
||||||
nightly = []
|
nightly = []
|
||||||
expose-test-schema = []
|
expose-test-schema = []
|
||||||
default = ["chrono", "url", "uuid"]
|
default = [
|
||||||
|
"codegen",
|
||||||
|
"chrono",
|
||||||
|
"url",
|
||||||
|
"uuid"
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
juniper_codegen = { version = "0.8.1", path = "../juniper_codegen" , optional = true}
|
||||||
|
|
||||||
fnv = "1.0.3"
|
fnv = "1.0.3"
|
||||||
chrono = { version = "^0.4.0", optional = true }
|
|
||||||
ordermap = { version = "^0.2.11", features = ["serde-1"] }
|
ordermap = { version = "^0.2.11", features = ["serde-1"] }
|
||||||
serde = { version = "^1.0.8" }
|
serde = { version = "^1.0.8" }
|
||||||
serde_derive = {version="^1.0.8" }
|
serde_derive = {version="^1.0.8" }
|
||||||
|
|
||||||
|
chrono = { version = "^0.4.0", optional = true }
|
||||||
serde_json = { version="^1.0.2", optional = true }
|
serde_json = { version="^1.0.2", optional = true }
|
||||||
url = { version = "^1.5.1", optional = true }
|
url = { version = "^1.5.1", optional = true }
|
||||||
uuid = { version = "0.5.1", optional = true }
|
uuid = { version = "0.5.1", optional = true }
|
||||||
|
|
|
@ -136,6 +136,17 @@ extern crate url;
|
||||||
#[cfg(any(test, feature = "uuid"))]
|
#[cfg(any(test, feature = "uuid"))]
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
|
|
||||||
|
// If the "codegen" feature is enabled, depend on juniper_codegen and re-export everything in it.
|
||||||
|
// This allows users to just depend on juniper and get the derive funcationality automatically.
|
||||||
|
#[cfg(feature = "codegen")]
|
||||||
|
#[allow(unused_imports)]
|
||||||
|
#[macro_use]
|
||||||
|
extern crate juniper_codegen;
|
||||||
|
|
||||||
|
#[cfg(feature = "codegen")]
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use juniper_codegen::*;
|
||||||
|
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -11,8 +11,8 @@ repository = "https://github.com/graphql-rust/juniper"
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
syn = "0.11.11"
|
syn = "0.11"
|
||||||
quote = "0.3.15"
|
quote = "0.3"
|
||||||
|
|
||||||
[badges]
|
[badges]
|
||||||
travis-ci = { repository = "graphql-rust/juniper" }
|
travis-ci = { repository = "graphql-rust/juniper" }
|
||||||
|
|
|
@ -4,8 +4,7 @@ version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
juniper = { path = "../juniper" }
|
juniper = { path = "../juniper" }
|
||||||
juniper_codegen = { path = "../juniper_codegen" }
|
serde_json = { version = "1" }
|
||||||
serde_json = { version = "^1.0.2" }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
fnv = "1.0.3"
|
fnv = "1.0.3"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate juniper;
|
extern crate juniper;
|
||||||
#[macro_use]
|
|
||||||
extern crate juniper_codegen;
|
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Reference in a new issue