chore(react-email): remove glob dependency and update export logic

LU
2d ago
+33-42

Replaces the single glob.sync('**/*.cjs') call in email export with fs.readdirSync(dir, { recursive: true }). This works on Node >=20.19, so glob, minimatch, path-scurry and @isaacs/nonrecursive-glob-match can go.

Behavior change: email templates in files or folders starting with a dot (e.g. emails/.drafts/x.tsx) are now rendered. Before, glob skipped dot-files, so they were left in out as raw .cjs bundles even though the preview app shows them.
If you'd rather keep the old behavior, let me know and I will add a filter to skip them.

This is my third small cleanup PR, so thanks a lot for reviewing and merging these :)


Summary by cubic

Replaces the single glob.sync('**/*.cjs') call in email export with fs.readdirSync(dir, { recursive: true }), which works on Node >=20.19 and lets us drop glob, minimatch, path-scurry, and @isaacs/nonrecursive-glob-match. Adds a test for relative outDir paths.

Behavior change: email templates in files or folders starting with a dot (e.g. emails/.drafts/x.tsx) are now rendered into out. Previously glob skipped dotfiles, leaving them as raw .cjs bundles even though the preview app shows them.