@voltro/cli 0.35.0 → 0.37.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 (109) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/dist/apiBuild-D0f6hYbH.js +2 -0
  3. package/dist/{apiBuild-DYD_ONLD.js → apiBuild-DGsShRuF.js} +1 -1
  4. package/dist/{baselineCommand-DIttzO8A.js → baselineCommand-C6NMt-oa.js} +1 -4
  5. package/dist/baselineCommand-Cfw2Afwm.js +2 -0
  6. package/dist/bin.js +1 -1
  7. package/dist/{build-CD8K4XOr.js → build-CiFA-E19.js} +7 -7
  8. package/dist/{checkCommand-DKpDLlqu.js → checkCommand-CIPYyNyc.js} +1 -1
  9. package/dist/{checkCommand-Ct9xkTrS.js → checkCommand-CLPTzYqM.js} +3 -3
  10. package/dist/{cloudCmd-Cvv5HGaZ.js → cloudCmd-NQSwe_Qk.js} +1 -1
  11. package/dist/{codegen-CYM3Zqrf.js → codegen-GYYcdpCg.js} +2 -2
  12. package/dist/codegen-uYrrDzQv.js +2 -0
  13. package/dist/{codegenCommand-C4YoQIc2.js → codegenCommand-BxS3sCeJ.js} +2 -2
  14. package/dist/{codemodRunner-BnFq3Fgu.js → codemodRunner-cyqu5oxr.js} +122 -46
  15. package/dist/{commands-BE8E7zF3.js → commands-BwG9A9Vv.js} +73 -72
  16. package/dist/{dashboardCommand-D7SgZGaN.js → dashboardCommand-C7U146xQ.js} +1 -1
  17. package/dist/{dataCommand-BhYwDgg-.js → dataCommand-BOwd8_aJ.js} +2 -2
  18. package/dist/{dbCommand-O8HA63s2.js → dbCommand-C4UW8cVN.js} +353 -351
  19. package/dist/dbCommand-CC-qNzpz.js +2 -0
  20. package/dist/{dev-D2BikO7a.js → dev-BV6XNYKf.js} +1 -1
  21. package/dist/{dev-C7sFZq3m.js → dev-bwDgSObH.js} +2000 -2000
  22. package/dist/{doctorCommand-DnimF5IM.js → doctorCommand-BXyrtN2l.js} +9 -9
  23. package/dist/doctorCommand-C4L61G_L.js +2 -0
  24. package/dist/{dormancyCommand-QewYug_s.js → dormancyCommand-BDdRRLsa.js} +1 -1
  25. package/dist/{embeddingsCommand-BfiLS_QI.js → embeddingsCommand-CjWGcAE6.js} +1 -1
  26. package/dist/{envCommand-CCGPRQY1.js → envCommand-B_TeG297.js} +1 -1
  27. package/dist/{evolveCommand-CHsLCtDf.js → evolveCommand-D6N-WfA4.js} +2 -2
  28. package/dist/index.js +2 -2
  29. package/dist/{infoCommand-DwOgK1t6.js → infoCommand-BHKTprrx.js} +1 -1
  30. package/dist/inspectGateHint-BF6608UT.js +4 -0
  31. package/dist/{metaCommands-7MJfZ5cf.js → metaCommands-CIoQNlaQ.js} +1 -1
  32. package/dist/{migrate-BV7I-ZHZ.js → migrate-RwgUWXfc.js} +1 -1
  33. package/dist/{privacyCommand-C-Df56U_.js → privacyCommand-XejDMvmu.js} +4 -3
  34. package/dist/{probeCommand-CZfaaUOZ.js → probeCommand-BPEpwT32.js} +40 -39
  35. package/dist/{projectScaffold-DmzEKHib.js → projectScaffold-CxgtJvlb.js} +1 -1
  36. package/dist/{projectScaffold-LMMtaavR.js → projectScaffold-DDgWbNLe.js} +2 -2
  37. package/dist/{runtimeTrace-CH3eUiMw.js → runtimeTrace-WYV7qYvz.js} +1 -1
  38. package/dist/{sdkgen-BLkvGRfX.js → sdkgen-TM5sSdf7.js} +1 -1
  39. package/dist/{serveCommand-iwlUBNS1.js → serveCommand-CyZsXL1l.js} +487 -487
  40. package/dist/serveCommand-qumm7jdF.js +2 -0
  41. package/dist/serveEntry.js +1 -1
  42. package/dist/subcommandNames-CKG5Dz3a.js +27 -0
  43. package/dist/{templates-De8IR5-c.js → templates-BR-fb4SP.js} +1 -4
  44. package/dist/{test-CI6iDsYc.js → test-DIQ0jlkQ.js} +1 -1
  45. package/dist/{updateCommand-x0pI_x-B.js → updateCommand-9GHHsmDf.js} +1 -1
  46. package/dist/updateCommand-BN0tkl9-.js +2 -0
  47. package/dist/{webhooksCommand-DlAgS2Iw.js → webhooksCommand-CHWSPk5z.js} +1 -1
  48. package/package.json +29 -17
  49. package/templates/AGENTS.md +1 -1
  50. package/templates/agent-docs/_index.md +1 -1
  51. package/templates/agent-docs/cli.md +38 -0
  52. package/templates/agent-docs/data.md +30 -0
  53. package/templates/agent-docs/database/misc.md +33 -0
  54. package/templates/agent-docs/plugins/audit.md +46 -0
  55. package/templates/agent-docs/whats-new.md +44 -121
  56. package/templates/apps/api-ai/package.json +7 -7
  57. package/templates/apps/api-auth/package.json +8 -8
  58. package/templates/apps/api-backend/package.json +7 -7
  59. package/templates/apps/api-backend-deactivation/package.json +7 -7
  60. package/templates/apps/api-backend-mail/package.json +8 -8
  61. package/templates/apps/api-backend-mariadb/package.json +9 -9
  62. package/templates/apps/api-backend-sqlite/package.json +8 -8
  63. package/templates/apps/api-backend-storage/package.json +8 -8
  64. package/templates/apps/api-cms/package.json +10 -10
  65. package/templates/apps/api-collab/package.json +8 -8
  66. package/templates/apps/api-data-advanced/package.json +8 -8
  67. package/templates/apps/api-durable/package.json +8 -8
  68. package/templates/apps/api-feature-flags/package.json +9 -9
  69. package/templates/apps/api-governance/package.json +8 -8
  70. package/templates/apps/api-kv/package.json +8 -8
  71. package/templates/apps/api-moderation/package.json +8 -8
  72. package/templates/apps/api-observability/package.json +8 -8
  73. package/templates/apps/api-ratelimit/package.json +8 -8
  74. package/templates/apps/api-rbac/package.json +8 -8
  75. package/templates/apps/api-rest/package.json +7 -7
  76. package/templates/apps/api-saas/package.json +11 -11
  77. package/templates/apps/api-saas-starter/package.json +10 -10
  78. package/templates/apps/api-search/package.json +8 -8
  79. package/templates/apps/api-status/package.json +8 -8
  80. package/templates/apps/api-versioning/package.json +8 -8
  81. package/templates/apps/api-webhooks/package.json +9 -9
  82. package/templates/apps/changelog/package.json +6 -6
  83. package/templates/apps/edge-functions/package.json +2 -2
  84. package/templates/apps/frontend-admin/package.json +8 -8
  85. package/templates/apps/frontend-app/package.json +9 -9
  86. package/templates/apps/frontend-auth/package.json +8 -8
  87. package/templates/apps/frontend-blank/package.json +7 -7
  88. package/templates/apps/frontend-cms/package.json +9 -9
  89. package/templates/apps/frontend-collab/package.json +10 -10
  90. package/templates/apps/frontend-contact/package.json +7 -7
  91. package/templates/apps/frontend-dashboard/package.json +7 -7
  92. package/templates/apps/frontend-docs/package.json +7 -7
  93. package/templates/apps/frontend-i18n/package.json +6 -6
  94. package/templates/apps/frontend-landing/package.json +7 -7
  95. package/templates/apps/frontend-portal/package.json +8 -8
  96. package/templates/apps/frontend-saas/package.json +8 -8
  97. package/templates/apps/frontend-spa/package.json +7 -7
  98. package/templates/apps/frontend-ssr/package.json +7 -7
  99. package/templates/apps/frontend-ssr-api/package.json +8 -8
  100. package/templates/apps/frontend-static-blog/package.json +6 -6
  101. package/templates/apps/frontend-status/package.json +8 -8
  102. package/templates/apps/mobile-app/package.json +3 -3
  103. package/dist/apiBuild-B8aoJvuw.js +0 -2
  104. package/dist/baselineCommand-C2ClWZN3.js +0 -2
  105. package/dist/codegen-ChBi_hVa.js +0 -2
  106. package/dist/dbCommand-DS4b97Is.js +0 -2
  107. package/dist/doctorCommand-CM4Ch9C7.js +0 -2
  108. package/dist/serveCommand-CbDHU6l-.js +0 -2
  109. package/dist/updateCommand-BlMZhWgO.js +0 -2
