@voltro/cli 0.54.0 → 0.56.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 +639 -2
- package/bin/voltro.mjs +24 -0
- package/dist/{apiBuild-DTWp0S_q.js → apiBuild-Bdaetr37.js} +119 -88
- package/dist/apiBuild-Vw1figjO.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/{build-D4ygSbnV.js → build-CI36wL4R.js} +339 -314
- package/dist/buildReport-52gHKgfO.js +64 -0
- package/dist/{checkCommand-Dg1G7Gwd.js → checkCommand-CAwFXrxA.js} +6 -6
- package/dist/{checkCommand-L7DTlpIF.js → checkCommand-D0QV_zM_.js} +1 -1
- package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
- package/dist/{codegen-DSLM8Su9.js → codegen-Bth5lUTU.js} +76 -64
- package/dist/codegen-DbH7NbCR.js +2 -0
- package/dist/{codegenCommand-CG_Vx4lc.js → codegenCommand-CidbQzbv.js} +15 -14
- package/dist/{codemodRunner-Cd4xkC6u.js → codemodRunner-BlQPfjzA.js} +277 -0
- package/dist/{commands-6Kzi92Np.js → commands-CWjfThXv.js} +35 -35
- package/dist/{dashboardCommand-Cq1PWvI1.js → dashboardCommand-BekcY5Ls.js} +3 -3
- package/dist/{dataCommand-DYzW8vkv.js → dataCommand-2pccgbIy.js} +267 -195
- package/dist/{dbCommand-B4NWZtGL.js → dbCommand-DpK_vQET.js} +457 -441
- package/dist/dbCommand-DrycGWWt.js +2 -0
- package/dist/{dev-cKUiZZsB.js → dev-B9Gz0k85.js} +1 -1
- package/dist/{dev-CmuvUKRq.js → dev-Dw263KPu.js} +2598 -2452
- package/dist/doctorCommand-BMWs6aVm.js +2 -0
- package/dist/{doctorCommand-DCiFVMtZ.js → doctorCommand-aR_bFmIi.js} +353 -251
- package/dist/{dormancyCommand-w1TrmgYP.js → dormancyCommand-eXTQMbHU.js} +1 -1
- package/dist/{embeddingsCommand-CMgPyRTr.js → embeddingsCommand-CTmiQvwa.js} +1 -1
- package/dist/{envCommand-Cyynmcfa.js → envCommand-BDUgV7EM.js} +12 -12
- package/dist/{evolveCommand-BwvQ8dVH.js → evolveCommand-YV8qW1LU.js} +2 -2
- package/dist/frameworkTableAssembly-CGNC0qr7.js +2 -0
- package/dist/{frameworkTableAssembly-D7LJuALW.js → frameworkTableAssembly-DNOFXfEQ.js} +102 -100
- package/dist/index.js +1 -1
- package/dist/{infoCommand-DlYlUPqs.js → infoCommand-BjVXpMlP.js} +1 -1
- package/dist/inspect-CNYvNXPU.js +1484 -0
- package/dist/inspect-S2rWy1Ys.js +2 -0
- package/dist/{inspectCmd-niF97fAq.js → inspectCmd-CP-G0sVK.js} +1 -1
- package/dist/{inspectFetch-EMuhTG_9.js → inspectFetch-BU1NyzxV.js} +36 -24
- package/dist/{inspectMetrics-CGF94puw.js → inspectMetrics-BY0Sjb2F.js} +19 -19
- package/dist/interruptedReplace-CwnkBb2X.js +41 -0
- package/dist/interruptedReplace-qzmFI020.js +2 -0
- package/dist/{logsCmd-B6oNsfaZ.js → logsCmd-BU8uCdys.js} +1 -1
- package/dist/{manifestBuild-Cqgsx2bM.js → manifestBuild-CEkjfpwc.js} +1 -1
- package/dist/manifestBuild-DIa_s6u0.js +2 -0
- package/dist/{migrate-BK_Bbx-_.js → migrate-SICulyz1.js} +2 -2
- package/dist/precompressAssets-YhTi1aWp.js +40 -0
- package/dist/{probeCommand-_C0YU207.js → probeCommand-6HxEkNDG.js} +2 -2
- package/dist/{runtimeTrace-CGWx1Q6l.js → runtimeTrace-DgYMc09E.js} +1 -1
- package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
- package/dist/{sdkgen-CDGHQUFj.js → sdkgen-PY-umd6O.js} +1 -1
- package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
- package/dist/serveCommand-BITS8Hpj.js +2 -0
- package/dist/{serveCommand-Bje09q1v.js → serveCommand-DIJ3ma76.js} +951 -909
- package/dist/serveEntry.js +1 -1
- package/dist/{start-Clz-1BHB.js → start-B9NGB8gn.js} +627 -588
- package/dist/{start-B0bnJgxI.js → start-BFQQkL1i.js} +1 -1
- package/dist/startEntry.js +1 -1
- package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
- package/dist/{test-D_kW4KMj.js → test-jipIQ5Mx.js} +1 -1
- package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-BWYDqMy6.js} +1 -1
- package/dist/{updateCommand-CRJlAOaM.js → updateCommand-C9n_Z_oG.js} +8 -2
- package/dist/updateCommand-DsXEAHbd.js +2 -0
- package/dist/webDev-C2dRz9s5.js +2 -0
- package/dist/{webDev-DSI9SOhs.js → webDev-C53hJdcL.js} +1265 -1288
- package/dist/{webhooksCommand-BvzXNHji.js → webhooksCommand-uuPu8qQX.js} +1 -1
- package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
- package/package.json +67 -19
- package/templates/AGENTS.core.md +20 -1
- package/templates/AGENTS.md +21 -2
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/_manifest.json +1 -1
- package/templates/agent-docs/authentication.md +49 -6
- package/templates/agent-docs/cli.md +216 -11
- package/templates/agent-docs/data.md +209 -18
- package/templates/agent-docs/database/scaling.md +40 -1
- package/templates/agent-docs/deployment.md +53 -1
- package/templates/agent-docs/internationalization.md +32 -0
- package/templates/agent-docs/local-first-mobile.md +9 -2
- package/templates/agent-docs/observability.md +227 -0
- package/templates/agent-docs/plugins/billing.md +15 -0
- package/templates/agent-docs/plugins/broadcast.md +2 -1
- package/templates/agent-docs/plugins/ratelimit.md +6 -1
- package/templates/agent-docs/plugins/row-history.md +11 -0
- package/templates/agent-docs/plugins.md +65 -8
- package/templates/agent-docs/reference.md +5 -3
- package/templates/agent-docs/routing.md +18 -0
- package/templates/agent-docs/schema-driven-ui.md +125 -0
- package/templates/agent-docs/templates/appshells.md +3 -3
- package/templates/agent-docs/whats-new.md +408 -106
- package/templates/apps/api-ai/package.json +6 -6
- 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 +9 -9
- 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-row-history/package.json +8 -8
- 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-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +7 -7
- package/templates/apps/changelog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +7 -8
- package/templates/apps/frontend-admin/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +1 -2
- package/templates/apps/frontend-app/package.json +8 -9
- package/templates/apps/frontend-app/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-auth/package.json +7 -8
- package/templates/apps/frontend-auth/src/components/AuthShell.tsx +1 -2
- package/templates/apps/frontend-blank/package.json +6 -7
- package/templates/apps/frontend-blank/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-cms/package.json +8 -9
- package/templates/apps/frontend-cms/src/pages/(app)/layout.tsx +1 -2
- package/templates/apps/frontend-collab/README.md +7 -2
- package/templates/apps/frontend-collab/package.json +9 -10
- package/templates/apps/frontend-collab/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +8 -4
- package/templates/apps/frontend-collab/src/pages/page.tsx +10 -5
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-contact/src/components/ContactForm.island.tsx +1 -1
- package/templates/apps/frontend-dashboard/package.json +6 -7
- package/templates/apps/frontend-dashboard/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-dashboard/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-docs/package.json +8 -8
- 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 +7 -8
- package/templates/apps/frontend-portal/src/pages/(portal)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/package.json +7 -8
- package/templates/apps/frontend-saas/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-spa/package.json +6 -7
- package/templates/apps/frontend-spa/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr/package.json +6 -7
- package/templates/apps/frontend-ssr/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr-api/package.json +7 -8
- package/templates/apps/frontend-ssr-api/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/templates/apps/frontend-static-blog/src/components/ReadingProgress.island.tsx +1 -1
- package/templates/apps/frontend-static-blog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/frontend-status/package.json +7 -8
- package/templates/apps/frontend-status/src/pages/layout.tsx +1 -2
- package/templates/apps/mobile-app/package.json +4 -4
- package/templates/baselines/compose/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose/docker/web.Dockerfile +55 -10
- package/templates/baselines/compose-mariadb/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose-mariadb/docker/web.Dockerfile +55 -10
- package/dist/apiBuild-CeUN55uk.js +0 -2
- package/dist/codegen-DjgxEOnD.js +0 -2
- package/dist/dbCommand-CSFWs9ev.js +0 -2
- package/dist/doctorCommand-J3qu4E0Y.js +0 -2
- package/dist/frameworkTableAssembly-IPD1pUnZ.js +0 -2
- package/dist/inspect-Bd8-9wsi.js +0 -1193
- package/dist/inspect-CuoDInfZ.js +0 -2
- package/dist/interruptedReplace-C3O3M1MM.js +0 -28
- package/dist/interruptedReplace-CvmiAM9K.js +0 -2
- package/dist/manifestBuild-C4-J1-m_.js +0 -2
- package/dist/serveCommand-BiPe8BJm.js +0 -2
- package/dist/updateCommand-CIoVDKnj.js +0 -2
- package/dist/webDev-DlvZO30c.js +0 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { join as e } from "node:path";
|
|
2
|
+
import { existsSync as t, readFileSync as n, readdirSync as r, statSync as i } from "node:fs";
|
|
3
|
+
import { gzipSync as a } from "node:zlib";
|
|
4
|
+
//#region src/buildReport.ts
|
|
5
|
+
var o = 9, s = (e) => a(e, { level: o }).length, c = (n) => {
|
|
6
|
+
let a = 0, o = 0, s = (t) => {
|
|
7
|
+
for (let n of r(t, { withFileTypes: !0 })) {
|
|
8
|
+
let r = e(t, n.name);
|
|
9
|
+
n.isDirectory() ? s(r) : (a += i(r).size, o += 1);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
return t(n) && s(n), {
|
|
13
|
+
bytes: a,
|
|
14
|
+
files: o
|
|
15
|
+
};
|
|
16
|
+
}, l = (a) => {
|
|
17
|
+
let o = e(a, ".framework", "dist"), l = e(o, "index.html");
|
|
18
|
+
if (!t(l)) return null;
|
|
19
|
+
let u = n(l, "utf8"), d = (r) => {
|
|
20
|
+
let i = e(o, r.replace(/^\//, ""));
|
|
21
|
+
if (!t(i)) return null;
|
|
22
|
+
let a = n(i);
|
|
23
|
+
return {
|
|
24
|
+
file: r,
|
|
25
|
+
gzip: s(a),
|
|
26
|
+
raw: a.length
|
|
27
|
+
};
|
|
28
|
+
}, f = [...u.matchAll(/(?:src|href)="(\/assets\/[^"]+\.js)"/g)].map((e) => e[1]), p = [...u.matchAll(/href="(\/assets\/[^"]+\.css)"/g)].map((e) => e[1]), m = f.map(d).filter((e) => e !== null), h = p.map(d).filter((e) => e !== null), g = e(o, "assets"), _ = 0, v = 0;
|
|
29
|
+
if (t(g)) for (let t of r(g)) t.endsWith(".js") && (_ += s(n(e(g, t))), v += 1);
|
|
30
|
+
let y = e(o, "server", "ssrEntry.js"), b = c(e(a, ".framework", "dist-web", "startBundle")), x = c(e(a, ".framework", "dist-api", "serveBundle"));
|
|
31
|
+
return {
|
|
32
|
+
firstLoad: m,
|
|
33
|
+
firstLoadGzip: m.reduce((e, t) => e + t.gzip, 0),
|
|
34
|
+
css: h,
|
|
35
|
+
cssGzip: h.reduce((e, t) => e + t.gzip, 0),
|
|
36
|
+
totalGzip: _,
|
|
37
|
+
chunkCount: v,
|
|
38
|
+
ssrEntryBytes: t(y) ? i(y).size : 0,
|
|
39
|
+
startBundleBytes: b.bytes,
|
|
40
|
+
startBundleFiles: b.files,
|
|
41
|
+
serveBundleBytes: x.bytes,
|
|
42
|
+
serveBundleFiles: x.files
|
|
43
|
+
};
|
|
44
|
+
}, u = (e) => `${(e / 1024).toFixed(1)} KB`, d = (e) => `${(e / 1e6).toFixed(2)} MB`, f = (e) => {
|
|
45
|
+
if (e === null) return [];
|
|
46
|
+
let t = [
|
|
47
|
+
"",
|
|
48
|
+
"build report — what a visitor downloads",
|
|
49
|
+
""
|
|
50
|
+
];
|
|
51
|
+
t.push(` first load ${u(e.firstLoadGzip).padStart(10)} gz ${e.firstLoad.length} file(s), entry + modulepreload`), e.css.length > 0 && t.push(` css ${u(e.cssGzip).padStart(10)} gz ${e.css.length} stylesheet(s)`), t.push(` all chunks ${u(e.totalGzip).padStart(10)} gz ${e.chunkCount} chunk(s), eager + lazy`);
|
|
52
|
+
let n = [...e.firstLoad].sort((e, t) => t.gzip - e.gzip).slice(0, 5);
|
|
53
|
+
if (n.length > 0) {
|
|
54
|
+
t.push("");
|
|
55
|
+
for (let r of n) {
|
|
56
|
+
let n = e.firstLoadGzip === 0 ? 0 : Math.round(r.gzip / e.firstLoadGzip * 100);
|
|
57
|
+
t.push(` ${u(r.gzip).padStart(10)} gz ${String(n).padStart(3)}% ${r.file}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
let r = n[0];
|
|
61
|
+
return r !== void 0 && e.firstLoadGzip > 0 && r.gzip > e.firstLoadGzip / 2 && (t.push(""), t.push(` ⚠ one chunk is ${Math.round(r.gzip / e.firstLoadGzip * 100)}% of the first load: ${r.file}`), t.push(" Every visitor downloads it before the page is interactive. If that is"), t.push(" data rather than code (a content glob, a locale catalog, a dataset),"), t.push(" it usually belongs behind a dynamic import or a build-time index.")), (e.ssrEntryBytes > 0 || e.startBundleFiles > 0 || e.serveBundleFiles > 0) && (t.push(""), t.push(" server artefacts (what the image ships and a cold boot loads)"), e.ssrEntryBytes > 0 && t.push(` ssr bundle ${d(e.ssrEntryBytes).padStart(10)}`), e.startBundleFiles > 0 && t.push(` start bundle ${d(e.startBundleBytes).padStart(10)} ${e.startBundleFiles} file(s)`), e.serveBundleFiles > 0 && t.push(` serve bundle ${d(e.serveBundleBytes).padStart(10)} ${e.serveBundleFiles} file(s)`)), t.push(""), t;
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { l as collectBuildReport, f as formatBuildReport };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./cliArgs-D4p8n7EE.js";
|
|
2
|
-
import { a as t, l as n } from "./codegen-
|
|
2
|
+
import { a as t, l as n } from "./codegen-Bth5lUTU.js";
|
|
3
3
|
import { r } from "./appGraph-yRuKjOba.js";
|
|
4
4
|
import { n as i } from "./cliOutput-D1tSBoRM.js";
|
|
5
|
-
import { n as a, o, r as s, t as c } from "./inspectFetch-
|
|
5
|
+
import { n as a, o, r as s, t as c } from "./inspectFetch-BU1NyzxV.js";
|
|
6
6
|
import { r as l } from "./fileTaxonomy-CbyMQYx_.js";
|
|
7
|
-
import { S as u } from "./doctorCommand-
|
|
7
|
+
import { S as u } from "./doctorCommand-aR_bFmIi.js";
|
|
8
8
|
import { resolve as d } from "node:path";
|
|
9
9
|
import { readdirSync as f, statSync as p } from "node:fs";
|
|
10
10
|
import { isReactivityChannelKey as m } from "@voltro/protocol";
|
|
@@ -170,9 +170,9 @@ var h = (e) => (e === void 0 ? [] : typeof e == "string" ? [e] : e).filter((e) =
|
|
|
170
170
|
let t = e.severity === "error" ? "✗ error" : "⚠ warn", n = e.file ? ` (${e.file})` : "";
|
|
171
171
|
return `${t} ${e.rule} ${e.node}${n}\n ${e.breaks.join("; ")}\n fix: ${e.fix}`;
|
|
172
172
|
}).join("\n"), O = async (e) => {
|
|
173
|
-
let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-
|
|
173
|
+
let { walk: t, loadDiscovered: n, loadApiConfig: r } = await import("./dev-B9Gz0k85.js"), { buildRpcEntry: i } = await import("./manifestBuild-DIa_s6u0.js"), { buildCapabilityManifest: a } = await import("./inspect-S2rWy1Ys.js"), { relative: o } = await import("node:path"), s = await n(await t(e)), c = await r(e).then((e) => e?.plugins ?? []).catch(() => []);
|
|
174
174
|
try {
|
|
175
|
-
let { mergePluginRoutesInto: e } = await import("./dev-
|
|
175
|
+
let { mergePluginRoutesInto: e } = await import("./dev-B9Gz0k85.js");
|
|
176
176
|
e({
|
|
177
177
|
plugins: c,
|
|
178
178
|
queries: s.queries,
|
|
@@ -189,7 +189,7 @@ var h = (e) => (e === void 0 ? [] : typeof e == "string" ? [e] : e).filter((e) =
|
|
|
189
189
|
...s.mutations.map((e) => l(e.descriptor, "mutation", e.file)),
|
|
190
190
|
...s.actions.map((e) => l(e.descriptor, "action", e.file)),
|
|
191
191
|
...s.streams.map((e) => l(e.descriptor, "stream", e.file))
|
|
192
|
-
], { assembleFrameworkTables: d } = await import("./frameworkTableAssembly-
|
|
192
|
+
], { assembleFrameworkTables: d } = await import("./frameworkTableAssembly-CGNC0qr7.js"), f = await d({ root: e }).catch((e) => (console.warn(`\n⚠ plugin tables could not be collected — this report is INCOMPLETE.\n ${e instanceof Error ? e.message.split("\n")[0] : String(e)}\n`), [])), p = new Set(s.tables.map((e) => e.tableName)), m = [...[...p].map((e) => ({ name: e })), ...f.map((e) => e.tableName).filter((e) => !p.has(e)).map((e) => ({
|
|
193
193
|
name: e,
|
|
194
194
|
framework: !0
|
|
195
195
|
}))], h = c;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, o as n } from "./checkCommand-
|
|
1
|
+
import { a as e, i as t, o as n } from "./checkCommand-CAwFXrxA.js";
|
|
2
2
|
export { t as offlineManifest, e as runCheckCommand, n as toInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e } from "./cliOutput-D1tSBoRM.js";
|
|
2
|
-
import { n as t, o as n, r, t as i } from "./inspectFetch-
|
|
2
|
+
import { n as t, o as n, r, t as i } from "./inspectFetch-BU1NyzxV.js";
|
|
3
3
|
import { ansi as a } from "@voltro/logger";
|
|
4
4
|
//#region src/clusterCmd.ts
|
|
5
5
|
var o = () => {
|
|
@@ -10,7 +10,8 @@ import { isAgentDescriptor as m } from "@voltro/ai/agent";
|
|
|
10
10
|
var h = /* @__PURE__ */ new Set(/* @__PURE__ */ "crypto.fs.path.os.net.http.https.http2.tls.dns.dgram.stream.zlib.child_process.worker_threads.cluster.readline.vm.module.perf_hooks.async_hooks.inspector.v8.process.tty.repl.constants.sys.string_decoder".split(".")), g = (e) => e.startsWith("node:") || h.has(e) || e === "@voltro/workflow" ? !0 : e === "@voltro/database/wire" ? !1 : e === "@voltro/database" || e.startsWith("@voltro/database/") || e === "@voltro/runtime" || e.startsWith("@voltro/runtime/") ? !0 : e === "@voltro/ai/agent" || e === "@voltro/ai/events" ? !1 : !!(e === "@voltro/ai" || e.startsWith("@voltro/ai/") || [
|
|
11
11
|
"@voltro/protocol/session",
|
|
12
12
|
"@voltro/protocol/jwt",
|
|
13
|
-
"@voltro/protocol/apikey"
|
|
13
|
+
"@voltro/protocol/apikey",
|
|
14
|
+
"@voltro/protocol/identity"
|
|
14
15
|
].includes(e) || e === "@voltro/env/server" || e.startsWith("@effect/cluster") || e.startsWith("@effect/sql") || e === "@effect/platform-node" || [
|
|
15
16
|
"pg",
|
|
16
17
|
"postgres",
|
|
@@ -304,8 +305,8 @@ ${o.join("\n\n")}\n`);
|
|
|
304
305
|
file: t,
|
|
305
306
|
reason: "a descriptor changed since the group was generated"
|
|
306
307
|
};
|
|
307
|
-
}, Q = (e, t, n, i = [], o = [], s = !1, l = !1, u = [], d = "") => {
|
|
308
|
-
let
|
|
308
|
+
}, Q = (e, t, n, i = [], o = [], s = !1, l = !1, u = [], d = {}, f = "") => {
|
|
309
|
+
let m = o.length > 0, h = o.flatMap((e) => [{
|
|
309
310
|
file: e.file,
|
|
310
311
|
exportName: e.exportName,
|
|
311
312
|
rpcTag: `${e.name}.send`,
|
|
@@ -315,7 +316,7 @@ ${o.join("\n\n")}\n`);
|
|
|
315
316
|
exportName: e.exportName,
|
|
316
317
|
rpcTag: `${e.name}.messages`,
|
|
317
318
|
kind: "query"
|
|
318
|
-
}]),
|
|
319
|
+
}]), g = [...new Map(u.map((e) => [e.tag, e])).values()].sort((e, t) => e.tag < t.tag ? -1 : 1), _ = g.map((e) => ({
|
|
319
320
|
file: `plugin:${e.module}`,
|
|
320
321
|
exportName: e.name,
|
|
321
322
|
rpcTag: e.tag,
|
|
@@ -323,26 +324,26 @@ ${o.join("\n\n")}\n`);
|
|
|
323
324
|
}));
|
|
324
325
|
ee([
|
|
325
326
|
...n,
|
|
326
|
-
...
|
|
327
|
-
...
|
|
327
|
+
...h,
|
|
328
|
+
..._
|
|
328
329
|
], e), q([
|
|
329
330
|
...n,
|
|
330
|
-
...
|
|
331
|
-
...
|
|
331
|
+
...h,
|
|
332
|
+
..._
|
|
332
333
|
], e);
|
|
333
|
-
let
|
|
334
|
-
let t = `./${a(
|
|
335
|
-
return `import { ${e.exportName} as ${
|
|
336
|
-
},
|
|
337
|
-
let t = G(e.rpcTag), n =
|
|
338
|
-
return e.kind === "query" ? `export const ${t} = queryToRpc(${n}${
|
|
334
|
+
let v = (e) => e.replace(/[^a-zA-Z0-9_$]/g, "_"), y = (e) => `__src_agent_${v(e.name)}`, b = (e) => `__agentRoutes_${v(e.name)}`, x = i.length > 0, S = i.map((e, t) => `import { ${e.name} as __pe${t} } from '${e.module}'`), C = x ? ", __voltroPluginErrors" : "", w = g.length > 0, T = g.map((e, t) => `import { ${e.name} as __prpc${t} } from '${e.module}'`), E = (e) => e === "query" ? "queryToRpc" : e === "mutation" ? "mutationToRpc" : "actionToRpc", D = g.map((e, t) => `export const ${G(e.tag)} = ${E(e.kind)}(withRpcTag(__prpc${t}, ${JSON.stringify(e.tag)})${C})`), O = g.map((e) => ` ${G(e.tag)},`), k = [...n].sort((e, t) => e.kind === t.kind ? e.rpcTag < t.rpcTag ? -1 : 1 : J(e.kind) - J(t.kind)), A = r(t), j = (e) => `__src_${G(e.rpcTag)}`, M = (e) => {
|
|
335
|
+
let t = `./${a(A, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}`;
|
|
336
|
+
return `import { ${e.exportName} as ${j(e)} } from '${t}'`;
|
|
337
|
+
}, N = (e) => {
|
|
338
|
+
let t = G(e.rpcTag), n = j(e);
|
|
339
|
+
return e.kind === "query" ? `export const ${t} = queryToRpc(${n}${C})` : e.kind === "mutation" ? `export const ${t} = mutationToRpc(${n}${C})` : e.kind === "action" ? `export const ${t} = actionToRpc(${n}${C})` : e.kind === "stream" ? `export const ${t} = streamToRpc(${n}${C})` : e.kind === "event" ? `export const ${t} = eventToRpc(${n}${C})` : [
|
|
339
340
|
`export const ${t} = Rpc.make('${e.rpcTag}', {`,
|
|
340
341
|
` payload: strictInput(${n}.payloadSchema),`,
|
|
341
342
|
" success: WorkflowRunHandleSchema,",
|
|
342
343
|
` error: ${n}.errorSchema,`,
|
|
343
344
|
"})"
|
|
344
345
|
].join("\n");
|
|
345
|
-
},
|
|
346
|
+
}, P = [...k.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => ` | __AppErrorOf<typeof ${j(e)}>`), ...x ? [" | Schema.Schema.Type<(typeof __voltroPluginErrors)[number]>"] : []], F = P.length > 0, I = k.some((e) => e.kind === "workflow"), L = I ? [
|
|
346
347
|
"__voltroWorkflowRun",
|
|
347
348
|
"__voltroWorkflowRuns",
|
|
348
349
|
"__voltroWorkflowRunSteps",
|
|
@@ -353,27 +354,29 @@ ${o.join("\n\n")}\n`);
|
|
|
353
354
|
"__voltroWorkflowResume",
|
|
354
355
|
"__voltroWorkflowSignal",
|
|
355
356
|
"__voltroWorkflowUpdate"
|
|
356
|
-
] : [],
|
|
357
|
+
] : [], R = s ? [
|
|
357
358
|
"__voltroUndoLog",
|
|
358
359
|
"__voltroUndoApply",
|
|
359
360
|
"__voltroUndoRedo"
|
|
360
|
-
] : [],
|
|
361
|
+
] : [], z = k.some((e) => e.requiresApproval === !0), B = z ? ["__voltroApprovalsPending", "__voltroApprovalsDecide"] : [], V = l ? [
|
|
361
362
|
"__voltroConnectionsList",
|
|
362
363
|
"__voltroConnectionStart",
|
|
363
364
|
"__voltroConnectionSubmitToken",
|
|
364
365
|
"__voltroConnectionDisconnect"
|
|
365
|
-
] : [],
|
|
366
|
-
...
|
|
366
|
+
] : [], H = [
|
|
367
|
+
...k.map((e) => ` ${G(e.rpcTag)},`),
|
|
367
368
|
...o.flatMap((e) => [` ${G(`${e.name}.send`)},`, ` ${G(`${e.name}.messages`)},`]),
|
|
368
|
-
...I.map((e) => ` ${e},`),
|
|
369
369
|
...L.map((e) => ` ${e},`),
|
|
370
|
-
...
|
|
370
|
+
...R.map((e) => ` ${e},`),
|
|
371
371
|
...B.map((e) => ` ${e},`),
|
|
372
|
-
...
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
372
|
+
...V.map((e) => ` ${e},`),
|
|
373
|
+
...O
|
|
374
|
+
].join("\n"), U = ["queryToRpc"];
|
|
375
|
+
w && U.push("withRpcTag");
|
|
376
|
+
let W = Object.entries(d).sort(([e], [t]) => e < t ? -1 : 1), K = W.length > 0;
|
|
377
|
+
K && U.push("registerPluginAliases"), (k.some((e) => e.kind === "mutation") || g.some((e) => e.kind === "mutation")) && U.push("mutationToRpc"), (k.some((e) => e.kind === "action") || I || m || g.some((e) => e.kind === "action")) && U.push("actionToRpc"), k.some((e) => e.kind === "stream") && U.push("streamToRpc"), k.some((e) => e.kind === "event") && U.push("eventToRpc"), I && U.push("strictInput", "WorkflowRunHandleSchema", "workflowCancelDescriptor", "workflowDomainEventsQueryDescriptor", "workflowEventDeliveriesQueryDescriptor", "workflowResumeDescriptor", "workflowRunEventsQueryDescriptor", "workflowRunQueryDescriptor", "workflowRunsQueryDescriptor", "workflowRunStepsQueryDescriptor", "workflowSignalDescriptor", "workflowUpdateDescriptor"), s && U.push("mutationToRpc", "undoLogQueryDescriptor", "undoApplyDescriptor", "undoRedoDescriptor"), z && U.push("mutationToRpc", "approvalsPendingQueryDescriptor", "approvalsDecideDescriptor"), l && U.push("mutationToRpc", "actionToRpc", "connectionsListQueryDescriptor", "connectionStartDescriptor", "connectionSubmitTokenDescriptor", "connectionDisconnectDescriptor"), (k.some((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream") || m || I || s || z || l || w) && U.push("normalizeDescriptor");
|
|
378
|
+
let Y = [...new Set(U)].sort(), X = [...k.filter((e) => e.kind === "query" || e.kind === "mutation" || e.kind === "action" || e.kind === "stream").map((e) => [e.rpcTag, j(e)]), ...o.flatMap((e) => [[`${e.name}.send`, `${b(e)}.send`], [`${e.name}.messages`, `${b(e)}.messages`]])], Z = [
|
|
379
|
+
...I ? [
|
|
377
380
|
["__voltro.workflow.run", "workflowRunQueryDescriptor"],
|
|
378
381
|
["__voltro.workflow.runs", "workflowRunsQueryDescriptor"],
|
|
379
382
|
["__voltro.workflow.run.steps", "workflowRunStepsQueryDescriptor"],
|
|
@@ -390,20 +393,20 @@ ${o.join("\n\n")}\n`);
|
|
|
390
393
|
["__voltro.undo.apply", "undoApplyDescriptor"],
|
|
391
394
|
["__voltro.undo.redo", "undoRedoDescriptor"]
|
|
392
395
|
] : [],
|
|
393
|
-
...
|
|
396
|
+
...z ? [["__voltro.approvals.pending", "approvalsPendingQueryDescriptor"], ["__voltro.approvals.decide", "approvalsDecideDescriptor"]] : [],
|
|
394
397
|
...l ? [
|
|
395
398
|
["__voltro.connections.list", "connectionsListQueryDescriptor"],
|
|
396
399
|
["__voltro.connections.start", "connectionStartDescriptor"],
|
|
397
400
|
["__voltro.connections.submitToken", "connectionSubmitTokenDescriptor"],
|
|
398
401
|
["__voltro.connections.disconnect", "connectionDisconnectDescriptor"]
|
|
399
402
|
] : [],
|
|
400
|
-
...
|
|
401
|
-
],
|
|
402
|
-
...
|
|
403
|
-
...
|
|
404
|
-
...
|
|
405
|
-
],
|
|
406
|
-
let t =
|
|
403
|
+
...g.map((e, t) => [e.tag, `__prpc${t}`])
|
|
404
|
+
], Q = ([e, t]) => ` ${JSON.stringify(e)}: normalizeDescriptor(${t}),`, $ = ([e, t]) => ` readonly ${JSON.stringify(e)}: typeof ${t}`, ne = X.map(Q), re = Z.map(Q), ie = k.filter((e) => e.kind === "workflow").map((e) => ` ${JSON.stringify(e.rpcTag)}: { kind: 'workflow' },`), ae = k.filter((e) => e.kind === "workflow").map((e) => ` readonly ${JSON.stringify(e.rpcTag)}: { readonly kind: 'workflow' }`), oe = [
|
|
405
|
+
...X.map($),
|
|
406
|
+
...ae,
|
|
407
|
+
...Z.map($)
|
|
408
|
+
], se = k.filter((e) => e.kind === "workflow").map((e) => {
|
|
409
|
+
let t = j(e);
|
|
407
410
|
return [
|
|
408
411
|
` ${JSON.stringify(e.rpcTag)}: {`,
|
|
409
412
|
" kind: 'workflow',",
|
|
@@ -414,44 +417,53 @@ ${o.join("\n\n")}\n`);
|
|
|
414
417
|
` updates: __voltroWorkflowMessages(${t}).updates,`,
|
|
415
418
|
" },"
|
|
416
419
|
].join("\n");
|
|
417
|
-
}),
|
|
420
|
+
}), ce = [...k, ...o.map((e) => ({
|
|
418
421
|
rpcTag: `agent:${e.name}`,
|
|
419
422
|
file: e.file
|
|
420
423
|
}))];
|
|
421
424
|
return [
|
|
422
425
|
"// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
|
|
423
426
|
"// Re-emitted by `voltro dev` whenever query/mutation/action/stream/workflow files change.",
|
|
424
|
-
`// descriptor-fingerprint: ${p("sha1").update(
|
|
427
|
+
`// descriptor-fingerprint: ${p("sha1").update(ce.map((e) => {
|
|
425
428
|
let t = "";
|
|
426
429
|
try {
|
|
427
430
|
t = c(e.file, "utf8");
|
|
428
431
|
} catch {}
|
|
429
432
|
return `${e.rpcTag}\u0000${t}`;
|
|
430
433
|
}).join("")).digest("hex").slice(0, 16)}`,
|
|
431
|
-
`${te}${
|
|
434
|
+
`${te}${f}`,
|
|
432
435
|
"// Source files:",
|
|
433
|
-
...
|
|
436
|
+
...k.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")}`),
|
|
434
437
|
...o.map((t) => `// - ${a(e, t.file).replace(/\\/g, "/")} (agent)`),
|
|
435
438
|
"",
|
|
436
|
-
|
|
437
|
-
...
|
|
438
|
-
`import { ${
|
|
439
|
-
...
|
|
439
|
+
I ? "import { Rpc, RpcGroup } from '@effect/rpc'" : "import { RpcGroup } from '@effect/rpc'",
|
|
440
|
+
...I || F ? ["import { Schema } from 'effect'"] : [],
|
|
441
|
+
`import { ${Y.join(", ")} } from '@voltro/protocol'`,
|
|
442
|
+
...m ? ["import { agentRouteDescriptors as __voltroAgentRoutes } from '@voltro/ai/agent'"] : [],
|
|
440
443
|
"",
|
|
441
|
-
...
|
|
442
|
-
...o.map((e) => `import { ${e.exportName} as ${
|
|
443
|
-
...
|
|
444
|
-
...
|
|
444
|
+
...k.map(M),
|
|
445
|
+
...o.map((e) => `import { ${e.exportName} as ${y(e)} } from './${a(A, e.file).replace(/\\/g, "/").replace(/\.tsx?$/, "")}'`),
|
|
446
|
+
...x ? ["", ...S] : [],
|
|
447
|
+
...w ? ["", ...T] : [],
|
|
448
|
+
...K ? [
|
|
449
|
+
"",
|
|
450
|
+
"/** Which namespace each installed plugin answers to in THIS app. Read by",
|
|
451
|
+
" * the plugins' own client hooks via `pluginTag()` so an `alias` in",
|
|
452
|
+
" * app.config.ts moves them too, not just the server's routes. */",
|
|
453
|
+
"registerPluginAliases({",
|
|
454
|
+
...W.map(([e, t]) => ` ${JSON.stringify(e)}: ${JSON.stringify(t)},`),
|
|
455
|
+
"})"
|
|
456
|
+
] : [],
|
|
445
457
|
"",
|
|
446
|
-
...o.map((e) => `const ${
|
|
447
|
-
...
|
|
448
|
-
...
|
|
458
|
+
...o.map((e) => `const ${b(e)} = __voltroAgentRoutes(${y(e)})`),
|
|
459
|
+
...m ? [""] : [],
|
|
460
|
+
...x ? [
|
|
449
461
|
"/** Cross-cutting plugin error schemas, unioned into every rpc's",
|
|
450
462
|
" * wire error so interceptor failures decode typed on the client. */",
|
|
451
463
|
`const __voltroPluginErrors = [${i.map((e, t) => `__pe${t}`).join(", ")}] as const`,
|
|
452
464
|
""
|
|
453
465
|
] : [],
|
|
454
|
-
...
|
|
466
|
+
...I ? [
|
|
455
467
|
"const __voltroEmptyWorkflowMessages = { signals: {}, updates: {} } as const",
|
|
456
468
|
"const __voltroWorkflowMessages = <const M extends {",
|
|
457
469
|
" readonly signals: Readonly<Record<string, Schema.Schema.Any>>",
|
|
@@ -460,7 +472,7 @@ ${o.join("\n\n")}\n`);
|
|
|
460
472
|
" definition.__voltroWorkflowMessages ?? __voltroEmptyWorkflowMessages",
|
|
461
473
|
"",
|
|
462
474
|
"export const workflowDescriptors = {",
|
|
463
|
-
...
|
|
475
|
+
...se,
|
|
464
476
|
"} as const",
|
|
465
477
|
"",
|
|
466
478
|
"export type WorkflowDescriptors = typeof workflowDescriptors",
|
|
@@ -479,9 +491,9 @@ ${o.join("\n\n")}\n`);
|
|
|
479
491
|
"} }",
|
|
480
492
|
""
|
|
481
493
|
] : [],
|
|
482
|
-
...
|
|
483
|
-
...o.flatMap((e) => [`export const ${G(`${e.name}.send`)} = actionToRpc(${
|
|
484
|
-
...
|
|
494
|
+
...k.map(N),
|
|
495
|
+
...o.flatMap((e) => [`export const ${G(`${e.name}.send`)} = actionToRpc(${b(e)}.send${C})`, `export const ${G(`${e.name}.messages`)} = queryToRpc(${b(e)}.messages${C})`]),
|
|
496
|
+
...I ? [
|
|
485
497
|
"export const __voltroWorkflowRun = queryToRpc(workflowRunQueryDescriptor)",
|
|
486
498
|
"export const __voltroWorkflowRuns = queryToRpc(workflowRunsQueryDescriptor)",
|
|
487
499
|
"export const __voltroWorkflowRunSteps = queryToRpc(workflowRunStepsQueryDescriptor)",
|
|
@@ -498,26 +510,26 @@ ${o.join("\n\n")}\n`);
|
|
|
498
510
|
"export const __voltroUndoApply = mutationToRpc(undoApplyDescriptor)",
|
|
499
511
|
"export const __voltroUndoRedo = mutationToRpc(undoRedoDescriptor)"
|
|
500
512
|
] : [],
|
|
501
|
-
...
|
|
513
|
+
...z ? ["export const __voltroApprovalsPending = queryToRpc(approvalsPendingQueryDescriptor)", "export const __voltroApprovalsDecide = mutationToRpc(approvalsDecideDescriptor)"] : [],
|
|
502
514
|
...l ? [
|
|
503
515
|
"export const __voltroConnectionsList = queryToRpc(connectionsListQueryDescriptor)",
|
|
504
516
|
"export const __voltroConnectionStart = actionToRpc(connectionStartDescriptor)",
|
|
505
517
|
"export const __voltroConnectionSubmitToken = mutationToRpc(connectionSubmitTokenDescriptor)",
|
|
506
518
|
"export const __voltroConnectionDisconnect = mutationToRpc(connectionDisconnectDescriptor)"
|
|
507
519
|
] : [],
|
|
508
|
-
...
|
|
520
|
+
...D,
|
|
509
521
|
"",
|
|
510
522
|
"export const appGroup = RpcGroup.make(",
|
|
511
|
-
|
|
523
|
+
H,
|
|
512
524
|
")",
|
|
513
525
|
"",
|
|
514
526
|
"/** Per-rpc-tag metadata for the client. Drives auto-optimistic etc.",
|
|
515
527
|
" * Function fields (target.shape, target.identify) survive because",
|
|
516
528
|
" * the descriptors themselves are imported by reference. */",
|
|
517
529
|
"export const appDescriptors = {",
|
|
518
|
-
...
|
|
519
|
-
|
|
520
|
-
...
|
|
530
|
+
...ne,
|
|
531
|
+
...ie,
|
|
532
|
+
...re,
|
|
521
533
|
"} as const",
|
|
522
534
|
"",
|
|
523
535
|
"export type AppDescriptors = typeof appDescriptors",
|
|
@@ -541,16 +553,16 @@ ${o.join("\n\n")}\n`);
|
|
|
541
553
|
" * Types only — erased at build time, so importing it costs the bundle",
|
|
542
554
|
" * nothing. */",
|
|
543
555
|
"export type AppProcedures = {",
|
|
544
|
-
...
|
|
556
|
+
...oe,
|
|
545
557
|
"}",
|
|
546
558
|
"",
|
|
547
|
-
...
|
|
559
|
+
...F ? [
|
|
548
560
|
"type __AppErrorOf<D> = D extends { readonly error: infer E extends Schema.Schema.Any } ? Schema.Schema.Type<E> : never",
|
|
549
561
|
"/** Union of every typed error the app's rpcs can fail with — the declared",
|
|
550
562
|
" * `error:` schemas + cross-cutting plugin errors. Generated by reference,",
|
|
551
563
|
" * so it can never drift out of date. (Workflows: see `WorkflowErrors`.) */",
|
|
552
564
|
"export type AppError =",
|
|
553
|
-
...
|
|
565
|
+
...P,
|
|
554
566
|
"/** The `_tag` literal of every AppError — the exhaustive key set for `matchError`. */",
|
|
555
567
|
"export type AppErrorTag = AppError extends { readonly _tag: infer T extends string } ? T : never",
|
|
556
568
|
"",
|
|
@@ -594,7 +606,7 @@ ${o.join("\n\n")}\n`);
|
|
|
594
606
|
"workflows"
|
|
595
607
|
]), p = (e) => e.slice(e.lastIndexOf("/") + 1), m = u;
|
|
596
608
|
for (; m !== t && d.has(p(m));) m = m.slice(0, m.lastIndexOf("/")) || "/";
|
|
597
|
-
let h = o(e.outputFile ?? i(m, "rpcGroup.generated.ts")), g = [...new Map((e.pluginErrorImports ?? []).map((e) => [`${e.module}#${e.name}`, e])).values()], _ = [...new Map((e.pluginRpcImports ?? []).map((e) => [e.tag, e])).values()], v = await Y(r(h)), y = Q(t, h, a, g, c, f(), l, _, v), b = [];
|
|
609
|
+
let h = o(e.outputFile ?? i(m, "rpcGroup.generated.ts")), g = [...new Map((e.pluginErrorImports ?? []).map((e) => [`${e.module}#${e.name}`, e])).values()], _ = [...new Map((e.pluginRpcImports ?? []).map((e) => [e.tag, e])).values()], v = await Y(r(h)), y = Q(t, h, a, g, c, f(), l, _, e.pluginAliases ?? {}, v), b = [];
|
|
598
610
|
for (let t of e.pluginContributions ?? []) {
|
|
599
611
|
let e = null;
|
|
600
612
|
try {
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as a } from "./frameworkTableAssembly-
|
|
3
|
-
import { i as o, r as s } from "./codegen-
|
|
1
|
+
import { An as e, V as t, kn as n, l as r, u as i } from "./dev-Dw263KPu.js";
|
|
2
|
+
import { n as a } from "./frameworkTableAssembly-DNOFXfEQ.js";
|
|
3
|
+
import { i as o, r as s } from "./codegen-Bth5lUTU.js";
|
|
4
4
|
import { n as c, r as l } from "./mobileCommand-D9O6iq3D.js";
|
|
5
5
|
import { basename as u, relative as d, resolve as f } from "node:path";
|
|
6
6
|
//#region src/codegenCommand.ts
|
|
7
|
-
var p = async (
|
|
8
|
-
let { config: i, present: a, error: o } = await r(
|
|
7
|
+
var p = async (n) => {
|
|
8
|
+
let { config: i, present: a, error: o } = await r(n);
|
|
9
9
|
if (a && i === null) return {
|
|
10
10
|
kind: "refused",
|
|
11
11
|
reason: "app.config.ts exists but could not be loaded" + (o === void 0 ? "" : ` — ${o instanceof Error ? o.message : String(o)}`)
|
|
12
12
|
};
|
|
13
|
-
let c = i?.plugins ?? [], { pluginContributions: l, pluginErrorImports: d, pluginRpcImports: f } = await
|
|
14
|
-
root:
|
|
13
|
+
let c = i?.plugins ?? [], { pluginContributions: l, pluginErrorImports: d, pluginRpcImports: f, pluginAliases: p } = await t(c, i?.name ?? u(n), n), h = await s({
|
|
14
|
+
root: n,
|
|
15
15
|
...l.length > 0 ? { pluginContributions: l } : {},
|
|
16
16
|
...d.length > 0 ? { pluginErrorImports: d } : {},
|
|
17
17
|
...f.length > 0 ? { pluginRpcImports: f } : {},
|
|
18
|
+
...Object.keys(p).length > 0 ? { pluginAliases: p } : {},
|
|
18
19
|
...i?.name === void 0 ? {} : { apiName: i.name }
|
|
19
20
|
});
|
|
20
|
-
if (!
|
|
21
|
-
let
|
|
21
|
+
if (!h) return { kind: "nothing-to-write" };
|
|
22
|
+
let g = await m(n, i), _ = await e(h, g);
|
|
22
23
|
return {
|
|
23
24
|
kind: "wrote",
|
|
24
|
-
file:
|
|
25
|
+
file: h,
|
|
25
26
|
plugins: c.length,
|
|
26
27
|
errorSchemas: d.length,
|
|
27
28
|
routes: f.length,
|
|
28
|
-
tables:
|
|
29
|
-
dts:
|
|
29
|
+
tables: g.size,
|
|
30
|
+
dts: _
|
|
30
31
|
};
|
|
31
|
-
}, m = async (e,
|
|
32
|
+
}, m = async (e, t) => {
|
|
32
33
|
let r = await o(e), { tables: s } = await i(r), c = await a({ root: e });
|
|
33
|
-
return
|
|
34
|
+
return n(s, c, t?.analytics?.tables ?? []);
|
|
34
35
|
}, h = async (e) => {
|
|
35
36
|
let t = f(e.find((e) => !e.startsWith("-")) ?? process.cwd()), n = await l(t);
|
|
36
37
|
if (n.apis.kind !== "not-a-mobile-app") return c(t, n);
|