fix(jsx-email): normalize globby paths for preview (v3) #367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Component / Package Name:
jsx-email / next/v3
This PR contains:
Are tests included?
Breaking Changes?
If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
resolves #366
Description
Ports the Windows static-asset path fix from #365 onto the
next/v3branch soemail previewserves files correctly on Windows when--assetsglobs include backslash-separated paths.On
main, the fix normalized the globs passed toglobbyusing Vite'snormalizePath()helper. This PR applies the same normalization in thenext/v3CLI implementation:packages/jsx-email/src/cli/vite-static.tsto importnormalizePathfromvite.pathsbefore passing them toglobby, matching the behavior fromvite-static.mtsonmain.Runtime behavior for non-Windows platforms is unchanged; on Windows, static asset paths are now consistently treated as POSIX-style globs that
globbycan match.Verification
plugin-inline:build,plugin-minify:build, andplugin-pretty:buildall completed successfully.jsx-email:buildcompleted successfully.repo:lintcompleted with 31 existing warnings (in apps, docs, and tests) but no errors; none are related tovite-static.ts.jsx-email:testpassed: 46 test files, 190 tests.jsx-email:tsccurrently fails with a preexisting TS2717 error inpackages/jsx-email/src/components/conditional.tsxabout duplicate'jsx-email-cond'declarations. This failure reproduces onorigin/next/v3before applying thevite-static.tschange and is unchanged by this PR.Self-review notes
The automated self-review surfaced a number of maintainability items (pnpm workspace flags, shared tsconfig changes, CLI test reshaping, Playwright/diffable-html versions, smoke snapshots, etc.) that do not appear in this branch's diff when compared to
origin/next/v3.git diff --stat origin/next/v3...HEADshows only one touched file:packages/jsx-email/src/cli/vite-static.tspnpm-workspace.yaml,shared/tsconfig.base.json,shared/tsconfig.eslint.json, tests, or lockfiles as part of this PR.Those self-review items correspond to earlier
next/v3alignment work (for example #355, #358, #359, #360, #361) and are intentionally left as-is here to keep this change narrowly scoped to porting the Windows asset path fix from #365.