Updates for Wasp 0.15.0 (#255)

* Bumps Prisma to v5

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>

* Update Prisma to 5.19.1

* Update for React Router v6

* Update types dep

* Update Prisma version

* Update package-lock.json

* update docs

* Update main.wasp.diff

* Add type: module

* Updated app_diff with type:module change from package.json.

* Updated version of Wasp in CI to 0.15.0-rc2.

* Removed type:module from e2e-tests/package.json.

---------

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Co-authored-by: vincanger <70215737+vincanger@users.noreply.github.com>
Co-authored-by: Filip Sodić <filip.sodic@fer.hr>
Co-authored-by: Martin Sosic <sosic.martin@gmail.com>
This commit is contained in:
Mihovil Ilakovac
2024-10-10 18:13:48 +02:00
committed by GitHub
parent e7cf1ee582
commit 8a368532b4
31 changed files with 2190 additions and 1398 deletions

View File

@@ -10,7 +10,7 @@ on:
env: env:
WASP_TELEMETRY_DISABLE: 1 WASP_TELEMETRY_DISABLE: 1
WASP_VERSION: 0.14.0 WASP_VERSION: 0.15.0-rc2
jobs: jobs:
test: test:
@@ -56,7 +56,7 @@ jobs:
run: | run: |
./tools/patch.sh ./tools/patch.sh
- name: "[e2e-tests] Install Node.js dependencies for Playwright tests" - name: '[e2e-tests] Install Node.js dependencies for Playwright tests'
if: steps.cache-e2e-tests.outputs.cache-hit != 'true' if: steps.cache-e2e-tests.outputs.cache-hit != 'true'
working-directory: ./template working-directory: ./template
run: | run: |
@@ -78,14 +78,14 @@ jobs:
path: ~/.cache/ms-playwright path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}-${{ runner.os }} key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}-${{ runner.os }}
- name: "[e2e-tests] Set up Playwright" - name: '[e2e-tests] Set up Playwright'
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
working-directory: ./template working-directory: ./template
run: | run: |
cd e2e-tests cd e2e-tests
npx playwright install --with-deps npx playwright install --with-deps
- name: "[e2e-tests] Install Stripe CLI" - name: '[e2e-tests] Install Stripe CLI'
run: | run: |
curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg
echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list
@@ -95,13 +95,13 @@ jobs:
# For Stripe webhooks to work in development, we need to run the Stripe CLI to listen for webhook events. # For Stripe webhooks to work in development, we need to run the Stripe CLI to listen for webhook events.
# The Stripe CLI will receive the webhook events from Stripe test payments and # The Stripe CLI will receive the webhook events from Stripe test payments and
# forward them to our local server so that we can test the payment flow in our e2e tests. # forward them to our local server so that we can test the payment flow in our e2e tests.
- name: "[e2e-tests] Run Stripe CLI to listen for webhooks" - name: '[e2e-tests] Run Stripe CLI to listen for webhooks'
env: env:
STRIPE_DEVICE_NAME: ${{ secrets.STRIPE_DEVICE_NAME }} STRIPE_DEVICE_NAME: ${{ secrets.STRIPE_DEVICE_NAME }}
run: | run: |
stripe listen --api-key ${{ secrets.STRIPE_KEY }} --forward-to localhost:3001/payments-webhook & stripe listen --api-key ${{ secrets.STRIPE_KEY }} --forward-to localhost:3001/payments-webhook &
- name: "[e2e-tests] Run Playwright tests" - name: '[e2e-tests] Run Playwright tests'
env: env:
# The e2e tests are testing parts of the app that need certain env vars, so we need to access them here. # The e2e tests are testing parts of the app that need certain env vars, so we need to access them here.
# These secretes can be set in your GitHub repo settings, e.g. https://github.com/<account>/<repo>/settings/secrets/actions # These secretes can be set in your GitHub repo settings, e.g. https://github.com/<account>/<repo>/settings/secrets/actions

View File

