scanner.rs — tailwindcss Source File
Architecture documentation for scanner.rs, a rust file in the tailwindcss codebase. 8 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 340ddba0_15e4_a309_9dea_cf6d6e73381d["scanner.rs"] e4088d34_b5b4_ec51_b975_557a1536ec76["pretty_assertions::assert_eq"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> e4088d34_b5b4_ec51_b975_557a1536ec76 9aa9da3e_3665_ff27_83fa_c1285f8c5a05["std::path::"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> 9aa9da3e_3665_ff27_83fa_c1285f8c5a05 76dc7686_9dd0_00d4_6906_94568c3839d6["std::process::Command"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> 76dc7686_9dd0_00d4_6906_94568c3839d6 c10681f2_479f_792e_e5e7_e85f6d41caca["std::thread::sleep"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> c10681f2_479f_792e_e5e7_e85f6d41caca 3c9be9ae_6c7d_ac56_3bab_86004806059d["std::time::Duration"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> 3c9be9ae_6c7d_ac56_3bab_86004806059d 148a0379_62c6_86e3_d9b3_de1fdebd7cfb["std::"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> 148a0379_62c6_86e3_d9b3_de1fdebd7cfb d0f50ca8_e27d_fb3b_012a_35295dbf1820["tailwindcss_oxide::*"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> d0f50ca8_e27d_fb3b_012a_35295dbf1820 f1bca424_c5f6_2d09_b590_d1407e7cbc6f["tempfile::tempdir"] 340ddba0_15e4_a309_9dea_cf6d6e73381d --> f1bca424_c5f6_2d09_b590_d1407e7cbc6f style 340ddba0_15e4_a309_9dea_cf6d6e73381d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
#[cfg(test)]
mod scanner {
use pretty_assertions::assert_eq;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::thread::sleep;
use std::time::Duration;
use std::{fs, path};
use tailwindcss_oxide::*;
use tempfile::tempdir;
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> std::io::Result<()> {
#[cfg(not(windows))]
let result = std::os::unix::fs::symlink(original, link);
#[cfg(windows)]
let result = std::os::windows::fs::symlink_dir(original, link);
result
}
fn public_source_entry_from_pattern(dir: PathBuf, pattern: &str) -> PublicSourceEntry {
let mut parts = pattern.split_whitespace();
let _ = parts.next().unwrap_or_default();
let not_or_pattern = parts.next().unwrap_or_default();
if not_or_pattern == "not" {
let pattern = parts.next().unwrap_or_default();
return PublicSourceEntry {
base: dir.to_string_lossy().into(),
pattern: pattern[1..pattern.len() - 1].to_string(),
negated: true,
};
}
PublicSourceEntry {
base: dir.to_string_lossy().into(),
pattern: not_or_pattern[1..not_or_pattern.len() - 1].to_string(),
negated: false,
}
}
struct ScanResult {
files: Vec<String>,
globs: Vec<String>,
normalized_sources: Vec<String>,
candidates: Vec<String>,
}
fn create_files_in(dir: &path::Path, paths: &[(&str, &str)]) {
// Create the necessary files
for (path, contents) in paths {
// Ensure we use the right path separator for the current platform
let path = dir.join(path.replace('/', path::MAIN_SEPARATOR.to_string().as_str()));
let parent = path.parent().unwrap();
if !parent.exists() {
fs::create_dir_all(parent).unwrap();
}
fs::write(path, contents).unwrap()
// ... (1739 more lines)
Domain
Subdomains
Functions
- create_files_in()
- it_includes_skipped_by_default_extensions_with_a_specific_source()
- it_respects_gitignore_in_workspace_root()
- it_respects_gitignore_in_workspace_root_for_manual_globs()
- it_should_be_possible_to_scan_in_the_parent_directory()
- it_should_find_new_extensions()
- it_should_ignore_and_expand_nested_ignored_folders()
- it_should_ignore_binary_files()
- it_should_ignore_known_extensions()
- it_should_ignore_known_files()
- it_should_ignore_negated_custom_sources()
- it_should_include_defined_extensions_that_are_ignored_by_default()
- it_should_list_all_files_in_the_public_folder_explicitly()
- it_should_list_all_files_in_the_public_folder_explicitly_except_ignored_files()
- it_should_list_nested_folders_explicitly_in_the_public_folder()
- it_should_not_ignore_folders_that_end_with_a_binary_extension()
- it_should_pick_up_new_files()
- it_should_scan_absolute_paths()
- it_should_scan_content_paths()
- it_should_scan_content_paths_even_when_they_are_git_ignored()
- it_should_scan_files_without_extensions()
- it_should_scan_folders_with_extensions()
- it_should_scan_for_utilities()
- it_should_scan_next_dynamic_folders()
- it_should_use_a_glob_for_top_level_folders()
- it_should_work_with_a_set_of_root_files()
- it_should_work_with_a_set_of_root_files_and_ignore_ignored_files()
- it_should_work_with_manual_glob_only()
- public_source_entry_from_pattern()
- scan()
- scan_with_globs()
- skips_ignore_files_outside_of_a_repo()
- symlink()
- test_allow_default_ignored_files()
- test_allow_default_ignored_files_via_gitignore()
- test_allow_explicit_node_modules_paths()
- test_explicitly_ignore_explicitly_allowed_files()
- test_extract_used_css_variables_from_css()
- test_glob_with_symlinks()
- test_globs_with_recursive_symlinks()
- test_ignore_files_can_be_included_with_custom_source_rule()
- test_ignore_gitignore_in_node_modules_source()
- test_ignore_node_modules_without_gitignore()
- test_manually_scanning_files_should_follow_all_rules()
- test_partial_globs_with_symlinks()
- test_works_with_filenames_containing_glob_characters()
- test_works_with_utf8_special_character_paths()
Dependencies
- pretty_assertions::assert_eq
- std::
- std::path::
- std::process::Command
- std::thread::sleep
- std::time::Duration
- tailwindcss_oxide::*
- tempfile::tempdir
Source
Frequently Asked Questions
What does scanner.rs do?
scanner.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 scanner.rs?
scanner.rs defines 47 function(s): create_files_in, it_includes_skipped_by_default_extensions_with_a_specific_source, it_respects_gitignore_in_workspace_root, it_respects_gitignore_in_workspace_root_for_manual_globs, it_should_be_possible_to_scan_in_the_parent_directory, it_should_find_new_extensions, it_should_ignore_and_expand_nested_ignored_folders, it_should_ignore_binary_files, it_should_ignore_known_extensions, it_should_ignore_known_files, and 37 more.
What does scanner.rs depend on?
scanner.rs imports 8 module(s): pretty_assertions::assert_eq, std::, std::path::, std::process::Command, std::thread::sleep, std::time::Duration, tailwindcss_oxide::*, tempfile::tempdir.
Where is scanner.rs in the architecture?
scanner.rs is located at crates/oxide/tests/scanner.rs (domain: OxideEngine, subdomain: Scanner, directory: crates/oxide/tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free