Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jsx-email,app-preview,create-jsx-email,plugin-inline,plugin-minify,plugin-pretty): version 2.0.0 #206

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bfbb66a
feat(app-preview)!: add exclude glob support (#156)
shellscape Jan 30, 2024
01a4d61
feat(jsx-email)!: add --exclude flag to preview (#158)
shellscape Jan 30, 2024
54d413e
feat(jsx-email,app-preview)!: support tsconfig and jsconfig path alia…
shellscape Jan 30, 2024
b66ed47
chore(create-jsx-email,jsx-email): consolidate new email template
shellscape Feb 13, 2024
bb5576b
chore(create-jsx-email,jsx-email): add symlinks to email templates
shellscape Feb 13, 2024
1186f2d
refactor(jsx-email): prefer named exports
shellscape Feb 13, 2024
f6e8a2c
chore(jsx-email,app-preview): shikiji to shiki
shellscape Feb 13, 2024
f720127
refactor(jsx-email): reorganize renderer, smoke tests
shellscape Feb 23, 2024
dfb14fe
chore(repo): merge create-jsx-email from main
shellscape Feb 28, 2024
ea18640
chore: Merge branch 'main' into release/v2
shellscape Feb 28, 2024
db26398
chore(repo): fix smoke tests
shellscape Feb 28, 2024
974288f
feat(jsx-email): support context hooks and components (#179)
ganondev Feb 28, 2024
153bc37
fix(jsx-email): add align to container td (#178)
ganondev Feb 28, 2024
363ee30
feat(app-preview): add logic for mobile sidebar and update ui (#182)
lordelogos Apr 2, 2024
854069b
chore(jsx-email): bump md-to-react-email dep (#184)
lordelogos Apr 2, 2024
dee6b53
feat(jsx-email): plugins!
shellscape Apr 8, 2024
9ac4bc0
chore: add logging, chalk utils to plugins
shellscape Apr 9, 2024
f944732
checkpoint
shellscape Apr 20, 2024
6148122
chore: js-only configs
shellscape May 9, 2024
3a45b4d
chore: update head component from main
shellscape May 9, 2024
a58b0d6
chore: another attempt at esm-first with tshy
shellscape May 9, 2024
290a038
chore: more config fixes
shellscape May 10, 2024
81aa42c
chore: get tests working
shellscape May 11, 2024
ff40b48
chore: get the cli working on esm
shellscape May 11, 2024
55e5d54
chore: more cli esm tweaks
shellscape May 11, 2024
77f3bb5
chore: more esm tweaks
shellscape May 24, 2024
f08eafb
refactor: move rendering out of the preview app for preview
shellscape May 24, 2024
c0d15d3
chore: get preview working with new direction
shellscape May 24, 2024
f659ffc
chore: add some missing devdeps
shellscape May 29, 2024
ed7adc9
fix: use templateName export in preview
shellscape May 29, 2024
375e077
chore: dep bumps
shellscape May 29, 2024
ccb6f10
chore: add @types/mustache
shellscape Jun 3, 2024
5fc0e81
fix(jsx-email): resolve type issues breaking `jsx-email` build (#199)
lordelogos Jun 4, 2024
f38f6ba
feat(jsx-email): add new components (graph, background), update compo…
lordelogos Jul 4, 2024
2e19cf5
chore: rc2.1
shellscape Jul 25, 2024
7b1edc8
chore: add watcher dep
shellscape Sep 14, 2024
5bd775e
feat: use parcel watcher to rebuild templates in preview
shellscape Sep 14, 2024
5e3566f
Merge branch 'main' into release/v2
shellscape Sep 14, 2024
aa8bd56
chore: cleanup
shellscape Sep 14, 2024
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
25 changes: 24 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
files: ['apps/demo/emails/**/*.tsx', 'apps/demo/staged/**/*.tsx'],
rules: {
'arrow-body-style': 'off',
'import/no-default-export': 'off',
'no-use-before-define': 'off',
'sort-keys': 'off',
'typescript-sort-keys/interface': 'off'
Expand All @@ -52,6 +51,30 @@ module.exports = {
varsIgnorePattern: '^_'
}
],
'import/extensions': [
'error',
'ignorePackages',
{
cjs: 'never',
cts: 'never',
js: 'never',
jsx: 'never',
mjs: 'never',
mts: 'never',
ts: 'never',
tsx: 'never'
}
],
'no-console': 'error'
},
settings: {
'import/resolver': {
node: {
extensions: ['.cjs', '.js', '.json', '.jsx', '.mjs', '.ts', '.tsx']
},
typescript: {
alwaysTryTypes: true
}
}
}
};
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ jobs:

- name: Build Projects
run: |
moon minify-preset:build
moon jsx-email:build
moon create-jsx-email:build
moon run :build --query "project~plugin-*"

- name: Release
run: moon run :release --affected --concurrency 1 --remote
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Run Tests

on:
workflow_dispatch:
pull_request:
types:
- edited
- opened
- synchronize
push:
branches:
- '*'
- '!main'

jobs:
validate:
runs-on: ubuntu-latest
name: Run Tests

steps:
- name: Checkout Commit
uses: actions/checkout@v4
with:
fetch-depth: 10

# Needed for https://github.com/moonrepo/moon/issues/1060
- name: Force Update Main
run: |
git fetch origin
git branch -f main origin/main

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"

- name: Setup Moon
uses: moonrepo/setup-toolchain@v0

- name: Sanity Check
run: |
echo git `git version`;
echo branch `git branch --show-current`;
echo node `node -v`;
echo pnpm `pnpm -v`
echo `moon --version`

- name: pnpm install
run: pnpm install --frozen-lockfile

- name: Build Projects
run: |
moon jsx-email:build
moon create-jsx-email:build
moon run :build --query "project~plugin-*"

- name: Package Tests
env:
FORCE_COLOR: 1
run: moon run :test --affected --concurrency 1 --remote

- name: Smoke Test
# Note: We're running `pnpm i` again so that pnpm places the `email` bin in root node_modules
# We'll need that for the preview tests below
run: |
pnpm i
moon smoke:run.ci
21 changes: 1 addition & 20 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ jobs:
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: ESLint Cache
uses: actions/cache@v3
Expand All @@ -74,19 +65,9 @@ jobs:

- name: Build Projects
run: |
moon minify-preset:build
moon jsx-email:build
moon create-jsx-email:build
moon run :build --query "project~plugin-*"

- name: Lint Monorepo
run: moon run repo:lint

- name: Run Tests
run: moon run :test --affected --concurrency 1 --remote

- name: Run Preview Test
# Note: We're running `pnpm i` again so that pnpm places the `email` bin in root node_modules
# We'll need that for the preview tests below
run: |
pnpm i
moon app-test:playwright.ci
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ dist
.env
.nojekyll
**/.vitepress/cache
.idea/
.tshy
.tshy-build

packages/**/tsconfig.json
packages/jsx-email/README.md

test-results
Expand Down
30 changes: 23 additions & 7 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,35 @@ fileGroups:
- 'tests/**/*.test.*'

tasks:
build:
command: echo "Build Complete ✓"
deps:
- ~:clean.dist
- ~:compile
inputs:
- src
- package.json
options:
cache: false
outputStyle: 'stream'
runDepsInParallel: false
outputs:
- dist

clean.dist:
command: rm -rf dist
inputs:
- src
- package.json

compile:
command: tshy
inputs:
- src
- package.json
options:
runDepsInParallel: false

release:
command: versioner --target $projectRoot
deps:
Expand All @@ -24,10 +47,3 @@ tasks:
cache: false
outputStyle: 'stream'
runDepsInParallel: false

tsconfig.link:
command: ln -sf ../../shared/tsconfig.default.json tsconfig.json
options:
cache: false
outputStyle: 'stream'
platform: system
2 changes: 1 addition & 1 deletion .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ node:

# The version of the package manager (above) to use.
pnpm:
version: '8.11.0'
version: '9.1.1'

# Add `node.version` as a constraint in the root `package.json` `engines`.
addEnginesConstraint: true
Expand Down
1 change: 1 addition & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ projects:
globs:
- 'apps/*'
- 'packages/*'
- 'test/*'
sources:
root: '.'
vcs:
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/airbnb-review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ interface AirbnbReviewEmailProps {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
authorName: 'Joker',
authorImage: `${baseUrl}batman-twilight.jpg`,
reviewText: `"Batsy's stay at my Airbnb Batcave was a riot! Batman surprised with a hidden sense of humor, engaging in epic banter and a prank war. His detective skills impressed, and the Batcave remained spotless. Game night and snacks were a hit, and even during downtime, he couldn't resist a Bat-signal. Hosting Batsy was chaos perfected – if you want a guest with brooding intensity and unexpected laughter, Batman's your Bat. Hahahahahahahahahaha! "`
} as AirbnbReviewEmailProps;

export const TemplateName = 'Airbnb Review';
export const templateName = 'Airbnb Review';

const main = {
backgroundColor: '#ffffff',
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/emails/apple-receipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const walletLinkText = {
textDecoration: 'none'
};

export const TemplateName = 'Apple Receipt';
export const templateName = 'Apple Receipt';

export const Template = () => (
<Html>
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/emails/codepen-challengers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const footerLink = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const TemplateName = 'Codepen Challengers';
export const templateName = 'Codepen Challengers';

export const Template = () => (
<Html>
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/credential emails/dropbox-reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ const anchor = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
userFirstname: 'Bruce',
resetPasswordLink: 'https://dropbox.com'
} as DropboxResetPasswordEmailProps;

export const TemplateName = 'Dropbox Reset Password';
export const templateName = 'Dropbox Reset Password';

export const Template = ({ userFirstname, resetPasswordLink }: DropboxResetPasswordEmailProps) => {
return (
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/credential emails/github-access-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const footer = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
username: 'Batman'
} as GithubAccessTokenEmailProps;

export const TemplateName = 'Github Access Token';
export const templateName = 'Github Access Token';

export const Template = ({ username }: GithubAccessTokenEmailProps) => (
<Html>
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/credential emails/linear-login-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ const code = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
validationCode: 'tt226-5398x'
} as LinearLoginCodeEmailProps;

export const TemplateName = 'Linear Login Code';
export const templateName = 'Linear Login Code';

export const Template = ({ validationCode }: LinearLoginCodeEmailProps) => (
<Html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ const code = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
loginCode: 'sparo-ndigo-amurt-secan'
} as NotionMagicLinkEmailProps;

export const TemplateName = 'Notion Magic Link';
export const templateName = 'Notion Magic Link';

export const Template = ({ loginCode }: NotionMagicLinkEmailProps) => (
<Html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ const footer = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
magicLink: 'https://raycast.com'
} as RaycastMagicLinkEmailProps;

export const TemplateName = 'Raycast Magic Link';
export const templateName = 'Raycast Magic Link';

export const Template = ({ magicLink }: RaycastMagicLinkEmailProps) => (
<Html>
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/credential emails/twitch-reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ const link = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
username: 'Batman',
updatedDate: new Date('June 23, 2022 4:06:00 pm UTC')
} as TwitchResetPasswordEmailProps;

export const TemplateName = 'Twitch Reset Password';
export const templateName = 'Twitch Reset Password';

export const Template = ({ username, updatedDate }: TwitchResetPasswordEmailProps) => {
const formattedDate = new Intl.DateTimeFormat('en', {
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/emails/google-play-policy-update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const hr = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const TemplateName = 'Google Play Policy Update';
export const templateName = 'Google Play Policy Update';

export const Template = () => (
<Html>
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/emails/nike-receipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const footer = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const TemplateName = 'Nike Receipt';
export const templateName = 'Nike Receipt';

export const Template = () => (
<Html>
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/emails/plaid-verify-identity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ const footer = {

const baseUrl = 'https://jsx.email/assets/demo/';

export const PreviewProps = {
export const previewProps = {
validationCode: '144833'
} as PlaidVerifyIdentityEmailProps;

export const TemplateName = 'Plaid Verify Identity';
export const templateName = 'Plaid Verify Identity';

export const Template = ({ validationCode }: PlaidVerifyIdentityEmailProps) => (
<Html>
Expand Down
Loading
Loading