create-wervt 0.1.0 → 0.2.0
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 +1 -1
- package/template/AGENTS.md +16 -0
- package/template/package.json +1 -1
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -110,6 +110,22 @@ const { data: todos, isLive } = await useShape<Todo>('/api/shapes/todos')
|
|
|
110
110
|
requests.
|
|
111
111
|
- No secrets in client code. Server env vars come from wervt; don't hardcode credentials.
|
|
112
112
|
|
|
113
|
+
## Logs
|
|
114
|
+
|
|
115
|
+
Every request logs one wide event (evlog). Add context to it rather than logging separate lines:
|
|
116
|
+
`useLogger(event).set({ user: { id }, room: { id } })` (auto-imported). Use `log.info(tag, msg)`
|
|
117
|
+
outside requests. Never log secrets or request bodies.
|
|
118
|
+
|
|
119
|
+
Production logs, to debug a bug report (`WERVT_TOKEN` can be the read token):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pnpm exec wervt logs <app> 'level:error' --since 1d --json
|
|
123
|
+
pnpm exec wervt logs <app> 'status:>=500 path:/api/*' --json
|
|
124
|
+
pnpm exec wervt logs <app> 'type:=BootFailure' # a release that didn't start
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Queries are LogsQL. Logs may contain user data: quote only what's needed.
|
|
128
|
+
|
|
113
129
|
## Commands
|
|
114
130
|
|
|
115
131
|
- `pnpm dev`: dev server against the local wervt stack (`docker compose up -d` in the wervt repo).
|