Skip to content

Commit

Permalink
feat(jsx-email,app-preview,create-jsx-email,plugin-inline,plugin-mini…
Browse files Browse the repository at this point in the history
…fy,plugin-pretty): version 2.0.0 (#206)

Co-authored-by: ganondev <ganonballgame@gmail.com>
Co-authored-by: EJ <me@me>
Co-authored-by: Paul Ehikhuemen <67395687+lordelogos@users.noreply.github.com>
Co-authored-by: Release Workflow <release-workflow@jsx.email>
Co-authored-by: Ben Cook <b@bencook.ca>
Co-authored-by: Thomas Dondorf <thomasdondorf@users.noreply.github.com>
  • Loading branch information
7 people authored Sep 22, 2024
1 parent b3fd188 commit 4197bb9
Show file tree
Hide file tree
Showing 259 changed files with 13,116 additions and 8,553 deletions.
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: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<br/>
</div>

## Version 2.0.0

The `main` branch currently represents the pending v2.0.0. To browse the source code for v1.12.1 please [click here](https://github.com/shellscape/jsx-email/tree/545ad7550fef11cc18fafe71c772c7b66a8b2373).

## Getting Started

Everything to know about the components, props, and usage is available within our [Documentation Site](https://jsx.email/docs/introduction). Please give that a read and let us know if there's anything we can help with.
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
Loading

0 comments on commit 4197bb9

Please sign in to comment.