From 0d2c4d7b79e53286ec1701a580f36f27a948b484 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 9 Oct 2026 09:24:17 +0200 Subject: [PATCH 1/4] chore(deps): remove normalize-path dependency --- packages/react-email/package.json | 1 - packages/react-email/src/cli/commands/export.ts | 11 ++++------- packages/ui/package.json | 1 - pnpm-lock.yaml | 11 ----------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/react-email/package.json b/packages/react-email/package.json index f86074ada2..67e7bb4e0a 100644 --- a/packages/react-email/package.json +++ b/packages/react-email/package.json @@ -59,7 +59,6 @@ "log-symbols": "catalog:", "marked": "^15.0.12", "mime-types": "^3.0.0", - "normalize-path": "^3.0.0", "nypm": "catalog:", "picospinner": "catalog:", "prismjs": "^1.30.0", diff --git a/packages/react-email/src/cli/commands/export.ts b/packages/react-email/src/cli/commands/export.ts index 417789dd46..529c9ae3bf 100644 --- a/packages/react-email/src/cli/commands/export.ts +++ b/packages/react-email/src/cli/commands/export.ts @@ -6,7 +6,6 @@ import type { Options } from '@react-email/render'; import { type BuildFailure, build, stop } from 'esbuild'; import { glob } from 'glob'; import logSymbols from 'log-symbols'; -import normalize from 'normalize-path'; import { inlineCssLoader } from '../utils/esbuild/inline-css-loader.js'; import { loadEsbuildPlugins } from '../utils/esbuild/load-esbuild-plugins.js'; import { renderingUtilitiesExporter } from '../utils/esbuild/renderring-utilities-exporter.js'; @@ -247,12 +246,10 @@ export const exportTemplates = async ( spinner.succeed(); } - const allBuiltTemplates = glob.sync( - normalize(`${pathToWhereEmailMarkupShouldBeDumped}/**/*.cjs`), - { - absolute: true, - }, - ); + const allBuiltTemplates = glob.sync('**/*.cjs', { + cwd: pathToWhereEmailMarkupShouldBeDumped, + absolute: true, + }); const extension = options.extension && options.extension.length > 0 diff --git a/packages/ui/package.json b/packages/ui/package.json index def2b06a47..473f0e2678 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -52,7 +52,6 @@ "@types/fs-extra": "11.0.4", "@types/mime-types": "catalog:", "@types/node": "catalog:", - "@types/normalize-path": "3.0.2", "@types/react": "catalog:", "@types/react-dom": "catalog:", "@types/webpack": "5.28.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 554c50bde5..64670c3300 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -705,9 +705,6 @@ importers: mime-types: specifier: ^3.0.0 version: 3.0.2 - normalize-path: - specifier: ^3.0.0 - version: 3.0.0 nypm: specifier: 'catalog:' version: 0.6.6 @@ -907,9 +904,6 @@ importers: '@types/node': specifier: 'catalog:' version: 22.19.18 - '@types/normalize-path': - specifier: 3.0.2 - version: 3.0.2 '@types/react': specifier: 'catalog:' version: 19.2.14 @@ -4374,9 +4368,6 @@ packages: '@types/node@25.5.0': resolution: {integrity: sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==} - '@types/normalize-path@3.0.2': - resolution: {integrity: sha512-DO++toKYPaFn0Z8hQ7Tx+3iT9t77IJo/nDiqTXilgEP+kPNIYdpS9kh3fXuc53ugqwp9pxC1PVjCpV1tQDyqMA==} - '@types/offscreencanvas@2019.7.3': resolution: {integrity: sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==} @@ -12892,8 +12883,6 @@ snapshots: dependencies: undici-types: 7.18.2 - '@types/normalize-path@3.0.2': {} - '@types/offscreencanvas@2019.7.3': {} '@types/prismjs@1.26.6': {} From 748457e616a300882c722c4ac4ccedc75fb9d63d Mon Sep 17 00:00:00 2001 From: dielduarte Date: Tue, 27 Oct 2026 12:33:06 -0400 Subject: [PATCH 2/4] test(react-email): cover email export to an outDir with glob characters Co-Authored-By: Claude Opus 5.5 --- .../src/cli/commands/testing/export.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/react-email/src/cli/commands/testing/export.spec.ts b/packages/react-email/src/cli/commands/testing/export.spec.ts index a55445da96..da17efaa94 100644 --- a/packages/react-email/src/cli/commands/testing/export.spec.ts +++ b/packages/react-email/src/cli/commands/testing/export.spec.ts @@ -1,4 +1,5 @@ import fs from 'node:fs'; +import os from 'node:os'; import path from 'node:path'; import { exportTemplates } from '../export.js'; @@ -236,3 +237,21 @@ test('email export with custom extension', { retry: 3 }, async () => { ' { + const pathToEmailsDirectory = path.resolve(__dirname, './emails'); + const parentDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'export-')); + const pathToDumpMarkup = path.join(parentDirectory, 'out[1]'); + + try { + await exportTemplates(pathToDumpMarkup, pathToEmailsDirectory, { + silent: true, + }); + + expect( + fs.existsSync(path.join(pathToDumpMarkup, 'vercel-invite-user.html')), + ).toBe(true); + } finally { + fs.rmSync(parentDirectory, { recursive: true, force: true }); + } +}); From 3d78cd18fd8beb4b85cef60332267ebeb6e9b995 Mon Sep 17 00:00:00 2001 From: dielduarte Date: Tue, 27 Oct 2026 12:33:06 -0400 Subject: [PATCH 3/4] chore(react-email): add changeset for normalize-path removal Co-Authored-By: Claude Opus 5.5 --- .changeset/remove-normalize-path.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/remove-normalize-path.md diff --git a/.changeset/remove-normalize-path.md b/.changeset/remove-normalize-path.md new file mode 100644 index 0000000000..ce719b7eeb --- /dev/null +++ b/.changeset/remove-normalize-path.md @@ -0,0 +1,5 @@ +--- +"react-email": patch +--- + +Remove the `normalize-path` dependency. `email export` now finds built templates when `--outDir` contains glob characters such as `[1]`, `{a,b}` or `*`. Previously, such an `--outDir` rendered nothing or picked up templates from sibling directories. From b8d7b03d198ad4e6bd4905dc9e31a0ad9ea31494 Mon Sep 17 00:00:00 2001 From: dielduarte Date: Tue, 27 Oct 2026 13:35:55 -0400 Subject: [PATCH 4/4] chore(react-email): shorten normalize-path changeset Co-Authored-By: Claude Opus 5.5 --- .changeset/remove-normalize-path.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/remove-normalize-path.md b/.changeset/remove-normalize-path.md index ce719b7eeb..cf46fb04de 100644 --- a/.changeset/remove-normalize-path.md +++ b/.changeset/remove-normalize-path.md @@ -2,4 +2,4 @@ "react-email": patch --- -Remove the `normalize-path` dependency. `email export` now finds built templates when `--outDir` contains glob characters such as `[1]`, `{a,b}` or `*`. Previously, such an `--outDir` rendered nothing or picked up templates from sibling directories. +Remove the `normalize-path` dependency.