react-email 4.2.11 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "4.2.11",
3
+ "version": "4.3.0",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/index.js"
@@ -45,13 +45,12 @@
45
45
  "next": "^15.3.2",
46
46
  "react": "19.0.0",
47
47
  "react-dom": "19.0.0",
48
- "tsup": "8.4.0",
49
48
  "typescript": "5.8.3",
50
- "@react-email/components": "0.5.3"
49
+ "@react-email/components": "0.5.6"
51
50
  },
52
51
  "scripts": {
53
- "build": "tsup-node",
54
- "build:watch": "tsup-node --watch src",
52
+ "build": "tsdown",
53
+ "build:watch": "tsdown --watch src",
55
54
  "clean": "rm -rf dist",
56
55
  "test": "vitest run",
57
56
  "test:watch": "vitest"
package/readme.md CHANGED
@@ -4,11 +4,10 @@
4
4
  <div align="center">The next generation of writing emails.<br />High-quality, unstyled components for creating emails.</div>
5
5
  <br />
6
6
  <div align="center">
7
- <a href="https://react.email">Website</a>
7
+ <a href="https://react.email">Website</a>
8
8
  <span> · </span>
9
- <a href="https://github.com/resend/react-email">GitHub</a>
10
- <span> · </span>
11
- <a href="https://react.email/discord">Discord</a>
9
+ <a href="https://github.com/resend/react-email">GitHub</a>
10
+
12
11
  </div>
13
12
 
14
13
  ## Getting started
@@ -78,14 +78,14 @@ const setNextEnvironmentVariablesForBuild = async (
78
78
  const nextConfigContents = `
79
79
  const path = require('path');
80
80
  const emailsDirRelativePath = path.normalize('${emailsDirRelativePath}');
81
- const userProjectLocation = '${process.cwd()}';
81
+ const userProjectLocation = '${process.cwd().replace(/\\/g, '/')}';
82
82
  /** @type {import('next').NextConfig} */
83
83
  module.exports = {
84
84
  env: {
85
85
  NEXT_PUBLIC_IS_BUILDING: 'true',
86
86
  EMAILS_DIR_RELATIVE_PATH: emailsDirRelativePath,
87
87
  EMAILS_DIR_ABSOLUTE_PATH: path.resolve(userProjectLocation, emailsDirRelativePath),
88
- PREVIEW_SERVER_LOCATION: '${builtPreviewAppPath}',
88
+ PREVIEW_SERVER_LOCATION: '${builtPreviewAppPath.replace(/\\/g, '/')}',
89
89
  USER_PROJECT_LOCATION: userProjectLocation
90
90
  },
91
91
  // this is needed so that the code for building emails works properly
@@ -154,9 +154,9 @@ const forceSSGForEmailPreviews = async (
154
154
  emailsDirPath: string,
155
155
  builtPreviewAppPath: string,
156
156
  ) => {
157
- const emailDirectoryMetadata =
158
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
159
- (await getEmailsDirectoryMetadata(emailsDirPath))!;
157
+ const emailDirectoryMetadata = (await getEmailsDirectoryMetadata(
158
+ emailsDirPath,
159
+ ))!;
160
160
 
161
161
  const parameters = getEmailSlugsFromEmailDirectory(
162
162
  emailDirectoryMetadata,
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
1
  import fs from 'node:fs';
3
2
  import path from 'node:path';
4
3
 
@@ -7,7 +7,7 @@ vi.mock('@babel/traverse', async () => {
7
7
  });
8
8
 
9
9
  describe('getImportedModules()', () => {
10
- it('should work with this test file', async () => {
10
+ it('works with this test file', async () => {
11
11
  const contents = await fs.readFile(import.meta.filename, 'utf8');
12
12
 
13
13
  expect(getImportedModules(contents)).toEqual([
@@ -16,7 +16,7 @@ describe('getImportedModules()', () => {
16
16
  ]);
17
17
  });
18
18
 
19
- it('should work with direct exports', () => {
19
+ it('works with direct exports', () => {
20
20
  const contents = `export * from './component-a';
21
21
  export { ComponentB } from './component-b';
22
22
 
@@ -29,7 +29,7 @@ describe('getImportedModules()', () => {
29
29
  ]);
30
30
  });
31
31
 
32
- it('should work with regular imports and double quotes', () => {
32
+ it('works with regular imports and double quotes', () => {
33
33
  const contents = `import {
34
34
  Body,
35
35
  Button,
@@ -59,7 +59,7 @@ import * as React from "react";
59
59
  ]);
60
60
  });
61
61
 
62
- it('should work with regular imports and single quotes', () => {
62
+ it('works with regular imports and single quotes', () => {
63
63
  const contents = `import {
64
64
  Body,
65
65
  Button,
@@ -89,7 +89,7 @@ import * as React from 'react';
89
89
  ]);
90
90
  });
91
91
 
92
- it('should work with commonjs require with double quotes', () => {
92
+ it('works with commonjs require with double quotes', () => {
93
93
  const contents = `const {
94
94
  Body,
95
95
  Button,
@@ -119,7 +119,7 @@ const React = require("react");
119
119
  ]);
120
120
  });
121
121
 
122
- it('should work with commonjs require with single quotes', () => {
122
+ it('works with commonjs require with single quotes', () => {
123
123
  const contents = `const {
124
124
  Body,
125
125
  Button,
@@ -1,5 +1,4 @@
1
1
  import { existsSync, promises as fs } from 'node:fs';
2
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
3
2
  import type http from 'node:http';
4
3
  import path from 'node:path';
5
4
  import type url from 'node:url';
@@ -83,8 +83,6 @@ export const startDevServer = async (
83
83
  const { portAlreadyInUse } = await safeAsyncServerListen(devServer, port);
84
84
 
85
85
  if (!portAlreadyInUse) {
86
- // this errors when linting but doesn't on the editor so ignore the warning on this
87
- /* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
88
86
  console.log(
89
87
  styleText('greenBright', ` React Email ${packageJson.version}`),
90
88
  );
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'tsdown';
2
+
3
+ export default defineConfig({
4
+ dts: false,
5
+ entry: ['./src/index.ts'],
6
+ format: ['esm'],
7
+ outDir: 'dist',
8
+ });