From fec8e1d2ad348b8bb75a83bd73ce3648fd32c179 Mon Sep 17 00:00:00 2001 From: Chris Olszewski Date: Mon, 10 Jun 2024 11:46:06 -0700 Subject: [PATCH] chore(lockfile): remove default turbo_version impl --- crates/turborepo-lib/src/engine/builder.rs | 4 ++++ crates/turborepo-lockfiles/src/bun/mod.rs | 4 ++++ crates/turborepo-lockfiles/src/lib.rs | 4 +--- crates/turborepo-repository/src/package_graph/mod.rs | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/turborepo-lib/src/engine/builder.rs b/crates/turborepo-lib/src/engine/builder.rs index 4ceeeb99cac70..fe25eaa4ce69a 100644 --- a/crates/turborepo-lib/src/engine/builder.rs +++ b/crates/turborepo-lib/src/engine/builder.rs @@ -579,6 +579,10 @@ mod test { fn global_change(&self, _other: &dyn Lockfile) -> bool { unreachable!() } + + fn turbo_version(&self) -> Option { + None + } } struct MockDiscovery; diff --git a/crates/turborepo-lockfiles/src/bun/mod.rs b/crates/turborepo-lockfiles/src/bun/mod.rs index bc607352c7ee9..363d443fe3705 100644 --- a/crates/turborepo-lockfiles/src/bun/mod.rs +++ b/crates/turborepo-lockfiles/src/bun/mod.rs @@ -118,6 +118,10 @@ impl Lockfile for BunLockfile { // if the types don't match then we changed package managers any_other.downcast_ref::().is_none() } + + fn turbo_version(&self) -> Option { + None + } } impl Entry { diff --git a/crates/turborepo-lockfiles/src/lib.rs b/crates/turborepo-lockfiles/src/lib.rs index ac32dd5cf6d0a..c8fbb9d3d2f45 100644 --- a/crates/turborepo-lockfiles/src/lib.rs +++ b/crates/turborepo-lockfiles/src/lib.rs @@ -64,9 +64,7 @@ pub trait Lockfile: Send + Sync + Any + std::fmt::Debug { fn global_change(&self, other: &dyn Lockfile) -> bool; /// Return any turbo version found in the lockfile - fn turbo_version(&self) -> Option { - None - } + fn turbo_version(&self) -> Option; } /// Takes a lockfile, and a map of workspace directory paths -> (package name, diff --git a/crates/turborepo-repository/src/package_graph/mod.rs b/crates/turborepo-repository/src/package_graph/mod.rs index aafb9682013f5..0f7a77dfbf0a4 100644 --- a/crates/turborepo-repository/src/package_graph/mod.rs +++ b/crates/turborepo-repository/src/package_graph/mod.rs @@ -680,6 +680,10 @@ mod test { fn global_change(&self, _other: &dyn Lockfile) -> bool { unreachable!("global change detection not necessary for package graph construction") } + + fn turbo_version(&self) -> Option { + None + } } #[tokio::test]