@voltro/cli 0.50.1 → 0.51.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/CHANGELOG.md +104 -0
- package/dist/{apiBuild-D3s7lx57.js → apiBuild-CPDHXF72.js} +2 -2
- package/dist/apiBuild-GDKuGOMV.js +2 -0
- package/dist/appGraph-CFmFKHb2.js +2 -0
- package/dist/appGraph-yRuKjOba.js +111 -0
- package/dist/bin.js +1 -1
- package/dist/{build-CFmqF39c.js → build-DETLZAFt.js} +271 -240
- package/dist/{checkCommand-DomvYDi1.js → checkCommand-CWcnDArJ.js} +1 -1
- package/dist/{checkCommand-DsKIjL6k.js → checkCommand-DNuPiWMc.js} +29 -28
- package/dist/{codegenCommand-C0S27nbB.js → codegenCommand-BNBHcNNj.js} +2 -2
- package/dist/{codemodRunner-DwY8Rjbl.js → codemodRunner-BDVixlSw.js} +278 -191
- package/dist/{commands-Brp4DI8u.js → commands-B1OiS9bX.js} +24 -23
- package/dist/{dashboardCommand-bbLfc9FW.js → dashboardCommand-C-vvPY1B.js} +5 -5
- package/dist/{dataCommand-k9mXTXin.js → dataCommand-C1GxXW5q.js} +279 -233
- package/dist/dbCommand-C27HIsGE.js +2 -0
- package/dist/{dbCommand-Bf7Cy0mn.js → dbCommand-If4Y1xQ-.js} +1 -1
- package/dist/{dev-Dz9GqA6P.js → dev-CK522MV5.js} +1 -1
- package/dist/{dev-C0cbqysu.js → dev-kdAg9Q7l.js} +1246 -1246
- package/dist/doctorCommand-BK4l18eG.js +2 -0
- package/dist/{doctorCommand-DyViaaCP.js → doctorCommand-nKmeW78u.js} +16 -16
- package/dist/{dormancyCommand-DMZPA_HW.js → dormancyCommand-CY3wa_SW.js} +1 -1
- package/dist/{embeddingsCommand-CMxRPkg6.js → embeddingsCommand-BDLIgje_.js} +1 -1
- package/dist/{envCommand-CDLr-yD4.js → envCommand-C6V_xVlT.js} +13 -13
- package/dist/{evolveCommand-Ct4NesL3.js → evolveCommand-D3c4DSfN.js} +2 -2
- package/dist/{generateCommand-BDdOxhnv.js → generateCommand-DTNPGjxo.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{infoCommand-orsKJKUy.js → infoCommand-BnRFEF1o.js} +1 -1
- package/dist/{migrate-D3MK9BpK.js → migrate-DehuBakM.js} +1 -1
- package/dist/{runtimeTrace-Bo8jWsNe.js → runtimeTrace-ZsBU7Tkx.js} +1 -1
- package/dist/{sdkgen-OZhiT2vz.js → sdkgen-O4XqWOjM.js} +1 -1
- package/dist/serveCommand-BRnPCxVd.js +2 -0
- package/dist/{serveCommand-YbD5VgfV.js → serveCommand-DdiYNBBu.js} +3 -3
- package/dist/serveEntry.js +1 -1
- package/dist/{start-B1nH9ahf.js → start-BLNmWkLa.js} +331 -327
- package/dist/{start-7b_bL8Uc.js → start-Dzicuyw8.js} +1 -1
- package/dist/startEntry.js +1 -1
- package/dist/{updateCommand-BgH6vTtq.js → updateCommand-Bs322Q78.js} +1 -1
- package/dist/updateCommand-eXB35SEv.js +2 -0
- package/dist/{webDev-BbdkzMbd.js → webDev-B-ubQEMX.js} +282 -223
- package/dist/webDev-DposiF3j.js +2 -0
- package/dist/{webhooksCommand-DjE6u0r4.js → webhooksCommand-FLYY9IXh.js} +1 -1
- package/package.json +35 -17
- package/templates/AGENTS.core.md +15 -5
- package/templates/AGENTS.md +16 -6
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +29 -0
- package/templates/agent-docs/internationalization.md +131 -13
- package/templates/agent-docs/whats-new.md +75 -27
- package/templates/apps/api-ai/package.json +7 -7
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +10 -10
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-versioning/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +6 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +9 -9
- package/templates/apps/frontend-auth/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-cms/package.json +9 -9
- package/templates/apps/frontend-collab/package.json +10 -10
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/package.json +7 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +8 -8
- package/templates/apps/frontend-saas/package.json +8 -8
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/package.json +6 -6
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-BZ-plaQN.js +0 -2
- package/dist/appGraph-CM9wvUmD.js +0 -2
- package/dist/appGraph-Cv2W_wO5.js +0 -111
- package/dist/dbCommand-Bnl7MSGC.js +0 -2
- package/dist/doctorCommand-BlciWUJb.js +0 -2
- package/dist/serveCommand-Bbgg7Paq.js +0 -2
- package/dist/updateCommand-BweY17z-.js +0 -2
- package/dist/webDev-BcRFTsMA.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./checkCommand-
|
|
1
|
+
import { n as e, r as t, t as n } from "./checkCommand-DNuPiWMc.js";
|
|
2
2
|
export { n as offlineManifest, e as runCheckCommand, t as toInput };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { t as e } from "./cliArgs-D4p8n7EE.js";
|
|
2
2
|
import { a as t, l as n } from "./codegen-CrMXs4hb.js";
|
|
3
|
-
import { r } from "./appGraph-
|
|
3
|
+
import { r } from "./appGraph-yRuKjOba.js";
|
|
4
4
|
import { n as i } from "./cliOutput-D1tSBoRM.js";
|
|
5
5
|
import { n as a, o, r as s, t as c } from "./inspectFetch-EMuhTG_9.js";
|
|
6
6
|
import { r as l } from "./fileTaxonomy-CJfgOllU.js";
|
|
7
|
-
import { S as u } from "./doctorCommand-
|
|
7
|
+
import { S as u } from "./doctorCommand-nKmeW78u.js";
|
|
8
8
|
import { resolve as d } from "node:path";
|
|
9
9
|
import { readdirSync as f, statSync as p } from "node:fs";
|
|
10
|
+
import { isReactivityChannelKey as m } from "@voltro/protocol";
|
|
10
11
|
//#region src/observedDiff.ts
|
|
11
|
-
var
|
|
12
|
+
var h = (e) => (e === void 0 ? [] : typeof e == "string" ? [e] : e).filter((e) => !m(e)), g = {
|
|
12
13
|
insert: ["insert"],
|
|
13
14
|
update: ["update"],
|
|
14
15
|
delete: ["delete"],
|
|
15
16
|
upsert: ["insert", "update"]
|
|
16
|
-
},
|
|
17
|
+
}, _ = (e) => e !== "read", v = (e, t) => `{ table: '${e}', op: '${t}' }`, y = (e, t) => {
|
|
17
18
|
let n = [], r = new Set(t.exercised), i = /* @__PURE__ */ new Map();
|
|
18
19
|
for (let e of t.edges) {
|
|
19
20
|
let t = i.get(e.tag);
|
|
@@ -25,19 +26,19 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
25
26
|
a.push(t.tag);
|
|
26
27
|
continue;
|
|
27
28
|
}
|
|
28
|
-
let e = `${t.kind}(${t.tag})`, s = t.file, c = i.get(t.tag) ?? [], l = new Set(
|
|
29
|
+
let e = `${t.kind}(${t.tag})`, s = t.file, c = i.get(t.tag) ?? [], l = new Set(h(t.source)), u = /* @__PURE__ */ new Map();
|
|
29
30
|
for (let e of t.targets ?? []) {
|
|
30
31
|
let t = u.get(e.table) ?? /* @__PURE__ */ new Set();
|
|
31
32
|
t.add(e.op), u.set(e.table, t);
|
|
32
33
|
}
|
|
33
|
-
for (let t of c) if (
|
|
34
|
-
let r =
|
|
34
|
+
for (let t of c) if (_(t.op)) {
|
|
35
|
+
let r = g[t.op], i = u.get(t.table);
|
|
35
36
|
if (i === void 0) n.push({
|
|
36
37
|
rule: "observed/undeclared-write",
|
|
37
38
|
node: e,
|
|
38
39
|
...s === void 0 ? {} : { file: s },
|
|
39
40
|
breaks: [`writes '${t.table}' (${t.op}) but declares no target for it`, "subscriptions on that table are not invalidated by this mutation"],
|
|
40
|
-
fix: `add ${r.map((e) =>
|
|
41
|
+
fix: `add ${r.map((e) => v(t.table, e)).join(" and ")} to this procedure's targets`,
|
|
41
42
|
severity: "warn"
|
|
42
43
|
});
|
|
43
44
|
else {
|
|
@@ -47,7 +48,7 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
47
48
|
node: e,
|
|
48
49
|
...s === void 0 ? {} : { file: s },
|
|
49
50
|
breaks: [`declares ${[...i].map((e) => `'${e}'`).join(" + ")} on '${t.table}' but performed '${t.op}'`, "the synthesized optimistic patch has the wrong shape"],
|
|
50
|
-
fix: r.length > 1 ? `an upsert is both halves — declare ${r.map((e) =>
|
|
51
|
+
fix: r.length > 1 ? `an upsert is both halves — declare ${r.map((e) => v(t.table, e)).join(" and ")}` : `change the target op for '${t.table}' to '${a[0]}'`,
|
|
51
52
|
severity: "warn"
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -90,7 +91,7 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
90
91
|
total: e.length
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
|
-
},
|
|
94
|
+
}, b = (e, n = [], r = 0) => {
|
|
94
95
|
if (r > 12) return n;
|
|
95
96
|
let i;
|
|
96
97
|
try {
|
|
@@ -114,24 +115,24 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
114
115
|
} catch {
|
|
115
116
|
continue;
|
|
116
117
|
}
|
|
117
|
-
o.isDirectory() ?
|
|
118
|
+
o.isDirectory() ? b(i, n, r + 1) : o.isFile() && t.test(a) && n.push(i);
|
|
118
119
|
}
|
|
119
120
|
return n;
|
|
120
|
-
},
|
|
121
|
+
}, x = /* @__PURE__ */ new Set(["actors", "tenants"]), S = async (e) => {
|
|
121
122
|
try {
|
|
122
123
|
let { readFile: t } = await import("node:fs/promises"), { join: n } = await import("node:path"), r = await t(n(e, "app.graph.observed.generated.json"), "utf8"), i = JSON.parse(r);
|
|
123
124
|
return i?.version !== 1 || !Array.isArray(i.edges) || !Array.isArray(i.exercised) ? null : i;
|
|
124
125
|
} catch {
|
|
125
126
|
return null;
|
|
126
127
|
}
|
|
127
|
-
},
|
|
128
|
+
}, C = (e) => {
|
|
128
129
|
let { exercised: t, total: n } = e.coverage, r = `\nobserved: ${t}/${n} procedures exercised (${n === 0 ? 0 : Math.round(t / n * 100)}%)`;
|
|
129
130
|
if (e.diagnostics.length === 0) return `${r}\n no declared/observed mismatches${e.unexercised.length > 0 ? `\n ${e.unexercised.length} unexercised — no recording, so nothing is claimed about them` : ""}`;
|
|
130
131
|
let i = e.diagnostics.map((e) => ` ${e.node}${e.file === void 0 ? "" : ` (${e.file})`}\n` + e.breaks.map((e) => ` ${e}`).join("\n") + `\n fix: ${e.fix}`), a = e.unexercised.length > 0 ? `\n ${e.unexercised.length} unexercised — no recording, so nothing is claimed about them` : "";
|
|
131
132
|
return `${r}\n${i.join("\n")}${a}`;
|
|
132
|
-
},
|
|
133
|
+
}, w = (e, t) => ({
|
|
133
134
|
tables: (t.tables ?? []).map((e) => e.name),
|
|
134
|
-
frameworkOwnedTables: (t.tables ?? []).filter((e) => e.framework === !0 || e.name.startsWith("_voltro_") ||
|
|
135
|
+
frameworkOwnedTables: (t.tables ?? []).filter((e) => e.framework === !0 || e.name.startsWith("_voltro_") || x.has(e.name)).map((e) => e.name),
|
|
135
136
|
scopes: e.scopes ?? [],
|
|
136
137
|
procedures: (e.procedures ?? []).map((e) => {
|
|
137
138
|
let t = (e.guards ?? []).flatMap((e) => e.kind === "scope" ? e.scope ?? [] : []), n = (e.guards ?? []).find((e) => e.kind === "open")?.reason;
|
|
@@ -146,11 +147,11 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
146
147
|
...e.internal === !0 ? { internal: !0 } : {}
|
|
147
148
|
};
|
|
148
149
|
})
|
|
149
|
-
}),
|
|
150
|
+
}), T = (e) => e.length === 0 ? "✓ voltro check: no issues" : e.map((e) => {
|
|
150
151
|
let t = e.severity === "error" ? "✗ error" : "⚠ warn", n = e.file ? ` (${e.file})` : "";
|
|
151
152
|
return `${t} ${e.rule} ${e.node}${n}\n ${e.breaks.join("; ")}\n fix: ${e.fix}`;
|
|
152
|
-
}).join("\n"),
|
|
153
|
-
let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-
|
|
153
|
+
}).join("\n"), E = async (e) => {
|
|
154
|
+
let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-CK522MV5.js"), { buildRpcEntry: i } = await import("./manifestBuild-CPjhvM62.js"), { buildCapabilityManifest: a } = await import("./inspect-CuGDYES0.js"), { relative: o } = await import("node:path"), s = await n(await t(e)), c = (t, n, r) => i(t, n, o(e, r)), l = [
|
|
154
155
|
...s.queries.map((e) => c(e.descriptor, "query", e.file)),
|
|
155
156
|
...s.mutations.map((e) => c(e.descriptor, "mutation", e.file)),
|
|
156
157
|
...s.actions.map((e) => c(e.descriptor, "action", e.file)),
|
|
@@ -166,7 +167,7 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
166
167
|
})), [], m),
|
|
167
168
|
tables: { tables: p }
|
|
168
169
|
};
|
|
169
|
-
},
|
|
170
|
+
}, D = async (t) => {
|
|
170
171
|
let f = t.flatMap((e) => e === "--json" ? ["--format", "json"] : [e]), p = a(f);
|
|
171
172
|
if ("error" in p) return console.error(`voltro check: ${p.error}`), 1;
|
|
172
173
|
let { process: m, target: h, rest: g } = s(p.rest), _;
|
|
@@ -186,11 +187,11 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
186
187
|
};
|
|
187
188
|
else return console.error("voltro check --diff: expected removeTable:<name> | removeProcedure:<tag> | removeScope:<name>"), 1;
|
|
188
189
|
}
|
|
189
|
-
let
|
|
190
|
+
let v = e(g, ["--diff"]) ?? process.cwd(), x = g.includes("--offline"), D = x ? [] : await o(m, h), O, k;
|
|
190
191
|
if (D.length === 0) {
|
|
191
|
-
if (!
|
|
192
|
+
if (!x && h !== void 0) return console.error("voltro check: --url given but no api reachable there."), 1;
|
|
192
193
|
try {
|
|
193
|
-
let e = await
|
|
194
|
+
let e = await E(d(v));
|
|
194
195
|
O = e.manifest, k = e.tables;
|
|
195
196
|
} catch (e) {
|
|
196
197
|
return console.error(`voltro check: could not assemble the graph from source: ${e.message}`), console.error(" Start `voltro dev` to check against a running api instead."), 1;
|
|
@@ -200,21 +201,21 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
200
201
|
if (t.kind === "err") return console.error(`voltro check: manifest fetch failed: ${t.error}`), 1;
|
|
201
202
|
O = t.data, k = n.kind === "ok" ? n.data : { tables: [] };
|
|
202
203
|
}
|
|
203
|
-
let A =
|
|
204
|
+
let A = w(O, k), j = r(A, _), M = [...l(v).findings.map((e) => ({
|
|
204
205
|
rule: e.rule,
|
|
205
206
|
node: e.file,
|
|
206
207
|
file: e.file,
|
|
207
208
|
breaks: [e.detail],
|
|
208
209
|
fix: e.fix,
|
|
209
210
|
severity: e.severity
|
|
210
|
-
})), ...u(
|
|
211
|
+
})), ...u(v).map((e) => ({
|
|
211
212
|
rule: `page/${e.kind}`,
|
|
212
213
|
node: e.file,
|
|
213
214
|
file: e.file,
|
|
214
215
|
breaks: [e.kind === "suffixed-outside-pages" ? "a page.tsx outside src/pages/ never routes" : "no test beside it"],
|
|
215
216
|
fix: e.kind === "suffixed-outside-pages" ? "move it under src/pages/ into the directory whose route it serves, or rename it — page.tsx is reserved" : "write the test with the file — the name is derivable",
|
|
216
217
|
severity: e.kind === "suffixed-outside-pages" ? "error" : "warn"
|
|
217
|
-
}))], N = (await n(
|
|
218
|
+
}))], N = (await n(v, b(v))).map((e) => ({
|
|
218
219
|
rule: "client/not-browser-safe",
|
|
219
220
|
node: e.file,
|
|
220
221
|
file: e.file,
|
|
@@ -225,7 +226,7 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
225
226
|
...j.diagnostics,
|
|
226
227
|
...M,
|
|
227
228
|
...N
|
|
228
|
-
], F = j.ok && !M.some((e) => e.severity === "error") && N.length === 0, I = await
|
|
229
|
+
], F = j.ok && !M.some((e) => e.severity === "error") && N.length === 0, I = await S(d(v)), L = I === null ? null : y(A.procedures, I);
|
|
229
230
|
return p.format === "json" ? i(L === null ? {
|
|
230
231
|
...j,
|
|
231
232
|
ok: F,
|
|
@@ -235,7 +236,7 @@ var m = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, h = {
|
|
|
235
236
|
ok: F,
|
|
236
237
|
diagnostics: P,
|
|
237
238
|
observed: L
|
|
238
|
-
}) : (console.log(
|
|
239
|
+
}) : (console.log(T(P)), L !== null && console.log(C(L)), console.log(F ? "\nvoltro check: OK" : "\nvoltro check: FAILED (errors above)")), +!F;
|
|
239
240
|
};
|
|
240
241
|
//#endregion
|
|
241
|
-
export {
|
|
242
|
+
export { D as n, w as r, E as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as e, Sn as t, l as n, u as r, xn as i } from "./dev-
|
|
2
|
-
import {
|
|
1
|
+
import { B as e, Sn as t, l as n, u as r, xn as i } from "./dev-kdAg9Q7l.js";
|
|
2
|
+
import { ft as a } from "./webDev-B-ubQEMX.js";
|
|
3
3
|
import { n as o } from "./frameworkTableAssembly-BwJVEKLr.js";
|
|
4
4
|
import { i as s, r as c } from "./codegen-CrMXs4hb.js";
|
|
5
5
|
import { basename as l, join as u, relative as d, resolve as f } from "node:path";
|