Skip to content

Commit

Permalink
log a message when encountering empty package names rather than erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Feb 6, 2024
1 parent 09555ec commit 8a578a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/turborepo-repository/src/package_graph/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,18 @@ impl<'a, T: PackageDiscovery> BuildState<'a, ResolvedPackageManager, T> {
}?;

for (path, json) in package_jsons {
self.add_json(path, json)?;
match self.add_json(path, json) {
Ok(()) => {}
Err(Error::PackageJsonMissingName(_)) => {
// previous implementations of turbo would silently ignore package.json files
// that didn't have a name field (well, actually, if two or more had the same
// name, it would throw a 'name clash' error, but that's a different story)
//
// let's try to match that behavior, but log a debug message
tracing::debug!("ignoring package.json at {} since it has no name", &path);
}
Err(err) => return Err(err),
}
}

let Self {
Expand Down

0 comments on commit 8a578a0

Please sign in to comment.