Skip to content

Commit f4b1ffa

Browse files
authored
feat(root): Rewrite monorepo setup (#948)
1 parent 4460c62 commit f4b1ffa

File tree

355 files changed

+9914
-117994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

355 files changed

+9914
-117994
lines changed

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 104 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -12,137 +12,146 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v4
15-
- name: Cache node modules
16-
id: npm-cache
17-
uses: buildjet/cache@v3
18-
with:
19-
path: ~/.node_modules
20-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
21-
restore-keys: |
22-
${{ runner.os }}-node-
23-
- name: Cache yarn cache
24-
id: yarn-cache
15+
16+
- name: Enable Corepack
17+
id: pnpm-setup
18+
run: |
19+
corepack enable
20+
corepack prepare pnpm@latest --activate
21+
pnpm config set script-shell "/usr/bin/bash"
22+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
23+
24+
- name: pnpm Cache
2525
uses: buildjet/cache@v3
2626
with:
27-
path: ~/.cache/yarn
28-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
27+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
28+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
2929
restore-keys: |
30-
${{ runner.os }}-yarn-
30+
${{ runner.os }}-pnpm-store-
31+
3132
- name: Install packages
32-
if: steps.npm-cache.outputs.cache-hit != 'true'
33-
run: yarn
33+
run: pnpm install --frozen-lockfile
34+
3435
- name: Run Lint
35-
run: yarn lint
36+
run: pnpm lint
37+
3638
format:
3739
runs-on: buildjet-4vcpu-ubuntu-2204
3840
container:
39-
image: node:16
41+
image: node:18
4042
steps:
4143
- name: Checkout
4244
uses: actions/checkout@v4
43-
- name: Cache node modules
44-
id: npm-cache
45+
46+
- name: Enable Corepack
47+
id: pnpm-setup
48+
run: |
49+
corepack enable
50+
corepack prepare pnpm@latest --activate
51+
pnpm config set script-shell "/usr/bin/bash"
52+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
53+
54+
- name: pnpm Cache
4555
uses: buildjet/cache@v3
4656
with:
47-
path: ~/.node_modules
48-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
57+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
58+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
4959
restore-keys: |
50-
${{ runner.os }}-node-
51-
- name: Cache yarn cache
52-
id: yarn-cache
60+
${{ runner.os }}-pnpm-store-
61+
62+
- name: Install packages
63+
run: pnpm install --frozen-lockfile
64+
65+
- name: Run Format Check
66+
run: pnpm format:check
67+
68+
test:
69+
runs-on: buildjet-4vcpu-ubuntu-2204
70+
container:
71+
image: node:18
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v3
75+
76+
- name: Enable Corepack
77+
id: pnpm-setup
78+
run: |
79+
corepack enable
80+
corepack prepare pnpm@latest --activate
81+
pnpm config set script-shell "/usr/bin/bash"
82+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
83+
84+
- name: pnpm Cache
5385
uses: buildjet/cache@v3
5486
with:
55-
path: ~/.cache/yarn
56-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
87+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
88+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5789
restore-keys: |
58-
${{ runner.os }}-yarn-
90+
${{ runner.os }}-pnpm-store-
91+
5992
- name: Install packages
60-
if: steps.npm-cache.outputs.cache-hit != 'true'
61-
run: yarn
62-
- name: Run Format Check
63-
run: yarn format:check
64-
# test:
65-
# runs-on: buildjet-4vcpu-ubuntu-2204
66-
# container:
67-
# image: node:16
68-
# steps:
69-
# - name: Checkout
70-
# uses: actions/checkout@v3
71-
# - name: Cache node modules
72-
# id: npm-cache
73-
# uses: buildjet/cache@v3
74-
# with:
75-
# path: ~/.node_modules
76-
# key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
77-
# restore-keys: |
78-
# ${{ runner.os }}-node-
79-
# - name: Cache yarn cache
80-
# id: yarn-cache
81-
# uses: buildjet/cache@v3
82-
# with:
83-
# path: ~/.cache/yarn
84-
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
85-
# restore-keys: |
86-
# ${{ runner.os }}-yarn-
87-
# - name: Install packages
88-
# if: steps.npm-cache.outputs.cache-hit != 'true'
89-
# run: yarn
90-
# - name: Run Tests
91-
# run: yarn test
93+
run: pnpm install --frozen-lockfile
94+
95+
- name: Run Tests
96+
run: pnpm test
97+
9298
build:
9399
runs-on: buildjet-4vcpu-ubuntu-2204
94100
container:
95-
image: node:16
101+
image: node:18
96102
steps:
97103
- name: Checkout
98104
uses: actions/checkout@v4
99-
- name: Cache node modules
100-
id: npm-cache
101-
uses: buildjet/cache@v3
102-
with:
103-
path: ~/.node_modules
104-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
105-
restore-keys: |
106-
${{ runner.os }}-node-
107-
- name: Cache yarn cache
108-
id: yarn-cache
105+
106+
- name: Enable Corepack
107+
id: pnpm-setup
108+
run: |
109+
corepack enable
110+
corepack prepare pnpm@latest --activate
111+
pnpm config set script-shell "/usr/bin/bash"
112+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
113+
114+
- name: pnpm Cache
109115
uses: buildjet/cache@v3
110116
with:
111-
path: ~/.cache/yarn
112-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
117+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
118+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
113119
restore-keys: |
114-
${{ runner.os }}-yarn-
120+
${{ runner.os }}-pnpm-store-
121+
115122
- name: Install packages
116-
if: steps.npm-cache.outputs.cache-hit != 'true'
117-
run: yarn
123+
run: pnpm install --frozen-lockfile
124+
118125
- name: Run Build
119-
run: yarn build
126+
run: pnpm build
127+
120128
dependencies:
121129
runs-on: buildjet-4vcpu-ubuntu-2204
122130
container:
123-
image: node:16
131+
image: node:18
124132
steps:
125133
- name: Checkout
126134
uses: actions/checkout@v4
127-
- name: Cache node modules
128-
id: npm-cache
129-
uses: buildjet/cache@v3
130-
with:
131-
path: ~/.node_modules
132-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
133-
restore-keys: |
134-
${{ runner.os }}-node-
135-
- name: Cache yarn cache
136-
id: yarn-cache
135+
136+
- name: Enable Corepack
137+
id: pnpm-setup
138+
run: |
139+
corepack enable
140+
corepack prepare pnpm@latest --activate
141+
pnpm config set script-shell "/usr/bin/bash"
142+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
143+
144+
- name: pnpm Cache
137145
uses: buildjet/cache@v3
138146
with:
139-
path: ~/.cache/yarn
140-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
147+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
148+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
141149
restore-keys: |
142-
${{ runner.os }}-yarn-
150+
${{ runner.os }}-pnpm-store-
151+
143152
- name: Install packages
144-
if: steps.npm-cache.outputs.cache-hit != 'true'
145-
run: yarn
153+
run: pnpm install --frozen-lockfile
154+
146155
- name: Check for pinned dependencies
147156
run: |
148157
node -e '
@@ -151,6 +160,9 @@ jobs:
151160
const errors = [];
152161
153162
function isPinned(version) {
163+
if (version.startsWith("workspace:")) {
164+
return true;
165+
}
154166
return /^\d+\.\d+\.\d+$|^[a-z]+:[a-z]+@\d+$/.test(version);
155167
}
156168

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
## Contributing
2+
23
Wanna help? Awesome! There are many ways you can contribute.
34

45
## Improving the docs
6+
57
Documentation is extremely important and takes a fair deal of time and effort to write and keep updated. Everything is written in Markdown to facilitate the process of contributing.
68

79
## Building new components
10+
811
We’re open to expanding the catalog of components to cover as many use cases as possible. We suggest to open an issue for discussion first to make sure your idea is aligned with the project goals.
912

1013
## Opening issues
14+
1115
Open an issue to report bugs or to propose new features.
1216

1317
**- Reporting bugs:**
@@ -16,6 +20,7 @@ describe the bug as clearly as you can, including steps to reproduce, what happe
1620
**- Suggesting features:** explain the proposed feature, what it should do, why it is useful, how users should use it. Give us as much info as possible so it will be easier to discuss, access and implement the proposed feature. When you’re unsure about a certain aspect of the feature, feel free to leave it open for others to discuss and find an appropriate solution.
1721

1822
## Proposing pull requests
23+
1924
Pull requests are very welcome. Note that if you are going to propose drastic changes, be sure to open an issue for discussion first, to make sure that your PR will be accepted before you spend effort coding it.
2025

2126
**- Forking the repository:** clone it locally and create a branch for your proposed bug fix or new feature. Avoid working directly on the main branch.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ npm install @react-email/button -E
4141
Add the component to your email template. Include styles where needed.
4242

4343
```jsx
44-
import { Button } from '@react-email/button';
44+
import { Button } from "@react-email/button";
4545

4646
const Email = () => {
4747
return (
48-
<Button href="https://example.com" style={{ color: '#61dafb' }}>
48+
<Button href="https://example.com" style={{ color: "#61dafb" }}>
4949
Click me
5050
</Button>
5151
);
@@ -87,20 +87,20 @@ All components were tested using the most popular email clients.
8787

8888
| <img src="https://react.email/static/icons/gmail.svg" width="48px" height="48px" alt="Gmail logo"> | <img src="https://react.email/static/icons/apple-mail.svg" width="48px" height="48px" alt="Apple Mail"> | <img src="https://react.email/static/icons/outlook.svg" width="48px" height="48px" alt="Outlook logo"> | <img src="https://react.email/static/icons/yahoo-mail.svg" width="48px" height="48px" alt="Yahoo! Mail logo"> | <img src="https://react.email/static/icons/hey.svg" width="48px" height="48px" alt="HEY logo"> | <img src="https://react.email/static/icons/superhuman.svg" width="48px" height="48px" alt="Superhuman logo"> |
8989
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
90-
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
90+
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
9191

9292
## Development
9393

9494
#### Install dependencies
9595

9696
```sh
97-
yarn install
97+
pnpm install
9898
```
9999

100100
#### Build and run packages
101101

102102
```sh
103-
yarn dev
103+
pnpm dev
104104
```
105105

106106
This will initialize all packages in parallel and watch for changes, including the website which will be available at [localhost:3001](http://localhost:3001).

apps/web/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['custom/next'],
3+
};

apps/web/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

0 commit comments

Comments
 (0)