-
Notifications
You must be signed in to change notification settings - Fork 836
feat(react-email): installation of UI without npm install
#2573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
Conversation
Co-authored-by: gabriel miranda <gabrielmfern@outlook.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This reverts commit 3924ebd.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
@SocketSecurity ignore npm/next@15.5.6 |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 8 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="packages/react-email/src/utils/get-preview-server-location.ts">
<violation number="1" location="packages/react-email/src/utils/get-preview-server-location.ts:42">
Avoid emitting the success spinner message when installation fails; the finally block currently overrides error cases with a success status.</violation>
<violation number="2" location="packages/react-email/src/utils/get-preview-server-location.ts:78">
The installation logic incorrectly assumes `@react-email/preview-server` only needs `next` as a dependency. By stripping out all other dependencies from `package.json`, it guarantees runtime crashes. The original `packages/preview-server/package.json` lists numerous required dependencies that are now omitted from installation.</violation>
<violation number="3" location="packages/react-email/src/utils/get-preview-server-location.ts:87">
The installation process is opaque and harms developer experience. It uses `execSync` with `stdio: 'ignore'`, which hides `npm` errors from the user. Furthermore, it breaks the monorepo's local development workflow by always fetching from npm, which prevents testing local changes to the preview server.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
8128be7
to
19de23f
Compare
2025-10-17.11-28-44.mp4
This changes things up so that users don't have to install
@react-email/preview-server
in their projects anymore. It still keeps the@react-email/preview-server
published package for backward compatibility, for versioning, and to simplify the changes in this pull request.This is mainly made so that we can possibly unify everything into
react-email
, so that users can install just one package for everything related to React Email.Most of the code stays the same, since the CLI is still importing
next
from@react-email/preview-server
, but now we automatically runnpm pack @react-email/preview-server
and extract it into$HOME/.react-email
. There we also only installnext
instead of all dependencies, to keep it fast and lightweight.At the same time, keeping the original source
package.json
aspackage.source.json
so that we can reuse it duringemail build
.Everything still works out of the box, this is backwards compatible, and users don't have to do anything special.
There are two downsides to the implementation of this pull request. First, and is that if users regularly switch between React Email versions, it will redownload the preview server each time. Secondly, it's that the local version is not going to be used when running the local CLI, instead it will download the one that's on npm. Both of these we can improve in later versions without breaking changes.
Summary by cubic
Run the React Email UI without adding @react-email/preview-server to your project. The CLI auto-installs the UI into $HOME/.react-email and only installs Next.js, keeping setup fast and backward compatible.