Skip to content

Commit

Permalink
fix: remove dojo plugin dep (#2461)
Browse files Browse the repository at this point in the history
* chore(dojo-core): move dojo plugin as a dev dependency

* fix: remove plugin dependency

* fix: run clippy and fmt
  • Loading branch information
glihm authored Sep 22, 2024
1 parent 892cd03 commit 86dbd44
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
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"

0 comments on commit 86dbd44

Please sign in to comment.