Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions apps/web/.react-email/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const { resolve } = require('node:path');

const project = resolve(process.cwd(), './tsconfig.json');

/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
extends: [
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
"eslint-config-turbo",
]
.map(require.resolve)
.concat(["eslint-config-prettier"]),
parserOptions: {
project,
},
globals: {
React: true,
JSX: true,
},
settings: {
"import/resolver": {
typescript: {
project,
},
},
},
ignorePatterns: ['cli/', 'cli/index.mjs', "node_modules/", "dist/"],
rules: {
"@next/next/no-img-element": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"import/no-default-export": "off",
"jsx-a11y/no-autofocus": "off",
"no-alert": "off",
"react/no-array-index-key": "off",
"react/function-component-definition": [
2,
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
'import/no-cycle': 'off',
'import/no-extraneous-dependencies': 'off',
'turbo/no-undeclared-env-vars': 'off',
'eslint-comments/require-description': 'off',
'no-console': 'off',
},
};
3 changes: 3 additions & 0 deletions apps/web/.react-email/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.react-email
dist
preview/.next
8 changes: 8 additions & 0 deletions apps/web/.react-email/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
quoteProps: 'consistent',
singleQuote: true,
trailingComma: 'all',
printWidth: 80,
useTabs: false,
bracketSpacing: true,
};
133 changes: 133 additions & 0 deletions apps/web/.react-email/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# react-email

## 3.0.2-canary.3

### Patch Changes

- ac01c91: bump chokidar to v4

## 3.0.2-canary.2

### Patch Changes

- 59e27bc: Add missing timers/promises Node module for `email dev`

## 3.0.2-canary.1

### Patch Changes

- 8ceb667: Add util/types as a module
- da82d77: Add AbortSignal, Event and EventTarget

## 3.0.2-canary.0

### Patch Changes

- 76bbf7b: Fix missing Request and Response globals
- 1af53fb: Fix NODE_ENV for emails as "PRODUCTION" instead of "DEVELOPMENT"

## 3.0.1

### Patch Changes

- a40904e: Fix hot reloading

## 3.0.0

### Major Changes

- 1a47335: Use a built version of preview app when running `email dev`

### Patch Changes

- 19cab7b: Fixes decorators causing dependency tree babel parsing to fail
- 14b7d1d: update socket.io/socket.io-client to 4.7.5
- b68e166: Fix sharp warning when running `email dev`
- 3caaf53: Updated peer dependencies to allow for React 19 release candidated and React 19 itself
- 9a5fd78: fix email template preview failing with emails having spaces
- d118a39: Fixes tooltip color being black for specific theming configurations
- 481e339: Fixes root directories being hidden when they are alone at their depth
- f9483ec: Deprecated `renderAsync` and made `render` itself always async

## Why

Three reasons:

1. Better support of NextJS's latest versions
2. Being ready for future React API deprecations
3. Support for Suspense which allows for using async inside components

See https://github.com/resend/react-email/discussions/1144 for more info.

## How to upgrade

If you are using the old `render`, you will need to now treat the Promise
that comes out of it, as it is now async. If you are using `renderAsync`,
you can replace it with `render` and things should work the same.

## 3.0.0-canary.1

### Patch Changes

- b87cbbf: Fix sharp warning when running `email dev`

## 3.0.0-canary.0

### Major Changes

- f552226: Use a built version of preview app when running `email dev`

### Patch Changes

- 2799bb4: fix email template preview failing with emails having spaces
- 3f67038: Deprecated `renderAsync` and made `render` itself always async

## Why

Three reasons:

1. Better support of NextJS's latest versions
2. Being ready for future React API deprecations
3. Support for Suspense which allows for using async inside components

See https://github.com/resend/react-email/discussions/1144 for more info.

## How to upgrade

If you are using the old `render`, you will need to now treat the Promise
that comes out of it, as it is now async. If you are using `renderAsync`,
you can replace it with `render` and things should work the same.

## 2.1.7-canary.2

### Patch Changes

- 349e5d5: Fixes decorators causing dependency tree babel parsing to fail
- 983626d: Fixes root directories being hidden when they are alone at their depth

## 2.1.7-canary.1

### Patch Changes

- 6f5204e: Fixes tooltip color being black for specific theming configurations

## 2.1.7-canary.0

### Patch Changes

- 27234ec: update socket.io/socket.io-client to 4.7.5
- a1c016b: Updated peer dependencies to allow for React 19 release candidated and React 19 itself

## 2.1.6

### Patch changes

- Fixes live refresh not working with files outside `emails` directory
- Fixes export failing when templates have different suffixes

## 2.1.6-canary.0

### Patch changes

- Fixes live refresh not working with files outside `emails` directory
- Fixes export failing when templates have different suffixes
24 changes: 24 additions & 0 deletions apps/web/.react-email/build-preview-server.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { spawn } from 'node:child_process';
import fs from 'node:fs';

const nextBuildProcess = spawn('next', ['build'], {
detached: true,
stdio: "inherit"
});

process.on('SIGINT', () => {
nextBuildProcess.kill('SIGINT');
});

nextBuildProcess.on('exit', (code) => {
if (code !== 0) {
process.exit(code);
}

if (fs.existsSync('dist/preview')) {
fs.rmSync('dist/preview', { recursive: true });
}
fs.mkdirSync('dist/preview', { recursive: true });
fs.renameSync('.next', 'dist/preview/.next');
});

7 changes: 7 additions & 0 deletions apps/web/.react-email/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 Plus Five Five, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5 changes: 5 additions & 0 deletions apps/web/.react-email/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
34 changes: 34 additions & 0 deletions apps/web/.react-email/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

const path = require('path');
const emailsDirRelativePath = path.normalize('./emails');
const userProjectLocation = path.resolve(process.cwd(), '../');
/** @type {import('next').NextConfig} */
module.exports = {
env: {
NEXT_PUBLIC_IS_BUILDING: 'true',
EMAILS_DIR_RELATIVE_PATH: emailsDirRelativePath,
EMAILS_DIR_ABSOLUTE_PATH: path.resolve(userProjectLocation, emailsDirRelativePath),
USER_PROJECT_LOCATION: userProjectLocation
},
// this is needed so that the code for building emails works properly
webpack: (
/** @type {import('webpack').Configuration & { externals: string[] }} */
config,
{ isServer }
) => {
if (isServer) {
config.externals.push('esbuild');
}

return config;
},
typescript: {
ignoreBuildErrors: true
},
eslint: {
ignoreDuringBuilds: true
},
experimental: {
webpackBuildWorker: true
},
}
Loading