@wervt/cli 0.2.9 → 0.2.11
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/dist/index.mjs +22 -1
- package/package.json +1 -1
- package/skill/SKILL.md +9 -5
package/dist/index.mjs
CHANGED
|
@@ -204,6 +204,15 @@ const deploy = defineCommand({
|
|
|
204
204
|
default: true,
|
|
205
205
|
description: "Build before deploying"
|
|
206
206
|
},
|
|
207
|
+
check: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Pages to request once the release started, a 5xx fails (default: /). Shape routes are checked too; --check= turns all checks off"
|
|
210
|
+
},
|
|
211
|
+
"rollback-on-fail": {
|
|
212
|
+
type: "boolean",
|
|
213
|
+
default: false,
|
|
214
|
+
description: "Go back to the previous release when a page or shape check fails"
|
|
215
|
+
},
|
|
207
216
|
...connection
|
|
208
217
|
},
|
|
209
218
|
async run({ args }) {
|
|
@@ -227,7 +236,10 @@ const deploy = defineCommand({
|
|
|
227
236
|
spinner.stop(`Packed ${bundle.files} files (${(bundle.data.byteLength / 1024).toFixed(0)} kB)`);
|
|
228
237
|
spinner.start("Uploading");
|
|
229
238
|
const source = await deploySource(dir);
|
|
230
|
-
const
|
|
239
|
+
const query = new URLSearchParams();
|
|
240
|
+
if (args.check !== void 0) query.set("check", args.check);
|
|
241
|
+
if (args["rollback-on-fail"]) query.set("rollbackOnFail", "1");
|
|
242
|
+
const res = await api(`/v1/apps/${name}/deploys${query.size ? `?${query}` : ""}`, args, {
|
|
231
243
|
method: "POST",
|
|
232
244
|
headers: {
|
|
233
245
|
"content-type": "application/gzip",
|
|
@@ -273,6 +285,15 @@ const deploy = defineCommand({
|
|
|
273
285
|
process.exitCode = 1;
|
|
274
286
|
return;
|
|
275
287
|
}
|
|
288
|
+
if (event.step === "check-failed") {
|
|
289
|
+
const failed = event.failed.map((check) => `${check.kind === "shape" ? "shape " : ""}${check.path} (${check.status || "no answer"})`).join(", ");
|
|
290
|
+
p.log.error(`Release ${event.release} started, but failed: ${failed}`);
|
|
291
|
+
if (event.message) p.log.message(event.message);
|
|
292
|
+
if (event.restored) p.log.info(`${name} is back on ${event.restored}.`);
|
|
293
|
+
else p.log.warn(`It stays active. Fix it or run \`wervt rollback ${name}\`.`);
|
|
294
|
+
process.exitCode = 1;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
276
297
|
if (event.step === "storage-failed") {
|
|
277
298
|
p.log.warn(`Storage isn't set up: ${event.message}. The app runs; files won't work yet.`);
|
|
278
299
|
continue;
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -49,8 +49,10 @@ existing app, work in its repository instead.
|
|
|
49
49
|
individual designs, Nuxt UI + the `nuxt-ui-mobile` skill for pure phone apps. Details in the
|
|
50
50
|
app's `AGENTS.md`.
|
|
51
51
|
- Users: wervt signs people in. Use `useWervtUser()`; never build login, passwords or OAuth.
|
|
52
|
-
-
|
|
53
|
-
|
|
52
|
+
- AI agents: add a tool in `server/tools/` (`defineTool`) for each main thing a user does in the
|
|
53
|
+
app, so agents can do it too: in the browser (WebMCP) and from Claude Code, Cursor and other
|
|
54
|
+
MCP clients at `https://<app>.wervt.app/mcp`, signed in through wervt. Details in the app's
|
|
55
|
+
`AGENTS.md`.
|
|
54
56
|
- After changing `server/db/schema.ts`: `pnpm db:generate`, and commit the migration.
|
|
55
57
|
- `pnpm dev` runs against a local wervt stack, which the user may not have. When it isn't running,
|
|
56
58
|
don't set one up: `pnpm build` plus `pnpm exec vp check --fix` are the checks, and the
|
|
@@ -70,9 +72,11 @@ pnpm exec wervt env <name> --set KEY=value # server env vars, applied fro
|
|
|
70
72
|
decide that. Private, with the user's email allowed, is the safe default.
|
|
71
73
|
- Secrets for `wervt env` (API keys) come from the user. Ask them to run the command themselves
|
|
72
74
|
(`! pnpm exec wervt env <name> --set API_KEY=…`) instead of pasting the value to you.
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
- `wervt deploy` requests `/` once the release started and fails (exit 1, with the first logged
|
|
76
|
+
error) on a 5xx. Add the pages you changed: `--check /,/todos,/api/todos`. The checks are
|
|
77
|
+
anonymous, so pages behind a sign-in only show they don't crash without a user.
|
|
78
|
+
- Then open the URL `wervt deploy` printed and check
|
|
79
|
+
`pnpm exec wervt logs <name> 'level:error' --since 15m`. Fix and redeploy until both are clean.
|
|
76
80
|
|
|
77
81
|
## 5. Deploy on push (when the user wants a repository)
|
|
78
82
|
|