-
Couldn't load subscription status.
- Fork 839
fix(react-email): suppress preview warnings outside email directory #2563
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?
fix(react-email): suppress preview warnings outside email directory #2563
Conversation
|
|
@glennreyes is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
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.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts">
<violation number="1" location="packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts:148">
Rule violated: **No `should` in tests**
Test descriptions must avoid the term “should” to stay declarative (per the No `should` in tests guideline). Please rephrase this description accordingly.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
packages/react-email/src/utils/preview/hot-reloading/create-dependency-graph.spec.ts
Outdated
Show resolved
Hide resolved
| pathToDependencyFromDirectory, | ||
| ) | ||
| ) { | ||
| console.warn( |
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.
I'm not convinced that we should only warn when inside the emails directory. Why would it be a problem inside it, but not ouside it?
| `Could not find file at ${pathToDependencyFromDirectory}`, | ||
| ); | ||
| if ( | ||
| isInsideDirectory( |
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.
I think this error should be fine as it was, right? This happens if the import's target file can't be found, not a directory
| 'utf8', | ||
| ); | ||
|
|
||
| const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); |
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.
I don't like testing for warnings like this very much, I'd rather test the parts that are tricky to maintain and/or are critical to users
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2602094 to
314323c
Compare
7da803f to
e9af285
Compare
Summary
Preview/logs should feel much friendlier/be less verbose after this. Fixes #2419.
Testing
Summary by cubic
Reduce noisy React Email preview logs by normalizing the preview root and suppressing missing-file/index warnings for imports outside the email directory. Keeps hot reload logs clean while still warning for real issues inside the email folder. Fixes #2419.