@voltro/cli 0.50.1 → 0.52.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.
Files changed (170) hide show
  1. package/CHANGELOG.md +231 -0
  2. package/dist/{agentsMd-D6yD7IQv.js → agentsMd-0l980yhL.js} +4 -1
  3. package/dist/agentsMd-SDDSkyl4.js +2 -0
  4. package/dist/apiBuild-BYBpL7Pz.js +2 -0
  5. package/dist/{apiBuild-D3s7lx57.js → apiBuild-CSFI8QGq.js} +3 -3
  6. package/dist/appGraph-CFmFKHb2.js +2 -0
  7. package/dist/appGraph-yRuKjOba.js +111 -0
  8. package/dist/bin.js +1 -1
  9. package/dist/build-CPgcMQug.js +793 -0
  10. package/dist/checkCommand-2SbqzukH.js +2 -0
  11. package/dist/{checkCommand-DsKIjL6k.js → checkCommand-COmqc2cB.js} +107 -60
  12. package/dist/{cloudCmd-F4YJeqM3.js → cloudCmd-QUXh-b5w.js} +1 -1
  13. package/dist/codegen-CctkDO-1.js +2 -0
  14. package/dist/{codegen-CrMXs4hb.js → codegen-VF479Cnb.js} +1 -1
  15. package/dist/{codegenCommand-C0S27nbB.js → codegenCommand-DCdG2JN-.js} +12 -12
  16. package/dist/{codemodRunner-DwY8Rjbl.js → codemodRunner-r7J9lIa7.js} +771 -636
  17. package/dist/{commands-Brp4DI8u.js → commands-Cc_nV8WI.js} +37 -36
  18. package/dist/{dashboardCommand-bbLfc9FW.js → dashboardCommand-C-gKvwqh.js} +3 -3
  19. package/dist/{dataCommand-k9mXTXin.js → dataCommand-BgpBHnlB.js} +299 -253
  20. package/dist/dbCommand-DNb6yeOG.js +2 -0
  21. package/dist/{dbCommand-Bf7Cy0mn.js → dbCommand-sHedr-NJ.js} +3 -3
  22. package/dist/dev--A3nsxA3.js +3 -0
  23. package/dist/{dev-C0cbqysu.js → dev-CRHoCEiy.js} +2258 -2219
  24. package/dist/doctorCommand-CqoWA2p5.js +2 -0
  25. package/dist/{doctorCommand-DyViaaCP.js → doctorCommand-DtfJ3FA6.js} +314 -234
  26. package/dist/{dormancyCommand-DMZPA_HW.js → dormancyCommand-Drn7o0No.js} +1 -1
  27. package/dist/{embeddingsCommand-CMxRPkg6.js → embeddingsCommand-Z-jO1fWN.js} +1 -1
  28. package/dist/{envCommand-CDLr-yD4.js → envCommand-D4gCrrTZ.js} +15 -15
  29. package/dist/{evolveCommand-Ct4NesL3.js → evolveCommand-CMROeKeA.js} +2 -2
  30. package/dist/fileConventions-DOqD3lPS.js +34 -0
  31. package/dist/{fileTaxonomy-CJfgOllU.js → fileTaxonomy-DvDUV9wq.js} +1 -1
  32. package/dist/frameworkTableAssembly-C6ETawPR.js +2 -0
  33. package/dist/{frameworkTableAssembly-BwJVEKLr.js → frameworkTableAssembly-w-XnLa3q.js} +1 -1
  34. package/dist/{generateCommand-BDdOxhnv.js → generateCommand-DTNPGjxo.js} +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/{infoCommand-orsKJKUy.js → infoCommand-DXM868o_.js} +1 -1
  37. package/dist/inspectMetrics-CGF94puw.js +143 -0
  38. package/dist/{metaCommands-CfRLra0s.js → metaCommands-C6RFmF1r.js} +2 -2
  39. package/dist/{migrate-D3MK9BpK.js → migrate-D0F-eTlK.js} +2 -2
  40. package/dist/{pageConvention-cEiRxdab.js → pageConvention-CzUiSbtU.js} +1 -1
  41. package/dist/{privacyCommand-XejDMvmu.js → privacyCommand-DGdopOI6.js} +1 -1
  42. package/dist/{projectScaffold-mIX_DpSe.js → projectScaffold-B4dmTlwT.js} +1 -1
  43. package/dist/{projectScaffold-BIl97_E6.js → projectScaffold-EzlErR4E.js} +1 -1
  44. package/dist/{renderModeScan-D7J1B7Kw.js → renderModeScan-CcH2X1_D.js} +25 -10
  45. package/dist/{renderProfile-1OWWAAtx.js → renderProfile-Ck32Fzxr.js} +2 -2
  46. package/dist/{runtimeTrace-Bo8jWsNe.js → runtimeTrace-BPQyCmC5.js} +1 -1
  47. package/dist/{sdkgen-OZhiT2vz.js → sdkgen-Se88ifTd.js} +1 -1
  48. package/dist/serveCommand-DLc-BznW.js +2 -0
  49. package/dist/{serveCommand-YbD5VgfV.js → serveCommand-DkP3OT0W.js} +885 -868
  50. package/dist/serveEntry.js +1 -1
  51. package/dist/start-DfL3fOiN.js +3 -0
  52. package/dist/start-jw89Xbqy.js +1339 -0
  53. package/dist/startEntry.js +1 -1
  54. package/dist/{staticCommand-Dr2M6tpU.js → staticCommand-BwNEDlSU.js} +1 -1
  55. package/dist/{test-rXFq4S76.js → test-f3amja6a.js} +1 -1
  56. package/dist/updateCommand-5gFVfK5q.js +2 -0
  57. package/dist/{updateCommand-BgH6vTtq.js → updateCommand-BMk2e4ky.js} +1 -1
  58. package/dist/{webDev-BbdkzMbd.js → webDev-BgWL9gKV.js} +1233 -853
  59. package/dist/webDev-CZbTsDcH.js +2 -0
  60. package/dist/{webhooksCommand-DjE6u0r4.js → webhooksCommand-CoIO3jbj.js} +1 -1
  61. package/package.json +48 -17
  62. package/templates/AGENTS.core.md +26 -5
  63. package/templates/AGENTS.md +30 -9
  64. package/templates/agent-docs/_index.md +4 -4
  65. package/templates/agent-docs/_manifest.json +11 -11
  66. package/templates/agent-docs/cli.md +125 -14
  67. package/templates/agent-docs/data.md +210 -7
  68. package/templates/agent-docs/database/schema.md +1 -1
  69. package/templates/agent-docs/database/seedsdialects.md +1 -1
  70. package/templates/agent-docs/deployment.md +22 -3
  71. package/templates/agent-docs/internationalization.md +131 -13
  72. package/templates/agent-docs/introduction.md +46 -0
  73. package/templates/agent-docs/local-first-mobile.md +34 -7
  74. package/templates/agent-docs/plugins/ai-flows.md +1 -1
  75. package/templates/agent-docs/plugins/audit.md +5 -5
  76. package/templates/agent-docs/plugins/cdc-out.md +2 -2
  77. package/templates/agent-docs/plugins/{versioning.md → row-history.md} +22 -22
  78. package/templates/agent-docs/plugins/storage.md +2 -2
  79. package/templates/agent-docs/plugins.md +29 -7
  80. package/templates/agent-docs/reference.md +39 -2
  81. package/templates/agent-docs/routing.md +341 -47
  82. package/templates/agent-docs/schema-driven-ui.md +78 -2
  83. package/templates/agent-docs/security.md +125 -8
  84. package/templates/agent-docs/templates/apibackends.md +14 -14
  85. package/templates/agent-docs/templates/overview.md +1 -1
  86. package/templates/agent-docs/whats-new.md +100 -29
  87. package/templates/apps/api-ai/package.json +6 -7
  88. package/templates/apps/api-ai/tests/summarize.test.ts +1 -1
  89. package/templates/apps/api-auth/package.json +8 -8
  90. package/templates/apps/api-backend/package.json +7 -7
  91. package/templates/apps/api-backend-deactivation/package.json +7 -7
  92. package/templates/apps/api-backend-mail/package.json +8 -8
  93. package/templates/apps/api-backend-mariadb/package.json +9 -9
  94. package/templates/apps/api-backend-sqlite/package.json +8 -8
  95. package/templates/apps/api-backend-storage/package.json +8 -8
  96. package/templates/apps/api-cms/package.json +9 -10
  97. package/templates/apps/api-collab/package.json +8 -8
  98. package/templates/apps/api-data-advanced/package.json +8 -8
  99. package/templates/apps/api-durable/package.json +8 -8
  100. package/templates/apps/api-feature-flags/package.json +9 -9
  101. package/templates/apps/api-governance/package.json +8 -8
  102. package/templates/apps/api-kv/package.json +8 -8
  103. package/templates/apps/api-moderation/package.json +8 -8
  104. package/templates/apps/api-observability/package.json +8 -8
  105. package/templates/apps/api-ratelimit/package.json +8 -8
  106. package/templates/apps/api-rbac/package.json +8 -8
  107. package/templates/apps/api-rest/package.json +7 -7
  108. package/templates/apps/{api-versioning → api-row-history}/README.md +3 -3
  109. package/templates/apps/{api-versioning → api-row-history}/actions/documents.asOf.action.server.ts +1 -1
  110. package/templates/apps/{api-versioning → api-row-history}/actions/documents.history.action.server.ts +1 -1
  111. package/templates/apps/{api-versioning → api-row-history}/app.config.ts +3 -3
  112. package/templates/apps/{api-versioning → api-row-history}/database/schema.ts +1 -1
  113. package/templates/apps/{api-versioning → api-row-history}/mutations/documents.create.mutation.server.ts +1 -1
  114. package/templates/apps/{api-versioning → api-row-history}/mutations/documents.create.mutation.ts +1 -1
  115. package/templates/apps/{api-versioning → api-row-history}/mutations/documents.update.mutation.ts +1 -1
  116. package/templates/apps/{api-versioning → api-row-history}/package.json +8 -8
  117. package/templates/apps/api-row-history/template.json +6 -0
  118. package/templates/apps/{api-versioning → api-row-history}/tests/documents.create.test.ts +1 -1
  119. package/templates/apps/api-saas/app.config.ts +1 -0
  120. package/templates/apps/api-saas/package.json +10 -11
  121. package/templates/apps/api-saas-starter/package.json +10 -10
  122. package/templates/apps/api-search/package.json +8 -8
  123. package/templates/apps/api-status/package.json +8 -8
  124. package/templates/apps/api-webhooks/package.json +9 -9
  125. package/templates/apps/changelog/package.json +6 -6
  126. package/templates/apps/edge-functions/package.json +2 -2
  127. package/templates/apps/frontend-admin/package.json +8 -8
  128. package/templates/apps/frontend-app/package.json +9 -9
  129. package/templates/apps/frontend-auth/package.json +8 -8
  130. package/templates/apps/frontend-blank/package.json +7 -7
  131. package/templates/apps/frontend-cms/package.json +9 -9
  132. package/templates/apps/frontend-collab/package.json +10 -10
  133. package/templates/apps/frontend-collab/src/pages/page.test.tsx +10 -9
  134. package/templates/apps/frontend-collab/src/pages/page.tsx +42 -65
  135. package/templates/apps/frontend-contact/package.json +7 -7
  136. package/templates/apps/frontend-dashboard/package.json +7 -7
  137. package/templates/apps/frontend-docs/package.json +6 -7
  138. package/templates/apps/frontend-i18n/package.json +6 -6
  139. package/templates/apps/frontend-landing/package.json +6 -7
  140. package/templates/apps/frontend-portal/package.json +8 -8
  141. package/templates/apps/frontend-saas/package.json +8 -8
  142. package/templates/apps/frontend-spa/package.json +7 -7
  143. package/templates/apps/frontend-ssr/package.json +7 -7
  144. package/templates/apps/frontend-ssr-api/package.json +8 -8
  145. package/templates/apps/frontend-static-blog/package.json +6 -6
  146. package/templates/apps/frontend-status/package.json +8 -8
  147. package/templates/apps/mobile-app/package.json +4 -4
  148. package/dist/agentsMd-Bu_XQgVf.js +0 -2
  149. package/dist/apiBuild-BZ-plaQN.js +0 -2
  150. package/dist/appGraph-CM9wvUmD.js +0 -2
  151. package/dist/appGraph-Cv2W_wO5.js +0 -111
  152. package/dist/build-CFmqF39c.js +0 -721
  153. package/dist/checkCommand-DomvYDi1.js +0 -2
  154. package/dist/codegen-DiMn2KkZ.js +0 -2
  155. package/dist/dbCommand-Bnl7MSGC.js +0 -2
  156. package/dist/dev-Dz9GqA6P.js +0 -3
  157. package/dist/doctorCommand-BlciWUJb.js +0 -2
  158. package/dist/fileConventions-Cof68_BL.js +0 -33
  159. package/dist/frameworkTableAssembly-CVDB2hCq.js +0 -2
  160. package/dist/inspectMetrics-CfdKLh6t.js +0 -72
  161. package/dist/serveCommand-Bbgg7Paq.js +0 -2
  162. package/dist/start-7b_bL8Uc.js +0 -3
  163. package/dist/start-B1nH9ahf.js +0 -1150
  164. package/dist/updateCommand-BweY17z-.js +0 -2
  165. package/dist/webDev-BcRFTsMA.js +0 -2
  166. package/templates/apps/api-versioning/template.json +0 -6
  167. /package/templates/apps/{api-versioning → api-row-history}/actions/documents.asOf.action.ts +0 -0
  168. /package/templates/apps/{api-versioning → api-row-history}/actions/documents.history.action.ts +0 -0
  169. /package/templates/apps/{api-versioning → api-row-history}/mutations/documents.update.mutation.server.ts +0 -0
  170. /package/templates/apps/{api-versioning → api-row-history}/tsconfig.json +0 -0
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./dev-C0cbqysu.js";
1
+ import { c as e, i as t } from "./dev-CRHoCEiy.js";
2
2
  import { n, t as r } from "./cliArgs-D4p8n7EE.js";
