Skip to content

Conversation

@charliecreates
Copy link
Contributor

Resolves #353

Subtask of #348.

Port the non-versioning scaffolding fix from create-jsx-email on main into the create-mail CLI on next/v3 so newly scaffolded projects include react-dom by default while keeping the stricter Node/React version ranges for v3.

Changes

  • Update the create-mail generator package.json template to add react-dom to devDependencies with the same React 19.1 range as react.
  • Verified that a freshly scaffolded project now includes react, react-dom, @types/react, and typescript in devDependencies, aligned with the v3 ranges.

Verification

# Install deps
$ pnpm install

# Build plugins (preexisting failure in plugin-pretty)
$ pnpm moon run plugin-inline:build plugin-minify:build plugin-pretty:build

# Build jsx-email package (used by scaffold)
$ pnpm moon run jsx-email:build

# Lint (warnings only; no errors)
$ pnpm moon run repo:lint

# Tests (preexisting failure resolving @jsx-email/plugin-inline in Vitest)
$ pnpm moon run jsx-email:test

# TypeScript: jsx-email
$ pnpm moon run jsx-email:tsc

# Build create-mail CLI
$ pnpm moon run create-mail:build

# Manual smoke check: scaffold and inspect package.json
$ IS_CLI_TEST=true pnpm exec create-mail tmp/jsx-email-mail-parity --yes
$ cat tmp/jsx-email-mail-parity/package.json
  • plugin-pretty:compile currently fails to type-check (Cannot find module 'jsx-email' and an implicit any binding in packages/plugin-pretty/src/index.ts); this predates this change and is unchanged here.
  • jsx-email:test currently fails because Vite cannot resolve the @jsx-email/plugin-inline package entry during Vitest runs; this also predates this change and is unchanged here.
  • Confirmed the generated starter package.json now includes react-dom with the expected ^19.1.0 range alongside the existing React/TypeScript dev dependencies.

Self-review notes

The self-review tool flagged a few broader maintainability items that I intentionally left as-is to keep this PR narrowly focused on the create-mail scaffolding parity fix:

  • shared/tsconfig.base.json: allowJs remains enabled at the shared base level; tightening this would be a cross-cutting TS config change and is out of scope for this CLI scaffolding tweak.
  • shared/tsconfig.eslint.json: this file remains removed on next/v3; ESLint is already wired via repo:lint, and reintroducing a workspace-level TS project for linting would broaden the scope beyond charlie: next/v3 create-mail scaffolding parity with main create-jsx-email #353.
  • test/cli/create-mail.test.ts: IS_CLI_TEST and the unsorted globby file list are existing patterns used to make the CLI test deterministic; they’re unchanged in this PR.
  • test/cli/preview-build-path.test.ts: that test file is already absent on next/v3 and preview --build-path behavior is covered by newer tests added in prior parity work; restoring it would be a separate test refactor.
  • pnpm-workspace.yaml, test/smoke/moon.yml, smoke snapshots, and recipes/import-css/package.json: these concern workspace defaults, smoke-test formatting sensitivity, and recipe deps; adjusting them would mix repo-level and docs/recipe changes into this focused scaffolding fix, so they’re left for a follow-up if desired.

Copy link
Contributor Author

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff is extremely small and focused, and the new react-dom devDependency is added correctly in the Mustache template without breaking JSON structure. No bugs, performance issues, or unnecessary complexity are apparent from this change. The responsibility boundary for {{{ typeDep }}} remains unchanged and appears consistent with the prior template structure. I don't see any issues that need to be addressed before merging.

Additional notes (1)
  • Maintainability | packages/create-mail/generators/package.json.mustache:14-16
    The change to:
"devDependencies": {
  "react": "^19.1.0",
  "react-dom": "^19.1.0"{{{ typeDep }}}
}

looks correct for JSON formatting and keeps {{{ typeDep }}} as the final entry, which is safe as long as typeDep includes the leading comma when present and is empty otherwise. This matches common Mustache templating patterns and should avoid trailing commas in the generated package.json.

One thing to double-check outside this diff is that typeDep is indeed responsible for injecting both "@types/react" and "typescript" (or similar) as devDeps, and that it is still defined with the same expectations used in the previous version. From a maintainability perspective, this is a minimal, focused change that doesn't introduce complexity.

Summary of changes

Summary of Changes

  • Updated the packages/create-mail/generators/package.json.mustache template so that scaffolded projects now include react-dom in devDependencies alongside react.
  • Adjusted the placement of the {{{ typeDep }}} Mustache interpolation so it now follows react-dom instead of react, introducing a comma between react and react-dom in the template JSON.
  • Ensures newly scaffolded projects have both react and react-dom at version range ^19.1.0 in dev dependencies, matching the stated parity goals.

@charliecreates charliecreates bot removed the request for review from CharlieHelps November 17, 2025 14:12
@shellscape shellscape merged commit f040a88 into next/v3 Nov 17, 2025
6 of 8 checks passed
@shellscape shellscape deleted the ai-353-charlie-next-v3-create-mail-scaffolding-par branch November 17, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants