@voltro/cli 0.53.0 → 0.54.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 +195 -0
- package/dist/{agentsMd-0l980yhL.js → agentsMd-BaLC10Na.js} +110 -82
- package/dist/agentsMd-DCY1RSs8.js +2 -0
- package/dist/apiBuild-CeUN55uk.js +2 -0
- package/dist/{apiBuild-CaPfoWku.js → apiBuild-DTWp0S_q.js} +2 -2
- package/dist/bin.js +1 -1
- package/dist/{build-D-OnvNMf.js → build-D4ygSbnV.js} +114 -114
- package/dist/{checkCommand-C5elt0tW.js → checkCommand-Dg1G7Gwd.js} +6 -6
- package/dist/{checkCommand-D2ZduVlh.js → checkCommand-L7DTlpIF.js} +1 -1
- package/dist/{cloudCmd-QUXh-b5w.js → cloudCmd-DzKcSYuy.js} +1 -1
- package/dist/{codegen-FEk8AZHb.js → codegen-DSLM8Su9.js} +2 -2
- package/dist/codegen-DjgxEOnD.js +2 -0
- package/dist/codegenCommand-CG_Vx4lc.js +41 -0
- package/dist/{codemodRunner-BjtB2lq6.js → codemodRunner-Cd4xkC6u.js} +9 -9
- package/dist/{commands-DyxAmhP0.js → commands-6Kzi92Np.js} +96 -73
- package/dist/{dashboardCommand-BdKTyT13.js → dashboardCommand-Cq1PWvI1.js} +3 -3
- package/dist/{dataCommand-Bab9X7s8.js → dataCommand-DYzW8vkv.js} +3 -3
- package/dist/{dbCommand-06O2finM.js → dbCommand-B4NWZtGL.js} +3 -3
- package/dist/dbCommand-CSFWs9ev.js +2 -0
- package/dist/{dev-C6LGF4iY.js → dev-CmuvUKRq.js} +2236 -2219
- package/dist/{dev-GjJWAYo2.js → dev-cKUiZZsB.js} +1 -1
- package/dist/{doctorCommand-etMkflRc.js → doctorCommand-DCiFVMtZ.js} +21 -21
- package/dist/doctorCommand-J3qu4E0Y.js +2 -0
- package/dist/{dormancyCommand-UwZ1AZzB.js → dormancyCommand-w1TrmgYP.js} +1 -1
- package/dist/{embeddingsCommand-C70zWHwo.js → embeddingsCommand-CMgPyRTr.js} +1 -1
- package/dist/{envCommand-dSyKvRkM.js → envCommand-Cyynmcfa.js} +15 -15
- package/dist/{evolveCommand-CG0_ebO5.js → evolveCommand-BwvQ8dVH.js} +2 -2
- package/dist/fileConventions-l-RIXbx8.js +36 -0
- package/dist/{fileTaxonomy-B7uxipWS.js → fileTaxonomy-CbyMQYx_.js} +37 -37
- package/dist/{frameworkTableAssembly-DKx3ba3S.js → frameworkTableAssembly-D7LJuALW.js} +5 -5
- package/dist/frameworkTableAssembly-IPD1pUnZ.js +2 -0
- package/dist/index.js +2 -2
- package/dist/{infoCommand-_53iOc_j.js → infoCommand-DlYlUPqs.js} +1 -1
- package/dist/{metaCommands-Cn2oboG4.js → metaCommands-x7RCi2AF.js} +2 -2
- package/dist/{migrate-Cko9rswM.js → migrate-BK_Bbx-_.js} +2 -2
- package/dist/mobileCommand-D9O6iq3D.js +428 -0
- package/dist/mobileCommand-DAum7tsG.js +2 -0
- package/dist/{pageConvention-C938S8oC.js → pageConvention-CMpfDN6r.js} +1 -1
- package/dist/{privacyCommand-DWTQMC6R.js → privacyCommand-BCa2OoZG.js} +2 -2
- package/dist/{probeCommand-DkGGLknv.js → probeCommand-_C0YU207.js} +1 -1
- package/dist/{projectScaffold-EzlErR4E.js → projectScaffold-CJfP-xbT.js} +1 -1
- package/dist/{projectScaffold-B4dmTlwT.js → projectScaffold-CSN0OzBV.js} +2 -2
- package/dist/renderModeScan-43yQ2opo.js +147 -0
- package/dist/{renderProfile-CskIgAfn.js → renderProfile-DvrhVJHa.js} +2 -2
- package/dist/{runtimeTrace-c0APJz7E.js → runtimeTrace-CGWx1Q6l.js} +1 -1
- package/dist/{sdkgen-BiQCgIEr.js → sdkgen-CDGHQUFj.js} +1 -1
- package/dist/serveCommand-BiPe8BJm.js +2 -0
- package/dist/{serveCommand-CueKQgzl.js → serveCommand-Bje09q1v.js} +708 -708
- package/dist/serveEntry.js +1 -1
- package/dist/start-B0bnJgxI.js +3 -0
- package/dist/{start-ekPan8BT.js → start-Clz-1BHB.js} +511 -504
- package/dist/startEntry.js +1 -1
- package/dist/{staticCommand-xlSL-IWk.js → staticCommand-ey0kYmOT.js} +1 -1
- package/dist/{subcommandNames-DpYs3DXr.js → subcommandNames-CDzfEtKV.js} +3 -3
- package/dist/{templates-BR-fb4SP.js → templates-BTWZkJJT.js} +41 -9
- package/dist/{test-BWPQcRoB.js → test-D_kW4KMj.js} +1 -1
- package/dist/updateCommand-CIoVDKnj.js +2 -0
- package/dist/{updateCommand-C_8I8Rzo.js → updateCommand-CRJlAOaM.js} +1 -1
- package/dist/{webDev-oczpugbx.js → webDev-DSI9SOhs.js} +1127 -1090
- package/dist/{webDev-C7jWJ5dX.js → webDev-DlvZO30c.js} +1 -1
- package/dist/{webhooksCommand-4SVPDjKg.js → webhooksCommand-BvzXNHji.js} +1 -1
- package/dist/workspaceDeps-RKEkX92S.js +45 -0
- package/package.json +19 -19
- package/templates/AGENTS.core.md +2 -0
- package/templates/AGENTS.md +4 -2
- package/templates/agent-docs/_index.md +2 -2
- package/templates/agent-docs/_manifest.json +1 -1
- package/templates/agent-docs/ai.md +4 -4
- package/templates/agent-docs/authentication.md +72 -0
- package/templates/agent-docs/cli.md +4 -1
- package/templates/agent-docs/data.md +61 -12
- package/templates/agent-docs/database/advancedqueries.md +1 -1
- package/templates/agent-docs/database/migrations.md +1 -1
- package/templates/agent-docs/database/seedsdialects.md +64 -2
- package/templates/agent-docs/internationalization.md +2 -0
- package/templates/agent-docs/introduction.md +25 -0
- package/templates/agent-docs/local-first-mobile.md +139 -41
- package/templates/agent-docs/observability.md +4 -2
- package/templates/agent-docs/plugins/atlassian.md +2 -2
- package/templates/agent-docs/plugins/audit.md +2 -2
- package/templates/agent-docs/plugins/billing.md +1 -1
- package/templates/agent-docs/plugins/cdc-out.md +8 -3
- package/templates/agent-docs/plugins/comments.md +22 -0
- package/templates/agent-docs/plugins/presence.md +32 -3
- package/templates/agent-docs/plugins/prometheus.md +2 -0
- package/templates/agent-docs/plugins/queue.md +47 -4
- package/templates/agent-docs/plugins.md +6 -6
- package/templates/agent-docs/reference.md +20 -1
- package/templates/agent-docs/routing.md +63 -9
- package/templates/agent-docs/scheduling.md +1 -1
- package/templates/agent-docs/schema-driven-ui.md +12 -1
- package/templates/agent-docs/templates/appshells.md +36 -4
- package/templates/agent-docs/whats-new.md +109 -135
- 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/README.md +3 -3
- package/templates/apps/api-collab/app.config.ts +1 -1
- package/templates/apps/api-collab/database/schema.ts +12 -8
- package/templates/apps/api-collab/mutations/documents.create.mutation.server.ts +1 -1
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +1 -1
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.ts +1 -1
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-collab/template.json +1 -1
- package/templates/apps/api-collab/tests/documents.setBody.test.ts +10 -2
- 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 -10
- 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 -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/README.md +43 -24
- package/templates/apps/frontend-collab/app.config.ts +3 -3
- package/templates/apps/frontend-collab/package.json +14 -10
- package/templates/apps/frontend-collab/src/locales/de.ts +1 -2
- package/templates/apps/frontend-collab/src/locales/en.ts +1 -2
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +72 -76
- package/templates/apps/frontend-collab/src/pages/page.tsx +45 -22
- package/templates/apps/frontend-collab/template.json +2 -2
- 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 +8 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/README.md +48 -0
- package/templates/apps/frontend-landing/app.config.ts +28 -0
- package/templates/apps/frontend-landing/package.json +7 -6
- package/templates/apps/frontend-landing/src/assets/hero.jpg +0 -0
- package/templates/apps/frontend-landing/src/fonts/Geist-Variable.woff2 +0 -0
- package/templates/apps/frontend-landing/src/fonts/LICENSE-Geist.txt +92 -0
- package/templates/apps/frontend-landing/src/globals.css +15 -0
- package/templates/apps/frontend-landing/src/globals.d.ts +17 -0
- package/templates/apps/frontend-landing/src/locales/de.ts +3 -2
- package/templates/apps/frontend-landing/src/locales/en.ts +5 -2
- package/templates/apps/frontend-landing/src/pages/page.test.tsx +79 -0
- package/templates/apps/frontend-landing/src/pages/page.tsx +26 -3
- package/templates/apps/frontend-landing/template.json +2 -2
- 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 +8 -7
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +12 -11
- package/templates/apps/mobile-app/src/lib/deeplinks.ts +29 -17
- package/templates/apps/mobile-app/tests/deeplinks.test.ts +16 -0
- package/dist/agentsMd-SDDSkyl4.js +0 -2
- package/dist/apiBuild-DHtLXYx9.js +0 -2
- package/dist/codegen-BWpt3VgF.js +0 -2
- package/dist/codegenCommand-BOiWQ5hz.js +0 -137
- package/dist/dbCommand-B1EXBC6f.js +0 -2
- package/dist/doctorCommand-B0hX0tdz.js +0 -2
- package/dist/fileConventions-DASGEmj-.js +0 -35
- package/dist/frameworkTableAssembly-C_7Z-rMs.js +0 -2
- package/dist/renderModeScan-CUbOeOAg.js +0 -122
- package/dist/serveCommand-DsnrVN3U.js +0 -2
- package/dist/start-BJzZLbt8.js +0 -3
- package/dist/updateCommand-Bqql_rsQ.js +0 -2
|
@@ -1,11 +1,27 @@
|
|
|
1
|
+
// Deep-link routing, against the GENERATED table.
|
|
2
|
+
//
|
|
3
|
+
// Nothing here names a hand-written link, because there are none: every
|
|
4
|
+
// assertion below is about a link `voltro mobile codegen` derived from a screen
|
|
5
|
+
// under `src/app/`. That is the property worth pinning — add
|
|
6
|
+
// `src/app/invoices/[id].tsx` and `/invoices/42` starts working with no other
|
|
7
|
+
// edit. These tests therefore need the table generated first, which is why the
|
|
8
|
+
// `test` script runs codegen (the same way `start` / `ios` do).
|
|
1
9
|
import { describe, expect, it, vi } from 'vitest'
|
|
2
10
|
import { handleDeepLink, makeDeepLinks } from '../src/lib/deeplinks'
|
|
11
|
+
import { DERIVED_DEEP_LINK_PATTERNS } from '../.framework/deepLinks.generated'
|
|
3
12
|
|
|
4
13
|
describe('deep links', () => {
|
|
14
|
+
it('derives one link per screen — nobody wrote this table', () => {
|
|
15
|
+
// src/app/index.tsx, settings.tsx, orders/[id].tsx. `_layout.tsx` is a
|
|
16
|
+
// layout, not a screen, and must not be in here.
|
|
17
|
+
expect([...DERIVED_DEEP_LINK_PATTERNS].sort()).toEqual(['/', '/orders/:id', '/settings'])
|
|
18
|
+
})
|
|
19
|
+
|
|
5
20
|
it('routes an order URL to the order screen with the captured id', () => {
|
|
6
21
|
const navigate = vi.fn()
|
|
7
22
|
const links = makeDeepLinks(navigate)
|
|
8
23
|
expect(handleDeepLink(links, '/orders/42')).toBe(true)
|
|
24
|
+
// A derived link navigates to the screen it came from, params put back.
|
|
9
25
|
expect(navigate).toHaveBeenCalledWith('/orders/42')
|
|
10
26
|
})
|
|
11
27
|
|
package/dist/codegen-BWpt3VgF.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { En as e, Tn as t, V as n, l as r, u as i } from "./dev-C6LGF4iY.js";
|
|
2
|
-
import { Bt as a } from "./webDev-oczpugbx.js";
|
|
3
|
-
import { n as o } from "./frameworkTableAssembly-DKx3ba3S.js";
|
|
4
|
-
import { i as s, r as c } from "./codegen-FEk8AZHb.js";
|
|
5
|
-
import { basename as l, join as u, relative as d, resolve as f } from "node:path";
|
|
6
|
-
import { promises as p } from "node:fs";
|
|
7
|
-
import { pathToFileURL as m } from "node:url";
|
|
8
|
-
//#region src/mobileCodegen.ts
|
|
9
|
-
var h = "voltro.mobile.ts", g = u(".framework", "mobileApis.generated.ts"), _ = (e) => e.replace(/[^a-zA-Z0-9]/g, "_"), v = async (e) => {
|
|
10
|
-
let t = u(e, h);
|
|
11
|
-
try {
|
|
12
|
-
await p.stat(t);
|
|
13
|
-
} catch {
|
|
14
|
-
return { present: !1 };
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
let e = (await import(`${m(t).href}?t=${Date.now()}`)).default;
|
|
18
|
-
return e === void 0 || typeof e != "object" || e.apis === void 0 ? {
|
|
19
|
-
present: !0,
|
|
20
|
-
error: /* @__PURE__ */ Error(`${h} has no default export with an \`apis\` map`)
|
|
21
|
-
} : {
|
|
22
|
-
present: !0,
|
|
23
|
-
binding: e
|
|
24
|
-
};
|
|
25
|
-
} catch (e) {
|
|
26
|
-
return {
|
|
27
|
-
present: !0,
|
|
28
|
-
error: e instanceof Error ? e : Error(String(e))
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}, y = (e, t) => {
|
|
32
|
-
let n = t.filter(([, e]) => e.package !== void 0).map(([e, t]) => {
|
|
33
|
-
let n = `${_(e)}Group`, r = `${_(e)}Descriptors`;
|
|
34
|
-
return `import { ${n === "appGroup" ? "appGroup" : `appGroup as ${n}`}, ${r === "appDescriptors" ? "appDescriptors" : `appDescriptors as ${r}`} } from '${t.package}/rpcGroup'`;
|
|
35
|
-
}), r = t.map(([e, t]) => t.package === void 0 ? ` // ${JSON.stringify(e)}: declared with \`url\` only — no local rpc surface to import.\n // Add \`package: '<the api package>'\` to ${h} to get typed hooks for it.` : ` { ${[
|
|
36
|
-
`name: ${JSON.stringify(e)}`,
|
|
37
|
-
`group: ${_(e)}Group`,
|
|
38
|
-
`descriptors: ${_(e)}Descriptors`,
|
|
39
|
-
`wsUrl: wsUrl(${JSON.stringify(e)})`
|
|
40
|
-
].join(", ")} },`), i = t.filter(([, e]) => e.url !== void 0).map(([e, t]) => ` ${JSON.stringify(e)}: ${JSON.stringify(t.url)},`);
|
|
41
|
-
return [
|
|
42
|
-
"// GENERATED BY `voltro codegen` — do not edit; regenerate with `voltro codegen`.",
|
|
43
|
-
"//",
|
|
44
|
-
`// The api bindings declared in ${h}. Only the BINDING is`,
|
|
45
|
-
"// generated: the procedure types ride the imports below, so a schema change",
|
|
46
|
-
"// in an api needs no regeneration here.",
|
|
47
|
-
"",
|
|
48
|
-
...n,
|
|
49
|
-
"import type { MobileApiBinding } from '@voltro/react-native'",
|
|
50
|
-
"",
|
|
51
|
-
"/** Every api this app talks to, bound to a runtime-resolved ws URL.",
|
|
52
|
-
" *",
|
|
53
|
-
" * The URL is a parameter because it differs per environment and `localhost`",
|
|
54
|
-
" * on a device is the DEVICE — see `resolveDevWsUrl` in @voltro/react-native. */",
|
|
55
|
-
"export const mobileApis = (",
|
|
56
|
-
" wsUrl: (apiName: string) => string,",
|
|
57
|
-
"): ReadonlyArray<MobileApiBinding> => [",
|
|
58
|
-
...r,
|
|
59
|
-
"]",
|
|
60
|
-
"",
|
|
61
|
-
"/** Api names in declaration order — the keys the hooks bind to. */",
|
|
62
|
-
`export const MOBILE_API_NAMES = [${t.map(([e]) => JSON.stringify(e)).join(", ")}] as const`,
|
|
63
|
-
...i.length > 0 ? [
|
|
64
|
-
"",
|
|
65
|
-
`/** URLs declared in ${h} for apis this app does not build. */`,
|
|
66
|
-
"export const MOBILE_API_URLS: Readonly<Record<string, string>> = {",
|
|
67
|
-
...i,
|
|
68
|
-
"}"
|
|
69
|
-
] : [],
|
|
70
|
-
""
|
|
71
|
-
].join("\n");
|
|
72
|
-
}, b = async (e) => {
|
|
73
|
-
let t = f(e), n = await v(t);
|
|
74
|
-
if (!n.present) return { kind: "not-a-mobile-app" };
|
|
75
|
-
if ("error" in n) return {
|
|
76
|
-
kind: "refused",
|
|
77
|
-
reason: `${h} could not be loaded — ${n.error.message}`
|
|
78
|
-
};
|
|
79
|
-
let r = Object.entries(n.binding.apis);
|
|
80
|
-
if (r.length === 0) return {
|
|
81
|
-
kind: "refused",
|
|
82
|
-
reason: `${h} declares no apis`
|
|
83
|
-
};
|
|
84
|
-
for (let [e, t] of r) if (t.package === void 0 && t.url === void 0) return {
|
|
85
|
-
kind: "refused",
|
|
86
|
-
reason: `api ${JSON.stringify(e)} declares neither \`package\` nor \`url\``
|
|
87
|
-
};
|
|
88
|
-
for (let [e, n] of r) if (n.package !== void 0 && await a(t, n.package) === null) return {
|
|
89
|
-
kind: "refused",
|
|
90
|
-
reason: `api ${JSON.stringify(e)}: ${n.package} is not a workspace dependency of this app. Add it to the app's package.json (\`"${n.package}": "workspace:*"\`) and install.`
|
|
91
|
-
};
|
|
92
|
-
let i = u(t, g), o = y(t, r);
|
|
93
|
-
await p.mkdir(u(t, ".framework"), { recursive: !0 });
|
|
94
|
-
let s = null;
|
|
95
|
-
try {
|
|
96
|
-
s = await p.readFile(i, "utf8");
|
|
97
|
-
} catch {}
|
|
98
|
-
return s !== o && await p.writeFile(i, o, "utf8"), {
|
|
99
|
-
kind: "wrote",
|
|
100
|
-
file: i,
|
|
101
|
-
apis: r.map(([e]) => e)
|
|
102
|
-
};
|
|
103
|
-
}, x = (e, t) => t.kind === "wrote" ? `voltro codegen: wrote ${d(e, t.file)} (apis ${t.apis.join(", ")})` : t.kind === "refused" ? `voltro codegen: ${t.reason} — refusing to write.` : `voltro codegen: no ${h} here — not a mobile app.`, S = async (t) => {
|
|
104
|
-
let { config: i, present: a, error: o } = await r(t);
|
|
105
|
-
if (a && i === null) return {
|
|
106
|
-
kind: "refused",
|
|
107
|
-
reason: "app.config.ts exists but could not be loaded" + (o === void 0 ? "" : ` — ${o instanceof Error ? o.message : String(o)}`)
|
|
108
|
-
};
|
|
109
|
-
let s = i?.plugins ?? [], { pluginContributions: u, pluginErrorImports: d, pluginRpcImports: f } = await n(s, i?.name ?? l(t), t), p = await c({
|
|
110
|
-
root: t,
|
|
111
|
-
...u.length > 0 ? { pluginContributions: u } : {},
|
|
112
|
-
...d.length > 0 ? { pluginErrorImports: d } : {},
|
|
113
|
-
...f.length > 0 ? { pluginRpcImports: f } : {},
|
|
114
|
-
...i?.name === void 0 ? {} : { apiName: i.name }
|
|
115
|
-
});
|
|
116
|
-
if (!p) return { kind: "nothing-to-write" };
|
|
117
|
-
let m = await C(t, i), h = await e(p, m);
|
|
118
|
-
return {
|
|
119
|
-
kind: "wrote",
|
|
120
|
-
file: p,
|
|
121
|
-
plugins: s.length,
|
|
122
|
-
errorSchemas: d.length,
|
|
123
|
-
routes: f.length,
|
|
124
|
-
tables: m.size,
|
|
125
|
-
dts: h
|
|
126
|
-
};
|
|
127
|
-
}, C = async (e, n) => {
|
|
128
|
-
let r = await s(e), { tables: a } = await i(r), c = await o({ root: e });
|
|
129
|
-
return t(a, c, n?.analytics?.tables ?? []);
|
|
130
|
-
}, w = async (e) => {
|
|
131
|
-
let t = f(e.find((e) => !e.startsWith("-")) ?? process.cwd()), n = await b(t);
|
|
132
|
-
if (n.kind !== "not-a-mobile-app") return console.log(x(t, n)), n.kind === "wrote" ? 0 : 1;
|
|
133
|
-
let r = await S(t);
|
|
134
|
-
return r.kind === "refused" ? (console.error(`voltro codegen: ${r.reason} — refusing to write.`), console.error(" The generated file would omit every plugin's error union and client routes, and would typecheck, so the omission would only surface as a missing error tag at runtime."), 1) : r.kind === "nothing-to-write" ? (console.log("voltro codegen: no rpc primitives found — nothing to write."), 0) : (console.log(`voltro codegen: wrote ${d(t, r.file)} (plugins ${r.plugins}, error schemas ${r.errorSchemas}, plugin routes ${r.routes})`), console.log(r.dts.action === "removed" ? ` removed ${d(t, r.dts.path)} — no tables declared, so \`source:\` is \`string\` again` : r.dts.action === "skipped" ? " no tables declared — `source:` stays `string`" : ` ${r.dts.action} ${d(t, r.dts.path)} (${r.tables} table name(s) typed for \`source:\`)`), r.plugins > 0 && r.errorSchemas === 0 && console.log(" note: no plugin contributed a cross-cutting error schema, so the wire error union carries only each procedure's own `error:`. Expected if none of your plugins declare `errorSchemas` — but `guards:` needs @voltro/plugin-rbac for its ScopeError to decode typed."), 0);
|
|
135
|
-
};
|
|
136
|
-
//#endregion
|
|
137
|
-
export { S as regenerateRpcGroup, w as runCodegenCommand };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
//#region src/fileConventions.ts
|
|
2
|
-
var e = /\.(query|mutation|action|stream)\.ts$/, t = /\.(query|mutation|action|stream)\.server\.ts$/, n = /\.event\.ts$/, r = /\.ws\.ts$/, i = /\.workflow\.tsx$/, a = /\.workflow\.server\.tsx$/, o = /\.workflow\.tsx?$/, s = /\.trigger\.tsx?$/, c = /\.cron\.tsx?$/, l = /\.webhook\.tsx?$/, u = /\.outbox\.tsx?$/, d = /\.consumer\.tsx?$/, f = /\.subscribe\.tsx?$/, p = /\.reaction\.tsx?$/, m = /\.aggregate\.tsx?$/, h = /\.expectation\.ts$/, g = /\.budget\.ts$/, _ = /\.experiment\.ts$/, v = /\.startup\.tsx?$/, y = /\.seed\.ts$/, b = /\.relations\.ts$/, x = /\.entity\.ts$|\.schema\.ts$|^schema\.ts$/, S = (e) => o.test(e) && !i.test(e) && !a.test(e), C = /(?:^|\/)page\.tsx$/, w = /\.island\.tsx?$/, T = /\.component\.tsx$/, E = /\.component\.ui\.tsx$/, D = /\.hook\.tsx?$/, O = /\.internal\.tsx?$/, k = /\.types\.tsx?$/, A = /\.fixture\.tsx?$/, j = /\.tracking\.tsx?$/, M = /\.store\.tsx?$/, N = /\.client\.tsx?$/, P = /\.(test|spec)\.tsx?$/, F = [
|
|
3
|
-
e,
|
|
4
|
-
t,
|
|
5
|
-
o,
|
|
6
|
-
a,
|
|
7
|
-
s,
|
|
8
|
-
c,
|
|
9
|
-
l,
|
|
10
|
-
u,
|
|
11
|
-
d,
|
|
12
|
-
f,
|
|
13
|
-
p,
|
|
14
|
-
m,
|
|
15
|
-
v,
|
|
16
|
-
h,
|
|
17
|
-
g,
|
|
18
|
-
_,
|
|
19
|
-
y,
|
|
20
|
-
b,
|
|
21
|
-
x,
|
|
22
|
-
/\.route\.tsx?$/,
|
|
23
|
-
n,
|
|
24
|
-
r,
|
|
25
|
-
M,
|
|
26
|
-
N,
|
|
27
|
-
/\.(agent|tool|email|connection|serverless|server|config|generated)\.tsx?$/
|
|
28
|
-
], I = (e) => F.some((t) => t.test(e)), L = /* @__PURE__ */ new Set([
|
|
29
|
-
"layout.tsx",
|
|
30
|
-
"error.tsx",
|
|
31
|
-
"loading.tsx",
|
|
32
|
-
"not-found.tsx"
|
|
33
|
-
]);
|
|
34
|
-
//#endregion
|
|
35
|
-
export { l as A, v as C, j as D, P as E, I as F, S as I, o as M, a as N, s as O, r as P, y as S, f as T, e as _, d as a, b, h as c, D as d, O as f, L as g, C as h, E as i, i as j, k, _ as l, u as m, g as n, c as o, w as p, T as r, n as s, m as t, A as u, t as v, M as w, x, p as y };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { join as e } from "node:path";
|
|
2
|
-
import { readFile as t } from "node:fs/promises";
|
|
3
|
-
//#region src/isrCache.ts
|
|
4
|
-
var n = () => {
|
|
5
|
-
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
6
|
-
t.set(e, (t.get(e) ?? 0) + 1);
|
|
7
|
-
};
|
|
8
|
-
return {
|
|
9
|
-
get(t) {
|
|
10
|
-
return e.get(t);
|
|
11
|
-
},
|
|
12
|
-
set(n, r, i) {
|
|
13
|
-
return i?.ifGeneration !== void 0 && (t.get(n) ?? 0) !== i.ifGeneration ? !1 : (e.set(n, r), !0);
|
|
14
|
-
},
|
|
15
|
-
generation(e) {
|
|
16
|
-
return t.get(e) ?? 0;
|
|
17
|
-
},
|
|
18
|
-
invalidate(t) {
|
|
19
|
-
e.delete(t), n(t);
|
|
20
|
-
},
|
|
21
|
-
invalidateBy(t) {
|
|
22
|
-
let r = 0;
|
|
23
|
-
for (let i of e.keys()) t(i) && (e.delete(i), n(i), r++);
|
|
24
|
-
return r;
|
|
25
|
-
},
|
|
26
|
-
clear() {
|
|
27
|
-
for (let t of e.keys()) n(t);
|
|
28
|
-
e.clear();
|
|
29
|
-
},
|
|
30
|
-
size() {
|
|
31
|
-
return e.size;
|
|
32
|
-
},
|
|
33
|
-
snapshot() {
|
|
34
|
-
return Array.from(e.entries());
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}, r = (e) => {
|
|
38
|
-
if (typeof e == "number" && Number.isFinite(e) && e > 0) return e * 1e3;
|
|
39
|
-
if (typeof e != "string") return null;
|
|
40
|
-
let t = /^\s*(\d+)\s*(s|seconds?|m|minutes?|h|hours?|d|days?)\s*$/i.exec(e);
|
|
41
|
-
if (!t) return null;
|
|
42
|
-
let n = parseInt(t[1], 10);
|
|
43
|
-
if (!Number.isFinite(n) || n <= 0) return null;
|
|
44
|
-
let r = t[2].toLowerCase();
|
|
45
|
-
return r === "s" || r.startsWith("second") ? n * 1e3 : r === "m" || r.startsWith("minute") ? n * 6e4 : r === "h" || r.startsWith("hour") ? n * 36e5 : r === "d" || r.startsWith("day") ? n * 864e5 : null;
|
|
46
|
-
}, i = (e, t = {}) => {
|
|
47
|
-
let n = [e];
|
|
48
|
-
return t.tenant !== void 0 && t.tenant !== "" && n.push(`tenant=${t.tenant}`), t.locale !== void 0 && t.locale !== "" && n.push(`lang=${t.locale}`), n.join("|");
|
|
49
|
-
}, a = (e, t) => e.expiresAt > t, o = (e, t) => e.expiresAt <= t && e.servableUntil > t, s = [
|
|
50
|
-
"static",
|
|
51
|
-
"spa",
|
|
52
|
-
"ssr",
|
|
53
|
-
"isr"
|
|
54
|
-
], c = (e) => typeof e == "string" && s.includes(e), l = s.map((e) => `'${e}'`).join(" | "), u = (e, t) => `[voltro] ${e}: unknown renderMode '${t}'.\n Valid values: ${l}.${t === "client" || t === "csr" || t === "browser" ? "\n A page that renders only in the browser is 'spa': it is skipped by the prerender and mounts on the client. If its route has a layout, that layout still renders server-side as an SSR shell." : t === "server" || t === "dynamic" ? "\n A page rendered per request is 'ssr'." : t === "ssg" || t === "prerender" ? "\n A page rendered once at build time is 'static' (the default)." : ""}`, d = class extends Error {
|
|
55
|
-
page;
|
|
56
|
-
value;
|
|
57
|
-
name = "InvalidRenderModeError";
|
|
58
|
-
constructor(e, t) {
|
|
59
|
-
super(u(e, t)), this.page = e, this.value = t;
|
|
60
|
-
}
|
|
61
|
-
}, f = (e, t = "<page>") => {
|
|
62
|
-
if (e.renderMode !== void 0 && e.renderMode !== null) {
|
|
63
|
-
if (!c(e.renderMode)) throw new d(t, String(e.renderMode));
|
|
64
|
-
return e.renderMode;
|
|
65
|
-
}
|
|
66
|
-
return e.dynamic === "force-dynamic" ? "ssr" : (e.dynamic, "static");
|
|
67
|
-
}, p = (e, t = "<page>") => ({
|
|
68
|
-
renderMode: f(e, t),
|
|
69
|
-
tenantAware: e.tenantAware === !0,
|
|
70
|
-
revalidateMs: r(e.revalidate),
|
|
71
|
-
staleWhileRevalidateMs: r(e.staleWhileRevalidate) ?? 0,
|
|
72
|
-
cacheInvalidatesOn: Array.isArray(e.cacheInvalidatesOn) ? e.cacheInvalidatesOn : [],
|
|
73
|
-
interactive: e.interactive ?? "full",
|
|
74
|
-
hasLoader: typeof e.loader == "function",
|
|
75
|
-
hasMeta: e.meta != null,
|
|
76
|
-
hasGetStaticPaths: typeof e.getStaticPaths == "function",
|
|
77
|
-
hasOgImage: typeof e.ogImage == "function",
|
|
78
|
-
ppr: e.ppr === !0
|
|
79
|
-
}), m = /export\s+const\s+renderMode\s*(?::[^=]+)?=\s*['"]([^'"]*)['"]/, h = (e) => m.exec(e)?.[1] ?? null, g = /export\s*\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/g, _ = (e) => {
|
|
80
|
-
g.lastIndex = 0;
|
|
81
|
-
let t;
|
|
82
|
-
for (; (t = g.exec(e)) !== null;) {
|
|
83
|
-
let e = t[2];
|
|
84
|
-
if (e.startsWith(".")) for (let n of t[1].split(",")) {
|
|
85
|
-
let t = n.lastIndexOf(" as ");
|
|
86
|
-
if ((t === -1 ? n : n.slice(t + 4)).trim() === "renderMode") return e;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
}, v = /export\s*\{([^}]*)\}/g, y = (e) => {
|
|
91
|
-
if (/export\s+default\b/.test(e)) return !0;
|
|
92
|
-
v.lastIndex = 0;
|
|
93
|
-
let t;
|
|
94
|
-
for (; (t = v.exec(e)) !== null;) for (let e of t[1].split(",")) {
|
|
95
|
-
let t = e.lastIndexOf(" as ");
|
|
96
|
-
if ((t === -1 ? e : e.slice(t + 4)).trim() === "default") return !0;
|
|
97
|
-
}
|
|
98
|
-
return !1;
|
|
99
|
-
}, b = (e) => {
|
|
100
|
-
if (/^export const searchParams\b/m.test(e)) return !0;
|
|
101
|
-
v.lastIndex = 0;
|
|
102
|
-
let t;
|
|
103
|
-
for (; (t = v.exec(e)) !== null;) for (let e of t[1].split(",")) {
|
|
104
|
-
let t = e.lastIndexOf(" as ");
|
|
105
|
-
if ((t === -1 ? e : e.slice(t + 4)).trim() === "searchParams") return !0;
|
|
106
|
-
}
|
|
107
|
-
return !1;
|
|
108
|
-
}, x = async (n, r) => {
|
|
109
|
-
let i = (await Promise.all(r.map(async (r) => {
|
|
110
|
-
let i;
|
|
111
|
-
try {
|
|
112
|
-
i = await t(e(n, r.file), "utf8");
|
|
113
|
-
} catch {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
let a = h(i);
|
|
117
|
-
return a !== null && !c(a) ? u(e("src", "pages", r.file), a) : a === "isr" && b(i) ? `${e("src", "pages", r.file)} declares BOTH renderMode 'isr' and a \`searchParams\` schema.\n\n The isr cache is keyed by path (plus tenant+locale) — the query string is not part of\n the key, so the first request's variant would be cached and served for every other\n query. A page whose render varies by search params cannot be isr-cached safely.\n\n Fix: use \`renderMode: 'ssr'\` (per-request render, params fully honoured), or remove\n the \`searchParams\` export and read the query client-side only.` : y(i) ? null : `${e("src", "pages", r.file)} is a route (a \`page.tsx\` under src/pages/) but exports no default.\n\n A page's default export IS its component — the router has nothing to render without it,\n and the failure would otherwise surface only in \`voltro build\`'s prerender as\n "SSR received a descriptor with no Component", long after the file was written.\n\n Fix: \`export default function Page() { … }\`, or re-export another page's component\n (\`export { default } from '../page'\`). If this file is NOT a route, rename it —\n only the reserved names route, and anything else under src/pages/ is ordinary code\n that may live beside the page that uses it.`;
|
|
118
|
-
}))).filter((e) => e !== null);
|
|
119
|
-
if (i.length !== 0) throw Error(i.join("\n\n"));
|
|
120
|
-
};
|
|
121
|
-
//#endregion
|
|
122
|
-
export { p as a, f as c, o as d, n as f, s as i, i as l, h as n, c as o, r as p, _ as r, u as s, x as t, a as u };
|
package/dist/start-BJzZLbt8.js
DELETED