process_directory() — svelte Function Reference
Architecture documentation for the process_directory() function in download.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 2e34f7ff_3d9b_3d31_75ac_8a472947d75a["process_directory()"] 65d20932_41e6_eeee_7338_5dd0682e5e42["download.js"] 2e34f7ff_3d9b_3d31_75ac_8a472947d75a -->|defined in| 65d20932_41e6_eeee_7338_5dd0682e5e42 7f0ea1c2_2714_c186_16e3_baa473ab323e["get_all_files()"] 2e34f7ff_3d9b_3d31_75ac_8a472947d75a -->|calls| 7f0ea1c2_2714_c186_16e3_baa473ab323e f3cb3b9e_52e3_27fb_9664_3c93ed173c54["detect_project_type()"] 2e34f7ff_3d9b_3d31_75ac_8a472947d75a -->|calls| f3cb3b9e_52e3_27fb_9664_3c93ed173c54 04de3495_cffc_dc6d_e930_d1c6d03a3a34["convert_sveltekit_project()"] 2e34f7ff_3d9b_3d31_75ac_8a472947d75a -->|calls| 04de3495_cffc_dc6d_e930_d1c6d03a3a34 2d1f4cc1_c2e4_e70c_5eaa_0161ef52d12e["convert_vite_project()"] 2e34f7ff_3d9b_3d31_75ac_8a472947d75a -->|calls| 2d1f4cc1_c2e4_e70c_5eaa_0161ef52d12e style 2e34f7ff_3d9b_3d31_75ac_8a472947d75a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
playgrounds/sandbox/scripts/download.js lines 551–572
function process_directory(dir_path) {
const all_files = get_all_files(dir_path);
const project_info = detect_project_type(all_files);
console.log(`Detected project type: ${project_info.type}`);
// Check for $app/* imports
if (project_info.has_app_imports) {
console.error('Error: This SvelteKit project uses $app/* imports which cannot be converted.');
console.error('The playground does not support SvelteKit runtime features.');
process.exit(1);
}
// Convert based on project type
if (project_info.type === 'sveltekit') {
console.log('Converting SvelteKit project to plain Svelte...');
return convert_sveltekit_project(dir_path);
} else {
console.log('Processing Vite+Svelte project...');
return convert_vite_project(dir_path);
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does process_directory() do?
process_directory() is a function in the svelte codebase, defined in playgrounds/sandbox/scripts/download.js.
Where is process_directory() defined?
process_directory() is defined in playgrounds/sandbox/scripts/download.js at line 551.
What does process_directory() call?
process_directory() calls 4 function(s): convert_sveltekit_project, convert_vite_project, detect_project_type, get_all_files.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free