Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove dojo plugin dep #2461

Merged
merged 3 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions crates/dojo-core/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@ version = 1
[[package]]
name = "dojo"
version = "1.0.0-alpha.4"
dependencies = [
"dojo_plugin",
]

[[package]]
name = "dojo_plugin"
version = "1.0.0-alpha.4"
source = "git+https://github.com/dojoengine/dojo?rev=f15def33#f15def330c0d099e79351d11c197f63e8cc1ff36"
1 change: 0 additions & 1 deletion crates/dojo-core/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ name = "dojo"
version = "1.0.0-alpha.4"

[dependencies]
dojo_plugin = { git = "https://github.com/dojoengine/dojo", rev = "f15def33" }
starknet = "=2.7.0"

[lib]
24 changes: 16 additions & 8 deletions crates/dojo-world/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,22 @@ pub fn dojo_metadata_from_package(package: &Package, ws: &Workspace<'_>) -> Resu
}

// If not dojo dependent, we should skip metadata gathering.
if !package
.manifest
.summary
.dependencies
.iter()
.any(|dep| dep.name.as_str() == "dojo" || dep.name.as_str() == "dojo_plugin")
{
return Ok(DojoMetadata::default());
if !package.manifest.summary.dependencies.iter().any(|dep| dep.name.as_str() == "dojo") {
// Some tests (like dojo-core) may depend on dojo, but there is no dojo dependency in the
// manifest. In case the profile config file exists, we extract the default
// namespace from it.
if let Ok(profile_config) = ProfileConfig::new(
&Utf8PathBuf::from(package.manifest_path().parent().unwrap()),
ws.current_profile()?,
) {
let metadata =
DojoMetadata { namespace: profile_config.namespace, ..Default::default() };

return Ok(metadata);
} else {
tracing::trace!(target: LOG_TARGET, package = ?package.manifest_path(), "No dojo dependency or profile config file found, skipping metadata collection.");
return Ok(DojoMetadata::default());
}
}

let profile_config = ProfileConfig::new(
Expand Down
8 changes: 0 additions & 8 deletions examples/spawn-and-move/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ dependencies = [
[[package]]
name = "dojo"
version = "1.0.0-alpha.4"
dependencies = [
"dojo_plugin",
]

[[package]]
name = "dojo_examples"
Expand All @@ -30,8 +27,3 @@ dependencies = [
"bestiary",
"dojo",
]

[[package]]
name = "dojo_plugin"
version = "1.0.0-alpha.4"
source = "git+https://github.com/dojoengine/dojo?rev=f15def33#f15def330c0d099e79351d11c197f63e8cc1ff36"
Loading