@@ -14,8 +14,8 @@ Since the demo app is just the open saas template with some small tweaks, and we
So because we don't version the actual demo app (`app/`) but its diffs instead (`app_diff`), the typical workflow is as follows: So because we don't version the actual demo app (`app/`) but its diffs instead (`app_diff`), the typical workflow is as follows:
1. Run `./tools/patch.sh` to generate `app/` from `../template/` and `app_diff/`. 1. Run `./tools/patch.sh` to generate `app/` from `../template/` and `app_diff/`.
2. If there are any conflicts (normally due to updates to the template), modify `app_diff/` till you resolve them. 2. If there are any conflicts (normally due to updates to the template), modify `app/` till you resolve them. Do any additional changes also if you wish.
3. Make any changes in the `app/` if you wish, and then generate new `app_diff/` by running `./tools/diff.sh`. 3. Generate new `app_diff/`, based on the current updated `app/`, by running `./tools/diff.sh`.
> [!WARNING] > [!WARNING]
> If you're running the `patch.sh` or `diff.sh` scripts on Mac, you need to have `grealpath` (packaged within `coreutils`) and `gpatch` installed. You should also create aliases for `realpath` and `patch`: > If you're running the `patch.sh` or `diff.sh` scripts on Mac, you need to have `grealpath` (packaged within `coreutils`) and `gpatch` installed. You should also create aliases for `realpath` and `patch`:

View File

@@ -11,16 +11,16 @@
+DOTENV_VAULT_DEVELOPMENT_VERSION=12 +DOTENV_VAULT_DEVELOPMENT_VERSION=12
+ +
+# ci +# ci
+DOTENV_VAULT_CI="2d/o/GNlLDr4CLqJdyEeusuZxMCIJw7lfqOmnC8TWMpqS+GMGHEUAQqssLTseFlEXWs9OIzxBaZosMter6cUOTcPri0yyGeIbrjqVjZHasmZ6f2fE6DtA6f/tzxuNOGwX186i9qQFRyE3oVUbzs1NLvbdSH5uGADJRZTaFD03BUbkWL01SoySWRWXQpZ88ZOENdfg4reaFTVsdb3auDW7pn19xUt+PnuZkupaXOVWScrM2kDdCC6njuovPRWBt5jgYcOEXSCwEhvRBcfd4kjEVT2Q5CJAvY3CGi9oVlw5164Y7jpShG8Yw+7FtwuIJYcQjXmMNG71j1JE+up8dPGi/vjP6EUFzbPguxzu7QtSMPoDgIcmA+OcrJA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3KZZs6YlSXyukklehkjtYoMM2TaZ478ioFOtD8yx12PjI3Pfoapo2La2boM48RFcipmVNpWNsLjGXaYyhYVV3RBsZAMvkOnYRVFUiZ50+ETdfizX0H23+mmkBt8FjNqHhvg9BIRaYnKTar1FPAd840lo4w2e7n2mKufHwykI5ILrJV0ozhPy7Yr8kltPiQYjpy1ua2scUdnKCngdX0KjqNQz072e6uYlhRpOib6CEwZXqMbr/"
+DOTENV_VAULT_STAGING_VERSION=7 +DOTENV_VAULT_STAGING_VERSION=8
+ +
+# production +# production
+DOTENV_VAULT_PRODUCTION="tnCGeONjuw95xeIn1a/07iux4KekBaVVjCZ6Rf9CKWnV/jRojO1rbF2zJLpSdAY1FoSgiZhUntnyJNGJBdx3QlCD2o5MSkNKtBre0W6rHj825ZgoICRuz2cwfWq5WVEPiPA16uZhHdujbnWfR646tTnkMb6LN+1wPpwuetwsHBEXabMG/7H2UT20XUChtzzm+qFmFPTg2dcS62xyXnJM1NvU5vL8D1By9Jc4uYezrIgFvPKENky6mg3S1uQhqRyzcSxLG1+amC18q1c0bOzgGJoJ5j06tbGvSES7aY09gKlNjduPstAWABoCBFQScPqgi/DttxjW2GDdOS0csOaWDAsgT9wHzrzdFTAEXKFHBUxebIlNvwOvX1ME+hPlHeBcicHHfDLbcFbj3L/2Su19KzmD4LOAcApZrkoQwrWIZE7KkluetQXIRHiDKAA4cd+UXHQe6PURT7ObiX7zHNXPM6shSSAPa6iWMOMZndM4CAUZJrzYYMnlZ1D9MCkMZTN608+f2A8JsbmbceUbLeiHpXtpmLkvkKb1pJ9uKQP38VGBQtqylcfStpEVOPX67VV/U88+BZu8E8+am072mb+fvrT+yNqmcNm6byo1+48Y96QN8i1J3qerrv3kcVWDbNKQEgyOG7UJEe2JXEFnLXYdnph10X7KAlsmfVacY8quXB8tIWdx2LbBTAB6zokifoLq5rikbXjFUKw0q0vREIspy5vtoKNDyttbc6Emsy+J/sHlS8c1TKdu1bQRPlMyoANCBVZpNuV9FRSSKJR0j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P/xBBOHqzoUs3gVk4HTMDfpYwO9k9SJNkfWBn1iV102BJ"
+DOTENV_VAULT_PRODUCTION_VERSION=7 +DOTENV_VAULT_PRODUCTION_VERSION=8
+ +
+#/----------------settings/metadata-----------------/ +#/----------------settings/metadata-----------------/
+DOTENV_VAULT="vlt_47e3eeb0730e831e688049600e59f8975260a1f00302ae08684ed87ba67872d0" +DOTENV_VAULT="vlt_47e3eeb0730e831e688049600e59f8975260a1f00302ae08684ed87ba67872d0"

