From 7e362f1af664424b8df6351bea28b55d82c3ec57 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 2 Feb 2024 17:42:30 -0800 Subject: [PATCH] Move project graph. --- Cargo.lock | 2 ++ crates/common/Cargo.toml | 2 ++ crates/common/src/lib.rs | 1 + crates/{migrate-turborepo => common}/src/project_graph.rs | 0 crates/migrate-turborepo/src/lib.rs | 3 --- crates/migrate-turborepo/src/migrate_turborepo.rs | 3 +-- 6 files changed, 6 insertions(+), 5 deletions(-) rename crates/{migrate-turborepo => common}/src/project_graph.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 9598e34..318b1a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1671,6 +1671,8 @@ version = "0.1.0" dependencies = [ "extism-pdk", "moon_pdk", + "rustc-hash", + "serde", ] [[package]] diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 0bfa37d..6d620a9 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -8,3 +8,5 @@ publish = false [dependencies] extism-pdk = { workspace = true } moon_pdk = { workspace = true } +rustc-hash = { workspace = true } +serde = { workspace = true } diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index d4ed453..5fafadf 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -1,4 +1,5 @@ pub mod download; +pub mod project_graph; pub fn map_miette_error(error: impl std::fmt::Display) -> extism_pdk::Error { moon_pdk::anyhow!("{error}") diff --git a/crates/migrate-turborepo/src/project_graph.rs b/crates/common/src/project_graph.rs similarity index 100% rename from crates/migrate-turborepo/src/project_graph.rs rename to crates/common/src/project_graph.rs diff --git a/crates/migrate-turborepo/src/lib.rs b/crates/migrate-turborepo/src/lib.rs index 689f9d7..e07a6a9 100644 --- a/crates/migrate-turborepo/src/lib.rs +++ b/crates/migrate-turborepo/src/lib.rs @@ -1,9 +1,6 @@ #[cfg(feature = "wasm")] mod migrate_turborepo; -#[cfg(feature = "wasm")] -mod project_graph; - #[cfg(feature = "wasm")] mod turbo_json; diff --git a/crates/migrate-turborepo/src/migrate_turborepo.rs b/crates/migrate-turborepo/src/migrate_turborepo.rs index 786b19d..c036bca 100644 --- a/crates/migrate-turborepo/src/migrate_turborepo.rs +++ b/crates/migrate-turborepo/src/migrate_turborepo.rs @@ -1,4 +1,3 @@ -use crate::project_graph::{Project, ProjectGraph}; use crate::turbo_json::*; use extism_pdk::*; use moon_common::Id; @@ -7,7 +6,7 @@ use moon_config::{ PartialProjectConfig, PartialTaskArgs, PartialTaskConfig, PartialTaskDependency, PartialTaskOptionsConfig, PlatformType, PortablePath, TaskOptionEnvFile, TaskOutputStyle, }; -use moon_extension_common::map_miette_error; +use moon_extension_common::{map_miette_error, project_graph::*}; use moon_pdk::*; use moon_target::Target; use rustc_hash::FxHashMap;