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
2 changes: 1 addition & 1 deletion docs/components/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This component is wrapper around [QuickChart API](https://quickchart.io/) for ge
Add the graph component to your email template.

```jsx
import { Html, Body, Section, Graph } from 'jsx-email';
import { Body, Graph, Html, Section } from 'jsx-email';

const Email = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions docs/core/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const compiledFiles = await compile({ files: [templatePath], hashFiles: false, o
Once compiled into a bundle, the file can be imported and passed to render such like:

```jsx
import { Template } from './.compiled/batman.js';

import { render } from 'jsx-email';

import { Template } from './.compiled/batman.js';

const html = render(<Template />);
```

Expand Down
1 change: 1 addition & 0 deletions docs/core/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ To instruct a render to use plugins, utilize a [Configuration File](/docs/core/c

```js
import { defineConfig } from 'jsx-email/config';

import { somePlugin } from './plugins/some-plugin';

export const config = defineConfig({
Expand Down
3 changes: 2 additions & 1 deletion packages/create-mail/generators/package.json.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"jsx-email": "^2.0.0"
},
"devDependencies": {
"react": "^19.1.0"{{{ typeDep }}}
"react": "^19.1.0",
"react-dom": "^19.1.0"{{{ typeDep }}}
}
}
17 changes: 17 additions & 0 deletions test/cli/create-mail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ describe('create-mail', async () => {

expect(plain).toMatchSnapshot();

type PackageJson = {
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
};

const packageJson = JSON.parse(
await readFile(join(__dirname, '.test/new/package.json'), 'utf8')
) as PackageJson;

expect(packageJson.devDependencies).toMatchObject({
react: expect.any(String),
'react-dom': expect.any(String)
});

expect(packageJson.dependencies ?? {}).not.toHaveProperty('react');
expect(packageJson.dependencies ?? {}).not.toHaveProperty('react-dom');

const contents = await readFile(join(__dirname, '.test/new/templates/email.tsx'), 'utf8');
expect(contents).toMatchSnapshot();

Expand Down