react-email 6.0.0 → 6.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-email
2
2
 
3
+ ## 6.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 63b6e71: Fix Markdown component crashing on CommonMark loose lists with paragraph continuations
8
+
9
+ ## 6.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 599b8c5: fix type issues in starter template and in react-email
14
+
3
15
  ## 6.0.0
4
16
 
5
17
  ### Major Changes
@@ -8,7 +20,7 @@
8
20
 
9
21
  All components (previously in `@react-email/components` or individual packages like `@react-email/button`) and rendering utilities (previously in `@react-email/render`) are now exported directly from `react-email`. This unifies the install and import experience into a single package.
10
22
 
11
- We're going to deprecate all packages except `@react-email/render` and `@react-email/preview-server`, and they will not be updated anymore.
23
+ We're going to deprecate all packages except `@react-email/render` and `@react-email/ui`, and they will not be updated anymore.
12
24
 
13
25
  ### Breaking change
14
26
 
@@ -19,22 +31,25 @@
19
31
  Having separate packages for components (`@react-email/components`), and the CLI (`react-email`) created unnecessary confusion, and a maintenance burden for us.
20
32
 
21
33
  ### How to migrate
22
- 1. **Update your dependencies** -- remove `@react-email/components`, keep `react-email`:
34
+ 1. Remove `@react-email/components`:
23
35
 
24
36
  ```diff
25
- - npm install @react-email/components react-email @react-email/preview-server
26
- + npm install react-email @react-email/preview-server
37
+ npm remove @react-email/components
27
38
  ```
28
39
 
29
- 2. **Update your imports**:
40
+ 2. Update `react-email`, and move it over to `dependencies`:
41
+
42
+ ```diff
43
+ npm install react-email@latest
44
+ ```
45
+
46
+ 3. **Update your imports**:
30
47
 
31
48
  ```diff
32
49
  - import { Button, Html, Head, render } from "@react-email/components";
33
50
  + import { Button, Html, Head, render } from "react-email";
34
51
  ```
35
52
 
36
- 3. The `@react-email/preview-server` and `@react-email/editor` packages are not included in `react-email`
37
-
38
53
  ### Patch Changes
39
54
 
40
55
  - a3a15ea: replace deprecated `url.parse()` with WHATWG URL API in the preview dev server.
