create-wervt 0.2.4 → 0.2.5

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.4",
3
+ "version": "0.2.5",
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",
@@ -99,6 +99,17 @@ const { data: todos, isLive } = await useShape<Todo>('/api/shapes/todos')
99
99
  - For your own state (anonymous visitors too), use `useSession(event, { name })` from
100
100
  `nuxt/server`. The secret is set by wervt.
101
101
 
102
+ ## Files
103
+
104
+ Store uploads with ablage (`pnpm add ablage`, add `'ablage'` to `modules`). wervt gives the app its
105
+ own bucket and `@wervt/nuxt` connects it; don't configure a provider or S3 credentials.
106
+
107
+ - `readUploadedFile(event, { types, maxSize })`, `useFileStorage().put/get/list/remove` and
108
+ `sendStoredFile(event, ref)` (route files without a method suffix) from `#imports`.
109
+ - Keep files to a few tens of MB: they pass through the isolate (150 MB memory). No tus uploads
110
+ and no `transform` / sharp: they need a disk and native modules.
111
+ - Check access in the route before serving a file.
112
+
102
113
  ## Tasks (cron)
103
114
 
104
115
  Periodic work (cleanup, syncs, renewals) goes into tasks, not into requests:
@@ -138,7 +149,7 @@ wervt: { timezone: 'Europe/Berlin' }, // optional, UTC by default
138
149
  ## Don'ts
139
150
 
140
151
  - No Node-only APIs that Deno lacks (`child_process`, native addons, writing to the filesystem).
141
- Store data in Postgres.
152
+ Store data in Postgres and files with ablage.
142
153
  - No long-running work in requests (CPU is limited per request) and no in-memory state that must
143
154
  survive: isolates are started and stopped on demand.
144
155
  - No WebSockets, SSE hubs or timers (`setInterval`) that push to clients. Write to the database
@@ -9,13 +9,13 @@
9
9
  "postinstall": "nuxt prepare"
10
10
  },
11
11
  "dependencies": {
12
- "@wervt/nuxt": "^0.2.2",
12
+ "@wervt/nuxt": "^0.2.3",
13
13
  "drizzle-orm": "1.0.0-rc.4",
14
14
  "nuxt": "npm:nuxt-nightly@5x",
15
15
  "valibot": "^1.5.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@wervt/cli": "^0.2.4",
18
+ "@wervt/cli": "^0.2.5",
19
19
  "drizzle-kit": "1.0.0-rc.4",
20
20
  "vite-plus": "^1.0.0"
21
21
  }