findSvelteComponents = async (root) => {
	/**
	 * @type {string[]}
	 */
	const output = [];
	// Scan & iterate directory
	const directoryContents = await fs.readdir(root, { withFileTypes: true });
	for (const item of directoryContents) {
		// Ignore these cases
		if (item.name === 'node_modules') continue; // Don't touch any dependencies
		if (item.name.startsWith('.')) continue; // Don't touch hidden files
		if (item.name.startsWith('+')) continue; // Don't touch sveltekit files

		// Build path; get item stats
		const itemPath = path.resolve(root, item.name);

		if (item.isDirectory()) {
			// Recurse on directories
			output.push(...(await findSvelteComponents(itemPath)));
		} else if (item.name.endsWith('.svelte')) {
			// Keep track of svelte components
			output.push(itemPath);
		}
	}

	// Return relative filepaths
	return output.map((p) => path.relative('.', p));
}
Searches recursively within a directory for svelte files
Ignores anything beginning with . (hidden) or + (special sveltekit files)

@param {string} root
@returns {Promise<string[]>}