Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Nov 25, 2025

shell: true runs the command you input using the shell from the system, but it doesn't sanitize the arguments you pass to the shell meaning it can be unsafe, so Node.js starts warning from version 24 onwards like

image

This pull request simply replaces all of those usages with all the arguments as a raw string, or using nypm to install dependencies and run scripts, which also makes our code cleaner.


Summary by cubic

Updated child_process.spawn usage to avoid unsafe shell argument handling and reduce Node v24 warnings by switching to nypm helpers and safer command execution. Preview server scripts now use single command strings with shell and import.meta.dirname for reliable paths.

  • Bug Fixes
    • create-email tests: replaced shell calls with nypm (installDependencies, runScript), switched to import.meta.dirname, used process.execPath; updated tsconfig to nodenext (moduleResolution and module); added nypm devDependency.
    • preview-server build/dev: swapped args arrays for single command strings (pnpm next build/dev), and switched to import.meta.dirname; updated tsconfig to esnext and included .mts.
    • react-email build: removed custom spawn logic; use nypm installDependencies and runScript('build'); typed packageManager as PackageManagerName.

Written for commit 032309b. Summary will update automatically on new commits.

@gabrielmfern gabrielmfern self-assigned this Nov 25, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2025

⚠️ No Changeset found

Latest commit: 032309b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-email Ready Ready Preview Comment Nov 26, 2025 7:56pm
react-email-demo Ready Ready Preview Comment Nov 26, 2025 7:56pm

@gabrielmfern gabrielmfern requested review from a team and joaopcm and removed request for a team November 25, 2025 13:53
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 25, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/create-email@2708
npm i https://pkg.pr.new/resend/react-email/@react-email/preview-server@2708
npm i https://pkg.pr.new/resend/react-email@2708

commit: 032309b

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 8 files

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/preview-server/scripts/build-preview-server.mts">

<violation number="1" location="packages/preview-server/scripts/build-preview-server.mts:5">
Spawning node_modules/.bin/next directly breaks on Windows because the .cmd shim is never selected; resolve to next.cmd (or use process.execPath) so the build still runs on win32.</violation>
</file>

<file name="packages/create-email/src/index.spec.ts">

<violation number="1" location="packages/create-email/src/index.spec.ts:44">
Type-check test now invokes the repo’s TypeScript binary instead of the generated project’s, so missing TypeScript dependencies in the starter will go undetected.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@socket-security
Copy link

socket-security bot commented Nov 26, 2025

@gabrielmfern
Copy link
Member Author

@cubic-dev-ai review this PR

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Nov 26, 2025

@cubic-dev-ai review this PR

@gabrielmfern I've started the AI code review. It'll take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 8 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/create-email/tsconfig.json">

<violation number="1" location="packages/create-email/tsconfig.json:7">
TypeScript 5.8.3 (the version used by this package) does not support the `&quot;node20&quot;` module target, so the new compiler option makes `tsc` fail with TS6046.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@gabrielmfern gabrielmfern merged commit 53c0a90 into canary Nov 26, 2025
15 of 17 checks passed
@gabrielmfern gabrielmfern deleted the fix/usages-of-shell-true branch November 26, 2025 20:04
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