diff --git a/src/core/generator/config.rs b/src/cli/generator/config.rs similarity index 100% rename from src/core/generator/config.rs rename to src/cli/generator/config.rs diff --git a/src/cli/generator.rs b/src/cli/generator/generator.rs similarity index 97% rename from src/cli/generator.rs rename to src/cli/generator/generator.rs index 4a9ca4a317..7f491351ad 100644 --- a/src/cli/generator.rs +++ b/src/cli/generator/generator.rs @@ -6,13 +6,13 @@ use pathdiff::diff_paths; use crate::core::config::{self, ConfigModule}; use crate::core::generator::source::{ConfigSource, ImportSource}; -use crate::core::generator::{ - ConfigInput, Generator, GeneratorConfig, InputSource, JsonInput, ProtoInput, Resolved, -}; +use crate::core::generator::{ConfigInput, Generator, JsonInput, ProtoInput}; use crate::core::proto_reader::ProtoReader; use crate::core::resource_reader::ResourceReader; use crate::core::runtime::TargetRuntime; +use super::config::{GeneratorConfig, InputSource, Resolved}; + /// Checks if file or folder already exists or not. fn is_exists(path: &str) -> bool { fs::metadata(path).is_ok() diff --git a/src/cli/generator/mod.rs b/src/cli/generator/mod.rs new file mode 100644 index 0000000000..dd52b56057 --- /dev/null +++ b/src/cli/generator/mod.rs @@ -0,0 +1,4 @@ +mod generator; +mod config; + +pub use generator::ConfigConsoleGenerator; \ No newline at end of file diff --git a/src/core/generator/snapshots/tailcall__core__generator__config__tests__from_json.snap b/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__from_json.snap similarity index 74% rename from src/core/generator/snapshots/tailcall__core__generator__config__tests__from_json.snap rename to src/cli/generator/snapshots/tailcall__cli__generator__config__tests__from_json.snap index 61be97e277..58d5ab264d 100644 --- a/src/core/generator/snapshots/tailcall__core__generator__config__tests__from_json.snap +++ b/src/cli/generator/snapshots/tailcall__cli__generator__config__tests__from_json.snap @@ -1,5 +1,5 @@ --- -source: src/core/generator/config.rs +source: src/cli/generator/config.rs expression: "&config" --- GeneratorConfig { @@ -7,26 +7,26 @@ GeneratorConfig { Input { source: Import { src: "../protobuf/news.proto", - _marker: PhantomData, + _marker: PhantomData, }, }, Input { source: Config { src: "../configs/user-posts.graphql", - _marker: PhantomData, + _marker: PhantomData, }, }, Input { source: Import { src: "https://jsonplaceholder.typicode.com/posts", - _marker: PhantomData, + _marker: PhantomData, }, }, ], output: Output { format: GraphQL, file: "./output.graphql", - _markder: PhantomData, + _markder: PhantomData, }, generate: GenerateOptions { schema: Schema { @@ -55,5 +55,5 @@ GeneratorConfig { }, ), }, - _marker: PhantomData, + _marker: PhantomData, } diff --git a/src/core/generator/mod.rs b/src/core/generator/mod.rs index 59a80201c4..ec7c8198e3 100644 --- a/src/core/generator/mod.rs +++ b/src/core/generator/mod.rs @@ -1,4 +1,3 @@ -mod config; mod from_json; mod from_proto; mod generator; @@ -7,7 +6,6 @@ mod json; mod proto; pub mod source; -pub use config::*; pub use from_json::{FromJsonGenerator, RequestSample}; pub use generator::{ConfigInput, Generator, JsonInput, ProtoInput}; pub use json::NameGenerator;