|
1 | 1 | # Template Testing |
2 | 2 |
|
3 | | -Tests the production version of the Open SaaS template that users get from `wasp new -t saas`. |
| 3 | +Tests the production version of the Open SaaS template that users get from `wasp new app -t saas`. |
4 | 4 |
|
5 | | -**Why this exists:** opensaas-sh tests `template/app` (current repo state), but `main` branch may differ from the last released template. This tests what users actually get from `wasp new -t saas`. |
| 5 | +**Why this exists:** As a part of our release checklist, we want to test that the production version of the Open SaaS template works. |
6 | 6 |
|
7 | | -**How it works:** Scripts run `wasp new -t saas` to get a fresh template, then apply minimal production patches (Dummy→SendGrid email, dotenv-vault for secrets). Tests that the template builds and runs with production email provider. |
| 7 | +**How it works:** We create a new Wasp app from the production Open SaaS template, and then modify the app to be production-ready (e.g. replace `Dummy` email service with `SMTP`, add Dotenv Vault with real credentials, etc.). |
8 | 8 |
|
9 | | -## Regular Usage |
| 9 | +## Testing a new Wasp release |
10 | 10 |
|
11 | 11 | When testing a new Wasp release: |
12 | 12 |
|
13 | 13 | ```bash |
14 | 14 | cd template-test |
| 15 | +# Create a new Wasp app and apply our patches to it. |
15 | 16 | ./tools/patch.sh |
16 | | -cd app && npm run env:pull |
17 | | -wasp start # or wasp build |
18 | | -``` |
19 | | - |
20 | | -## Initial Setup |
21 | | - |
22 | | -Only needed once to create the initial patches: |
23 | 17 |
|
24 | | -```bash |
25 | | -cd template-test |
26 | | -wasp new -t saas temp && cp -r temp/app/* app/ && rm -rf temp |
27 | | -cd app && git init && git add . |
| 18 | +cd app |
28 | 19 |
|
29 | | -# Edit main.wasp: change Dummy→SendGrid |
30 | | -# Setup dotenv-vault with working credentials |
| 20 | +# Get the environment variables from Dotenv Vault. |
| 21 | +npm run env:pull |
31 | 22 |
|
32 | | -cd .. && ./tools/diff.sh |
33 | | -git add app_diff/ && git commit -m "Add template-test patches" |
| 23 | +wasp db start |
| 24 | +wasp db migrate-dev |
| 25 | +wasp start |
34 | 26 | ``` |
35 | 27 |
|
36 | | -## Requirements |
| 28 | +### Workflow |
| 29 | + |
| 30 | +- Generate `app/` from template and diffs: `./tools/patch.sh` |
| 31 | +- Update diffs after modifying `app/`: `./tools/diff.sh` |
37 | 32 |
|
38 | | -MacOS users need: `brew install coreutils gpatch diffutils` |
| 33 | +For detailed information about the diff/patch workflow and MacOS setup requirements, see [../tools/README.md](../tools/README.md). |
0 commit comments