@@ -6522,15 +6522,17 @@ const getEmailsDirectoryMetadata = async (absolutePathToEmailsDirectory, keepFil
6522
6522
  //#region package.json
6523
6523
  var package_default = {
6524
6524
  name: "react-email",
6525
- version: "6.0.0",
6525
+ version: "6.0.2",
6526
6526
  description: "A live preview of your emails right in your browser.",
6527
6527
  bin: { "email": "./dist/cli/index.mjs" },
6528
6528
  type: "module",
6529
+ types: "./dist/index.d.mts",
6529
6530
  scripts: {
6530
6531
  "build": "tsdown",
6531
6532
  "build:watch": "tsdown --watch src",
6532
6533
  "clean": "rm -rf dist",
6533
6534
  "test": "vitest run",
6535
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
6534
6536
  "test:watch": "vitest",
6535
6537
  "typecheck": "tsc --noEmit"
6536
6538
  },
@@ -6584,12 +6586,15 @@ var package_default = {
6584
6586
  "@types/css-tree": "catalog:",
6585
6587
  "@types/mime-types": "catalog:",
6586
6588
  "@types/prompts": "2.4.9",
6589
+ "@types/shelljs": "0.10.0",
6587
6590
  "next": "catalog:",
6588
6591
  "react": "catalog:",
6589
6592
  "react-dom": "catalog:",
6593
+ "shelljs": "0.10.0",
6590
6594
  "shlex": "3.0.0",
6591
6595
  "tsx": "catalog:",
6592
- "typescript": "catalog:"
6596
+ "typescript": "catalog:",
6597
+ "yalc": "catalog:"
6593
6598
  }
6594
6599
  };
6595
6600
  //#endregion
package/dist/index.cjs CHANGED
@@ -17810,8 +17810,9 @@ const Markdown = react.forwardRef(({ children, markdownContainerStyles, markdown
17810
17810
  const text = renderer.parser.parseInline(tokens);
17811
17811
  return `<a href="${href}" target="_blank"${title ? ` title="${title}"` : ""}${parseCssInJsToInlineCss(finalStyles.link) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.link)}"` : ""}>${text}</a>`;
17812
17812
  };
17813
- renderer.listitem = ({ tokens }) => {
17814
- const text = tokens.some((token) => token.type === "list") ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
17813
+ renderer.listitem = ({ tokens, loose }) => {
17814
+ const hasNestedList = tokens.some((token) => token.type === "list");
17815
+ const text = loose || hasNestedList ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
17815
17816
  return `<li${parseCssInJsToInlineCss(finalStyles.li) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.li)}"` : ""}>${text}</li>\n`;
17816
17817
  };
17817
17818
  renderer.list = ({ items, ordered, start }) => {
package/dist/index.mjs CHANGED
@@ -17789,8 +17789,9 @@ const Markdown = React$1.forwardRef(({ children, markdownContainerStyles, markdo
17789
17789
  const text = renderer.parser.parseInline(tokens);
17790
17790
  return `<a href="${href}" target="_blank"${title ? ` title="${title}"` : ""}${parseCssInJsToInlineCss(finalStyles.link) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.link)}"` : ""}>${text}</a>`;
17791
17791
  };
17792
- renderer.listitem = ({ tokens }) => {
17793
- const text = tokens.some((token) => token.type === "list") ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
17792
+ renderer.listitem = ({ tokens, loose }) => {
17793
+ const hasNestedList = tokens.some((token) => token.type === "list");
17794
+ const text = loose || hasNestedList ? renderer.parser.parse(tokens) : renderer.parser.parseInline(tokens);
17794
17795
  return `<li${parseCssInJsToInlineCss(finalStyles.li) !== "" ? ` style="${parseCssInJsToInlineCss(finalStyles.li)}"` : ""}>${text}</li>\n`;
17795
17796
  };
17796
17797
  renderer.list = ({ items, ordered, start }) => {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "react-email",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "A live preview of your emails right in your browser.",
5
5
  "bin": {
6
6
  "email": "./dist/cli/index.mjs"
7
7
  },
8
8
  "type": "module",
9
+ "types": "./dist/index.d.mts",
9
10
  "license": "MIT",
10
11
  "exports": {
11
12
  "import": {
@@ -38,14 +39,14 @@
38
39
  "conf": "^15.0.2",
39
40
  "css-tree": "3.2.1",
40
41
  "debounce": "^2.0.0",
41
- "esbuild": "0.27.5",
42
+ "esbuild": "0.28.0",
42
43
  "glob": "^13.0.6",
43
44
  "jiti": "2.4.2",
44
45
  "log-symbols": "^7.0.0",
45
46
  "marked": "^15.0.12",
46
47
  "mime-types": "^3.0.0",
47
48
  "normalize-path": "^3.0.0",
48
- "nypm": "0.6.5",
49
+ "nypm": "0.6.6",
49
50
  "ora": "^8.0.0",
50
51
  "prismjs": "^1.30.0",
51
52
  "prompts": "2.4.2",
@@ -60,12 +61,15 @@
60
61
  "@types/css-tree": "2.3.11",
61
62
  "@types/mime-types": "2.1.4",
62
63
  "@types/prompts": "2.4.9",
64
+ "@types/shelljs": "0.10.0",
63
65
  "next": "16.2.3",
64
66
  "react": "19.2.4",
65
67
  "react-dom": "19.2.4",
68
+ "shelljs": "0.10.0",
66
69
  "shlex": "3.0.0",
67
70
  "tsx": "4.21.0",
68
71
  "typescript": "5.9.3",
72
+ "yalc": "1.0.0-pre.53",
69
73
  "@react-email/render": "2.0.7"
70
74
  },
71
75
  "scripts": {
@@ -73,6 +77,7 @@
73
77
  "build:watch": "tsdown --watch src",
74
78
  "clean": "rm -rf dist",
75
79
  "test": "vitest run",
80
+ "test:e2e": "vitest run --config vitest.e2e.config.ts",
76
81
  "test:watch": "vitest",
77
82
  "typecheck": "tsc --noEmit"
78
83
  }
@@ -153,6 +153,28 @@ console.log(\`Hello, $\{name}!\`);
153
153
  `);
154
154
  });
155
155
 
156
+ it('renders loose lists with paragraph continuations without crashing', async () => {
157
+ const actualOutput = await render(
158
+ <Markdown>
159
+ {`- item1
160
+
161
+ paragraph continuation
162
+
163
+ - item2`}
164
+ </Markdown>,
165
+ );
166
+ expect(actualOutput).toMatchInlineSnapshot(`
167
+ "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!--$--><div data-id="react-email-markdown"><ul>
168
+ <li><p>item1</p>
169
+ <p>paragraph continuation</p>
170
+ </li>
171
+ <li><p>item2</p>
172
+ </li>
173
+ </ul>
174
+ </div><!--/$-->"
175
+ `);
176
+ });
177
+
156
178
  it('renders nested lists in the correct format for browsers', async () => {
157
179
  const actualOutput = await render(
158
180
  <Markdown>
@@ -118,11 +118,12 @@ export const Markdown = React.forwardRef<HTMLDivElement, MarkdownProps>(
118
118
  }>${text}</a>`;
119
119
  };
120
120
 
121
- renderer.listitem = ({ tokens }) => {
121
+ renderer.listitem = ({ tokens, loose }) => {
122
122
  const hasNestedList = tokens.some((token) => token.type === 'list');
123
- const text = hasNestedList
124
- ? renderer.parser.parse(tokens)
125
- : renderer.parser.parseInline(tokens);
123
+ const text =
124
+ loose || hasNestedList
125
+ ? renderer.parser.parse(tokens)
126
+ : renderer.parser.parseInline(tokens);
126
127
 
127
128
  return `<li${
128
129
  parseCssInJsToInlineCss(finalStyles.li) !== ''
@@ -19,8 +19,8 @@ const $ = (command: string, cwd: string = path.resolve(__dirname, '..')) => {
19
19
 
20
20
  describe('integrations', () => {
21
21
  beforeAll(() => {
22
- const packageLocation = path.resolve(__dirname, '../');
23
- $('yalc installations clean @react-email/tailwind', packageLocation);
22
+ const packageLocation = path.resolve(__dirname, '../../../..');
23
+ $('yalc installations clean react-email', packageLocation);
24
24
  $('yalc publish', packageLocation);
25
25
  });
26
26
 
@@ -12,9 +12,9 @@ import {
12
12
  Preview,
13
13
  Row,
14
14
  Section,
15
+ Tailwind,
15
16
  Text,
16
- } from '@react-email/components';
17
- import { Tailwind } from '@react-email/tailwind';
17
+ } from 'react-email';
18
18
 
19
19
  interface VercelInviteUserEmailProps {
20
20
  username?: string;
@@ -1,7 +1,6 @@
1
1
  /** @type {import('next').NextConfig} */
2
2
  const nextConfig = {
3
3
  compress: false,
4
- swcMinify: false,
5
4
  };
6
5
 
7
6
  export default nextConfig;
@@ -6,11 +6,10 @@
6
6
  "dev": "next dev",
7
7
  "build": "next build",
8
8
  "start": "next start",
9
- "preinstall": "yalc add @react-email/tailwind"
9
+ "preinstall": "yalc add react-email"
10
10
  },
11
11
  "dependencies": {
12
- "@react-email/components": "0.0.36",
13
- "@react-email/tailwind": "file:.yalc/@react-email/tailwind",
12
+ "react-email": "file:.yalc/react-email",
14
13
  "next": "^15",
15
14
  "react": "^19",
16
15
  "react-dom": "^19"
@@ -1,4 +1,4 @@
1
- import { render } from '@react-email/components';
1
+ import { render } from 'react-email';
2
2
  import { VercelInviteUserEmail } from '../../emails/vercel-invite-user';
3
3
 
4
4
  export default async function Home() {
@@ -12,9 +12,9 @@ import {
12
12
  Preview,
13
13
  Row,
14
14
  Section,
15
+ Tailwind,
15
16
  Text,
16
- } from '@react-email/components';
17
- import { Tailwind } from '@react-email/tailwind';
17
+ } from 'react-email';
18
18
 
19
19
  interface VercelInviteUserEmailProps {
20
20
  username?: string;
@@ -6,12 +6,11 @@
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "build": "vite build",
9
- "preinstall": "yalc add @react-email/tailwind",
9
+ "preinstall": "yalc add react-email",
10
10
  "preview": "vite preview"
11
11
  },
12
12
  "dependencies": {
13
- "@react-email/components": "0.0.36",
14
- "@react-email/tailwind": "file:.yalc/@react-email/tailwind",
13
+ "react-email": "file:.yalc/react-email",
15
14
  "react": "^19",
16
15
  "react-dom": "^19"
17
16
  },
@@ -1,4 +1,4 @@
1
- import { render } from '@react-email/components';
1
+ import { render } from 'react-email';
2
2
  import { VercelInviteUserEmail } from '../emails/vercel-invite-user';
3
3
 
4
4
  function App() {
@@ -0,0 +1,17 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'happy-dom',
7
+ include: ['**/e2e/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
8
+ exclude: ['**/node_modules/**'],
9
+ },
10
+ esbuild: {
11
+ tsconfigRaw: {
12
+ compilerOptions: {
13
+ jsx: 'react-jsx',
14
+ },
15
+ },
16
+ },
17
+ });