@@ -64,7 +64,7 @@ mod error;
6464use crate :: error:: Error ;
6565
6666/// Method to use to enumerate inputs to the TypeScript compiler.
67- #[ derive( Debug ) ]
67+ #[ derive( Copy , Clone , Debug ) ]
6868pub enum Calculation {
6969 /// Estimate the true list of inputs to the TypeScript compiler by listing
7070 /// the files matching the tsconfig's `include` globs.
@@ -278,14 +278,15 @@ fn tsconfig_includes_estimate(
278278///
279279/// - `monorepo_root` may be an absolute path
280280/// - `tsconfig_files` should be relative paths from the monorepo root
281- pub fn tsconfig_includes_by_package_name < P , Q > (
281+ pub fn tsconfig_includes_by_package_name < P , Q , C > (
282282 monorepo_root : P ,
283283 tsconfig_files : & [ Q ] ,
284- calculation_type : Calculation ,
284+ calculation_type : C ,
285285) -> Result < HashMap < String , Vec < PathBuf > > , Error >
286286where
287287 P : AsRef < Path > + Sync ,
288288 Q : AsRef < Path > ,
289+ C : Into < Calculation > + Copy + Sync + Send ,
289290{
290291 let lerna_manifest =
291292 monorepo_manifest:: MonorepoManifest :: from_directory ( monorepo_root. as_ref ( ) ) ?;
@@ -352,7 +353,7 @@ where
352353 . map ( |package| -> Result < ( _ , _ ) , Error > {
353354 // This relies on the assumption that tsconfig.json is always the name of the tsconfig file
354355 let tsconfig = & monorepo_root. as_ref ( ) . join ( package. tsconfig_file ) ;
355- let mut included_files = match calculation_type {
356+ let mut included_files = match calculation_type. into ( ) {
356357 Calculation :: Estimate => {
357358 tsconfig_includes_estimate ( monorepo_root. as_ref ( ) , tsconfig)
358359 }
0 commit comments