3
3
  import { r as i } from "./appPort-B_HpJ_ck.js";
4
4
  import { resolve as a } from "node:path";
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./dev-C0cbqysu.js";
1
+ import { c as e, i as t } from "./dev-CRHoCEiy.js";
2
2
  import { Effect as n } from "effect";
3
3
  import { embedMany as r } from "@voltro/ai";
4
4
  //#region src/embeddingsBackfill.ts
@@ -1,5 +1,5 @@
1
- import { c as e } from "./dev-C0cbqysu.js";
2
- import { _t as t, gt as n, mt as r, pt as i } from "./webDev-BbdkzMbd.js";
1
+ import { c as e } from "./dev-CRHoCEiy.js";
2
+ import { Et as t, Ot as n, Tt as r, kt as i } from "./webDev-BgWL9gKV.js";
3
3
  import { join as a } from "node:path";
4
4
  import { promises as o } from "node:fs";
5
5
  import { createLogger as s } from "@voltro/logger";
@@ -21,27 +21,27 @@ var u = s({ scope: "voltro:env" }), d = "# Environment for this app", f = async
21
21
  }, h = async (e) => {
22
22
  let t = await f(e);
23
23
  if (!t) return u.error("no app.config.ts found in the current directory"), 1;
24
- let n = i(t.name, t.input), r = `${p("KEY", 32)} ${p("OWNER", 16)} ${p("ACCESS", 8)} ${p("REQ", 4)} SET`;
25
- u.info(`env manifest — ${n.app} (${n.summary.total} vars, ${n.summary.set} set)`), m(r);
24
+ let n = r(t.name, t.input), i = `${p("KEY", 32)} ${p("OWNER", 16)} ${p("ACCESS", 8)} ${p("REQ", 4)} SET`;
25
+ u.info(`env manifest — ${n.app} (${n.summary.total} vars, ${n.summary.set} set)`), m(i);
26
26
  for (let e of n.entries) {
27
27
  let t = e.isSet ? "✓" : e.satisfied ? "·" : "✗";
28
28
  m(`${p(e.key, 32)} ${p(e.owner, 16)} ${p(e.access, 8)} ${p(e.required ? "yes" : "", 4)} ${t}`);
29
29
  }
30
30
  return n.summary.missingRequired > 0 ? (u.error(`${n.summary.missingRequired} required var(s) are unset`), 1) : 0;
31
- }, g = async (e, t) => {
32
- let n = await f(e);
33
- if (!n) return u.error("no app.config.ts found in the current directory"), 1;
34
- let i = r(n.input, ["Environment for this app — generated from app.config.ts `env` + plugin declarations.", "Regenerate with `voltro env sync`. Copy to `.env` and fill in the blanks."]), s = a(e, ".env.example"), c = await o.readFile(s, "utf8").catch(() => null);
35
- if (c !== null && !c.startsWith(d) && !t) {
31
+ }, g = async (e, n) => {
32
+ let r = await f(e);
33
+ if (!r) return u.error("no app.config.ts found in the current directory"), 1;
34
+ let i = t(r.input, ["Environment for this app — generated from app.config.ts `env` + plugin declarations.", "Regenerate with `voltro env sync`. Copy to `.env` and fill in the blanks."]), s = a(e, ".env.example"), c = await o.readFile(s, "utf8").catch(() => null);
35
+ if (c !== null && !c.startsWith(d) && !n) {
36
36
  let t = a(e, ".env.example.generated");
37
37
  return await o.writeFile(t, i, "utf8"), u.warn(".env.example exists and is not framework-generated — wrote .env.example.generated instead", { hint: "merge it by hand, or pass --force to overwrite .env.example" }), 0;
38
38
  }
39
- return await o.writeFile(s, i, "utf8"), u.info("wrote .env.example", { app: n.name }), 0;
40
- }, _ = async (r) => {
41
- let i = await e(r).catch(() => null);
42
- if (!i) return u.error("no app.config.ts found in the current directory"), 1;
43
- let a = l(i.env) ? i.env : void 0;
44
- return a ? (i.type === "web" ? (await n(r, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: i.name ?? "app" })) : (await t(r, a), u.info("wrote env.generated.d.ts (serverEnv augmentation)", { app: i.name ?? "app" })), 0) : (u.warn("no `defineEnv` declared in app.config.ts — nothing to generate", { hint: "add `env: defineEnv({ ... })` to app.config.ts (see @voltro/env)" }), 0);
39
+ return await o.writeFile(s, i, "utf8"), u.info("wrote .env.example", { app: r.name }), 0;
40
+ }, _ = async (t) => {
41
+ let r = await e(t).catch(() => null);
42
+ if (!r) return u.error("no app.config.ts found in the current directory"), 1;
43
+ let a = l(r.env) ? r.env : void 0;
44
+ return a ? (r.type === "web" ? (await n(t, a), u.info("wrote src/voltro-env.d.ts (publicEnv augmentation)", { app: r.name ?? "app" })) : (await i(t, a), u.info("wrote env.generated.d.ts (serverEnv augmentation)", { app: r.name ?? "app" })), 0) : (u.warn("no `defineEnv` declared in app.config.ts — nothing to generate", { hint: "add `env: defineEnv({ ... })` to app.config.ts (see @voltro/env)" }), 0);
45
45
  }, v = () => {
46
46
  let e = c();
47
47
  return u.info(`${e.length} framework env vars for turbo.json globalPassThroughEnv:`), m(JSON.stringify([...e].sort(), null, 2)), u.info("merge these into the workspace turbo.json `globalPassThroughEnv` array (+ your own app vars)."), 0;
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./cliOutput-D1tSBoRM.js";
2
- import { t } from "./checkCommand-DsKIjL6k.js";
3
- import { i as n, n as r } from "./codemodRunner-DwY8Rjbl.js";
2
+ import { i as t } from "./checkCommand-COmqc2cB.js";
3
+ import { i as n, n as r } from "./codemodRunner-r7J9lIa7.js";
4
4
  import { basename as i, join as a, resolve as o } from "node:path";
5
5
  import { branchNamespaceName as s, planBranchProvision as c } from "@voltro/database";
6
6
  import { readFile as l } from "node:fs/promises";
@@ -0,0 +1,34 @@
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 = /\.subscribe\.tsx?$/, f = /\.reaction\.tsx?$/, p = /\.aggregate\.tsx?$/, m = /\.expectation\.ts$/, h = /\.budget\.ts$/, g = /\.experiment\.ts$/, _ = /\.startup\.tsx?$/, v = /\.seed\.ts$/, y = /\.relations\.ts$/, b = /\.entity\.ts$|\.schema\.ts$|^schema\.ts$/, x = (e) => o.test(e) && !i.test(e) && !a.test(e), S = /(?:^|\/)page\.tsx$/, C = /\.island\.tsx?$/, w = /\.component\.tsx$/, T = /\.component\.ui\.tsx$/, E = /\.hook\.tsx?$/, D = /\.internal\.tsx?$/, O = /\.types\.tsx?$/, k = /\.fixture\.tsx?$/, A = /\.tracking\.tsx?$/, j = /\.store\.tsx?$/, M = /\.client\.tsx?$/, N = /\.(test|spec)\.tsx?$/, P = [
3
+ e,
4
+ t,
5
+ o,
6
+ a,
7
+ s,
8
+ c,
9
+ l,
10
+ u,
11
+ d,
12
+ f,
13
+ p,
14
+ _,
15
+ m,
16
+ h,
17
+ g,
18
+ v,
19
+ y,
20
+ b,
21
+ /\.route\.tsx?$/,
22
+ n,
23
+ r,
24
+ j,
25
+ M,
26
+ /\.(agent|tool|email|connection|serverless|server|config|generated)\.tsx?$/
27
+ ], F = (e) => P.some((t) => t.test(e)), I = /* @__PURE__ */ new Set([
28
+ "layout.tsx",
29
+ "error.tsx",
30
+ "loading.tsx",
31
+ "not-found.tsx"
32
+ ]);
33
+ //#endregion
34
+ export { i as A, j as C, s as D, A as E, x as F, a as M, r as N, O, F as P, _ as S, N as T, t as _, c as a, b, g as c, D as d, C as f, e as g, I as h, T as i, o as j, l as k, k as l, S as m, h as n, n as o, u as p, w as r, m as s, p as t, E as u, f as v, d as w, v as x, y };
@@ -1,4 +1,4 @@
1
- import { C as e, E as t, O as n, T as r, d as i, h as a, i as o, l as s, m as c, r as l, u } from "./fileConventions-Cof68_BL.js";
1
+ import { C as e, E as t, O as n, T as r, d as i, h as a, i as o, l as s, m as c, r as l, u } from "./fileConventions-DOqD3lPS.js";
2
2
  import { n as d, t as f } from "./tsconfigPaths-BWXBWgcl.js";
3
3
  import { dirname as p, join as m, relative as h, resolve as g, sep as _ } from "node:path";
4
4
  import { existsSync as v, readFileSync as y, readdirSync as b, statSync as x } from "node:fs";
@@ -0,0 +1,2 @@
1
+ import { c as e, n as t } from "./frameworkTableAssembly-w-XnLa3q.js";
2
+ export { t as assembleFrameworkTables, e as loadAppSchemaInputs };
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./appModuleLoader-C9r9mxZt.js";
2
2
  import { n as t } from "./declaredSchemaGates-BlcwObhb.js";
3
- import { D as n, a as r, j as i, k as a, x as o } from "./fileConventions-Cof68_BL.js";
3
+ import { D as n, a as r, j as i, k as a, x as o } from "./fileConventions-DOqD3lPS.js";
4
4
  import { basename as s, join as c } from "node:path";
5
5
  import { existsSync as l, promises as u } from "node:fs";
6
6
  import { pathToFileURL as d } from "node:url";
@@ -1,4 +1,4 @@
1
- import { r as e } from "./appGraph-Cv2W_wO5.js";
1
+ import { r as e } from "./appGraph-yRuKjOba.js";
2
2
  import { dirname as t, join as n } from "node:path";
3
3
  import { promises as r } from "node:fs";
4
4
  import { createLogger as i } from "@voltro/logger";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-Brp4DI8u.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./commands-Cc_nV8WI.js";
2
2
  import { r as o } from "./templates-BR-fb4SP.js";
3
3
  //#region src/index.ts
4
4
  var s = "framework";
@@ -1,5 +1,5 @@
1
1
  import { n as e, r as t, t as n } from "./cliOutput-D1tSBoRM.js";
2
- import { o as r } from "./updateCommand-BgH6vTtq.js";
2
+ import { o as r } from "./updateCommand-BMk2e4ky.js";
3
3
  import { join as i, resolve as a } from "node:path";
4
4
  import { readFileSync as o, readdirSync as s, statSync as c } from "node:fs";
5
5
  //#region src/infoCommand.ts
@@ -0,0 +1,143 @@
1
+ import { o as e, t } from "./connectionConfig-Bk9IC7D0.js";
2
+ import { createLogger as n } from "@voltro/logger";
3
+ import { Effect as r } from "effect";
4
+ import { recordSample as i, setRevalidationPublisher as a } from "@voltro/runtime";
5
+ import { channelFor as o, resolveBroadcastNamespace as s, resolveBroadcastProvider as c } from "@voltro/plugin-broadcast";
6
+ //#region src/revalidationWiring.ts
7
+ var l = "voltro_revalidate", u = (e) => o(s({ env: e.VOLTRO_BROADCAST_NAMESPACE }), "revalidate"), d = (i) => {
8
+ let o = i.logger ?? n({ scope: "voltro:revalidate" });
9
+ if (i.mode === "dev") return a((e) => (o.debug(`revalidate ${e.kind} '${e.value}' — no-op under voltro dev (no ISR cache)`), Promise.resolve())), {
10
+ transports: [],
11
+ stop: () => (a(null), Promise.resolve())
12
+ };
13
+ let s = [], d = i.dialect === "postgres" && t(), f = null, m = null, h = () => m || (m = (async () => {
14
+ try {
15
+ let t = new (await (import("pg"))).default.Client(e());
16
+ return await t.connect(), f = t, t;
17
+ } catch (e) {
18
+ return o.warn("revalidate: could not open the NOTIFY connection — pg transport disabled for this process", {}, e), null;
19
+ }
20
+ })(), m);
21
+ d && s.push("pg-notify");
22
+ let g = null, _ = !1;
23
+ if (i.provider !== void 0 && i.provider.name !== "memory") g = i.provider;
24
+ else if (i.provider === void 0) {
25
+ let e = c({}, process.env);
26
+ e.crossReplica && (g = e.provider, _ = !0);
27
+ }
28
+ let v = u(process.env);
29
+ return g && s.push("broker"), a(async (e) => {
30
+ let t = JSON.stringify(e), n = !1;
31
+ if (d) {
32
+ let r = await h();
33
+ if (r) try {
34
+ await r.query("SELECT pg_notify($1, $2)", [l, t]), n = !0;
35
+ } catch (t) {
36
+ o.warn(`revalidate ${e.kind} '${e.value}': NOTIFY failed`, {}, t);
37
+ }
38
+ }
39
+ if (g) try {
40
+ await r.runPromise(g.publish(v, t)), n = !0;
41
+ } catch (t) {
42
+ o.warn(`revalidate ${e.kind} '${e.value}': broker publish failed`, {}, t);
43
+ }
44
+ !n && s.length === 0 && p(o);
45
+ }), s.length > 0 && o.info(`revalidation publisher: ${s.join(" + ")}`, {
46
+ ...d ? { pgChannel: l } : {},
47
+ ...g ? { brokerChannel: v } : {}
48
+ }), {
49
+ transports: s,
50
+ stop: async () => {
51
+ if (a(null), f) {
52
+ try {
53
+ await f.end();
54
+ } catch {}
55
+ f = null;
56
+ }
57
+ if (g && _) try {
58
+ await r.runPromise(g.close());
59
+ } catch {}
60
+ g = null;
61
+ }
62
+ };
63
+ }, f = !1, p = (e) => {
64
+ f || (f = !0, e.warn("revalidatePath/revalidateTable/revalidateTag was called, but this process has NO transport to reach the web replicas: the store is not postgres (no NOTIFY line) and no broker is configured. The call is a no-op — cached pages stay until their own `revalidate` window. Set BROADCAST_URL (redis:// or nats://) on BOTH the api and the web deployment, or run on postgres where the NOTIFY line is built in."));
65
+ }, m = (e) => {
66
+ let t = {}, n = e?.http?.maxBodyBytes;
67
+ typeof n == "number" && Number.isFinite(n) && n > 0 && (t.maxBodyBytes = n);
68
+ let r = e?.http?.compression;
69
+ if (r !== void 0) {
70
+ let e = {};
71
+ typeof r.enabled == "boolean" && (e.enabled = r.enabled), typeof r.minBytes == "number" && Number.isFinite(r.minBytes) && r.minBytes >= 0 && (e.minBytes = r.minBytes), t.compression = e;
72
+ }
73
+ return t;
74
+ }, h = 5e3, g = 6e4, _ = (e, t) => {
75
+ if (e.length === 0) return 0;
76
+ if (e.length === 1) return e[0];
77
+ let n = t * (e.length - 1), r = Math.floor(n), i = Math.ceil(n);
78
+ if (r === i) return e[r];
79
+ let a = n - r;
80
+ return e[r] * (1 - a) + e[i] * a;
81
+ }, v = (e) => {
82
+ if (e.length === 0) return {
83
+ p50: 0,
84
+ p95: 0,
85
+ p99: 0,
86
+ mean: 0,
87
+ min: 0,
88
+ max: 0
89
+ };
90
+ let t = e.slice().sort((e, t) => e - t), n = 0;
91
+ for (let e of t) n += e;
92
+ return {
93
+ p50: _(t, .5),
94
+ p95: _(t, .95),
95
+ p99: _(t, .99),
96
+ mean: n / t.length,
97
+ min: t[0],
98
+ max: t[t.length - 1]
99
+ };
100
+ }, y = (e = {}) => {
101
+ let t = e.maxSamples ?? h, n = e.defaultWindowMs ?? g, r = [];
102
+ return {
103
+ record(e) {
104
+ i(e), r.push({
105
+ ...e,
106
+ ts: Date.now()
107
+ }), r.length > t && r.shift();
108
+ },
109
+ snapshot(e) {
110
+ let t = e ?? n, i = Date.now(), a = i - t, o = /* @__PURE__ */ new Map(), s = 0;
111
+ for (let e of r) {
112
+ if (e.ts < a) continue;
113
+ s++;
114
+ let t = `${e.kind}\u0000${e.tag}`, n = o.get(t);
115
+ n || (n = {
116
+ kind: e.kind,
117
+ tag: e.tag,
118
+ samples: []
119
+ }, o.set(t, n)), n.samples.push(e);
120
+ }
121
+ let c = [];
122
+ for (let e of o.values()) {
123
+ let t = e.samples.map((e) => e.durationMs), n = 0;
124
+ for (let t of e.samples) t.status === "error" && n++;
125
+ c.push({
126
+ kind: e.kind,
127
+ tag: e.tag,
128
+ count: e.samples.length,
129
+ errorCount: n,
130
+ latencyMs: v(t)
131
+ });
132
+ }
133
+ return c.sort((e, t) => t.count - e.count), {
134
+ windowMs: t,
135
+ capturedAt: i,
136
+ totalSamples: s,
137
+ buckets: c
138
+ };
139
+ }
140
+ };
141
+ };
142
+ //#endregion
143
+ export { d as i, m as n, u as r, y as t };
@@ -1,7 +1,7 @@
1
1
  import { i as e, n as t, r as n } from "./cliArgs-D4p8n7EE.js";
2
2
  import { t as r } from "./cliRuntime-Dh7UDinH.js";
3
- import { n as i } from "./renderProfile-1OWWAAtx.js";
4
- import { a, i as o } from "./projectScaffold-mIX_DpSe.js";
3
+ import { n as i } from "./renderProfile-Ck32Fzxr.js";
4
+ import { a, i as o } from "./projectScaffold-B4dmTlwT.js";
5
5
  import { t as s } from "./discover-C9XKJDco.js";
6
6
  import { basename as c, join as l, relative as u, resolve as d } from "node:path";
7
7
  import { createLogger as f } from "@voltro/logger";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./cliError-BmdYnghb.js";
2
2
  import { r as t } from "./dialectDriver-czCHYpeH.js";
3
3
  import { a as n, r } from "./connectionConfig-Bk9IC7D0.js";
4
- import { g as i, n as a, s as o } from "./frameworkTableAssembly-BwJVEKLr.js";
4
+ import { g as i, n as a, s as o } from "./frameworkTableAssembly-w-XnLa3q.js";
5
5
  import { t as s } from "./cliRuntime-Dh7UDinH.js";
6
6
  import { join as c, relative as l, resolve as u } from "node:path";
7
7
  import { pathToFileURL as d } from "node:url";
@@ -79,7 +79,7 @@ var _ = /* @__PURE__ */ new Set([
79
79
  let t = u(e.find((e) => !e.startsWith("-")) ?? process.cwd());
80
80
  return s(S(t), { scope: "voltro:migrate" });
81
81
  }
82
- let { runDbCommand: t } = await import("./dbCommand-Bnl7MSGC.js");
82
+ let { runDbCommand: t } = await import("./dbCommand-DNb6yeOG.js");
83
83
  return t(["apply", ...e]);
84
84
  };
85
85
  //#endregion
@@ -1,4 +1,4 @@
1
- import { T as e } from "./fileConventions-Cof68_BL.js";
1
+ import { T as e } from "./fileConventions-DOqD3lPS.js";
2
2
  //#region src/pageConvention.ts
3
3
  var t = (t) => e.test(t), n = (e) => e.replace(/page\.tsx$/, "page.test.tsx");
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./cliError-BmdYnghb.js";
2
2
  import { i as t, n, t as r } from "./cliArgs-D4p8n7EE.js";
3
- import { b as i, y as a } from "./fileConventions-Cof68_BL.js";
3
+ import { b as i, y as a } from "./fileConventions-DOqD3lPS.js";
4
4
  import { n as o } from "./cliOutput-D1tSBoRM.js";
5
5
  import { join as s, resolve as c } from "node:path";
6
6
  import { promises as l } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import { a as e, i as t, n, r, t as i } from "./templates-BR-fb4SP.js";
2
2
  import { i as a, n as o, t as s } from "./cloudClient-DWL-Hw_T.js";
3
3
  import { t as c } from "./cliRuntime-Dh7UDinH.js";
4
- import { n as l } from "./agentsMd-D6yD7IQv.js";
4
+ import { n as l } from "./agentsMd-0l980yhL.js";
5
5
  import { n as u } from "./addCommand-C05L9tZh.js";
6
6
  import { a as d, n as f, r as p } from "./baselineCommand-Ck2Xm8M7.js";
7
7
  import { basename as m, dirname as h, join as g, resolve as _ } from "node:path";
@@ -1,2 +1,2 @@
1
- import { c as e, l as t, s as n } from "./projectScaffold-mIX_DpSe.js";
1
+ import { c as e, l as t, s as n } from "./projectScaffold-B4dmTlwT.js";
2
2
  export { n as runAddApp, e as runCreateProject, t as runListTemplates };
@@ -2,23 +2,29 @@ import { join as e } from "node:path";
2
2
  import { readFile as t } from "node:fs/promises";
3
3
  //#region src/isrCache.ts
4
4
  var n = () => {
5
- let e = /* @__PURE__ */ new Map();
5
+ let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = (e) => {
6
+ t.set(e, (t.get(e) ?? 0) + 1);
7
+ };
6
8
  return {
7
9
  get(t) {
8
10
  return e.get(t);
9
11
  },
10
- set(t, n) {
11
- e.set(t, n);
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;
12
17
  },
13
18
  invalidate(t) {
14
- e.delete(t);
19
+ e.delete(t), n(t);
15
20
  },
16
21
  invalidateBy(t) {
17
- let n = 0;
18
- for (let r of e.keys()) t(r) && (e.delete(r), n++);
19
- return n;
22
+ let r = 0;
23
+ for (let i of e.keys()) t(i) && (e.delete(i), n(i), r++);
24
+ return r;
20
25
  },
21
26
  clear() {
27
+ for (let t of e.keys()) n(t);
22
28
  e.clear();
23
29
  },
24
30
  size() {
@@ -88,7 +94,16 @@ var n = () => {
88
94
  if ((t === -1 ? e : e.slice(t + 4)).trim() === "default") return !0;
89
95
  }
90
96
  return !1;
91
- }, b = async (n, r) => {
97
+ }, b = (e) => {
98
+ if (/^export const searchParams\b/m.test(e)) return !0;
99
+ v.lastIndex = 0;
100
+ let t;
101
+ for (; (t = v.exec(e)) !== null;) for (let e of t[1].split(",")) {
102
+ let t = e.lastIndexOf(" as ");
103
+ if ((t === -1 ? e : e.slice(t + 4)).trim() === "searchParams") return !0;
104
+ }
105
+ return !1;
106
+ }, x = async (n, r) => {
92
107
  let i = (await Promise.all(r.map(async (r) => {
93
108
  let i;
94
109
  try {
@@ -97,9 +112,9 @@ var n = () => {
97
112
  return null;
98
113
  }
99
114
  let a = h(i);
100
- return a !== null && !c(a) ? u(e("src", "pages", r.file), a) : 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.`;
115
+ 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.`;
101
116
  }))).filter((e) => e !== null);
102
117
  if (i.length !== 0) throw Error(i.join("\n\n"));
103
118
  };
104
119
  //#endregion
105
- 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, b as t, a as u };
120
+ 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 };
@@ -1,5 +1,5 @@
1
- import { m as e } from "./fileConventions-Cof68_BL.js";
2
- import { i as t, n, o as r, r as i, s as a } from "./renderModeScan-D7J1B7Kw.js";
1
+ import { m as e } from "./fileConventions-DOqD3lPS.js";
2
+ import { i as t, n, o as r, r as i, s as a } from "./renderModeScan-CcH2X1_D.js";
3
3
  import { dirname as o, join as s, relative as c, resolve as l } from "node:path";
4
4
  import { Effect as u } from "effect";
5
5
  import { readFile as d, readdir as f } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { n as e } from "./apiBuild-D3s7lx57.js";
1
+ import { n as e } from "./apiBuild-CSFI8QGq.js";
2
2
  import { join as t, resolve as n, sep as r } from "node:path";
3
3
  import { existsSync as i, promises as a } from "node:fs";
4
4
  import { createLogger as o } from "@voltro/logger";
@@ -422,7 +422,7 @@ let package = Package(
422
422
  await l.mkdir(o(e), { recursive: !0 }), await l.writeFile(e, n.content, "utf8");
423
423
  }
424
424
  }, X = async (e) => {
425
- let { offlineManifest: t } = await import("./checkCommand-DomvYDi1.js"), { manifest: n } = await t(e);
425
+ let { offlineManifest: t } = await import("./checkCommand-2SbqzukH.js"), { manifest: n } = await t(e);
426
426
  return n;
427
427
  }, Z = async (e) => {
428
428
  let t = J(await (e.manifestProvider ?? X)(e.root), {
@@ -0,0 +1,2 @@
1
+ import { n as e } from "./serveCommand-DkP3OT0W.js";
2
+ export { e as runServeDispatch };