@voltro/cli 0.51.0 → 0.53.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 +356 -0
- package/THIRD-PARTY-NOTICES.md +8311 -3318
- package/dist/{agentsMd-D6yD7IQv.js → agentsMd-0l980yhL.js} +4 -1
- package/dist/agentsMd-SDDSkyl4.js +2 -0
- package/dist/{apiBuild-CPDHXF72.js → apiBuild-CaPfoWku.js} +11 -5
- package/dist/apiBuild-DHtLXYx9.js +2 -0
- package/dist/bin.js +1 -1
- package/dist/build-D-OnvNMf.js +843 -0
- package/dist/{checkCommand-DNuPiWMc.js → checkCommand-C5elt0tW.js} +92 -46
- package/dist/checkCommand-D2ZduVlh.js +2 -0
- package/dist/{cloudCmd-F4YJeqM3.js → cloudCmd-QUXh-b5w.js} +1 -1
- package/dist/codegen-BWpt3VgF.js +2 -0
- package/dist/{codegen-CrMXs4hb.js → codegen-FEk8AZHb.js} +2 -2
- package/dist/{codegenCommand-BNBHcNNj.js → codegenCommand-BOiWQ5hz.js} +12 -12
- package/dist/{codemodRunner-BDVixlSw.js → codemodRunner-BjtB2lq6.js} +691 -545
- package/dist/{commands-B1OiS9bX.js → commands-DyxAmhP0.js} +36 -36
- package/dist/{dashboardCommand-C-vvPY1B.js → dashboardCommand-BdKTyT13.js} +3 -3
- package/dist/{dataCommand-C1GxXW5q.js → dataCommand-Bab9X7s8.js} +27 -27
- package/dist/{dbCommand-If4Y1xQ-.js → dbCommand-06O2finM.js} +277 -236
- package/dist/dbCommand-B1EXBC6f.js +2 -0
- package/dist/{dev-kdAg9Q7l.js → dev-C6LGF4iY.js} +2998 -2379
- package/dist/dev-GjJWAYo2.js +3 -0
- package/dist/doctorCommand-B0hX0tdz.js +2 -0
- package/dist/{doctorCommand-nKmeW78u.js → doctorCommand-etMkflRc.js} +332 -220
- package/dist/{dormancyCommand-CY3wa_SW.js → dormancyCommand-UwZ1AZzB.js} +1 -1
- package/dist/{embeddingsCommand-BDLIgje_.js → embeddingsCommand-C70zWHwo.js} +1 -1
- package/dist/{envCommand-C6V_xVlT.js → envCommand-dSyKvRkM.js} +15 -15
- package/dist/{evolveCommand-D3c4DSfN.js → evolveCommand-CG0_ebO5.js} +2 -2
- package/dist/fileConventions-DASGEmj-.js +35 -0
- package/dist/{fileTaxonomy-CJfgOllU.js → fileTaxonomy-B7uxipWS.js} +55 -55
- package/dist/fontPipeline-LxIHa1vo.js +2 -0
- package/dist/fontPipeline-Tsh8kZfA.js +152 -0
- package/dist/frameworkTableAssembly-C_7Z-rMs.js +2 -0
- package/dist/{frameworkTableAssembly-BwJVEKLr.js → frameworkTableAssembly-DKx3ba3S.js} +5 -5
- package/dist/imagePipeline-B_GVJgm6.js +2 -0
- package/dist/imagePipeline-CBZmjT4i.js +127 -0
- package/dist/index.js +1 -1
- package/dist/{infoCommand-BnRFEF1o.js → infoCommand-_53iOc_j.js} +1 -1
- package/dist/{inspect-CtL_xTbu.js → inspect-Bd8-9wsi.js} +1 -1
- package/dist/inspect-CuoDInfZ.js +2 -0
- package/dist/{inspectGateHint-BjnFubmH.js → inspectGateHint-4LxkNtrz.js} +1 -1
- package/dist/inspectMetrics-CGF94puw.js +143 -0
- package/dist/manifestBuild-C4-J1-m_.js +2 -0
- package/dist/{manifestBuild-CuU1VrSm.js → manifestBuild-Cqgsx2bM.js} +1 -1
- package/dist/{metaCommands-CfRLra0s.js → metaCommands-Cn2oboG4.js} +9 -3
- package/dist/{migrate-DehuBakM.js → migrate-Cko9rswM.js} +2 -2
- package/dist/{pageConvention-cEiRxdab.js → pageConvention-C938S8oC.js} +1 -1
- package/dist/{privacyCommand-XejDMvmu.js → privacyCommand-DWTQMC6R.js} +2 -2
- package/dist/{probeCommand-C9gazU0H.js → probeCommand-DkGGLknv.js} +83 -24
- package/dist/{projectScaffold-mIX_DpSe.js → projectScaffold-B4dmTlwT.js} +1 -1
- package/dist/{projectScaffold-BIl97_E6.js → projectScaffold-EzlErR4E.js} +1 -1
- package/dist/{renderModeScan-D7J1B7Kw.js → renderModeScan-CUbOeOAg.js} +28 -11
- package/dist/{renderProfile-1OWWAAtx.js → renderProfile-CskIgAfn.js} +2 -2
- package/dist/{runtimeTrace-ZsBU7Tkx.js → runtimeTrace-c0APJz7E.js} +1 -1
- package/dist/{sdkgen-O4XqWOjM.js → sdkgen-BiQCgIEr.js} +1 -1
- package/dist/serveCommand-CueKQgzl.js +2443 -0
- package/dist/serveCommand-DsnrVN3U.js +2 -0
- package/dist/serveEntry.js +1 -1
- package/dist/start-BJzZLbt8.js +3 -0
- package/dist/start-ekPan8BT.js +1510 -0
- package/dist/startEntry.js +1 -1
- package/dist/{staticCommand-Dr2M6tpU.js → staticCommand-xlSL-IWk.js} +1 -1
- package/dist/{test-rXFq4S76.js → test-BWPQcRoB.js} +1 -1
- package/dist/updateCommand-Bqql_rsQ.js +2 -0
- package/dist/{updateCommand-Bs322Q78.js → updateCommand-C_8I8Rzo.js} +139 -115
- package/dist/webDev-C7jWJ5dX.js +2 -0
- package/dist/{webDev-B-ubQEMX.js → webDev-oczpugbx.js} +1767 -913
- package/dist/{webhooksCommand-FLYY9IXh.js → webhooksCommand-4SVPDjKg.js} +1 -1
- package/package.json +72 -18
- package/templates/AGENTS.core.md +11 -0
- package/templates/AGENTS.md +19 -6
- package/templates/agent-docs/_index.md +8 -6
- package/templates/agent-docs/_manifest.json +31 -15
- package/templates/agent-docs/ai.md +2 -2
- package/templates/agent-docs/authentication.md +1 -1
- package/templates/agent-docs/cli.md +97 -15
- package/templates/agent-docs/configuration.md +17 -0
- package/templates/agent-docs/data.md +680 -33
- package/templates/agent-docs/database/advancedqueries.md +7 -7
- package/templates/agent-docs/database/columntypes.md +2 -2
- package/templates/agent-docs/database/querying.md +1 -1
- package/templates/agent-docs/database/schema.md +2 -2
- package/templates/agent-docs/database/seedsdialects.md +2 -2
- package/templates/agent-docs/database/transactions.md +3 -3
- package/templates/agent-docs/deployment.md +30 -3
- package/templates/agent-docs/internationalization.md +2 -2
- package/templates/agent-docs/introduction.md +52 -0
- package/templates/agent-docs/local-first-mobile.md +132 -7
- package/templates/agent-docs/observability.md +2 -0
- package/templates/agent-docs/plugins/ai-flows.md +1 -1
- package/templates/agent-docs/plugins/audit.md +5 -5
- package/templates/agent-docs/plugins/auth.md +1 -1
- package/templates/agent-docs/plugins/cdc-out.md +2 -2
- package/templates/agent-docs/plugins/comments.md +142 -0
- package/templates/agent-docs/plugins/notifications.md +47 -4
- package/templates/agent-docs/plugins/presence.md +16 -3
- package/templates/agent-docs/plugins/prometheus.md +1 -1
- package/templates/agent-docs/plugins/queue.md +129 -0
- package/templates/agent-docs/plugins/{versioning.md → row-history.md} +22 -22
- package/templates/agent-docs/plugins/storage.md +2 -2
- package/templates/agent-docs/plugins.md +38 -12
- package/templates/agent-docs/reference.md +54 -5
- package/templates/agent-docs/routing.md +868 -50
- package/templates/agent-docs/schema-driven-ui.md +292 -5
- package/templates/agent-docs/security.md +125 -8
- package/templates/agent-docs/templates/apibackends.md +14 -14
- package/templates/agent-docs/templates/overview.md +1 -1
- package/templates/agent-docs/whats-new.md +171 -54
- package/templates/apps/api-ai/package.json +6 -7
- package/templates/apps/api-ai/tests/summarize.test.ts +1 -1
- 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 -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-versioning → api-row-history}/README.md +3 -3
- package/templates/apps/{api-versioning → api-row-history}/actions/documents.asOf.action.server.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/actions/documents.history.action.server.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/app.config.ts +3 -3
- package/templates/apps/{api-versioning → api-row-history}/database/schema.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/mutations/documents.create.mutation.server.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/mutations/documents.create.mutation.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/mutations/documents.update.mutation.ts +1 -1
- package/templates/apps/{api-versioning → api-row-history}/package.json +8 -8
- package/templates/apps/api-row-history/template.json +6 -0
- package/templates/apps/{api-versioning → api-row-history}/tests/documents.create.test.ts +1 -1
- package/templates/apps/api-saas/app.config.ts +1 -0
- package/templates/apps/api-saas/package.json +10 -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/app.config.ts +26 -2
- package/templates/apps/changelog/content/releases/{0.1.0.mdx → v0-1-0.mdx} +0 -1
- package/templates/apps/changelog/content/releases/{0.2.0.mdx → v0-2-0.mdx} +0 -1
- package/templates/apps/changelog/package.json +8 -8
- package/templates/apps/changelog/src/collections/releases.collection.ts +48 -0
- package/templates/apps/changelog/src/globals.d.ts +1 -1
- package/templates/apps/changelog/src/locales/de.ts +1 -1
- package/templates/apps/changelog/src/locales/en.ts +1 -1
- package/templates/apps/changelog/src/pages/[locale]/[slug]/page.tsx +7 -4
- package/templates/apps/changelog/src/pages/[locale]/mirrors.test.tsx +13 -41
- package/templates/apps/changelog/src/pages/[slug]/page.test.tsx +26 -51
- package/templates/apps/changelog/src/pages/[slug]/page.tsx +21 -19
- package/templates/apps/changelog/src/pages/page.test.tsx +14 -37
- package/templates/apps/changelog/src/pages/page.tsx +18 -12
- 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-collab/src/pages/page.test.tsx +10 -9
- package/templates/apps/frontend-collab/src/pages/page.tsx +42 -65
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/content/docs/de/guides/first-page.md +4 -0
- package/templates/apps/frontend-docs/content/docs/de/intro/getting-started.md +4 -0
- package/templates/apps/frontend-docs/content/docs/en/guides/first-page.md +4 -0
- package/templates/apps/frontend-docs/content/docs/en/intro/getting-started.md +4 -0
- package/templates/apps/frontend-docs/package.json +8 -7
- package/templates/apps/frontend-docs/src/collections/docs.collection.ts +21 -0
- package/templates/apps/frontend-docs/src/locales/de.ts +0 -5
- package/templates/apps/frontend-docs/src/locales/en.ts +0 -5
- package/templates/apps/frontend-docs/src/pages/[locale]/docs/[...slug]/page.tsx +17 -9
- package/templates/apps/frontend-docs/src/pages/[locale]/mirrors.test.tsx +10 -5
- package/templates/apps/frontend-docs/src/pages/[locale]/page.tsx +8 -0
- package/templates/apps/frontend-docs/src/pages/docs/[...slug]/page.test.tsx +53 -15
- package/templates/apps/frontend-docs/src/pages/docs/[...slug]/page.tsx +27 -33
- package/templates/apps/frontend-docs/src/pages/page.test.tsx +17 -3
- package/templates/apps/frontend-docs/src/pages/page.tsx +16 -12
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +6 -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/content/posts/cms-to-ssg.md +12 -0
- package/templates/apps/frontend-static-blog/content/posts/hello-static.md +12 -0
- package/templates/apps/frontend-static-blog/content/posts/islands-not-hydration.md +14 -0
- package/templates/apps/frontend-static-blog/package.json +8 -6
- package/templates/apps/frontend-static-blog/src/collections/posts.collection.ts +27 -0
- package/templates/apps/frontend-static-blog/src/pages/[locale]/blog/[slug]/page.tsx +7 -4
- package/templates/apps/frontend-static-blog/src/pages/[locale]/mirrors.test.tsx +7 -1
- package/templates/apps/frontend-static-blog/src/pages/blog/[slug]/page.test.tsx +19 -9
- package/templates/apps/frontend-static-blog/src/pages/blog/[slug]/page.tsx +19 -21
- package/templates/apps/frontend-static-blog/src/pages/page.test.tsx +18 -5
- package/templates/apps/frontend-static-blog/src/pages/page.tsx +21 -14
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +4 -4
- package/dist/agentsMd-Bu_XQgVf.js +0 -2
- package/dist/apiBuild-GDKuGOMV.js +0 -2
- package/dist/build-DETLZAFt.js +0 -752
- package/dist/checkCommand-CWcnDArJ.js +0 -2
- package/dist/codegen-DiMn2KkZ.js +0 -2
- package/dist/dbCommand-C27HIsGE.js +0 -2
- package/dist/dev-CK522MV5.js +0 -3
- package/dist/doctorCommand-BK4l18eG.js +0 -2
- package/dist/fileConventions-Cof68_BL.js +0 -33
- package/dist/frameworkTableAssembly-CVDB2hCq.js +0 -2
- package/dist/inspect-CuGDYES0.js +0 -2
- package/dist/inspectMetrics-CfdKLh6t.js +0 -72
- package/dist/manifestBuild-CPjhvM62.js +0 -2
- package/dist/serveCommand-BRnPCxVd.js +0 -2
- package/dist/serveCommand-DdiYNBBu.js +0 -2362
- package/dist/start-BLNmWkLa.js +0 -1154
- package/dist/start-Dzicuyw8.js +0 -3
- package/dist/updateCommand-eXB35SEv.js +0 -2
- package/dist/webDev-DposiF3j.js +0 -2
- package/templates/apps/api-versioning/template.json +0 -6
- package/templates/apps/changelog/scripts/generate-rss.mjs +0 -38
- package/templates/apps/changelog/src/lib/releases.ts +0 -21
- package/templates/apps/frontend-static-blog/src/content/posts.ts +0 -64
- /package/templates/apps/{api-versioning → api-row-history}/actions/documents.asOf.action.ts +0 -0
- /package/templates/apps/{api-versioning → api-row-history}/actions/documents.history.action.ts +0 -0
- /package/templates/apps/{api-versioning → api-row-history}/mutations/documents.update.mutation.server.ts +0 -0
- /package/templates/apps/{api-versioning → api-row-history}/tsconfig.json +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { join as e } from "node:path";
|
|
2
|
+
import { mkdir as t, readFile as n, stat as r, writeFile as i } from "node:fs/promises";
|
|
3
|
+
import { createHash as a } from "node:crypto";
|
|
4
|
+
//#region src/imagePipeline.ts
|
|
5
|
+
var o = [
|
|
6
|
+
640,
|
|
7
|
+
750,
|
|
8
|
+
828,
|
|
9
|
+
1080,
|
|
10
|
+
1200,
|
|
11
|
+
1920,
|
|
12
|
+
2048,
|
|
13
|
+
3840
|
|
14
|
+
], s = {
|
|
15
|
+
formats: ["avif", "webp"],
|
|
16
|
+
quality: 75
|
|
17
|
+
}, c = (e) => ({
|
|
18
|
+
formats: e?.formats !== void 0 && e.formats.length > 0 ? e.formats.filter((e) => e === "avif" || e === "webp") : s.formats,
|
|
19
|
+
quality: e?.quality !== void 0 && Number.isFinite(e.quality) && e.quality >= 1 && e.quality <= 100 ? Math.round(e.quality) : s.quality
|
|
20
|
+
}), l, u = !1, d, f = async () => {
|
|
21
|
+
if (l !== void 0) return l;
|
|
22
|
+
try {
|
|
23
|
+
let e = await import("sharp");
|
|
24
|
+
l = e.default ?? e;
|
|
25
|
+
} catch (e) {
|
|
26
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
27
|
+
d = t.includes("Could not load the sharp module") ? {
|
|
28
|
+
reason: "binary-missing",
|
|
29
|
+
detail: t
|
|
30
|
+
} : {
|
|
31
|
+
reason: "not-installed",
|
|
32
|
+
detail: t
|
|
33
|
+
}, l = null;
|
|
34
|
+
}
|
|
35
|
+
return l;
|
|
36
|
+
}, p = () => d, m = (e) => {
|
|
37
|
+
if (u) return;
|
|
38
|
+
u = !0;
|
|
39
|
+
let t = d?.reason === "binary-missing" ? "sharp is installed but its platform binary is missing (an install that omitted optional dependencies drops the @img/* prebuilds). Reinstall without omitting optional deps, or run `pnpm add -D sharp` in this app to pin it directly." : "sharp is not installed. It ships as an optional dependency of @voltro/cli; if your installer skipped optional dependencies, run `pnpm add -D sharp` in this app.";
|
|
40
|
+
e.warn(`image pipeline: serving ORIGINAL images without srcSet variants or blur placeholders — ${t} Until then <Image> falls back to the passthrough loader.`);
|
|
41
|
+
}, h = (e, t, n, r) => `${e}-w${t}-q${r}.${n}`, g = (t) => e(t, ".framework", "image-cache"), _ = (e) => a("sha256").update(e).digest("hex").slice(0, 16), v = 4, y = 0, b = [], x = async (e) => {
|
|
42
|
+
y >= v && await new Promise((e) => b.push(e)), y += 1;
|
|
43
|
+
try {
|
|
44
|
+
return await e();
|
|
45
|
+
} finally {
|
|
46
|
+
--y, b.shift()?.();
|
|
47
|
+
}
|
|
48
|
+
}, S = async (r) => {
|
|
49
|
+
let a = await f();
|
|
50
|
+
if (!a) return null;
|
|
51
|
+
let o = e(r.cacheDir, h(r.sourceHash, r.width, r.format, r.quality));
|
|
52
|
+
try {
|
|
53
|
+
let e = await n(o);
|
|
54
|
+
return r.onCache?.("hit"), new Uint8Array(e);
|
|
55
|
+
} catch {}
|
|
56
|
+
r.onCache?.("miss");
|
|
57
|
+
let s = await x(async () => {
|
|
58
|
+
let e = await a(Buffer.from(r.sourceBytes), { failOn: "none" }).resize({
|
|
59
|
+
width: r.width,
|
|
60
|
+
withoutEnlargement: !0
|
|
61
|
+
}).toFormat(r.format, { quality: r.quality }).toBuffer();
|
|
62
|
+
return new Uint8Array(e);
|
|
63
|
+
});
|
|
64
|
+
return await t(r.cacheDir, { recursive: !0 }), await i(o, s), s;
|
|
65
|
+
}, C = async (e) => {
|
|
66
|
+
let t = await f();
|
|
67
|
+
if (!t) return null;
|
|
68
|
+
try {
|
|
69
|
+
let n = await t(Buffer.from(e), { failOn: "none" }).metadata();
|
|
70
|
+
return n.width === void 0 || n.height === void 0 || n.format === void 0 ? null : {
|
|
71
|
+
width: n.width,
|
|
72
|
+
height: n.height,
|
|
73
|
+
format: n.format
|
|
74
|
+
};
|
|
75
|
+
} catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}, w = async (e, t, n) => {
|
|
79
|
+
let r = await S({
|
|
80
|
+
sourceBytes: e,
|
|
81
|
+
sourceHash: t,
|
|
82
|
+
width: 16,
|
|
83
|
+
format: "webp",
|
|
84
|
+
quality: 40,
|
|
85
|
+
cacheDir: n
|
|
86
|
+
});
|
|
87
|
+
return r === null ? null : `data:image/webp;base64,${Buffer.from(r).toString("base64")}`;
|
|
88
|
+
}, T = (e) => [...o.filter((t) => t < e), e], E = async (e) => {
|
|
89
|
+
let t = await C(e.sourceBytes);
|
|
90
|
+
if (t === null) return null;
|
|
91
|
+
let n = _(e.sourceBytes), r = T(t.width), i = t.format === "png" ? "png" : "jpeg", a = [...e.config.formats, i], o = [];
|
|
92
|
+
for (let t of a) for (let i of r) {
|
|
93
|
+
let r = await S({
|
|
94
|
+
sourceBytes: e.sourceBytes,
|
|
95
|
+
sourceHash: n,
|
|
96
|
+
width: i,
|
|
97
|
+
format: t,
|
|
98
|
+
quality: e.config.quality,
|
|
99
|
+
cacheDir: e.cacheDir,
|
|
100
|
+
...e.onCache === void 0 ? {} : { onCache: e.onCache }
|
|
101
|
+
});
|
|
102
|
+
if (r === null) return null;
|
|
103
|
+
o.push({
|
|
104
|
+
width: i,
|
|
105
|
+
format: t,
|
|
106
|
+
bytes: r,
|
|
107
|
+
hash: _(r)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
let s = await w(e.sourceBytes, n, e.cacheDir);
|
|
111
|
+
return s === null ? null : {
|
|
112
|
+
width: t.width,
|
|
113
|
+
height: t.height,
|
|
114
|
+
blurDataURL: s,
|
|
115
|
+
widths: r,
|
|
116
|
+
variants: o,
|
|
117
|
+
fallbackFormat: i
|
|
118
|
+
};
|
|
119
|
+
}, D = async (e) => {
|
|
120
|
+
try {
|
|
121
|
+
return (await r(e)).isFile() ? new Uint8Array(await n(e)) : null;
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
//#endregion
|
|
127
|
+
export { g as a, f as c, S as d, m as f, E as i, D as l, o as n, c as o, T as p, w as r, C as s, s as t, p as u };
|
package/dist/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { o as r } from "./updateCommand-C_8I8Rzo.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "./inspectGateHint-
|
|
1
|
+
import { n as e } from "./inspectGateHint-4LxkNtrz.js";
|
|
2
2
|
import { lastWriteProvenance as t } from "@voltro/runtime";
|
|
3
3
|
import { timingSafeStringEqual as n } from "@voltro/protocol/session";
|
|
4
4
|
//#region src/inspect.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/inspectGateHint.ts
|
|
2
|
-
var e = (e) => e === 401 || e === 403, t = (e) => e === 403 ? "The inspect surface rejected the credential. VOLTRO_INSPECT_TOKEN must be set on the SERVER and in this shell, and the two values must match. (This is a framework gate, not a database permission.)" : "The inspect surface is gated and this request carried no credential. Set VOLTRO_INSPECT_TOKEN on the server and in this shell (same value), or pass --token.", n = "`voltro dev` mints VOLTRO_INSPECT_WRITE_TOKEN into the project's gitignored .env.local, so read the value from there and send it in this shell; outside dev nothing mints it and
|
|
2
|
+
var e = (e) => e === 401 || e === 403, t = (e) => e === 403 ? "The inspect surface rejected the credential. VOLTRO_INSPECT_TOKEN must be set on the SERVER and in this shell, and the two values must match. (This is a framework gate, not a database permission.)" : "The inspect surface is gated and this request carried no credential. Set VOLTRO_INSPECT_TOKEN on the server and in this shell (same value), or pass --token.", n = "`voltro dev` mints VOLTRO_INSPECT_WRITE_TOKEN into the project's gitignored .env.local, so read the value from there and send it in this shell; outside dev nothing mints it — generate one with `voltro secret generate inspect-write` and set it explicitly on both sides.", r = (e, t) => {
|
|
3
3
|
let r = `inspect: ${(t || "unknown-method").toUpperCase()} is a mutating request and needs the WRITE credential — VOLTRO_INSPECT_WRITE_TOKEN, sent as the \`x-voltro-inspect-write\` header alongside the bearer. The read token authorises reads only.`;
|
|
4
4
|
return e === "unset" ? `${r} The SERVER has none configured, so no header can satisfy this. Mutating inspect endpoints (GDPR erase/export, storage share/revoke, schedule fire) need their own secret. ${n}` : e === "mismatch" ? `${r} The header was sent and does not match the server's value — so this is the two values disagreeing, not a missing setting. ${n}` : `${r} This request carried no such header. ${n}`;
|
|
5
5
|
};
|
|
@@ -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-
|
|
4
|
-
import { a, i as o } from "./projectScaffold-
|
|
3
|
+
import { n as i } from "./renderProfile-CskIgAfn.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";
|
|
@@ -141,7 +141,13 @@ var v = /* @__PURE__ */ new Set([
|
|
|
141
141
|
env: "VOLTRO_INSPECT_TOKEN",
|
|
142
142
|
encoding: "base64url",
|
|
143
143
|
bytes: 32,
|
|
144
|
-
note: "bearer token for /_voltro/inspect/*"
|
|
144
|
+
note: "bearer token for /_voltro/inspect/* (reads)"
|
|
145
|
+
},
|
|
146
|
+
"inspect-write": {
|
|
147
|
+
env: "VOLTRO_INSPECT_WRITE_TOKEN",
|
|
148
|
+
encoding: "base64url",
|
|
149
|
+
bytes: 32,
|
|
150
|
+
note: "second factor for MUTATING inspect endpoints (x-voltro-inspect-write header)"
|
|
145
151
|
},
|
|
146
152
|
webhook: {
|
|
147
153
|
env: "VOLTRO_WEBHOOK_SECRET_<ID>",
|
|
@@ -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-
|
|
4
|
+
import { g as i, n as a, s as o } from "./frameworkTableAssembly-DKx3ba3S.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-
|
|
82
|
+
let { runDbCommand: t } = await import("./dbCommand-B1EXBC6f.js");
|
|
83
83
|
return t(["apply", ...e]);
|
|
84
84
|
};
|
|
85
85
|
//#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,
|
|
3
|
+
import { b as i, x as a } from "./fileConventions-DASGEmj-.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";
|
|
@@ -38,7 +38,7 @@ var _ = d({ scope: "voltro:privacy" }), v = /* @__PURE__ */ new Set([
|
|
|
38
38
|
return await r(e), n;
|
|
39
39
|
}, x = (e) => typeof e == "object" && !!e && "tableName" in e && "fields" in e && typeof e.tableName == "string", S = async (e) => {
|
|
40
40
|
f();
|
|
41
|
-
let t = 0, n = 0, r = [...await b(e,
|
|
41
|
+
let t = 0, n = 0, r = [...await b(e, a), ...await b(e, i)];
|
|
42
42
|
for (let e of r) {
|
|
43
43
|
let r;
|
|
44
44
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e, t } from "./inspectGateHint-
|
|
1
|
+
import { r as e, t } from "./inspectGateHint-4LxkNtrz.js";
|
|
2
2
|
import { n } from "./cliOutput-D1tSBoRM.js";
|
|
3
3
|
import { n as r, o as i, r as a, t as o } from "./inspectFetch-EMuhTG_9.js";
|
|
4
4
|
import { ansi as s } from "@voltro/logger";
|
|
@@ -57,25 +57,84 @@ server and in this shell.`);
|
|
|
57
57
|
verdict: "refused",
|
|
58
58
|
detail: `refused (${a})`
|
|
59
59
|
};
|
|
60
|
-
}, d = 0, f = (e) => ({
|
|
60
|
+
}, d = 0, f = (e, t) => ({
|
|
61
61
|
_tag: "Request",
|
|
62
62
|
id: String(++d),
|
|
63
63
|
tag: e,
|
|
64
|
-
payload:
|
|
64
|
+
payload: t,
|
|
65
65
|
headers: []
|
|
66
|
-
}), p =
|
|
67
|
-
|
|
66
|
+
}), p = (e, t = 0) => {
|
|
67
|
+
if (t > 6 || typeof e != "object" || !e) return;
|
|
68
|
+
let n = e;
|
|
69
|
+
switch (n._tag) {
|
|
70
|
+
case "StringKeyword": return "probe";
|
|
71
|
+
case "NumberKeyword": return 0;
|
|
72
|
+
case "BooleanKeyword": return !1;
|
|
73
|
+
case "BigIntKeyword": return "0";
|
|
74
|
+
case "UnknownKeyword":
|
|
75
|
+
case "AnyKeyword":
|
|
76
|
+
case "ObjectKeyword": return {};
|
|
77
|
+
case "VoidKeyword":
|
|
78
|
+
case "UndefinedKeyword": return;
|
|
79
|
+
case "Literal": return n.literal;
|
|
80
|
+
case "Enums": return n.enums?.[0]?.[1];
|
|
81
|
+
case "TypeLiteral": {
|
|
82
|
+
let e = {};
|
|
83
|
+
for (let r of n.propertySignatures ?? []) {
|
|
84
|
+
if (r.isOptional === !0) continue;
|
|
85
|
+
let n = p(r.type, t + 1);
|
|
86
|
+
if (n === void 0) return;
|
|
87
|
+
e[String(r.name)] = n;
|
|
88
|
+
}
|
|
89
|
+
return e;
|
|
90
|
+
}
|
|
91
|
+
case "TupleType": {
|
|
92
|
+
if ((n.elements ?? []).length === 0) return [];
|
|
93
|
+
let e = (n.elements ?? []).map((e) => p(e.type ?? e, t + 1));
|
|
94
|
+
return e.some((e) => e === void 0) ? void 0 : e;
|
|
95
|
+
}
|
|
96
|
+
case "Union":
|
|
97
|
+
for (let e of n.types ?? []) {
|
|
98
|
+
let n = p(e, t + 1);
|
|
99
|
+
if (n !== void 0) return n;
|
|
100
|
+
}
|
|
101
|
+
(n.types ?? []).some((e) => e._tag === "UndefinedKeyword");
|
|
102
|
+
return;
|
|
103
|
+
case "Refinement":
|
|
104
|
+
case "Transformation": return p(n.from, t + 1);
|
|
105
|
+
case "Suspend": return;
|
|
106
|
+
default: return;
|
|
107
|
+
}
|
|
108
|
+
}, m = async (e) => {
|
|
109
|
+
let t = /* @__PURE__ */ new Map();
|
|
110
|
+
try {
|
|
111
|
+
let { walk: n, loadDiscovered: r } = await import("./dev-GjJWAYo2.js"), i = await r(await n(e)), a = [
|
|
112
|
+
...i.queries,
|
|
113
|
+
...i.mutations,
|
|
114
|
+
...i.actions,
|
|
115
|
+
...i.streams
|
|
116
|
+
];
|
|
117
|
+
for (let e of a) {
|
|
118
|
+
let n = e.descriptor.input;
|
|
119
|
+
if (n?.ast === void 0) continue;
|
|
120
|
+
let r = p(n.ast);
|
|
121
|
+
r !== void 0 && t.set(e.descriptor.name, r);
|
|
122
|
+
}
|
|
123
|
+
} catch {}
|
|
124
|
+
return t;
|
|
125
|
+
}, h = async (e, t, n) => {
|
|
126
|
+
let { verdict: r, detail: i } = u(await o(e, "/rpc", {
|
|
68
127
|
method: "POST",
|
|
69
|
-
body: f(t.tag),
|
|
128
|
+
body: f(t.tag, n),
|
|
70
129
|
anonymous: !0
|
|
71
130
|
}));
|
|
72
131
|
return {
|
|
73
132
|
tag: t.tag,
|
|
74
133
|
kind: t.kind,
|
|
75
|
-
verdict:
|
|
76
|
-
detail:
|
|
134
|
+
verdict: r,
|
|
135
|
+
detail: i
|
|
77
136
|
};
|
|
78
|
-
},
|
|
137
|
+
}, g = (e, t, r, i) => {
|
|
79
138
|
let a = t.filter((e) => e.verdict === "admitted"), o = t.filter((e) => e.verdict === "inconclusive"), c = t.filter((e) => e.verdict === "refused");
|
|
80
139
|
if (r === "json") n({
|
|
81
140
|
app: e,
|
|
@@ -107,28 +166,28 @@ server and in this shell.`);
|
|
|
107
166
|
There an anonymous request carries \`tenantId: null\`, which is the case a guard
|
|
108
167
|
has to refuse — and the case a tenant-keyed role map most easily gets wrong.`), 1) : i && o.length > 0 ? (r !== "json" && console.error(`\n${s.yellow("--strict:")} ${o.length} procedure(s) could not be judged.\n Their calls failed before the guard was reached (usually payload validation).
|
|
109
168
|
That is not evidence of enforcement, so under --strict it is not a pass.`), 1) : 0;
|
|
110
|
-
},
|
|
169
|
+
}, _ = async (n) => {
|
|
111
170
|
let c = r(n);
|
|
112
171
|
if ("error" in c) return console.error(`voltro probe access: ${c.error}`), 1;
|
|
113
|
-
let { format: u } = c, { process: d, target: f, rest:
|
|
114
|
-
if (
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
117
|
-
let
|
|
118
|
-
for (let n of
|
|
172
|
+
let { format: u } = c, { process: d, target: f, rest: p, error: _ } = a(c.rest);
|
|
173
|
+
if (_ !== void 0) return console.error(`voltro probe access: ${_}`), 1;
|
|
174
|
+
let v = p.includes("--strict"), y = await i(d, f);
|
|
175
|
+
if (y.length === 0) return console.error("voltro probe access: no live api found.\n This command asks a RUNNING app what it does — there is nothing to ask a source tree.\n Start one (`voltro dev` / `voltro serve`), or address it directly with --url."), 1;
|
|
176
|
+
let b = 0;
|
|
177
|
+
for (let n of y) {
|
|
119
178
|
let r = await o(n, "/_voltro/inspect/manifest");
|
|
120
179
|
if (r.kind === "err" || r.status < 200 || r.status >= 300) {
|
|
121
|
-
console.error(`${s.red("✗")} ${n.name}: could not read the manifest — ${r.kind === "err" ? r.error : `HTTP ${r.status}`}`), r.kind === "ok" && e(r.status) && console.error(` ${t(r.status)}`),
|
|
180
|
+
console.error(`${s.red("✗")} ${n.name}: could not read the manifest — ${r.kind === "err" ? r.error : `HTTP ${r.status}`}`), r.kind === "ok" && e(r.status) && console.error(` ${t(r.status)}`), b = 1;
|
|
122
181
|
continue;
|
|
123
182
|
}
|
|
124
|
-
let i = l(r.data?.procedures ?? []), a = [];
|
|
125
|
-
for (let e of i)
|
|
126
|
-
|
|
183
|
+
let i = l(r.data?.procedures ?? []), a = await m(process.cwd()), c = [];
|
|
184
|
+
for (let e of i) c.push(await h(n, e, a.get(e.tag) ?? {}));
|
|
185
|
+
b = Math.max(b, g(n.name, c, u, v));
|
|
127
186
|
}
|
|
128
|
-
return
|
|
129
|
-
},
|
|
187
|
+
return b;
|
|
188
|
+
}, v = async (e) => {
|
|
130
189
|
let [t, ...n] = e;
|
|
131
|
-
return t === void 0 || t === "--help" || t === "-h" ? (c(), +(t === void 0)) : t === "access" ?
|
|
190
|
+
return t === void 0 || t === "--help" || t === "-h" ? (c(), +(t === void 0)) : t === "access" ? _(n) : (console.error(`voltro probe: unknown subcommand "${t}" (expected: access)`), 1);
|
|
132
191
|
};
|
|
133
192
|
//#endregion
|
|
134
|
-
export {
|
|
193
|
+
export { v as runProbeCommand };
|
|
@@ -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-
|
|
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-
|
|
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(
|
|
11
|
-
e.set(
|
|
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
|
|
18
|
-
for (let
|
|
19
|
-
return
|
|
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() {
|
|
@@ -67,7 +73,9 @@ var n = () => {
|
|
|
67
73
|
interactive: e.interactive ?? "full",
|
|
68
74
|
hasLoader: typeof e.loader == "function",
|
|
69
75
|
hasMeta: e.meta != null,
|
|
70
|
-
hasGetStaticPaths: typeof e.getStaticPaths == "function"
|
|
76
|
+
hasGetStaticPaths: typeof e.getStaticPaths == "function",
|
|
77
|
+
hasOgImage: typeof e.ogImage == "function",
|
|
78
|
+
ppr: e.ppr === !0
|
|
71
79
|
}), m = /export\s+const\s+renderMode\s*(?::[^=]+)?=\s*['"]([^'"]*)['"]/, h = (e) => m.exec(e)?.[1] ?? null, g = /export\s*\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/g, _ = (e) => {
|
|
72
80
|
g.lastIndex = 0;
|
|
73
81
|
let t;
|
|
@@ -88,7 +96,16 @@ var n = () => {
|
|
|
88
96
|
if ((t === -1 ? e : e.slice(t + 4)).trim() === "default") return !0;
|
|
89
97
|
}
|
|
90
98
|
return !1;
|
|
91
|
-
}, b =
|
|
99
|
+
}, b = (e) => {
|
|
100
|
+
if (/^export const searchParams\b/m.test(e)) return !0;
|
|
101
|
+
v.lastIndex = 0;
|
|
102
|
+
let t;
|
|
103
|
+
for (; (t = v.exec(e)) !== null;) for (let e of t[1].split(",")) {
|
|
104
|
+
let t = e.lastIndexOf(" as ");
|
|
105
|
+
if ((t === -1 ? e : e.slice(t + 4)).trim() === "searchParams") return !0;
|
|
106
|
+
}
|
|
107
|
+
return !1;
|
|
108
|
+
}, x = async (n, r) => {
|
|
92
109
|
let i = (await Promise.all(r.map(async (r) => {
|
|
93
110
|
let i;
|
|
94
111
|
try {
|
|
@@ -97,9 +114,9 @@ var n = () => {
|
|
|
97
114
|
return null;
|
|
98
115
|
}
|
|
99
116
|
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.`;
|
|
117
|
+
return a !== null && !c(a) ? u(e("src", "pages", r.file), a) : a === "isr" && b(i) ? `${e("src", "pages", r.file)} declares BOTH renderMode 'isr' and a \`searchParams\` schema.\n\n The isr cache is keyed by path (plus tenant+locale) — the query string is not part of\n the key, so the first request's variant would be cached and served for every other\n query. A page whose render varies by search params cannot be isr-cached safely.\n\n Fix: use \`renderMode: 'ssr'\` (per-request render, params fully honoured), or remove\n the \`searchParams\` export and read the query client-side only.` : y(i) ? null : `${e("src", "pages", r.file)} is a route (a \`page.tsx\` under src/pages/) but exports no default.\n\n A page's default export IS its component — the router has nothing to render without it,\n and the failure would otherwise surface only in \`voltro build\`'s prerender as\n "SSR received a descriptor with no Component", long after the file was written.\n\n Fix: \`export default function Page() { … }\`, or re-export another page's component\n (\`export { default } from '../page'\`). If this file is NOT a route, rename it —\n only the reserved names route, and anything else under src/pages/ is ordinary code\n that may live beside the page that uses it.`;
|
|
101
118
|
}))).filter((e) => e !== null);
|
|
102
119
|
if (i.length !== 0) throw Error(i.join("\n\n"));
|
|
103
120
|
};
|
|
104
121
|
//#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,
|
|
122
|
+
export { p as a, f as c, o as d, n as f, s as i, i as l, h as n, c as o, r as p, _ as r, u as s, x as t, a as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as t, n, o as r, r as i, s as a } from "./renderModeScan-
|
|
1
|
+
import { h as e } from "./fileConventions-DASGEmj-.js";
|
|
2
|
+
import { i as t, n, o as r, r as i, s as a } from "./renderModeScan-CUbOeOAg.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-
|
|
1
|
+
import { n as e } from "./apiBuild-CaPfoWku.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-
|
|
425
|
+
let { offlineManifest: t } = await import("./checkCommand-D2ZduVlh.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), {
|