resend / react-email

💌 Build and send emails using React
https://react.email
MIT License
12.67k stars 583 forks source link

fix(react-email): Directories getting merged at the root #1284

Open gabrielmfern opened 3 months ago

gabrielmfern commented 3 months ago

What does this fix?

Due to a recent aesthetic change we made to the Sidebar, the root directory doesn't appear anymore. This was getting kind of finicky and giving off unexpected behaviors to users where the emails directory would be merged with sub directories which would make it seem like the emails directory is set to it.

Here's an example:

emails
└── folder2
    ├── email.js
    └── folder3
        └── email.js

If email dev is ran with the latest version we would have:

image

Which is just showing the contents inside of folder2.

How can I make sure this is fixed?

  1. Move all emails from inside of ./apps/demo/emails into ./apps/demo/emails/sub-directory
  2. Add a new file called email.jsx inside of ./apps/demo/emails/sub-directory with the contents:
    export default function Email(props) {
        return <div>Hello world</div>;
    }
  3. Run email dev on ./apps/demo
  4. Open http://localhost:3000
  5. Verify that the directory called sub-directory appears on the Sidebar in a way that's not confusing
vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 2:45pm
react-email-demo ❌ Failed (Inspect) May 15, 2024 2:45pm