Skip to content

Commit

Permalink
Restrict metaslang_graph_builder dependency to the runtime crate
Browse files Browse the repository at this point in the history
And put it behind the `cli` feature flag
  • Loading branch information
ggiraldez committed May 30, 2024
1 parent 64a91a0 commit 3b31f9e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 28 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/codegen/runtime/cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ codegen_runtime_generator = { workspace = true }
ariadne = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true }
metaslang_graph_builder = { workspace = true, optional = true }
napi = { workspace = true, optional = true }
napi-derive = { workspace = true, optional = true }
semver = { workspace = true }
Expand All @@ -32,7 +32,7 @@ default = ["slang_napi_interfaces", "__private_ariadne", "cli"]
slang_napi_interfaces = ["dep:napi", "dep:napi-derive", "dep:serde_json"]
# Only used by the `slang_solidity` CLI
__private_ariadne = ["dep:ariadne"]
cli = ["dep:clap", "dep:serde_json"]
cli = ["dep:clap", "dep:metaslang_graph_builder", "dep:serde_json"]

[lints]
workspace = true
12 changes: 6 additions & 6 deletions crates/codegen/runtime/cargo/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ pub mod text_index {
pub use text_index::{TextIndex, TextRange, TextRangeExtensions};
}

pub mod graph_builder {
pub use metaslang_graph_builder::functions::Functions;
use metaslang_graph_builder::{ast, graph};
pub use metaslang_graph_builder::{ExecutionConfig, ExecutionError, NoCancellation, Variables};
#[cfg(feature = "cli")]
pub(crate) mod graph_builder {
use metaslang_graph_builder::ast;
pub(crate) use metaslang_graph_builder::functions::Functions;
pub(crate) use metaslang_graph_builder::{ExecutionConfig, ExecutionError, NoCancellation, Variables};

use super::metaslang_cst::KindTypes;

pub type File = ast::File<KindTypes>;
pub type Graph = graph::Graph<KindTypes>;
pub(crate) type File = ast::File<KindTypes>;
}
1 change: 0 additions & 1 deletion crates/codegen/runtime/node_addon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ napi-build = { workspace = true }

[dependencies]
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true }
napi = { workspace = true }
napi-derive = { workspace = true }
semver = { workspace = true }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ napi-build = { workspace = true }

[dependencies]
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true }
napi = { workspace = true }
napi-derive = { workspace = true }
semver = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion crates/testlang/outputs/cargo/slang_testlang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ testlang_language = { workspace = true }

[dependencies]
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true }
semver = { workspace = true }
serde = { workspace = true }
strum = { workspace = true }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ napi-build = { workspace = true }

[dependencies]
metaslang_cst = { workspace = true }
metaslang_graph_builder = { workspace = true }
napi = { workspace = true }
napi-derive = { workspace = true }
semver = { workspace = true }
Expand Down

0 comments on commit 3b31f9e

Please sign in to comment.