diff --git a/crates/turborepo-lib/src/turbo_json/loader.rs b/crates/turborepo-lib/src/turbo_json/loader.rs index 1b895f6ee690e5..2f9d7d1e283519 100644 --- a/crates/turborepo-lib/src/turbo_json/loader.rs +++ b/crates/turborepo-lib/src/turbo_json/loader.rs @@ -1,10 +1,9 @@ use std::collections::HashMap; -use itertools::Itertools; use tracing::debug; use turbopath::{AbsoluteSystemPath, AbsoluteSystemPathBuf}; use turborepo_errors::Spanned; -use turborepo_micro_frontend::MICRO_FRONTENDS_PACKAGE_INTERNAL; +use turborepo_micro_frontend::MICRO_FRONTENDS_PACKAGES; use turborepo_repository::{ package_graph::{PackageInfo, PackageName}, package_json::PackageJson, @@ -186,10 +185,12 @@ impl TurboJsonLoader { Error::NoTurboJSON => Ok(TurboJson::default()), err => Err(err), })?; - let needs_proxy_build = packages + let mfe_package_name = packages .keys() - .contains(&PackageName::from(MICRO_FRONTENDS_PACKAGE_INTERNAL)); - turbo_json.with_proxy(needs_proxy_build); + .filter(|package| MICRO_FRONTENDS_PACKAGES.contains(&package.as_str())) + .map(|package| package.as_str()) + .next(); + turbo_json.with_proxy(mfe_package_name); Ok(turbo_json) } else { turbo_json diff --git a/crates/turborepo-lib/src/turbo_json/mod.rs b/crates/turborepo-lib/src/turbo_json/mod.rs index 25c5f02f84ba9d..3009759957c984 100644 --- a/crates/turborepo-lib/src/turbo_json/mod.rs +++ b/crates/turborepo-lib/src/turbo_json/mod.rs @@ -12,7 +12,6 @@ use serde::{Deserialize, Serialize}; use struct_iterable::Iterable; use turbopath::AbsoluteSystemPath; use turborepo_errors::Spanned; -use turborepo_micro_frontend::MICRO_FRONTENDS_PACKAGE_INTERNAL; use turborepo_repository::package_graph::ROOT_PKG_NAME; use turborepo_unescape::UnescapedString; @@ -611,7 +610,7 @@ impl TurboJson { } /// Adds a local proxy task to a workspace TurboJson - pub fn with_proxy(&mut self, needs_proxy_build: bool) { + pub fn with_proxy(&mut self, mfe_package_name: Option<&str>) { if self.extends.is_empty() { self.extends = Spanned::new(vec!["//".into()]); } @@ -620,9 +619,9 @@ impl TurboJson { TaskName::from("proxy"), Spanned::new(RawTaskDefinition { cache: Some(Spanned::new(false)), - depends_on: needs_proxy_build.then(|| { + depends_on: mfe_package_name.map(|mfe_package_name| { Spanned::new(vec![Spanned::new(UnescapedString::from(format!( - "{MICRO_FRONTENDS_PACKAGE_INTERNAL}#build" + "{mfe_package_name}#build" )))]) }), ..Default::default()