Skip to content
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

fix(react-email): Add Windows support for build process #1699

Merged

Conversation

chuanxshi
Copy link
Contributor

Description

This PR addresses compatibility issues with the build process on Windows systems by adding support for Windows-specific executables. Previously, the build script utilized the Unix-like next executable, which isn't compatible with Windows environments. This fix ensures that the correct executable (next.cmd) is used based on the operating system.

Changes

  • Updated build-preview-server.mjs to detect the operating system.
  • Utilized next.cmd for Windows and next for Unix-like systems.
  • Ensured proper handling of build artifacts across different environments.

Motivation and Context

Developers using Windows encountered errors when attempting to run the build process due to the incorrect executable being invoked. This fix ensures a seamless build experience across all major operating systems.

How Has This Been Tested?

  • Windows:
    • Ran the build script and verified that the project builds successfully.
    • Ensured that the dist/preview/.next directory is correctly populated.
  • Unix/Linux/Mac:
    • Confirmed that existing build processes remain unaffected and continue to function as expected.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings/errors.

Copy link

changeset-bot bot commented Sep 20, 2024

⚠️ No Changeset found

Latest commit: 5bbbb55

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

Copy link

vercel bot commented Sep 20, 2024

@chuanxshi is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@gabrielmfern gabrielmfern changed the title fix(build-preview-server): Add Windows support for build process fix(react-email): Add Windows support for build process Sep 20, 2024
@gabrielmfern gabrielmfern added the Package: react-email This is the CLI we generally use as just `email` on the temrinal. label Sep 20, 2024
@gabrielmfern
Copy link
Collaborator

gabrielmfern commented Sep 20, 2024

Hey, thank you so much for this PR! A lot of details always get past testing and are only seen when trying to contribute or running a specific edge-case, so I appreciate the help!

Added a few minor comments for us to improve this together

packages/react-email/build-preview-server.mjs Outdated Show resolved Hide resolved
packages/react-email/build-preview-server.mjs Outdated Show resolved Hide resolved
packages/react-email/build-preview-server.mjs Outdated Show resolved Hide resolved
@chuanxshi
Copy link
Contributor Author

@gabrielmfern I’ve made the updates based on the feedback. Please take a look when you have a moment. Thank you!

@gabrielmfern gabrielmfern force-pushed the fix/windows-support-build-preview-server branch from 0c0e618 to fbbab7e Compare September 23, 2024 14:48
@gabrielmfern gabrielmfern force-pushed the canary branch 3 times, most recently from f69b971 to 86fe0ef Compare October 1, 2024 14:10
@gabrielmfern gabrielmfern force-pushed the canary branch 3 times, most recently from 0b21151 to 30a20d6 Compare October 14, 2024 14:58
@gabrielmfern gabrielmfern force-pushed the fix/windows-support-build-preview-server branch from fbbab7e to 8ca96c3 Compare October 22, 2024 17:18
@gabrielmfern gabrielmfern merged commit 9e46fca into resend:canary Oct 22, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react-email This is the CLI we generally use as just `email` on the temrinal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants