create-wervt 0.2.20 → 0.2.21

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.20",
3
+ "version": "0.2.21",
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",
@@ -115,6 +115,10 @@ const rows = await useDb().select().from(todos).where(eq(todos.done, false))
115
115
  schema** (no `pgSchema`): the app's role only sees its own schema.
116
116
  - After changing `server/db/schema.ts`, run `pnpm db:generate` and commit the new folder in
117
117
  `drizzle/`. Never edit generated migrations. Migrations run on deploy and on `nuxt dev`.
118
+ - Renaming a table or column in the schema can generate a `DROP` and a new one. Check the generated
119
+ SQL for `DROP TABLE`, `DROP COLUMN` and `TRUNCATE`. `wervt deploy` refuses migrations that would
120
+ delete rows and prints the `--allow-drop TABLE=ROWS` command to deploy anyway; run it only when
121
+ losing that data is intended, never just to get the deploy through.
118
122
  - Don't read `DATABASE_URL` yourself and don't create other clients. Use `useDb()`.
119
123
  - For relational queries (`db.query.rooms.findFirst({ with: … })`), define relations with
120
124
  `defineRelations` in `server/db/relations.ts` and use `useDb({ relations })`.
@@ -191,8 +195,11 @@ version polling. For a banner in the app's own design, set `wervt: { updates: 'm
191
195
  apps only when the visitor signed in. It works with `ssr: false` too (no own `/api/me` needed). Link to `wervtLoginUrl(path)` / `wervtLogoutUrl(path)` as
192
196
  external links. Never build your own login or OAuth.
193
197
  - Name, picture and email change on wervt's account page: link to `wervtAccountUrl(path)`
194
- (external), which shows it in the app's look and comes back. Don't build forms that change
195
- them; keep app-only profile data (bio, display name) in the app's tables under `user.id`.
198
+ (external), which shows it in the app's look and comes back. Keep app-only profile data (bio,
199
+ display name) in the app's tables under `user.id`. Only if an admin allowed the app the profile
200
+ API (dashboard, the app's Access page) may it change name and picture itself, with
201
+ `useWervtProfile(event).setName(name)` / `.setImage(bytes)` / `.removeImage()` from
202
+ `@wervt/nuxt/server`. The email address always stays on the account page.
196
203
  - Users are one row per wervt account: key them by `user.id`, not by email (addresses change).
197
204
  When an admin merges two accounts of the same person, wervt runs the task
198
205
  `wervt:account-merged` (`server/tasks/wervt/account-merged.ts`) with
@@ -203,6 +210,10 @@ version polling. For a banner in the app's own design, set `wervt: { updates: 'm
203
210
  `allowed` or `public`. Guard the app's admin features with
204
211
  `requireWervtRole(event, 'owner', 'member', 'admin')` from `@wervt/nuxt/server`; don't keep
205
212
  admin emails in env variables.
213
+ - Under `pnpm dev`, `/_wervt/login` signs in the dev user (the app's owner).
214
+ `/_wervt/login?as=alice&role=member&redirect=/` signs in another user with a role instead: test
215
+ role checks and multi-user flows with one persona per browser context (Playwright), e.g. `alice`
216
+ as `member` and `bob` as `public`. Plain `/_wervt/login` switches back.
206
217
  - Private apps show a link preview to visitors without a login (chats unfurling a shared link):
207
218
  only the app name and icon unless `wervt: { preview: { title, description, image: '/og.png' } }`
208
219
  is set (`true` takes them from `app.head`; `false` turns it off). Put the image (1200×630) in
@@ -485,6 +496,11 @@ Queries are LogsQL. Logs may contain user data: quote only what's needed.
485
496
  - Deploys: pushing to `main` deploys through `.github/workflows/deploy.yml`.
486
497
  `pnpm exec wervt releases <app>` lists releases with their commits. Don't deploy, roll back or
487
498
  create deploy tokens unless asked.
499
+ - Data of the deployed app: `pnpm exec wervt db sql <app> "select …"` runs one read-only
500
+ statement, `pnpm exec wervt db export <app> --out before.json` dumps the tables (`--format sql`
501
+ for inserts), and `pnpm exec wervt storage list|get|put <app> …` works with the app's files.
502
+ Export before changes that touch data. Don't run `db sql --write`, `storage put` over existing
503
+ files or `storage delete` unless asked.
488
504
  - Pull requests get a preview at `https://<app>--pr-<number>.wervt.app`
489
505
  (`.github/workflows/preview.yml`), deleted when the pull request closes. It has its own empty
490
506
  database (seed it with `pnpm exec wervt tasks <app>--pr-<number> --run db:seed`), the app's
@@ -10,7 +10,7 @@
10
10
  "postinstall": "nuxt prepare"
11
11
  },
12
12
  "dependencies": {
13
- "@wervt/nuxt": "^0.3.21",
13
+ "@wervt/nuxt": "^0.3.26",
14
14
  "drizzle-orm": "1.0.0-rc.5",
15
15
  "nuxt": "npm:nuxt-nightly@5x",
16
16
  "valibot": "^1.5.0",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@golar/vue": "^0.1.11",
22
- "@wervt/cli": "^0.2.28",
22
+ "@wervt/cli": "^0.2.31",
23
23
  "drizzle-kit": "1.0.0-rc.5",
24
24
  "golar": "^0.1.11",
25
25
  "vite-plus": "^1.3.0"