@voltro/cli 0.55.0 → 0.57.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 +691 -0
- package/bin/voltro.mjs +24 -0
- package/dist/apiBuild-B83Cb2Rv.js +2 -0
- package/dist/{apiBuild-CMvLJM_K.js → apiBuild-DDr2aNFd.js} +119 -88
- package/dist/bin.js +1 -1
- package/dist/{build-S0QOzqPT.js → build-QKP6Bm0J.js} +308 -279
- package/dist/buildReport-52gHKgfO.js +64 -0
- package/dist/{checkCommand-DNkY5kwF.js → checkCommand-BISqx1OJ.js} +1 -1
- package/dist/{checkCommand-fbj9GDjN.js → checkCommand-DUtMWjcR.js} +6 -6
- package/dist/{clusterCmd-DrVFCzSj.js → clusterCmd-CdLB1GkT.js} +1 -1
- package/dist/{codegen-SIepQtUl.js → codegen-Bth5lUTU.js} +2 -1
- package/dist/codegen-DbH7NbCR.js +2 -0
- package/dist/{codegenCommand-3TDJezom.js → codegenCommand-DnVuDxwT.js} +11 -11
- package/dist/{codemodRunner-C2zxZUIw.js → codemodRunner-BlQPfjzA.js} +222 -0
- package/dist/{commands-BBYJ7Q3B.js → commands-CRbxgxv0.js} +35 -35
- package/dist/{dashboardCommand-D2kmyCLL.js → dashboardCommand-Bf_-Ne3P.js} +5 -5
- package/dist/{dataCommand-BEPPQiTl.js → dataCommand-BoBJJ-Gb.js} +3 -3
- package/dist/{dbCommand-DZTmOFT4.js → dbCommand-CMAIz-Bf.js} +457 -441
- package/dist/dbCommand-DHi_RuDl.js +2 -0
- package/dist/dev-Bl9HqtV7.js +3 -0
- package/dist/{dev-Ca_A_S9v.js → dev-DOEJXicj.js} +2623 -2485
- package/dist/{doctorCommand-CGZJK_4o.js → doctorCommand-BrWu67JZ.js} +524 -280
- package/dist/doctorCommand-DrQv9SL3.js +2 -0
- package/dist/{dormancyCommand-DY2rYpTa.js → dormancyCommand-xn2y-pJm.js} +1 -1
- package/dist/{embeddingsCommand-BoCqZsgp.js → embeddingsCommand-Cn5MbRDM.js} +1 -1
- package/dist/emptyResultHeadline-Csa5fZOF.js +18 -0
- package/dist/{envCommand-Bxy2fOjc.js → envCommand-UJmJIbs9.js} +8 -8
- package/dist/{evolveCommand-BsbZ-XDg.js → evolveCommand-Db30twUy.js} +2 -2
- package/dist/frameworkTableAssembly-B96WCNJA.js +2 -0
- package/dist/{frameworkTableAssembly-Do-cf6RJ.js → frameworkTableAssembly-vfkzuzEo.js} +131 -104
- package/dist/index.js +1 -1
- package/dist/{infoCommand-EmM3jPKD.js → infoCommand-BjVXpMlP.js} +1 -1
- package/dist/inspect-B0hL41s0.js +2 -0
- package/dist/inspect-DZnan87F.js +1500 -0
- package/dist/{inspectCmd-niF97fAq.js → inspectCmd-CP-G0sVK.js} +1 -1
- package/dist/{inspectFetch-EMuhTG_9.js → inspectFetch-BU1NyzxV.js} +36 -24
- package/dist/{inspectMetrics-CGF94puw.js → inspectMetrics-BY0Sjb2F.js} +19 -19
- package/dist/{logsCmd-B6oNsfaZ.js → logsCmd-C5y9HyrG.js} +59 -54
- package/dist/{manifestBuild-DjX5MoXy.js → manifestBuild-DnbFKF6w.js} +1 -1
- package/dist/manifestBuild-UXrnUcXP.js +2 -0
- package/dist/{migrate-CGFZS-1a.js → migrate-DtC3lu7H.js} +4 -4
- package/dist/precompressAssets-YhTi1aWp.js +40 -0
- package/dist/{probeCommand-Bs3iVBSL.js → probeCommand-C5fuN6Z2.js} +2 -2
- package/dist/{runtimeTrace-C1BTpHGQ.js → runtimeTrace-BQL_lfz6.js} +1 -1
- package/dist/{scheduleCmd-DQRu6BZC.js → scheduleCmd-DYBUfo_T.js} +1 -1
- package/dist/{sdkgen-CXMwLg9n.js → sdkgen-CMUPrDjH.js} +1 -1
- package/dist/{seedRunner-Dgsiwk_e.js → seedRunner-DISBKow-.js} +16 -16
- package/dist/serveCommand-B_w-Mpb_.js +2544 -0
- package/dist/serveCommand-Dtb48ffg.js +2 -0
- package/dist/serveEntry.js +1 -1
- package/dist/{start-EOV7s1NZ.js → start-YaUehtDV.js} +580 -558
- package/dist/{start-DH7cat4-.js → start-s25GAIgn.js} +1 -1
- package/dist/startEntry.js +1 -1
- package/dist/staticCachePolicy-CIyj6DbS.js +15 -0
- package/dist/{test-DO27-x2P.js → test-jipIQ5Mx.js} +1 -1
- package/dist/{tracesCmd-DgtgOUdi.js → tracesCmd-C1qKa94g.js} +69 -64
- package/dist/{updateCommand-C_jN1w18.js → updateCommand-C9n_Z_oG.js} +8 -2
- package/dist/updateCommand-DsXEAHbd.js +2 -0
- package/dist/webDev-B6ZMX42w.js +2 -0
- package/dist/{webDev-B7vNj4Bq.js → webDev-BgdkyjP6.js} +1379 -1303
- package/dist/{webhooksCommand-B1LVcyO3.js → webhooksCommand-CYXTNvXq.js} +2 -2
- package/dist/{workflowsCmd-BGF-mRZ5.js → workflowsCmd-g-DNpaUc.js} +1 -1
- package/package.json +55 -19
- package/templates/AGENTS.core.md +20 -1
- package/templates/AGENTS.md +21 -2
- package/templates/agent-docs/_index.md +1 -1
- package/templates/agent-docs/_manifest.json +2 -2
- package/templates/agent-docs/ai.md +1 -1
- package/templates/agent-docs/authentication.md +34 -19
- package/templates/agent-docs/cli.md +170 -0
- package/templates/agent-docs/configuration.md +29 -4
- package/templates/agent-docs/data.md +145 -5
- package/templates/agent-docs/database/scaling.md +50 -2
- package/templates/agent-docs/deployment.md +75 -1
- package/templates/agent-docs/internationalization.md +32 -0
- package/templates/agent-docs/local-first-mobile.md +9 -2
- package/templates/agent-docs/observability.md +227 -0
- package/templates/agent-docs/plugins/audit.md +21 -5
- package/templates/agent-docs/plugins/billing.md +17 -0
- package/templates/agent-docs/plugins/broadcast.md +2 -1
- package/templates/agent-docs/plugins/ratelimit.md +6 -1
- package/templates/agent-docs/plugins/row-history.md +11 -0
- package/templates/agent-docs/plugins.md +19 -0
- package/templates/agent-docs/reference.md +1 -0
- package/templates/agent-docs/scheduling.md +23 -0
- package/templates/agent-docs/schema-driven-ui.md +81 -0
- package/templates/agent-docs/templates/appshells.md +3 -3
- package/templates/agent-docs/whats-new.md +133 -77
- package/templates/apps/api-ai/package.json +6 -6
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +9 -9
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-row-history/package.json +8 -8
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/package.json +7 -7
- package/templates/apps/changelog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +7 -8
- package/templates/apps/frontend-admin/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-admin/src/pages/admin/layout.tsx +1 -2
- package/templates/apps/frontend-app/package.json +8 -9
- package/templates/apps/frontend-app/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-auth/package.json +7 -8
- package/templates/apps/frontend-auth/src/components/AuthShell.tsx +1 -2
- package/templates/apps/frontend-blank/package.json +6 -7
- package/templates/apps/frontend-blank/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-cms/package.json +8 -9
- package/templates/apps/frontend-cms/src/pages/(app)/layout.tsx +1 -2
- package/templates/apps/frontend-collab/README.md +7 -2
- package/templates/apps/frontend-collab/package.json +9 -10
- package/templates/apps/frontend-collab/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +8 -4
- package/templates/apps/frontend-collab/src/pages/page.tsx +10 -5
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-contact/src/components/ContactForm.island.tsx +1 -1
- package/templates/apps/frontend-dashboard/package.json +6 -7
- package/templates/apps/frontend-dashboard/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-dashboard/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-docs/package.json +8 -8
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-portal/package.json +7 -8
- package/templates/apps/frontend-portal/src/pages/(portal)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/package.json +7 -8
- package/templates/apps/frontend-saas/src/pages/(marketing)/layout.tsx +1 -2
- package/templates/apps/frontend-saas/src/pages/dashboard/layout.tsx +1 -2
- package/templates/apps/frontend-spa/package.json +6 -7
- package/templates/apps/frontend-spa/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr/package.json +6 -7
- package/templates/apps/frontend-ssr/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-ssr-api/package.json +7 -8
- package/templates/apps/frontend-ssr-api/src/pages/layout.tsx +1 -2
- package/templates/apps/frontend-static-blog/package.json +8 -8
- package/templates/apps/frontend-static-blog/src/components/ReadingProgress.island.tsx +1 -1
- package/templates/apps/frontend-static-blog/src/pages/[locale]/page.tsx +7 -1
- package/templates/apps/frontend-status/package.json +7 -8
- package/templates/apps/frontend-status/src/pages/layout.tsx +1 -2
- package/templates/apps/mobile-app/package.json +4 -4
- package/templates/baselines/compose/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose/docker/web.Dockerfile +55 -10
- package/templates/baselines/compose-mariadb/docker/api.Dockerfile +61 -5
- package/templates/baselines/compose-mariadb/docker/web.Dockerfile +55 -10
- package/dist/apiBuild-Cl0IDx8c.js +0 -2
- package/dist/codegen-CN6vMM4J.js +0 -2
- package/dist/dbCommand-BTyBGhIA.js +0 -2
- package/dist/dev-DfVZaoys.js +0 -3
- package/dist/doctorCommand-djmqEcDC.js +0 -2
- package/dist/frameworkTableAssembly-Df2Ymp2f.js +0 -2
- package/dist/inspect-DCqILJ1G.js +0 -1197
- package/dist/inspect-DGJwpOAb.js +0 -2
- package/dist/manifestBuild-CJ2zvPvT.js +0 -2
- package/dist/serveCommand-C7IrCD58.js +0 -2445
- package/dist/serveCommand-Cjt5S9hD.js +0 -2
- package/dist/updateCommand-nnFjDbl4.js +0 -2
- package/dist/webDev-1XpVnYkW.js +0 -2
package/dist/startEntry.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var e = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? Math.floor(e) : void 0, t = (t) => {
|
|
2
|
+
let n = t?.http?.cache;
|
|
3
|
+
return {
|
|
4
|
+
immutableMaxAgeSeconds: e(n?.immutableMaxAgeSeconds) ?? 31536e3,
|
|
5
|
+
staticMaxAgeSeconds: e(n?.staticMaxAgeSeconds) ?? 3600,
|
|
6
|
+
htmlSMaxAgeSeconds: e(n?.htmlSMaxAgeSeconds),
|
|
7
|
+
isrShared: n?.isrShared === !0
|
|
8
|
+
};
|
|
9
|
+
}, n = (e) => /^\/assets\/[^/]*-[A-Za-z0-9_-]{6,12}\.[a-z0-9]+$/i.test(e), r = (e, t) => n(e) && t.immutableMaxAgeSeconds > 0 ? `public, max-age=${t.immutableMaxAgeSeconds}, immutable` : `public, max-age=${t.staticMaxAgeSeconds}`, i = (e) => e.htmlSMaxAgeSeconds === void 0 ? "public, max-age=0, must-revalidate" : `public, max-age=0, s-maxage=${e.htmlSMaxAgeSeconds}, must-revalidate`, a = (e, t, n = 0) => {
|
|
10
|
+
if (!e.isrShared || t == null || t <= 0) return "public, max-age=0, must-revalidate";
|
|
11
|
+
let r = Math.max(1, Math.floor(t / 1e3)), i = Math.max(0, Math.floor(n / 1e3));
|
|
12
|
+
return i > 0 ? `public, max-age=0, s-maxage=${r}, stale-while-revalidate=${i}, must-revalidate` : `public, max-age=0, s-maxage=${r}, must-revalidate`;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { t as a, n as i, a as n, i as r, r as t };
|
|
@@ -79,7 +79,7 @@ var d = l({ scope: "voltro:test" }), f = (e) => {
|
|
|
79
79
|
}, C = async (e) => {
|
|
80
80
|
let t = m(e);
|
|
81
81
|
if (!o(t.root)) return console.error(`voltro test: no such directory: ${t.root}`), 1;
|
|
82
|
-
let { checkRpcGroupFreshness: n } = await import("./codegen-
|
|
82
|
+
let { checkRpcGroupFreshness: n } = await import("./codegen-DbH7NbCR.js"), r = await n(t.root);
|
|
83
83
|
if (r.kind === "stale") return console.error(`voltro test: ${r.file} is stale — ${r.reason}.`), console.error(" The tests would run against the previously generated procedure group, pass, and prove nothing about the descriptors you just edited.\n Run `voltro codegen` (or boot `voltro dev` once) and try again."), 1;
|
|
84
84
|
d.info("running vitest", {
|
|
85
85
|
root: t.root,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as e } from "./runtimeRegistry-DMeKfTHP.js";
|
|
2
2
|
import { n as t } from "./cliOutput-D1tSBoRM.js";
|
|
3
|
-
import { a as n, i as r } from "./inspectFetch-
|
|
4
|
-
import {
|
|
3
|
+
import { a as n, i as r } from "./inspectFetch-BU1NyzxV.js";
|
|
4
|
+
import { n as i, t as a } from "./emptyResultHeadline-Csa5fZOF.js";
|
|
5
|
+
import { ansi as o } from "@voltro/logger";
|
|
5
6
|
//#region src/tracesCmd.ts
|
|
6
|
-
var
|
|
7
|
+
var s = (e) => {
|
|
7
8
|
let t = /^(\d+)([smh])$/.exec(e);
|
|
8
9
|
if (t) {
|
|
9
10
|
let e = Number(t[1]), n = t[2], r = n === "s" ? 1e3 : n === "m" ? 6e4 : 36e5;
|
|
@@ -11,10 +12,10 @@ var a = (e) => {
|
|
|
11
12
|
}
|
|
12
13
|
let n = Number(e);
|
|
13
14
|
return Number.isFinite(n) && n > 0 ? n : null;
|
|
14
|
-
},
|
|
15
|
+
}, c = (e) => {
|
|
15
16
|
let t = r(e);
|
|
16
17
|
if (t.error !== void 0) return { error: t.error };
|
|
17
|
-
let n = t.target, i = t.rest,
|
|
18
|
+
let n = t.target, i = t.rest, a = {
|
|
18
19
|
tail: 20,
|
|
19
20
|
since: void 0,
|
|
20
21
|
errors: !1,
|
|
@@ -31,54 +32,54 @@ var a = (e) => {
|
|
|
31
32
|
case "--tail": {
|
|
32
33
|
let e = n(), t = e === void 0 ? NaN : Number(e);
|
|
33
34
|
if (!Number.isFinite(t) || t <= 0) return { error: `--tail expects a positive number, got '${e ?? ""}'` };
|
|
34
|
-
|
|
35
|
+
a.tail = Math.floor(t);
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
37
38
|
case "--since": {
|
|
38
39
|
let e = n();
|
|
39
40
|
if (e === void 0) return { error: "--since expects a value" };
|
|
40
|
-
let t =
|
|
41
|
+
let t = s(e);
|
|
41
42
|
if (t === null) return { error: `--since: unrecognised '${e}' (try '30s', '5m', '1h', or unix-ms)` };
|
|
42
|
-
|
|
43
|
+
a.since = t;
|
|
43
44
|
break;
|
|
44
45
|
}
|
|
45
46
|
case "--errors":
|
|
46
47
|
case "--error":
|
|
47
|
-
|
|
48
|
+
a.errors = !0;
|
|
48
49
|
break;
|
|
49
50
|
case "--id":
|
|
50
51
|
case "--trace": {
|
|
51
52
|
let e = n();
|
|
52
53
|
if (e === void 0 || e.length === 0) return { error: "--id expects a traceId" };
|
|
53
|
-
|
|
54
|
+
a.id = e;
|
|
54
55
|
break;
|
|
55
56
|
}
|
|
56
57
|
case "--min-duration": {
|
|
57
58
|
let e = n(), t = e === void 0 ? NaN : Number(e);
|
|
58
59
|
if (!Number.isFinite(t) || t < 0) return { error: `--min-duration expects a number (ms), got '${e ?? ""}'` };
|
|
59
|
-
|
|
60
|
+
a.minDurationMs = t;
|
|
60
61
|
break;
|
|
61
62
|
}
|
|
62
63
|
case "--status": {
|
|
63
64
|
let e = n();
|
|
64
65
|
if (e !== "ok" && e !== "error" && e !== "unset") return { error: "--status: must be 'ok' | 'error' | 'unset'" };
|
|
65
|
-
|
|
66
|
+
a.statusFilter = e;
|
|
66
67
|
break;
|
|
67
68
|
}
|
|
68
69
|
case "--process":
|
|
69
|
-
|
|
70
|
+
a.process = n();
|
|
70
71
|
break;
|
|
71
72
|
case "--format": {
|
|
72
73
|
let e = n();
|
|
73
74
|
if (e !== "pretty" && e !== "json") return { error: "--format: must be 'pretty' | 'json'" };
|
|
74
|
-
|
|
75
|
+
a.format = e;
|
|
75
76
|
break;
|
|
76
77
|
}
|
|
77
78
|
case "--no-color":
|
|
78
|
-
|
|
79
|
+
a.color = !1;
|
|
79
80
|
break;
|
|
80
81
|
case "--color":
|
|
81
|
-
|
|
82
|
+
a.color = !0;
|
|
82
83
|
break;
|
|
83
84
|
case "--help":
|
|
84
85
|
case "-h": return { error: "help" };
|
|
@@ -86,21 +87,21 @@ var a = (e) => {
|
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
return {
|
|
89
|
-
...
|
|
90
|
+
...a,
|
|
90
91
|
target: n
|
|
91
92
|
};
|
|
92
|
-
},
|
|
93
|
+
}, l = () => {
|
|
93
94
|
console.log("voltro traces — distributed traces from every running voltro api"), console.log(""), console.log("Usage:"), console.log(" voltro traces [--tail N] [--since SPEC] [--errors] [--process NAME]"), console.log(" [--format pretty|json] [--no-color]"), console.log(" voltro traces --id <traceId> [--min-duration MS] [--status ok|error|unset]"), console.log(" [--process NAME] [--format pretty|json]"), console.log(""), console.log("Examples:"), console.log(" voltro traces # 20 newest traces, pretty"), console.log(" voltro traces --errors # only traces with an errored span"), console.log(" voltro traces --since 30s # last 30 seconds"), console.log(" voltro traces --id <traceId> # one trace, span waterfall"), console.log(" voltro traces --errors --format json | jq '.traces[]'"), console.log(""), console.log("Tip: pair with `voltro logs --trace <id>` to get the full causal chain.");
|
|
94
|
-
},
|
|
95
|
-
let a =
|
|
96
|
-
if ("error" in a) return a.error !== "help" && console.error(`voltro traces: ${a.error}`),
|
|
97
|
-
let
|
|
95
|
+
}, u = async (r) => {
|
|
96
|
+
let a = c(r);
|
|
97
|
+
if ("error" in a) return a.error !== "help" && console.error(`voltro traces: ${a.error}`), l(), a.error === "help" ? 0 : 2;
|
|
98
|
+
let s = (a.target === void 0 ? await e() : {
|
|
98
99
|
version: 1,
|
|
99
100
|
apps: [n(a.target)]
|
|
100
101
|
}).apps.filter((e) => e.kind === "api" && e.status === "live" && e.url.length > 0 && (a.process === void 0 || e.name === a.process));
|
|
101
|
-
if (
|
|
102
|
+
if (s.length === 0) return console.error(a.process === void 0 ? "voltro traces: no running api processes found" : `voltro traces: no running api named '${a.process}'`), a.process === void 0 && console.error(" start one with 'voltro dev' and try again."), 1;
|
|
102
103
|
if (a.id !== void 0) {
|
|
103
|
-
let e =
|
|
104
|
+
let e = s.map((e) => f(e, a.id)), n = await Promise.all(e), r = n.find((e) => e.kind === "ok" && e.spans.length > 0);
|
|
104
105
|
if (!r || r.kind !== "ok") {
|
|
105
106
|
let e = n.filter((e) => e.kind === "err");
|
|
106
107
|
if (a.format === "json") t({
|
|
@@ -115,38 +116,42 @@ var a = (e) => {
|
|
|
115
116
|
console.error(`voltro traces: no spans for trace ${a.id}`);
|
|
116
117
|
for (let t of e) console.error(` # ${t.name}: ${t.error}`);
|
|
117
118
|
}
|
|
118
|
-
return +(e.length ===
|
|
119
|
+
return +(e.length === s.length);
|
|
119
120
|
}
|
|
120
121
|
return a.format === "json" ? (t({
|
|
121
122
|
traceId: a.id,
|
|
122
123
|
process: r.name,
|
|
123
124
|
spans: r.spans
|
|
124
|
-
}, { pretty: !1 }), 0) : (
|
|
125
|
+
}, { pretty: !1 }), 0) : (_(a.id, r.name, p(r.spans, a), a.color), 0);
|
|
125
126
|
}
|
|
126
|
-
let
|
|
127
|
-
for (let e of
|
|
127
|
+
let u = s.map((e) => d(e, a)), m = await Promise.all(u), h = [], v = [];
|
|
128
|
+
for (let e of m) e.kind === "ok" ? h.push(...e.traces.map((t) => ({
|
|
128
129
|
...t,
|
|
129
130
|
process: e.name
|
|
130
|
-
}))) :
|
|
131
|
+
}))) : v.push({
|
|
131
132
|
name: e.name,
|
|
132
133
|
error: e.error
|
|
133
134
|
});
|
|
134
|
-
|
|
135
|
-
let
|
|
135
|
+
h.sort((e, t) => t.startMs - e.startMs);
|
|
136
|
+
let y = h.slice(0, a.tail);
|
|
136
137
|
if (a.format === "json") {
|
|
137
|
-
let e =
|
|
138
|
-
traces:
|
|
139
|
-
fetchErrors:
|
|
140
|
-
} : { traces:
|
|
141
|
-
return t(e, { pretty: !1 }), +(
|
|
138
|
+
let e = v.length > 0 ? {
|
|
139
|
+
traces: y,
|
|
140
|
+
fetchErrors: v
|
|
141
|
+
} : { traces: y };
|
|
142
|
+
return t(e, { pretty: !1 }), +(v.length === s.length);
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
g(y, a.color), y.length === 0 && console.error(i({
|
|
145
|
+
noun: "traces",
|
|
146
|
+
targets: s.length,
|
|
147
|
+
failures: v
|
|
148
|
+
}) ?? "voltro traces: no traces matched the given filters.");
|
|
149
|
+
for (let e of v) {
|
|
145
150
|
let t = `# fetch failed: ${e.name}: ${e.error}`;
|
|
146
|
-
console.error(a.color ?
|
|
151
|
+
console.error(a.color ? o.dim(t) : t);
|
|
147
152
|
}
|
|
148
|
-
return +(
|
|
149
|
-
},
|
|
153
|
+
return +(v.length === s.length);
|
|
154
|
+
}, d = async (e, t) => {
|
|
150
155
|
let n = new URLSearchParams();
|
|
151
156
|
n.set("max", String(t.tail)), t.since !== void 0 && n.set("since", String(t.since)), t.errors && n.set("onlyErrors", "1");
|
|
152
157
|
let r = `${e.url.replace(/\/+$/, "")}/_voltro/inspect/traces?${n.toString()}`;
|
|
@@ -157,7 +162,7 @@ var a = (e) => {
|
|
|
157
162
|
if (!n.ok) return {
|
|
158
163
|
kind: "err",
|
|
159
164
|
name: e.name,
|
|
160
|
-
error:
|
|
165
|
+
error: await a(n)
|
|
161
166
|
};
|
|
162
167
|
let i = await n.json();
|
|
163
168
|
return {
|
|
@@ -172,7 +177,7 @@ var a = (e) => {
|
|
|
172
177
|
error: t.message || String(t)
|
|
173
178
|
};
|
|
174
179
|
}
|
|
175
|
-
},
|
|
180
|
+
}, f = async (e, t) => {
|
|
176
181
|
let n = `${e.url.replace(/\/+$/, "")}/_voltro/inspect/traces?traceId=${encodeURIComponent(t)}`;
|
|
177
182
|
try {
|
|
178
183
|
let t = {};
|
|
@@ -181,7 +186,7 @@ var a = (e) => {
|
|
|
181
186
|
if (!r.ok) return {
|
|
182
187
|
kind: "err",
|
|
183
188
|
name: e.name,
|
|
184
|
-
error:
|
|
189
|
+
error: await a(r)
|
|
185
190
|
};
|
|
186
191
|
let i = await r.json();
|
|
187
192
|
return {
|
|
@@ -196,40 +201,40 @@ var a = (e) => {
|
|
|
196
201
|
error: t.message || String(t)
|
|
197
202
|
};
|
|
198
203
|
}
|
|
199
|
-
},
|
|
204
|
+
}, p = (e, t) => {
|
|
200
205
|
let n = e;
|
|
201
206
|
return t.minDurationMs !== void 0 && (n = n.filter((e) => e.durationMs >= t.minDurationMs)), t.statusFilter !== void 0 && (n = n.filter((e) => e.status === t.statusFilter)), n;
|
|
202
|
-
},
|
|
207
|
+
}, m = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, h = (e) => {
|
|
203
208
|
let t = new Date(e), n = (e, t = 2) => String(e).padStart(t, "0");
|
|
204
209
|
return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${n(t.getMilliseconds(), 3)}`;
|
|
205
|
-
},
|
|
210
|
+
}, g = (e, t) => {
|
|
206
211
|
for (let n of e) {
|
|
207
|
-
let e =
|
|
212
|
+
let e = h(n.startMs), r = n.traceId.slice(0, 8), i = n.rootName.padEnd(36).slice(0, 36), a;
|
|
208
213
|
if (n.kind === "subscription") {
|
|
209
|
-
let e = n.deliveryCount ?? 0, t = n.lastDeliveryMs === void 0 ? "—" :
|
|
210
|
-
|
|
211
|
-
} else
|
|
212
|
-
let s = n.hasError ? t ?
|
|
213
|
-
console.log(`${c} ${l} ${s} ${
|
|
214
|
+
let e = n.deliveryCount ?? 0, t = n.lastDeliveryMs === void 0 ? "—" : m(n.lastDeliveryMs);
|
|
215
|
+
a = `sub ${e} ${e === 1 ? "delivery" : "deliveries"} · last ${t}`;
|
|
216
|
+
} else a = `${n.spanCount} spans · ${m(n.durationMs)}`;
|
|
217
|
+
let s = n.hasError ? t ? o.red("err ") : "err " : t ? o.green("ok ") : "ok ", c = t ? o.dim(e) : e, l = t ? o.dim(r) : r, u = t ? o.dim(`@${n.process}`) : `@${n.process}`;
|
|
218
|
+
console.log(`${c} ${l} ${s} ${i} ${a} ${u}`);
|
|
214
219
|
}
|
|
215
|
-
},
|
|
220
|
+
}, _ = (e, t, n, r) => {
|
|
216
221
|
if (n.length === 0) {
|
|
217
222
|
console.log(`trace ${e} (no spans matched)`);
|
|
218
223
|
return;
|
|
219
224
|
}
|
|
220
|
-
let
|
|
221
|
-
if (
|
|
222
|
-
if (t > 64 || e.parentSpanId === null) return
|
|
223
|
-
let n =
|
|
224
|
-
return
|
|
225
|
+
let i = new Map(n.map((e) => [e.spanId, e])), a = /* @__PURE__ */ new Map(), s = (e, t) => {
|
|
226
|
+
if (a.has(e.spanId)) return a.get(e.spanId);
|
|
227
|
+
if (t > 64 || e.parentSpanId === null) return a.set(e.spanId, 0), 0;
|
|
228
|
+
let n = i.get(e.parentSpanId), r = n ? s(n, t + 1) + 1 : 0;
|
|
229
|
+
return a.set(e.spanId, r), r;
|
|
225
230
|
};
|
|
226
231
|
for (let e of n) s(e, 0);
|
|
227
|
-
let c = [...n].sort((e, t) => e.startMs - t.startMs), l = c[0].startMs, u = n.some((e) => e.status === "error") ? r ?
|
|
228
|
-
console.log(r ?
|
|
232
|
+
let c = [...n].sort((e, t) => e.startMs - t.startMs), l = c[0].startMs, u = n.some((e) => e.status === "error") ? r ? o.red(" · contains error") : " · contains error" : "", d = `trace ${e} (${n.length} spans @${t})${u}`;
|
|
233
|
+
console.log(r ? o.bold(d) : d), console.log("");
|
|
229
234
|
for (let e of c) {
|
|
230
|
-
let t = " ".repeat(
|
|
231
|
-
console.log(`${n} ${
|
|
235
|
+
let t = " ".repeat(a.get(e.spanId) ?? 0), n = m(e.durationMs).padStart(6), i = `+${m(e.startMs - l)}`.padStart(8), s = e.status === "error" ? r ? o.red("✗") : "✗" : r ? o.dim("·") : "·", c = r && e.status === "error" ? o.red(e.name) : e.name, u = e.statusMessage ? r ? o.dim(` // ${e.statusMessage}`) : ` // ${e.statusMessage}` : "";
|
|
236
|
+
console.log(`${n} ${i} ${s} ${t}${c}${u}`);
|
|
232
237
|
}
|
|
233
238
|
};
|
|
234
239
|
//#endregion
|
|
235
|
-
export {
|
|
240
|
+
export { u as runTracesCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./codemodRunner-
|
|
1
|
+
import { n as e, r as t, t as n } from "./codemodRunner-BlQPfjzA.js";
|
|
2
2
|
import { basename as r, dirname as i, join as a, relative as o, resolve as s } from "node:path";
|
|
3
3
|
import { existsSync as c, readFileSync as l, readdirSync as u, statSync as d, writeFileSync as f } from "node:fs";
|
|
4
4
|
import { totalmem as p } from "node:os";
|
|
@@ -590,7 +590,13 @@ with \`--only\` / \`--root\`.`;
|
|
|
590
590
|
only: n.only,
|
|
591
591
|
log: (e) => console.log(` ${e}`)
|
|
592
592
|
});
|
|
593
|
-
if (r.applied.length === 0 && r.manual.length === 0)
|
|
593
|
+
if (r.applied.length === 0 && r.manual.length === 0) {
|
|
594
|
+
if (r.skipped.length === 0) return console.log("codemods: none ship for this jump — nothing to apply."), 0;
|
|
595
|
+
console.log(`codemods: ${r.skipped.length} ship for this jump; none matched your project.`);
|
|
596
|
+
for (let e of r.skipped) console.log(` · ${e} — its own check found nothing to change`);
|
|
597
|
+
return console.log(""), console.log("If one of these SHOULD have matched, that is a bug in its check, not in your"), console.log("project — the CHANGELOG entry for this version says what each one looks for."), 0;
|
|
598
|
+
}
|
|
599
|
+
r.skipped.length > 0 && console.log(`codemods: ${r.skipped.length} skipped (own check found nothing): ${r.skipped.join(", ")}`);
|
|
594
600
|
let i = n.dryRun ? "·" : "✓";
|
|
595
601
|
for (let e of r.applied) {
|
|
596
602
|
let t = [];
|