auto_source_detection.rs — tailwindcss Source File
Architecture documentation for auto_source_detection.rs, a rust file in the tailwindcss codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 39a54cbf_9465_f527_f672_64ed77edcb50["auto_source_detection.rs"] d56faeb8_aaca_322b_e532_947aed8b0050["ignore::gitignore::"] 39a54cbf_9465_f527_f672_64ed77edcb50 --> d56faeb8_aaca_322b_e532_947aed8b0050 29632a2a_88f2_f99f_6979_ae26cc6fa806["std::sync"] 39a54cbf_9465_f527_f672_64ed77edcb50 --> 29632a2a_88f2_f99f_6979_ae26cc6fa806 style 39a54cbf_9465_f527_f672_64ed77edcb50 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
use ignore::gitignore::{Gitignore, GitignoreBuilder};
use std::sync;
/// All the default rules for auto source detection.
///
/// This includes:
///
/// - Ignoring common content directories like `.git` and `node_modules`
/// - Ignoring file extensions we definitely don't want to include like `.css` and `.scss`
/// - Ignoring common binary file extensions like `.png` and `.jpg`
/// - Ignoring common files like `yarn.lock` and `package-lock.json`
///
pub static RULES: sync::LazyLock<Vec<Gitignore>> = sync::LazyLock::new(|| {
let mut builder = GitignoreBuilder::new("");
builder.add_line(None, &IGNORED_CONTENT_DIRS_GLOB).unwrap();
builder.add_line(None, &IGNORED_EXTENSIONS_GLOB).unwrap();
builder.add_line(None, &IGNORED_FILES_GLOB).unwrap();
// Ensure these rules do not match on folder names
let mut file_only_builder = GitignoreBuilder::new("");
file_only_builder
.only_on_files(true)
.add_line(None, &BINARY_EXTENSIONS_GLOB)
.unwrap();
vec![builder.build().unwrap(), file_only_builder.build().unwrap()]
});
pub static IGNORED_CONTENT_DIRS: sync::LazyLock<Vec<&'static str>> = sync::LazyLock::new(|| {
include_str!("fixtures/ignored-content-dirs.txt")
.trim()
.lines()
.collect()
});
static IGNORED_CONTENT_DIRS_GLOB: sync::LazyLock<String> =
sync::LazyLock::new(|| format!("{{{}}}/", IGNORED_CONTENT_DIRS.join(",")));
static IGNORED_EXTENSIONS_GLOB: sync::LazyLock<String> = sync::LazyLock::new(|| {
format!(
"*.{{{}}}",
include_str!("fixtures/ignored-extensions.txt")
.trim()
.lines()
.collect::<Vec<&str>>()
.join(",")
)
});
pub static BINARY_EXTENSIONS_GLOB: sync::LazyLock<String> = sync::LazyLock::new(|| {
format!(
"*.{{{}}}",
include_str!("fixtures/binary-extensions.txt")
.trim()
.lines()
.collect::<Vec<&str>>()
.join(",")
)
});
static IGNORED_FILES_GLOB: sync::LazyLock<String> = sync::LazyLock::new(|| {
format!(
"{{{}}}",
include_str!("fixtures/ignored-files.txt")
.trim()
.lines()
.collect::<Vec<&str>>()
.join(",")
)
});
Domain
Subdomains
Functions
Dependencies
- ignore::gitignore::
- std::sync
Source
Frequently Asked Questions
What does auto_source_detection.rs do?
auto_source_detection.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the OxideEngine domain, Scanner subdomain.
What functions are defined in auto_source_detection.rs?
auto_source_detection.rs defines 3 function(s): builder, format, include_str.
What does auto_source_detection.rs depend on?
auto_source_detection.rs imports 2 module(s): ignore::gitignore::, std::sync.
Where is auto_source_detection.rs in the architecture?
auto_source_detection.rs is located at crates/oxide/src/scanner/auto_source_detection.rs (domain: OxideEngine, subdomain: Scanner, directory: crates/oxide/src/scanner).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free