Skip to content
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

feat(boundaries): ignore svelte and vue files (but warn) #9886

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion crates/turborepo-lib/src/boundaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -197,8 +198,10 @@ impl Run {
"**/*.jsx".parse().unwrap(),
"**/*.ts".parse().unwrap(),
"**/*.tsx".parse().unwrap(),
"**/*.vue".parse().unwrap(),
"**/*.cjs".parse().unwrap(),
"**/*.mjs".parse().unwrap(),
"**/*.svelte".parse().unwrap(),
"**/*.vue".parse().unwrap(),
],
&["**/node_modules/**".parse().unwrap()],
globwalk::WalkType::Files,
Expand All @@ -214,7 +217,13 @@ 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 {
if let Some(ext @ ("svelte" | "vue")) = file_path.extension() {
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)) {
Expand Down Expand Up @@ -298,6 +307,16 @@ impl Run {
}
}

for ext in &not_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))
}

Expand Down
Loading