-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Target branch
All PRs must branch from next/v3 and target base next/v3 (not main).
Context
Per #379, next/v3 intentionally uses caniemail for email check (this must remain), but the current implementation has clear formatting/debug placeholders and is missing some useful behavior that exists on main (like --use-preview-props).
This issue is specifically about making email check production-ready on next/v3 without regressing the caniemail choice.
Scope (files/areas)
packages/jsx-email/src/cli/commands/check.tspackages/jsx-email/src/cli/commands/build.ts(only as needed to plumbusePreviewPropsthroughbuildTemplates())packages/jsx-email/package.json(do not swap to@jsx-email/doiuse-email)test/cli/**(add a small CLI regression test if practical)
Tasks
- Remove debug/placeholder output from
check.ts:- Delete
console.log({ noteLines }). - Replace the placeholder text in
formatNotes()with real formatting.
- Delete
- Add
--use-preview-propssupport (keep usingcaniemail):- Extend the Valibot options schema to accept
usePreviewProps. - When set, ensure
buildTemplates()is invoked withusePreviewProps: trueso templates can exportpreviewProps. - Update the help text.
- Extend the Valibot options schema to accept
- Ensure output formatting remains stable and readable:
- Show grouped issues with clients, include notes (when present), and keep counts at the end.
- (Optional but recommended) Add a CLI test that runs
email checkagainst a fixture template and asserts:- Command exits successfully.
- Output does not include placeholder/debug strings.
Acceptance criteria (done when)
email checkproduces clean output (no debug objects, no placeholder language).email check --use-preview-propsuses the template’s exportedpreviewPropswhen present.caniemailremains the engine behind the check (do not introduce or depend on@jsx-email/doiuse-email).
Verification
# Unit tests
$ FORCE_COLOR=1 moon jsx-email:test
# CLI tests
$ FORCE_COLOR=1 moon test-cli:test.runRefs #379.
Metadata
Metadata
Assignees
Labels
No labels