From 354100a0d5619736fd68922e3603a8759e27f9fa Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Mon, 3 Feb 2025 11:19:08 -0500 Subject: [PATCH 1/3] Removing svelte/vue from globs --- crates/turborepo-lib/src/boundaries.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/turborepo-lib/src/boundaries.rs b/crates/turborepo-lib/src/boundaries.rs index b8a075a9b1aef..c37bc114fbbd9 100644 --- a/crates/turborepo-lib/src/boundaries.rs +++ b/crates/turborepo-lib/src/boundaries.rs @@ -197,8 +197,6 @@ impl Run { "**/*.jsx".parse().unwrap(), "**/*.ts".parse().unwrap(), "**/*.tsx".parse().unwrap(), - "**/*.vue".parse().unwrap(), - "**/*.svelte".parse().unwrap(), ], &["**/node_modules/**".parse().unwrap()], globwalk::WalkType::Files, From bb92aa935afbce939f29df803a42818c20490155 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Mon, 3 Feb 2025 16:43:21 -0500 Subject: [PATCH 2/3] Added warning for svelte/vue extensions. Also extended to mjs and cjs files --- crates/turborepo-lib/src/boundaries.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/turborepo-lib/src/boundaries.rs b/crates/turborepo-lib/src/boundaries.rs index c37bc114fbbd9..fb38c90f4a9ff 100644 --- a/crates/turborepo-lib/src/boundaries.rs +++ b/crates/turborepo-lib/src/boundaries.rs @@ -16,6 +16,7 @@ use swc_ecma_ast::EsVersion; use swc_ecma_parser::{lexer::Lexer, Capturing, EsSyntax, Parser, Syntax, TsSyntax}; use swc_ecma_visit::VisitWith; use thiserror::Error; +use tracing::log::warn; use turbo_trace::{ImportFinder, ImportType, Tracer}; use turbopath::{AbsoluteSystemPath, AbsoluteSystemPathBuf, PathRelation, RelativeUnixPath}; use turborepo_repository::{ @@ -197,6 +198,10 @@ impl Run { "**/*.jsx".parse().unwrap(), "**/*.ts".parse().unwrap(), "**/*.tsx".parse().unwrap(), + "**/*.cjs".parse().unwrap(), + "**/*.mjs".parse().unwrap(), + "**/*.svelte".parse().unwrap(), + "**/*.vue".parse().unwrap(), ], &["**/node_modules/**".parse().unwrap()], globwalk::WalkType::Files, @@ -212,7 +217,16 @@ impl Run { let resolver = Tracer::create_resolver(tsconfig_path.exists().then(|| tsconfig_path.as_ref())); + let mut not_supported_extensions = HashSet::new(); for file_path in files { + match file_path.extension() { + Some(ext @ ("svelte" | "vue")) => { + not_supported_extensions.insert(ext.to_string()); + continue; + } + _ => {} + } + if let Some(repo) = repo { let repo = repo.lock().expect("lock poisoned"); if matches!(repo.status_should_ignore(file_path.as_std_path()), Ok(true)) { @@ -296,6 +310,16 @@ impl Run { } } + for ext in ¬_supported_extensions { + warn!( + "{} files are currently not supported, boundaries checks will not apply to them", + ext + ); + } + if !not_supported_extensions.is_empty() { + println!(); + } + Ok((files_checked, diagnostics)) } From 0aced636f17cd6ad272259b80d5307d05a3ef1b5 Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Tue, 4 Feb 2025 14:14:07 -0500 Subject: [PATCH 3/3] Fix lints --- crates/turborepo-lib/src/boundaries.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/turborepo-lib/src/boundaries.rs b/crates/turborepo-lib/src/boundaries.rs index fb38c90f4a9ff..06acc97a10eb7 100644 --- a/crates/turborepo-lib/src/boundaries.rs +++ b/crates/turborepo-lib/src/boundaries.rs @@ -219,12 +219,9 @@ impl Run { let mut not_supported_extensions = HashSet::new(); for file_path in files { - match file_path.extension() { - Some(ext @ ("svelte" | "vue")) => { - not_supported_extensions.insert(ext.to_string()); - continue; - } - _ => {} + if let Some(ext @ ("svelte" | "vue")) = file_path.extension() { + not_supported_extensions.insert(ext.to_string()); + continue; } if let Some(repo) = repo {