View File

@@ -1,7 +1,7 @@
--- template/app/main.wasp --- template/app/main.wasp
+++ opensaas-sh/app/main.wasp +++ opensaas-sh/app/main.wasp
@@ -3,24 +3,24 @@ @@ -3,24 +3,24 @@
version: "^0.14.0" version: "^0.15.0"
}, },
- title: "My Open SaaS App", - title: "My Open SaaS App",

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,9 @@
--- template/app/package.json --- template/app/package.json
+++ opensaas-sh/app/package.json +++ opensaas-sh/app/package.json
@@ -1,12 +1,16 @@ @@ -1,13 +1,17 @@
{ {
"name": "opensaas", "name": "opensaas",
"type": "module",
+ "scripts": { + "scripts": {
+ "env:pull": "npx dotenv-vault@latest pull development .env.server", + "env:pull": "npx dotenv-vault@latest pull development .env.server",
+ "env:push": "npx dotenv-vault@latest push development .env.server", + "env:push": "npx dotenv-vault@latest push development .env.server",

View File

@@ -3,7 +3,7 @@
@@ -1,8 +1,14 @@ @@ -1,8 +1,14 @@
-import { Link } from 'react-router-dom'; -import { Link } from 'react-router-dom';
-import { LoginForm } from 'wasp/client/auth'; -import { LoginForm } from 'wasp/client/auth';
+import { Redirect, Link } from 'react-router-dom'; +import { Navigate, Link } from 'react-router-dom';
+import { LoginForm, useAuth } from 'wasp/client/auth'; +import { LoginForm, useAuth } from 'wasp/client/auth';
import { AuthPageLayout } from './AuthPageLayout'; import { AuthPageLayout } from './AuthPageLayout';
@@ -11,7 +11,7 @@
+ const { data: user } = useAuth(); + const { data: user } = useAuth();
+ +
+ if (user) { + if (user) {
+ return <Redirect to='/demo-app' />; + return <Navigate to='/demo-app' />;
+ } + }
+ +
return ( return (

View File

@@ -2,7 +2,7 @@
title: Admin Dashboard title: Admin Dashboard
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This is a reference on how the Admin dashboard is set up and works. This is a reference on how the Admin dashboard is set up and works.

View File

@@ -2,7 +2,7 @@
title: User Overview title: User Overview
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This reference will help you understand how the User entity works in this template. This reference will help you understand how the User entity works in this template.

View File

@@ -2,7 +2,7 @@
title: Analytics title: Analytics
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will show you how to integrate analytics for your app. You can choose between [Google Analytics](#google-analytics) and [Plausible](#plausible). This guide will show you how to integrate analytics for your app. You can choose between [Google Analytics](#google-analytics) and [Plausible](#plausible).

View File

@@ -2,7 +2,7 @@
title: Authentication title: Authentication
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
Setting up your app's authentication is easy with Wasp. In fact, it's already set up for you in the `main.wasp` file: Setting up your app's authentication is easy with Wasp. In fact, it's already set up for you in the `main.wasp` file:

View File

@@ -2,7 +2,7 @@
title: Authorization title: Authorization
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will help you get started with authorization in your SaaS app. This guide will help you get started with authorization in your SaaS app.

View File

@@ -2,7 +2,7 @@
title: Cookie Consent Modal title: Cookie Consent Modal
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
<img src="/cookie-consent/cookiebanner.png" alt="cookie banner" width="400px" /> <img src="/cookie-consent/cookiebanner.png" alt="cookie banner" width="400px" />

View File

@@ -2,7 +2,7 @@
title: Deploying title: Deploying
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
Because this SaaS app is a React/NodeJS/Postgres app built on top of [Wasp](https://wasp-lang.dev), we will direct you to the [Wasp Deployment Guide](https://wasp-lang.dev/docs/advanced/deployment/overview/) for more detailed instructions, except for where the instructions are specific to this template. Because this SaaS app is a React/NodeJS/Postgres app built on top of [Wasp](https://wasp-lang.dev), we will direct you to the [Wasp Deployment Guide](https://wasp-lang.dev/docs/advanced/deployment/overview/) for more detailed instructions, except for where the instructions are specific to this template.

View File

@@ -2,7 +2,7 @@
title: Email Sending title: Email Sending
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
import { Tabs, TabItem } from '@astrojs/starlight/components'; import { Tabs, TabItem } from '@astrojs/starlight/components';

View File

@@ -2,7 +2,7 @@
title: File Uploading title: File Uploading
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will show you how to set up file uploading in your SaaS app. This guide will show you how to set up file uploading in your SaaS app.

View File

@@ -2,7 +2,7 @@
title: Payments Integration title: Payments Integration
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will show you how to set up Payments for testing and local development with the following payment processors: This guide will show you how to set up Payments for testing and local development with the following payment processors:

View File

@@ -2,7 +2,7 @@
title: SEO title: SEO
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guides explains how to improve SEO for of your app This guides explains how to improve SEO for of your app

View File

@@ -2,7 +2,7 @@
title: Tests title: Tests
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will show you how to use the included end-to-end (e2e) tests for your Open SaaS application. This guide will show you how to use the included end-to-end (e2e) tests for your Open SaaS application.

View File

@@ -2,7 +2,7 @@
title: Introduction title: Introduction
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
## Welcome to your new SaaS App! ## Welcome to your new SaaS App!

View File

@@ -2,7 +2,7 @@
title: Getting Started title: Getting Started
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
This guide will help you get your new SaaS app up and running. This guide will help you get your new SaaS app up and running.

View File

@@ -2,7 +2,7 @@
title: Guided Tour title: Guided Tour
banner: banner:
content: | content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a> 🆕 Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
--- ---
Awesome, you now have your very own SaaS app up and running! But, first, here are some important things you need to know about your app in its current state: Awesome, you now have your very own SaaS app up and running! But, first, here are some important things you need to know about your app in its current state:

View File

@@ -1,6 +1,6 @@
app OpenSaaS { app OpenSaaS {
wasp: { wasp: {
version: "^0.14.0" version: "^0.15.0"
}, },
title: "My Open SaaS App", title: "My Open SaaS App",

View File

@@ -1,5 +1,6 @@
{ {
"name": "opensaas", "name": "opensaas",
"type": "module",
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.523.0", "@aws-sdk/client-s3": "^3.523.0",
"@aws-sdk/s3-request-presigner": "^3.523.0", "@aws-sdk/s3-request-presigner": "^3.523.0",
@@ -29,8 +30,7 @@
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"@types/react": "^18.0.37", "@types/react": "^18.0.37",
"@types/react-router-dom": "^5.3.3", "prisma": "5.19.1",
"prisma": "4.16.2",
"typescript": "^5.1.0", "typescript": "^5.1.0",
"vite": "^4.3.9" "vite": "^4.3.9"
} }

View File

@@ -103,8 +103,8 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
{/* <!-- Menu Item Dashboard --> */} {/* <!-- Menu Item Dashboard --> */}
<NavLink <NavLink
to='/admin' to='/admin'
isActive={(_match, location) => location.pathname === '/admin'} end
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
{ {
@@ -147,7 +147,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/users' to='/admin/users'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
{ {
@@ -185,7 +185,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/settings' to='/admin/settings'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
{ {
@@ -234,7 +234,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/chart' to='/admin/chart'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
{ {
@@ -279,15 +279,12 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<React.Fragment> <React.Fragment>
<NavLink <NavLink
to='#' to='#'
isActive={(_match, location) => location.pathname.includes('forms')} className={cn(
className={(isActive) => 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
cn( {
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'bg-gray-700 dark:bg-meta-4': pathname.includes('forms'),
{ }
'bg-gray-700 dark:bg-meta-4': isActive, )}
}
)
}
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
sidebarExpanded ? handleClick() : setSidebarExpanded(true); sidebarExpanded ? handleClick() : setSidebarExpanded(true);
@@ -347,7 +344,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/forms/form-elements' to='/admin/forms/form-elements'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white', 'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white',
{ '!text-white': isActive } { '!text-white': isActive }
@@ -360,7 +357,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/forms/form-layouts' to='/admin/forms/form-layouts'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white', 'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white',
{ '!text-white': isActive } { '!text-white': isActive }
@@ -383,7 +380,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/calendar' to='/admin/calendar'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
{ {
@@ -417,15 +414,12 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<React.Fragment> <React.Fragment>
<NavLink <NavLink
to='#' to='#'
isActive={(_match, location) => location.pathname.includes('ui')} className={cn(
className={(isActive) => 'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4',
cn( {
'group relative flex items-center gap-2.5 rounded-sm py-2 px-4 font-medium text-bodydark1 duration-300 ease-in-out hover:bg-gray-700 dark:hover:bg-meta-4', 'bg-gray-700 dark:bg-meta-4': pathname.includes('ui'),
{ }
'bg-gray-700 dark:bg-meta-4': isActive, )}
}
)
}
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
sidebarExpanded ? handleClick() : setSidebarExpanded(true); sidebarExpanded ? handleClick() : setSidebarExpanded(true);
@@ -484,7 +478,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/ui/alerts' to='/admin/ui/alerts'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white', 'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white',
{ '!text-white': isActive } { '!text-white': isActive }
@@ -497,7 +491,7 @@ const Sidebar = ({ sidebarOpen, setSidebarOpen }: SidebarProps) => {
<li> <li>
<NavLink <NavLink
to='/admin/ui/buttons' to='/admin/ui/buttons'
className={(isActive) => className={({ isActive }) =>
cn( cn(
'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white', 'group relative flex items-center gap-2.5 rounded-md px-4 font-medium text-bodydark2 duration-300 ease-in-out hover:text-white',
{ '!text-white': isActive } { '!text-white': isActive }

View File

@@ -1,13 +1,13 @@
import { type AuthUser } from 'wasp/auth'; import { type AuthUser } from 'wasp/auth';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useHistory } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
export function useRedirectHomeUnlessUserIsAdmin({ user }: { user: AuthUser }) { export function useRedirectHomeUnlessUserIsAdmin({ user }: { user: AuthUser }) {
const history = useHistory(); const navigate = useNavigate();
useEffect(() => { useEffect(() => {
if (!user.isAdmin) { if (!user.isAdmin) {
history.push('/'); navigate('/');
} }
}, [user, history]); }, [user, history]);
} }

View File

@@ -4,13 +4,13 @@ import './Main.css';
import AppNavBar from './components/AppNavBar'; import AppNavBar from './components/AppNavBar';
import CookieConsentBanner from './components/cookie-consent/Banner'; import CookieConsentBanner from './components/cookie-consent/Banner';
import { useMemo, useEffect, ReactNode } from 'react'; import { useMemo, useEffect, ReactNode } from 'react';
import { useLocation } from 'react-router-dom'; import { Outlet, useLocation } from 'react-router-dom';
/** /**
* use this component to wrap all child components * use this component to wrap all child components
* this is useful for templates, themes, and context * this is useful for templates, themes, and context
*/ */
export default function App({ children }: { children: ReactNode }) { export default function App() {
const location = useLocation(); const location = useLocation();
const { data: user } = useAuth(); const { data: user } = useAuth();
@@ -46,11 +46,13 @@ export default function App({ children }: { children: ReactNode }) {
<> <>
<div className='min-h-screen dark:text-white dark:bg-boxdark-2'> <div className='min-h-screen dark:text-white dark:bg-boxdark-2'>
{isAdminDashboard ? ( {isAdminDashboard ? (
<>{children}</> <Outlet />
) : ( ) : (
<> <>
{shouldDisplayAppNavBar && <AppNavBar />} {shouldDisplayAppNavBar && <AppNavBar />}
<div className='mx-auto max-w-7xl sm:px-6 lg:px-8'>{children}</div> <div className='mx-auto max-w-7xl sm:px-6 lg:px-8'>
<Outlet />
</div>
</> </>
)} )}
</div> </div>

View File

@@ -1,16 +1,16 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useHistory, useLocation } from 'react-router-dom'; import { useNavigate, useLocation } from 'react-router-dom';
export default function CheckoutPage() { export default function CheckoutPage() {
const [paymentStatus, setPaymentStatus] = useState('loading'); const [paymentStatus, setPaymentStatus] = useState('loading');
const history = useHistory(); const navigate = useNavigate();
const location = useLocation(); const location = useLocation();
useEffect(() => { useEffect(() => {
function delayedRedirect() { function delayedRedirect() {
return setTimeout(() => { return setTimeout(() => {
history.push('/account'); navigate('/account');
}, 4000); }, 4000);
} }
@@ -23,7 +23,7 @@ export default function CheckoutPage() {
} else if (isSuccess) { } else if (isSuccess) {
setPaymentStatus('paid'); setPaymentStatus('paid');
} else { } else {
history.push('/account'); navigate('/account');
} }
delayedRedirect(); delayedRedirect();
return () => { return () => {

View File

@@ -3,7 +3,7 @@ import { generateCheckoutSession, getCustomerPortalUrl, useQuery } from 'wasp/cl
import { PaymentPlanId, paymentPlans, prettyPaymentPlanName } from './plans'; import { PaymentPlanId, paymentPlans, prettyPaymentPlanName } from './plans';
import { AiFillCheckCircle } from 'react-icons/ai'; import { AiFillCheckCircle } from 'react-icons/ai';
import { useState } from 'react'; import { useState } from 'react';
import { useHistory } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { cn } from '../client/cn'; import { cn } from '../client/cn';
const bestDealPaymentPlanId: PaymentPlanId = PaymentPlanId.Pro; const bestDealPaymentPlanId: PaymentPlanId = PaymentPlanId.Pro;
@@ -48,11 +48,11 @@ const PricingPage = () => {
error: customerPortalUrlError, error: customerPortalUrlError,
} = useQuery(getCustomerPortalUrl, { enabled: isUserSubscribed }); } = useQuery(getCustomerPortalUrl, { enabled: isUserSubscribed });
const history = useHistory(); const navigate = useNavigate();
async function handleBuyNowClick(paymentPlanId: PaymentPlanId) { async function handleBuyNowClick(paymentPlanId: PaymentPlanId) {
if (!user) { if (!user) {
history.push('/login'); navigate('/login');
return; return;
} }
try { try {
@@ -73,7 +73,7 @@ const PricingPage = () => {
const handleCustomerPortalClick = () => { const handleCustomerPortalClick = () => {
if (!user) { if (!user) {
history.push('/login'); navigate('/login');
return; return;
} }

View File

@@ -10,9 +10,9 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@playwright/test": "^1.42.1", "@playwright/test": "^1.42.1",
"@prisma/client": "^4.16.2", "@prisma/client": "5.19.1",
"linebyline": "^1.3.0", "linebyline": "^1.3.0",
"prisma": "^4.16.2" "prisma": "5.19.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.0.0" "@types/node": "^18.0.0"
@@ -33,15 +33,13 @@
} }
}, },
"node_modules/@prisma/client": { "node_modules/@prisma/client": {
"version": "4.16.2", "version": "5.19.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.16.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.19.1.tgz",
"integrity": "sha512-qCoEyxv1ZrQ4bKy39GnylE8Zq31IRmm8bNhNbZx7bF2cU5aiCCnSa93J2imF88MBjn7J9eUQneNxUQVJdl/rPQ==", "integrity": "sha512-x30GFguInsgt+4z5I4WbkZP2CGpotJMUXy+Gl/aaUjHn2o1DnLYNTA+q9XdYmAQZM8fIIkvUiA2NpgosM3fneg==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "license": "Apache-2.0",
"@prisma/engines-version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81"
},
"engines": { "engines": {
"node": ">=14.17" "node": ">=16.13"
}, },
"peerDependencies": { "peerDependencies": {
"prisma": "*" "prisma": "*"
@@ -52,16 +50,50 @@
} }
} }
}, },
"node_modules/@prisma/debug": {
"version": "5.19.1",
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.19.1.tgz",
"integrity": "sha512-lAG6A6QnG2AskAukIEucYJZxxcSqKsMK74ZFVfCTOM/7UiyJQi48v6TQ47d6qKG3LbMslqOvnTX25dj/qvclGg==",
"license": "Apache-2.0"
},
"node_modules/@prisma/engines": { "node_modules/@prisma/engines": {
"version": "4.16.2", "version": "5.19.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.16.2.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.19.1.tgz",
"integrity": "sha512-vx1nxVvN4QeT/cepQce68deh/Turxy5Mr+4L4zClFuK1GlxN3+ivxfuv+ej/gvidWn1cE1uAhW7ALLNlYbRUAw==", "integrity": "sha512-kR/PoxZDrfUmbbXqqb8SlBBgCjvGaJYMCOe189PEYzq9rKqitQ2fvT/VJ8PDSe8tTNxhc2KzsCfCAL+Iwm/7Cg==",
"hasInstallScript": true "hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "5.19.1",
"@prisma/engines-version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3",
"@prisma/fetch-engine": "5.19.1",
"@prisma/get-platform": "5.19.1"
}
}, },
"node_modules/@prisma/engines-version": { "node_modules/@prisma/engines-version": {
"version": "4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81", "version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.16.1-1.4bc8b6e1b66cb932731fb1bdbbc550d1e010de81.tgz", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3.tgz",
"integrity": "sha512-q617EUWfRIDTriWADZ4YiWRZXCa/WuhNgLTVd+HqWLffjMSPzyM5uOWoauX91wvQClSKZU4pzI4JJLQ9Kl62Qg==" "integrity": "sha512-xR6rt+z5LnNqTP5BBc+8+ySgf4WNMimOKXRn6xfNRDSpHvbOEmd7+qAOmzCrddEc4Cp8nFC0txU14dstjH7FXA==",
"license": "Apache-2.0"
},
"node_modules/@prisma/fetch-engine": {
"version": "5.19.1",
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.19.1.tgz",
"integrity": "sha512-pCq74rtlOVJfn4pLmdJj+eI4P7w2dugOnnTXpRilP/6n5b2aZiA4ulJlE0ddCbTPkfHmOL9BfaRgA8o+1rfdHw==",
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "5.19.1",
"@prisma/engines-version": "5.19.1-2.69d742ee20b815d88e17e54db4a2a7a3b30324e3",
"@prisma/get-platform": "5.19.1"
}
},
"node_modules/@prisma/get-platform": {
"version": "5.19.1",
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.19.1.tgz",
"integrity": "sha512-sCeoJ+7yt0UjnR+AXZL7vXlg5eNxaFOwC23h0KvW1YIXUoa7+W2ZcAUhoEQBmJTW4GrFqCuZ8YSP0mkDa4k3Zg==",
"license": "Apache-2.0",
"dependencies": {
"@prisma/debug": "5.19.1"
}
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.19.24", "version": "18.19.24",
@@ -119,19 +151,36 @@
} }
}, },
"node_modules/prisma": { "node_modules/prisma": {
"version": "4.16.2", "version": "5.19.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.16.2.tgz", "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.19.1.tgz",
"integrity": "sha512-SYCsBvDf0/7XSJyf2cHTLjLeTLVXYfqp7pG5eEVafFLeT0u/hLFz/9W196nDRGUOo1JfPatAEb+uEnTQImQC1g==", "integrity": "sha512-c5K9MiDaa+VAAyh1OiYk76PXOme9s3E992D7kvvIOhCrNsBQfy2mP2QAQtX0WNj140IgG++12kwZpYB9iIydNQ==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"@prisma/engines": "4.16.2" "@prisma/engines": "5.19.1"
}, },
"bin": { "bin": {
"prisma": "build/index.js", "prisma": "build/index.js"
"prisma2": "build/index.js"
}, },
"engines": { "engines": {
"node": ">=14.17" "node": ">=16.13"
},
"optionalDependencies": {
"fsevents": "2.3.3"
}
},
"node_modules/prisma/node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {

View File

@@ -24,9 +24,9 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@playwright/test": "^1.42.1", "@playwright/test": "^1.42.1",
"@prisma/client": "^4.16.2", "@prisma/client": "5.19.1",
"linebyline": "^1.3.0", "linebyline": "^1.3.0",
"prisma": "^4.16.2" "prisma": "5.19.1"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.0.0" "@types/node": "^18.0.0"