create-wervt 0.2.17 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wervt",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "Create a new wervt app: Nuxt 5, Postgres with Drizzle, live data with Electric.",
5
5
  "homepage": "https://wervt.app",
6
6
  "license": "MIT",
@@ -0,0 +1,67 @@
1
+ name: preview
2
+
3
+ # Deploys every pull request to its own preview, <app>--pr-<number>, and deletes it once the pull
4
+ # request is closed or merged. Uses the same WERVT_TOKEN and WERVT_URL as deploy.yml. A preview
5
+ # starts with an empty database, lets in who the app lets in and gets the app's env, with the
6
+ # preview env on top (`wervt env <app> --preview --set KEY=value`, or Preview variables in the
7
+ # dashboard). The pull request shows the preview's URL under Deployments.
8
+
9
+ on:
10
+ pull_request:
11
+ types: [opened, reopened, synchronize, closed]
12
+
13
+ # One run per pull request; a newer push or the close replaces a deploy still running.
14
+ concurrency:
15
+ group: preview-${{ github.event.pull_request.number }}
16
+ cancel-in-progress: true
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ deploy:
23
+ # Pull requests from forks get no secrets, and their code shouldn't get the app's env anyway.
24
+ if: github.event.action != 'closed' && github.event.pull_request.head.repo.full_name == github.repository
25
+ runs-on: ubuntu-latest
26
+ environment:
27
+ name: preview
28
+ url: ${{ steps.deploy.outputs.url }}
29
+ steps:
30
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+
32
+ # The pnpm version comes from packageManager in package.json.
33
+ - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
34
+
35
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
36
+ with:
37
+ node-version: 24
38
+ cache: pnpm
39
+
40
+ - run: pnpm install --frozen-lockfile
41
+
42
+ - id: deploy
43
+ run: pnpm exec wervt deploy --preview pr-${{ github.event.pull_request.number }}
44
+ env:
45
+ WERVT_URL: ${{ vars.WERVT_URL }}
46
+ WERVT_TOKEN: ${{ secrets.WERVT_TOKEN }}
47
+
48
+ remove:
49
+ if: github.event.action == 'closed' && github.event.pull_request.head.repo.full_name == github.repository
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
53
+
54
+ - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
55
+
56
+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
57
+ with:
58
+ node-version: 24
59
+ cache: pnpm
60
+
61
+ - run: pnpm install --frozen-lockfile
62
+
63
+ # Drops the preview's database and files too. A preview that never deployed is fine.
64
+ - run: pnpm exec wervt delete --preview pr-${{ github.event.pull_request.number }} --yes || true
65
+ env:
66
+ WERVT_URL: ${{ vars.WERVT_URL }}
67
+ WERVT_TOKEN: ${{ secrets.WERVT_TOKEN }}
@@ -473,6 +473,12 @@ Queries are LogsQL. Logs may contain user data: quote only what's needed.
473
473
  - Deploys: pushing to `main` deploys through `.github/workflows/deploy.yml`.
474
474
  `pnpm exec wervt releases <app>` lists releases with their commits. Don't deploy, roll back or
475
475
  create deploy tokens unless asked.
476
+ - Pull requests get a preview at `https://<app>--pr-<number>.wervt.app`
477
+ (`.github/workflows/preview.yml`), deleted when the pull request closes. It has its own empty
478
+ database (seed it with `pnpm exec wervt tasks <app>--pr-<number> --run db:seed`), the app's
479
+ access rules and env, with preview-only values on top:
480
+ `pnpm exec wervt env <app> --preview --set NUXT_<KEY>=…` (from the previews' next deploy).
481
+ Test changes on a preview instead of deploying them to production.
476
482
 
477
483
  ## Checking the deployed app
478
484
 
@@ -10,7 +10,7 @@
10
10
  "postinstall": "nuxt prepare"
11
11
  },
12
12
  "dependencies": {
13
- "@wervt/nuxt": "^0.3.7",
13
+ "@wervt/nuxt": "^0.3.11",
14
14
  "drizzle-orm": "1.0.0-rc.5",
15
15
  "nuxt": "npm:nuxt-nightly@5x",
16
16
  "valibot": "^1.5.0",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@golar/vue": "^0.1.11",
21
- "@wervt/cli": "^0.2.17",
21
+ "@wervt/cli": "^0.2.19",
22
22
  "drizzle-kit": "1.0.0-rc.5",
23
23
  "golar": "^0.1.11",
24
24
  "vite-plus": "^1.3.0"