Skip to content

charlie: fix email check output + add --use-preview-props (next/v3) #371

Description

@charliecreates

All PRs must branch from next/v3 and target base next/v3 (not main).

Context
next/v3 intentionally uses caniemail, but the current email check command has obvious placeholder/debug output and is missing main's --use-preview-props option.

Maps to the report:

  • Section 2: “email check output/flag parity (caniemail stays)”
  • Section 4: “CLI feature exists on both branches but diverges/conflicts”

Scope

  1. Fix/finish formatting in packages/jsx-email/src/cli/commands/check.ts:
    • Remove placeholder strings and stray debug logging in formatNotes().
    • Make Notes output deterministic (no runtime object logging).
  2. Add --use-preview-props to email check on next/v3 (keep caniemail):
    • Update CheckOptionsStruct in packages/jsx-email/src/cli/commands/check.ts.
    • Pass usePreviewProps through to buildTemplates() (mirrors main behavior: 955bffb9).
    • Update the help output to document the flag.
  3. Add coverage:
    • Add a focused unit test for the formatting helpers (or a CLI-level test under test/cli) to ensure notes + issue grouping prints without placeholders and includes expected lines.

Acceptance criteria (done when)

  • email check output contains no placeholder/debug text.
  • email check --use-preview-props ./path/to/template.tsx renders using exported previewProps when present.
  • Tests covering the above pass on next/v3.

Verification

pnpm install

# Build deps used by tests
moon jsx-email:build
moon create-mail:build
moon run :build --query "project~plugin-*"

# Unit/snapshot tests
FORCE_COLOR=1 moon jsx-email:test

# CLI suite
moon test-cli:test.run

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions