mod.rs — tailwindcss Source File
Architecture documentation for mod.rs, a rust file in the tailwindcss codebase. 22 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR b82a42d6_b7d3_c6d2_1e14_451f8382da81["mod.rs"] 1667c76d_59f5_094e_94e1_b1f28afbe004["super::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 1667c76d_59f5_094e_94e1_b1f28afbe004 9e6a1b6c_10c8_203c_88f1_d44384e0e31f["crate::extractor::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 9e6a1b6c_10c8_203c_88f1_d44384e0e31f b5d4eb5f_78cc_0773_3542_46c75f84a8b9["crate::glob::optimize_patterns"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> b5d4eb5f_78cc_0773_3542_46c75f84a8b9 1ce30202_0a2e_590e_dbf1_ea126444c1b2["crate::scanner::detect_sources::resolve_globs"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 1ce30202_0a2e_590e_dbf1_ea126444c1b2 7243e4b9_0288_7fde_2c3e_1f19340ae91f["crate::scanner::sources::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 7243e4b9_0288_7fde_2c3e_1f19340ae91f b921cd27_b8e3_5c45_8149_e1c73da861da["crate::GlobEntry"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> b921cd27_b8e3_5c45_8149_e1c73da861da 400123e7_c584_c912_7aa1_d6f85e95d192["auto_source_detection::BINARY_EXTENSIONS_GLOB"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 400123e7_c584_c912_7aa1_d6f85e95d192 092d26da_8f74_08d1_48f1_765b79ca447c["bstr::ByteSlice"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 092d26da_8f74_08d1_48f1_765b79ca447c f66c1483_47ad_6009_31e9_c628c0148984["fast_glob::glob_match"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> f66c1483_47ad_6009_31e9_c628c0148984 cd8ad636_0546_92c3_8277_112b4ac61619["fxhash::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> cd8ad636_0546_92c3_8277_112b4ac61619 1265f855_3bcf_0fc9_c4bd_ce4b2083e5bf["ignore::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 1265f855_3bcf_0fc9_c4bd_ce4b2083e5bf b8d3af30_8c18_17ed_f3f5_a22539206bb1["rayon::prelude::*"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> b8d3af30_8c18_17ed_f3f5_a22539206bb1 65977e4c_5bfb_9718_3822_5b0bfbacb9c1["std::collections::"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 65977e4c_5bfb_9718_3822_5b0bfbacb9c1 5b639e99_a908_d7c5_ea32_661c288daca5["std::fs::OpenOptions"] b82a42d6_b7d3_c6d2_1e14_451f8382da81 --> 5b639e99_a908_d7c5_ea32_661c288daca5 style b82a42d6_b7d3_c6d2_1e14_451f8382da81 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
pub mod auto_source_detection;
pub mod detect_sources;
pub mod sources;
use crate::extractor::{Extracted, Extractor};
use crate::glob::optimize_patterns;
use crate::scanner::detect_sources::resolve_globs;
use crate::scanner::sources::{
public_source_entries_to_private_source_entries, PublicSourceEntry, SourceEntry, Sources,
};
use crate::GlobEntry;
use auto_source_detection::BINARY_EXTENSIONS_GLOB;
use bstr::ByteSlice;
use fast_glob::glob_match;
use fxhash::{FxHashMap, FxHashSet};
use ignore::{gitignore::GitignoreBuilder, WalkBuilder};
use rayon::prelude::*;
use std::collections::{BTreeMap, BTreeSet};
use std::fs::OpenOptions;
use std::io::{self, Write};
use std::path::{Path, PathBuf};
use std::sync::{self, Arc, Mutex};
use std::time::SystemTime;
use tracing::event;
use tracing_subscriber::fmt::writer::BoxMakeWriter;
// @source "some/folder"; // This is auto source detection
// @source "some/folder/**/*"; // This is auto source detection
// @source "some/folder/*.html"; // This is just a glob, but new files matching this should be included
// @source "node_modules/my-ui-lib"; // Auto source detection but since node_modules is explicit we allow it
// // Maybe could be considered `external(…)` automatically if:
// // 1. It's git ignored but listed explicitly
// // 2. It exists outside of the current working directory (do we know that?)
//
// @source "do-include-me.bin"; // `.bin` is typically ignored, but now it's explicit so should be included
// @source "git-ignored.html"; // A git ignored file that is listed explicitly, should be scanned
static SHOULD_TRACE: sync::LazyLock<bool> = sync::LazyLock::new(
|| matches!(std::env::var("DEBUG"), Ok(value) if value.eq("*") || (value.contains("tailwindcss:oxide") && !value.contains("-tailwindcss:oxide"))),
);
fn dim(input: &str) -> String {
format!("\u{001b}[2m{input}\u{001b}[22m")
}
fn blue(input: &str) -> String {
format!("\u{001b}[34m{input}\u{001b}[39m")
}
fn highlight(input: &str) -> String {
format!("{}{}{}", dim(&blue("`")), blue(input), dim(&blue("`")))
}
fn init_tracing() {
if !*SHOULD_TRACE {
return;
}
let file_path = format!("tailwindcss-{}.log", std::process::id());
let file = OpenOptions::new()
.create(true)
// ... (779 more lines)
Domain
Subdomains
Functions
- blue()
- create_walker()
- dim()
- extract()
- extract_candidates()
- extract_css_variables()
- flush()
- get_candidates_with_positions()
- get_files()
- get_globs()
- get_normalized_sources()
- highlight()
- init_tracing()
- matches()
- new()
- parse_all_blobs()
- pre_process_input()
- read_all_files()
- read_changed_content()
- scan()
- scan_content()
- scan_sources()
- test_positions()
- write()
Dependencies
- auto_source_detection::BINARY_EXTENSIONS_GLOB
- bstr::ByteSlice
- crate::GlobEntry
- crate::extractor::
- crate::extractor::pre_processors::*
- crate::glob::optimize_patterns
- crate::scanner::detect_sources::resolve_globs
- crate::scanner::sources::
- fast_glob::glob_match
- fxhash::
- ignore::
- pretty_assertions::assert_eq
- rayon::prelude::*
- std::collections::
- std::fs::OpenOptions
- std::io::
- std::path::
- std::sync::
- std::time::SystemTime
- super::
- tracing::event
- tracing_subscriber::fmt::writer::BoxMakeWriter
Source
Frequently Asked Questions
What does mod.rs do?
mod.rs is a source file in the tailwindcss codebase, written in rust. It belongs to the Oxide domain, Scanner subdomain.
What functions are defined in mod.rs?
mod.rs defines 24 function(s): blue, create_walker, dim, extract, extract_candidates, extract_css_variables, flush, get_candidates_with_positions, get_files, get_globs, and 14 more.
What does mod.rs depend on?
mod.rs imports 22 module(s): auto_source_detection::BINARY_EXTENSIONS_GLOB, bstr::ByteSlice, crate::GlobEntry, crate::extractor::, crate::extractor::pre_processors::*, crate::glob::optimize_patterns, crate::scanner::detect_sources::resolve_globs, crate::scanner::sources::, and 14 more.
Where is mod.rs in the architecture?
mod.rs is located at crates/oxide/src/scanner/mod.rs (domain: Oxide, 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