@@ -5066,7 +5066,37 @@ var x = (e, t, n) => {
5066
5066
  "",
5067
5067
  "The read is issued at most once per key per process, off the commit path."
5068
5068
  ].join("\n")
5069
- }), Gr = (e) => /RunStepStatus/.test(e) || /['"]succeeded['"]/.test(e) && /['"]waiting['"]/.test(e) && /RunStep|runStep|flow/i.test(e), q = [
5069
+ }), Gr = (e) => /RunStepStatus/.test(e) || /['"]succeeded['"]/.test(e) && /['"]waiting['"]/.test(e) && /RunStep|runStep|flow/i.test(e), Kr = C({
5070
+ version: "0.35.0",
5071
+ id: "0.35.0/04_flow-run-step-skipped",
5072
+ title: "A flow run step can now be 'skipped' — handle it where you render a run timeline",
5073
+ kind: "manual",
5074
+ appliesTo: ({ project: e }) => e.getSourceFiles().some((e) => Gr(e.getFullText())),
5075
+ note: (/* @__PURE__ */ "A FLOW RUN STEP CAN NOW BE 'skipped'.((`when:` on a flow step gates it on a prior value, and a step whose condition(is false is SKIPPED rather than run. That is a sixth member of(`RunStepStatus`, so an exhaustive switch over it no longer compiles, and a(lookup keyed by status now has a hole.((WHAT TO DO:((1) FIND IT. Anywhere you render or branch on a run step status — a timeline( component, a status badge map, a progress calculation.((2) DECIDE WHAT A SKIPPED STEP LOOKS LIKE. It is NOT a failure and NOT a( success: it did not run, on purpose, and it produced no output. The( step carries `skipReason` — the rendered condition, e.g.( `{{mode}} equals \"full\"` — so the timeline can say WHY.((3) DO NOT DEFAULT IT TO INVISIBLE. Dropping the row compiles and reads fine( in review, and it reproduces exactly the problem `skipReason` exists to( prevent: a step that vanished is indistinguishable from a step nobody( declared, which is the first thing a user reports as a bug.((A PROGRESS COUNT probably needs a second look too: `succeeded / total` now(under-reports a completed run that skipped a step. Counting(`succeeded + skipped` against the total is usually what was meant.((If your app does not render a flow timeline, there is nothing to do — this(note fires on any file that names the status type or its literals.".split("(")).join("\n")
5076
+ }), qr = C({
5077
+ version: "0.35.0",
5078
+ id: "0.35.0/05_declared-schema-drops-runtime-flags",
5079
+ title: "The declared schema no longer reads `CDC` / `VOLTRO_UNDO` / `VOLTRO_TRACING_PERSIST`",
5080
+ kind: "manual",
5081
+ appliesTo: () => !0,
5082
+ note: (/* @__PURE__ */ "The set of framework tables your app DECLARES is hashed into the schema(fingerprint. A pre-deploy `voltro db apply` records that hash; every serving(container recomputes it and refuses to boot if it differs. Until this release(three RUNTIME flags fed into that set:(( CDC=0 removed `_voltro_cdc_offsets`( VOLTRO_UNDO=on added `_voltro_undo_log`( VOLTRO_TRACING_PERSIST=all added `_voltro_traces`((All three read as pure runtime knobs, so they tend to live on the PODS and(not on the pre-upgrade migrate Job — which is a green migrate followed by(every pod in CrashLoopBackOff. This was reported against a Helm deployment(where `CDC: \"0\"` was in all three overlays' pod blocks and none of their(jobs; it had been latent for months and would have fired on the next deploy.((WHAT YOU MUST DO — only if you set one of these to turn a table ON in(production:(( * `VOLTRO_UNDO=on` in production → add to app.config.ts:( export default { schema: { undo: true }, … }( * `VOLTRO_TRACING_PERSIST` keeping trace history in production → add:( export default { schema: { traces: true }, … }(( Without the declaration, `voltro serve` now REFUSES to boot and names the( field. That refusal is the point: before, the same configuration either( wrote to a table nobody created or produced a fingerprint the migrate job( could not reproduce.(( Turning capture OFF still needs no declaration and never will — a declared( table nobody writes to is harmless. Only turning it ON is a schema claim.((WHAT HAPPENS WITHOUT ANY ACTION:(( * On mariadb or mssql you will see ONE additive `create-table` in your next( plan: `_voltro_cdc_offsets` is now declared by the DIALECT rather than by( `CDC`, so it exists whether or not that process drives CDC. It is an( offsets table — a handful of rows — and the alternative was leaving a( runtime flag able to split your fleet.( * On postgres/sqlite nothing changes: those dialects have no offsets table.((AND ONE THING WORTH DOING ANYWAY: if you are upgrading a deployment that has(a separate migrate job, diff that job's `env:` against your pods' once. The(framework can now guarantee its OWN tables do not depend on a runtime flag;(it cannot make the same guarantee for a plugin's `extendSchema.tables`, which(is app code and may read anything. A `prod-mismatch` refusal now prints which(tables this process decided and from which input, so the comparison is quick.".split("(")).join("\n")
5083
+ }), q = "session_expired", Jr = C({
5084
+ version: "0.35.1",
5085
+ id: "0.35.1/01_unauthorized-replaces-session-expired",
5086
+ title: "A 401 is `code: 'unauthorized'`; the vault's own failure is `'credential_unusable'`",
5087
+ kind: "transform",
5088
+ appliesTo: ({ project: e }) => e.getSourceFiles().some((e) => e.getFullText().includes(q)),
5089
+ transform: ({ project: e, log: t }) => {
5090
+ let n = [];
5091
+ for (let t of e.getSourceFiles()) {
5092
+ if (!t.getFullText().includes(q)) continue;
5093
+ let e = !1;
5094
+ for (let n of t.getDescendantsOfKind(11)) n.getLiteralValue() === q && (n.setLiteralValue("unauthorized"), e = !0);
5095
+ e && n.push(t.getFilePath());
5096
+ }
5097
+ n.length !== 0 && t(`rewrote '${q}' to 'unauthorized' in ${n.length} file(s).\n A 401 now means only "the credential was refused" — expired, revoked, wrong\n scope and MALFORMED all produce that status, and the old name asserted the\n first one. If a rewritten branch was meant to catch a credential your\n CONNECTION VAULT could not produce (no grant, revoked grant, failed refresh),\n change it to 'credential_unusable' — that is the code the vault raises, and it\n is the one where re-auth is genuinely the right action.\n A health check that logs the user out on this code should read 'unauthorized'\n as "ask again", not as "the session is gone".\n` + n.map((e) => ` ${e}`).join("\n"));
5098
+ }
5099
+ }), Yr = /\(\s*\{[^}]*\.\.\./, Xr = /\bquery\??\.?\(\s*['"`]/, J = [
5070
5100
  ge,
5071
5101
  _e,
5072
5102
  ye,
@@ -5165,23 +5195,69 @@ var x = (e, t, n) => {
5165
5195
  Ir,
5166
5196
  Hr,
5167
5197
  Wr,
5198
+ Kr,
5199
+ qr,
5200
+ Jr,
5168
5201
  C({
5169
- version: "0.35.0",
5170
- id: "0.35.0/04_flow-run-step-skipped",
5171
- title: "A flow run step can now be 'skipped' handle it where you render a run timeline",
5202
+ version: "0.37.0",
5203
+ id: "0.37.0/01_procedure-input-rejects-undeclared-fields",
5204
+ title: "a procedure input rejects a field it does not declare (it used to drop it)",
5172
5205
  kind: "manual",
5173
- appliesTo: ({ project: e }) => e.getSourceFiles().some((e) => Gr(e.getFullText())),
5174
- note: (/* @__PURE__ */ "A FLOW RUN STEP CAN NOW BE 'skipped'.((`when:` on a flow step gates it on a prior value, and a step whose condition(is false is SKIPPED rather than run. That is a sixth member of(`RunStepStatus`, so an exhaustive switch over it no longer compiles, and a(lookup keyed by status now has a hole.((WHAT TO DO:((1) FIND IT. Anywhere you render or branch on a run step status — a timeline( component, a status badge map, a progress calculation.((2) DECIDE WHAT A SKIPPED STEP LOOKS LIKE. It is NOT a failure and NOT a( success: it did not run, on purpose, and it produced no output. The( step carries `skipReason` — the rendered condition, e.g.( `{{mode}} equals \"full\"` — so the timeline can say WHY.((3) DO NOT DEFAULT IT TO INVISIBLE. Dropping the row compiles and reads fine( in review, and it reproduces exactly the problem `skipReason` exists to( prevent: a step that vanished is indistinguishable from a step nobody( declared, which is the first thing a user reports as a bug.((A PROGRESS COUNT probably needs a second look too: `succeeded / total` now(under-reports a completed run that skipped a step. Counting(`succeeded + skipped` against the total is usually what was meant.((If your app does not render a flow timeline, there is nothing to do — this(note fires on any file that names the status type or its literals.".split("(")).join("\n")
5175
- }),
5176
- C({
5177
- version: "0.35.0",
5178
- id: "0.35.0/05_declared-schema-drops-runtime-flags",
5179
- title: "The declared schema no longer reads `CDC` / `VOLTRO_UNDO` / `VOLTRO_TRACING_PERSIST`",
5180
- kind: "manual",
5181
- appliesTo: () => !0,
5182
- note: (/* @__PURE__ */ "The set of framework tables your app DECLARES is hashed into the schema(fingerprint. A pre-deploy `voltro db apply` records that hash; every serving(container recomputes it and refuses to boot if it differs. Until this release(three RUNTIME flags fed into that set:(( CDC=0 removed `_voltro_cdc_offsets`( VOLTRO_UNDO=on added `_voltro_undo_log`( VOLTRO_TRACING_PERSIST=all added `_voltro_traces`((All three read as pure runtime knobs, so they tend to live on the PODS and(not on the pre-upgrade migrate Job which is a green migrate followed by(every pod in CrashLoopBackOff. This was reported against a Helm deployment(where `CDC: \"0\"` was in all three overlays' pod blocks and none of their(jobs; it had been latent for months and would have fired on the next deploy.((WHAT YOU MUST DO — only if you set one of these to turn a table ON in(production:(( * `VOLTRO_UNDO=on` in production → add to app.config.ts:( export default { schema: { undo: true }, … }( * `VOLTRO_TRACING_PERSIST` keeping trace history in production → add:( export default { schema: { traces: true }, … }(( Without the declaration, `voltro serve` now REFUSES to boot and names the( field. That refusal is the point: before, the same configuration either( wrote to a table nobody created or produced a fingerprint the migrate job( could not reproduce.(( Turning capture OFF still needs no declaration and never will — a declared( table nobody writes to is harmless. Only turning it ON is a schema claim.((WHAT HAPPENS WITHOUT ANY ACTION:(( * On mariadb or mssql you will see ONE additive `create-table` in your next( plan: `_voltro_cdc_offsets` is now declared by the DIALECT rather than by( `CDC`, so it exists whether or not that process drives CDC. It is an( offsets table — a handful of rows — and the alternative was leaving a( runtime flag able to split your fleet.( * On postgres/sqlite nothing changes: those dialects have no offsets table.((AND ONE THING WORTH DOING ANYWAY: if you are upgrading a deployment that has(a separate migrate job, diff that job's `env:` against your pods' once. The(framework can now guarantee its OWN tables do not depend on a runtime flag;(it cannot make the same guarantee for a plugin's `extendSchema.tables`, which(is app code and may read anything. A `prod-mismatch` refusal now prints which(tables this process decided and from which input, so the comparison is quick.".split("(")).join("\n")
5206
+ appliesTo: ({ project: e }) => e.getSourceFiles().some((e) => {
5207
+ let t = e.getFullText();
5208
+ return Yr.test(t) || Xr.test(t) || w("query").test(t);
5209
+ }),
5210
+ note: [
5211
+ "A procedure call whose input carries a field the schema does not declare",
5212
+ "now fails with a ParseError naming the field. Before this release the",
5213
+ "field was DISCARDED and the call ran with what was left.",
5214
+ "",
5215
+ "The measurement that caused it — a consumer's root layout:",
5216
+ "",
5217
+ " query?.('userSettings.list', { employeeId })",
5218
+ "",
5219
+ "That procedure declares `userId` / `userIdIn`. The payload decoded to `{}`,",
5220
+ "which for a LIST query is not a narrower filter — it is NO filter. An admin",
5221
+ "was served a different user's settings row, and nothing logged anything.",
5222
+ "",
5223
+ "WHAT TO DO",
5224
+ "",
5225
+ "1. Run your test suite and your app against a dev build. A wrong field now",
5226
+ " surfaces as a ParseError that NAMES the key and lists the accepted ones,",
5227
+ " so each one is a one-line read rather than an investigation.",
5228
+ "",
5229
+ "2. Look at every SPREAD into a procedure input:",
5230
+ "",
5231
+ " await api.orders.list({ ...filters, limit })",
5232
+ "",
5233
+ " This is the construct the change is aimed at. The keys come from a value,",
5234
+ " so nobody reading the call site can see what is being sent — which is",
5235
+ " exactly the condition under which a stray key survived unnoticed.",
5236
+ "",
5237
+ "3. If a spread legitimately carries more than the procedure declares, narrow",
5238
+ " it at the call site (`{ status: filters.status, limit }`) rather than",
5239
+ " widening the input schema. Widening restores the silent drop under a",
5240
+ " different name: the field is accepted and still does nothing.",
5241
+ "",
5242
+ "WHAT DOES NOT CHANGE",
5243
+ "",
5244
+ " • A DECLARED field, including every optional one, decodes exactly as",
5245
+ " before. An empty input to a procedure that declares none is still fine.",
5246
+ " • Nested objects and union members follow the same rule — that is the",
5247
+ " point, since a filter object one level down is the commoner spelling.",
5248
+ " • A non-object input (a scalar, a void input) is unaffected; there is no",
5249
+ " excess property for it to have.",
5250
+ "",
5251
+ "WHY IT IS NOT A WARNING",
5252
+ "",
5253
+ "The decoder cannot tell a projection field from a FILTER field. Dropping an",
5254
+ "unknown `include` costs a caller some data; dropping an unknown `tenantId`",
5255
+ "hands them somebody else's. Since nothing at decode time distinguishes the",
5256
+ "two, the only safe direction is to refuse — and a warning would have to be",
5257
+ "read by someone, in a log, after the wrong rows were already served."
5258
+ ].join("\n")
5183
5259
  })
5184
- ], J = /* @__PURE__ */ new Set([
5260
+ ], Y = /* @__PURE__ */ new Set([
5185
5261
  "node_modules",
5186
5262
  ".git",
5187
5263
  "dist",
@@ -5193,12 +5269,12 @@ var x = (e, t, n) => {
5193
5269
  ".turbo",
5194
5270
  ".cache",
5195
5271
  ".output"
5196
- ]), Kr = () => [...[...J].map((e) => `**/${e}/**`), "**/.voltro-*/**"], Y = /(?:from|import)\s*\(?\s*['"]([^'"]+)['"]|require\s*\(\s*['"]([^'"]+)['"]\s*\)/g, X = /\.(?:tsx?|jsx?|mjs|cjs)$/, qr = (e) => m(e).replace(X, ""), Jr = (e) => {
5272
+ ]), Zr = () => [...[...Y].map((e) => `**/${e}/**`), "**/.voltro-*/**"], X = /(?:from|import)\s*\(?\s*['"]([^'"]+)['"]|require\s*\(\s*['"]([^'"]+)['"]\s*\)/g, Z = /\.(?:tsx?|jsx?|mjs|cjs)$/, Qr = (e) => m(e).replace(Z, ""), $r = (e) => {
5197
5273
  let t = e.split("/").filter((e) => e.length > 0).pop();
5198
5274
  if (t === void 0 || t === "." || t === "..") return;
5199
- let n = t.replace(X, "");
5275
+ let n = t.replace(Z, "");
5200
5276
  return n.length > 0 ? n : void 0;
5201
- }, Yr = (e) => {
5277
+ }, ei = (e) => {
5202
5278
  let t = /* @__PURE__ */ new Map();
5203
5279
  for (let n of e) {
5204
5280
  let e;
@@ -5207,57 +5283,57 @@ var x = (e, t, n) => {
5207
5283
  } catch {
5208
5284
  continue;
5209
5285
  }
5210
- Y.lastIndex = 0;
5211
- for (let r = Y.exec(e); r !== null; r = Y.exec(e)) {
5212
- let e = Jr(r[1] ?? r[2] ?? "");
5286
+ X.lastIndex = 0;
5287
+ for (let r = X.exec(e); r !== null; r = X.exec(e)) {
5288
+ let e = $r(r[1] ?? r[2] ?? "");
5213
5289
  if (e === void 0) continue;
5214
5290
  let i = t.get(e);
5215
5291
  i === void 0 ? t.set(e, /* @__PURE__ */ new Set([n])) : i.add(n);
5216
5292
  }
5217
5293
  }
5218
5294
  return t;
5219
- }, Xr = (e, t) => {
5295
+ }, ti = (e, t) => {
5220
5296
  let n = new Set(e);
5221
- for (let r of e) for (let e of [qr(r), m(h(r))]) {
5297
+ for (let r of e) for (let e of [Qr(r), m(h(r))]) {
5222
5298
  let r = t.get(e);
5223
5299
  if (r !== void 0) for (let e of r) n.add(e);
5224
5300
  }
5225
5301
  return n;
5226
- }, Zr = [
5302
+ }, ni = [
5227
5303
  "**/*.ts",
5228
5304
  "**/*.tsx",
5229
5305
  "!**/node_modules/**",
5230
5306
  "!**/dist/**",
5231
5307
  "!**/.framework/**",
5232
5308
  "!**/*.d.ts"
5233
- ], Z = (e, t, n = ei) => {
5309
+ ], Q = (e, t, n = ai) => {
5234
5310
  let r = /* @__PURE__ */ new Set();
5235
- for (let e of t) for (let t of e.scope ?? Zr) r.add(t);
5311
+ for (let e of t) for (let t of e.scope ?? ni) r.add(t);
5236
5312
  let i = n(e);
5237
5313
  if (i !== void 0) {
5238
- let t = [...r].filter((e) => !e.startsWith("!")).map((e) => $r(e)), n = [...r].filter((e) => e.startsWith("!")).map((e) => $r(e.slice(1))), a = [...J], o = [];
5314
+ let t = [...r].filter((e) => !e.startsWith("!")).map((e) => ii(e)), n = [...r].filter((e) => e.startsWith("!")).map((e) => ii(e.slice(1))), a = [...Y], o = [];
5239
5315
  for (let r of i) {
5240
5316
  if (a.some((e) => r === e || r.startsWith(`${e}/`) || r.includes(`/${e}/`)) || !t.some((e) => e(r)) || n.some((e) => e(r))) continue;
5241
5317
  let i = g(e, r);
5242
5318
  v(i) && o.push(i);
5243
5319
  }
5244
- return Qr(o.length, e), o;
5320
+ return ri(o.length, e), o;
5245
5321
  }
5246
5322
  let a = oe([...r], {
5247
5323
  cwd: e,
5248
5324
  absolute: !0,
5249
5325
  expandDirectories: !1,
5250
5326
  followSymbolicLinks: !1,
5251
- ignore: [...Kr()]
5327
+ ignore: [...Zr()]
5252
5328
  });
5253
- return Qr(a.length, e), a;
5254
- }, Qr = (e, t) => {
5255
- let n = ti();
5329
+ return ri(a.length, e), a;
5330
+ }, ri = (e, t) => {
5331
+ let n = oi();
5256
5332
  if (!(e <= n)) throw Error(`voltro update: the codemod scan matched ${e} files under ${t}, past the ${n} ceiling.\n Every matched file is parsed into one ts-morph project, so the heap needed grows with\n this number — past the ceiling it runs out of memory, and V8 aborts without naming a\n limit, which is why this stops here instead. Three ways out, in order:\n • put non-source directories in .gitignore (inside a git repo the scan then never\n sees them at all — a build cache, a data dump, a virtualenv),\n • run \`voltro update\` from the app directory rather than the workspace root, or\n • take one codemod at a time: \`voltro update --dry-run\` lists the ids, then\n \`voltro update --codemods-only --only <id>\` runs a single one.\n If every one of those files really is source this pass must rewrite, raise the ceiling\n with VOLTRO_CODEMOD_MAX_FILES and give node room: NODE_OPTIONS=--max-old-space-size=8192.`);
5257
- }, $r = (e) => {
5333
+ }, ii = (e) => {
5258
5334
  let t = e.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*\//g, "\0").replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*").replace(/\u0000/g, "(?:.*/)?").replace(/\\\{([^}]*)\\\}/g, (e, t) => `(?:${t.split(",").join("|")})`);
5259
5335
  return (e) => RegExp(`^${t}$`).test(e);
5260
- }, ei = (e) => {
5336
+ }, ai = (e) => {
5261
5337
  try {
5262
5338
  let t = re("git", [
5263
5339
  "ls-files",
@@ -5278,17 +5354,17 @@ var x = (e, t, n) => {
5278
5354
  } catch {
5279
5355
  return;
5280
5356
  }
5281
- }, ti = () => {
5357
+ }, oi = () => {
5282
5358
  let e = Number(process.env.VOLTRO_CODEMOD_MAX_FILES);
5283
5359
  return Number.isInteger(e) && e > 0 ? e : 2e4;
5284
- }, Q = (e, t) => {
5360
+ }, $ = (e, t) => {
5285
5361
  let n = e.split(".").map(Number), r = t.split(".").map(Number);
5286
5362
  for (let e = 0; e < 3; e++) {
5287
5363
  let t = (n[e] ?? 0) - (r[e] ?? 0);
5288
5364
  if (t !== 0) return t;
5289
5365
  }
5290
5366
  return 0;
5291
- }, ni = (e, t, n = q) => n.filter((n) => Q(e, n.version) < 0 && Q(n.version, t) <= 0).slice().sort(he), $ = (e, t, n = () => {}) => {
5367
+ }, si = (e, t, n = J) => n.filter((n) => $(e, n.version) < 0 && $(n.version, t) <= 0).slice().sort(he), ci = (e, t, n = () => {}) => {
5292
5368
  let r = [], i = [], a = [];
5293
5369
  for (let o of t) {
5294
5370
  if (!(!o.appliesTo || o.appliesTo({ project: e }))) {
@@ -5334,8 +5410,8 @@ var x = (e, t, n) => {
5334
5410
  manual: i,
5335
5411
  skipped: a
5336
5412
  };
5337
- }, ri = async (e) => {
5338
- let t = e.log ?? (() => {}), n = ni(e.from, e.to, e.codemods ?? q), r = e.only === void 0 || e.only.length === 0 ? n : (() => {
5413
+ }, li = async (e) => {
5414
+ let t = e.log ?? (() => {}), n = si(e.from, e.to, e.codemods ?? J), r = e.only === void 0 || e.only.length === 0 ? n : (() => {
5339
5415
  let t = n.filter((t) => e.only.includes(t.id)), r = e.only.filter((e) => !n.some((t) => t.id === e));
5340
5416
  if (r.length > 0) throw Error(`voltro update --only: no codemod in ${e.from} → ${e.to} has id ${r.map((e) => `"${e}"`).join(", ")}.\n Available for this jump:\n${n.map((e) => ` ${e.id}`).join("\n")}`);
5341
5417
  return t;
@@ -5354,15 +5430,15 @@ var x = (e, t, n) => {
5354
5430
  baseUrl: i.baseUrl,
5355
5431
  paths: i.paths
5356
5432
  } }
5357
- }), o, s = Z(e.root, r), c = r.filter((e) => e.needsImporters === !0 && e.scope !== void 0), l = [], u = [], d = [], p = c.length > 0 ? Yr(Z(e.root, [{
5433
+ }), o, s = Q(e.root, r), c = r.filter((e) => e.needsImporters === !0 && e.scope !== void 0), l = [], u = [], d = [], p = c.length > 0 ? ei(Q(e.root, [{
5358
5434
  ...c[0],
5359
- scope: Zr
5435
+ scope: ni
5360
5436
  }])) : void 0;
5361
5437
  for (let n of r) {
5362
5438
  if (c.includes(n)) {
5363
- let r = a(), i = Z(e.root, [n]);
5364
- for (let e of Xr(i, p)) v(e) && r.addSourceFileAtPath(e);
5365
- let s = $(r, [n], t);
5439
+ let r = a(), i = Q(e.root, [n]);
5440
+ for (let e of ti(i, p)) v(e) && r.addSourceFileAtPath(e);
5441
+ let s = ci(r, [n], t);
5366
5442
  e.dryRun || await r.save(), l.push(...s.applied), u.push(...s.manual), d.push(...s.skipped), o = void 0;
5367
5443
  continue;
5368
5444
  }
@@ -5371,7 +5447,7 @@ var x = (e, t, n) => {
5371
5447
  for (let t of s) v(t) && e.addSourceFileAtPath(t);
5372
5448
  return e;
5373
5449
  })();
5374
- let r = $(o, [n], t);
5450
+ let r = ci(o, [n], t);
5375
5451
  e.dryRun || await o.save(), l.push(...r.applied), u.push(...r.manual), d.push(...r.skipped);
5376
5452
  }
5377
5453
  return {
@@ -5381,4 +5457,4 @@ var x = (e, t, n) => {
5381
5457
  };
5382
5458
  };
5383
5459
  //#endregion
5384
- export { C as i, ri as n, J as r, Q as t };
5460
+ export { C as i, li as n, Y as r, $ as t };