react-email 1.4.2-canary.1 → 1.4.2-canary.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/.react-email/next-env.d.ts +0 -0
- package/.react-email/package.json +0 -0
- package/.react-email/postcss.config.js +0 -0
- package/.react-email/src/components/button.tsx +0 -0
- package/.react-email/src/components/code.tsx +0 -0
- package/.react-email/src/components/heading.tsx +0 -0
- package/.react-email/src/components/icon-base.tsx +0 -0
- package/.react-email/src/components/icon-button.tsx +0 -0
- package/.react-email/src/components/icon-check.tsx +0 -0
- package/.react-email/src/components/icon-clipboard.tsx +0 -0
- package/.react-email/src/components/icon-download.tsx +0 -0
- package/.react-email/src/components/index.ts +0 -0
- package/.react-email/src/components/layout.tsx +0 -0
- package/.react-email/src/components/logo.tsx +0 -0
- package/.react-email/src/components/send.tsx +0 -0
- package/.react-email/src/components/sidebar.tsx +0 -0
- package/.react-email/src/components/text.tsx +0 -0
- package/.react-email/src/components/tooltip-content.tsx +0 -0
- package/.react-email/src/components/tooltip.tsx +0 -0
- package/.react-email/src/components/topbar.tsx +0 -0
- package/.react-email/src/pages/_app.tsx +26 -0
- package/.react-email/src/pages/_document.tsx +0 -0
- package/.react-email/src/pages/index.tsx +0 -0
- package/.react-email/src/styles/globals.css +0 -0
- package/.react-email/src/utils/as.ts +0 -0
- package/.react-email/src/utils/copy-text-to-clipboard.ts +0 -0
- package/.react-email/src/utils/index.ts +0 -0
- package/.react-email/src/utils/unreachable.ts +0 -0
- package/.react-email/tailwind.config.js +0 -0
- package/.react-email/tsconfig.json +0 -0
- package/dist/commands/exportTemplates.js +20 -1
- package/emails/airbnb-review.tsx +163 -0
- package/emails/dropbox-reset-password.tsx +85 -0
- package/emails/google-play-policy-update.tsx +229 -0
- package/emails/koala-welcome.tsx +97 -0
- package/emails/linear-login-code.tsx +124 -0
- package/emails/notion-magic-link.tsx +133 -0
- package/emails/plaid-verify-identity.tsx +133 -0
- package/emails/raycast-magic-link.tsx +107 -0
- package/emails/static/airbnb-logo.png +0 -0
- package/emails/static/airbnb-review-user.jpg +0 -0
- package/emails/static/chat.png +0 -0
- package/emails/static/dropbox.png +0 -0
- package/emails/static/google-play-academy.png +0 -0
- package/emails/static/google-play-chat.png +0 -0
- package/emails/static/google-play-footer.png +0 -0
- package/emails/static/google-play-header.png +0 -0
- package/emails/static/google-play-icon.png +0 -0
- package/emails/static/google-play-logo.png +0 -0
- package/emails/static/google-play-pl.png +0 -0
- package/emails/static/google-play.png +0 -0
- package/emails/static/linear-logo.png +0 -0
- package/emails/static/notion-logo.png +0 -0
- package/emails/static/plaid.png +0 -0
- package/emails/static/raycast-bg.png +0 -0
- package/emails/static/raycast-logo.png +0 -0
- package/emails/static/stripe-logo.png +0 -0
- package/emails/static/twitch-icon-facebook.png +0 -0
- package/emails/static/twitch-icon-twitter.png +0 -0
- package/emails/static/twitch-logo.png +0 -0
- package/emails/static/vercel-arrow.png +0 -0
- package/emails/static/vercel-logo.png +0 -0
- package/emails/static/yelp-footer.png +0 -0
- package/emails/static/yelp-header.png +0 -0
- package/emails/static/yelp-logo.png +0 -0
- package/emails/stripe-welcome.tsx +152 -0
- package/emails/twitch-reset-password.tsx +138 -0
- package/emails/vercel-invite-user.tsx +196 -0
- package/emails/yelp-recent-login.tsx +158 -0
- package/package.json +4 -3
- package/source/commands/exportTemplates.ts +28 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { glob } from 'glob';
|
|
2
2
|
import esbuild from 'esbuild';
|
|
3
|
+
import tree from 'tree-node-cli';
|
|
4
|
+
import ora from 'ora';
|
|
5
|
+
import logSymbols from 'log-symbols';
|
|
3
6
|
import { render } from '@react-email/render';
|
|
4
7
|
import { unlinkSync, writeFileSync } from 'fs';
|
|
8
|
+
import copy from 'cpy';
|
|
9
|
+
import { checkDirectoryExist, CLIENT_EMAILS_PATH } from '../utils';
|
|
5
10
|
|
|
6
11
|
/*
|
|
7
12
|
This first builds all the templates using esbuild and then puts the output in the `.js`
|
|
@@ -9,7 +14,9 @@ import { unlinkSync, writeFileSync } from 'fs';
|
|
|
9
14
|
using the `render` function.
|
|
10
15
|
*/
|
|
11
16
|
export const exportTemplates = async (outDir: string, pretty: boolean) => {
|
|
12
|
-
const
|
|
17
|
+
const spinner = ora('Preparing files...\n').start();
|
|
18
|
+
const allTemplates = glob.sync(`${CLIENT_EMAILS_PATH}/*.{tsx,jsx}`);
|
|
19
|
+
|
|
13
20
|
esbuild.buildSync({
|
|
14
21
|
bundle: true,
|
|
15
22
|
entryPoints: allTemplates,
|
|
@@ -29,4 +36,24 @@ export const exportTemplates = async (outDir: string, pretty: boolean) => {
|
|
|
29
36
|
writeFileSync(htmlPath, rendered);
|
|
30
37
|
unlinkSync(template);
|
|
31
38
|
}
|
|
39
|
+
|
|
40
|
+
const hasStaticDirectory = checkDirectoryExist(
|
|
41
|
+
`${CLIENT_EMAILS_PATH}/static`,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
if (hasStaticDirectory) {
|
|
45
|
+
await copy(`${CLIENT_EMAILS_PATH}/static`, `${outDir}/static`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const fileTree = tree(outDir, {
|
|
49
|
+
allFiles: true,
|
|
50
|
+
maxDepth: 4,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
console.log(fileTree);
|
|
54
|
+
|
|
55
|
+
spinner.stopAndPersist({
|
|
56
|
+
symbol: logSymbols.success,
|
|
57
|
+
text: 'Successfully exported emails',
|
|
58
|
+
});
|
|
32
59
|
};
|