-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(mfe): build internal package if present in graph #9383
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ 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; | ||
|
||
|
@@ -610,7 +611,7 @@ impl TurboJson { | |
} | ||
|
||
/// Adds a local proxy task to a workspace TurboJson | ||
pub fn with_proxy(&mut self) { | ||
pub fn with_proxy(&mut self, needs_proxy_build: bool) { | ||
if self.extends.is_empty() { | ||
self.extends = Spanned::new(vec!["//".into()]); | ||
} | ||
|
@@ -619,6 +620,11 @@ impl TurboJson { | |
TaskName::from("proxy"), | ||
Spanned::new(RawTaskDefinition { | ||
cache: Some(Spanned::new(false)), | ||
depends_on: needs_proxy_build.then(|| { | ||
Spanned::new(vec![Spanned::new(UnescapedString::from(format!( | ||
"{MICRO_FRONTENDS_PACKAGE_INTERNAL}#build" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't love that we have to hardcode this task, but we can iterate on it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also don't love this, but for all other uses of the MFE package that don't have it as a workspace package this will be unnecessary. |
||
)))]) | ||
}), | ||
..Default::default() | ||
}), | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,11 @@ impl From<UnescapedString> for String { | |
} | ||
} | ||
|
||
impl From<String> for UnescapedString { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required since there isn't any other way to construct an |
||
fn from(value: String) -> Self { | ||
Self(value) | ||
} | ||
} | ||
// For testing purposes | ||
impl From<&'static str> for UnescapedString { | ||
fn from(value: &'static str) -> Self { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to add this if the internal package is in the graph meaning there's a valid build task