@voltro/cli 0.47.0 → 0.49.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 +147 -0
- package/dist/{apiBuild-FpHCWiv6.js → apiBuild-QmYHaCF4.js} +1 -1
- package/dist/apiBuild-dZbHdqMg.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/{build-zVygXxGB.js → build-Bi4O_g7T.js} +6 -6
- package/dist/{checkCommand-D0dAKciE.js → checkCommand-D8vjQXQt.js} +3 -3
- package/dist/{checkCommand-B2Fw73lu.js → checkCommand-udbQpphy.js} +1 -1
- package/dist/{codegenCommand-BTtsnRus.js → codegenCommand-DApSH7hK.js} +39 -46
- package/dist/{codemodRunner-DSZjgyCL.js → codemodRunner-De1_316I.js} +562 -492
- package/dist/{commands-BrFKxnYW.js → commands-a5PxCaIg.js} +68 -60
- package/dist/{dashboardCommand-D9SjDc8E.js → dashboardCommand-DaoUUqJS.js} +1 -1
- package/dist/dataCommand-CJv_OMoS.js +1156 -0
- package/dist/dataProfile-Du3ztYxv.js +51 -0
- package/dist/{dbCommand-jbrmzwW_.js → dbCommand-Bf7Cy0mn.js} +5 -5
- package/dist/dbCommand-Bnl7MSGC.js +2 -0
- package/dist/declaredSchemaGates-BlcwObhb.js +25 -0
- package/dist/{dev-RjB7eE_B.js → dev-C31Nvlbv.js} +31 -30
- package/dist/{dev-CaIfZnw5.js → dev-DFVuzOj7.js} +1 -1
- package/dist/{doctorCommand-D7X29cw6.js → doctorCommand-B3uraeAe.js} +32 -14
- package/dist/doctorCommand-CPL6EhrW.js +2 -0
- package/dist/doctorDecidedSchema-BlbWgCD_.js +23 -0
- package/dist/{dormancyCommand-BGOP27fz.js → dormancyCommand-QUXQ9yoz.js} +1 -1
- package/dist/{embeddingsCommand-D72E22bw.js → embeddingsCommand-Zw1-rYSF.js} +1 -1
- package/dist/{envCommand-BHSxz6wC.js → envCommand-DtaJ4xEf.js} +1 -1
- package/dist/{evolveCommand-C2ofGGlz.js → evolveCommand-JDD3hE1i.js} +2 -2
- package/dist/{frameworkTableAssembly-BvZ0Lil_.js → frameworkTableAssembly-BwJVEKLr.js} +96 -119
- package/dist/frameworkTableAssembly-CVDB2hCq.js +2 -0
- package/dist/index.js +1 -1
- package/dist/{infoCommand-CuNl9cbh.js → infoCommand-COsUC1DB.js} +1 -1
- package/dist/{migrate-odCPGHPq.js → migrate-D3MK9BpK.js} +4 -4
- package/dist/{runtimeTrace-C_OKr0jY.js → runtimeTrace-Di6fcndp.js} +1 -1
- package/dist/{sdkgen-D9trW7sl.js → sdkgen-CIi5gM17.js} +1 -1
- package/dist/serveCommand-CzSDngKm.js +2 -0
- package/dist/serveCommand-N3udT49p.js +2362 -0
- package/dist/serveEntry.js +5 -5
- package/dist/{subcommandNames-CKG5Dz3a.js → subcommandNames-DpYs3DXr.js} +12 -2
- package/dist/{updateCommand-BlyXavoG.js → updateCommand-2BfbeMvp.js} +1 -1
- package/dist/updateCommand-CtYm7aKH.js +2 -0
- package/dist/{webhooksCommand-BqcWcbuW.js → webhooksCommand-CwX9IzvJ.js} +1 -1
- package/package.json +29 -17
- package/templates/AGENTS.md +1 -1
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/cli.md +117 -4
- package/templates/agent-docs/database/migrations.md +19 -5
- package/templates/agent-docs/whats-new.md +51 -14
- package/templates/apps/api-ai/package.json +7 -7
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +10 -10
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-versioning/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +6 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +9 -9
- package/templates/apps/frontend-auth/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-cms/package.json +9 -9
- package/templates/apps/frontend-collab/package.json +10 -10
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/package.json +7 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +8 -8
- package/templates/apps/frontend-saas/package.json +8 -8
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/package.json +6 -6
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/apiBuild-BsooZpw2.js +0 -2
- package/dist/dataCommand-Dl11q14e.js +0 -975
- package/dist/dataProfile-Cm0YVKSy.js +0 -18
- package/dist/dbCommand-BUD4Fd8v.js +0 -2
- package/dist/doctorCommand-5zv6PN-G.js +0 -2
- package/dist/frameworkTableAssembly-DDKtwsy2.js +0 -2
- package/dist/serveCommand-BU0wfV6V.js +0 -1931
- package/dist/serveCommand-Bwrn_9Fn.js +0 -2
- package/dist/updateCommand-CT5AvVg7.js +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { dirname as
|
|
3
|
-
import { readFileSync as
|
|
4
|
-
import { fileURLToPath as
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./subcommandNames-DpYs3DXr.js";
|
|
2
|
+
import { dirname as i, join as a, resolve as o } from "node:path";
|
|
3
|
+
import { readFileSync as s } from "node:fs";
|
|
4
|
+
import { fileURLToPath as c } from "node:url";
|
|
5
5
|
//#region src/commands.ts
|
|
6
|
-
var
|
|
6
|
+
var l = () => {
|
|
7
7
|
try {
|
|
8
|
-
let e = i(
|
|
9
|
-
return JSON.parse(
|
|
8
|
+
let e = a(i(c(import.meta.url)), "..", "package.json");
|
|
9
|
+
return JSON.parse(s(e, "utf8")).version ?? "0.0.0";
|
|
10
10
|
} catch {
|
|
11
11
|
return "0.0.0";
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, u = [
|
|
14
14
|
{
|
|
15
15
|
name: "list-templates",
|
|
16
16
|
summary: "List available app templates (kind, summary, tags).",
|
|
@@ -91,7 +91,7 @@ var c = () => {
|
|
|
91
91
|
name: "dev",
|
|
92
92
|
summary: "Start the local development server (auto-discovers routes / mutations).",
|
|
93
93
|
status: "wired",
|
|
94
|
-
run: (e) => import("./dev-
|
|
94
|
+
run: (e) => import("./dev-DFVuzOj7.js").then((t) => t.runDev(e)),
|
|
95
95
|
help: {
|
|
96
96
|
usage: "[app]",
|
|
97
97
|
examples: [["voltro dev", "boot the app in the current directory"], ["voltro dev apps/acme/api", "boot a specific app"]],
|
|
@@ -109,7 +109,7 @@ var c = () => {
|
|
|
109
109
|
name: "dashboard",
|
|
110
110
|
summary: "Serve the DevTools dashboard standalone (from @voltro/dashboard). Targets via VOLTRO_DASHBOARD_APPS; --port to override.",
|
|
111
111
|
status: "wired",
|
|
112
|
-
run: (e) => import("./dashboardCommand-
|
|
112
|
+
run: (e) => import("./dashboardCommand-DaoUUqJS.js").then((t) => t.runDashboardCommand(e)),
|
|
113
113
|
help: {
|
|
114
114
|
usage: "[--port <n>]",
|
|
115
115
|
flags: [["--port <n>", "port to serve the dashboard on"]],
|
|
@@ -121,7 +121,7 @@ var c = () => {
|
|
|
121
121
|
name: "check",
|
|
122
122
|
summary: "Verify the app graph (blast-radius checks) against a running api; LLM-shaped --json diagnostics. Flags: --json, --process <p>, --diff removeTable:<name>.",
|
|
123
123
|
status: "wired",
|
|
124
|
-
run: (e) => import("./checkCommand-
|
|
124
|
+
run: (e) => import("./checkCommand-udbQpphy.js").then((t) => t.runCheckCommand(e)),
|
|
125
125
|
help: {
|
|
126
126
|
usage: "[--json] [--offline] [--process <name>] [--diff removeTable:<name>]",
|
|
127
127
|
flags: [
|
|
@@ -155,7 +155,7 @@ var c = () => {
|
|
|
155
155
|
name: "webhooks",
|
|
156
156
|
summary: "Outbound-webhook artefacts. `consumer` generates the ZERO-DEPENDENCY Standard-Webhooks verification package a subscriber installs, from this app's own declared events; `events` lists the events a subscriber can register for. Usage: voltro webhooks <consumer|events> [path] [--out <dir>] [--name <pkg>] [--json].",
|
|
157
157
|
status: "wired",
|
|
158
|
-
run: (e) => import("./webhooksCommand-
|
|
158
|
+
run: (e) => import("./webhooksCommand-CwX9IzvJ.js").then((t) => t.runWebhooksCommand(e)),
|
|
159
159
|
help: {
|
|
160
160
|
usage: "<consumer|events> [path] [--out <dir>] [--name <pkg>] [--json]",
|
|
161
161
|
flags: [
|
|
@@ -171,7 +171,7 @@ var c = () => {
|
|
|
171
171
|
name: "evolve",
|
|
172
172
|
summary: "Schema-evolution copilot: propose an observed-graph-driven codemod + a branch-verified backfill for a schema change (rename/retype/split/drop a column, rename a table). Dry-run by default; --write applies. Usage: voltro evolve rename-column <table>.<col> --to <newName> [--write] [--json].",
|
|
173
173
|
status: "wired",
|
|
174
|
-
run: (e) => import("./evolveCommand-
|
|
174
|
+
run: (e) => import("./evolveCommand-JDD3hE1i.js").then((t) => t.runEvolveCommand(e)),
|
|
175
175
|
help: {
|
|
176
176
|
usage: "<rename-column|rename-table|retype-column|split-column|drop-column> <target> [--to <new>] [--write]",
|
|
177
177
|
flags: [
|
|
@@ -188,7 +188,7 @@ var c = () => {
|
|
|
188
188
|
name: "codegen",
|
|
189
189
|
summary: "Emit rpcGroup.generated.ts from discovered route / mutation descriptors.",
|
|
190
190
|
status: "wired",
|
|
191
|
-
run: (e) => import("./codegenCommand-
|
|
191
|
+
run: (e) => import("./codegenCommand-DApSH7hK.js").then((t) => t.runCodegenCommand(e)),
|
|
192
192
|
help: {
|
|
193
193
|
usage: "[app]",
|
|
194
194
|
examples: [["voltro codegen", "regenerate rpcGroup.generated.ts for the app in the cwd"]],
|
|
@@ -199,7 +199,7 @@ var c = () => {
|
|
|
199
199
|
name: "migrate",
|
|
200
200
|
summary: "Apply the declared schema to the database (alias of `db apply` — diffs declared vs live and emits the ALTERs). `--create-only` for the bootstrap-only CREATE TABLE IF NOT EXISTS path.",
|
|
201
201
|
status: "wired",
|
|
202
|
-
run: (e) => import("./migrate-
|
|
202
|
+
run: (e) => import("./migrate-D3MK9BpK.js").then((t) => t.runMigrateCommand(e)),
|
|
203
203
|
help: {
|
|
204
204
|
usage: "[app] [--create-only]",
|
|
205
205
|
flags: [["--create-only", "only CREATE TABLE IF NOT EXISTS — never ALTER (bootstrap)"]],
|
|
@@ -259,7 +259,7 @@ var c = () => {
|
|
|
259
259
|
name: "info",
|
|
260
260
|
summary: "Report versions (CLI, node, every installed @voltro/* — flags lockstep skew), package manager, and dialect. --json for CI. Exits 1 on version skew.",
|
|
261
261
|
status: "wired",
|
|
262
|
-
run: (e) => import("./infoCommand-
|
|
262
|
+
run: (e) => import("./infoCommand-COsUC1DB.js").then((t) => t.runInfoCommand(e)),
|
|
263
263
|
help: {
|
|
264
264
|
usage: "[--json]",
|
|
265
265
|
flags: [["--json", "machine-readable report"]],
|
|
@@ -280,7 +280,7 @@ var c = () => {
|
|
|
280
280
|
name: "env",
|
|
281
281
|
summary: "Inspect/sync the typed-env manifest. Subcommands: check (default), sync (.env.example), types (env.generated.d.ts for CI tsc), turbo.",
|
|
282
282
|
status: "wired",
|
|
283
|
-
run: (e) => import("./envCommand-
|
|
283
|
+
run: (e) => import("./envCommand-DtaJ4xEf.js").then((t) => t.runEnvCommand(e)),
|
|
284
284
|
help: {
|
|
285
285
|
usage: "[check|sync|types|turbo] [--force]",
|
|
286
286
|
flags: [["--force", "overwrite the generated file instead of refusing on a conflict"]],
|
|
@@ -309,12 +309,12 @@ var c = () => {
|
|
|
309
309
|
run: async (e) => {
|
|
310
310
|
let t = e.find((e) => !e.startsWith("-")) ?? process.cwd();
|
|
311
311
|
if (e.includes("--preflight")) {
|
|
312
|
-
let { runServePreflight: e } = await import("./doctorCommand-
|
|
313
|
-
return e(
|
|
312
|
+
let { runServePreflight: e } = await import("./doctorCommand-CPL6EhrW.js");
|
|
313
|
+
return e(o(t), !0);
|
|
314
314
|
}
|
|
315
|
-
let { tryRunWebServe: n } = await import("./webDev-B79ji8M5.js"), r = await n(
|
|
315
|
+
let { tryRunWebServe: n } = await import("./webDev-B79ji8M5.js"), r = await n(o(t));
|
|
316
316
|
if (!r.ran) {
|
|
317
|
-
let { runServeDispatch: t } = await import("./serveCommand-
|
|
317
|
+
let { runServeDispatch: t } = await import("./serveCommand-CzSDngKm.js");
|
|
318
318
|
return t(e);
|
|
319
319
|
}
|
|
320
320
|
return r.exitCode;
|
|
@@ -342,13 +342,13 @@ var c = () => {
|
|
|
342
342
|
handlesHelp: !0,
|
|
343
343
|
summary: "Preflight an app for production: the precompiled serve bundle, hand-rolled primitives (naming the shipped one), @voltro/* version skew, executors with no access check, `.serverOnly()` leaks, and junction-FK gaps.",
|
|
344
344
|
status: "wired",
|
|
345
|
-
run: (e) => import("./doctorCommand-
|
|
345
|
+
run: (e) => import("./doctorCommand-CPL6EhrW.js").then((t) => t.runDoctorCommand(e))
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
name: "build",
|
|
349
349
|
summary: "Production build for a web app (vite build + per-page SSG pre-render).",
|
|
350
350
|
status: "wired",
|
|
351
|
-
run: (e) => import("./build-
|
|
351
|
+
run: (e) => import("./build-Bi4O_g7T.js").then((t) => t.runBuildCommand(e)),
|
|
352
352
|
help: {
|
|
353
353
|
usage: "[app] [--target <t>]",
|
|
354
354
|
flags: [["--target <t>", "build target"]],
|
|
@@ -364,7 +364,7 @@ var c = () => {
|
|
|
364
364
|
name: "prune-runtime",
|
|
365
365
|
summary: "Trim a deployed web tree’s node_modules to the reachable runtime set (standalone image slimming).",
|
|
366
366
|
status: "wired",
|
|
367
|
-
run: (e) => import("./runtimeTrace-
|
|
367
|
+
run: (e) => import("./runtimeTrace-Di6fcndp.js").then((t) => t.runPruneRuntimeCommand(e)),
|
|
368
368
|
hidden: !0
|
|
369
369
|
},
|
|
370
370
|
{
|
|
@@ -382,7 +382,7 @@ var c = () => {
|
|
|
382
382
|
name: "dormancy",
|
|
383
383
|
summary: "Single-node scale-to-zero: front the API with a wake-orchestrator that stops the app when idle and brings it back on a request or a due wakeup (cron/workflow). Needs a SQL store. Flags: --port, --app-port, --idle-grace-ms, --tick-ms.",
|
|
384
384
|
status: "wired",
|
|
385
|
-
run: (e) => import("./dormancyCommand-
|
|
385
|
+
run: (e) => import("./dormancyCommand-QUXQ9yoz.js").then((t) => t.runDormancyCommand(e)),
|
|
386
386
|
help: {
|
|
387
387
|
usage: "[app] [--port <n>] [--app-port <n>] [--idle-grace-ms <n>] [--tick-ms <n>]",
|
|
388
388
|
flags: [
|
|
@@ -436,7 +436,7 @@ var c = () => {
|
|
|
436
436
|
status: "wired",
|
|
437
437
|
run: (e) => import("./privacyCommand-XejDMvmu.js").then((t) => t.runPrivacyCommand(e)),
|
|
438
438
|
help: {
|
|
439
|
-
usage:
|
|
439
|
+
usage: e(n),
|
|
440
440
|
examples: [
|
|
441
441
|
["voltro privacy scope --subject-table users", "every table a DSAR reaches, and every table it does not"],
|
|
442
442
|
["voltro privacy export usr_123 --url https://api.example.com", "the subject's portable bundle"],
|
|
@@ -453,9 +453,9 @@ var c = () => {
|
|
|
453
453
|
name: "db",
|
|
454
454
|
summary: "Database subcommands. Declarative flow: plan, apply, branch, plans, drift [--accept], squash, restore-snapshot. File migrations: generate [name], migrate, rollback, status, files, rollback-file. Data + housekeeping: seed, gc-snapshots, adopt. Credentials at rest: scan-credentials (find plaintext), encrypt-column (migrate a populated column onto .encrypted()).",
|
|
455
455
|
status: "wired",
|
|
456
|
-
run: (e) => import("./dbCommand-
|
|
456
|
+
run: (e) => import("./dbCommand-Bnl7MSGC.js").then((t) => t.runDbCommand(e)),
|
|
457
457
|
help: {
|
|
458
|
-
usage: t
|
|
458
|
+
usage: e(t),
|
|
459
459
|
examples: [
|
|
460
460
|
["voltro db plan", "the diff between the declared schema and the live database"],
|
|
461
461
|
["voltro db apply", "apply that diff"],
|
|
@@ -467,22 +467,30 @@ var c = () => {
|
|
|
467
467
|
},
|
|
468
468
|
{
|
|
469
469
|
name: "data",
|
|
470
|
-
summary: "Export/import + backup/restore of app data. Logical (rows + optional assets): export <dir> [--tenant <id>|--tables a,b] [--assets] [--compression zstd|gzip|none] [--consistency live|snapshot]; import <dir> [--assets] [--no-verify]
|
|
470
|
+
summary: "Export/import + backup/restore of app data. Logical (rows + optional assets): export <dir> [--tenant <id>|--tables a,b|--exclude a,b] [--assets] [--compression zstd|gzip|none] [--consistency live|snapshot]; import <dir> [--assets] [--no-verify]; transfers — the history in both directions, including a run in flight; inspect <file|dir>; unpack <file> <dir>. Native (rows ONLY — no blobs): backup <dir> / restore <dir> (pg_dump/mariadb-dump/…). Recovery: clear-replace-marker, clear-staging. Resumable; typed-NDJSON; content-addressed assets on the logical path.",
|
|
471
471
|
status: "wired",
|
|
472
|
-
run: (e) => import("./dataCommand-
|
|
472
|
+
run: (e) => import("./dataCommand-CJv_OMoS.js").then((t) => t.runDataCommand(e)),
|
|
473
473
|
help: {
|
|
474
|
-
usage:
|
|
474
|
+
usage: e(r),
|
|
475
475
|
flags: [
|
|
476
476
|
["--tenant <id>", "export one tenant's rows"],
|
|
477
477
|
["--tables <a,b>", "restrict to these tables"],
|
|
478
478
|
["--assets", "include blobs (logical path only)"],
|
|
479
479
|
["--compression <zstd|gzip|none>", "archive compression"],
|
|
480
480
|
["--consistency <live|snapshot>", "read live, or from a consistent snapshot"],
|
|
481
|
+
["--mode <upsert|append|replace>", "what an import does to what is there — `replace` EMPTIES the target first"],
|
|
482
|
+
["--on-conflict <skip|fail>", "a row that collides with an existing one"],
|
|
481
483
|
["--no-verify", "skip checksum verification on import"],
|
|
482
484
|
["--dry-run", "report what would move, write nothing"],
|
|
485
|
+
["--max-request-seconds <n>", "cap EVERY request (--target api); the transfer still takes as long as it takes"],
|
|
486
|
+
["--detach", "start it and return — exit 0 means STARTED, not finished (--target api)"],
|
|
483
487
|
["--json", "machine-readable progress + result"]
|
|
484
488
|
],
|
|
485
|
-
examples: [
|
|
489
|
+
examples: [
|
|
490
|
+
["voltro data export ./dump --assets", "rows + blobs, resumable, typed NDJSON"],
|
|
491
|
+
["voltro data transfers", "what has moved through here, and what is moving right now"],
|
|
492
|
+
["voltro data backup ./dump", "native dump (rows ONLY — no blobs)"]
|
|
493
|
+
]
|
|
486
494
|
}
|
|
487
495
|
},
|
|
488
496
|
{
|
|
@@ -524,20 +532,20 @@ var c = () => {
|
|
|
524
532
|
handlesHelp: !0,
|
|
525
533
|
summary: "Upgrade the app to the latest framework: bump every @voltro/* dependency (across ALL workspace members, install once at the workspace root), then run the codemods shipped with the target version. Flags: --to <version>, --from <version>, --codemods-only, --dry-run, --force, --exact, --help. After: run `voltro db apply`.",
|
|
526
534
|
status: "wired",
|
|
527
|
-
run: (e) => import("./updateCommand-
|
|
535
|
+
run: (e) => import("./updateCommand-CtYm7aKH.js").then((t) => t.runUpdateCommand(e))
|
|
528
536
|
},
|
|
529
537
|
{
|
|
530
538
|
name: "_apply-codemods",
|
|
531
539
|
summary: "Internal: apply shipped codemods for a framework version jump (re-exec target of `voltro update`).",
|
|
532
540
|
status: "wired",
|
|
533
541
|
hidden: !0,
|
|
534
|
-
run: (e) => import("./updateCommand-
|
|
542
|
+
run: (e) => import("./updateCommand-CtYm7aKH.js").then((t) => t.runApplyCodemods(e))
|
|
535
543
|
},
|
|
536
544
|
{
|
|
537
545
|
name: "embeddings",
|
|
538
546
|
summary: "Embeddings tooling. Subcommand: backfill <table> --text <field> --vector <field> [--model <m>] [--model-field <f>] [--batch <n>] [--dry-run] — (re)embed rows the vectorEmbedding() mixin missed.",
|
|
539
547
|
status: "wired",
|
|
540
|
-
run: (e) => import("./embeddingsCommand-
|
|
548
|
+
run: (e) => import("./embeddingsCommand-Zw1-rYSF.js").then((t) => t.runEmbeddingsCommand(e)),
|
|
541
549
|
help: {
|
|
542
550
|
usage: "backfill <table> --text <field> --vector <field> [--model <m>] [--batch <n>] [--dry-run]",
|
|
543
551
|
flags: [
|
|
@@ -664,15 +672,15 @@ var c = () => {
|
|
|
664
672
|
name: "help",
|
|
665
673
|
summary: "Print this help.",
|
|
666
674
|
status: "wired",
|
|
667
|
-
run: async (e) => (
|
|
675
|
+
run: async (e) => (p(), 0)
|
|
668
676
|
},
|
|
669
677
|
{
|
|
670
678
|
name: "version",
|
|
671
679
|
summary: "Print the voltro version.",
|
|
672
680
|
status: "wired",
|
|
673
|
-
run: async () => (console.log(
|
|
681
|
+
run: async () => (console.log(l()), 0)
|
|
674
682
|
}
|
|
675
|
-
],
|
|
683
|
+
], d = [
|
|
676
684
|
["Start a project", [
|
|
677
685
|
"init",
|
|
678
686
|
"create-project",
|
|
@@ -740,32 +748,32 @@ var c = () => {
|
|
|
740
748
|
"info"
|
|
741
749
|
]],
|
|
742
750
|
["Meta", ["help", "version"]]
|
|
743
|
-
],
|
|
751
|
+
], f = (e, t = 68) => {
|
|
744
752
|
let n = e.search(/\.(\s|$)/), r = n > 0 ? e.slice(0, n) : e;
|
|
745
753
|
return r.length <= t ? r : `${r.slice(0, t - 1).trimEnd()}…`;
|
|
746
|
-
},
|
|
747
|
-
let e =
|
|
748
|
-
console.log(`voltro v${
|
|
749
|
-
for (let [e, r] of
|
|
754
|
+
}, p = () => {
|
|
755
|
+
let e = u.filter((e) => !e.hidden), t = new Map(e.map((e) => [e.name, e])), n = e.reduce((e, t) => Math.max(e, t.name.length), 0);
|
|
756
|
+
console.log(`voltro v${l()}`), console.log("voltro <command> [args]");
|
|
757
|
+
for (let [e, r] of d) {
|
|
750
758
|
let i = r.map((e) => t.get(e)).filter((e) => e !== void 0);
|
|
751
759
|
if (i.length !== 0) {
|
|
752
760
|
console.log(`\n${e}`);
|
|
753
761
|
for (let e of i) {
|
|
754
762
|
let t = " ".repeat(n - e.name.length + 2);
|
|
755
|
-
console.log(` ${e.name}${t}${
|
|
763
|
+
console.log(` ${e.name}${t}${f(e.summary)}`);
|
|
756
764
|
}
|
|
757
765
|
}
|
|
758
766
|
}
|
|
759
|
-
let r = new Set(
|
|
767
|
+
let r = new Set(d.flatMap(([, e]) => e)), i = e.filter((e) => !r.has(e.name));
|
|
760
768
|
if (i.length > 0) {
|
|
761
769
|
console.log("\nOther");
|
|
762
770
|
for (let e of i) {
|
|
763
771
|
let t = " ".repeat(n - e.name.length + 2);
|
|
764
|
-
console.log(` ${e.name}${t}${
|
|
772
|
+
console.log(` ${e.name}${t}${f(e.summary)}`);
|
|
765
773
|
}
|
|
766
774
|
}
|
|
767
775
|
console.log("\nRun 'voltro <command> --help' for the full description, or see https://voltro.dev/docs/cli.");
|
|
768
|
-
},
|
|
776
|
+
}, m = (e, t) => {
|
|
769
777
|
let n = Array.from({ length: t.length + 1 }, (e, t) => t), r = Array(t.length + 1).fill(0);
|
|
770
778
|
for (let i = 1; i <= e.length; i++) {
|
|
771
779
|
r[0] = i;
|
|
@@ -776,13 +784,13 @@ var c = () => {
|
|
|
776
784
|
for (let e = 0; e <= t.length; e++) n[e] = r[e];
|
|
777
785
|
}
|
|
778
786
|
return n[t.length];
|
|
779
|
-
},
|
|
780
|
-
let n =
|
|
787
|
+
}, h = (e, t = 3) => {
|
|
788
|
+
let n = u.filter((e) => !e.hidden).map((e) => e.name), r = e.length <= 4 ? 1 : e.length <= 8 ? 2 : 3;
|
|
781
789
|
return n.map((t) => ({
|
|
782
790
|
name: t,
|
|
783
|
-
score: t.startsWith(e) || e.startsWith(t) ? -2 : t.includes(e) ? -1 :
|
|
791
|
+
score: t.startsWith(e) || e.startsWith(t) ? -2 : t.includes(e) ? -1 : m(e, t)
|
|
784
792
|
})).filter((e) => e.score <= r).sort((e, t) => e.score - t.score || e.name.localeCompare(t.name)).slice(0, t).map((e) => e.name);
|
|
785
|
-
},
|
|
793
|
+
}, g = (e) => {
|
|
786
794
|
let t = [`voltro ${e.name} — ${e.summary}`], n = e.help, r = (e) => {
|
|
787
795
|
let t = e.reduce((e, [t]) => Math.max(e, t.length), 0);
|
|
788
796
|
return e.map(([e, n]) => ` ${e}${" ".repeat(t - e.length + 2)}${n}`);
|
|
@@ -792,26 +800,26 @@ var c = () => {
|
|
|
792
800
|
for (let [e, r] of n.examples) t.push(` ${e}`, ` ${r}`);
|
|
793
801
|
}
|
|
794
802
|
return n?.notes !== void 0 && n.notes.length > 0 && t.push("", ...n.notes), t.push("", `Docs: https://voltro.dev/docs/cli/${e.name}`), t;
|
|
795
|
-
},
|
|
803
|
+
}, _ = /* @__PURE__ */ new Set(["--help", "-h"]), v = async (e) => {
|
|
796
804
|
let [t, ...n] = e;
|
|
797
|
-
if (!t ||
|
|
798
|
-
if (t === "--version" || t === "-v") return console.log(
|
|
799
|
-
if (t === "help" && n.length > 0 && !n[0].startsWith("-")) return
|
|
800
|
-
let r =
|
|
805
|
+
if (!t || _.has(t)) return p(), 0;
|
|
806
|
+
if (t === "--version" || t === "-v") return console.log(l()), 0;
|
|
807
|
+
if (t === "help" && n.length > 0 && !n[0].startsWith("-")) return v([n[0], "--help"]);
|
|
808
|
+
let r = u.find((e) => e.name === t);
|
|
801
809
|
if (!r) {
|
|
802
810
|
console.error(`voltro: unknown command '${t}'`);
|
|
803
|
-
let e =
|
|
811
|
+
let e = h(t);
|
|
804
812
|
if (e.length > 0) {
|
|
805
813
|
console.error(`\nDid you mean${e.length > 1 ? " one of" : ""}?`);
|
|
806
814
|
for (let t of e) console.error(` voltro ${t}`);
|
|
807
815
|
}
|
|
808
816
|
return console.error("\nrun 'voltro help' for available commands"), 2;
|
|
809
817
|
}
|
|
810
|
-
if (!r.handlesHelp && n.some((e) =>
|
|
811
|
-
for (let e of
|
|
818
|
+
if (!r.handlesHelp && n.some((e) => _.has(e))) {
|
|
819
|
+
for (let e of g(r)) console.log(e);
|
|
812
820
|
return 0;
|
|
813
821
|
}
|
|
814
822
|
return r.run(n);
|
|
815
823
|
};
|
|
816
824
|
//#endregion
|
|
817
|
-
export {
|
|
825
|
+
export { g as a, p as i, d as n, h as o, v as r, u as t };
|